From bf1ee5366c8ab28d817c4b71a6ee8f11bc67d3cf Mon Sep 17 00:00:00 2001 From: Karsten Hopp Date: Jul 17 2013 09:21:25 +0000 Subject: Merge remote-tracking branch 'fedora/master' into rhel-7.0 --- diff --git a/7.3.1000 b/7.3.1000 new file mode 100644 index 0000000..c9164ff --- /dev/null +++ b/7.3.1000 @@ -0,0 +1,55 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1000 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1000 (whoa!) +Problem: Typo in char value causes out of bounds access. +Solution: Fix character value. (Klemens Baum) +Files: src/regexp.c + + +*** ../vim-7.3.999/src/regexp.c 2013-05-21 00:02:54.000000000 +0200 +--- src/regexp.c 2013-05-21 21:25:58.000000000 +0200 +*************** +*** 6899,6905 **** + { + decomp_T d; + +! if (c >= 0x4b20 && c <= 0xfb4f) + { + d = decomp_table[c - 0xfb20]; + *c1 = d.a; +--- 6899,6905 ---- + { + decomp_T d; + +! if (c >= 0xfb20 && c <= 0xfb4f) + { + d = decomp_table[c - 0xfb20]; + *c1 = d.a; +*** ../vim-7.3.999/src/version.c 2013-05-21 21:20:16.000000000 +0200 +--- src/version.c 2013-05-21 21:22:14.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1000, + /**/ + +-- +ARTHUR: The swallow may fly south with the sun, or the house martin or the + plover seek warmer hot lands in winter, yet these are not strangers to + our land. +SOLDIER: Are you suggesting coconuts migrate? + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// 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 /// diff --git a/7.3.1001 b/7.3.1001 new file mode 100644 index 0000000..a968fd7 --- /dev/null +++ b/7.3.1001 @@ -0,0 +1,54 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1001 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1001 +Problem: Duplicate condition in if. +Solution: Remove one condition. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1000/src/regexp_nfa.c 2013-05-21 21:20:16.000000000 +0200 +--- src/regexp_nfa.c 2013-05-21 21:56:45.000000000 +0200 +*************** +*** 1091,1097 **** + { + nfa_inc(®parse); + +! if (*regparse == 'n' || *regparse == 'n') + startc = reg_string ? NL : NFA_NEWL; + else + if (*regparse == 'd' +--- 1091,1097 ---- + { + nfa_inc(®parse); + +! if (*regparse == 'n') + startc = reg_string ? NL : NFA_NEWL; + else + if (*regparse == 'd' +*** ../vim-7.3.1000/src/version.c 2013-05-21 21:37:01.000000000 +0200 +--- src/version.c 2013-05-21 21:59:09.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1001, + /**/ + +-- +SECOND SOLDIER: It could be carried by an African swallow! +FIRST SOLDIER: Oh yes! An African swallow maybe ... but not a European + swallow. that's my point. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// 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 /// diff --git a/7.3.1002 b/7.3.1002 new file mode 100644 index 0000000..d76c573 --- /dev/null +++ b/7.3.1002 @@ -0,0 +1,178 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1002 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1002 +Problem: Valgrind errors for Python interface. +Solution: Fix memory leaks when running tests. (ZyX) +Files: src/if_py_both.h + + +*** ../vim-7.3.1001/src/if_py_both.h 2013-05-21 20:51:55.000000000 +0200 +--- src/if_py_both.h 2013-05-21 22:08:25.000000000 +0200 +*************** +*** 866,871 **** +--- 866,872 ---- + DICTKEY_UNREF + + copy_tv(&tv, &di->di_tv); ++ clear_tv(&tv); + return 0; + } + +*************** +*** 1129,1134 **** +--- 1130,1136 ---- + { + if (list_append_tv(l, &tv) == FAIL) + { ++ clear_tv(&tv); + PyErr_SetVim(_("Failed to add item to list")); + return -1; + } +*************** +*** 1138,1143 **** +--- 1140,1146 ---- + li = list_find(l, (long) index); + clear_tv(&li->li_tv); + copy_tv(&tv, &li->li_tv); ++ clear_tv(&tv); + } + return 0; + } +*************** +*** 1204,1212 **** +--- 1207,1217 ---- + return -1; + if (list_insert_tv(l, &v, li) == FAIL) + { ++ clear_tv(&v); + PyErr_SetVim(_("internal error: failed to add item to list")); + return -1; + } ++ clear_tv(&v); + } + return 0; + } +*************** +*** 1346,1352 **** +--- 1351,1360 ---- + return NULL; + } + if (ConvertFromPyObject(selfdictObject, &selfdicttv) == -1) ++ { ++ clear_tv(&args); + return NULL; ++ } + selfdict = selfdicttv.vval.v_dict; + } + } +*************** +*** 1370,1382 **** + else + result = ConvertToPyObject(&rettv); + +- /* FIXME Check what should really be cleared. */ + clear_tv(&args); + clear_tv(&rettv); +! /* +! * if (selfdict!=NULL) +! * clear_tv(selfdicttv); +! */ + + return result; + } +--- 1378,1387 ---- + else + result = ConvertToPyObject(&rettv); + + clear_tv(&args); + clear_tv(&rettv); +! if (selfdict != NULL) +! clear_tv(&selfdicttv); + + return result; + } +*************** +*** 1482,1488 **** + } + else if (flags & SOPT_BOOL) + { +! PyObject *r; + r = numval ? Py_True : Py_False; + Py_INCREF(r); + return r; +--- 1487,1493 ---- + } + else if (flags & SOPT_BOOL) + { +! PyObject *r; + r = numval ? Py_True : Py_False; + Py_INCREF(r); + return r; +*************** +*** 1492,1498 **** + else if (flags & SOPT_STRING) + { + if (stringval) +! return PyBytes_FromString((char *) stringval); + else + { + PyErr_SetString(PyExc_RuntimeError, +--- 1497,1507 ---- + else if (flags & SOPT_STRING) + { + if (stringval) +! { +! PyObject *r = PyBytes_FromString((char *) stringval); +! vim_free(stringval); +! return r; +! } + else + { + PyErr_SetString(PyExc_RuntimeError, +*************** +*** 1516,1524 **** + int opt_type; + void *from; + { +! win_T *save_curwin; +! tabpage_T *save_curtab; +! buf_T *save_curbuf; + + VimTryStart(); + switch (opt_type) +--- 1525,1533 ---- + int opt_type; + void *from; + { +! win_T *save_curwin = NULL; +! tabpage_T *save_curtab = NULL; +! buf_T *save_curbuf = NULL; + + VimTryStart(); + switch (opt_type) +*** ../vim-7.3.1001/src/version.c 2013-05-21 22:00:42.000000000 +0200 +--- src/version.c 2013-05-21 22:12:54.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1002, + /**/ + +-- +"I've been teaching myself to play the piano for about 5 years and now write +most of my songs on it, mainly because I can never find any paper." + Jeff Lynne, ELO's greatest hits + + /// 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 /// diff --git a/7.3.1003 b/7.3.1003 new file mode 100644 index 0000000..cd84406 --- /dev/null +++ b/7.3.1003 @@ -0,0 +1,381 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1003 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1003 +Problem: Python interface does not compile with Python 2.2 +Solution: Fix thread issues and True/False. (ZyX) +Files: src/if_py_both.h, src/if_python3.c, src/if_python.c, + src/testdir/test86.in, src/testdir/test86.ok, + src/testdir/test87.in, src/testdir/test87.ok + + +*** ../vim-7.3.1002/src/if_py_both.h 2013-05-21 22:13:36.000000000 +0200 +--- src/if_py_both.h 2013-05-21 22:16:58.000000000 +0200 +*************** +*** 31,37 **** + #define INVALID_TABPAGE_VALUE ((tabpage_T *)(-1)) + + typedef void (*rangeinitializer)(void *); +! typedef void (*runner)(const char *, void *, PyGILState_STATE *); + + static int ConvertFromPyObject(PyObject *, typval_T *); + static int _ConvertFromPyObject(PyObject *, typval_T *, PyObject *); +--- 31,41 ---- + #define INVALID_TABPAGE_VALUE ((tabpage_T *)(-1)) + + typedef void (*rangeinitializer)(void *); +! typedef void (*runner)(const char *, void * +! #ifdef PY_CAN_RECURSE +! , PyGILState_STATE * +! #endif +! ); + + static int ConvertFromPyObject(PyObject *, typval_T *); + static int _ConvertFromPyObject(PyObject *, typval_T *, PyObject *); +*************** +*** 3489,3495 **** + } + + static void +! run_cmd(const char *cmd, void *arg UNUSED, PyGILState_STATE *pygilstate UNUSED) + { + PyRun_SimpleString((char *) cmd); + } +--- 3493,3503 ---- + } + + static void +! run_cmd(const char *cmd, void *arg UNUSED +! #ifdef PY_CAN_RECURSE +! , PyGILState_STATE *pygilstate UNUSED +! #endif +! ) + { + PyRun_SimpleString((char *) cmd); + } +*************** +*** 3498,3504 **** + static int code_hdr_len = 30; + + static void +! run_do(const char *cmd, void *arg UNUSED, PyGILState_STATE *pygilstate) + { + PyInt lnum; + size_t len; +--- 3506,3516 ---- + static int code_hdr_len = 30; + + static void +! run_do(const char *cmd, void *arg UNUSED +! #ifdef PY_CAN_RECURSE +! , PyGILState_STATE *pygilstate +! #endif +! ) + { + PyInt lnum; + size_t len; +*************** +*** 3528,3540 **** +--- 3540,3556 ---- + status = 0; + pymain = PyImport_AddModule("__main__"); + pyfunc = PyObject_GetAttrString(pymain, DOPY_FUNC); ++ #ifdef PY_CAN_RECURSE + PyGILState_Release(*pygilstate); ++ #endif + + for (lnum = RangeStart; lnum <= RangeEnd; ++lnum) + { + PyObject *line, *linenr, *ret; + ++ #ifdef PY_CAN_RECURSE + *pygilstate = PyGILState_Ensure(); ++ #endif + if (!(line = GetBufferLine(curbuf, lnum))) + goto err; + if (!(linenr = PyInt_FromLong((long) lnum))) +*************** +*** 3554,3570 **** +--- 3570,3592 ---- + + Py_XDECREF(ret); + PythonIO_Flush(); ++ #ifdef PY_CAN_RECURSE + PyGILState_Release(*pygilstate); ++ #endif + } + goto out; + err: ++ #ifdef PY_CAN_RECURSE + *pygilstate = PyGILState_Ensure(); ++ #endif + PyErr_PrintEx(0); + PythonIO_Flush(); + status = 1; + out: ++ #ifdef PY_CAN_RECURSE + if (!status) + *pygilstate = PyGILState_Ensure(); ++ #endif + Py_DECREF(pyfunc); + PyObject_SetAttrString(pymain, DOPY_FUNC, NULL); + if (status) +*************** +*** 3574,3580 **** + } + + static void +! run_eval(const char *cmd, typval_T *rettv, PyGILState_STATE *pygilstate UNUSED) + { + PyObject *r; + +--- 3596,3606 ---- + } + + static void +! run_eval(const char *cmd, typval_T *rettv +! #ifdef PY_CAN_RECURSE +! , PyGILState_STATE *pygilstate UNUSED +! #endif +! ) + { + PyObject *r; + +*** ../vim-7.3.1002/src/if_python3.c 2013-05-21 20:51:55.000000000 +0200 +--- src/if_python3.c 2013-05-21 22:16:58.000000000 +0200 +*************** +*** 693,698 **** +--- 693,700 ---- + + static struct PyModuleDef vimmodule; + ++ #define PY_CAN_RECURSE ++ + /* + * Include the code shared with if_python.c + */ +*** ../vim-7.3.1002/src/if_python.c 2013-05-21 20:51:55.000000000 +0200 +--- src/if_python.c 2013-05-21 22:16:58.000000000 +0200 +*************** +*** 641,647 **** + #define DICTKEY_UNREF + #define DICTKEY_DECL + +! #define DESTRUCTOR_FINISH(self) Py_TYPE(self)->tp_free((PyObject*)self); + + #define WIN_PYTHON_REF(win) win->w_python_ref + #define BUF_PYTHON_REF(buf) buf->b_python_ref +--- 641,647 ---- + #define DICTKEY_UNREF + #define DICTKEY_DECL + +! #define DESTRUCTOR_FINISH(self) self->ob_type->tp_free((PyObject*)self); + + #define WIN_PYTHON_REF(win) win->w_python_ref + #define BUF_PYTHON_REF(buf) buf->b_python_ref +*************** +*** 656,661 **** +--- 656,670 ---- + static PyObject *ListGetattr(PyObject *, char *); + static PyObject *FunctionGetattr(PyObject *, char *); + ++ #ifndef Py_VISIT ++ # define Py_VISIT(obj) visit(obj, arg) ++ #endif ++ #ifndef Py_CLEAR ++ # define Py_CLEAR(obj) \ ++ Py_XDECREF(obj); \ ++ obj = NULL; ++ #endif ++ + /* + * Include the code shared with if_python3.c + */ +*************** +*** 881,887 **** + Python_RestoreThread(); /* enter python */ + #endif + +! run((char *) cmd, arg, &pygilstate); + + #ifdef PY_CAN_RECURSE + PyGILState_Release(pygilstate); +--- 890,900 ---- + Python_RestoreThread(); /* enter python */ + #endif + +! run((char *) cmd, arg +! #ifdef PY_CAN_RECURSE +! , &pygilstate +! #endif +! ); + + #ifdef PY_CAN_RECURSE + PyGILState_Release(pygilstate); +*** ../vim-7.3.1002/src/testdir/test86.in 2013-05-21 20:40:35.000000000 +0200 +--- src/testdir/test86.in 2013-05-21 22:16:58.000000000 +0200 +*************** +*** 518,523 **** +--- 518,527 ---- + :edit c + :buffer # + py << EOF ++ try: ++ from __builtin__ import next ++ except ImportError: ++ next = lambda o: o.next() + # Check GCing iterator that was not fully exhausted + i = iter(vim.buffers) + cb.append('i:' + str(next(i))) +*************** +*** 577,591 **** + cb.append('Number of tabs: ' + str(len(vim.tabpages))) + cb.append('Current tab pages:') + def W(w): +! if '(unknown)' in repr(w): + return '' + else: + return repr(w) + for t in vim.tabpages: + cb.append(' ' + repr(t) + '(' + str(t.number) + ')' + ': ' + str(len(t.windows)) + ' windows, current is ' + W(t.window)) + cb.append(' Windows:') + for w in t.windows: +! cb.append(' ' + W(w) + '(' + str(w.number) + ')' + ': displays buffer ' + repr(w.buffer) + '; cursor is at ' + repr(w.cursor)) + # Other values depend on the size of the terminal, so they are checked partly: + for attr in ('height', 'row', 'width', 'col'): + try: +--- 581,602 ---- + cb.append('Number of tabs: ' + str(len(vim.tabpages))) + cb.append('Current tab pages:') + def W(w): +! if repr(w).find('(unknown)') != -1: + return '' + else: + return repr(w) ++ ++ def Cursor(w, start=len(cb)): ++ if w.buffer is cb: ++ return repr((start - w.cursor[0], w.cursor[1])) ++ else: ++ return repr(w.cursor) ++ + for t in vim.tabpages: + cb.append(' ' + repr(t) + '(' + str(t.number) + ')' + ': ' + str(len(t.windows)) + ' windows, current is ' + W(t.window)) + cb.append(' Windows:') + for w in t.windows: +! cb.append(' ' + W(w) + '(' + str(w.number) + ')' + ': displays buffer ' + repr(w.buffer) + '; cursor is at ' + Cursor(w)) + # Other values depend on the size of the terminal, so they are checked partly: + for attr in ('height', 'row', 'width', 'col'): + try: +*** ../vim-7.3.1002/src/testdir/test86.ok 2013-05-21 20:40:35.000000000 +0200 +--- src/testdir/test86.ok 2013-05-21 22:18:02.000000000 +0200 +*************** +*** 333,339 **** + Current tab pages: + (1): 1 windows, current is + Windows: +! (1): displays buffer ; cursor is at (990, 0) + (2): 1 windows, current is + Windows: + (1): displays buffer ; cursor is at (1, 0) +--- 333,339 ---- + Current tab pages: + (1): 1 windows, current is + Windows: +! (1): displays buffer ; cursor is at (27, 0) + (2): 1 windows, current is + Windows: + (1): displays buffer ; cursor is at (1, 0) +*** ../vim-7.3.1002/src/testdir/test87.in 2013-05-21 20:40:35.000000000 +0200 +--- src/testdir/test87.in 2013-05-21 22:16:58.000000000 +0200 +*************** +*** 561,578 **** + :vnew b.2 + :vnew c.2 + py3 << EOF + def W(w): + if '(unknown)' in repr(w): + return '' + else: + return repr(w) +! cb.append('Number of tabs: ' + str(len(vim.tabpages))) +! cb.append('Current tab pages:') + for t in vim.tabpages: + cb.append(' ' + repr(t) + '(' + str(t.number) + ')' + ': ' + str(len(t.windows)) + ' windows, current is ' + W(t.window)) + cb.append(' Windows:') + for w in t.windows: +! cb.append(' ' + W(w) + '(' + str(w.number) + ')' + ': displays buffer ' + repr(w.buffer) + '; cursor is at ' + repr(w.cursor)) + # Other values depend on the size of the terminal, so they are checked partly: + for attr in ('height', 'row', 'width', 'col'): + try: +--- 561,586 ---- + :vnew b.2 + :vnew c.2 + py3 << EOF ++ cb.append('Number of tabs: ' + str(len(vim.tabpages))) ++ cb.append('Current tab pages:') ++ + def W(w): + if '(unknown)' in repr(w): + return '' + else: + return repr(w) +! +! def Cursor(w, start=len(cb)): +! if w.buffer is cb: +! return repr((start - w.cursor[0], w.cursor[1])) +! else: +! return repr(w.cursor) +! + for t in vim.tabpages: + cb.append(' ' + repr(t) + '(' + str(t.number) + ')' + ': ' + str(len(t.windows)) + ' windows, current is ' + W(t.window)) + cb.append(' Windows:') + for w in t.windows: +! cb.append(' ' + W(w) + '(' + str(w.number) + ')' + ': displays buffer ' + repr(w.buffer) + '; cursor is at ' + Cursor(w)) + # Other values depend on the size of the terminal, so they are checked partly: + for attr in ('height', 'row', 'width', 'col'): + try: +*** ../vim-7.3.1002/src/testdir/test87.ok 2013-05-21 20:40:35.000000000 +0200 +--- src/testdir/test87.ok 2013-05-21 22:18:31.000000000 +0200 +*************** +*** 322,328 **** + Current tab pages: + (1): 1 windows, current is + Windows: +! (1): displays buffer ; cursor is at (966, 0) + (2): 1 windows, current is + Windows: + (1): displays buffer ; cursor is at (1, 0) +--- 322,328 ---- + Current tab pages: + (1): 1 windows, current is + Windows: +! (1): displays buffer ; cursor is at (27, 0) + (2): 1 windows, current is + Windows: + (1): displays buffer ; cursor is at (1, 0) +*** ../vim-7.3.1002/src/version.c 2013-05-21 22:13:36.000000000 +0200 +--- src/version.c 2013-05-21 22:19:01.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1003, + /**/ + +-- +./configure +Checking whether build environment is sane ... +build environment is grinning and holding a spatula. Guess not. + + /// 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 /// diff --git a/7.3.1004 b/7.3.1004 new file mode 100644 index 0000000..2498fe1 --- /dev/null +++ b/7.3.1004 @@ -0,0 +1,364 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1004 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1004 +Problem: No error when option could not be set. +Solution: Report an error. (ZyX) +Files: src/if_py_both.h, src/option.c, src/proto/option.pro, + src/testdir/test86.ok, src/testdir/test87.ok + + +*** ../vim-7.3.1003/src/if_py_both.h 2013-05-21 22:23:50.000000000 +0200 +--- src/if_py_both.h 2013-05-21 22:34:04.000000000 +0200 +*************** +*** 1521,1526 **** +--- 1521,1545 ---- + } + + static int ++ set_option_value_err(key, numval, stringval, opt_flags) ++ char_u *key; ++ int numval; ++ char_u *stringval; ++ int opt_flags; ++ { ++ char_u *errmsg; ++ ++ if ((errmsg = set_option_value(key, numval, stringval, opt_flags))) ++ { ++ if (VimTryEnd()) ++ return FAIL; ++ PyErr_SetVim((char *)errmsg); ++ return FAIL; ++ } ++ return OK; ++ } ++ ++ static int + set_option_value_for(key, numval, stringval, opt_flags, opt_type, from) + char_u *key; + int numval; +*************** +*** 1532,1537 **** +--- 1551,1557 ---- + win_T *save_curwin = NULL; + tabpage_T *save_curtab = NULL; + buf_T *save_curbuf = NULL; ++ int r = 0; + + VimTryStart(); + switch (opt_type) +*************** +*** 1545,1560 **** + PyErr_SetVim("Problem while switching windows."); + return -1; + } +! set_option_value(key, numval, stringval, opt_flags); + restore_win(save_curwin, save_curtab); + break; + case SREQ_BUF: + switch_buffer(&save_curbuf, (buf_T *)from); +! set_option_value(key, numval, stringval, opt_flags); + restore_buffer(save_curbuf); + break; + case SREQ_GLOBAL: +! set_option_value(key, numval, stringval, opt_flags); + break; + } + return VimTryEnd(); +--- 1565,1586 ---- + PyErr_SetVim("Problem while switching windows."); + return -1; + } +! r = set_option_value_err(key, numval, stringval, opt_flags); + restore_win(save_curwin, save_curtab); ++ if (r == FAIL) ++ return -1; + break; + case SREQ_BUF: + switch_buffer(&save_curbuf, (buf_T *)from); +! r = set_option_value_err(key, numval, stringval, opt_flags); + restore_buffer(save_curbuf); ++ if (r == FAIL) ++ return -1; + break; + case SREQ_GLOBAL: +! r = set_option_value_err(key, numval, stringval, opt_flags); +! if (r == FAIL) +! return -1; + break; + } + return VimTryEnd(); +*************** +*** 1611,1616 **** +--- 1637,1643 ---- + if (flags & SOPT_BOOL) + { + int istrue = PyObject_IsTrue(valObject); ++ + if (istrue == -1) + return -1; + r = set_option_value_for(key, istrue, NULL, +*** ../vim-7.3.1003/src/option.c 2013-05-19 19:16:25.000000000 +0200 +--- src/option.c 2013-05-21 22:34:41.000000000 +0200 +*************** +*** 3018,3024 **** + # define insecure_flag(opt_idx, opt_flags) (&options[opt_idx].flags) + #endif + static void set_string_option_global __ARGS((int opt_idx, char_u **varp)); +! static void set_string_option __ARGS((int opt_idx, char_u *value, int opt_flags)); + static char_u *did_set_string_option __ARGS((int opt_idx, char_u **varp, int new_value_alloced, char_u *oldval, char_u *errbuf, int opt_flags)); + static char_u *set_chars_option __ARGS((char_u **varp)); + #ifdef FEAT_SYN_HL +--- 3018,3024 ---- + # define insecure_flag(opt_idx, opt_flags) (&options[opt_idx].flags) + #endif + static void set_string_option_global __ARGS((int opt_idx, char_u **varp)); +! static char_u *set_string_option __ARGS((int opt_idx, char_u *value, int opt_flags)); + static char_u *did_set_string_option __ARGS((int opt_idx, char_u **varp, int new_value_alloced, char_u *oldval, char_u *errbuf, int opt_flags)); + static char_u *set_chars_option __ARGS((char_u **varp)); + #ifdef FEAT_SYN_HL +*************** +*** 5600,5607 **** + + /* + * Set a string option to a new value, and handle the effects. + */ +! static void + set_string_option(opt_idx, value, opt_flags) + int opt_idx; + char_u *value; +--- 5600,5609 ---- + + /* + * Set a string option to a new value, and handle the effects. ++ * ++ * Returns NULL on success or error message on error. + */ +! static char_u * + set_string_option(opt_idx, value, opt_flags) + int opt_idx; + char_u *value; +*************** +*** 5610,5618 **** + char_u *s; + char_u **varp; + char_u *oldval; + + if (options[opt_idx].var == NULL) /* don't set hidden option */ +! return; + + s = vim_strsave(value); + if (s != NULL) +--- 5612,5621 ---- + char_u *s; + char_u **varp; + char_u *oldval; ++ char_u *r = NULL; + + if (options[opt_idx].var == NULL) /* don't set hidden option */ +! return NULL; + + s = vim_strsave(value); + if (s != NULL) +*************** +*** 5624,5633 **** + : opt_flags); + oldval = *varp; + *varp = s; +! if (did_set_string_option(opt_idx, varp, TRUE, oldval, NULL, +! opt_flags) == NULL) + did_set_option(opt_idx, opt_flags, TRUE); + } + } + + /* +--- 5627,5637 ---- + : opt_flags); + oldval = *varp; + *varp = s; +! if ((r = did_set_string_option(opt_idx, varp, TRUE, oldval, NULL, +! opt_flags)) == NULL) + did_set_option(opt_idx, opt_flags, TRUE); + } ++ return r; + } + + /* +*************** +*** 8969,8976 **** + /* + * Set the value of option "name". + * Use "string" for string options, use "number" for other options. + */ +! void + set_option_value(name, number, string, opt_flags) + char_u *name; + long number; +--- 8973,8982 ---- + /* + * Set the value of option "name". + * Use "string" for string options, use "number" for other options. ++ * ++ * Returns NULL on success or error message on error. + */ +! char_u * + set_option_value(name, number, string, opt_flags) + char_u *name; + long number; +*************** +*** 8992,9002 **** + if (sandbox > 0 && (flags & P_SECURE)) + { + EMSG(_(e_sandbox)); +! return; + } + #endif + if (flags & P_STRING) +! set_string_option(opt_idx, string, opt_flags); + else + { + varp = get_varp_scope(&(options[opt_idx]), opt_flags); +--- 8998,9008 ---- + if (sandbox > 0 && (flags & P_SECURE)) + { + EMSG(_(e_sandbox)); +! return NULL; + } + #endif + if (flags & P_STRING) +! return set_string_option(opt_idx, string, opt_flags); + else + { + varp = get_varp_scope(&(options[opt_idx]), opt_flags); +*************** +*** 9017,9035 **** + * num option using a string. */ + EMSG3(_("E521: Number required: &%s = '%s'"), + name, string); +! return; /* do nothing as we hit an error */ + + } + } + if (flags & P_NUM) +! (void)set_num_option(opt_idx, varp, number, + NULL, 0, opt_flags); + else +! (void)set_bool_option(opt_idx, varp, (int)number, + opt_flags); + } + } + } + } + + /* +--- 9023,9042 ---- + * num option using a string. */ + EMSG3(_("E521: Number required: &%s = '%s'"), + name, string); +! return NULL; /* do nothing as we hit an error */ + + } + } + if (flags & P_NUM) +! return set_num_option(opt_idx, varp, number, + NULL, 0, opt_flags); + else +! return set_bool_option(opt_idx, varp, (int)number, + opt_flags); + } + } + } ++ return NULL; + } + + /* +*** ../vim-7.3.1003/src/proto/option.pro 2013-05-06 03:52:44.000000000 +0200 +--- src/proto/option.pro 2013-05-21 22:27:50.000000000 +0200 +*************** +*** 23,29 **** + char_u *check_stl_option __ARGS((char_u *s)); + int get_option_value __ARGS((char_u *name, long *numval, char_u **stringval, int opt_flags)); + int get_option_value_strict __ARGS((char_u *name, long *numval, char_u **stringval, int opt_type, void *from)); +! void set_option_value __ARGS((char_u *name, long number, char_u *string, int opt_flags)); + char_u *get_term_code __ARGS((char_u *tname)); + char_u *get_highlight_default __ARGS((void)); + char_u *get_encoding_default __ARGS((void)); +--- 23,29 ---- + char_u *check_stl_option __ARGS((char_u *s)); + int get_option_value __ARGS((char_u *name, long *numval, char_u **stringval, int opt_flags)); + int get_option_value_strict __ARGS((char_u *name, long *numval, char_u **stringval, int opt_type, void *from)); +! char_u *set_option_value __ARGS((char_u *name, long number, char_u *string, int opt_flags)); + char_u *get_term_code __ARGS((char_u *tname)); + char_u *get_highlight_default __ARGS((void)); + char_u *get_encoding_default __ARGS((void)); +*** ../vim-7.3.1003/src/testdir/test86.ok 2013-05-21 22:23:51.000000000 +0200 +--- src/testdir/test86.ok 2013-05-21 22:27:50.000000000 +0200 +*************** +*** 166,171 **** +--- 166,172 ---- + inv: -100! KeyError + gopts1! KeyError + p/wopts1: 8 ++ inv: -100! error + p/bopts1! KeyError + inv: -100! KeyError + bopts1! KeyError +*************** +*** 184,189 **** +--- 185,191 ---- + inv: 'abc'! KeyError + gopts1! KeyError + p/wopts1: '' ++ inv: 'abc'! error + p/bopts1! KeyError + inv: 'abc'! KeyError + bopts1! KeyError +*** ../vim-7.3.1003/src/testdir/test87.ok 2013-05-21 22:23:51.000000000 +0200 +--- src/testdir/test87.ok 2013-05-21 22:27:50.000000000 +0200 +*************** +*** 155,160 **** +--- 155,161 ---- + inv: -100! KeyError + gopts1! KeyError + p/wopts1: 8 ++ inv: -100! error + p/bopts1! KeyError + inv: -100! KeyError + bopts1! KeyError +*************** +*** 173,178 **** +--- 174,180 ---- + inv: 'abc'! KeyError + gopts1! KeyError + p/wopts1: b'' ++ inv: 'abc'! error + p/bopts1! KeyError + inv: 'abc'! KeyError + bopts1! KeyError +*** ../vim-7.3.1003/src/version.c 2013-05-21 22:23:51.000000000 +0200 +--- src/version.c 2013-05-21 22:37:33.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1004, + /**/ + +-- +FIRST SOLDIER: So they wouldn't be able to bring a coconut back anyway. +SECOND SOLDIER: Wait a minute! Suppose two swallows carried it together? +FIRST SOLDIER: No, they'd have to have it on a line. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// 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 /// diff --git a/7.3.1005 b/7.3.1005 new file mode 100644 index 0000000..dbc05c2 --- /dev/null +++ b/7.3.1005 @@ -0,0 +1,265 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1005 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1005 +Problem: Get stuck on regexp "\n*" and on "%s/^\n\+/\r". +Solution: Fix handling of matching a line break. (idea by Hirohito Higashi) +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1004/src/regexp_nfa.c 2013-05-21 22:00:42.000000000 +0200 +--- src/regexp_nfa.c 2013-05-22 22:53:08.000000000 +0200 +*************** +*** 2462,2468 **** + List *l; /* runtime state list */ + nfa_state_T *state; /* state to update */ + regsub_T *m; /* pointers to subexpressions */ +! int off; + int lid; + int *match; /* found match? */ + { +--- 2462,2468 ---- + List *l; /* runtime state list */ + nfa_state_T *state; /* state to update */ + regsub_T *m; /* pointers to subexpressions */ +! int off; /* byte offset, when -1 go to next line */ + int lid; + int *match; /* found match? */ + { +*************** +*** 2585,2592 **** + { + save.startpos[subidx] = m->startpos[subidx]; + save.endpos[subidx] = m->endpos[subidx]; +! m->startpos[subidx].lnum = reglnum; +! m->startpos[subidx].col = (colnr_T)(reginput - regline + off); + } + else + { +--- 2585,2601 ---- + { + save.startpos[subidx] = m->startpos[subidx]; + save.endpos[subidx] = m->endpos[subidx]; +! if (off == -1) +! { +! m->startpos[subidx].lnum = reglnum + 1; +! m->startpos[subidx].col = 0; +! } +! else +! { +! m->startpos[subidx].lnum = reglnum; +! m->startpos[subidx].col = +! (colnr_T)(reginput - regline + off); +! } + } + else + { +*************** +*** 2633,2640 **** + { + save.startpos[subidx] = m->startpos[subidx]; + save.endpos[subidx] = m->endpos[subidx]; +! m->endpos[subidx].lnum = reglnum; +! m->endpos[subidx].col = (colnr_T)(reginput - regline + off); + } + else + { +--- 2642,2657 ---- + { + save.startpos[subidx] = m->startpos[subidx]; + save.endpos[subidx] = m->endpos[subidx]; +! if (off == -1) +! { +! m->endpos[subidx].lnum = reglnum + 1; +! m->endpos[subidx].col = 0; +! } +! else +! { +! m->endpos[subidx].lnum = reglnum; +! m->endpos[subidx].col = (colnr_T)(reginput - regline + off); +! } + } + else + { +*************** +*** 2834,2840 **** + int match = FALSE; + int flag = 0; + int old_reglnum = -1; +! int reginput_updated = FALSE; + thread_T *t; + char_u *old_reginput = NULL; + char_u *old_regline = NULL; +--- 2851,2857 ---- + int match = FALSE; + int flag = 0; + int old_reglnum = -1; +! int go_to_nextline; + thread_T *t; + char_u *old_reginput = NULL; + char_u *old_regline = NULL; +*************** +*** 2917,2924 **** + /* + * Run for each character. + */ +! do { +! again: + #ifdef FEAT_MBYTE + if (has_mbyte) + { +--- 2934,2941 ---- + /* + * Run for each character. + */ +! for (;;) +! { + #ifdef FEAT_MBYTE + if (has_mbyte) + { +*************** +*** 2932,2938 **** +--- 2949,2958 ---- + n = 1; + } + if (c == NUL) ++ { + n = 0; ++ go_to_nextline = FALSE; ++ } + + /* swap lists */ + thislist = &list[flag]; +*************** +*** 3007,3013 **** + (char *)t->sub.end[j]); + fprintf(log_fd, "\n"); + #endif +! goto nextchar; /* found the left-most longest match */ + + case NFA_END_INVISIBLE: + /* This is only encountered after a NFA_START_INVISIBLE node. +--- 3027,3035 ---- + (char *)t->sub.end[j]); + fprintf(log_fd, "\n"); + #endif +! /* Found the left-most longest match, do not look at any other +! * states at this position. */ +! goto nextchar; + + case NFA_END_INVISIBLE: + /* This is only encountered after a NFA_START_INVISIBLE node. +*************** +*** 3206,3220 **** + + case NFA_NEWL: + if (!reg_line_lbr && REG_MULTI +! && c == NUL && reglnum <= reg_maxline) + { +! if (reginput_updated == FALSE) +! { +! reg_nextline(); +! reginput_updated = TRUE; +! } +! addstate(nextlist, t->state->out, &t->sub, n, listid + 1, +! &match); + } + break; + +--- 3228,3240 ---- + + case NFA_NEWL: + if (!reg_line_lbr && REG_MULTI +! && c == NUL && reglnum <= reg_maxline) + { +! go_to_nextline = TRUE; +! /* Pass -1 for the offset, which means taking the position +! * at the start of the next line. */ +! addstate(nextlist, t->state->out, &t->sub, -1, +! listid + 1, &match); + } + break; + +*************** +*** 3247,3254 **** + break; + + case NFA_ANY: +! /* Any printable char, not just any char. '\0' (end of input) +! * must not match */ + if (c > 0) + addstate(nextlist, t->state->out, &t->sub, n, listid + 1, + &match); +--- 3267,3273 ---- + break; + + case NFA_ANY: +! /* Any char except '\0', (end of input) does not match. */ + if (c > 0) + addstate(nextlist, t->state->out, &t->sub, n, listid + 1, + &match); +*************** +*** 3433,3444 **** + addstate(nextlist, start, m, n, listid + 1, &match); + } + +- if (reginput_updated) +- { +- reginput_updated = FALSE; +- goto again; +- } +- + #ifdef ENABLE_LOG + fprintf(log_fd, ">>> Thislist had %d states available: ", thislist->n); + for (i = 0; i< thislist->n; i++) +--- 3452,3457 ---- +*************** +*** 3447,3454 **** + #endif + + nextchar: +! reginput += n; +! } while (c || reginput_updated); + + #ifdef ENABLE_LOG + if (log_fd != stderr) +--- 3460,3474 ---- + #endif + + nextchar: +! /* Advance to the next character, or advance to the next line, or +! * finish. */ +! if (n != 0) +! reginput += n; +! else if (go_to_nextline) +! reg_nextline(); +! else +! break; +! } + + #ifdef ENABLE_LOG + if (log_fd != stderr) +*** ../vim-7.3.1004/src/version.c 2013-05-21 22:38:14.000000000 +0200 +--- src/version.c 2013-05-22 22:57:59.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1005, + /**/ + +-- +"Lisp has all the visual appeal of oatmeal with nail clippings thrown in." + -- Larry Wall + + /// 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 /// diff --git a/7.3.1006 b/7.3.1006 new file mode 100644 index 0000000..c5e05fb --- /dev/null +++ b/7.3.1006 @@ -0,0 +1,74 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1006 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1006 +Problem: NFA engine not used for "\_[0-9]". +Solution: Enable this, fixed in patch 1005. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1005/src/regexp_nfa.c 2013-05-22 23:00:34.000000000 +0200 +--- src/regexp_nfa.c 2013-05-23 22:19:29.000000000 +0200 +*************** +*** 679,687 **** + + /* "\_[" is collection plus newline */ + if (c == '[') +! /* TODO: make this work +! * goto collection; */ +! return FAIL; + + /* "\_x" is character class plus newline */ + /*FALLTHROUGH*/ +--- 679,685 ---- + + /* "\_[" is collection plus newline */ + if (c == '[') +! goto collection; + + /* "\_x" is character class plus newline */ + /*FALLTHROUGH*/ +*************** +*** 891,898 **** + } + break; + +- /* collection: */ + case Magic('['): + /* + * Glue is emitted between several atoms from the []. + * It is either NFA_OR, or NFA_CONCAT. +--- 889,896 ---- + } + break; + + case Magic('['): ++ collection: + /* + * Glue is emitted between several atoms from the []. + * It is either NFA_OR, or NFA_CONCAT. +*** ../vim-7.3.1005/src/version.c 2013-05-22 23:00:34.000000000 +0200 +--- src/version.c 2013-05-23 22:23:07.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1006, + /**/ + +-- +BLACK KNIGHT: I'm invincible! +ARTHUR: You're a looney. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// 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 /// diff --git a/7.3.1007 b/7.3.1007 new file mode 100644 index 0000000..a7e758e --- /dev/null +++ b/7.3.1007 @@ -0,0 +1,57 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1007 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1007 +Problem: Can't build on Minix 3.2.1. +Solution: Add a condition to an #ifdef. (Gautam Tirumala) +Files: src/memfile.c + + +*** ../vim-7.3.1006/src/memfile.c 2013-05-06 04:21:35.000000000 +0200 +--- src/memfile.c 2013-05-23 22:22:22.000000000 +0200 +*************** +*** 127,133 **** + { + memfile_T *mfp; + off_t size; +! #if defined(STATFS) && defined(UNIX) && !defined(__QNX__) + # define USE_FSTATFS + struct STATFS stf; + #endif +--- 127,133 ---- + { + memfile_T *mfp; + off_t size; +! #if defined(STATFS) && defined(UNIX) && !defined(__QNX__) && !defined(__minix) + # define USE_FSTATFS + struct STATFS stf; + #endif +*** ../vim-7.3.1006/src/version.c 2013-05-23 22:25:10.000000000 +0200 +--- src/version.c 2013-05-23 22:26:16.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1007, + /**/ + +-- +Mrs Abbott: I'm a paediatrician. + Basil: Feet? +Mrs Abbott: Children. + Sybil: Oh, Basil! + Basil: Well, children have feet, don't they? That's how they move + around, my dear. You must take a look next time, it's most + interesting. (Fawlty Towers) + + /// 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 /// diff --git a/7.3.1008 b/7.3.1008 new file mode 100644 index 0000000..1dc0376 --- /dev/null +++ b/7.3.1008 @@ -0,0 +1,76 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1008 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1008 +Problem: Test 95 fails on MS-Windows. +Solution: Set 'nomore'. Change \i to \f. Change multi-byte character to + something that is not matching \i. (Ken Takata) +Files: src/testdir/test95.in, src/testdir/test95.ok + + +*** ../vim-7.3.1007/src/testdir/test95.in 2013-05-21 13:30:17.000000000 +0200 +--- src/testdir/test95.in 2013-05-23 22:36:22.000000000 +0200 +*************** +*** 30,39 **** + :call add(tl, ['\p\+', 'ìa', 'ìa']) + + :"""" Test recognition of some character classes +! :call add(tl, ['\i\+', '&*§xx ', 'xx']) +! :call add(tl, ['\%#=1\i\+', '&*§xx ', 'xx']) + :call add(tl, ['\f\+', '&*Ÿfname ', 'fname']) +! :call add(tl, ['\%#=1\i\+', '&*Ÿfname ', 'fname']) + + :"""" Combining different tests and features + :call add(tl, ['[^[=a=]]\+', 'ddaãâbcd', 'dd']) +--- 30,39 ---- + :call add(tl, ['\p\+', 'ìa', 'ìa']) + + :"""" Test recognition of some character classes +! :call add(tl, ['\i\+', '&*¨xx ', 'xx']) +! :call add(tl, ['\%#=1\i\+', '&*¨xx ', 'xx']) + :call add(tl, ['\f\+', '&*Ÿfname ', 'fname']) +! :call add(tl, ['\%#=1\f\+', '&*Ÿfname ', 'fname']) + + :"""" Combining different tests and features + :call add(tl, ['[^[=a=]]\+', 'ddaãâbcd', 'dd']) +*** ../vim-7.3.1007/src/testdir/test95.ok 2013-05-21 13:30:17.000000000 +0200 +--- src/testdir/test95.ok 2013-05-23 19:34:01.000000000 +0200 +*************** +*** 8,12 **** + OK - \i\+ + OK - \%#=1\i\+ + OK - \f\+ +! OK - \%#=1\i\+ + OK - [^[=a=]]\+ +--- 8,12 ---- + OK - \i\+ + OK - \%#=1\i\+ + OK - \f\+ +! OK - \%#=1\f\+ + OK - [^[=a=]]\+ +*** ../vim-7.3.1007/src/version.c 2013-05-23 22:26:50.000000000 +0200 +--- src/version.c 2013-05-23 22:39:37.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1008, + /**/ + +-- +BLACK KNIGHT: The Black Knight always triumphs. Have at you! + ARTHUR takes his last leg off. The BLACK KNIGHT's body lands upright. +BLACK KNIGHT: All right, we'll call it a draw. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// 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 /// diff --git a/7.3.1009 b/7.3.1009 new file mode 100644 index 0000000..3fa2107 --- /dev/null +++ b/7.3.1009 @@ -0,0 +1,50 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1009 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1009 +Problem: Compiler warning for ambiguous else. +Solution: Add curly braces. +Files: src/if_py_both.h + + +*** ../vim-7.3.1008/src/if_py_both.h 2013-05-21 22:38:14.000000000 +0200 +--- src/if_py_both.h 2013-05-24 18:54:32.000000000 +0200 +*************** +*** 2163,2169 **** +--- 2163,2171 ---- + TabPageObject *tabObject = self->tabObject; + + if (tabObject) ++ { + Py_DECREF((PyObject *)(tabObject)); ++ } + + DESTRUCTOR_FINISH(self); + } +*** ../vim-7.3.1008/src/version.c 2013-05-23 22:43:03.000000000 +0200 +--- src/version.c 2013-05-24 18:58:10.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1009, + /**/ + +-- +BEDEVERE: Why do you think she is a witch? +SECOND VILLAGER: She turned me into a newt. +BEDEVERE: A newt? +SECOND VILLAGER: (After looking at himself for some time) I got better. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// 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 /// diff --git a/7.3.1010 b/7.3.1010 new file mode 100644 index 0000000..7fafb93 --- /dev/null +++ b/7.3.1010 @@ -0,0 +1,174 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1010 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1010 +Problem: New regexp: adding \Z makes every character match. +Solution: Only apply ireg_icombine for composing characters. + Alsl add missing change from patch 1008. (Ken Takata) +Files: src/regexp_nfa.c, src/testdir/test95.in, src/testdir/test95.ok + + +*** ../vim-7.3.1009/src/regexp_nfa.c 2013-05-23 22:25:10.000000000 +0200 +--- src/regexp_nfa.c 2013-05-24 20:20:14.000000000 +0200 +*************** +*** 2859,2865 **** + List *listtbl[2][2]; + List *ll; + int listid = 1; +! int endnode = 0; + List *thislist; + List *nextlist; + List *neglist; +--- 2859,2865 ---- + List *listtbl[2][2]; + List *ll; + int listid = 1; +! int endnode; + List *thislist; + List *nextlist; + List *neglist; +*************** +*** 3192,3204 **** + + case NFA_MULTIBYTE: + case NFA_COMPOSING: +! switch (t->state->c) +! { +! case NFA_MULTIBYTE: endnode = NFA_END_MULTIBYTE; break; +! case NFA_COMPOSING: endnode = NFA_END_COMPOSING; break; +! default: endnode = 0; +! } +! + result = OK; + sta = t->state->out; + len = 1; +--- 3192,3198 ---- + + case NFA_MULTIBYTE: + case NFA_COMPOSING: +! endnode = t->state->c + 1; + result = OK; + sta = t->state->out; + len = 1; +*************** +*** 3206,3212 **** + { + if (reginput[len-1] != sta->c) + { +! result = OK - 1; + break; + } + len++; +--- 3200,3206 ---- + { + if (reginput[len-1] != sta->c) + { +! result = FAIL; + break; + } + len++; +*************** +*** 3215,3225 **** + + /* if input char length doesn't match regexp char length */ + if (len -1 < n || sta->c != endnode) +! result = OK - 1; + end = t->state->out1; /* NFA_END_MULTIBYTE or + NFA_END_COMPOSING */ + /* If \Z was present, then ignore composing characters */ +! if (regflags & RF_ICOMBINE) + result = 1 ^ sta->negated; + ADD_POS_NEG_STATE(end); + break; +--- 3209,3219 ---- + + /* if input char length doesn't match regexp char length */ + if (len -1 < n || sta->c != endnode) +! result = FAIL; + end = t->state->out1; /* NFA_END_MULTIBYTE or + NFA_END_COMPOSING */ + /* If \Z was present, then ignore composing characters */ +! if (ireg_icombine && endnode == NFA_END_COMPOSING) + result = 1 ^ sta->negated; + ADD_POS_NEG_STATE(end); + break; +*** ../vim-7.3.1009/src/testdir/test95.in 2013-05-23 22:43:03.000000000 +0200 +--- src/testdir/test95.in 2013-05-24 20:18:13.000000000 +0200 +*************** +*** 7,13 **** + STARTTEST + :so small.vim + :so mbyte.vim +! :set nocp encoding=utf-8 viminfo+=nviminfo + :" tl is a List of Lists with: + :" regexp pattern + :" text to test the pattern on +--- 7,13 ---- + STARTTEST + :so small.vim + :so mbyte.vim +! :set nocp encoding=utf-8 viminfo+=nviminfo nomore + :" tl is a List of Lists with: + :" regexp pattern + :" text to test the pattern on +*************** +*** 35,45 **** + :call add(tl, ['\f\+', '&*Ÿfname ', 'fname']) + :call add(tl, ['\%#=1\f\+', '&*Ÿfname ', 'fname']) + + :"""" Combining different tests and features + :call add(tl, ['[^[=a=]]\+', 'ddaãâbcd', 'dd']) + + :"""" Run the tests +- + :" + :for t in tl + : let l = matchlist(t[1], t[0]) +--- 35,47 ---- + :call add(tl, ['\f\+', '&*Ÿfname ', 'fname']) + :call add(tl, ['\%#=1\f\+', '&*Ÿfname ', 'fname']) + ++ :"""" Test \Z ++ :call add(tl, ['ú\Z', 'x']) ++ + :"""" Combining different tests and features + :call add(tl, ['[^[=a=]]\+', 'ddaãâbcd', 'dd']) + + :"""" Run the tests + :" + :for t in tl + : let l = matchlist(t[1], t[0]) +*** ../vim-7.3.1009/src/testdir/test95.ok 2013-05-23 22:43:03.000000000 +0200 +--- src/testdir/test95.ok 2013-05-24 20:18:55.000000000 +0200 +*************** +*** 9,12 **** +--- 9,13 ---- + OK - \%#=1\i\+ + OK - \f\+ + OK - \%#=1\f\+ ++ OK - ú\Z + OK - [^[=a=]]\+ +*** ../vim-7.3.1009/src/version.c 2013-05-24 18:58:39.000000000 +0200 +--- src/version.c 2013-05-24 20:21:52.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1010, + /**/ + +-- +Never under any circumstances take a sleeping pill +and a laxative on the same night. + + /// 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 /// diff --git a/7.3.1011 b/7.3.1011 new file mode 100644 index 0000000..0e2304b --- /dev/null +++ b/7.3.1011 @@ -0,0 +1,475 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1011 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1011 +Problem: New regexp engine is inefficient with multi-byte characters. +Solution: Handle a character at a time instead of a byte at a time. Also + make \Z partly work. +Files: src/regexp_nfa.c, src/testdir/test95.in, src/testdir/test95.ok + + +*** ../vim-7.3.1010/src/regexp_nfa.c 2013-05-24 20:25:28.000000000 +0200 +--- src/regexp_nfa.c 2013-05-24 21:49:43.000000000 +0200 +*************** +*** 46,54 **** + NFA_NCLOSE, /* End of subexpr. marked with \%( ... \) */ + NFA_START_INVISIBLE, + NFA_END_INVISIBLE, +- NFA_MULTIBYTE, /* Next nodes in NFA are part of the same +- multibyte char */ +- NFA_END_MULTIBYTE, /* End of multibyte char in the NFA */ + NFA_COMPOSING, /* Next nodes in NFA are part of the + composing multibyte char */ + NFA_END_COMPOSING, /* End of a composing char in the NFA */ +--- 46,51 ---- +*************** +*** 195,220 **** + *post_ptr++ = c; \ + } while (0) + +- #define EMIT_MBYTE(c) \ +- len = (*mb_char2bytes)(c, buf); \ +- EMIT(buf[0]); \ +- for (i = 1; i < len; i++) \ +- { \ +- EMIT(buf[i]); \ +- EMIT(NFA_CONCAT); \ +- } \ +- EMIT(NFA_MULTIBYTE); +- +- #define EMIT_COMPOSING_UTF(input) \ +- len = utfc_ptr2len(input); \ +- EMIT(input[0]); \ +- for (i = 1; i < len; i++) \ +- { \ +- EMIT(input[i]); \ +- EMIT(NFA_CONCAT); \ +- } \ +- EMIT(NFA_COMPOSING); +- + /* + * Initialize internal variables before NFA compilation. + * Return OK on success, FAIL otherwise. +--- 192,197 ---- +*************** +*** 611,618 **** + #ifdef FEAT_MBYTE + char_u *old_regparse = regparse; + int clen; +- int len; +- static char_u buf[30]; + int i; + #endif + int extra = 0; +--- 588,593 ---- +*************** +*** 845,858 **** + return FAIL; + + c = coll_get_char(); +! #ifdef FEAT_MBYTE +! if ((*mb_char2len)(c) > 1) +! { +! EMIT_MBYTE(c); +! } +! else +! #endif +! EMIT(c); + break; + + /* Catch \%^ and \%$ regardless of where they appear in the +--- 820,826 ---- + return FAIL; + + c = coll_get_char(); +! EMIT(c); + break; + + /* Catch \%^ and \%$ regardless of where they appear in the +*************** +*** 1135,1146 **** + * skip it. */ + for (c = startc + 1; c <= endc; c++) + { +! if ((*mb_char2len)(c) > 1) +! { +! EMIT_MBYTE(c); +! } +! else +! EMIT(c); + TRY_NEG(); + EMIT_GLUE(); + } +--- 1103,1109 ---- + * skip it. */ + for (c = startc + 1; c <= endc; c++) + { +! EMIT(c); + TRY_NEG(); + EMIT_GLUE(); + } +*************** +*** 1187,1200 **** + if (got_coll_char == TRUE && startc == 0) + EMIT(0x0a); + else +! #ifdef FEAT_MBYTE +! if ((*mb_char2len)(startc) > 1) +! { +! EMIT_MBYTE(startc); +! } +! else +! #endif +! EMIT(startc); + TRY_NEG(); + EMIT_GLUE(); + } +--- 1150,1156 ---- + if (got_coll_char == TRUE && startc == 0) + EMIT(0x0a); + else +! EMIT(startc); + TRY_NEG(); + EMIT_GLUE(); + } +*************** +*** 1242,1271 **** + int plen; + + nfa_do_multibyte: +! /* length of current char, with composing chars, +! * from pointer */ +! plen = (*mb_ptr2len)(old_regparse); +! if (enc_utf8 && clen != plen) +! { +! /* A composing character is always handled as a +! * separate atom, surrounded by NFA_COMPOSING and +! * NFA_END_COMPOSING. Note that right now we are + * building the postfix form, not the NFA itself; + * a composing char could be: a, b, c, NFA_COMPOSING +! * where 'a', 'b', 'c' are chars with codes > 256. +! */ +! EMIT_COMPOSING_UTF(old_regparse); + regparse = old_regparse + plen; + } + else +- /* A multi-byte character is always handled as a +- * separate atom, surrounded by NFA_MULTIBYTE and +- * NFA_END_MULTIBYTE */ +- if (plen > 1) +- { +- EMIT_MBYTE(c); +- } +- else + #endif + { + c = no_Magic(c); +--- 1198,1227 ---- + int plen; + + nfa_do_multibyte: +! /* Length of current char with composing chars. */ +! if (enc_utf8 && clen != (plen = (*mb_ptr2len)(old_regparse))) +! { +! /* A base character plus composing characters. +! * This requires creating a separate atom as if enclosing +! * the characters in (), where NFA_COMPOSING is the ( and +! * NFA_END_COMPOSING is the ). Note that right now we are + * building the postfix form, not the NFA itself; + * a composing char could be: a, b, c, NFA_COMPOSING +! * where 'b' and 'c' are chars with codes > 256. */ +! i = 0; +! for (;;) +! { +! EMIT(c); +! if (i > 0) +! EMIT(NFA_CONCAT); +! if (i += utf_char2len(c) >= plen) +! break; +! c = utf_ptr2char(old_regparse + i); +! } +! EMIT(NFA_COMPOSING); + regparse = old_regparse + plen; + } + else + #endif + { + c = no_Magic(c); +*************** +*** 1702,1710 **** + case NFA_START_INVISIBLE: STRCPY(code, "NFA_START_INVISIBLE"); break; + case NFA_END_INVISIBLE: STRCPY(code, "NFA_END_INVISIBLE"); break; + +- case NFA_MULTIBYTE: STRCPY(code, "NFA_MULTIBYTE"); break; +- case NFA_END_MULTIBYTE: STRCPY(code, "NFA_END_MULTIBYTE"); break; +- + case NFA_COMPOSING: STRCPY(code, "NFA_COMPOSING"); break; + case NFA_END_COMPOSING: STRCPY(code, "NFA_END_COMPOSING"); break; + +--- 1658,1663 ---- +*************** +*** 2194,2200 **** + } + e1 = POP(); + e1.start->negated = TRUE; +! if (e1.start->c == NFA_MULTIBYTE || e1.start->c == NFA_COMPOSING) + e1.start->out1->negated = TRUE; + PUSH(e1); + break; +--- 2147,2153 ---- + } + e1 = POP(); + e1.start->negated = TRUE; +! if (e1.start->c == NFA_COMPOSING) + e1.start->out1->negated = TRUE; + PUSH(e1); + break; +*************** +*** 2311,2316 **** +--- 2264,2279 ---- + PUSH(frag(s, list1(&s1->out))); + break; + ++ case NFA_COMPOSING: /* char with composing char */ ++ #if 0 ++ /* TODO */ ++ if (regflags & RF_ICOMBINE) ++ { ++ goto normalchar; ++ } ++ #endif ++ /* FALLTHROUGH */ ++ + case NFA_MOPEN + 0: /* Submatch */ + case NFA_MOPEN + 1: + case NFA_MOPEN + 2: +*************** +*** 2322,2329 **** + case NFA_MOPEN + 8: + case NFA_MOPEN + 9: + case NFA_NOPEN: /* \%( "Invisible Submatch" */ +- case NFA_MULTIBYTE: /* mbyte char */ +- case NFA_COMPOSING: /* composing char */ + if (nfa_calc_size == TRUE) + { + nstate += 2; +--- 2285,2290 ---- +*************** +*** 2336,2344 **** + case NFA_NOPEN: + mclose = NFA_NCLOSE; + break; +- case NFA_MULTIBYTE: +- mclose = NFA_END_MULTIBYTE; +- break; + case NFA_COMPOSING: + mclose = NFA_END_COMPOSING; + break; +--- 2297,2302 ---- +*************** +*** 2377,2385 **** + goto theend; + patch(e.out, s1); + +! if (mopen == NFA_MULTIBYTE || mopen == NFA_COMPOSING) +! /* MULTIBYTE->out1 = END_MULTIBYTE +! * COMPOSING->out1 = END_COMPOSING */ + patch(list1(&s->out1), s1); + + PUSH(frag(s, list1(&s1->out))); +--- 2335,2342 ---- + goto theend; + patch(e.out, s1); + +! if (mopen == NFA_COMPOSING) +! /* COMPOSING->out1 = END_COMPOSING */ + patch(list1(&s->out1), s1); + + PUSH(frag(s, list1(&s1->out))); +*************** +*** 2540,2556 **** + case NFA_COMPOSING: + /* nfa_regmatch() will match all the bytes of this composing char. */ + break; +- +- case NFA_MULTIBYTE: +- /* nfa_regmatch() will match all the bytes of this multibyte char. */ +- break; + #endif + +- case NFA_END_MULTIBYTE: +- /* Successfully matched this mbyte char */ +- addstate(l, state->out, m, off, lid, match); +- break; +- + case NFA_NOPEN: + case NFA_NCLOSE: + addstate(l, state->out, m, off, lid, match); +--- 2497,2504 ---- +*************** +*** 2841,2847 **** + regsub_T *submatch; + regsub_T *m; + { +! int c = -1; + int n; + int i = 0; + int result; +--- 2789,2795 ---- + regsub_T *submatch; + regsub_T *m; + { +! int c; + int n; + int i = 0; + int result; +*************** +*** 2859,2865 **** + List *listtbl[2][2]; + List *ll; + int listid = 1; +- int endnode; + List *thislist; + List *nextlist; + List *neglist; +--- 2807,2812 ---- +*************** +*** 3190,3222 **** + break; + } + +! case NFA_MULTIBYTE: + case NFA_COMPOSING: +! endnode = t->state->c + 1; + result = OK; + sta = t->state->out; +! len = 1; +! while (sta->c != endnode && len <= n) + { +! if (reginput[len-1] != sta->c) +! { +! result = FAIL; + break; +! } +! len++; + sta = sta->out; + } + + /* if input char length doesn't match regexp char length */ +! if (len -1 < n || sta->c != endnode) + result = FAIL; +! end = t->state->out1; /* NFA_END_MULTIBYTE or +! NFA_END_COMPOSING */ + /* If \Z was present, then ignore composing characters */ +! if (ireg_icombine && endnode == NFA_END_COMPOSING) + result = 1 ^ sta->negated; + ADD_POS_NEG_STATE(end); + break; + + case NFA_NEWL: + if (!reg_line_lbr && REG_MULTI +--- 3137,3171 ---- + break; + } + +! #ifdef FEAT_MBYTE + case NFA_COMPOSING: +! { +! int mc = c; +! + result = OK; + sta = t->state->out; +! len = 0; +! while (sta->c != NFA_END_COMPOSING && len < n) + { +! if (len > 0) +! mc = mb_ptr2char(reginput + len); +! if (mc != sta->c) + break; +! len += mb_char2len(mc); + sta = sta->out; + } + + /* if input char length doesn't match regexp char length */ +! if (len < n || sta->c != NFA_END_COMPOSING) + result = FAIL; +! end = t->state->out1; /* NFA_END_COMPOSING */ + /* If \Z was present, then ignore composing characters */ +! if (ireg_icombine) + result = 1 ^ sta->negated; + ADD_POS_NEG_STATE(end); + break; ++ } ++ #endif + + case NFA_NEWL: + if (!reg_line_lbr && REG_MULTI +*************** +*** 3425,3430 **** +--- 3374,3387 ---- + if (!result) + result = ireg_ic == TRUE + && MB_TOLOWER(t->state->c) == MB_TOLOWER(c); ++ #ifdef FEAT_MBYTE ++ /* If there is a composing character which is not being ++ * ignored there can be no match. Match with composing ++ * character uses NFA_COMPOSING above. */ ++ if (result && enc_utf8 && !ireg_icombine ++ && n != utf_char2len(c)) ++ result = FALSE; ++ #endif + ADD_POS_NEG_STATE(t->state); + break; + } +*** ../vim-7.3.1010/src/testdir/test95.in 2013-05-24 20:25:28.000000000 +0200 +--- src/testdir/test95.in 2013-05-24 20:45:08.000000000 +0200 +*************** +*** 35,40 **** +--- 35,44 ---- + :call add(tl, ['\f\+', '&*Ÿfname ', 'fname']) + :call add(tl, ['\%#=1\f\+', '&*Ÿfname ', 'fname']) + ++ :"""" Test composing character matching ++ :call add(tl, ['.ม', 'xม่x yมy', 'yม']) ++ :call add(tl, ['.ม่', 'xม่x yมy', 'xม่']) ++ + :"""" Test \Z + :call add(tl, ['ú\Z', 'x']) + +*** ../vim-7.3.1010/src/testdir/test95.ok 2013-05-24 20:25:28.000000000 +0200 +--- src/testdir/test95.ok 2013-05-24 20:44:41.000000000 +0200 +*************** +*** 9,13 **** +--- 9,15 ---- + OK - \%#=1\i\+ + OK - \f\+ + OK - \%#=1\f\+ ++ OK - .ม ++ OK - .ม่ + OK - ú\Z + OK - [^[=a=]]\+ +*** ../vim-7.3.1010/src/version.c 2013-05-24 20:25:28.000000000 +0200 +--- src/version.c 2013-05-24 21:56:02.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1011, + /**/ + +-- +If you had to identify, in one word, the reason why the +human race has not achieved, and never will achieve, its +full potential, that word would be "meetings." + + /// 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 /// diff --git a/7.3.1012 b/7.3.1012 new file mode 100644 index 0000000..20c2998 --- /dev/null +++ b/7.3.1012 @@ -0,0 +1,196 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1012 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1012 +Problem: \Z does not work properly with the new regexp engine. +Solution: Make \Z work. Add tests. +Files: src/regexp_nfa.c, src/testdir/test95.in, src/testdir/test95.ok + + +*** ../vim-7.3.1011/src/regexp_nfa.c 2013-05-24 21:59:50.000000000 +0200 +--- src/regexp_nfa.c 2013-05-24 22:46:00.000000000 +0200 +*************** +*** 1184,1197 **** + EMIT(NFA_CONCAT); + } + return OK; +! } /* if exists closing ] */ +! else if (reg_strict) + { + syntax_error = TRUE; + EMSG_RET_FAIL(_(e_missingbracket)); + } + +- /* FALLTHROUGH */ + default: + { + #ifdef FEAT_MBYTE +--- 1184,1198 ---- + EMIT(NFA_CONCAT); + } + return OK; +! } /* if exists closing ] */ +! +! if (reg_strict) + { + syntax_error = TRUE; + EMSG_RET_FAIL(_(e_missingbracket)); + } ++ /* FALLTHROUGH */ + + default: + { + #ifdef FEAT_MBYTE +*************** +*** 1214,1220 **** + EMIT(c); + if (i > 0) + EMIT(NFA_CONCAT); +! if (i += utf_char2len(c) >= plen) + break; + c = utf_ptr2char(old_regparse + i); + } +--- 1215,1221 ---- + EMIT(c); + if (i > 0) + EMIT(NFA_CONCAT); +! if ((i += utf_char2len(c)) >= plen) + break; + c = utf_ptr2char(old_regparse + i); + } +*************** +*** 2269,2275 **** + /* TODO */ + if (regflags & RF_ICOMBINE) + { +! goto normalchar; + } + #endif + /* FALLTHROUGH */ +--- 2270,2276 ---- + /* TODO */ + if (regflags & RF_ICOMBINE) + { +! /* use the base character only */ + } + #endif + /* FALLTHROUGH */ +*************** +*** 3145,3167 **** + result = OK; + sta = t->state->out; + len = 0; +! while (sta->c != NFA_END_COMPOSING && len < n) + { +! if (len > 0) +! mc = mb_ptr2char(reginput + len); +! if (mc != sta->c) +! break; +! len += mb_char2len(mc); +! sta = sta->out; + } + + /* if input char length doesn't match regexp char length */ + if (len < n || sta->c != NFA_END_COMPOSING) + result = FAIL; + end = t->state->out1; /* NFA_END_COMPOSING */ +- /* If \Z was present, then ignore composing characters */ +- if (ireg_icombine) +- result = 1 ^ sta->negated; + ADD_POS_NEG_STATE(end); + break; + } +--- 3146,3176 ---- + result = OK; + sta = t->state->out; + len = 0; +! if (ireg_icombine) + { +! /* If \Z was present, then ignore composing characters. */ +! /* TODO: How about negated? */ +! if (sta->c != c) +! result = FAIL; +! len = n; +! while (sta->c != NFA_END_COMPOSING) +! sta = sta->out; + } ++ else ++ while (sta->c != NFA_END_COMPOSING && len < n) ++ { ++ if (len > 0) ++ mc = mb_ptr2char(reginput + len); ++ if (mc != sta->c) ++ break; ++ len += mb_char2len(mc); ++ sta = sta->out; ++ } + + /* if input char length doesn't match regexp char length */ + if (len < n || sta->c != NFA_END_COMPOSING) + result = FAIL; + end = t->state->out1; /* NFA_END_COMPOSING */ + ADD_POS_NEG_STATE(end); + break; + } +*** ../vim-7.3.1011/src/testdir/test95.in 2013-05-24 21:59:50.000000000 +0200 +--- src/testdir/test95.in 2013-05-24 23:02:13.000000000 +0200 +*************** +*** 41,46 **** +--- 41,55 ---- + + :"""" Test \Z + :call add(tl, ['ú\Z', 'x']) ++ :call add(tl, ['יהוה\Z', 'יהוה', 'יהוה']) ++ :call add(tl, ['יְהוָה\Z', 'יהוה', 'יהוה']) ++ :call add(tl, ['יהוה\Z', 'יְהוָה', 'יְהוָה']) ++ :call add(tl, ['יְהוָה\Z', 'יְהוָה', 'יְהוָה']) ++ :call add(tl, ['יְ\Z', 'וְיַ', 'יַ']) ++ :call add(tl, ["ק\u200d\u05b9x\\Z", "xק\u200d\u05b9xy", "ק\u200d\u05b9x"]) ++ :call add(tl, ["ק\u200d\u05b9x\\Z", "xק\u200dxy", "ק\u200dx"]) ++ :call add(tl, ["ק\u200dx\\Z", "xק\u200d\u05b9xy", "ק\u200d\u05b9x"]) ++ :call add(tl, ["ק\u200dx\\Z", "xק\u200dxy", "ק\u200dx"]) + + :"""" Combining different tests and features + :call add(tl, ['[^[=a=]]\+', 'ddaãâbcd', 'dd']) +*** ../vim-7.3.1011/src/testdir/test95.ok 2013-05-24 21:59:50.000000000 +0200 +--- src/testdir/test95.ok 2013-05-24 23:02:59.000000000 +0200 +*************** +*** 12,15 **** +--- 12,24 ---- + OK - .ม + OK - .ม่ + OK - ú\Z ++ OK - יהוה\Z ++ OK - יְהוָה\Z ++ OK - יהוה\Z ++ OK - יְהוָה\Z ++ OK - יְ\Z ++ OK - ק‍ֹx\Z ++ OK - ק‍ֹx\Z ++ OK - ק‍x\Z ++ OK - ק‍x\Z + OK - [^[=a=]]\+ +*** ../vim-7.3.1011/src/version.c 2013-05-24 21:59:50.000000000 +0200 +--- src/version.c 2013-05-24 23:08:21.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1012, + /**/ + +-- +BEDEVERE: And that, my lord, is how we know the Earth to be banana-shaped. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// 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 /// diff --git a/7.3.1013 b/7.3.1013 new file mode 100644 index 0000000..125bd34 --- /dev/null +++ b/7.3.1013 @@ -0,0 +1,347 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1013 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1013 +Problem: New regexp logging is a bit messy. +Solution: Consistently use #defines, add explanatory comment. (Taro Muraoka) +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1012/src/regexp_nfa.c 2013-05-24 23:10:45.000000000 +0200 +--- src/regexp_nfa.c 2013-05-25 12:17:35.000000000 +0200 +*************** +*** 5,16 **** + * This file is included in "regexp.c". + */ + + #ifdef DEBUG +! /* Comment this out to disable log files. They can get pretty big */ + # define ENABLE_LOG +! # define LOG_NAME "log_nfarun.log" +! # define NFA_REGEXP_DEBUG_LOG +! # define NFA_REGEXP_DEBUG_LOG_NAME "nfa_regexp_debug.log" + #endif + + /* Upper limit allowed for {m,n} repetitions handled by NFA */ +--- 5,32 ---- + * This file is included in "regexp.c". + */ + ++ /* ++ * Logging of NFA engine. ++ * ++ * The NFA engine can write four log files: ++ * - Error log: Contains NFA engine's fatal errors. ++ * - Dump log: Contains compiled NFA state machine's information. ++ * - Run log: Contains information of matching procedure. ++ * - Debug log: Contains detailed information of matching procedure. Can be ++ * disabled by undefining NFA_REGEXP_DEBUG_LOG. ++ * The first one can also be used without debug mode. ++ * The last three are enabled when compiled as debug mode and individually ++ * disabled by commenting them out. ++ * The log files can get quite big! ++ * Do disable all of this when compiling Vim for debugging, undefine DEBUG in ++ * regexp.c ++ */ + #ifdef DEBUG +! # define NFA_REGEXP_ERROR_LOG "nfa_regexp_error.log" + # define ENABLE_LOG +! # define NFA_REGEXP_DUMP_LOG "nfa_regexp_dump.log" +! # define NFA_REGEXP_RUN_LOG "nfa_regexp_run.log" +! # define NFA_REGEXP_DEBUG_LOG "nfa_regexp_debug.log" + #endif + + /* Upper limit allowed for {m,n} repetitions handled by NFA */ +*************** +*** 1769,1775 **** + int *p; + FILE *f; + +! f = fopen("LOG.log", "a"); + if (f != NULL) + { + fprintf(f, "\n-------------------------\n"); +--- 1785,1791 ---- + int *p; + FILE *f; + +! f = fopen(NFA_REGEXP_DUMP_LOG, "a"); + if (f != NULL) + { + fprintf(f, "\n-------------------------\n"); +*************** +*** 1827,1833 **** + nfa_dump(prog) + nfa_regprog_T *prog; + { +! FILE *debugf = fopen("LOG.log", "a"); + + if (debugf != NULL) + { +--- 1843,1849 ---- + nfa_dump(prog) + nfa_regprog_T *prog; + { +! FILE *debugf = fopen(NFA_REGEXP_DUMP_LOG, "a"); + + if (debugf != NULL) + { +*************** +*** 1994,2007 **** + + static void + st_error(postfix, end, p) +! int *postfix; +! int *end; +! int *p; + { + FILE *df; + int *p2; + +! df = fopen("stack.err", "a"); + if (df) + { + fprintf(df, "Error popping the stack!\n"); +--- 2010,2024 ---- + + static void + st_error(postfix, end, p) +! int *postfix UNUSED; +! int *end UNUSED; +! int *p UNUSED; + { ++ #ifdef NFA_REGEXP_ERROR_LOG + FILE *df; + int *p2; + +! df = fopen(NFA_REGEXP_ERROR_LOG, "a"); + if (df) + { + fprintf(df, "Error popping the stack!\n"); +*************** +*** 2036,2041 **** +--- 2053,2059 ---- + fprintf(df, "\n--------------------------\n"); + fclose(df); + } ++ #endif + EMSG(_("E874: (NFA) Could not pop the stack !")); + } + +*************** +*** 2148,2155 **** +--- 2166,2175 ---- + } + e1 = POP(); + e1.start->negated = TRUE; ++ #ifdef FEAT_MBYTE + if (e1.start->c == NFA_COMPOSING) + e1.start->out1->negated = TRUE; ++ #endif + PUSH(e1); + break; + +*************** +*** 2265,2270 **** +--- 2285,2291 ---- + PUSH(frag(s, list1(&s1->out))); + break; + ++ #ifdef FEAT_MBYTE + case NFA_COMPOSING: /* char with composing char */ + #if 0 + /* TODO */ +*************** +*** 2274,2279 **** +--- 2295,2301 ---- + } + #endif + /* FALLTHROUGH */ ++ #endif + + case NFA_MOPEN + 0: /* Submatch */ + case NFA_MOPEN + 1: +*************** +*** 2298,2306 **** +--- 2320,2330 ---- + case NFA_NOPEN: + mclose = NFA_NCLOSE; + break; ++ #ifdef FEAT_MBYTE + case NFA_COMPOSING: + mclose = NFA_END_COMPOSING; + break; ++ #endif + default: + /* NFA_MOPEN(0) ... NFA_MOPEN(9) */ + mclose = *p + NSUBEXP; +*************** +*** 2336,2344 **** +--- 2360,2370 ---- + goto theend; + patch(e.out, s1); + ++ #ifdef FEAT_MBYTE + if (mopen == NFA_COMPOSING) + /* COMPOSING->out1 = END_COMPOSING */ + patch(list1(&s->out1), s1); ++ #endif + + PUSH(frag(s, list1(&s1->out))); + break; +*************** +*** 2802,2809 **** + thread_T *t; + char_u *old_reginput = NULL; + char_u *old_regline = NULL; +- nfa_state_T *sta; +- nfa_state_T *end; + List list[3]; + List *listtbl[2][2]; + List *ll; +--- 2828,2833 ---- +*************** +*** 2813,2825 **** + List *neglist; + int *listids = NULL; + int j = 0; +- int len = 0; + #ifdef NFA_REGEXP_DEBUG_LOG +! FILE *debug = fopen(NFA_REGEXP_DEBUG_LOG_NAME, "a"); + + if (debug == NULL) + { +! EMSG2(_("(NFA) COULD NOT OPEN %s !"), NFA_REGEXP_DEBUG_LOG_NAME); + return FALSE; + } + #endif +--- 2837,2848 ---- + List *neglist; + int *listids = NULL; + int j = 0; + #ifdef NFA_REGEXP_DEBUG_LOG +! FILE *debug = fopen(NFA_REGEXP_DEBUG_LOG, "a"); + + if (debug == NULL) + { +! EMSG2(_("(NFA) COULD NOT OPEN %s !"), NFA_REGEXP_DEBUG_LOG); + return FALSE; + } + #endif +*************** +*** 2836,2842 **** + vim_memset(list[2].t, 0, size); + + #ifdef ENABLE_LOG +! log_fd = fopen(LOG_NAME, "a"); + if (log_fd != NULL) + { + fprintf(log_fd, "**********************************\n"); +--- 2859,2865 ---- + vim_memset(list[2].t, 0, size); + + #ifdef ENABLE_LOG +! log_fd = fopen(NFA_REGEXP_RUN_LOG, "a"); + if (log_fd != NULL) + { + fprintf(log_fd, "**********************************\n"); +*************** +*** 3025,3031 **** + nfa_restore_listids(start, listids); + + #ifdef ENABLE_LOG +! log_fd = fopen(LOG_NAME, "a"); + if (log_fd != NULL) + { + fprintf(log_fd, "****************************\n"); +--- 3048,3054 ---- + nfa_restore_listids(start, listids); + + #ifdef ENABLE_LOG +! log_fd = fopen(NFA_REGEXP_RUN_LOG, "a"); + if (log_fd != NULL) + { + fprintf(log_fd, "****************************\n"); +*************** +*** 3141,3147 **** + #ifdef FEAT_MBYTE + case NFA_COMPOSING: + { +! int mc = c; + + result = OK; + sta = t->state->out; +--- 3164,3173 ---- + #ifdef FEAT_MBYTE + case NFA_COMPOSING: + { +! int mc = c; +! int len = 0; +! nfa_state_T *end; +! nfa_state_T *sta; + + result = OK; + sta = t->state->out; +*************** +*** 3469,3475 **** + need_clear_subexpr = TRUE; + + #ifdef ENABLE_LOG +! f = fopen(LOG_NAME, "a"); + if (f != NULL) + { + fprintf(f, "\n\n\n\n\n\n\t\t=======================================================\n"); +--- 3495,3501 ---- + need_clear_subexpr = TRUE; + + #ifdef ENABLE_LOG +! f = fopen(NFA_REGEXP_RUN_LOG, "a"); + if (f != NULL) + { + fprintf(f, "\n\n\n\n\n\n\t\t=======================================================\n"); +*************** +*** 3662,3668 **** + */ + #ifdef ENABLE_LOG + { +! FILE *f = fopen(LOG_NAME, "a"); + + if (f != NULL) + { +--- 3688,3694 ---- + */ + #ifdef ENABLE_LOG + { +! FILE *f = fopen(NFA_REGEXP_RUN_LOG, "a"); + + if (f != NULL) + { +*** ../vim-7.3.1012/src/version.c 2013-05-24 23:10:45.000000000 +0200 +--- src/version.c 2013-05-25 12:06:33.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1013, + /**/ + +-- +Scientists decoded the first message from an alien civilization: + SIMPLY SEND 6 TIMES 10 TO THE 50 ATOMS OF HYDROGEN TO THE STAR +SYSTEM AT THE TOP OF THE LIST, CROSS OFF THAT STAR SYSTEM, THEN PUT +YOUR STAR SYSTEM AT THE BOTTOM OF THE LIST AND SEND IT TO 100 OTHER +STAR SYSTEMS. WITHIN ONE TENTH GALACTIC ROTATION YOU WILL RECEIVE +ENOUGH HYDROGREN TO POWER YOUR CIVILIZATION UNTIL ENTROPY REACHES ITS +MAXIMUM! IT REALLY WORKS! + + /// 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 /// diff --git a/7.3.1014 b/7.3.1014 new file mode 100644 index 0000000..5cc84be --- /dev/null +++ b/7.3.1014 @@ -0,0 +1,192 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1014 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1014 +Problem: New regexp state dump is hard to read. +Solution: Make the state dump more pretty. (Taro Muraoka) +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1013/src/regexp_nfa.c 2013-05-25 12:18:34.000000000 +0200 +--- src/regexp_nfa.c 2013-05-25 12:25:43.000000000 +0200 +*************** +*** 183,189 **** + #ifdef DEBUG + static void nfa_set_code __ARGS((int c)); + static void nfa_postfix_dump __ARGS((char_u *expr, int retval)); +! static void nfa_print_state __ARGS((FILE *debugf, nfa_state_T *state, int ident)); + static void nfa_dump __ARGS((nfa_regprog_T *prog)); + #endif + static int *re2post __ARGS((void)); +--- 183,190 ---- + #ifdef DEBUG + static void nfa_set_code __ARGS((int c)); + static void nfa_postfix_dump __ARGS((char_u *expr, int retval)); +! static void nfa_print_state __ARGS((FILE *debugf, nfa_state_T *state)); +! static void nfa_print_state2 __ARGS((FILE *debugf, nfa_state_T *state, garray_T *indent)); + static void nfa_dump __ARGS((nfa_regprog_T *prog)); + #endif + static int *re2post __ARGS((void)); +*************** +*** 1811,1839 **** + * Print the NFA starting with a root node "state". + */ + static void +! nfa_print_state(debugf, state, ident) + FILE *debugf; + nfa_state_T *state; +- int ident; + { +! int i; + + if (state == NULL) + return; + + fprintf(debugf, "(%2d)", abs(state->id)); +! for (i = 0; i < ident; i++) +! fprintf(debugf, "%c", ' '); + + nfa_set_code(state->c); +! fprintf(debugf, "%s %s (%d) (id=%d)\n", +! state->negated ? "NOT" : "", code, state->c, abs(state->id)); + if (state->id < 0) + return; + + state->id = abs(state->id) * -1; +! nfa_print_state(debugf, state->out, ident + 4); +! nfa_print_state(debugf, state->out1, ident + 4); + } + + /* +--- 1812,1885 ---- + * Print the NFA starting with a root node "state". + */ + static void +! nfa_print_state(debugf, state) + FILE *debugf; + nfa_state_T *state; + { +! garray_T indent; +! +! ga_init2(&indent, 1, 64); +! ga_append(&indent, '\0'); +! nfa_print_state2(debugf, state, &indent); +! ga_clear(&indent); +! } +! +! static void +! nfa_print_state2(debugf, state, indent) +! FILE *debugf; +! nfa_state_T *state; +! garray_T *indent; +! { +! char_u *p; + + if (state == NULL) + return; + + fprintf(debugf, "(%2d)", abs(state->id)); +! +! /* Output indent */ +! p = (char_u *)indent->ga_data; +! if (indent->ga_len >= 3) +! { +! int last = indent->ga_len - 3; +! char_u save[2]; +! +! STRNCPY(save, &p[last], 2); +! STRNCPY(&p[last], "+-", 2); +! fprintf(debugf, " %s", p); +! STRNCPY(&p[last], save, 2); +! } +! else +! fprintf(debugf, " %s", p); + + nfa_set_code(state->c); +! fprintf(debugf, "%s%s (%d) (id=%d)\n", +! state->negated ? "NOT " : "", code, state->c, abs(state->id)); + if (state->id < 0) + return; + + state->id = abs(state->id) * -1; +! +! /* grow indent for state->out */ +! indent->ga_len -= 1; +! if (state->out1) +! ga_concat(indent, "| "); +! else +! ga_concat(indent, " "); +! ga_append(indent, '\0'); +! +! nfa_print_state2(debugf, state->out, indent); +! +! /* replace last part of indent for state->out1 */ +! indent->ga_len -= 3; +! ga_concat(indent, " "); +! ga_append(indent, '\0'); +! +! nfa_print_state2(debugf, state->out1, indent); +! +! /* shrink indent */ +! indent->ga_len -= 3; +! ga_append(indent, '\0'); + } + + /* +*************** +*** 1847,1853 **** + + if (debugf != NULL) + { +! nfa_print_state(debugf, prog->start, 0); + fclose(debugf); + } + } +--- 1893,1899 ---- + + if (debugf != NULL) + { +! nfa_print_state(debugf, prog->start); + fclose(debugf); + } + } +*************** +*** 3505,3511 **** + #endif + fprintf(f, "\tInput text is \"%s\" \n", reginput); + fprintf(f, " =======================================================\n\n\n\n\n\n\n"); +! nfa_print_state(f, start, 0); + fprintf(f, "\n\n"); + fclose(f); + } +--- 3551,3557 ---- + #endif + fprintf(f, "\tInput text is \"%s\" \n", reginput); + fprintf(f, " =======================================================\n\n\n\n\n\n\n"); +! nfa_print_state(f, start); + fprintf(f, "\n\n"); + fclose(f); + } +*** ../vim-7.3.1013/src/version.c 2013-05-25 12:18:34.000000000 +0200 +--- src/version.c 2013-05-25 12:27:22.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1014, + /**/ + +-- +Lower life forms have more fun! + + /// 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 /// diff --git a/7.3.1015 b/7.3.1015 new file mode 100644 index 0000000..91b0d07 --- /dev/null +++ b/7.3.1015 @@ -0,0 +1,172 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1015 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1015 +Problem: New regexp engine: Matching composing characters is wrong. +Solution: Fix matching composing characters. +Files: src/regexp_nfa.c, src/testdir/test95.in, src/testdir/test95.ok + + +*** ../vim-7.3.1014/src/regexp_nfa.c 2013-05-25 12:28:08.000000000 +0200 +--- src/regexp_nfa.c 2013-05-25 14:25:42.000000000 +0200 +*************** +*** 716,721 **** +--- 716,722 ---- + * the composing char is matched here. */ + if (enc_utf8 && c == Magic('.') && utf_iscomposing(peekchr())) + { ++ old_regparse = regparse; + c = getchr(); + goto nfa_do_multibyte; + } +*************** +*** 1217,1225 **** + + nfa_do_multibyte: + /* Length of current char with composing chars. */ +! if (enc_utf8 && clen != (plen = (*mb_ptr2len)(old_regparse))) + { +! /* A base character plus composing characters. + * This requires creating a separate atom as if enclosing + * the characters in (), where NFA_COMPOSING is the ( and + * NFA_END_COMPOSING is the ). Note that right now we are +--- 1218,1228 ---- + + nfa_do_multibyte: + /* Length of current char with composing chars. */ +! if (enc_utf8 && (clen != (plen = (*mb_ptr2len)(old_regparse)) +! || utf_iscomposing(c))) + { +! /* A base character plus composing characters, or just one +! * or more composing characters. + * This requires creating a separate atom as if enclosing + * the characters in (), where NFA_COMPOSING is the ( and + * NFA_END_COMPOSING is the ). Note that right now we are +*************** +*** 1400,1406 **** + /* Save pos after the repeated atom and the \{} */ + new_regparse = regparse; + +- new_regparse = regparse; + quest = (greedy == TRUE? NFA_QUEST : NFA_QUEST_NONGREEDY); + for (i = 0; i < maxval; i++) + { +--- 1403,1408 ---- +*************** +*** 3218,3228 **** + result = OK; + sta = t->state->out; + len = 0; + if (ireg_icombine) + { +! /* If \Z was present, then ignore composing characters. */ + /* TODO: How about negated? */ +! if (sta->c != c) + result = FAIL; + len = n; + while (sta->c != NFA_END_COMPOSING) +--- 3220,3238 ---- + result = OK; + sta = t->state->out; + len = 0; ++ if (utf_iscomposing(sta->c)) ++ { ++ /* Only match composing character(s), ignore base ++ * character. Used for ".{composing}" and "{composing}" ++ * (no preceding character). */ ++ len += mb_char2len(c); ++ } + if (ireg_icombine) + { +! /* If \Z was present, then ignore composing characters. +! * When ignoring the base character this always matches. */ + /* TODO: How about negated? */ +! if (len == 0 && sta->c != c) + result = FAIL; + len = n; + while (sta->c != NFA_END_COMPOSING) +*** ../vim-7.3.1014/src/testdir/test95.in 2013-05-24 23:10:45.000000000 +0200 +--- src/testdir/test95.in 2013-05-25 14:36:50.000000000 +0200 +*************** +*** 38,43 **** +--- 38,52 ---- + :"""" Test composing character matching + :call add(tl, ['.ม', 'xม่x yมy', 'yม']) + :call add(tl, ['.ม่', 'xม่x yมy', 'xม่']) ++ :call add(tl, ["\u05b9", " x\u05b9 ", "x\u05b9"]) ++ :call add(tl, [".\u05b9", " x\u05b9 ", "x\u05b9"]) ++ :call add(tl, ["\u05b9\u05bb", " x\u05b9\u05bb ", "x\u05b9\u05bb"]) ++ :call add(tl, [".\u05b9\u05bb", " x\u05b9\u05bb ", "x\u05b9\u05bb"]) ++ :call add(tl, ["\u05bb\u05b9", " x\u05b9\u05bb "]) ++ :call add(tl, [".\u05bb\u05b9", " x\u05b9\u05bb "]) ++ :call add(tl, ["\u05b9", " y\u05bb x\u05b9 ", "x\u05b9"]) ++ :call add(tl, [".\u05b9", " y\u05bb x\u05b9 ", "x\u05b9"]) ++ + + :"""" Test \Z + :call add(tl, ['ú\Z', 'x']) +*************** +*** 50,55 **** +--- 59,66 ---- + :call add(tl, ["ק\u200d\u05b9x\\Z", "xק\u200dxy", "ק\u200dx"]) + :call add(tl, ["ק\u200dx\\Z", "xק\u200d\u05b9xy", "ק\u200d\u05b9x"]) + :call add(tl, ["ק\u200dx\\Z", "xק\u200dxy", "ק\u200dx"]) ++ :call add(tl, ["\u05b9\\+\\Z", "xyz", "xyz"]) ++ :call add(tl, ["\\Z\u05b9\\+", "xyz", "xyz"]) + + :"""" Combining different tests and features + :call add(tl, ['[^[=a=]]\+', 'ddaãâbcd', 'dd']) +*** ../vim-7.3.1014/src/testdir/test95.ok 2013-05-24 23:10:45.000000000 +0200 +--- src/testdir/test95.ok 2013-05-25 14:36:54.000000000 +0200 +*************** +*** 11,16 **** +--- 11,24 ---- + OK - \%#=1\f\+ + OK - .ม + OK - .ม่ ++ OK - ֹ ++ OK - .ֹ ++ OK - ֹֻ ++ OK - .ֹֻ ++ OK - ֹֻ ++ OK - .ֹֻ ++ OK - ֹ ++ OK - .ֹ + OK - ú\Z + OK - יהוה\Z + OK - יְהוָה\Z +*************** +*** 21,24 **** +--- 29,34 ---- + OK - ק‍ֹx\Z + OK - ק‍x\Z + OK - ק‍x\Z ++ OK - ֹ\+\Z ++ OK - \Zֹ\+ + OK - [^[=a=]]\+ +*** ../vim-7.3.1014/src/version.c 2013-05-25 12:28:08.000000000 +0200 +--- src/version.c 2013-05-25 14:41:05.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1015, + /**/ + +-- +If your company is not involved in something called "ISO 9000" you probably +have no idea what it is. If your company _is_ involved in ISO 9000 then you +definitely have no idea what it is. + (Scott Adams - The Dilbert principle) + + /// 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 /// diff --git a/7.3.1016 b/7.3.1016 new file mode 100644 index 0000000..5c2e52a --- /dev/null +++ b/7.3.1016 @@ -0,0 +1,153 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1016 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1016 +Problem: Unused field in nfa_state. +Solution: Remove lastthread. +Files: src/regexp.h, src/regexp_nfa.c + + +*** ../vim-7.3.1015/src/regexp.h 2013-05-19 19:16:25.000000000 +0200 +--- src/regexp.h 2013-05-25 15:23:33.000000000 +0200 +*************** +*** 74,80 **** + int id; + int lastlist; + int visits; +- thread_T *lastthread; + int negated; + }; + +--- 74,79 ---- +*** ../vim-7.3.1015/src/regexp_nfa.c 2013-05-25 14:41:58.000000000 +0200 +--- src/regexp_nfa.c 2013-05-25 15:23:28.000000000 +0200 +*************** +*** 1865,1880 **** + /* grow indent for state->out */ + indent->ga_len -= 1; + if (state->out1) +! ga_concat(indent, "| "); + else +! ga_concat(indent, " "); + ga_append(indent, '\0'); + + nfa_print_state2(debugf, state->out, indent); + + /* replace last part of indent for state->out1 */ + indent->ga_len -= 3; +! ga_concat(indent, " "); + ga_append(indent, '\0'); + + nfa_print_state2(debugf, state->out1, indent); +--- 1865,1880 ---- + /* grow indent for state->out */ + indent->ga_len -= 1; + if (state->out1) +! ga_concat(indent, (char_u *)"| "); + else +! ga_concat(indent, (char_u *)" "); + ga_append(indent, '\0'); + + nfa_print_state2(debugf, state->out, indent); + + /* replace last part of indent for state->out1 */ + indent->ga_len -= 3; +! ga_concat(indent, (char_u *)" "); + ga_append(indent, '\0'); + + nfa_print_state2(debugf, state->out1, indent); +*************** +*** 1948,1954 **** + + s->id = istate; + s->lastlist = 0; +- s->lastthread = NULL; + s->visits = 0; + s->negated = FALSE; + +--- 1948,1953 ---- +*************** +*** 2498,2503 **** +--- 2497,2503 ---- + { + regsub_T save; + int subidx = 0; ++ thread_T *lastthread; + + if (l == NULL || state == NULL) + return; +*************** +*** 2531,2539 **** + { + /* add the state to the list */ + state->lastlist = lid; +! state->lastthread = &l->t[l->n++]; +! state->lastthread->state = state; +! state->lastthread->sub = *m; + } + } + +--- 2531,2539 ---- + { + /* add the state to the list */ + state->lastlist = lid; +! lastthread = &l->t[l->n++]; +! lastthread->state = state; +! lastthread->sub = *m; + } + } + +*************** +*** 2983,2989 **** + fprintf(log_fd, ">>> Reginput is \"%s\"\n", reginput); + fprintf(log_fd, ">>> Advanced one character ... Current char is %c (code %d) \n", c, (int)c); + fprintf(log_fd, ">>> Thislist has %d states available: ", thislist->n); +! for (i = 0; i< thislist->n; i++) + fprintf(log_fd, "%d ", abs(thislist->t[i].state->id)); + fprintf(log_fd, "\n"); + #endif +--- 2983,2989 ---- + fprintf(log_fd, ">>> Reginput is \"%s\"\n", reginput); + fprintf(log_fd, ">>> Advanced one character ... Current char is %c (code %d) \n", c, (int)c); + fprintf(log_fd, ">>> Thislist has %d states available: ", thislist->n); +! for (i = 0; i < thislist->n; i++) + fprintf(log_fd, "%d ", abs(thislist->t[i].state->id)); + fprintf(log_fd, "\n"); + #endif +*************** +*** 3690,3696 **** + prog->state[i].id = i; + prog->state[i].lastlist = 0; + prog->state[i].visits = 0; +- prog->state[i].lastthread = NULL; + } + + retval = nfa_regtry(prog->start, col); +--- 3690,3695 ---- +*** ../vim-7.3.1015/src/version.c 2013-05-25 14:41:58.000000000 +0200 +--- src/version.c 2013-05-25 15:28:53.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1016, + /**/ + +-- +For large projects, Team Leaders use sophisticated project management software +to keep track of who's doing what. The software collects the lies and guesses +of the project team and organizes them in to instantly outdated charts that +are too boring to look at closely. This is called "planning". + (Scott Adams - The Dilbert principle) + + /// 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 /// diff --git a/7.3.1017 b/7.3.1017 new file mode 100644 index 0000000..6e043e3 --- /dev/null +++ b/7.3.1017 @@ -0,0 +1,416 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1017 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1017 +Problem: Zero width match changes length of match. +Solution: For a zero width match put new states in the current position in + the state list. +Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok, + src/regexp.h + + +*** ../vim-7.3.1016/src/regexp_nfa.c 2013-05-25 15:31:02.000000000 +0200 +--- src/regexp_nfa.c 2013-05-25 20:18:25.000000000 +0200 +*************** +*** 2471,2494 **** + * NFA execution code. + ****************************************************************/ + +! /* thread_T contains runtime information of a NFA state */ +! struct thread + { + nfa_state_T *state; +! regsub_T sub; /* submatch info */ +! }; + + typedef struct + { +! thread_T *t; +! int n; +! } List; + +! static void addstate __ARGS((List *l, nfa_state_T *state, regsub_T *m, int off, int lid, int *match)); + + static void + addstate(l, state, m, off, lid, match) +! List *l; /* runtime state list */ + nfa_state_T *state; /* state to update */ + regsub_T *m; /* pointers to subexpressions */ + int off; /* byte offset, when -1 go to next line */ +--- 2471,2497 ---- + * NFA execution code. + ****************************************************************/ + +! /* nfa_thread_T contains runtime information of a NFA state */ +! typedef struct + { + nfa_state_T *state; +! regsub_T sub; /* Submatch info. TODO: expensive! */ +! } nfa_thread_T; +! + + typedef struct + { +! nfa_thread_T *t; +! int n; +! } nfa_list_T; + +! static void addstate __ARGS((nfa_list_T *l, nfa_state_T *state, regsub_T *m, int off, int lid, int *match)); +! +! static void addstate_here __ARGS((nfa_list_T *l, nfa_state_T *state, regsub_T *m, int lid, int *match, int *ip)); + + static void + addstate(l, state, m, off, lid, match) +! nfa_list_T *l; /* runtime state list */ + nfa_state_T *state; /* state to update */ + regsub_T *m; /* pointers to subexpressions */ + int off; /* byte offset, when -1 go to next line */ +*************** +*** 2497,2503 **** + { + regsub_T save; + int subidx = 0; +! thread_T *lastthread; + + if (l == NULL || state == NULL) + return; +--- 2500,2506 ---- + { + regsub_T save; + int subidx = 0; +! nfa_thread_T *lastthread; + + if (l == NULL || state == NULL) + return; +*************** +*** 2533,2539 **** + state->lastlist = lid; + lastthread = &l->t[l->n++]; + lastthread->state = state; +! lastthread->sub = *m; + } + } + +--- 2536,2542 ---- + state->lastlist = lid; + lastthread = &l->t[l->n++]; + lastthread->state = state; +! lastthread->sub = *m; /* TODO: expensive! */ + } + } + +*************** +*** 2698,2703 **** +--- 2701,2754 ---- + } + + /* ++ * Like addstate(), but the new state(s) are put at position "*ip". ++ * Used for zero-width matches, next state to use is the added one. ++ * This makes sure the order of states to be tried does not change, which ++ * matters for alternatives. ++ */ ++ static void ++ addstate_here(l, state, m, lid, matchp, ip) ++ nfa_list_T *l; /* runtime state list */ ++ nfa_state_T *state; /* state to update */ ++ regsub_T *m; /* pointers to subexpressions */ ++ int lid; ++ int *matchp; /* found match? */ ++ int *ip; ++ { ++ int tlen = l->n; ++ int count; ++ int i = *ip; ++ ++ /* first add the state(s) at the end, so that we know how many there are */ ++ addstate(l, state, m, 0, lid, matchp); ++ ++ /* when "*ip" was at the end of the list, nothing to do */ ++ if (i + 1 == tlen) ++ return; ++ ++ /* re-order to put the new state at the current position */ ++ count = l->n - tlen; ++ if (count > 1) ++ { ++ /* make space for new states, then move them from the ++ * end to the current position */ ++ mch_memmove(&(l->t[i + count]), ++ &(l->t[i + 1]), ++ sizeof(nfa_thread_T) * (l->n - i - 1)); ++ mch_memmove(&(l->t[i]), ++ &(l->t[l->n - 1]), ++ sizeof(nfa_thread_T) * count); ++ } ++ else ++ { ++ /* overwrite the current state */ ++ l->t[i] = l->t[l->n - 1]; ++ } ++ --l->n; ++ *ip = i - 1; ++ } ++ ++ /* + * Check character class "class" against current character c. + */ + static int +*************** +*** 2872,2888 **** + int match = FALSE; + int flag = 0; + int old_reglnum = -1; +! int go_to_nextline; +! thread_T *t; + char_u *old_reginput = NULL; + char_u *old_regline = NULL; +! List list[3]; +! List *listtbl[2][2]; +! List *ll; + int listid = 1; +! List *thislist; +! List *nextlist; +! List *neglist; + int *listids = NULL; + int j = 0; + #ifdef NFA_REGEXP_DEBUG_LOG +--- 2923,2939 ---- + int match = FALSE; + int flag = 0; + int old_reglnum = -1; +! int go_to_nextline = FALSE; +! nfa_thread_T *t; + char_u *old_reginput = NULL; + char_u *old_regline = NULL; +! nfa_list_T list[3]; +! nfa_list_T *listtbl[2][2]; +! nfa_list_T *ll; + int listid = 1; +! nfa_list_T *thislist; +! nfa_list_T *nextlist; +! nfa_list_T *neglist; + int *listids = NULL; + int j = 0; + #ifdef NFA_REGEXP_DEBUG_LOG +*************** +*** 2896,2905 **** + #endif + + /* Allocate memory for the lists of nodes */ +! size = (nstate + 1) * sizeof(thread_T); +! list[0].t = (thread_T *)lalloc(size, TRUE); +! list[1].t = (thread_T *)lalloc(size, TRUE); +! list[2].t = (thread_T *)lalloc(size, TRUE); + if (list[0].t == NULL || list[1].t == NULL || list[2].t == NULL) + goto theend; + vim_memset(list[0].t, 0, size); +--- 2947,2956 ---- + #endif + + /* Allocate memory for the lists of nodes */ +! size = (nstate + 1) * sizeof(nfa_thread_T); +! list[0].t = (nfa_thread_T *)lalloc(size, TRUE); +! list[1].t = (nfa_thread_T *)lalloc(size, TRUE); +! list[2].t = (nfa_thread_T *)lalloc(size, TRUE); + if (list[0].t == NULL || list[1].t == NULL || list[2].t == NULL) + goto theend; + vim_memset(list[0].t, 0, size); +*************** +*** 3056,3063 **** + * nfa_regmatch(). Submatches are stored in *m, and used in + * the parent call. */ + if (start->c == NFA_MOPEN + 0) +! addstate(thislist, t->state->out, &t->sub, 0, listid, +! &match); + else + { + *m = t->sub; +--- 3107,3114 ---- + * nfa_regmatch(). Submatches are stored in *m, and used in + * the parent call. */ + if (start->c == NFA_MOPEN + 0) +! addstate_here(thislist, t->state->out, &t->sub, listid, +! &match, &i); + else + { + *m = t->sub; +*************** +*** 3130,3137 **** + t->sub.end[j] = m->end[j]; + } + /* t->state->out1 is the corresponding END_INVISIBLE node */ +! addstate(thislist, t->state->out1->out, &t->sub, 0, listid, +! &match); + } + else + { +--- 3181,3188 ---- + t->sub.end[j] = m->end[j]; + } + /* t->state->out1 is the corresponding END_INVISIBLE node */ +! addstate_here(thislist, t->state->out1->out, &t->sub, +! listid, &match, &i); + } + else + { +*************** +*** 3142,3155 **** + + case NFA_BOL: + if (reginput == regline) +! addstate(thislist, t->state->out, &t->sub, 0, listid, +! &match); + break; + + case NFA_EOL: + if (c == NUL) +! addstate(thislist, t->state->out, &t->sub, 0, listid, +! &match); + break; + + case NFA_BOW: +--- 3193,3206 ---- + + case NFA_BOL: + if (reginput == regline) +! addstate_here(thislist, t->state->out, &t->sub, listid, +! &match, &i); + break; + + case NFA_EOL: + if (c == NUL) +! addstate_here(thislist, t->state->out, &t->sub, listid, +! &match, &i); + break; + + case NFA_BOW: +*************** +*** 3176,3183 **** + && vim_iswordc_buf(reginput[-1], reg_buf))) + bow = FALSE; + if (bow) +! addstate(thislist, t->state->out, &t->sub, 0, listid, +! &match); + break; + } + +--- 3227,3234 ---- + && vim_iswordc_buf(reginput[-1], reg_buf))) + bow = FALSE; + if (bow) +! addstate_here(thislist, t->state->out, &t->sub, listid, +! &match, &i); + break; + } + +*************** +*** 3204,3211 **** + || (reginput[0] != NUL && vim_iswordc_buf(c, reg_buf))) + eow = FALSE; + if (eow) +! addstate(thislist, t->state->out, &t->sub, 0, listid, +! &match); + break; + } + +--- 3255,3262 ---- + || (reginput[0] != NUL && vim_iswordc_buf(c, reg_buf))) + eow = FALSE; + if (eow) +! addstate_here(thislist, t->state->out, &t->sub, listid, +! &match, &i); + break; + } + +*** ../vim-7.3.1016/src/testdir/test64.in 2013-05-21 13:30:17.000000000 +0200 +--- src/testdir/test64.in 2013-05-25 19:54:40.000000000 +0200 +*************** +*** 270,275 **** +--- 270,276 ---- + :call add(tl, ['aa \zsax', ' ax']) " must match before \zs + :call add(tl, ['abc \zsmatch\ze abc', 'abc abc abc match abc abc', 'match']) + :call add(tl, ['\v(a \zsif .*){2}', 'a if then a if last', 'if last', 'a if last']) ++ :call add(tl, ['\>\zs.', 'aword. ', '.']) + + :"""" Tests for \@ features + :call add(tl, ['abc\@=', 'abc', 'ab']) +*************** +*** 299,304 **** +--- 300,311 ---- + :call add(tl, ['\%u0020', 'yes no', ' ']) + :call add(tl, ['\%U00000020', 'yes no', ' ']) + ++ :"""" Alternatives, must use first longest match ++ :call add(tl, ['goo\|go', 'google', 'goo']) ++ :call add(tl, ['\\zs. + OK - abc\@= + OK - abc\@=cd + OK - abc\@= +*************** +*** 231,234 **** +--- 232,238 ---- + OK - \%x20 + OK - \%u0020 + OK - \%U00000020 ++ OK - goo\|go ++ OK - \ +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1018 +Problem: New regexp engine wastes memory. +Solution: Allocate prog with actual number of states, not estimated maximum + number of sates. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1017/src/regexp_nfa.c 2013-05-25 20:19:45.000000000 +0200 +--- src/regexp_nfa.c 2013-05-25 20:57:21.000000000 +0200 +*************** +*** 3758,3764 **** + char_u *expr; + int re_flags; + { +! nfa_regprog_T *prog; + size_t prog_size; + int *postfix; + +--- 3758,3764 ---- + char_u *expr; + int re_flags; + { +! nfa_regprog_T *prog = NULL; + size_t prog_size; + int *postfix; + +*************** +*** 3774,3788 **** + if (nfa_regcomp_start(expr, re_flags) == FAIL) + return NULL; + +- /* Space for compiled regexp */ +- prog_size = sizeof(nfa_regprog_T) + sizeof(nfa_state_T) * nstate_max; +- prog = (nfa_regprog_T *)lalloc(prog_size, TRUE); +- if (prog == NULL) +- goto fail; +- vim_memset(prog, 0, prog_size); +- + /* Build postfix form of the regexp. Needed to build the NFA +! * (and count its size) */ + postfix = re2post(); + if (postfix == NULL) + goto fail; /* Cascaded (syntax?) error */ +--- 3774,3781 ---- + if (nfa_regcomp_start(expr, re_flags) == FAIL) + return NULL; + + /* Build postfix form of the regexp. Needed to build the NFA +! * (and count its size). */ + postfix = re2post(); + if (postfix == NULL) + goto fail; /* Cascaded (syntax?) error */ +*************** +*** 3809,3814 **** +--- 3802,3814 ---- + * Count number of NFA states in "nstate". Do not build the NFA. + */ + post2nfa(postfix, post_ptr, TRUE); ++ ++ /* Space for compiled regexp */ ++ prog_size = sizeof(nfa_regprog_T) + sizeof(nfa_state_T) * nstate; ++ prog = (nfa_regprog_T *)lalloc(prog_size, TRUE); ++ if (prog == NULL) ++ goto fail; ++ vim_memset(prog, 0, prog_size); + state_ptr = prog->state; + + /* +*** ../vim-7.3.1017/src/version.c 2013-05-25 20:19:45.000000000 +0200 +--- src/version.c 2013-05-25 21:17:39.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1018, + /**/ + +-- +Sometimes you can protect millions of dollars in your budget simply by buying +a bag of cookies, dropping it on the budget anylyst's desk, and saying +something deeply personal such as "How was your weekend, big guy?" + (Scott Adams - The Dilbert principle) + + /// 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 /// diff --git a/7.3.1019 b/7.3.1019 new file mode 100644 index 0000000..481bce0 --- /dev/null +++ b/7.3.1019 @@ -0,0 +1,152 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1019 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1019 +Problem: These do not work with the new regexp engine: \%o123, \%x123, + \%d123, \%u123 and \%U123. +Solution: Implement these items. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1018/src/regexp_nfa.c 2013-05-25 21:18:30.000000000 +0200 +--- src/regexp_nfa.c 2013-05-25 21:56:16.000000000 +0200 +*************** +*** 604,610 **** + char_u *endp; + #ifdef FEAT_MBYTE + char_u *old_regparse = regparse; +- int clen; + int i; + #endif + int extra = 0; +--- 604,609 ---- +*************** +*** 623,637 **** + cpo_bsl = vim_strchr(p_cpo, CPO_BACKSL) != NULL; + + c = getchr(); +- +- #ifdef FEAT_MBYTE +- /* clen has the length of the current char, without composing chars */ +- clen = (*mb_char2len)(c); +- if (has_mbyte && clen > 1) +- goto nfa_do_multibyte; +- #endif + switch (c) + { + case Magic('^'): + EMIT(NFA_BOL); + break; +--- 622,633 ---- + cpo_bsl = vim_strchr(p_cpo, CPO_BACKSL) != NULL; + + c = getchr(); + switch (c) + { ++ case NUL: ++ syntax_error = TRUE; ++ EMSG_RET_FAIL(_("E865: (NFA) Regexp end encountered prematurely")); ++ + case Magic('^'): + EMIT(NFA_BOL); + break; +*************** +*** 747,756 **** + return FAIL; /* cascaded error */ + break; + +- case NUL: +- syntax_error = TRUE; +- EMSG_RET_FAIL(_("E865: (NFA) Regexp end encountered prematurely")); +- + case Magic('|'): + case Magic('&'): + case Magic(')'): +--- 743,748 ---- +*************** +*** 834,844 **** + case 'x': /* %xab hex 2 */ + case 'u': /* %uabcd hex 4 */ + case 'U': /* %U1234abcd hex 8 */ +! /* Not yet supported */ +! return FAIL; + +! c = coll_get_char(); +! EMIT(c); + break; + + /* Catch \%^ and \%$ regardless of where they appear in the +--- 826,851 ---- + case 'x': /* %xab hex 2 */ + case 'u': /* %uabcd hex 4 */ + case 'U': /* %U1234abcd hex 8 */ +! { +! int i; + +! switch (c) +! { +! case 'd': i = getdecchrs(); break; +! case 'o': i = getoctchrs(); break; +! case 'x': i = gethexchrs(2); break; +! case 'u': i = gethexchrs(4); break; +! case 'U': i = gethexchrs(8); break; +! default: i = -1; break; +! } +! +! if (i < 0) +! EMSG2_RET_FAIL( +! _("E678: Invalid character after %s%%[dxouU]"), +! reg_magic == MAGIC_ALL); +! /* TODO: what if a composing character follows? */ +! EMIT(i); +! } + break; + + /* Catch \%^ and \%$ regardless of where they appear in the +*************** +*** 1217,1225 **** + int plen; + + nfa_do_multibyte: +! /* Length of current char with composing chars. */ +! if (enc_utf8 && (clen != (plen = (*mb_ptr2len)(old_regparse)) +! || utf_iscomposing(c))) + { + /* A base character plus composing characters, or just one + * or more composing characters. +--- 1224,1233 ---- + int plen; + + nfa_do_multibyte: +! /* plen is length of current char with composing chars */ +! if (enc_utf8 && ((*mb_char2len)(c) +! != (plen = (*mb_ptr2len)(old_regparse)) +! || utf_iscomposing(c))) + { + /* A base character plus composing characters, or just one + * or more composing characters. +*** ../vim-7.3.1018/src/version.c 2013-05-25 21:18:30.000000000 +0200 +--- src/version.c 2013-05-25 22:00:51.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1019, + /**/ + +-- +The budget process was invented by an alien race of sadistic beings who +resemble large cats. + (Scott Adams - The Dilbert principle) + + /// 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 /// diff --git a/7.3.1020 b/7.3.1020 new file mode 100644 index 0000000..7093a8e --- /dev/null +++ b/7.3.1020 @@ -0,0 +1,1945 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1020 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1020 +Problem: Not all patterns are tested with auto / old / new engine. +Solution: Test patterns with three values of 'regexpengine'. +Files: src/testdir/test64.in, src/testdir/test64.ok, + src/testdir/test95.in, src/testdir/test95.ok + + +*** ../vim-7.3.1019/src/testdir/test64.in 2013-05-25 20:19:45.000000000 +0200 +--- src/testdir/test64.in 2013-05-25 23:11:58.000000000 +0200 +*************** +*** 20,347 **** + :"""" Previously written tests """""""""""""""""""""""""""""""" + :"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +! :call add(tl, ['ab', 'aab', 'ab']) +! :call add(tl, ['b', 'abcdef', 'b']) +! :call add(tl, ['bc*', 'abccccdef', 'bcccc']) +! :call add(tl, ['bc\{-}', 'abccccdef', 'b']) +! :call add(tl, ['bc\{-}\(d\)', 'abccccdef', 'bccccd', 'd']) +! :call add(tl, ['bc*', 'abbdef', 'b']) +! :call add(tl, ['c*', 'ccc', 'ccc']) +! :call add(tl, ['bc*', 'abdef', 'b']) +! :call add(tl, ['c*', 'abdef', '']) +! :call add(tl, ['bc\+', 'abccccdef', 'bcccc']) +! :call add(tl, ['bc\+', 'abdef']) "no match + :" + :"operator \| +! :call add(tl, ['a\|ab', 'cabd', 'a']) "alternation is ordered + :" +! :call add(tl, ['c\?', 'ccb', 'c']) +! :call add(tl, ['bc\?', 'abd', 'b']) +! :call add(tl, ['bc\?', 'abccd', 'bc']) +! :" +! :call add(tl, ['\va{1}', 'ab', 'a']) +! :" +! :call add(tl, ['\va{2}', 'aa', 'aa']) +! :call add(tl, ['\va{2}', 'caad', 'aa']) +! :call add(tl, ['\va{2}', 'aba']) +! :call add(tl, ['\va{2}', 'ab']) +! :call add(tl, ['\va{2}', 'abaa', 'aa']) +! :call add(tl, ['\va{2}', 'aaa', 'aa']) +! :" +! :call add(tl, ['\vb{1}', 'abca', 'b']) +! :call add(tl, ['\vba{2}', 'abaa', 'baa']) +! :call add(tl, ['\vba{3}', 'aabaac']) +! :" +! :call add(tl, ['\v(ab){1}', 'ab', 'ab', 'ab']) +! :call add(tl, ['\v(ab){1}', 'dabc', 'ab', 'ab']) +! :call add(tl, ['\v(ab){1}', 'acb']) +! :" +! :call add(tl, ['\v(ab){0,2}', 'acb', "", ""]) +! :call add(tl, ['\v(ab){0,2}', 'ab', 'ab', 'ab']) +! :call add(tl, ['\v(ab){1,2}', 'ab', 'ab', 'ab']) +! :call add(tl, ['\v(ab){1,2}', 'ababc', 'abab', 'ab']) +! :call add(tl, ['\v(ab){2,4}', 'ababcab', 'abab', 'ab']) +! :call add(tl, ['\v(ab){2,4}', 'abcababa', 'abab', 'ab']) +! :" +! :call add(tl, ['\v(ab){2}', 'abab', 'abab', 'ab']) +! :call add(tl, ['\v(ab){2}', 'cdababe', 'abab', 'ab']) +! :call add(tl, ['\v(ab){2}', 'abac']) +! :call add(tl, ['\v(ab){2}', 'abacabab', 'abab', 'ab']) +! :call add(tl, ['\v((ab){2}){2}', 'abababab', 'abababab', 'abab', 'ab']) +! :call add(tl, ['\v((ab){2}){2}', 'abacabababab', 'abababab', 'abab', 'ab']) +! :" +! :call add(tl, ['\v(a{1}){1}', 'a', 'a', 'a']) +! :call add(tl, ['\v(a{2}){1}', 'aa', 'aa', 'aa']) +! :call add(tl, ['\v(a{2}){1}', 'aaac', 'aa', 'aa']) +! :call add(tl, ['\v(a{2}){1}', 'daaac', 'aa', 'aa']) +! :call add(tl, ['\v(a{1}){2}', 'daaac', 'aa', 'a']) +! :call add(tl, ['\v(a{1}){2}', 'aaa', 'aa', 'a']) +! :call add(tl, ['\v(a{2})+', 'adaac', 'aa', 'aa']) +! :call add(tl, ['\v(a{2})+', 'aa', 'aa', 'aa']) +! :call add(tl, ['\v(a{2}){1}', 'aa', 'aa', 'aa']) +! :call add(tl, ['\v(a{1}){2}', 'aa', 'aa', 'a']) +! :call add(tl, ['\v(a{1}){1}', 'a', 'a', 'a']) +! :call add(tl, ['\v(a{2}){2}', 'aaaa', 'aaaa', 'aa']) +! :call add(tl, ['\v(a{2}){2}', 'aaabaaaa', 'aaaa', 'aa']) +! :" +! :call add(tl, ['\v(a+){2}', 'dadaac', 'aa', 'a']) +! :call add(tl, ['\v(a{3}){2}', 'aaaaaaa', 'aaaaaa', 'aaa']) +! :" +! :call add(tl, ['\v(a{1,2}){2}', 'daaac', 'aaa', 'a']) +! :call add(tl, ['\v(a{1,3}){2}', 'daaaac', 'aaaa', 'a']) +! :call add(tl, ['\v(a{1,3}){2}', 'daaaaac', 'aaaaa', 'aa']) +! :call add(tl, ['\v(a{1,3}){3}', 'daac']) +! :call add(tl, ['\v(a{1,2}){2}', 'dac']) +! :call add(tl, ['\v(a+)+', 'daac', 'aa', 'aa']) +! :call add(tl, ['\v(a+)+', 'aaa', 'aaa', 'aaa']) +! :call add(tl, ['\v(a+){1,2}', 'aaa', 'aaa', 'aaa']) +! :call add(tl, ['\v(a+)(a+)', 'aaa', 'aaa', 'aa', 'a']) +! :call add(tl, ['\v(a{3})+', 'daaaac', 'aaa', 'aaa']) +! :call add(tl, ['\v(a|b|c)+', 'aacb', 'aacb', 'b']) +! :call add(tl, ['\v(a|b|c){2}', 'abcb', 'ab', 'b']) +! :call add(tl, ['\v(abc){2}', 'abcabd', ]) +! :call add(tl, ['\v(abc){2}', 'abdabcabc','abcabc', 'abc']) +! :" +! :call add(tl, ['a*', 'cc', '']) +! :call add(tl, ['\v(a*)+', 'cc', '']) +! :call add(tl, ['\v((ab)+)+', 'ab', 'ab', 'ab', 'ab']) +! :call add(tl, ['\v(((ab)+)+)+', 'ab', 'ab', 'ab', 'ab', 'ab']) +! :call add(tl, ['\v(((ab)+)+)+', 'dababc', 'abab', 'abab', 'abab', 'ab']) +! :call add(tl, ['\v(a{0,2})+', 'cc', '']) +! :call add(tl, ['\v(a*)+', '', '']) +! :call add(tl, ['\v((a*)+)+', '', '']) +! :call add(tl, ['\v((ab)*)+', '', '']) +! :call add(tl, ['\va{1,3}', 'aab', 'aa']) +! :call add(tl, ['\va{2,3}', 'abaa', 'aa']) +! :" +! :call add(tl, ['\v((ab)+|c*)+', 'abcccaba', 'abcccab', '', 'ab']) +! :call add(tl, ['\v(a{2})|(b{3})', 'bbabbbb', 'bbb', '', 'bbb']) +! :call add(tl, ['\va{2}|b{2}', 'abab']) +! :call add(tl, ['\v(a)+|(c)+', 'bbacbaacbbb', 'a', 'a']) +! :call add(tl, ['\vab{2,3}c', 'aabbccccccccccccc', 'abbc']) +! :call add(tl, ['\vab{2,3}c', 'aabbbccccccccccccc', 'abbbc']) +! :call add(tl, ['\vab{2,3}cd{2,3}e', 'aabbbcddee', 'abbbcdde']) +! :call add(tl, ['\va(bc){2}d', 'aabcbfbc' ]) +! :call add(tl, ['\va*a{2}', 'a', ]) +! :call add(tl, ['\va*a{2}', 'aa', 'aa' ]) +! :call add(tl, ['\va*a{2}', 'aaa', 'aaa' ]) +! :call add(tl, ['\va*a{2}', 'bbbabcc', ]) +! :call add(tl, ['\va*b*|a*c*', 'a', 'a']) +! :call add(tl, ['\va{1}b{1}|a{1}b{1}', '']) + :" + :"submatches +! :call add(tl, ['\v(a)', 'ab', 'a', 'a']) +! :call add(tl, ['\v(a)(b)', 'ab', 'ab', 'a', 'b']) +! :call add(tl, ['\v(ab)(b)(c)', 'abbc', 'abbc', 'ab', 'b', 'c']) +! :call add(tl, ['\v((a)(b))', 'ab', 'ab', 'ab', 'a', 'b']) +! :call add(tl, ['\v(a)|(b)', 'ab', 'a', 'a']) + :" +! :call add(tl, ['\v(a*)+', 'aaaa', 'aaaa', '']) +! :call add(tl, ['x', 'abcdef']) + + :"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + :""""" Simple tests """"""""""""""""""""""""""""""""""""""""""" + :"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + + :" Search single groups +! :call add(tl, ['ab', 'aab', 'ab']) +! :call add(tl, ['ab', 'baced']) +! :call add(tl, ['ab', ' ab ', 'ab']) + + :" Search multi-modifiers +! :call add(tl, ['x*', 'xcd', 'x']) +! :call add(tl, ['x*', 'xxxxxxxxxxxxxxxxsofijiojgf', 'xxxxxxxxxxxxxxxx']) +! :call add(tl, ['x*', 'abcdoij', '']) " empty match is good +! :call add(tl, ['x\+', 'abcdoin']) " no match here +! :call add(tl, ['x\+', 'abcdeoijdfxxiuhfij', 'xx']) +! :call add(tl, ['x\+', 'xxxxx', 'xxxxx']) +! :call add(tl, ['x\+', 'abc x siufhiush xxxxxxxxx', 'x']) +! :call add(tl, ['x\=', 'x sdfoij', 'x']) +! :call add(tl, ['x\=', 'abc sfoij', '']) " empty match is good +! :call add(tl, ['x\=', 'xxxxxxxxx c', 'x']) +! :call add(tl, ['x\?', 'x sdfoij', 'x']) +! :call add(tl, ['x\?', 'abc sfoij', '']) " empty match is good +! :call add(tl, ['x\?', 'xxxxxxxxxx c', 'x']) +! +! :call add(tl, ['a\{0,0}', 'abcdfdoij', '']) +! :call add(tl, ['a\{0,1}', 'asiubid axxxaaa', 'a']) " same thing as 'a?' +! :call add(tl, ['a\{1,0}', 'asiubid axxxaaa', 'a']) " same thing as 'a\{0,1}' +! :call add(tl, ['a\{3,6}', 'aa siofuh']) +! :call add(tl, ['a\{3,6}', 'aaaaa asfoij afaa', 'aaaaa']) +! :call add(tl, ['a\{3,6}', 'aaaaaaaa', 'aaaaaa']) +! :call add(tl, ['a\{0}', 'asoiuj', '']) +! :call add(tl, ['a\{2}', 'aaaa', 'aa']) +! :call add(tl, ['a\{2}', 'iuash fiusahfliusah fiushfilushfi uhsaifuh askfj nasfvius afg aaaa sfiuhuhiushf', 'aa']) +! :call add(tl, ['a\{2}', 'abcdefghijklmnopqrestuvwxyz1234567890']) +! :call add(tl, ['a\{0,}', 'oij sdigfusnf', '']) " same thing as 'a*' +! :call add(tl, ['a\{0,}', 'aaaaa aa', 'aaaaa']) +! :call add(tl, ['a\{2,}', 'sdfiougjdsafg']) +! :call add(tl, ['a\{2,}', 'aaaaasfoij ', 'aaaaa']) +! :call add(tl, ['a\{,0}', 'oidfguih iuhi hiu aaaa', '']) +! :call add(tl, ['a\{,5}', 'abcd', 'a']) +! :call add(tl, ['a\{,5}', 'aaaaaaaaaa', 'aaaaa']) +! :call add(tl, ['a\{}', 'bbbcddiuhfcd', '']) " same thing as 'a*' +! :call add(tl, ['a\{}', 'aaaaioudfh coisf jda', 'aaaa']) +! +! :call add(tl, ['a\{-0,0}', 'abcdfdoij', '']) +! :call add(tl, ['a\{-0,1}', 'asiubid axxxaaa', '']) " anti-greedy version of 'a?' +! :call add(tl, ['a\{-3,6}', 'aa siofuh']) +! :call add(tl, ['a\{-3,6}', 'aaaaa asfoij afaa', 'aaa']) +! :call add(tl, ['a\{-3,6}', 'aaaaaaaa', 'aaa']) +! :call add(tl, ['a\{-0}', 'asoiuj', '']) +! :call add(tl, ['a\{-2}', 'aaaa', 'aa']) +! :call add(tl, ['a\{-2}', 'abcdefghijklmnopqrestuvwxyz1234567890']) +! :call add(tl, ['a\{-0,}', 'oij sdigfusnf', '']) +! :call add(tl, ['a\{-0,}', 'aaaaa aa', '']) +! :call add(tl, ['a\{-2,}', 'sdfiougjdsafg']) +! :call add(tl, ['a\{-2,}', 'aaaaasfoij ', 'aa']) +! :call add(tl, ['a\{-,0}', 'oidfguih iuhi hiu aaaa', '']) +! :call add(tl, ['a\{-,5}', 'abcd', '']) +! :call add(tl, ['a\{-,5}', 'aaaaaaaaaa', '']) +! :call add(tl, ['a\{-}', 'bbbcddiuhfcd', '']) " anti-greedy version of 'a*' +! :call add(tl, ['a\{-}', 'aaaaioudfh coisf jda', '']) + + :" Test groups of characters and submatches +! :call add(tl, ['\(abc\)*', 'abcabcabc', 'abcabcabc', 'abc']) +! :call add(tl, ['\(ab\)\+', 'abababaaaaa', 'ababab', 'ab']) +! :call add(tl, ['\(abaaaaa\)*cd', 'cd', 'cd', '']) +! :call add(tl, ['\(test1\)\? \(test2\)\?', 'test1 test3', 'test1 ', 'test1', '']) +! :call add(tl, ['\(test1\)\= \(test2\) \(test4443\)\=', ' test2 test4443 yupiiiiiiiiiii', ' test2 test4443', '', 'test2', 'test4443']) +! :call add(tl, ['\(\(sub1\) hello \(sub 2\)\)', 'asterix sub1 hello sub 2 obelix', 'sub1 hello sub 2', 'sub1 hello sub 2', 'sub1', 'sub 2']) +! :call add(tl, ['\(\(\(yyxxzz\)\)\)', 'abcdddsfiusfyyzzxxyyxxzz', 'yyxxzz', 'yyxxzz', 'yyxxzz', 'yyxxzz']) +! :call add(tl, ['\v((ab)+|c+)+', 'abcccaba', 'abcccab', 'ab', 'ab']) +! :call add(tl, ['\v((ab)|c*)+', 'abcccaba', 'abcccab', '', 'ab']) +! :call add(tl, ['\v(a(c*)+b)+', 'acbababaaa', 'acbabab', 'ab', '']) +! :call add(tl, ['\v(a|b*)+', 'aaaa', 'aaaa', '']) + + :" Test greedy-ness and lazy-ness +! :call add(tl, ['a\{-2,7}','aaaaaaaaaaaaa', 'aa']) +! :call add(tl, ['a\{2,7}','aaaaaaaaaaaaaaaaaaaa', 'aaaaaaa']) +! :call add(tl, ['\vx(.{-,8})yz(.*)','xayxayzxayzxayz','xayxayzxayzxayz','ayxa','xayzxayz']) +! :call add(tl, ['\vx(.*)yz(.*)','xayxayzxayzxayz','xayxayzxayzxayz', 'ayxayzxayzxa','']) +! :call add(tl, ['\v(a{1,2}){-2,3}','aaaaaaa','aaaa','aa']) +! :call add(tl, ['\v(a{-1,3})+','aa','aa','a']) + + :" Test Character classes +! :call add(tl, ['\d\+e\d\d','test 10e23 fd','10e23']) + + :" Test collections and character range [] +! :call add(tl, ['\v[a]', 'abcd', 'a']) +! :call add(tl, ['a[bcd]', 'abcd', 'ab']) +! :call add(tl, ['a[b-d]', 'acbd', 'ac']) +! :call add(tl, ['[a-d][e-f][x-x]d', 'cexdxx', 'cexd']) +! :call add(tl, ['\v[[:alpha:]]+', 'abcdefghijklmnopqrstuvwxyz6','abcdefghijklmnopqrstuvwxyz']) +! :call add(tl, ['[[:alpha:]\+]', '6x8','x']) +! :call add(tl, ['[^abc]\+','abcabcabc']) +! :call add(tl, ['[^abc]','defghiasijvoinasoiunbvb','d']) +! :call add(tl, ['[^abc]\+','ddddddda','ddddddd']) +! :call add(tl, ['[^a-d]\+','aaaAAAZIHFNCddd','AAAZIHFNC']) +! :call add(tl, ['[a-f]*','iiiiiiii','']) +! :call add(tl, ['[a-f]*','abcdefgh','abcdef']) +! :call add(tl, ['[^a-f]\+','abcdefgh','gh']) +! :call add(tl, ['[a-c]\{-3,6}','abcabc','abc']) +! :call add(tl, ['[^[:alpha:]]\+','abcccadfoij7787ysf287yrnccdu','7787']) +! :call add(tl, ['[-a]', '-', '-']) +! :call add(tl, ['[a-]', '-', '-']) +! :call add(tl, ['[-./[:alnum:]_~]\+', 'log13.file', 'log13.file']) " filename regexp +! :call add(tl, ['[\]\^\-\\]\+', '\^\\\-\---^', '\^\\\-\---^']) " special chars +! :call add(tl, ['[[.a.]]\+', 'aa', 'aa']) " collation elem +! :call add(tl, ['abc[0-9]*ddd', 'siuhabc ii']) " middle of regexp +! :call add(tl, ['abc[0-9]*ddd', 'adf abc44482ddd oijs', 'abc44482ddd']) +! :call add(tl, ['\_[0-9]\+', 'asfi9888u', '9888']) +! :call add(tl, ['[0-9\n]\+', 'asfi9888u', '9888']) + + + :"""" Test recognition of some character classes +! :call add(tl, ['[0-9]', '8', '8']) +! :call add(tl, ['[^0-9]', '8']) +! :call add(tl, ['[0-9a-fA-F]*', '0a7', '0a7']) +! :call add(tl, ['[^0-9A-Fa-f]\+', '0a7']) +! :call add(tl, ['[a-z_A-Z0-9]\+', 'aso_sfoij', 'aso_sfoij']) +! :call add(tl, ['[a-z]', 'a', 'a']) +! :call add(tl, ['[a-zA-Z]', 'a', 'a']) +! :call add(tl, ['[A-Z]', 'a']) +! :call add(tl, ['\C[^A-Z]\+', 'ABCOIJDEOIFNSD jsfoij sa', ' jsfoij sa']) + + :"""" Tests for \z features +! :call add(tl, ['xx \ze test', 'xx ']) " must match after \ze +! :call add(tl, ['abc\zeend', 'oij abcend', 'abc']) +! :call add(tl, ['abc\zsdd', 'ddabcddxyzt', 'dd']) +! :call add(tl, ['aa \zsax', ' ax']) " must match before \zs +! :call add(tl, ['abc \zsmatch\ze abc', 'abc abc abc match abc abc', 'match']) +! :call add(tl, ['\v(a \zsif .*){2}', 'a if then a if last', 'if last', 'a if last']) +! :call add(tl, ['\>\zs.', 'aword. ', '.']) + + :"""" Tests for \@ features +! :call add(tl, ['abc\@=', 'abc', 'ab']) +! :call add(tl, ['abc\@=cd', 'abcd', 'abcd']) +! :call add(tl, ['abc\@=', 'ababc', 'ab']) +! :call add(tl, ['abcd\@=e', 'abcd']) " will never match, no matter the input text +! :call add(tl, ['abcd\@=e', 'any text in here ... ']) " will never match +! :call add(tl, ['\v(abc)@=..', 'xabcd', 'ab', 'abc']) +! :call add(tl, ['\(.*John\)\@=.*Bob', 'here is John, and here is B']) " no match +! :call add(tl, ['\(John.*\)\@=.*Bob', 'John is Bobs friend', 'John is Bob', 'John is Bobs friend']) +! :call add(tl, ['.*John\&.*Bob', 'here is John, and here is B']) " no match +! :call add(tl, ['.*John\&.*Bob', 'John is Bobs friend', 'John is Bob']) +! :call add(tl, ['\v(test1)@=.*yep', 'this is a test1, yep it is', 'test1, yep', 'test1']) + + :"""" Combining different tests and features +! :call add(tl, ['[[:alpha:]]\{-2,6}', '787abcdiuhsasiuhb4', 'ab']) +! :call add(tl, ['', 'abcd', '']) +! :call add(tl, ['\v(())', 'any possible text', '']) +! :call add(tl, ['\v%(ab(xyz)c)', ' abxyzc ', 'abxyzc', 'xyz']) +! :call add(tl, ['\v(test|)empty', 'tesempty', 'empty', '']) +! :call add(tl, ['\v(a|aa)(a|aa)', 'aaa', 'aa', 'a', 'a']) + + :"""" \%u and friends +! :call add(tl, ['\%d32', 'yes no', ' ']) +! :call add(tl, ['\%o40', 'yes no', ' ']) +! :call add(tl, ['\%x20', 'yes no', ' ']) +! :call add(tl, ['\%u0020', 'yes no', ' ']) +! :call add(tl, ['\%U00000020', 'yes no', ' ']) + + :"""" Alternatives, must use first longest match +! :call add(tl, ['goo\|go', 'google', 'goo']) +! :call add(tl, ['\ 2 +! : $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", did not match, expected: \"' . t[2] . '\"' +! : elseif len(l) > 0 && len(t) == 2 +! : $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", match: \"' . l[0] . '\", expected no match' +! : elseif len(t) > 2 && l[0] != t[2] +! : $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", match: \"' . l[0] . '\", expected: \"' . t[2] . '\"' +! : else +! : $put ='OK - ' . t[0] +! : endif +! : if len(l) > 0 + :" check all the nine submatches +! : for i in range(1, 9) +! : if len(t) <= i + 2 +! : let e = '' +! : else +! : let e = t[i + 2] +! : endif +! : if l[i] != e +! : $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", submatch ' . i . ': \"' . l[i] . '\", expected: \"' . e . '\"' +! : endif +! : endfor +! : unlet i +! : endif + :endfor + :unlet t tl e l + + :" Check that \_[0-9] matching EOL does not break a following \> + :" This only works on a buffer line, not with expression evaluation + /^Find this +! /\<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\> + y$Gop:" + + :/\%#=1^Results/,$wq! test.out +--- 20,363 ---- + :"""" Previously written tests """""""""""""""""""""""""""""""" + :"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +! :call add(tl, [2, 'ab', 'aab', 'ab']) +! :call add(tl, [2, 'b', 'abcdef', 'b']) +! :call add(tl, [2, 'bc*', 'abccccdef', 'bcccc']) +! :call add(tl, [0, 'bc\{-}', 'abccccdef', 'b']) +! :call add(tl, [0, 'bc\{-}\(d\)', 'abccccdef', 'bccccd', 'd']) +! :call add(tl, [2, 'bc*', 'abbdef', 'b']) +! :call add(tl, [2, 'c*', 'ccc', 'ccc']) +! :call add(tl, [2, 'bc*', 'abdef', 'b']) +! :call add(tl, [2, 'c*', 'abdef', '']) +! :call add(tl, [2, 'bc\+', 'abccccdef', 'bcccc']) +! :call add(tl, [2, 'bc\+', 'abdef']) "no match + :" + :"operator \| +! :call add(tl, [2, 'a\|ab', 'cabd', 'a']) "alternation is ordered + :" +! :call add(tl, [2, 'c\?', 'ccb', 'c']) +! :call add(tl, [2, 'bc\?', 'abd', 'b']) +! :call add(tl, [2, 'bc\?', 'abccd', 'bc']) +! :" +! :call add(tl, [2, '\va{1}', 'ab', 'a']) +! :" +! :call add(tl, [2, '\va{2}', 'aa', 'aa']) +! :call add(tl, [2, '\va{2}', 'caad', 'aa']) +! :call add(tl, [2, '\va{2}', 'aba']) +! :call add(tl, [2, '\va{2}', 'ab']) +! :call add(tl, [2, '\va{2}', 'abaa', 'aa']) +! :call add(tl, [2, '\va{2}', 'aaa', 'aa']) +! :" +! :call add(tl, [2, '\vb{1}', 'abca', 'b']) +! :call add(tl, [2, '\vba{2}', 'abaa', 'baa']) +! :call add(tl, [2, '\vba{3}', 'aabaac']) +! :" +! :call add(tl, [2, '\v(ab){1}', 'ab', 'ab', 'ab']) +! :call add(tl, [2, '\v(ab){1}', 'dabc', 'ab', 'ab']) +! :call add(tl, [2, '\v(ab){1}', 'acb']) +! :" +! :call add(tl, [2, '\v(ab){0,2}', 'acb', "", ""]) +! :call add(tl, [2, '\v(ab){0,2}', 'ab', 'ab', 'ab']) +! :call add(tl, [2, '\v(ab){1,2}', 'ab', 'ab', 'ab']) +! :call add(tl, [2, '\v(ab){1,2}', 'ababc', 'abab', 'ab']) +! :call add(tl, [2, '\v(ab){2,4}', 'ababcab', 'abab', 'ab']) +! :call add(tl, [2, '\v(ab){2,4}', 'abcababa', 'abab', 'ab']) +! :" +! :call add(tl, [2, '\v(ab){2}', 'abab', 'abab', 'ab']) +! :call add(tl, [2, '\v(ab){2}', 'cdababe', 'abab', 'ab']) +! :call add(tl, [2, '\v(ab){2}', 'abac']) +! :call add(tl, [2, '\v(ab){2}', 'abacabab', 'abab', 'ab']) +! :call add(tl, [2, '\v((ab){2}){2}', 'abababab', 'abababab', 'abab', 'ab']) +! :call add(tl, [2, '\v((ab){2}){2}', 'abacabababab', 'abababab', 'abab', 'ab']) +! :" +! :call add(tl, [2, '\v(a{1}){1}', 'a', 'a', 'a']) +! :call add(tl, [2, '\v(a{2}){1}', 'aa', 'aa', 'aa']) +! :call add(tl, [2, '\v(a{2}){1}', 'aaac', 'aa', 'aa']) +! :call add(tl, [2, '\v(a{2}){1}', 'daaac', 'aa', 'aa']) +! :call add(tl, [2, '\v(a{1}){2}', 'daaac', 'aa', 'a']) +! :call add(tl, [2, '\v(a{1}){2}', 'aaa', 'aa', 'a']) +! :call add(tl, [2, '\v(a{2})+', 'adaac', 'aa', 'aa']) +! :call add(tl, [2, '\v(a{2})+', 'aa', 'aa', 'aa']) +! :call add(tl, [2, '\v(a{2}){1}', 'aa', 'aa', 'aa']) +! :call add(tl, [2, '\v(a{1}){2}', 'aa', 'aa', 'a']) +! :call add(tl, [2, '\v(a{1}){1}', 'a', 'a', 'a']) +! :call add(tl, [2, '\v(a{2}){2}', 'aaaa', 'aaaa', 'aa']) +! :call add(tl, [2, '\v(a{2}){2}', 'aaabaaaa', 'aaaa', 'aa']) +! :" +! :call add(tl, [2, '\v(a+){2}', 'dadaac', 'aa', 'a']) +! :call add(tl, [2, '\v(a{3}){2}', 'aaaaaaa', 'aaaaaa', 'aaa']) +! :" +! :call add(tl, [2, '\v(a{1,2}){2}', 'daaac', 'aaa', 'a']) +! :call add(tl, [2, '\v(a{1,3}){2}', 'daaaac', 'aaaa', 'a']) +! :call add(tl, [2, '\v(a{1,3}){2}', 'daaaaac', 'aaaaa', 'aa']) +! :call add(tl, [2, '\v(a{1,3}){3}', 'daac']) +! :call add(tl, [2, '\v(a{1,2}){2}', 'dac']) +! :call add(tl, [2, '\v(a+)+', 'daac', 'aa', 'aa']) +! :call add(tl, [2, '\v(a+)+', 'aaa', 'aaa', 'aaa']) +! :call add(tl, [2, '\v(a+){1,2}', 'aaa', 'aaa', 'aaa']) +! :call add(tl, [2, '\v(a+)(a+)', 'aaa', 'aaa', 'aa', 'a']) +! :call add(tl, [2, '\v(a{3})+', 'daaaac', 'aaa', 'aaa']) +! :call add(tl, [2, '\v(a|b|c)+', 'aacb', 'aacb', 'b']) +! :call add(tl, [2, '\v(a|b|c){2}', 'abcb', 'ab', 'b']) +! :call add(tl, [2, '\v(abc){2}', 'abcabd', ]) +! :call add(tl, [2, '\v(abc){2}', 'abdabcabc','abcabc', 'abc']) +! :" +! :call add(tl, [2, 'a*', 'cc', '']) +! :call add(tl, [2, '\v(a*)+', 'cc', '']) +! :call add(tl, [2, '\v((ab)+)+', 'ab', 'ab', 'ab', 'ab']) +! :call add(tl, [2, '\v(((ab)+)+)+', 'ab', 'ab', 'ab', 'ab', 'ab']) +! :call add(tl, [2, '\v(((ab)+)+)+', 'dababc', 'abab', 'abab', 'abab', 'ab']) +! :call add(tl, [2, '\v(a{0,2})+', 'cc', '']) +! :call add(tl, [2, '\v(a*)+', '', '']) +! :call add(tl, [2, '\v((a*)+)+', '', '']) +! :call add(tl, [2, '\v((ab)*)+', '', '']) +! :call add(tl, [2, '\va{1,3}', 'aab', 'aa']) +! :call add(tl, [2, '\va{2,3}', 'abaa', 'aa']) +! :" +! :call add(tl, [2, '\v((ab)+|c*)+', 'abcccaba', 'abcccab', '', 'ab']) +! :call add(tl, [2, '\v(a{2})|(b{3})', 'bbabbbb', 'bbb', '', 'bbb']) +! :call add(tl, [2, '\va{2}|b{2}', 'abab']) +! :call add(tl, [2, '\v(a)+|(c)+', 'bbacbaacbbb', 'a', 'a']) +! :call add(tl, [2, '\vab{2,3}c', 'aabbccccccccccccc', 'abbc']) +! :call add(tl, [2, '\vab{2,3}c', 'aabbbccccccccccccc', 'abbbc']) +! :call add(tl, [2, '\vab{2,3}cd{2,3}e', 'aabbbcddee', 'abbbcdde']) +! :call add(tl, [2, '\va(bc){2}d', 'aabcbfbc' ]) +! :call add(tl, [2, '\va*a{2}', 'a', ]) +! :call add(tl, [2, '\va*a{2}', 'aa', 'aa' ]) +! :call add(tl, [2, '\va*a{2}', 'aaa', 'aaa' ]) +! :call add(tl, [2, '\va*a{2}', 'bbbabcc', ]) +! :call add(tl, [2, '\va*b*|a*c*', 'a', 'a']) +! :call add(tl, [2, '\va{1}b{1}|a{1}b{1}', '']) + :" + :"submatches +! :call add(tl, [2, '\v(a)', 'ab', 'a', 'a']) +! :call add(tl, [2, '\v(a)(b)', 'ab', 'ab', 'a', 'b']) +! :call add(tl, [2, '\v(ab)(b)(c)', 'abbc', 'abbc', 'ab', 'b', 'c']) +! :call add(tl, [2, '\v((a)(b))', 'ab', 'ab', 'ab', 'a', 'b']) +! :call add(tl, [2, '\v(a)|(b)', 'ab', 'a', 'a']) + :" +! :call add(tl, [2, '\v(a*)+', 'aaaa', 'aaaa', '']) +! :call add(tl, [2, 'x', 'abcdef']) + + :"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + :""""" Simple tests """"""""""""""""""""""""""""""""""""""""""" + :"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + + :" Search single groups +! :call add(tl, [2, 'ab', 'aab', 'ab']) +! :call add(tl, [2, 'ab', 'baced']) +! :call add(tl, [2, 'ab', ' ab ', 'ab']) + + :" Search multi-modifiers +! :call add(tl, [2, 'x*', 'xcd', 'x']) +! :call add(tl, [2, 'x*', 'xxxxxxxxxxxxxxxxsofijiojgf', 'xxxxxxxxxxxxxxxx']) +! :call add(tl, [2, 'x*', 'abcdoij', '']) " empty match is good +! :call add(tl, [2, 'x\+', 'abcdoin']) " no match here +! :call add(tl, [2, 'x\+', 'abcdeoijdfxxiuhfij', 'xx']) +! :call add(tl, [2, 'x\+', 'xxxxx', 'xxxxx']) +! :call add(tl, [2, 'x\+', 'abc x siufhiush xxxxxxxxx', 'x']) +! :call add(tl, [2, 'x\=', 'x sdfoij', 'x']) +! :call add(tl, [2, 'x\=', 'abc sfoij', '']) " empty match is good +! :call add(tl, [2, 'x\=', 'xxxxxxxxx c', 'x']) +! :call add(tl, [2, 'x\?', 'x sdfoij', 'x']) +! :call add(tl, [2, 'x\?', 'abc sfoij', '']) " empty match is good +! :call add(tl, [2, 'x\?', 'xxxxxxxxxx c', 'x']) +! +! :call add(tl, [2, 'a\{0,0}', 'abcdfdoij', '']) +! :call add(tl, [2, 'a\{0,1}', 'asiubid axxxaaa', 'a']) " same thing as 'a?' +! :call add(tl, [2, 'a\{1,0}', 'asiubid axxxaaa', 'a']) " same thing as 'a\{0,1}' +! :call add(tl, [2, 'a\{3,6}', 'aa siofuh']) +! :call add(tl, [2, 'a\{3,6}', 'aaaaa asfoij afaa', 'aaaaa']) +! :call add(tl, [2, 'a\{3,6}', 'aaaaaaaa', 'aaaaaa']) +! :call add(tl, [2, 'a\{0}', 'asoiuj', '']) +! :call add(tl, [2, 'a\{2}', 'aaaa', 'aa']) +! :call add(tl, [2, 'a\{2}', 'iuash fiusahfliusah fiushfilushfi uhsaifuh askfj nasfvius afg aaaa sfiuhuhiushf', 'aa']) +! :call add(tl, [2, 'a\{2}', 'abcdefghijklmnopqrestuvwxyz1234567890']) +! :call add(tl, [2, 'a\{0,}', 'oij sdigfusnf', '']) " same thing as 'a*' +! :call add(tl, [2, 'a\{0,}', 'aaaaa aa', 'aaaaa']) +! :call add(tl, [2, 'a\{2,}', 'sdfiougjdsafg']) +! :call add(tl, [0, 'a\{2,}', 'aaaaasfoij ', 'aaaaa']) +! :call add(tl, [2, 'a\{,0}', 'oidfguih iuhi hiu aaaa', '']) +! :call add(tl, [2, 'a\{,5}', 'abcd', 'a']) +! :call add(tl, [2, 'a\{,5}', 'aaaaaaaaaa', 'aaaaa']) +! :call add(tl, [2, 'a\{}', 'bbbcddiuhfcd', '']) " same thing as 'a*' +! :call add(tl, [2, 'a\{}', 'aaaaioudfh coisf jda', 'aaaa']) +! +! :call add(tl, [2, 'a\{-0,0}', 'abcdfdoij', '']) +! :call add(tl, [2, 'a\{-0,1}', 'asiubid axxxaaa', '']) " anti-greedy version of 'a?' +! :call add(tl, [2, 'a\{-3,6}', 'aa siofuh']) +! :call add(tl, [2, 'a\{-3,6}', 'aaaaa asfoij afaa', 'aaa']) +! :call add(tl, [2, 'a\{-3,6}', 'aaaaaaaa', 'aaa']) +! :call add(tl, [2, 'a\{-0}', 'asoiuj', '']) +! :call add(tl, [2, 'a\{-2}', 'aaaa', 'aa']) +! :call add(tl, [2, 'a\{-2}', 'abcdefghijklmnopqrestuvwxyz1234567890']) +! :call add(tl, [0, 'a\{-0,}', 'oij sdigfusnf', '']) +! :call add(tl, [0, 'a\{-0,}', 'aaaaa aa', '']) +! :call add(tl, [2, 'a\{-2,}', 'sdfiougjdsafg']) +! :call add(tl, [0, 'a\{-2,}', 'aaaaasfoij ', 'aa']) +! :call add(tl, [2, 'a\{-,0}', 'oidfguih iuhi hiu aaaa', '']) +! :call add(tl, [2, 'a\{-,5}', 'abcd', '']) +! :call add(tl, [2, 'a\{-,5}', 'aaaaaaaaaa', '']) +! :call add(tl, [0, 'a\{-}', 'bbbcddiuhfcd', '']) " anti-greedy version of 'a*' +! :call add(tl, [0, 'a\{-}', 'aaaaioudfh coisf jda', '']) + + :" Test groups of characters and submatches +! :call add(tl, [2, '\(abc\)*', 'abcabcabc', 'abcabcabc', 'abc']) +! :call add(tl, [2, '\(ab\)\+', 'abababaaaaa', 'ababab', 'ab']) +! :call add(tl, [2, '\(abaaaaa\)*cd', 'cd', 'cd', '']) +! :call add(tl, [2, '\(test1\)\? \(test2\)\?', 'test1 test3', 'test1 ', 'test1', '']) +! :call add(tl, [2, '\(test1\)\= \(test2\) \(test4443\)\=', ' test2 test4443 yupiiiiiiiiiii', ' test2 test4443', '', 'test2', 'test4443']) +! :call add(tl, [2, '\(\(sub1\) hello \(sub 2\)\)', 'asterix sub1 hello sub 2 obelix', 'sub1 hello sub 2', 'sub1 hello sub 2', 'sub1', 'sub 2']) +! :call add(tl, [2, '\(\(\(yyxxzz\)\)\)', 'abcdddsfiusfyyzzxxyyxxzz', 'yyxxzz', 'yyxxzz', 'yyxxzz', 'yyxxzz']) +! :call add(tl, [2, '\v((ab)+|c+)+', 'abcccaba', 'abcccab', 'ab', 'ab']) +! :call add(tl, [2, '\v((ab)|c*)+', 'abcccaba', 'abcccab', '', 'ab']) +! :call add(tl, [2, '\v(a(c*)+b)+', 'acbababaaa', 'acbabab', 'ab', '']) +! :call add(tl, [2, '\v(a|b*)+', 'aaaa', 'aaaa', '']) + + :" Test greedy-ness and lazy-ness +! :call add(tl, [2, 'a\{-2,7}','aaaaaaaaaaaaa', 'aa']) +! :call add(tl, [2, 'a\{2,7}','aaaaaaaaaaaaaaaaaaaa', 'aaaaaaa']) +! :call add(tl, [2, '\vx(.{-,8})yz(.*)','xayxayzxayzxayz','xayxayzxayzxayz','ayxa','xayzxayz']) +! :call add(tl, [2, '\vx(.*)yz(.*)','xayxayzxayzxayz','xayxayzxayzxayz', 'ayxayzxayzxa','']) +! :call add(tl, [2, '\v(a{1,2}){-2,3}','aaaaaaa','aaaa','aa']) +! :call add(tl, [2, '\v(a{-1,3})+','aa','aa','a']) + + :" Test Character classes +! :call add(tl, [2, '\d\+e\d\d','test 10e23 fd','10e23']) + + :" Test collections and character range [] +! :call add(tl, [2, '\v[a]', 'abcd', 'a']) +! :call add(tl, [2, 'a[bcd]', 'abcd', 'ab']) +! :call add(tl, [2, 'a[b-d]', 'acbd', 'ac']) +! :call add(tl, [2, '[a-d][e-f][x-x]d', 'cexdxx', 'cexd']) +! :call add(tl, [2, '\v[[:alpha:]]+', 'abcdefghijklmnopqrstuvwxyz6','abcdefghijklmnopqrstuvwxyz']) +! :call add(tl, [2, '[[:alpha:]\+]', '6x8','x']) +! :call add(tl, [2, '[^abc]\+','abcabcabc']) +! :call add(tl, [2, '[^abc]','defghiasijvoinasoiunbvb','d']) +! :call add(tl, [2, '[^abc]\+','ddddddda','ddddddd']) +! :call add(tl, [2, '[^a-d]\+','aaaAAAZIHFNCddd','AAAZIHFNC']) +! :call add(tl, [2, '[a-f]*','iiiiiiii','']) +! :call add(tl, [2, '[a-f]*','abcdefgh','abcdef']) +! :call add(tl, [2, '[^a-f]\+','abcdefgh','gh']) +! :call add(tl, [2, '[a-c]\{-3,6}','abcabc','abc']) +! :call add(tl, [2, '[^[:alpha:]]\+','abcccadfoij7787ysf287yrnccdu','7787']) +! :call add(tl, [2, '[-a]', '-', '-']) +! :call add(tl, [2, '[a-]', '-', '-']) +! :call add(tl, [2, '[-./[:alnum:]_~]\+', 'log13.file', 'log13.file']) " filename regexp +! :call add(tl, [2, '[\]\^\-\\]\+', '\^\\\-\---^', '\^\\\-\---^']) " special chars +! :call add(tl, [2, '[[.a.]]\+', 'aa', 'aa']) " collation elem +! :call add(tl, [2, 'abc[0-9]*ddd', 'siuhabc ii']) " middle of regexp +! :call add(tl, [2, 'abc[0-9]*ddd', 'adf abc44482ddd oijs', 'abc44482ddd']) +! :call add(tl, [2, '\_[0-9]\+', 'asfi9888u', '9888']) +! :call add(tl, [2, '[0-9\n]\+', 'asfi9888u', '9888']) + + + :"""" Test recognition of some character classes +! :call add(tl, [2, '[0-9]', '8', '8']) +! :call add(tl, [2, '[^0-9]', '8']) +! :call add(tl, [2, '[0-9a-fA-F]*', '0a7', '0a7']) +! :call add(tl, [2, '[^0-9A-Fa-f]\+', '0a7']) +! :call add(tl, [2, '[a-z_A-Z0-9]\+', 'aso_sfoij', 'aso_sfoij']) +! :call add(tl, [2, '[a-z]', 'a', 'a']) +! :call add(tl, [2, '[a-zA-Z]', 'a', 'a']) +! :call add(tl, [2, '[A-Z]', 'a']) +! :call add(tl, [2, '\C[^A-Z]\+', 'ABCOIJDEOIFNSD jsfoij sa', ' jsfoij sa']) + + :"""" Tests for \z features +! :call add(tl, [2, 'xx \ze test', 'xx ']) " must match after \ze +! :call add(tl, [0, 'abc\zeend', 'oij abcend', 'abc']) +! :call add(tl, [2, 'abc\zsdd', 'ddabcddxyzt', 'dd']) +! :call add(tl, [2, 'aa \zsax', ' ax']) " must match before \zs +! :call add(tl, [0, 'abc \zsmatch\ze abc', 'abc abc abc match abc abc', 'match']) +! :call add(tl, [2, '\v(a \zsif .*){2}', 'a if then a if last', 'if last', 'a if last']) +! :call add(tl, [2, '\>\zs.', 'aword. ', '.']) + + :"""" Tests for \@ features +! :call add(tl, [0, 'abc\@=', 'abc', 'ab']) +! :call add(tl, [0, 'abc\@=cd', 'abcd', 'abcd']) +! :call add(tl, [0, 'abc\@=', 'ababc', 'ab']) +! :call add(tl, [2, 'abcd\@=e', 'abcd']) " will never match, no matter the input text +! :call add(tl, [2, 'abcd\@=e', 'any text in here ... ']) " will never match +! :call add(tl, [0, '\v(abc)@=..', 'xabcd', 'ab', 'abc']) +! :call add(tl, [2, '\(.*John\)\@=.*Bob', 'here is John, and here is B']) " no match +! :call add(tl, [0, '\(John.*\)\@=.*Bob', 'John is Bobs friend', 'John is Bob', 'John is Bobs friend']) +! :call add(tl, [2, '.*John\&.*Bob', 'here is John, and here is B']) " no match +! :call add(tl, [0, '.*John\&.*Bob', 'John is Bobs friend', 'John is Bob']) +! :call add(tl, [0, '\v(test1)@=.*yep', 'this is a test1, yep it is', 'test1, yep', 'test1']) + + :"""" Combining different tests and features +! :call add(tl, [2, '[[:alpha:]]\{-2,6}', '787abcdiuhsasiuhb4', 'ab']) +! :call add(tl, [2, '', 'abcd', '']) +! :call add(tl, [2, '\v(())', 'any possible text', '']) +! :call add(tl, [2, '\v%(ab(xyz)c)', ' abxyzc ', 'abxyzc', 'xyz']) +! :call add(tl, [2, '\v(test|)empty', 'tesempty', 'empty', '']) +! :call add(tl, [2, '\v(a|aa)(a|aa)', 'aaa', 'aa', 'a', 'a']) + + :"""" \%u and friends +! :call add(tl, [2, '\%d32', 'yes no', ' ']) +! :call add(tl, [2, '\%o40', 'yes no', ' ']) +! :call add(tl, [2, '\%x20', 'yes no', ' ']) +! :call add(tl, [2, '\%u0020', 'yes no', ' ']) +! :call add(tl, [2, '\%U00000020', 'yes no', ' ']) + + :"""" Alternatives, must use first longest match +! :call add(tl, [2, 'goo\|go', 'google', 'goo']) +! :call add(tl, [2, '\ matchidx +! : $put ='ERROR: pat: \"' . pat . '\", text: \"' . text . '\", did not match, expected: \"' . t[matchidx] . '\"' +! : elseif len(l) > 0 && len(t) == matchidx +! : $put ='ERROR: pat: \"' . pat . '\", text: \"' . text . '\", match: \"' . l[0] . '\", expected no match' +! : elseif len(t) > matchidx && l[0] != t[matchidx] +! : $put ='ERROR: pat: \"' . pat . '\", text: \"' . text . '\", match: \"' . l[0] . '\", expected: \"' . t[matchidx] . '\"' +! : else +! : $put ='OK ' . engine . ' - ' . pat +! : endif +! : if len(l) > 0 + :" check all the nine submatches +! : for i in range(1, 9) +! : if len(t) <= matchidx + i +! : let e = '' +! : else +! : let e = t[matchidx + i] +! : endif +! : if l[i] != e +! : $put ='ERROR: pat: \"' . pat . '\", text: \"' . text . '\", submatch ' . i . ': \"' . l[i] . '\", expected: \"' . e . '\"' +! : endif +! : endfor +! : unlet i +! : endif +! : endfor + :endfor + :unlet t tl e l + + :" Check that \_[0-9] matching EOL does not break a following \> + :" This only works on a buffer line, not with expression evaluation + /^Find this +! /\%#=0\<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\> +! y$Gop:" +! /^Find this +! /\%#=1\<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\> +! y$Gop:" +! /^Find this +! /\%#=2\<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\> + y$Gop:" + + :/\%#=1^Results/,$wq! test.out +*** ../vim-7.3.1019/src/testdir/test64.ok 2013-05-25 20:19:45.000000000 +0200 +--- src/testdir/test64.ok 2013-05-25 23:12:31.000000000 +0200 +*************** +*** 1,238 **** + Results of test64: +! OK - ab +! OK - b +! OK - bc* +! OK - bc\{-} +! OK - bc\{-}\(d\) +! OK - bc* +! OK - c* +! OK - bc* +! OK - c* +! OK - bc\+ +! OK - bc\+ +! OK - a\|ab +! OK - c\? +! OK - bc\? +! OK - bc\? +! OK - \va{1} +! OK - \va{2} +! OK - \va{2} +! OK - \va{2} +! OK - \va{2} +! OK - \va{2} +! OK - \va{2} +! OK - \vb{1} +! OK - \vba{2} +! OK - \vba{3} +! OK - \v(ab){1} +! OK - \v(ab){1} +! OK - \v(ab){1} +! OK - \v(ab){0,2} +! OK - \v(ab){0,2} +! OK - \v(ab){1,2} +! OK - \v(ab){1,2} +! OK - \v(ab){2,4} +! OK - \v(ab){2,4} +! OK - \v(ab){2} +! OK - \v(ab){2} +! OK - \v(ab){2} +! OK - \v(ab){2} +! OK - \v((ab){2}){2} +! OK - \v((ab){2}){2} +! OK - \v(a{1}){1} +! OK - \v(a{2}){1} +! OK - \v(a{2}){1} +! OK - \v(a{2}){1} +! OK - \v(a{1}){2} +! OK - \v(a{1}){2} +! OK - \v(a{2})+ +! OK - \v(a{2})+ +! OK - \v(a{2}){1} +! OK - \v(a{1}){2} +! OK - \v(a{1}){1} +! OK - \v(a{2}){2} +! OK - \v(a{2}){2} +! OK - \v(a+){2} +! OK - \v(a{3}){2} +! OK - \v(a{1,2}){2} +! OK - \v(a{1,3}){2} +! OK - \v(a{1,3}){2} +! OK - \v(a{1,3}){3} +! OK - \v(a{1,2}){2} +! OK - \v(a+)+ +! OK - \v(a+)+ +! OK - \v(a+){1,2} +! OK - \v(a+)(a+) +! OK - \v(a{3})+ +! OK - \v(a|b|c)+ +! OK - \v(a|b|c){2} +! OK - \v(abc){2} +! OK - \v(abc){2} +! OK - a* +! OK - \v(a*)+ +! OK - \v((ab)+)+ +! OK - \v(((ab)+)+)+ +! OK - \v(((ab)+)+)+ +! OK - \v(a{0,2})+ +! OK - \v(a*)+ +! OK - \v((a*)+)+ +! OK - \v((ab)*)+ +! OK - \va{1,3} +! OK - \va{2,3} +! OK - \v((ab)+|c*)+ +! OK - \v(a{2})|(b{3}) +! OK - \va{2}|b{2} +! OK - \v(a)+|(c)+ +! OK - \vab{2,3}c +! OK - \vab{2,3}c +! OK - \vab{2,3}cd{2,3}e +! OK - \va(bc){2}d +! OK - \va*a{2} +! OK - \va*a{2} +! OK - \va*a{2} +! OK - \va*a{2} +! OK - \va*b*|a*c* +! OK - \va{1}b{1}|a{1}b{1} +! OK - \v(a) +! OK - \v(a)(b) +! OK - \v(ab)(b)(c) +! OK - \v((a)(b)) +! OK - \v(a)|(b) +! OK - \v(a*)+ +! OK - x +! OK - ab +! OK - ab +! OK - ab +! OK - x* +! OK - x* +! OK - x* +! OK - x\+ +! OK - x\+ +! OK - x\+ +! OK - x\+ +! OK - x\= +! OK - x\= +! OK - x\= +! OK - x\? +! OK - x\? +! OK - x\? +! OK - a\{0,0} +! OK - a\{0,1} +! OK - a\{1,0} +! OK - a\{3,6} +! OK - a\{3,6} +! OK - a\{3,6} +! OK - a\{0} +! OK - a\{2} +! OK - a\{2} +! OK - a\{2} +! OK - a\{0,} +! OK - a\{0,} +! OK - a\{2,} +! OK - a\{2,} +! OK - a\{,0} +! OK - a\{,5} +! OK - a\{,5} +! OK - a\{} +! OK - a\{} +! OK - a\{-0,0} +! OK - a\{-0,1} +! OK - a\{-3,6} +! OK - a\{-3,6} +! OK - a\{-3,6} +! OK - a\{-0} +! OK - a\{-2} +! OK - a\{-2} +! OK - a\{-0,} +! OK - a\{-0,} +! OK - a\{-2,} +! OK - a\{-2,} +! OK - a\{-,0} +! OK - a\{-,5} +! OK - a\{-,5} +! OK - a\{-} +! OK - a\{-} +! OK - \(abc\)* +! OK - \(ab\)\+ +! OK - \(abaaaaa\)*cd +! OK - \(test1\)\? \(test2\)\? +! OK - \(test1\)\= \(test2\) \(test4443\)\= +! OK - \(\(sub1\) hello \(sub 2\)\) +! OK - \(\(\(yyxxzz\)\)\) +! OK - \v((ab)+|c+)+ +! OK - \v((ab)|c*)+ +! OK - \v(a(c*)+b)+ +! OK - \v(a|b*)+ +! OK - a\{-2,7} +! OK - a\{2,7} +! OK - \vx(.{-,8})yz(.*) +! OK - \vx(.*)yz(.*) +! OK - \v(a{1,2}){-2,3} +! OK - \v(a{-1,3})+ +! OK - \d\+e\d\d +! OK - \v[a] +! OK - a[bcd] +! OK - a[b-d] +! OK - [a-d][e-f][x-x]d +! OK - \v[[:alpha:]]+ +! OK - [[:alpha:]\+] +! OK - [^abc]\+ +! OK - [^abc] +! OK - [^abc]\+ +! OK - [^a-d]\+ +! OK - [a-f]* +! OK - [a-f]* +! OK - [^a-f]\+ +! OK - [a-c]\{-3,6} +! OK - [^[:alpha:]]\+ +! OK - [-a] +! OK - [a-] +! OK - [-./[:alnum:]_~]\+ +! OK - [\]\^\-\\]\+ +! OK - [[.a.]]\+ +! OK - abc[0-9]*ddd +! OK - abc[0-9]*ddd +! OK - \_[0-9]\+ +! OK - [0-9\n]\+ +! OK - [0-9] +! OK - [^0-9] +! OK - [0-9a-fA-F]* +! OK - [^0-9A-Fa-f]\+ +! OK - [a-z_A-Z0-9]\+ +! OK - [a-z] +! OK - [a-zA-Z] +! OK - [A-Z] +! OK - \C[^A-Z]\+ +! OK - xx \ze test +! OK - abc\zeend +! OK - abc\zsdd +! OK - aa \zsax +! OK - abc \zsmatch\ze abc +! OK - \v(a \zsif .*){2} +! OK - \>\zs. +! OK - abc\@= +! OK - abc\@=cd +! OK - abc\@= +! OK - abcd\@=e +! OK - abcd\@=e +! OK - \v(abc)@=.. +! OK - \(.*John\)\@=.*Bob +! OK - \(John.*\)\@=.*Bob +! OK - .*John\&.*Bob +! OK - .*John\&.*Bob +! OK - \v(test1)@=.*yep +! OK - [[:alpha:]]\{-2,6} +! OK - +! OK - \v(()) +! OK - \v%(ab(xyz)c) +! OK - \v(test|)empty +! OK - \v(a|aa)(a|aa) +! OK - \%d32 +! OK - \%o40 +! OK - \%x20 +! OK - \%u0020 +! OK - \%U00000020 +! OK - goo\|go +! OK - \\zs. +! OK 1 - \>\zs. +! OK 2 - \>\zs. +! OK 0 - abc\@= +! OK 1 - abc\@= +! OK 0 - abc\@=cd +! OK 1 - abc\@=cd +! OK 0 - abc\@= +! OK 1 - abc\@= +! OK 0 - abcd\@=e +! OK 1 - abcd\@=e +! OK 2 - abcd\@=e +! OK 0 - abcd\@=e +! OK 1 - abcd\@=e +! OK 2 - abcd\@=e +! OK 0 - \v(abc)@=.. +! OK 1 - \v(abc)@=.. +! OK 0 - \(.*John\)\@=.*Bob +! OK 1 - \(.*John\)\@=.*Bob +! OK 2 - \(.*John\)\@=.*Bob +! OK 0 - \(John.*\)\@=.*Bob +! OK 1 - \(John.*\)\@=.*Bob +! OK 0 - .*John\&.*Bob +! OK 1 - .*John\&.*Bob +! OK 2 - .*John\&.*Bob +! OK 0 - .*John\&.*Bob +! OK 1 - .*John\&.*Bob +! OK 0 - \v(test1)@=.*yep +! OK 1 - \v(test1)@=.*yep +! OK 0 - [[:alpha:]]\{-2,6} +! OK 1 - [[:alpha:]]\{-2,6} +! OK 2 - [[:alpha:]]\{-2,6} +! OK 0 - +! OK 1 - +! OK 2 - +! OK 0 - \v(()) +! OK 1 - \v(()) +! OK 2 - \v(()) +! OK 0 - \v%(ab(xyz)c) +! OK 1 - \v%(ab(xyz)c) +! OK 2 - \v%(ab(xyz)c) +! OK 0 - \v(test|)empty +! OK 1 - \v(test|)empty +! OK 2 - \v(test|)empty +! OK 0 - \v(a|aa)(a|aa) +! OK 1 - \v(a|aa)(a|aa) +! OK 2 - \v(a|aa)(a|aa) +! OK 0 - \%d32 +! OK 1 - \%d32 +! OK 2 - \%d32 +! OK 0 - \%o40 +! OK 1 - \%o40 +! OK 2 - \%o40 +! OK 0 - \%x20 +! OK 1 - \%x20 +! OK 2 - \%x20 +! OK 0 - \%u0020 +! OK 1 - \%u0020 +! OK 2 - \%u0020 +! OK 0 - \%U00000020 +! OK 1 - \%U00000020 +! OK 2 - \%U00000020 +! OK 0 - goo\|go +! OK 1 - goo\|go +! OK 2 - goo\|go +! OK 0 - \ 2 +! : $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", did not match, expected: \"' . t[2] . '\"' +! : elseif len(l) > 0 && len(t) == 2 +! : $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", match: \"' . l[0] . '\", expected no match' +! : elseif len(t) > 2 && l[0] != t[2] +! : $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", match: \"' . l[0] . '\", expected: \"' . t[2] . '\"' +! : else +! : $put ='OK - ' . t[0] +! : endif +! : if len(l) > 0 + :" check all the nine submatches +! : for i in range(1, 9) +! : if len(t) <= i + 2 +! : let e = '' +! : else +! : let e = t[i + 2] +! : endif +! : if l[i] != e +! : $put ='ERROR: pat: \"' . t[0] . '\", text: \"' . t[1] . '\", submatch ' . i . ': \"' . l[i] . '\", expected: \"' . e . '\"' +! : endif +! : endfor +! : unlet i +! : endif + :endfor + :unlet t tl e l + +--- 20,109 ---- + + :"""" Multi-byte character tests. These will fail unless vim is compiled + :"""" with Multibyte (FEAT_MBYTE) or BIG/HUGE features. +! :call add(tl, [2, '[[:alpha:][=a=]]\+', '879 aiaãâaiuvna ', 'aiaãâaiuvna']) +! :call add(tl, [2, '[[=a=]]\+', 'ddaãâbcd', 'aãâ']) " equivalence classes +! :call add(tl, [2, '[^ม ]\+', 'มม oijasoifjos ifjoisj f osij j มมมมม abcd', 'oijasoifjos']) +! :call add(tl, [2, ' [^ ]\+', 'start มabcdม ', ' มabcdม']) +! :call add(tl, [2, '[ม[:alpha:][=a=]]\+', '879 aiaãมâมaiuvna ', 'aiaãมâมaiuvna']) + + :" this is not a normal "i" but 0xec +! :call add(tl, [2, '\p\+', 'ìa', 'ìa']) + + :"""" Test recognition of some character classes +! :call add(tl, [2, '\i\+', '&*¨xx ', 'xx']) +! :call add(tl, [2, '\f\+', '&*Ÿfname ', 'fname']) + + :"""" Test composing character matching +! :call add(tl, [2, '.ม', 'xม่x yมy', 'yม']) +! :call add(tl, [2, '.ม่', 'xม่x yมy', 'xม่']) +! :call add(tl, [2, "\u05b9", " x\u05b9 ", "x\u05b9"]) +! :call add(tl, [2, ".\u05b9", " x\u05b9 ", "x\u05b9"]) +! :call add(tl, [2, "\u05b9\u05bb", " x\u05b9\u05bb ", "x\u05b9\u05bb"]) +! :call add(tl, [2, ".\u05b9\u05bb", " x\u05b9\u05bb ", "x\u05b9\u05bb"]) +! :"call add(tl, [2, "\u05bb\u05b9", " x\u05b9\u05bb "]) +! :"call add(tl, [2, ".\u05bb\u05b9", " x\u05b9\u05bb "]) +! :call add(tl, [2, "\u05b9", " y\u05bb x\u05b9 ", "x\u05b9"]) +! :call add(tl, [2, ".\u05b9", " y\u05bb x\u05b9 ", "x\u05b9"]) + + + :"""" Test \Z +! :call add(tl, [2, 'ú\Z', 'x']) +! :call add(tl, [2, 'יהוה\Z', 'יהוה', 'יהוה']) +! :call add(tl, [2, 'יְהוָה\Z', 'יהוה', 'יהוה']) +! :call add(tl, [2, 'יהוה\Z', 'יְהוָה', 'יְהוָה']) +! :call add(tl, [2, 'יְהוָה\Z', 'יְהוָה', 'יְהוָה']) +! :call add(tl, [2, 'יְ\Z', 'וְיַ', 'יַ']) +! :call add(tl, [2, "ק\u200d\u05b9x\\Z", "xק\u200d\u05b9xy", "ק\u200d\u05b9x"]) +! :call add(tl, [2, "ק\u200d\u05b9x\\Z", "xק\u200dxy", "ק\u200dx"]) +! :call add(tl, [2, "ק\u200dx\\Z", "xק\u200d\u05b9xy", "ק\u200d\u05b9x"]) +! :call add(tl, [2, "ק\u200dx\\Z", "xק\u200dxy", "ק\u200dx"]) +! :"call add(tl, [2, "\u05b9\\Z", "xyz"]) +! :"call add(tl, [2, "\\Z\u05b9", "xyz"]) +! :"call add(tl, [2, "\u05b9\\+\\Z", "xyz", "xyz"]) +! :"call add(tl, [2, "\\Z\u05b9\\+", "xyz", "xyz"]) + + :"""" Combining different tests and features +! :call add(tl, [2, '[^[=a=]]\+', 'ddaãâbcd', 'dd']) + + :"""" Run the tests ++ + :" + :for t in tl +! : let re = t[0] +! : let pat = t[1] +! : let text = t[2] +! : let matchidx = 3 +! : for engine in [0, 1, 2] +! : if engine == 2 && !re +! : continue +! : endif +! : let ®expengine = engine +! : let l = matchlist(text, pat) + :" check the match itself +! : if len(l) == 0 && len(t) > matchidx +! : $put ='ERROR: pat: \"' . pat . '\", text: \"' . text . '\", did not match, expected: \"' . t[matchidx] . '\"' +! : elseif len(l) > 0 && len(t) == matchidx +! : $put ='ERROR: pat: \"' . pat . '\", text: \"' . text . '\", match: \"' . l[0] . '\", expected no match' +! : elseif len(t) > matchidx && l[0] != t[matchidx] +! : $put ='ERROR: pat: \"' . pat . '\", text: \"' . text . '\", match: \"' . l[0] . '\", expected: \"' . t[matchidx] . '\"' +! : else +! : $put ='OK ' . engine . ' - ' . pat +! : endif +! : if len(l) > 0 + :" check all the nine submatches +! : for i in range(1, 9) +! : if len(t) <= matchidx + i +! : let e = '' +! : else +! : let e = t[matchidx + i] +! : endif +! : if l[i] != e +! : $put ='ERROR: pat: \"' . pat . '\", text: \"' . text . '\", submatch ' . i . ': \"' . l[i] . '\", expected: \"' . e . '\"' +! : endif +! : endfor +! : unlet i +! : endif +! : endfor + :endfor + :unlet t tl e l + +*** ../vim-7.3.1019/src/testdir/test95.ok 2013-05-25 14:41:58.000000000 +0200 +--- src/testdir/test95.ok 2013-05-25 23:06:26.000000000 +0200 +*************** +*** 1,34 **** + Results of test95: +! OK - [[:alpha:][=a=]]\+ +! OK - [[=a=]]\+ +! OK - [^ม ]\+ +! OK - [^ ]\+ +! OK - [ม[:alpha:][=a=]]\+ +! OK - \p\+ +! OK - \i\+ +! OK - \%#=1\i\+ +! OK - \f\+ +! OK - \%#=1\f\+ +! OK - .ม +! OK - .ม่ +! OK - ֹ +! OK - .ֹ +! OK - ֹֻ +! OK - .ֹֻ +! OK - ֹֻ +! OK - .ֹֻ +! OK - ֹ +! OK - .ֹ +! OK - ú\Z +! OK - יהוה\Z +! OK - יְהוָה\Z +! OK - יהוה\Z +! OK - יְהוָה\Z +! OK - יְ\Z +! OK - ק‍ֹx\Z +! OK - ק‍ֹx\Z +! OK - ק‍x\Z +! OK - ק‍x\Z +! OK - ֹ\+\Z +! OK - \Zֹ\+ +! OK - [^[=a=]]\+ +--- 1,82 ---- + Results of test95: +! OK 0 - [[:alpha:][=a=]]\+ +! OK 1 - [[:alpha:][=a=]]\+ +! OK 2 - [[:alpha:][=a=]]\+ +! OK 0 - [[=a=]]\+ +! OK 1 - [[=a=]]\+ +! OK 2 - [[=a=]]\+ +! OK 0 - [^ม ]\+ +! OK 1 - [^ม ]\+ +! OK 2 - [^ม ]\+ +! OK 0 - [^ ]\+ +! OK 1 - [^ ]\+ +! OK 2 - [^ ]\+ +! OK 0 - [ม[:alpha:][=a=]]\+ +! OK 1 - [ม[:alpha:][=a=]]\+ +! OK 2 - [ม[:alpha:][=a=]]\+ +! OK 0 - \p\+ +! OK 1 - \p\+ +! OK 2 - \p\+ +! OK 0 - \i\+ +! OK 1 - \i\+ +! OK 2 - \i\+ +! OK 0 - \f\+ +! OK 1 - \f\+ +! OK 2 - \f\+ +! OK 0 - .ม +! OK 1 - .ม +! OK 2 - .ม +! OK 0 - .ม่ +! OK 1 - .ม่ +! OK 2 - .ม่ +! OK 0 - ֹ +! OK 1 - ֹ +! OK 2 - ֹ +! OK 0 - .ֹ +! OK 1 - .ֹ +! OK 2 - .ֹ +! OK 0 - ֹֻ +! OK 1 - ֹֻ +! OK 2 - ֹֻ +! OK 0 - .ֹֻ +! OK 1 - .ֹֻ +! OK 2 - .ֹֻ +! OK 0 - ֹ +! OK 1 - ֹ +! OK 2 - ֹ +! OK 0 - .ֹ +! OK 1 - .ֹ +! OK 2 - .ֹ +! OK 0 - ú\Z +! OK 1 - ú\Z +! OK 2 - ú\Z +! OK 0 - יהוה\Z +! OK 1 - יהוה\Z +! OK 2 - יהוה\Z +! OK 0 - יְהוָה\Z +! OK 1 - יְהוָה\Z +! OK 2 - יְהוָה\Z +! OK 0 - יהוה\Z +! OK 1 - יהוה\Z +! OK 2 - יהוה\Z +! OK 0 - יְהוָה\Z +! OK 1 - יְהוָה\Z +! OK 2 - יְהוָה\Z +! OK 0 - יְ\Z +! OK 1 - יְ\Z +! OK 2 - יְ\Z +! OK 0 - ק‍ֹx\Z +! OK 1 - ק‍ֹx\Z +! OK 2 - ק‍ֹx\Z +! OK 0 - ק‍ֹx\Z +! OK 1 - ק‍ֹx\Z +! OK 2 - ק‍ֹx\Z +! OK 0 - ק‍x\Z +! OK 1 - ק‍x\Z +! OK 2 - ק‍x\Z +! OK 0 - ק‍x\Z +! OK 1 - ק‍x\Z +! OK 2 - ק‍x\Z +! OK 0 - [^[=a=]]\+ +! OK 1 - [^[=a=]]\+ +! OK 2 - [^[=a=]]\+ +*** ../vim-7.3.1019/src/version.c 2013-05-25 22:04:19.000000000 +0200 +--- src/version.c 2013-05-25 23:10:16.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1020, + /**/ + +-- +Engineers will go without food and hygiene for days to solve a problem. +(Other times just because they forgot.) + (Scott Adams - The Dilbert principle) + + /// 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 /// diff --git a/7.3.1021 b/7.3.1021 new file mode 100644 index 0000000..6d26807 --- /dev/null +++ b/7.3.1021 @@ -0,0 +1,229 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1021 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1021 +Problem: New regexp engine does not ignore order of composing chars. +Solution: Ignore composing chars order. +Files: src/regexp_nfa.c, src/testdir/test95.in, src/testdir/test95.ok + + +*** ../vim-7.3.1020/src/regexp_nfa.c 2013-05-25 22:04:19.000000000 +0200 +--- src/regexp_nfa.c 2013-05-26 14:27:11.000000000 +0200 +*************** +*** 3275,3282 **** + int len = 0; + nfa_state_T *end; + nfa_state_T *sta; + +- result = OK; + sta = t->state->out; + len = 0; + if (utf_iscomposing(sta->c)) +--- 3275,3284 ---- + int len = 0; + nfa_state_T *end; + nfa_state_T *sta; ++ int cchars[MAX_MCO]; ++ int ccount = 0; ++ int j; + + sta = t->state->out; + len = 0; + if (utf_iscomposing(sta->c)) +*************** +*** 3293,3316 **** + /* TODO: How about negated? */ + if (len == 0 && sta->c != c) + result = FAIL; +! len = n; + while (sta->c != NFA_END_COMPOSING) + sta = sta->out; + } +! else +! while (sta->c != NFA_END_COMPOSING && len < n) + { +- if (len > 0) +- mc = mb_ptr2char(reginput + len); +- if (mc != sta->c) +- break; + len += mb_char2len(mc); + sta = sta->out; + } + +! /* if input char length doesn't match regexp char length */ +! if (len < n || sta->c != NFA_END_COMPOSING) + result = FAIL; + end = t->state->out1; /* NFA_END_COMPOSING */ + ADD_POS_NEG_STATE(end); + break; +--- 3295,3346 ---- + /* TODO: How about negated? */ + if (len == 0 && sta->c != c) + result = FAIL; +! else +! result = OK; + while (sta->c != NFA_END_COMPOSING) + sta = sta->out; + } +! +! /* Check base character matches first, unless ignored. */ +! else if (len > 0 || mc == sta->c) +! { +! if (len == 0) + { + len += mb_char2len(mc); + sta = sta->out; + } + +! /* We don't care about the order of composing characters. +! * Get them into cchars[] first. */ +! while (len < n) +! { +! mc = mb_ptr2char(reginput + len); +! cchars[ccount++] = mc; +! len += mb_char2len(mc); +! if (ccount == MAX_MCO) +! break; +! } +! +! /* Check that each composing char in the pattern matches a +! * composing char in the text. We do not check if all +! * composing chars are matched. */ +! result = OK; +! while (sta->c != NFA_END_COMPOSING) +! { +! for (j = 0; j < ccount; ++j) +! if (cchars[j] == sta->c) +! break; +! if (j == ccount) +! { +! result = FAIL; +! break; +! } +! sta = sta->out; +! } +! } +! else + result = FAIL; ++ + end = t->state->out1; /* NFA_END_COMPOSING */ + ADD_POS_NEG_STATE(end); + break; +*** ../vim-7.3.1020/src/testdir/test95.in 2013-05-25 23:15:21.000000000 +0200 +--- src/testdir/test95.in 2013-05-26 14:12:13.000000000 +0200 +*************** +*** 9,14 **** +--- 9,15 ---- + :so mbyte.vim + :set nocp encoding=utf-8 viminfo+=nviminfo nomore + :" tl is a List of Lists with: ++ :" 2: test auto/old/new 0: test auto/old 1: test auto/new + :" regexp pattern + :" text to test the pattern on + :" expected match (optional) +*************** +*** 40,49 **** + :call add(tl, [2, ".\u05b9", " x\u05b9 ", "x\u05b9"]) + :call add(tl, [2, "\u05b9\u05bb", " x\u05b9\u05bb ", "x\u05b9\u05bb"]) + :call add(tl, [2, ".\u05b9\u05bb", " x\u05b9\u05bb ", "x\u05b9\u05bb"]) +! :"call add(tl, [2, "\u05bb\u05b9", " x\u05b9\u05bb "]) +! :"call add(tl, [2, ".\u05bb\u05b9", " x\u05b9\u05bb "]) + :call add(tl, [2, "\u05b9", " y\u05bb x\u05b9 ", "x\u05b9"]) + :call add(tl, [2, ".\u05b9", " y\u05bb x\u05b9 ", "x\u05b9"]) + + + :"""" Test \Z +--- 41,54 ---- + :call add(tl, [2, ".\u05b9", " x\u05b9 ", "x\u05b9"]) + :call add(tl, [2, "\u05b9\u05bb", " x\u05b9\u05bb ", "x\u05b9\u05bb"]) + :call add(tl, [2, ".\u05b9\u05bb", " x\u05b9\u05bb ", "x\u05b9\u05bb"]) +! :call add(tl, [2, "\u05bb\u05b9", " x\u05b9\u05bb ", "x\u05b9\u05bb"]) +! :call add(tl, [2, ".\u05bb\u05b9", " x\u05b9\u05bb ", "x\u05b9\u05bb"]) + :call add(tl, [2, "\u05b9", " y\u05bb x\u05b9 ", "x\u05b9"]) + :call add(tl, [2, ".\u05b9", " y\u05bb x\u05b9 ", "x\u05b9"]) ++ :call add(tl, [2, "\u05b9", " y\u05bb\u05b9 x\u05b9 ", "y\u05bb\u05b9"]) ++ :call add(tl, [2, ".\u05b9", " y\u05bb\u05b9 x\u05b9 ", "y\u05bb\u05b9"]) ++ :call add(tl, [1, "\u05b9\u05bb", " y\u05b9 x\u05b9\u05bb ", "x\u05b9\u05bb"]) ++ :call add(tl, [2, ".\u05b9\u05bb", " y\u05bb x\u05b9\u05bb ", "x\u05b9\u05bb"]) + + + :"""" Test \Z +*************** +*** 74,80 **** + : let text = t[2] + : let matchidx = 3 + : for engine in [0, 1, 2] +! : if engine == 2 && !re + : continue + : endif + : let ®expengine = engine +--- 79,85 ---- + : let text = t[2] + : let matchidx = 3 + : for engine in [0, 1, 2] +! : if engine == 2 && re == 0 || engine == 1 && re == 1 + : continue + : endif + : let ®expengine = engine +*** ../vim-7.3.1020/src/testdir/test95.ok 2013-05-25 23:15:21.000000000 +0200 +--- src/testdir/test95.ok 2013-05-26 14:12:36.000000000 +0200 +*************** +*** 41,52 **** +--- 41,69 ---- + OK 0 - .ֹֻ + OK 1 - .ֹֻ + OK 2 - .ֹֻ ++ OK 0 - ֹֻ ++ OK 1 - ֹֻ ++ OK 2 - ֹֻ ++ OK 0 - .ֹֻ ++ OK 1 - .ֹֻ ++ OK 2 - .ֹֻ + OK 0 - ֹ + OK 1 - ֹ + OK 2 - ֹ + OK 0 - .ֹ + OK 1 - .ֹ + OK 2 - .ֹ ++ OK 0 - ֹ ++ OK 1 - ֹ ++ OK 2 - ֹ ++ OK 0 - .ֹ ++ OK 1 - .ֹ ++ OK 2 - .ֹ ++ OK 0 - ֹֻ ++ OK 2 - ֹֻ ++ OK 0 - .ֹֻ ++ OK 1 - .ֹֻ ++ OK 2 - .ֹֻ + OK 0 - ú\Z + OK 1 - ú\Z + OK 2 - ú\Z +*** ../vim-7.3.1020/src/version.c 2013-05-25 23:15:21.000000000 +0200 +--- src/version.c 2013-05-26 13:54:16.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1021, + /**/ + +-- +Engineers are always delighted to share wisdom, even in areas in which they +have no experience whatsoever. Their logic provides them with inherent +insight into any field of expertise. This can be a problem when dealing with +the illogical people who believe that knowledge can only be derived through +experience. + (Scott Adams - The Dilbert principle) + + /// 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 /// diff --git a/7.3.1022 b/7.3.1022 new file mode 100644 index 0000000..557f0bb --- /dev/null +++ b/7.3.1022 @@ -0,0 +1,873 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1022 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1022 +Problem: Compiler warning for shadowed variable. (John Little) +Solution: Move declaration, rename variables. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1021/src/regexp_nfa.c 2013-05-26 14:32:01.000000000 +0200 +--- src/regexp_nfa.c 2013-05-26 14:50:27.000000000 +0200 +*************** +*** 604,610 **** + char_u *endp; + #ifdef FEAT_MBYTE + char_u *old_regparse = regparse; +- int i; + #endif + int extra = 0; + int first; +--- 604,609 ---- +*************** +*** 827,850 **** + case 'u': /* %uabcd hex 4 */ + case 'U': /* %U1234abcd hex 8 */ + { +! int i; + + switch (c) + { +! case 'd': i = getdecchrs(); break; +! case 'o': i = getoctchrs(); break; +! case 'x': i = gethexchrs(2); break; +! case 'u': i = gethexchrs(4); break; +! case 'U': i = gethexchrs(8); break; +! default: i = -1; break; + } + +! if (i < 0) + EMSG2_RET_FAIL( + _("E678: Invalid character after %s%%[dxouU]"), + reg_magic == MAGIC_ALL); + /* TODO: what if a composing character follows? */ +! EMIT(i); + } + break; + +--- 826,849 ---- + case 'u': /* %uabcd hex 4 */ + case 'U': /* %U1234abcd hex 8 */ + { +! int nr; + + switch (c) + { +! case 'd': nr = getdecchrs(); break; +! case 'o': nr = getoctchrs(); break; +! case 'x': nr = gethexchrs(2); break; +! case 'u': nr = gethexchrs(4); break; +! case 'U': nr = gethexchrs(8); break; +! default: nr = -1; break; + } + +! if (nr < 0) + EMSG2_RET_FAIL( + _("E678: Invalid character after %s%%[dxouU]"), + reg_magic == MAGIC_ALL); + /* TODO: what if a composing character follows? */ +! EMIT(nr); + } + break; + +*************** +*** 1229,1234 **** +--- 1228,1235 ---- + != (plen = (*mb_ptr2len)(old_regparse)) + || utf_iscomposing(c))) + { ++ int i = 0; ++ + /* A base character plus composing characters, or just one + * or more composing characters. + * This requires creating a separate atom as if enclosing +*************** +*** 1237,1243 **** + * building the postfix form, not the NFA itself; + * a composing char could be: a, b, c, NFA_COMPOSING + * where 'b' and 'c' are chars with codes > 256. */ +- i = 0; + for (;;) + { + EMIT(c); +--- 1238,1243 ---- +*************** +*** 2923,2931 **** + regsub_T *submatch; + regsub_T *m; + { +- int c; +- int n; +- int i = 0; + int result; + int size = 0; + int match = FALSE; +--- 2923,2928 ---- +*************** +*** 2939,2944 **** +--- 2936,2942 ---- + nfa_list_T *listtbl[2][2]; + nfa_list_T *ll; + int listid = 1; ++ int listidx; + nfa_list_T *thislist; + nfa_list_T *nextlist; + nfa_list_T *neglist; +*************** +*** 3004,3010 **** + #define ADD_POS_NEG_STATE(node) \ + ll = listtbl[result ? 1 : 0][node->negated]; \ + if (ll != NULL) \ +! addstate(ll, node->out , &t->sub, n, listid + 1, &match); + + + /* +--- 3002,3008 ---- + #define ADD_POS_NEG_STATE(node) \ + ll = listtbl[result ? 1 : 0][node->negated]; \ + if (ll != NULL) \ +! addstate(ll, node->out , &t->sub, clen, listid + 1, &match); + + + /* +*************** +*** 3012,3032 **** + */ + for (;;) + { + #ifdef FEAT_MBYTE + if (has_mbyte) + { +! c = (*mb_ptr2char)(reginput); +! n = (*mb_ptr2len)(reginput); + } + else + #endif + { +! c = *reginput; +! n = 1; + } +! if (c == NUL) + { +! n = 0; + go_to_nextline = FALSE; + } + +--- 3010,3033 ---- + */ + for (;;) + { ++ int curc; ++ int clen; ++ + #ifdef FEAT_MBYTE + if (has_mbyte) + { +! curc = (*mb_ptr2char)(reginput); +! clen = (*mb_ptr2len)(reginput); + } + else + #endif + { +! curc = *reginput; +! clen = 1; + } +! if (curc == NUL) + { +! clen = 0; + go_to_nextline = FALSE; + } + +*************** +*** 3040,3049 **** + #ifdef ENABLE_LOG + fprintf(log_fd, "------------------------------------------\n"); + fprintf(log_fd, ">>> Reginput is \"%s\"\n", reginput); +! fprintf(log_fd, ">>> Advanced one character ... Current char is %c (code %d) \n", c, (int)c); + fprintf(log_fd, ">>> Thislist has %d states available: ", thislist->n); +! for (i = 0; i < thislist->n; i++) +! fprintf(log_fd, "%d ", abs(thislist->t[i].state->id)); + fprintf(log_fd, "\n"); + #endif + +--- 3041,3054 ---- + #ifdef ENABLE_LOG + fprintf(log_fd, "------------------------------------------\n"); + fprintf(log_fd, ">>> Reginput is \"%s\"\n", reginput); +! fprintf(log_fd, ">>> Advanced one character ... Current char is %c (code %d) \n", curc, (int)curc); + fprintf(log_fd, ">>> Thislist has %d states available: ", thislist->n); +! { +! int i; +! +! for (i = 0; i < thislist->n; i++) +! fprintf(log_fd, "%d ", abs(thislist->t[i].state->id)); +! } + fprintf(log_fd, "\n"); + #endif + +*************** +*** 3057,3072 **** + break; + + /* compute nextlist */ +! for (i = 0; i < thislist->n || neglist->n > 0; ++i) + { + if (neglist->n > 0) + { + t = &neglist->t[0]; + neglist->n--; +! i--; + } + else +! t = &thislist->t[i]; + + #ifdef NFA_REGEXP_DEBUG_LOG + nfa_set_code(t->state->c); +--- 3062,3077 ---- + break; + + /* compute nextlist */ +! for (listidx = 0; listidx < thislist->n || neglist->n > 0; ++listidx) + { + if (neglist->n > 0) + { + t = &neglist->t[0]; + neglist->n--; +! listidx--; + } + else +! t = &thislist->t[listidx]; + + #ifdef NFA_REGEXP_DEBUG_LOG + nfa_set_code(t->state->c); +*************** +*** 3116,3122 **** + * the parent call. */ + if (start->c == NFA_MOPEN + 0) + addstate_here(thislist, t->state->out, &t->sub, listid, +! &match, &i); + else + { + *m = t->sub; +--- 3121,3127 ---- + * the parent call. */ + if (start->c == NFA_MOPEN + 0) + addstate_here(thislist, t->state->out, &t->sub, listid, +! &match, &listidx); + else + { + *m = t->sub; +*************** +*** 3190,3196 **** + } + /* t->state->out1 is the corresponding END_INVISIBLE node */ + addstate_here(thislist, t->state->out1->out, &t->sub, +! listid, &match, &i); + } + else + { +--- 3195,3201 ---- + } + /* t->state->out1 is the corresponding END_INVISIBLE node */ + addstate_here(thislist, t->state->out1->out, &t->sub, +! listid, &match, &listidx); + } + else + { +*************** +*** 3202,3221 **** + case NFA_BOL: + if (reginput == regline) + addstate_here(thislist, t->state->out, &t->sub, listid, +! &match, &i); + break; + + case NFA_EOL: +! if (c == NUL) + addstate_here(thislist, t->state->out, &t->sub, listid, +! &match, &i); + break; + + case NFA_BOW: + { + int bow = TRUE; + +! if (c == NUL) + bow = FALSE; + #ifdef FEAT_MBYTE + else if (has_mbyte) +--- 3207,3226 ---- + case NFA_BOL: + if (reginput == regline) + addstate_here(thislist, t->state->out, &t->sub, listid, +! &match, &listidx); + break; + + case NFA_EOL: +! if (curc == NUL) + addstate_here(thislist, t->state->out, &t->sub, listid, +! &match, &listidx); + break; + + case NFA_BOW: + { + int bow = TRUE; + +! if (curc == NUL) + bow = FALSE; + #ifdef FEAT_MBYTE + else if (has_mbyte) +*************** +*** 3230,3242 **** + bow = FALSE; + } + #endif +! else if (!vim_iswordc_buf(c, reg_buf) + || (reginput > regline + && vim_iswordc_buf(reginput[-1], reg_buf))) + bow = FALSE; + if (bow) + addstate_here(thislist, t->state->out, &t->sub, listid, +! &match, &i); + break; + } + +--- 3235,3247 ---- + bow = FALSE; + } + #endif +! else if (!vim_iswordc_buf(curc, reg_buf) + || (reginput > regline + && vim_iswordc_buf(reginput[-1], reg_buf))) + bow = FALSE; + if (bow) + addstate_here(thislist, t->state->out, &t->sub, listid, +! &match, &listidx); + break; + } + +*************** +*** 3260,3277 **** + } + #endif + else if (!vim_iswordc_buf(reginput[-1], reg_buf) +! || (reginput[0] != NUL && vim_iswordc_buf(c, reg_buf))) + eow = FALSE; + if (eow) + addstate_here(thislist, t->state->out, &t->sub, listid, +! &match, &i); + break; + } + + #ifdef FEAT_MBYTE + case NFA_COMPOSING: + { +! int mc = c; + int len = 0; + nfa_state_T *end; + nfa_state_T *sta; +--- 3265,3283 ---- + } + #endif + else if (!vim_iswordc_buf(reginput[-1], reg_buf) +! || (reginput[0] != NUL +! && vim_iswordc_buf(curc, reg_buf))) + eow = FALSE; + if (eow) + addstate_here(thislist, t->state->out, &t->sub, listid, +! &match, &listidx); + break; + } + + #ifdef FEAT_MBYTE + case NFA_COMPOSING: + { +! int mc = curc; + int len = 0; + nfa_state_T *end; + nfa_state_T *sta; +*************** +*** 3286,3299 **** + /* Only match composing character(s), ignore base + * character. Used for ".{composing}" and "{composing}" + * (no preceding character). */ +! len += mb_char2len(c); + } + if (ireg_icombine) + { + /* If \Z was present, then ignore composing characters. + * When ignoring the base character this always matches. */ + /* TODO: How about negated? */ +! if (len == 0 && sta->c != c) + result = FAIL; + else + result = OK; +--- 3292,3305 ---- + /* Only match composing character(s), ignore base + * character. Used for ".{composing}" and "{composing}" + * (no preceding character). */ +! len += mb_char2len(mc); + } + if (ireg_icombine) + { + /* If \Z was present, then ignore composing characters. + * When ignoring the base character this always matches. */ + /* TODO: How about negated? */ +! if (len == 0 && sta->c != curc) + result = FAIL; + else + result = OK; +*************** +*** 3312,3318 **** + + /* We don't care about the order of composing characters. + * Get them into cchars[] first. */ +! while (len < n) + { + mc = mb_ptr2char(reginput + len); + cchars[ccount++] = mc; +--- 3318,3324 ---- + + /* We don't care about the order of composing characters. + * Get them into cchars[] first. */ +! while (len < clen) + { + mc = mb_ptr2char(reginput + len); + cchars[ccount++] = mc; +*************** +*** 3349,3355 **** + + case NFA_NEWL: + if (!reg_line_lbr && REG_MULTI +! && c == NUL && reglnum <= reg_maxline) + { + go_to_nextline = TRUE; + /* Pass -1 for the offset, which means taking the position +--- 3355,3361 ---- + + case NFA_NEWL: + if (!reg_line_lbr && REG_MULTI +! && curc == NUL && reglnum <= reg_maxline) + { + go_to_nextline = TRUE; + /* Pass -1 for the offset, which means taking the position +*************** +*** 3375,3409 **** + case NFA_CLASS_RETURN: + case NFA_CLASS_BACKSPACE: + case NFA_CLASS_ESCAPE: +! result = check_char_class(t->state->c, c); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_END_NEG_RANGE: + /* This follows a series of negated nodes, like: + * CHAR(x), NFA_NOT, CHAR(y), NFA_NOT etc. */ +! if (c > 0) +! addstate(nextlist, t->state->out, &t->sub, n, listid + 1, +! &match); + break; + + case NFA_ANY: + /* Any char except '\0', (end of input) does not match. */ +! if (c > 0) +! addstate(nextlist, t->state->out, &t->sub, n, listid + 1, +! &match); + break; + + /* + * Character classes like \a for alpha, \d for digit etc. + */ + case NFA_IDENT: /* \i */ +! result = vim_isIDc(c); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_SIDENT: /* \I */ +! result = !VIM_ISDIGIT(c) && vim_isIDc(c); + ADD_POS_NEG_STATE(t->state); + break; + +--- 3381,3415 ---- + case NFA_CLASS_RETURN: + case NFA_CLASS_BACKSPACE: + case NFA_CLASS_ESCAPE: +! result = check_char_class(t->state->c, curc); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_END_NEG_RANGE: + /* This follows a series of negated nodes, like: + * CHAR(x), NFA_NOT, CHAR(y), NFA_NOT etc. */ +! if (curc > 0) +! addstate(nextlist, t->state->out, &t->sub, clen, +! listid + 1, &match); + break; + + case NFA_ANY: + /* Any char except '\0', (end of input) does not match. */ +! if (curc > 0) +! addstate(nextlist, t->state->out, &t->sub, clen, +! listid + 1, &match); + break; + + /* + * Character classes like \a for alpha, \d for digit etc. + */ + case NFA_IDENT: /* \i */ +! result = vim_isIDc(curc); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_SIDENT: /* \I */ +! result = !VIM_ISDIGIT(curc) && vim_isIDc(curc); + ADD_POS_NEG_STATE(t->state); + break; + +*************** +*** 3413,3429 **** + break; + + case NFA_SKWORD: /* \K */ +! result = !VIM_ISDIGIT(c) && vim_iswordp_buf(reginput, reg_buf); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_FNAME: /* \f */ +! result = vim_isfilec(c); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_SFNAME: /* \F */ +! result = !VIM_ISDIGIT(c) && vim_isfilec(c); + ADD_POS_NEG_STATE(t->state); + break; + +--- 3419,3436 ---- + break; + + case NFA_SKWORD: /* \K */ +! result = !VIM_ISDIGIT(curc) +! && vim_iswordp_buf(reginput, reg_buf); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_FNAME: /* \f */ +! result = vim_isfilec(curc); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_SFNAME: /* \F */ +! result = !VIM_ISDIGIT(curc) && vim_isfilec(curc); + ADD_POS_NEG_STATE(t->state); + break; + +*************** +*** 3433,3529 **** + break; + + case NFA_SPRINT: /* \P */ +! result = !VIM_ISDIGIT(c) && ptr2cells(reginput) == 1; + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_WHITE: /* \s */ +! result = vim_iswhite(c); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NWHITE: /* \S */ +! result = c != NUL && !vim_iswhite(c); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_DIGIT: /* \d */ +! result = ri_digit(c); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NDIGIT: /* \D */ +! result = c != NUL && !ri_digit(c); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_HEX: /* \x */ +! result = ri_hex(c); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NHEX: /* \X */ +! result = c != NUL && !ri_hex(c); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_OCTAL: /* \o */ +! result = ri_octal(c); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NOCTAL: /* \O */ +! result = c != NUL && !ri_octal(c); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_WORD: /* \w */ +! result = ri_word(c); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NWORD: /* \W */ +! result = c != NUL && !ri_word(c); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_HEAD: /* \h */ +! result = ri_head(c); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NHEAD: /* \H */ +! result = c != NUL && !ri_head(c); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_ALPHA: /* \a */ +! result = ri_alpha(c); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NALPHA: /* \A */ +! result = c != NUL && !ri_alpha(c); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_LOWER: /* \l */ +! result = ri_lower(c); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NLOWER: /* \L */ +! result = c != NUL && !ri_lower(c); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_UPPER: /* \u */ +! result = ri_upper(c); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NUPPER: /* \U */ +! result = c != NUL && !ri_upper(c); + ADD_POS_NEG_STATE(t->state); + break; + +--- 3440,3536 ---- + break; + + case NFA_SPRINT: /* \P */ +! result = !VIM_ISDIGIT(curc) && ptr2cells(reginput) == 1; + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_WHITE: /* \s */ +! result = vim_iswhite(curc); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NWHITE: /* \S */ +! result = curc != NUL && !vim_iswhite(curc); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_DIGIT: /* \d */ +! result = ri_digit(curc); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NDIGIT: /* \D */ +! result = curc != NUL && !ri_digit(curc); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_HEX: /* \x */ +! result = ri_hex(curc); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NHEX: /* \X */ +! result = curc != NUL && !ri_hex(curc); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_OCTAL: /* \o */ +! result = ri_octal(curc); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NOCTAL: /* \O */ +! result = curc != NUL && !ri_octal(curc); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_WORD: /* \w */ +! result = ri_word(curc); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NWORD: /* \W */ +! result = curc != NUL && !ri_word(curc); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_HEAD: /* \h */ +! result = ri_head(curc); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NHEAD: /* \H */ +! result = curc != NUL && !ri_head(curc); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_ALPHA: /* \a */ +! result = ri_alpha(curc); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NALPHA: /* \A */ +! result = curc != NUL && !ri_alpha(curc); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_LOWER: /* \l */ +! result = ri_lower(curc); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NLOWER: /* \L */ +! result = curc != NUL && !ri_lower(curc); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_UPPER: /* \u */ +! result = ri_upper(curc); + ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NUPPER: /* \U */ +! result = curc != NUL && !ri_upper(curc); + ADD_POS_NEG_STATE(t->state); + break; + +*************** +*** 3549,3565 **** + /* TODO: put this in #ifdef later */ + if (t->state->c < -256) + EMSGN("INTERNAL: Negative state char: %ld", t->state->c); +! result = (no_Magic(t->state->c) == c); + + if (!result) + result = ireg_ic == TRUE +! && MB_TOLOWER(t->state->c) == MB_TOLOWER(c); + #ifdef FEAT_MBYTE + /* If there is a composing character which is not being + * ignored there can be no match. Match with composing + * character uses NFA_COMPOSING above. */ + if (result && enc_utf8 && !ireg_icombine +! && n != utf_char2len(c)) + result = FALSE; + #endif + ADD_POS_NEG_STATE(t->state); +--- 3556,3572 ---- + /* TODO: put this in #ifdef later */ + if (t->state->c < -256) + EMSGN("INTERNAL: Negative state char: %ld", t->state->c); +! result = (no_Magic(t->state->c) == curc); + + if (!result) + result = ireg_ic == TRUE +! && MB_TOLOWER(t->state->c) == MB_TOLOWER(curc); + #ifdef FEAT_MBYTE + /* If there is a composing character which is not being + * ignored there can be no match. Match with composing + * character uses NFA_COMPOSING above. */ + if (result && enc_utf8 && !ireg_icombine +! && clen != utf_char2len(curc)) + result = FALSE; + #endif + ADD_POS_NEG_STATE(t->state); +*************** +*** 3578,3598 **** + #ifdef ENABLE_LOG + fprintf(log_fd, "(---) STARTSTATE\n"); + #endif +! addstate(nextlist, start, m, n, listid + 1, &match); + } + + #ifdef ENABLE_LOG + fprintf(log_fd, ">>> Thislist had %d states available: ", thislist->n); +! for (i = 0; i< thislist->n; i++) +! fprintf(log_fd, "%d ", abs(thislist->t[i].state->id)); + fprintf(log_fd, "\n"); + #endif + + nextchar: + /* Advance to the next character, or advance to the next line, or + * finish. */ +! if (n != 0) +! reginput += n; + else if (go_to_nextline) + reg_nextline(); + else +--- 3585,3609 ---- + #ifdef ENABLE_LOG + fprintf(log_fd, "(---) STARTSTATE\n"); + #endif +! addstate(nextlist, start, m, clen, listid + 1, &match); + } + + #ifdef ENABLE_LOG + fprintf(log_fd, ">>> Thislist had %d states available: ", thislist->n); +! { +! int i; +! +! for (i = 0; i < thislist->n; i++) +! fprintf(log_fd, "%d ", abs(thislist->t[i].state->id)); +! } + fprintf(log_fd, "\n"); + #endif + + nextchar: + /* Advance to the next character, or advance to the next line, or + * finish. */ +! if (clen != 0) +! reginput += clen; + else if (go_to_nextline) + reg_nextline(); + else +*** ../vim-7.3.1021/src/version.c 2013-05-26 14:32:01.000000000 +0200 +--- src/version.c 2013-05-26 14:39:12.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1022, + /**/ + +-- +Female engineers become irresistible at the age of consent and remain that +way until about thirty minutes after their clinical death. Longer if it's a +warm day. + (Scott Adams - The Dilbert principle) + + /// 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 /// diff --git a/7.3.1023 b/7.3.1023 new file mode 100644 index 0000000..1d2c03e --- /dev/null +++ b/7.3.1023 @@ -0,0 +1,109 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1023 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1023 +Problem: Searching for composing char only and using \Z has different + results. +Solution: Make it match the composing char, matching everything is not + useful. +Files: src/regexp_nfa.c, src/testdir/test95.in, src/testdir/test95.ok + + +*** ../vim-7.3.1022/src/regexp_nfa.c 2013-05-26 14:54:07.000000000 +0200 +--- src/regexp_nfa.c 2013-05-26 15:02:26.000000000 +0200 +*************** +*** 3294,3300 **** + * (no preceding character). */ + len += mb_char2len(mc); + } +! if (ireg_icombine) + { + /* If \Z was present, then ignore composing characters. + * When ignoring the base character this always matches. */ +--- 3294,3300 ---- + * (no preceding character). */ + len += mb_char2len(mc); + } +! if (ireg_icombine && len == 0) + { + /* If \Z was present, then ignore composing characters. + * When ignoring the base character this always matches. */ +*** ../vim-7.3.1022/src/testdir/test95.in 2013-05-26 14:32:01.000000000 +0200 +--- src/testdir/test95.in 2013-05-26 15:07:01.000000000 +0200 +*************** +*** 62,71 **** + :call add(tl, [2, "ק\u200d\u05b9x\\Z", "xק\u200dxy", "ק\u200dx"]) + :call add(tl, [2, "ק\u200dx\\Z", "xק\u200d\u05b9xy", "ק\u200d\u05b9x"]) + :call add(tl, [2, "ק\u200dx\\Z", "xק\u200dxy", "ק\u200dx"]) +! :"call add(tl, [2, "\u05b9\\Z", "xyz"]) +! :"call add(tl, [2, "\\Z\u05b9", "xyz"]) +! :"call add(tl, [2, "\u05b9\\+\\Z", "xyz", "xyz"]) +! :"call add(tl, [2, "\\Z\u05b9\\+", "xyz", "xyz"]) + + :"""" Combining different tests and features + :call add(tl, [2, '[^[=a=]]\+', 'ddaãâbcd', 'dd']) +--- 62,73 ---- + :call add(tl, [2, "ק\u200d\u05b9x\\Z", "xק\u200dxy", "ק\u200dx"]) + :call add(tl, [2, "ק\u200dx\\Z", "xק\u200d\u05b9xy", "ק\u200d\u05b9x"]) + :call add(tl, [2, "ק\u200dx\\Z", "xק\u200dxy", "ק\u200dx"]) +! :call add(tl, [2, "\u05b9\\Z", "xyz"]) +! :call add(tl, [2, "\\Z\u05b9", "xyz"]) +! :call add(tl, [2, "\u05b9\\Z", "xy\u05b9z", "y\u05b9"]) +! :call add(tl, [2, "\\Z\u05b9", "xy\u05b9z", "y\u05b9"]) +! :call add(tl, [1, "\u05b9\\+\\Z", "xy\u05b9z\u05b9 ", "y\u05b9z\u05b9"]) +! :call add(tl, [1, "\\Z\u05b9\\+", "xy\u05b9z\u05b9 ", "y\u05b9z\u05b9"]) + + :"""" Combining different tests and features + :call add(tl, [2, '[^[=a=]]\+', 'ddaãâbcd', 'dd']) +*** ../vim-7.3.1022/src/testdir/test95.ok 2013-05-26 14:32:01.000000000 +0200 +--- src/testdir/test95.ok 2013-05-26 15:12:17.000000000 +0200 +*************** +*** 94,99 **** +--- 94,115 ---- + OK 0 - ק‍x\Z + OK 1 - ק‍x\Z + OK 2 - ק‍x\Z ++ OK 0 - ֹ\Z ++ OK 1 - ֹ\Z ++ OK 2 - ֹ\Z ++ OK 0 - \Zֹ ++ OK 1 - \Zֹ ++ OK 2 - \Zֹ ++ OK 0 - ֹ\Z ++ OK 1 - ֹ\Z ++ OK 2 - ֹ\Z ++ OK 0 - \Zֹ ++ OK 1 - \Zֹ ++ OK 2 - \Zֹ ++ OK 0 - ֹ\+\Z ++ OK 2 - ֹ\+\Z ++ OK 0 - \Zֹ\+ ++ OK 2 - \Zֹ\+ + OK 0 - [^[=a=]]\+ + OK 1 - [^[=a=]]\+ + OK 2 - [^[=a=]]\+ +*** ../vim-7.3.1022/src/version.c 2013-05-26 15:14:11.000000000 +0200 +--- src/version.c 2013-05-26 15:08:43.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1023, + /**/ + +-- +Engineers are widely recognized as superior marriage material: intelligent, +dependable, employed, honest, and handy around the house. + (Scott Adams - The Dilbert principle) + + /// 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 /// diff --git a/7.3.1024 b/7.3.1024 new file mode 100644 index 0000000..99025c9 --- /dev/null +++ b/7.3.1024 @@ -0,0 +1,457 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1024 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1024 +Problem: New regexp: End of matching pattern not set correctly. (Cesar + Romani) +Solution: Quit the loop after finding the match. Store nfa_has_zend in the + program. +Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok, + src/regexp.h + + +*** ../vim-7.3.1023/src/regexp_nfa.c 2013-05-26 15:14:49.000000000 +0200 +--- src/regexp_nfa.c 2013-05-26 16:51:44.000000000 +0200 +*************** +*** 2651,2657 **** + break; + + case NFA_MCLOSE + 0: +! if (nfa_has_zend == TRUE) + { + addstate(l, state->out, m, off, lid, match); + break; +--- 2651,2657 ---- + break; + + case NFA_MCLOSE + 0: +! if (nfa_has_zend) + { + addstate(l, state->out, m, off, lid, match); + break; +*************** +*** 3109,3115 **** + fprintf(log_fd, "\n"); + #endif + /* Found the left-most longest match, do not look at any other +! * states at this position. */ + goto nextchar; + + case NFA_END_INVISIBLE: +--- 3109,3119 ---- + fprintf(log_fd, "\n"); + #endif + /* Found the left-most longest match, do not look at any other +! * states at this position. When the list of states is going +! * to be empty quit without advancing, so that "reginput" is +! * correct. */ +! if (nextlist->n == 0 && neglist->n == 0) +! clen = 0; + goto nextchar; + + case NFA_END_INVISIBLE: +*************** +*** 3783,3790 **** + regline = line; + reglnum = 0; /* relative to line */ + +! nstate = prog->nstate; + + for (i = 0; i < nstate; ++i) + { + prog->state[i].id = i; +--- 3787,3795 ---- + regline = line; + reglnum = 0; /* relative to line */ + +! nfa_has_zend = prog->has_zend; + ++ nstate = prog->nstate; + for (i = 0; i < nstate; ++i) + { + prog->state[i].id = i; +*************** +*** 3871,3876 **** +--- 3876,3882 ---- + prog->regflags = regflags; + prog->engine = &nfa_regengine; + prog->nstate = nstate; ++ prog->has_zend = nfa_has_zend; + #ifdef ENABLE_LOG + nfa_postfix_dump(expr, OK); + nfa_dump(prog); +*** ../vim-7.3.1023/src/testdir/test64.in 2013-05-25 23:15:21.000000000 +0200 +--- src/testdir/test64.in 2013-05-26 16:50:38.000000000 +0200 +*************** +*** 15,25 **** + :" etc. + :" When there is no match use only the first two items. + :let tl = [] +! + :"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + :"""" Previously written tests """""""""""""""""""""""""""""""" + :"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +! + :call add(tl, [2, 'ab', 'aab', 'ab']) + :call add(tl, [2, 'b', 'abcdef', 'b']) + :call add(tl, [2, 'bc*', 'abccccdef', 'bcccc']) +--- 15,25 ---- + :" etc. + :" When there is no match use only the first two items. + :let tl = [] +! :" + :"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + :"""" Previously written tests """""""""""""""""""""""""""""""" + :"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +! :" + :call add(tl, [2, 'ab', 'aab', 'ab']) + :call add(tl, [2, 'b', 'abcdef', 'b']) + :call add(tl, [2, 'bc*', 'abccccdef', 'bcccc']) +*************** +*** 138,153 **** + :" + :call add(tl, [2, '\v(a*)+', 'aaaa', 'aaaa', '']) + :call add(tl, [2, 'x', 'abcdef']) +! + :"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + :""""" Simple tests """"""""""""""""""""""""""""""""""""""""""" + :"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +! + :" Search single groups + :call add(tl, [2, 'ab', 'aab', 'ab']) + :call add(tl, [2, 'ab', 'baced']) + :call add(tl, [2, 'ab', ' ab ', 'ab']) +! + :" Search multi-modifiers + :call add(tl, [2, 'x*', 'xcd', 'x']) + :call add(tl, [2, 'x*', 'xxxxxxxxxxxxxxxxsofijiojgf', 'xxxxxxxxxxxxxxxx']) +--- 138,153 ---- + :" + :call add(tl, [2, '\v(a*)+', 'aaaa', 'aaaa', '']) + :call add(tl, [2, 'x', 'abcdef']) +! :" + :"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + :""""" Simple tests """"""""""""""""""""""""""""""""""""""""""" + :"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +! :" + :" Search single groups + :call add(tl, [2, 'ab', 'aab', 'ab']) + :call add(tl, [2, 'ab', 'baced']) + :call add(tl, [2, 'ab', ' ab ', 'ab']) +! :" + :" Search multi-modifiers + :call add(tl, [2, 'x*', 'xcd', 'x']) + :call add(tl, [2, 'x*', 'xxxxxxxxxxxxxxxxsofijiojgf', 'xxxxxxxxxxxxxxxx']) +*************** +*** 162,168 **** + :call add(tl, [2, 'x\?', 'x sdfoij', 'x']) + :call add(tl, [2, 'x\?', 'abc sfoij', '']) " empty match is good + :call add(tl, [2, 'x\?', 'xxxxxxxxxx c', 'x']) +! + :call add(tl, [2, 'a\{0,0}', 'abcdfdoij', '']) + :call add(tl, [2, 'a\{0,1}', 'asiubid axxxaaa', 'a']) " same thing as 'a?' + :call add(tl, [2, 'a\{1,0}', 'asiubid axxxaaa', 'a']) " same thing as 'a\{0,1}' +--- 162,168 ---- + :call add(tl, [2, 'x\?', 'x sdfoij', 'x']) + :call add(tl, [2, 'x\?', 'abc sfoij', '']) " empty match is good + :call add(tl, [2, 'x\?', 'xxxxxxxxxx c', 'x']) +! :" + :call add(tl, [2, 'a\{0,0}', 'abcdfdoij', '']) + :call add(tl, [2, 'a\{0,1}', 'asiubid axxxaaa', 'a']) " same thing as 'a?' + :call add(tl, [2, 'a\{1,0}', 'asiubid axxxaaa', 'a']) " same thing as 'a\{0,1}' +*************** +*** 182,188 **** + :call add(tl, [2, 'a\{,5}', 'aaaaaaaaaa', 'aaaaa']) + :call add(tl, [2, 'a\{}', 'bbbcddiuhfcd', '']) " same thing as 'a*' + :call add(tl, [2, 'a\{}', 'aaaaioudfh coisf jda', 'aaaa']) +! + :call add(tl, [2, 'a\{-0,0}', 'abcdfdoij', '']) + :call add(tl, [2, 'a\{-0,1}', 'asiubid axxxaaa', '']) " anti-greedy version of 'a?' + :call add(tl, [2, 'a\{-3,6}', 'aa siofuh']) +--- 182,188 ---- + :call add(tl, [2, 'a\{,5}', 'aaaaaaaaaa', 'aaaaa']) + :call add(tl, [2, 'a\{}', 'bbbcddiuhfcd', '']) " same thing as 'a*' + :call add(tl, [2, 'a\{}', 'aaaaioudfh coisf jda', 'aaaa']) +! :" + :call add(tl, [2, 'a\{-0,0}', 'abcdfdoij', '']) + :call add(tl, [2, 'a\{-0,1}', 'asiubid axxxaaa', '']) " anti-greedy version of 'a?' + :call add(tl, [2, 'a\{-3,6}', 'aa siofuh']) +*************** +*** 200,206 **** + :call add(tl, [2, 'a\{-,5}', 'aaaaaaaaaa', '']) + :call add(tl, [0, 'a\{-}', 'bbbcddiuhfcd', '']) " anti-greedy version of 'a*' + :call add(tl, [0, 'a\{-}', 'aaaaioudfh coisf jda', '']) +! + :" Test groups of characters and submatches + :call add(tl, [2, '\(abc\)*', 'abcabcabc', 'abcabcabc', 'abc']) + :call add(tl, [2, '\(ab\)\+', 'abababaaaaa', 'ababab', 'ab']) +--- 200,206 ---- + :call add(tl, [2, 'a\{-,5}', 'aaaaaaaaaa', '']) + :call add(tl, [0, 'a\{-}', 'bbbcddiuhfcd', '']) " anti-greedy version of 'a*' + :call add(tl, [0, 'a\{-}', 'aaaaioudfh coisf jda', '']) +! :" + :" Test groups of characters and submatches + :call add(tl, [2, '\(abc\)*', 'abcabcabc', 'abcabcabc', 'abc']) + :call add(tl, [2, '\(ab\)\+', 'abababaaaaa', 'ababab', 'ab']) +*************** +*** 213,219 **** + :call add(tl, [2, '\v((ab)|c*)+', 'abcccaba', 'abcccab', '', 'ab']) + :call add(tl, [2, '\v(a(c*)+b)+', 'acbababaaa', 'acbabab', 'ab', '']) + :call add(tl, [2, '\v(a|b*)+', 'aaaa', 'aaaa', '']) +! + :" Test greedy-ness and lazy-ness + :call add(tl, [2, 'a\{-2,7}','aaaaaaaaaaaaa', 'aa']) + :call add(tl, [2, 'a\{2,7}','aaaaaaaaaaaaaaaaaaaa', 'aaaaaaa']) +--- 213,219 ---- + :call add(tl, [2, '\v((ab)|c*)+', 'abcccaba', 'abcccab', '', 'ab']) + :call add(tl, [2, '\v(a(c*)+b)+', 'acbababaaa', 'acbabab', 'ab', '']) + :call add(tl, [2, '\v(a|b*)+', 'aaaa', 'aaaa', '']) +! :" + :" Test greedy-ness and lazy-ness + :call add(tl, [2, 'a\{-2,7}','aaaaaaaaaaaaa', 'aa']) + :call add(tl, [2, 'a\{2,7}','aaaaaaaaaaaaaaaaaaaa', 'aaaaaaa']) +*************** +*** 221,230 **** + :call add(tl, [2, '\vx(.*)yz(.*)','xayxayzxayzxayz','xayxayzxayzxayz', 'ayxayzxayzxa','']) + :call add(tl, [2, '\v(a{1,2}){-2,3}','aaaaaaa','aaaa','aa']) + :call add(tl, [2, '\v(a{-1,3})+','aa','aa','a']) +! + :" Test Character classes + :call add(tl, [2, '\d\+e\d\d','test 10e23 fd','10e23']) +! + :" Test collections and character range [] + :call add(tl, [2, '\v[a]', 'abcd', 'a']) + :call add(tl, [2, 'a[bcd]', 'abcd', 'ab']) +--- 221,230 ---- + :call add(tl, [2, '\vx(.*)yz(.*)','xayxayzxayzxayz','xayxayzxayzxayz', 'ayxayzxayzxa','']) + :call add(tl, [2, '\v(a{1,2}){-2,3}','aaaaaaa','aaaa','aa']) + :call add(tl, [2, '\v(a{-1,3})+','aa','aa','a']) +! :" + :" Test Character classes + :call add(tl, [2, '\d\+e\d\d','test 10e23 fd','10e23']) +! :" + :" Test collections and character range [] + :call add(tl, [2, '\v[a]', 'abcd', 'a']) + :call add(tl, [2, 'a[bcd]', 'abcd', 'ab']) +*************** +*** 250,257 **** + :call add(tl, [2, 'abc[0-9]*ddd', 'adf abc44482ddd oijs', 'abc44482ddd']) + :call add(tl, [2, '\_[0-9]\+', 'asfi9888u', '9888']) + :call add(tl, [2, '[0-9\n]\+', 'asfi9888u', '9888']) +! +! + :"""" Test recognition of some character classes + :call add(tl, [2, '[0-9]', '8', '8']) + :call add(tl, [2, '[^0-9]', '8']) +--- 250,257 ---- + :call add(tl, [2, 'abc[0-9]*ddd', 'adf abc44482ddd oijs', 'abc44482ddd']) + :call add(tl, [2, '\_[0-9]\+', 'asfi9888u', '9888']) + :call add(tl, [2, '[0-9\n]\+', 'asfi9888u', '9888']) +! :" +! :" + :"""" Test recognition of some character classes + :call add(tl, [2, '[0-9]', '8', '8']) + :call add(tl, [2, '[^0-9]', '8']) +*************** +*** 262,268 **** + :call add(tl, [2, '[a-zA-Z]', 'a', 'a']) + :call add(tl, [2, '[A-Z]', 'a']) + :call add(tl, [2, '\C[^A-Z]\+', 'ABCOIJDEOIFNSD jsfoij sa', ' jsfoij sa']) +! + :"""" Tests for \z features + :call add(tl, [2, 'xx \ze test', 'xx ']) " must match after \ze + :call add(tl, [0, 'abc\zeend', 'oij abcend', 'abc']) +--- 262,268 ---- + :call add(tl, [2, '[a-zA-Z]', 'a', 'a']) + :call add(tl, [2, '[A-Z]', 'a']) + :call add(tl, [2, '\C[^A-Z]\+', 'ABCOIJDEOIFNSD jsfoij sa', ' jsfoij sa']) +! :" + :"""" Tests for \z features + :call add(tl, [2, 'xx \ze test', 'xx ']) " must match after \ze + :call add(tl, [0, 'abc\zeend', 'oij abcend', 'abc']) +*************** +*** 271,277 **** + :call add(tl, [0, 'abc \zsmatch\ze abc', 'abc abc abc match abc abc', 'match']) + :call add(tl, [2, '\v(a \zsif .*){2}', 'a if then a if last', 'if last', 'a if last']) + :call add(tl, [2, '\>\zs.', 'aword. ', '.']) +! + :"""" Tests for \@ features + :call add(tl, [0, 'abc\@=', 'abc', 'ab']) + :call add(tl, [0, 'abc\@=cd', 'abcd', 'abcd']) +--- 271,277 ---- + :call add(tl, [0, 'abc \zsmatch\ze abc', 'abc abc abc match abc abc', 'match']) + :call add(tl, [2, '\v(a \zsif .*){2}', 'a if then a if last', 'if last', 'a if last']) + :call add(tl, [2, '\>\zs.', 'aword. ', '.']) +! :" + :"""" Tests for \@ features + :call add(tl, [0, 'abc\@=', 'abc', 'ab']) + :call add(tl, [0, 'abc\@=cd', 'abcd', 'abcd']) +*************** +*** 284,290 **** + :call add(tl, [2, '.*John\&.*Bob', 'here is John, and here is B']) " no match + :call add(tl, [0, '.*John\&.*Bob', 'John is Bobs friend', 'John is Bob']) + :call add(tl, [0, '\v(test1)@=.*yep', 'this is a test1, yep it is', 'test1, yep', 'test1']) +! + :"""" Combining different tests and features + :call add(tl, [2, '[[:alpha:]]\{-2,6}', '787abcdiuhsasiuhb4', 'ab']) + :call add(tl, [2, '', 'abcd', '']) +--- 284,290 ---- + :call add(tl, [2, '.*John\&.*Bob', 'here is John, and here is B']) " no match + :call add(tl, [0, '.*John\&.*Bob', 'John is Bobs friend', 'John is Bob']) + :call add(tl, [0, '\v(test1)@=.*yep', 'this is a test1, yep it is', 'test1, yep', 'test1']) +! :" + :"""" Combining different tests and features + :call add(tl, [2, '[[:alpha:]]\{-2,6}', '787abcdiuhsasiuhb4', 'ab']) + :call add(tl, [2, '', 'abcd', '']) +*************** +*** 292,313 **** + :call add(tl, [2, '\v%(ab(xyz)c)', ' abxyzc ', 'abxyzc', 'xyz']) + :call add(tl, [2, '\v(test|)empty', 'tesempty', 'empty', '']) + :call add(tl, [2, '\v(a|aa)(a|aa)', 'aaa', 'aa', 'a', 'a']) +! + :"""" \%u and friends + :call add(tl, [2, '\%d32', 'yes no', ' ']) + :call add(tl, [2, '\%o40', 'yes no', ' ']) + :call add(tl, [2, '\%x20', 'yes no', ' ']) + :call add(tl, [2, '\%u0020', 'yes no', ' ']) + :call add(tl, [2, '\%U00000020', 'yes no', ' ']) +! + :"""" Alternatives, must use first longest match + :call add(tl, [2, 'goo\|go', 'google', 'goo']) + :call add(tl, [2, '\ + :" This only works on a buffer line, not with expression evaluation + /^Find this +--- 347,353 ---- + : endfor + :endfor + :unlet t tl e l +! :" + :" Check that \_[0-9] matching EOL does not break a following \> + :" This only works on a buffer line, not with expression evaluation + /^Find this +*************** +*** 359,369 **** + /^Find this + /\%#=2\<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\> + y$Gop:" +! + :/\%#=1^Results/,$wq! test.out + ENDTEST + + Find this: + localnet/192.168.0.1 + + Results of test64: +--- 359,383 ---- + /^Find this + /\%#=2\<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\> + y$Gop:" +! :" +! :" Check that using a pattern on two lines doesn't get messed up by using +! :" matchstr() with \ze in between. +! :set re=0 +! /^Substitute here +! :.+1,.+2s/""/\='"'.matchstr(getline("."), '\d\+\ze<').'"' +! /^Substitute here +! :.+1,.+2yank +! Gop:" +! :" +! :" + :/\%#=1^Results/,$wq! test.out + ENDTEST + + Find this: + localnet/192.168.0.1 + ++ Substitute here: ++ Ta 5 ++ Ac 7 ++ + Results of test64: +*** ../vim-7.3.1023/src/testdir/test64.ok 2013-05-25 23:15:21.000000000 +0200 +--- src/testdir/test64.ok 2013-05-26 16:42:18.000000000 +0200 +*************** +*** 693,695 **** +--- 693,698 ---- + 192.168.0.1 + 192.168.0.1 + 192.168.0.1 ++ ++ Ta 5 ++ Ac 7 +*** ../vim-7.3.1023/src/regexp.h 2013-05-25 20:19:45.000000000 +0200 +--- src/regexp.h 2013-05-26 16:30:50.000000000 +0200 +*************** +*** 86,91 **** +--- 86,92 ---- + + regprog_T regprog; + nfa_state_T *start; ++ int has_zend; /* pattern contains \ze */ + int nstate; + nfa_state_T state[0]; /* actually longer.. */ + } nfa_regprog_T; +*** ../vim-7.3.1023/src/version.c 2013-05-26 15:14:49.000000000 +0200 +--- src/version.c 2013-05-26 16:55:29.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1024, + /**/ + +-- +An alien life briefly visits earth. Just before departing it leaves a +message in the dust on the back of a white van. The world is shocked +and wants to know what it means. After months of studies the worlds +best linguistic scientists are able to decipher the message: "Wash me!". + + /// 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 /// diff --git a/7.3.1025 b/7.3.1025 new file mode 100644 index 0000000..04af5e4 --- /dev/null +++ b/7.3.1025 @@ -0,0 +1,218 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1025 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1025 +Problem: New regexp: not matching newline in string. (Marc Weber) +Solution: Check for "\n" character. +Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok + + +*** ../vim-7.3.1024/src/regexp_nfa.c 2013-05-26 16:57:23.000000000 +0200 +--- src/regexp_nfa.c 2013-05-26 17:38:27.000000000 +0200 +*************** +*** 165,173 **** + static int *post_end; + static int *post_ptr; + +! static int nstate; /* Number of states in the NFA. */ + static int istate; /* Index in the state vector, used in new_state() */ +- static int nstate_max; /* Upper bound of estimated number of states. */ + + + static int nfa_regcomp_start __ARGS((char_u*expr, int re_flags)); +--- 165,173 ---- + static int *post_end; + static int *post_ptr; + +! static int nstate; /* Number of states in the NFA. Also used when +! * executing. */ + static int istate; /* Index in the state vector, used in new_state() */ + + + static int nfa_regcomp_start __ARGS((char_u*expr, int re_flags)); +*************** +*** 219,228 **** + int re_flags; /* see vim_regcomp() */ + { + size_t postfix_size; + + nstate = 0; + istate = 0; +! /* A reasonable estimation for size */ + nstate_max = (int)(STRLEN(expr) + 1) * NFA_POSTFIX_MULTIPLIER; + + /* Some items blow up in size, such as [A-z]. Add more space for that. +--- 219,229 ---- + int re_flags; /* see vim_regcomp() */ + { + size_t postfix_size; ++ int nstate_max; + + nstate = 0; + istate = 0; +! /* A reasonable estimation for maximum size */ + nstate_max = (int)(STRLEN(expr) + 1) * NFA_POSTFIX_MULTIPLIER; + + /* Some items blow up in size, such as [A-z]. Add more space for that. +*************** +*** 1968,1977 **** + * Frag_T.out is a list of places that need to be set to the + * next state for this fragment. + */ + typedef union Ptrlist Ptrlist; + struct Frag + { +! nfa_state_T *start; + Ptrlist *out; + }; + typedef struct Frag Frag_T; +--- 1969,1988 ---- + * Frag_T.out is a list of places that need to be set to the + * next state for this fragment. + */ ++ ++ /* Since the out pointers in the list are always ++ * uninitialized, we use the pointers themselves ++ * as storage for the Ptrlists. */ + typedef union Ptrlist Ptrlist; ++ union Ptrlist ++ { ++ Ptrlist *next; ++ nfa_state_T *s; ++ }; ++ + struct Frag + { +! nfa_state_T *start; + Ptrlist *out; + }; + typedef struct Frag Frag_T; +*************** +*** 1999,2015 **** + } + + /* +- * Since the out pointers in the list are always +- * uninitialized, we use the pointers themselves +- * as storage for the Ptrlists. +- */ +- union Ptrlist +- { +- Ptrlist *next; +- nfa_state_T *s; +- }; +- +- /* + * Create singleton list containing just outp. + */ + static Ptrlist * +--- 2010,2015 ---- +*************** +*** 3358,3365 **** + #endif + + case NFA_NEWL: +! if (!reg_line_lbr && REG_MULTI +! && curc == NUL && reglnum <= reg_maxline) + { + go_to_nextline = TRUE; + /* Pass -1 for the offset, which means taking the position +--- 3358,3365 ---- + #endif + + case NFA_NEWL: +! if (curc == NUL && !reg_line_lbr && REG_MULTI +! && reglnum <= reg_maxline) + { + go_to_nextline = TRUE; + /* Pass -1 for the offset, which means taking the position +*************** +*** 3367,3372 **** +--- 3367,3378 ---- + addstate(nextlist, t->state->out, &t->sub, -1, + listid + 1, &match); + } ++ else if (curc == '\n' && reg_line_lbr) ++ { ++ /* match \n as if it is an ordinary character */ ++ addstate(nextlist, t->state->out, &t->sub, 1, ++ listid + 1, &match); ++ } + break; + + case NFA_CLASS_ALNUM: +*************** +*** 3832,3838 **** +--- 3838,3849 ---- + * (and count its size). */ + postfix = re2post(); + if (postfix == NULL) ++ { ++ /* TODO: only give this error for debugging? */ ++ if (post_ptr >= post_end) ++ EMSGN("Internal error: estimated max number of states insufficient: %ld", post_end - post_start); + goto fail; /* Cascaded (syntax?) error */ ++ } + + /* + * In order to build the NFA, we parse the input regexp twice: +*** ../vim-7.3.1024/src/testdir/test64.in 2013-05-26 16:57:23.000000000 +0200 +--- src/testdir/test64.in 2013-05-26 17:37:51.000000000 +0200 +*************** +*** 250,255 **** +--- 250,258 ---- + :call add(tl, [2, 'abc[0-9]*ddd', 'adf abc44482ddd oijs', 'abc44482ddd']) + :call add(tl, [2, '\_[0-9]\+', 'asfi9888u', '9888']) + :call add(tl, [2, '[0-9\n]\+', 'asfi9888u', '9888']) ++ :call add(tl, [2, '\_[0-9]\+', "asfi\n9888u", "\n9888"]) ++ :call add(tl, [2, '\_f', " \na ", "\n"]) ++ :call add(tl, [2, '\_f\+', " \na ", "\na"]) + :" + :" + :"""" Test recognition of some character classes +*** ../vim-7.3.1024/src/testdir/test64.ok 2013-05-26 16:57:23.000000000 +0200 +--- src/testdir/test64.ok 2013-05-26 17:38:51.000000000 +0200 +*************** +*** 576,581 **** +--- 576,590 ---- + OK 0 - [0-9\n]\+ + OK 1 - [0-9\n]\+ + OK 2 - [0-9\n]\+ ++ OK 0 - \_[0-9]\+ ++ OK 1 - \_[0-9]\+ ++ OK 2 - \_[0-9]\+ ++ OK 0 - \_f ++ OK 1 - \_f ++ OK 2 - \_f ++ OK 0 - \_f\+ ++ OK 1 - \_f\+ ++ OK 2 - \_f\+ + OK 0 - [0-9] + OK 1 - [0-9] + OK 2 - [0-9] +*** ../vim-7.3.1024/src/version.c 2013-05-26 16:57:23.000000000 +0200 +--- src/version.c 2013-05-26 17:44:16.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1025, + /**/ + +-- +Every engineer dreams about saving the universe and having sex with aliens. +This is much more glamorous than the real life of an engineer, which consists +of hiding from the universe and having sex without the participation of other +life forms. (Scott Adams - The Dilbert principle) + + /// 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 /// diff --git a/7.3.1026 b/7.3.1026 new file mode 100644 index 0000000..dd5ca1b --- /dev/null +++ b/7.3.1026 @@ -0,0 +1,108 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1026 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1026 +Problem: New regexp: pattern that includs a new-line matches too early. + (john McGowan) +Solution: Do not start searching in the second line. +Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok + + +*** ../vim-7.3.1025/src/regexp_nfa.c 2013-05-26 17:45:41.000000000 +0200 +--- src/regexp_nfa.c 2013-05-26 18:38:01.000000000 +0200 +*************** +*** 3585,3596 **** + + } /* for (thislist = thislist; thislist->state; thislist++) */ + +! /* The first found match is the leftmost one, but there may be a +! * longer one. Keep running the NFA, but don't start from the +! * beginning. Also, do not add the start state in recursive calls of +! * nfa_regmatch(), because recursive calls should only start in the +! * first position. */ +! if (match == FALSE && start->c == NFA_MOPEN + 0) + { + #ifdef ENABLE_LOG + fprintf(log_fd, "(---) STARTSTATE\n"); +--- 3585,3599 ---- + + } /* for (thislist = thislist; thislist->state; thislist++) */ + +! /* Look for the start of a match in the current position by adding the +! * start state to the list of states. +! * The first found match is the leftmost one, thus the order of states +! * matters! +! * Do not add the start state in recursive calls of nfa_regmatch(), +! * because recursive calls should only start in the first position. +! * Also don't start a match past the first line. */ +! if (match == FALSE && start->c == NFA_MOPEN + 0 +! && reglnum == 0 && clen != 0) + { + #ifdef ENABLE_LOG + fprintf(log_fd, "(---) STARTSTATE\n"); +*** ../vim-7.3.1025/src/testdir/test64.in 2013-05-26 17:45:41.000000000 +0200 +--- src/testdir/test64.in 2013-05-26 18:34:04.000000000 +0200 +*************** +*** 372,377 **** +--- 372,383 ---- + :.+1,.+2yank + Gop:" + :" ++ :" Check a pattern with a line break matches in the right position. ++ /^Multiline ++ /\S.*\nx ++ :.yank ++ y$Gop:" ++ :" + :" + :/\%#=1^Results/,$wq! test.out + ENDTEST +*************** +*** 383,386 **** +--- 389,399 ---- + Ta 5 + Ac 7 + ++ Multiline: ++ abc ++ def ++ ghi ++ xjk ++ lmn ++ + Results of test64: +*** ../vim-7.3.1025/src/testdir/test64.ok 2013-05-26 17:45:41.000000000 +0200 +--- src/testdir/test64.ok 2013-05-26 18:34:00.000000000 +0200 +*************** +*** 705,707 **** +--- 705,708 ---- + + Ta 5 + Ac 7 ++ ghi +*** ../vim-7.3.1025/src/version.c 2013-05-26 17:45:41.000000000 +0200 +--- src/version.c 2013-05-26 18:35:52.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1026, + /**/ + +-- +For society, it's probably a good thing that engineers value function over +appearance. For example, you wouldn't want engineers to build nuclear power +plants that only _look_ like they would keep all the radiation inside. + (Scott Adams - The Dilbert principle) + + /// 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 /// diff --git a/7.3.1027 b/7.3.1027 new file mode 100644 index 0000000..3dff82b --- /dev/null +++ b/7.3.1027 @@ -0,0 +1,80 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1027 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1027 +Problem: New regexp performance: Calling no_Magic() very often. +Solution: Remove magicness inline. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1026/src/regexp_nfa.c 2013-05-26 18:40:11.000000000 +0200 +--- src/regexp_nfa.c 2013-05-26 19:18:32.000000000 +0200 +*************** +*** 3563,3576 **** + break; + + default: /* regular character */ + /* TODO: put this in #ifdef later */ +! if (t->state->c < -256) +! EMSGN("INTERNAL: Negative state char: %ld", t->state->c); +! result = (no_Magic(t->state->c) == curc); + +! if (!result) +! result = ireg_ic == TRUE +! && MB_TOLOWER(t->state->c) == MB_TOLOWER(curc); + #ifdef FEAT_MBYTE + /* If there is a composing character which is not being + * ignored there can be no match. Match with composing +--- 3563,3580 ---- + break; + + default: /* regular character */ ++ { ++ int c = t->state->c; ++ + /* TODO: put this in #ifdef later */ +! if (c < -256) +! EMSGN("INTERNAL: Negative state char: %ld", c); +! if (is_Magic(c)) +! c = un_Magic(c); +! result = (c == curc); + +! if (!result && ireg_ic) +! result = MB_TOLOWER(c) == MB_TOLOWER(curc); + #ifdef FEAT_MBYTE + /* If there is a composing character which is not being + * ignored there can be no match. Match with composing +*************** +*** 3581,3586 **** +--- 3585,3591 ---- + #endif + ADD_POS_NEG_STATE(t->state); + break; ++ } + } + + } /* for (thislist = thislist; thislist->state; thislist++) */ +*** ../vim-7.3.1026/src/version.c 2013-05-26 18:40:11.000000000 +0200 +--- src/version.c 2013-05-26 19:16:07.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1027, + /**/ + +-- +It doesn't really matter what you are able to do if you don't do it. + (Bram Moolenaar) + + /// 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 /// diff --git a/7.3.1028 b/7.3.1028 new file mode 100644 index 0000000..44e3ddd --- /dev/null +++ b/7.3.1028 @@ -0,0 +1,895 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1028 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1028 +Problem: New regexp performance: Copying a lot of position state. +Solution: Only copy the sub-expressions that are being used. +Files: src/regexp_nfa.c, src/regexp.h + + +*** ../vim-7.3.1027/src/regexp_nfa.c 2013-05-26 19:19:48.000000000 +0200 +--- src/regexp_nfa.c 2013-05-26 21:35:33.000000000 +0200 +*************** +*** 161,166 **** +--- 161,170 ---- + /* NFA regexp \ze operator encountered. */ + static int nfa_has_zend = FALSE; + ++ /* Number of sub expressions actually being used during execution. 1 if only ++ * the whole match (subexpr 0) is used. */ ++ static int nfa_nsubexpr; ++ + static int *post_start; /* holds the postfix form of r.e. */ + static int *post_end; + static int *post_ptr; +*************** +*** 1645,1656 **** + return OK; + } + +! typedef struct + { +! char_u *start[NSUBEXP]; +! char_u *end[NSUBEXP]; +! lpos_T startpos[NSUBEXP]; +! lpos_T endpos[NSUBEXP]; + } regsub_T; + + static int nfa_regmatch __ARGS((nfa_state_T *start, regsub_T *submatch, regsub_T *m)); +--- 1649,1666 ---- + return OK; + } + +! typedef union + { +! struct multipos +! { +! lpos_T start; +! lpos_T end; +! } multilist[NSUBEXP]; +! struct linepos +! { +! char_u *start; +! char_u *end; +! } linelist[NSUBEXP]; + } regsub_T; + + static int nfa_regmatch __ARGS((nfa_state_T *start, regsub_T *submatch, regsub_T *m)); +*************** +*** 2479,2514 **** + * NFA execution code. + ****************************************************************/ + +! /* nfa_thread_T contains runtime information of a NFA state */ + typedef struct + { + nfa_state_T *state; +! regsub_T sub; /* Submatch info. TODO: expensive! */ + } nfa_thread_T; + +! + typedef struct + { + nfa_thread_T *t; + int n; + } nfa_list_T; + +! static void addstate __ARGS((nfa_list_T *l, nfa_state_T *state, regsub_T *m, int off, int lid, int *match)); + +! static void addstate_here __ARGS((nfa_list_T *l, nfa_state_T *state, regsub_T *m, int lid, int *match, int *ip)); + + static void +! addstate(l, state, m, off, lid, match) + nfa_list_T *l; /* runtime state list */ + nfa_state_T *state; /* state to update */ + regsub_T *m; /* pointers to subexpressions */ + int off; /* byte offset, when -1 go to next line */ + int lid; +- int *match; /* found match? */ + { +! regsub_T save; +! int subidx = 0; + nfa_thread_T *lastthread; + + if (l == NULL || state == NULL) + return; +--- 2489,2527 ---- + * NFA execution code. + ****************************************************************/ + +! /* nfa_thread_T contains execution information of a NFA state */ + typedef struct + { + nfa_state_T *state; +! regsub_T sub; /* submatch info, only party used */ + } nfa_thread_T; + +! /* nfa_list_T contains the alternative NFA execution states. */ + typedef struct + { + nfa_thread_T *t; + int n; + } nfa_list_T; + +! /* Used during execution: whether a match has been found. */ +! static int nfa_match; +! +! static void addstate __ARGS((nfa_list_T *l, nfa_state_T *state, regsub_T *m, int off, int lid)); + +! static void addstate_here __ARGS((nfa_list_T *l, nfa_state_T *state, regsub_T *m, int lid, int *ip)); + + static void +! addstate(l, state, m, off, lid) + nfa_list_T *l; /* runtime state list */ + nfa_state_T *state; /* state to update */ + regsub_T *m; /* pointers to subexpressions */ + int off; /* byte offset, when -1 go to next line */ + int lid; + { +! int subidx; + nfa_thread_T *lastthread; ++ lpos_T save_lpos; ++ char_u *save_ptr; + + if (l == NULL || state == NULL) + return; +*************** +*** 2544,2550 **** + state->lastlist = lid; + lastthread = &l->t[l->n++]; + lastthread->state = state; +! lastthread->sub = *m; /* TODO: expensive! */ + } + } + +--- 2557,2572 ---- + state->lastlist = lid; + lastthread = &l->t[l->n++]; + lastthread->state = state; +! +! /* Copy the match start and end positions. */ +! if (REG_MULTI) +! mch_memmove(&lastthread->sub.multilist[0], +! &m->multilist[0], +! sizeof(struct multipos) * nfa_nsubexpr); +! else +! mch_memmove(&lastthread->sub.linelist[0], +! &m->linelist[0], +! sizeof(struct linepos) * nfa_nsubexpr); + } + } + +*************** +*** 2556,2571 **** + switch (state->c) + { + case NFA_MATCH: +! *match = TRUE; + break; + + case NFA_SPLIT: +! addstate(l, state->out, m, off, lid, match); +! addstate(l, state->out1, m, off, lid, match); + break; + + case NFA_SKIP_CHAR: +! addstate(l, state->out, m, off, lid, match); + break; + + #if 0 +--- 2578,2593 ---- + switch (state->c) + { + case NFA_MATCH: +! nfa_match = TRUE; + break; + + case NFA_SPLIT: +! addstate(l, state->out, m, off, lid); +! addstate(l, state->out1, m, off, lid); + break; + + case NFA_SKIP_CHAR: +! addstate(l, state->out, m, off, lid); + break; + + #if 0 +*************** +*** 2587,2593 **** + + case NFA_NOPEN: + case NFA_NCLOSE: +! addstate(l, state->out, m, off, lid, match); + break; + + /* If this state is reached, then a recursive call of nfa_regmatch() +--- 2609,2615 ---- + + case NFA_NOPEN: + case NFA_NCLOSE: +! addstate(l, state->out, m, off, lid); + break; + + /* If this state is reached, then a recursive call of nfa_regmatch() +*************** +*** 2609,2659 **** + case NFA_MOPEN + 8: + case NFA_MOPEN + 9: + case NFA_ZSTART: +- subidx = state->c - NFA_MOPEN; + if (state->c == NFA_ZSTART) + subidx = 0; + + if (REG_MULTI) + { +! save.startpos[subidx] = m->startpos[subidx]; +! save.endpos[subidx] = m->endpos[subidx]; + if (off == -1) + { +! m->startpos[subidx].lnum = reglnum + 1; +! m->startpos[subidx].col = 0; + } + else + { +! m->startpos[subidx].lnum = reglnum; +! m->startpos[subidx].col = + (colnr_T)(reginput - regline + off); + } + } + else + { +! save.start[subidx] = m->start[subidx]; +! save.end[subidx] = m->end[subidx]; +! m->start[subidx] = reginput + off; + } + +! addstate(l, state->out, m, off, lid, match); + + if (REG_MULTI) +! { +! m->startpos[subidx] = save.startpos[subidx]; +! m->endpos[subidx] = save.endpos[subidx]; +! } + else +! { +! m->start[subidx] = save.start[subidx]; +! m->end[subidx] = save.end[subidx]; +! } + break; + + case NFA_MCLOSE + 0: + if (nfa_has_zend) + { +! addstate(l, state->out, m, off, lid, match); + break; + } + case NFA_MCLOSE + 1: +--- 2631,2674 ---- + case NFA_MOPEN + 8: + case NFA_MOPEN + 9: + case NFA_ZSTART: + if (state->c == NFA_ZSTART) + subidx = 0; ++ else ++ subidx = state->c - NFA_MOPEN; + + if (REG_MULTI) + { +! save_lpos = m->multilist[subidx].start; + if (off == -1) + { +! m->multilist[subidx].start.lnum = reglnum + 1; +! m->multilist[subidx].start.col = 0; + } + else + { +! m->multilist[subidx].start.lnum = reglnum; +! m->multilist[subidx].start.col = + (colnr_T)(reginput - regline + off); + } + } + else + { +! save_ptr = m->linelist[subidx].start; +! m->linelist[subidx].start = reginput + off; + } + +! addstate(l, state->out, m, off, lid); + + if (REG_MULTI) +! m->multilist[subidx].start = save_lpos; + else +! m->linelist[subidx].start = save_ptr; + break; + + case NFA_MCLOSE + 0: + if (nfa_has_zend) + { +! addstate(l, state->out, m, off, lid); + break; + } + case NFA_MCLOSE + 1: +*************** +*** 2666,2709 **** + case NFA_MCLOSE + 8: + case NFA_MCLOSE + 9: + case NFA_ZEND: +- subidx = state->c - NFA_MCLOSE; + if (state->c == NFA_ZEND) + subidx = 0; + + if (REG_MULTI) + { +! save.startpos[subidx] = m->startpos[subidx]; +! save.endpos[subidx] = m->endpos[subidx]; + if (off == -1) + { +! m->endpos[subidx].lnum = reglnum + 1; +! m->endpos[subidx].col = 0; + } + else + { +! m->endpos[subidx].lnum = reglnum; +! m->endpos[subidx].col = (colnr_T)(reginput - regline + off); + } + } + else + { +! save.start[subidx] = m->start[subidx]; +! save.end[subidx] = m->end[subidx]; +! m->end[subidx] = reginput + off; + } + +! addstate(l, state->out, m, off, lid, match); + + if (REG_MULTI) +! { +! m->startpos[subidx] = save.startpos[subidx]; +! m->endpos[subidx] = save.endpos[subidx]; +! } + else +! { +! m->start[subidx] = save.start[subidx]; +! m->end[subidx] = save.end[subidx]; +! } + break; + } + } +--- 2681,2718 ---- + case NFA_MCLOSE + 8: + case NFA_MCLOSE + 9: + case NFA_ZEND: + if (state->c == NFA_ZEND) + subidx = 0; ++ else ++ subidx = state->c - NFA_MCLOSE; + + if (REG_MULTI) + { +! save_lpos = m->multilist[subidx].end; + if (off == -1) + { +! m->multilist[subidx].end.lnum = reglnum + 1; +! m->multilist[subidx].end.col = 0; + } + else + { +! m->multilist[subidx].end.lnum = reglnum; +! m->multilist[subidx].end.col = +! (colnr_T)(reginput - regline + off); + } + } + else + { +! save_ptr = m->linelist[subidx].end; +! m->linelist[subidx].end = reginput + off; + } + +! addstate(l, state->out, m, off, lid); + + if (REG_MULTI) +! m->multilist[subidx].end = save_lpos; + else +! m->linelist[subidx].end = save_ptr; + break; + } + } +*************** +*** 2715,2726 **** + * matters for alternatives. + */ + static void +! addstate_here(l, state, m, lid, matchp, ip) + nfa_list_T *l; /* runtime state list */ + nfa_state_T *state; /* state to update */ + regsub_T *m; /* pointers to subexpressions */ + int lid; +- int *matchp; /* found match? */ + int *ip; + { + int tlen = l->n; +--- 2724,2734 ---- + * matters for alternatives. + */ + static void +! addstate_here(l, state, m, lid, ip) + nfa_list_T *l; /* runtime state list */ + nfa_state_T *state; /* state to update */ + regsub_T *m; /* pointers to subexpressions */ + int lid; + int *ip; + { + int tlen = l->n; +*************** +*** 2728,2734 **** + int i = *ip; + + /* first add the state(s) at the end, so that we know how many there are */ +! addstate(l, state, m, 0, lid, matchp); + + /* when "*ip" was at the end of the list, nothing to do */ + if (i + 1 == tlen) +--- 2736,2742 ---- + int i = *ip; + + /* first add the state(s) at the end, so that we know how many there are */ +! addstate(l, state, m, 0, lid); + + /* when "*ip" was at the end of the list, nothing to do */ + if (i + 1 == tlen) +*************** +*** 2925,2931 **** + { + int result; + int size = 0; +- int match = FALSE; + int flag = 0; + int old_reglnum = -1; + int go_to_nextline = FALSE; +--- 2933,2938 ---- +*************** +*** 2951,2956 **** +--- 2958,2964 ---- + return FALSE; + } + #endif ++ nfa_match = FALSE; + + /* Allocate memory for the lists of nodes */ + size = (nstate + 1) * sizeof(nfa_thread_T); +*************** +*** 2989,2995 **** + #ifdef ENABLE_LOG + fprintf(log_fd, "(---) STARTSTATE\n"); + #endif +! addstate(thislist, start, m, 0, listid, &match); + + /* There are two cases when the NFA advances: 1. input char matches the + * NFA node and 2. input char does not match the NFA node, but the next +--- 2997,3003 ---- + #ifdef ENABLE_LOG + fprintf(log_fd, "(---) STARTSTATE\n"); + #endif +! addstate(thislist, start, m, 0, listid); + + /* There are two cases when the NFA advances: 1. input char matches the + * NFA node and 2. input char does not match the NFA node, but the next +*************** +*** 3002,3008 **** + #define ADD_POS_NEG_STATE(node) \ + ll = listtbl[result ? 1 : 0][node->negated]; \ + if (ll != NULL) \ +! addstate(ll, node->out , &t->sub, clen, listid + 1, &match); + + + /* +--- 3010,3016 ---- + #define ADD_POS_NEG_STATE(node) \ + ll = listtbl[result ? 1 : 0][node->negated]; \ + if (ll != NULL) \ +! addstate(ll, node->out , &t->sub, clen, listid + 1); + + + /* +*************** +*** 3090,3096 **** + switch (t->state->c) + { + case NFA_MATCH: +! match = TRUE; + *submatch = t->sub; + #ifdef ENABLE_LOG + for (j = 0; j < 4; j++) +--- 3098,3104 ---- + switch (t->state->c) + { + case NFA_MATCH: +! nfa_match = TRUE; + *submatch = t->sub; + #ifdef ENABLE_LOG + for (j = 0; j < 4; j++) +*************** +*** 3125,3135 **** + * the parent call. */ + if (start->c == NFA_MOPEN + 0) + addstate_here(thislist, t->state->out, &t->sub, listid, +! &match, &listidx); + else + { + *m = t->sub; +! match = TRUE; + } + break; + +--- 3133,3143 ---- + * the parent call. */ + if (start->c == NFA_MOPEN + 0) + addstate_here(thislist, t->state->out, &t->sub, listid, +! &listidx); + else + { + *m = t->sub; +! nfa_match = TRUE; + } + break; + +*************** +*** 3186,3205 **** + reglnum = old_reglnum; + /* Copy submatch info from the recursive call */ + if (REG_MULTI) +! for (j = 1; j < NSUBEXP; j++) + { +! t->sub.startpos[j] = m->startpos[j]; +! t->sub.endpos[j] = m->endpos[j]; + } + else +! for (j = 1; j < NSUBEXP; j++) + { +! t->sub.start[j] = m->start[j]; +! t->sub.end[j] = m->end[j]; + } + /* t->state->out1 is the corresponding END_INVISIBLE node */ + addstate_here(thislist, t->state->out1->out, &t->sub, +! listid, &match, &listidx); + } + else + { +--- 3194,3213 ---- + reglnum = old_reglnum; + /* Copy submatch info from the recursive call */ + if (REG_MULTI) +! for (j = 1; j < nfa_nsubexpr; j++) + { +! t->sub.multilist[j].start = m->multilist[j].start; +! t->sub.multilist[j].end = m->multilist[j].end; + } + else +! for (j = 1; j < nfa_nsubexpr; j++) + { +! t->sub.linelist[j].start = m->linelist[j].start; +! t->sub.linelist[j].end = m->linelist[j].end; + } + /* t->state->out1 is the corresponding END_INVISIBLE node */ + addstate_here(thislist, t->state->out1->out, &t->sub, +! listid, &listidx); + } + else + { +*************** +*** 3211,3223 **** + case NFA_BOL: + if (reginput == regline) + addstate_here(thislist, t->state->out, &t->sub, listid, +! &match, &listidx); + break; + + case NFA_EOL: + if (curc == NUL) + addstate_here(thislist, t->state->out, &t->sub, listid, +! &match, &listidx); + break; + + case NFA_BOW: +--- 3219,3231 ---- + case NFA_BOL: + if (reginput == regline) + addstate_here(thislist, t->state->out, &t->sub, listid, +! &listidx); + break; + + case NFA_EOL: + if (curc == NUL) + addstate_here(thislist, t->state->out, &t->sub, listid, +! &listidx); + break; + + case NFA_BOW: +*************** +*** 3245,3251 **** + bow = FALSE; + if (bow) + addstate_here(thislist, t->state->out, &t->sub, listid, +! &match, &listidx); + break; + } + +--- 3253,3259 ---- + bow = FALSE; + if (bow) + addstate_here(thislist, t->state->out, &t->sub, listid, +! &listidx); + break; + } + +*************** +*** 3274,3280 **** + eow = FALSE; + if (eow) + addstate_here(thislist, t->state->out, &t->sub, listid, +! &match, &listidx); + break; + } + +--- 3282,3288 ---- + eow = FALSE; + if (eow) + addstate_here(thislist, t->state->out, &t->sub, listid, +! &listidx); + break; + } + +*************** +*** 3364,3377 **** + go_to_nextline = TRUE; + /* Pass -1 for the offset, which means taking the position + * at the start of the next line. */ +! addstate(nextlist, t->state->out, &t->sub, -1, +! listid + 1, &match); + } + else if (curc == '\n' && reg_line_lbr) + { + /* match \n as if it is an ordinary character */ +! addstate(nextlist, t->state->out, &t->sub, 1, +! listid + 1, &match); + } + break; + +--- 3372,3383 ---- + go_to_nextline = TRUE; + /* Pass -1 for the offset, which means taking the position + * at the start of the next line. */ +! addstate(nextlist, t->state->out, &t->sub, -1, listid + 1); + } + else if (curc == '\n' && reg_line_lbr) + { + /* match \n as if it is an ordinary character */ +! addstate(nextlist, t->state->out, &t->sub, 1, listid + 1); + } + break; + +*************** +*** 3400,3413 **** + * CHAR(x), NFA_NOT, CHAR(y), NFA_NOT etc. */ + if (curc > 0) + addstate(nextlist, t->state->out, &t->sub, clen, +! listid + 1, &match); + break; + + case NFA_ANY: + /* Any char except '\0', (end of input) does not match. */ + if (curc > 0) + addstate(nextlist, t->state->out, &t->sub, clen, +! listid + 1, &match); + break; + + /* +--- 3406,3419 ---- + * CHAR(x), NFA_NOT, CHAR(y), NFA_NOT etc. */ + if (curc > 0) + addstate(nextlist, t->state->out, &t->sub, clen, +! listid + 1); + break; + + case NFA_ANY: + /* Any char except '\0', (end of input) does not match. */ + if (curc > 0) + addstate(nextlist, t->state->out, &t->sub, clen, +! listid + 1); + break; + + /* +*************** +*** 3597,3609 **** + * Do not add the start state in recursive calls of nfa_regmatch(), + * because recursive calls should only start in the first position. + * Also don't start a match past the first line. */ +! if (match == FALSE && start->c == NFA_MOPEN + 0 + && reglnum == 0 && clen != 0) + { + #ifdef ENABLE_LOG + fprintf(log_fd, "(---) STARTSTATE\n"); + #endif +! addstate(nextlist, start, m, clen, listid + 1, &match); + } + + #ifdef ENABLE_LOG +--- 3603,3615 ---- + * Do not add the start state in recursive calls of nfa_regmatch(), + * because recursive calls should only start in the first position. + * Also don't start a match past the first line. */ +! if (nfa_match == FALSE && start->c == NFA_MOPEN + 0 + && reglnum == 0 && clen != 0) + { + #ifdef ENABLE_LOG + fprintf(log_fd, "(---) STARTSTATE\n"); + #endif +! addstate(nextlist, start, m, clen, listid + 1); + } + + #ifdef ENABLE_LOG +*************** +*** 3640,3653 **** + vim_free(list[1].t); + vim_free(list[2].t); + list[0].t = list[1].t = list[2].t = NULL; +! if (listids != NULL) +! vim_free(listids); + #undef ADD_POS_NEG_STATE + #ifdef NFA_REGEXP_DEBUG_LOG + fclose(debug); + #endif + +! return match; + } + + /* +--- 3646,3658 ---- + vim_free(list[1].t); + vim_free(list[2].t); + list[0].t = list[1].t = list[2].t = NULL; +! vim_free(listids); + #undef ADD_POS_NEG_STATE + #ifdef NFA_REGEXP_DEBUG_LOG + fclose(debug); + #endif + +! return nfa_match; + } + + /* +*************** +*** 3690,3706 **** + if (REG_MULTI) + { + /* Use 0xff to set lnum to -1 */ +! vim_memset(sub.startpos, 0xff, sizeof(lpos_T) * NSUBEXP); +! vim_memset(sub.endpos, 0xff, sizeof(lpos_T) * NSUBEXP); +! vim_memset(m.startpos, 0xff, sizeof(lpos_T) * NSUBEXP); +! vim_memset(m.endpos, 0xff, sizeof(lpos_T) * NSUBEXP); + } + else + { +! vim_memset(sub.start, 0, sizeof(char_u *) * NSUBEXP); +! vim_memset(sub.end, 0, sizeof(char_u *) * NSUBEXP); +! vim_memset(m.start, 0, sizeof(char_u *) * NSUBEXP); +! vim_memset(m.end, 0, sizeof(char_u *) * NSUBEXP); + } + + if (nfa_regmatch(start, &sub, &m) == FALSE) +--- 3695,3707 ---- + if (REG_MULTI) + { + /* Use 0xff to set lnum to -1 */ +! vim_memset(sub.multilist, 0xff, sizeof(struct multipos) * nfa_nsubexpr); +! vim_memset(m.multilist, 0xff, sizeof(struct multipos) * nfa_nsubexpr); + } + else + { +! vim_memset(sub.linelist, 0, sizeof(struct linepos) * nfa_nsubexpr); +! vim_memset(m.linelist, 0, sizeof(struct linepos) * nfa_nsubexpr); + } + + if (nfa_regmatch(start, &sub, &m) == FALSE) +*************** +*** 3709,3718 **** + cleanup_subexpr(); + if (REG_MULTI) + { +! for (i = 0; i < NSUBEXP; i++) + { +! reg_startpos[i] = sub.startpos[i]; +! reg_endpos[i] = sub.endpos[i]; + } + + if (reg_startpos[0].lnum < 0) +--- 3710,3719 ---- + cleanup_subexpr(); + if (REG_MULTI) + { +! for (i = 0; i < nfa_nsubexpr; i++) + { +! reg_startpos[i] = sub.multilist[i].start; +! reg_endpos[i] = sub.multilist[i].end; + } + + if (reg_startpos[0].lnum < 0) +*************** +*** 3731,3740 **** + } + else + { +! for (i = 0; i < NSUBEXP; i++) + { +! reg_startp[i] = sub.start[i]; +! reg_endp[i] = sub.end[i]; + } + + if (reg_startp[0] == NULL) +--- 3732,3741 ---- + } + else + { +! for (i = 0; i < nfa_nsubexpr; i++) + { +! reg_startp[i] = sub.linelist[i].start; +! reg_endp[i] = sub.linelist[i].end; + } + + if (reg_startp[0] == NULL) +*************** +*** 3802,3807 **** +--- 3803,3809 ---- + reglnum = 0; /* relative to line */ + + nfa_has_zend = prog->has_zend; ++ nfa_nsubexpr = prog->nsubexp; + + nstate = prog->nstate; + for (i = 0; i < nstate; ++i) +*************** +*** 3896,3901 **** +--- 3898,3904 ---- + prog->engine = &nfa_regengine; + prog->nstate = nstate; + prog->has_zend = nfa_has_zend; ++ prog->nsubexp = regnpar; + #ifdef ENABLE_LOG + nfa_postfix_dump(expr, OK); + nfa_dump(prog); +*** ../vim-7.3.1027/src/regexp.h 2013-05-26 16:57:23.000000000 +0200 +--- src/regexp.h 2013-05-26 20:08:09.000000000 +0200 +*************** +*** 87,92 **** +--- 87,93 ---- + regprog_T regprog; + nfa_state_T *start; + int has_zend; /* pattern contains \ze */ ++ int nsubexp; /* number of () */ + int nstate; + nfa_state_T state[0]; /* actually longer.. */ + } nfa_regprog_T; +*** ../vim-7.3.1027/src/version.c 2013-05-26 19:19:48.000000000 +0200 +--- src/version.c 2013-05-26 21:44:20.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1028, + /**/ + +-- +Q: What's a light-year? +A: One-third less calories than a regular year. + + /// 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 /// diff --git a/7.3.1029 b/7.3.1029 new file mode 100644 index 0000000..dcc59d2 --- /dev/null +++ b/7.3.1029 @@ -0,0 +1,404 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1029 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1029 +Problem: New regexp performance: Unused position state being copied. +Solution: Keep track of which positions are actually valid. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1028/src/regexp_nfa.c 2013-05-26 21:47:22.000000000 +0200 +--- src/regexp_nfa.c 2013-05-26 22:45:26.000000000 +0200 +*************** +*** 1649,1670 **** + return OK; + } + +- typedef union +- { +- struct multipos +- { +- lpos_T start; +- lpos_T end; +- } multilist[NSUBEXP]; +- struct linepos +- { +- char_u *start; +- char_u *end; +- } linelist[NSUBEXP]; +- } regsub_T; +- +- static int nfa_regmatch __ARGS((nfa_state_T *start, regsub_T *submatch, regsub_T *m)); +- + #ifdef DEBUG + static char_u code[50]; + +--- 1649,1654 ---- +*************** +*** 2489,2494 **** +--- 2473,2498 ---- + * NFA execution code. + ****************************************************************/ + ++ typedef struct ++ { ++ int in_use; /* number of subexpr with useful info */ ++ ++ /* When REG_MULTI is TRUE multilist is used, otherwise linelist. */ ++ union ++ { ++ struct multipos ++ { ++ lpos_T start; ++ lpos_T end; ++ } multilist[NSUBEXP]; ++ struct linepos ++ { ++ char_u *start; ++ char_u *end; ++ } linelist[NSUBEXP]; ++ }; ++ } regsub_T; ++ + /* nfa_thread_T contains execution information of a NFA state */ + typedef struct + { +*************** +*** 2507,2513 **** + static int nfa_match; + + static void addstate __ARGS((nfa_list_T *l, nfa_state_T *state, regsub_T *m, int off, int lid)); +- + static void addstate_here __ARGS((nfa_list_T *l, nfa_state_T *state, regsub_T *m, int lid, int *ip)); + + static void +--- 2511,2516 ---- +*************** +*** 2521,2527 **** +--- 2524,2532 ---- + int subidx; + nfa_thread_T *lastthread; + lpos_T save_lpos; ++ int save_in_use; + char_u *save_ptr; ++ int i; + + if (l == NULL || state == NULL) + return; +*************** +*** 2557,2572 **** + state->lastlist = lid; + lastthread = &l->t[l->n++]; + lastthread->state = state; +! +! /* Copy the match start and end positions. */ +! if (REG_MULTI) +! mch_memmove(&lastthread->sub.multilist[0], +! &m->multilist[0], +! sizeof(struct multipos) * nfa_nsubexpr); +! else +! mch_memmove(&lastthread->sub.linelist[0], +! &m->linelist[0], +! sizeof(struct linepos) * nfa_nsubexpr); + } + } + +--- 2562,2580 ---- + state->lastlist = lid; + lastthread = &l->t[l->n++]; + lastthread->state = state; +! lastthread->sub.in_use = m->in_use; +! if (m->in_use > 0) +! { +! /* Copy the match start and end positions. */ +! if (REG_MULTI) +! mch_memmove(&lastthread->sub.multilist[0], +! &m->multilist[0], +! sizeof(struct multipos) * m->in_use); +! else +! mch_memmove(&lastthread->sub.linelist[0], +! &m->linelist[0], +! sizeof(struct linepos) * m->in_use); +! } + } + } + +*************** +*** 2636,2644 **** + else + subidx = state->c - NFA_MOPEN; + + if (REG_MULTI) + { +! save_lpos = m->multilist[subidx].start; + if (off == -1) + { + m->multilist[subidx].start.lnum = reglnum + 1; +--- 2644,2668 ---- + else + subidx = state->c - NFA_MOPEN; + ++ /* Set the position (with "off") in the subexpression. Save and ++ * restore it when it was in use. Otherwise fill any gap. */ + if (REG_MULTI) + { +! if (subidx < m->in_use) +! { +! save_lpos = m->multilist[subidx].start; +! save_in_use = -1; +! } +! else +! { +! save_in_use = m->in_use; +! for (i = m->in_use; i < subidx; ++i) +! { +! m->multilist[i].start.lnum = -1; +! m->multilist[i].end.lnum = -1; +! } +! m->in_use = subidx + 1; +! } + if (off == -1) + { + m->multilist[subidx].start.lnum = reglnum + 1; +*************** +*** 2653,2668 **** + } + else + { +! save_ptr = m->linelist[subidx].start; + m->linelist[subidx].start = reginput + off; + } + + addstate(l, state->out, m, off, lid); + +! if (REG_MULTI) +! m->multilist[subidx].start = save_lpos; + else +! m->linelist[subidx].start = save_ptr; + break; + + case NFA_MCLOSE + 0: +--- 2677,2711 ---- + } + else + { +! if (subidx < m->in_use) +! { +! save_ptr = m->linelist[subidx].start; +! save_in_use = -1; +! } +! else +! { +! save_in_use = m->in_use; +! for (i = m->in_use; i < subidx; ++i) +! { +! m->linelist[i].start = NULL; +! m->linelist[i].end = NULL; +! } +! m->in_use = subidx + 1; +! } + m->linelist[subidx].start = reginput + off; + } + + addstate(l, state->out, m, off, lid); + +! if (save_in_use == -1) +! { +! if (REG_MULTI) +! m->multilist[subidx].start = save_lpos; +! else +! m->linelist[subidx].start = save_ptr; +! } + else +! m->in_use = save_in_use; + break; + + case NFA_MCLOSE + 0: +*************** +*** 2686,2691 **** +--- 2729,2739 ---- + else + subidx = state->c - NFA_MCLOSE; + ++ /* We don't fill in gaps here, there must have been an MOPEN that ++ * has done that. */ ++ save_in_use = m->in_use; ++ if (m->in_use <= subidx) ++ m->in_use = subidx + 1; + if (REG_MULTI) + { + save_lpos = m->multilist[subidx].end; +*************** +*** 2713,2718 **** +--- 2761,2767 ---- + m->multilist[subidx].end = save_lpos; + else + m->linelist[subidx].end = save_ptr; ++ m->in_use = save_in_use; + break; + } + } +*************** +*** 2917,2922 **** +--- 2966,2973 ---- + } + } + ++ static int nfa_regmatch __ARGS((nfa_state_T *start, regsub_T *submatch, regsub_T *m)); ++ + /* + * Main matching routine. + * +*************** +*** 2960,2966 **** + #endif + nfa_match = FALSE; + +! /* Allocate memory for the lists of nodes */ + size = (nstate + 1) * sizeof(nfa_thread_T); + list[0].t = (nfa_thread_T *)lalloc(size, TRUE); + list[1].t = (nfa_thread_T *)lalloc(size, TRUE); +--- 3011,3017 ---- + #endif + nfa_match = FALSE; + +! /* Allocate memory for the lists of nodes. */ + size = (nstate + 1) * sizeof(nfa_thread_T); + list[0].t = (nfa_thread_T *)lalloc(size, TRUE); + list[1].t = (nfa_thread_T *)lalloc(size, TRUE); +*************** +*** 3099,3105 **** + { + case NFA_MATCH: + nfa_match = TRUE; +! *submatch = t->sub; + #ifdef ENABLE_LOG + for (j = 0; j < 4; j++) + if (REG_MULTI) +--- 3150,3168 ---- + { + case NFA_MATCH: + nfa_match = TRUE; +! submatch->in_use = t->sub.in_use; +! if (REG_MULTI) +! for (j = 0; j < submatch->in_use; j++) +! { +! submatch->multilist[j].start = t->sub.multilist[j].start; +! submatch->multilist[j].end = t->sub.multilist[j].end; +! } +! else +! for (j = 0; j < submatch->in_use; j++) +! { +! submatch->linelist[j].start = t->sub.linelist[j].start; +! submatch->linelist[j].end = t->sub.linelist[j].end; +! } + #ifdef ENABLE_LOG + for (j = 0; j < 4; j++) + if (REG_MULTI) +*************** +*** 3194,3210 **** + reglnum = old_reglnum; + /* Copy submatch info from the recursive call */ + if (REG_MULTI) +! for (j = 1; j < nfa_nsubexpr; j++) + { + t->sub.multilist[j].start = m->multilist[j].start; + t->sub.multilist[j].end = m->multilist[j].end; + } + else +! for (j = 1; j < nfa_nsubexpr; j++) + { + t->sub.linelist[j].start = m->linelist[j].start; + t->sub.linelist[j].end = m->linelist[j].end; + } + /* t->state->out1 is the corresponding END_INVISIBLE node */ + addstate_here(thislist, t->state->out1->out, &t->sub, + listid, &listidx); +--- 3257,3275 ---- + reglnum = old_reglnum; + /* Copy submatch info from the recursive call */ + if (REG_MULTI) +! for (j = 1; j < m->in_use; j++) + { + t->sub.multilist[j].start = m->multilist[j].start; + t->sub.multilist[j].end = m->multilist[j].end; + } + else +! for (j = 1; j < m->in_use; j++) + { + t->sub.linelist[j].start = m->linelist[j].start; + t->sub.linelist[j].end = m->linelist[j].end; + } ++ t->sub.in_use = m->in_use; ++ + /* t->state->out1 is the corresponding END_INVISIBLE node */ + addstate_here(thislist, t->state->out1->out, &t->sub, + listid, &listidx); +*************** +*** 3703,3708 **** +--- 3768,3775 ---- + vim_memset(sub.linelist, 0, sizeof(struct linepos) * nfa_nsubexpr); + vim_memset(m.linelist, 0, sizeof(struct linepos) * nfa_nsubexpr); + } ++ sub.in_use = 0; ++ m.in_use = 0; + + if (nfa_regmatch(start, &sub, &m) == FALSE) + return 0; +*************** +*** 3710,3716 **** + cleanup_subexpr(); + if (REG_MULTI) + { +! for (i = 0; i < nfa_nsubexpr; i++) + { + reg_startpos[i] = sub.multilist[i].start; + reg_endpos[i] = sub.multilist[i].end; +--- 3777,3783 ---- + cleanup_subexpr(); + if (REG_MULTI) + { +! for (i = 0; i < sub.in_use; i++) + { + reg_startpos[i] = sub.multilist[i].start; + reg_endpos[i] = sub.multilist[i].end; +*************** +*** 3732,3738 **** + } + else + { +! for (i = 0; i < nfa_nsubexpr; i++) + { + reg_startp[i] = sub.linelist[i].start; + reg_endp[i] = sub.linelist[i].end; +--- 3799,3805 ---- + } + else + { +! for (i = 0; i < sub.in_use; i++) + { + reg_startp[i] = sub.linelist[i].start; + reg_endp[i] = sub.linelist[i].end; +*** ../vim-7.3.1028/src/version.c 2013-05-26 21:47:22.000000000 +0200 +--- src/version.c 2013-05-26 22:53:55.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1029, + /**/ + +-- +I used to be indecisive, now I'm not sure. + + /// 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 /// diff --git a/7.3.1030 b/7.3.1030 new file mode 100644 index 0000000..9ecda71 --- /dev/null +++ b/7.3.1030 @@ -0,0 +1,77 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1030 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1030 (after 7.3.1028) +Problem: Can't build for debugging. +Solution: Fix struct member names. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1029/src/regexp_nfa.c 2013-05-26 22:56:16.000000000 +0200 +--- src/regexp_nfa.c 2013-05-26 23:12:12.000000000 +0200 +*************** +*** 3164,3182 **** + submatch->linelist[j].end = t->sub.linelist[j].end; + } + #ifdef ENABLE_LOG +! for (j = 0; j < 4; j++) + if (REG_MULTI) + fprintf(log_fd, "\n *** group %d, start: c=%d, l=%d, end: c=%d, l=%d", + j, +! t->sub.startpos[j].col, +! (int)t->sub.startpos[j].lnum, +! t->sub.endpos[j].col, +! (int)t->sub.endpos[j].lnum); + else + fprintf(log_fd, "\n *** group %d, start: \"%s\", end: \"%s\"", + j, +! (char *)t->sub.start[j], +! (char *)t->sub.end[j]); + fprintf(log_fd, "\n"); + #endif + /* Found the left-most longest match, do not look at any other +--- 3164,3182 ---- + submatch->linelist[j].end = t->sub.linelist[j].end; + } + #ifdef ENABLE_LOG +! for (j = 0; j < t->sub.in_use; j++) + if (REG_MULTI) + fprintf(log_fd, "\n *** group %d, start: c=%d, l=%d, end: c=%d, l=%d", + j, +! t->sub.multilist[j].start.col, +! (int)t->sub.multilist[j].start.lnum, +! t->sub.multilist[j].end.col, +! (int)t->sub.multilist[j].end.lnum); + else + fprintf(log_fd, "\n *** group %d, start: \"%s\", end: \"%s\"", + j, +! (char *)t->sub.linelist[j].start, +! (char *)t->sub.linelist[j].end); + fprintf(log_fd, "\n"); + #endif + /* Found the left-most longest match, do not look at any other +*** ../vim-7.3.1029/src/version.c 2013-05-26 22:56:16.000000000 +0200 +--- src/version.c 2013-05-26 23:11:27.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1030, + /**/ + +-- +I think that you'll agree that engineers are very effective in their social +interactions. It's the "normal" people who are nuts. + (Scott Adams - The Dilbert principle) + + /// 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 /// diff --git a/7.3.1031 b/7.3.1031 new file mode 100644 index 0000000..466baec --- /dev/null +++ b/7.3.1031 @@ -0,0 +1,80 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1031 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1031 +Problem: Compiler warnings for shadowed variable. (John Little) +Solution: Move the variable declarations to the scope where they are used. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1030/src/regexp_nfa.c 2013-05-26 23:13:03.000000000 +0200 +--- src/regexp_nfa.c 2013-05-27 11:15:35.000000000 +0200 +*************** +*** 2999,3005 **** + nfa_list_T *nextlist; + nfa_list_T *neglist; + int *listids = NULL; +- int j = 0; + #ifdef NFA_REGEXP_DEBUG_LOG + FILE *debug = fopen(NFA_REGEXP_DEBUG_LOG, "a"); + +--- 2999,3004 ---- +*************** +*** 3149,3154 **** +--- 3148,3156 ---- + switch (t->state->c) + { + case NFA_MATCH: ++ { ++ int j; ++ + nfa_match = TRUE; + submatch->in_use = t->sub.in_use; + if (REG_MULTI) +*************** +*** 3186,3191 **** +--- 3188,3194 ---- + if (nextlist->n == 0 && neglist->n == 0) + clen = 0; + goto nextchar; ++ } + + case NFA_END_INVISIBLE: + /* This is only encountered after a NFA_START_INVISIBLE node. +*************** +*** 3251,3256 **** +--- 3254,3261 ---- + #endif + if (result == TRUE) + { ++ int j; ++ + /* Restore position in input text */ + reginput = old_reginput; + regline = old_regline; +*** ../vim-7.3.1030/src/version.c 2013-05-26 23:13:03.000000000 +0200 +--- src/version.c 2013-05-27 11:21:28.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1031, + /**/ + +-- +It's totally unfair to suggest - as many have - that engineers are socially +inept. Engineers simply have different objectives when it comes to social +interaction. + (Scott Adams - The Dilbert principle) + + /// 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 /// diff --git a/7.3.1032 b/7.3.1032 new file mode 100644 index 0000000..10ee7f1 --- /dev/null +++ b/7.3.1032 @@ -0,0 +1,339 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1032 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1032 +Problem: "\ze" is not supported by the new regexp engine. +Solution: Make "\ze" work. +Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok + + +*** ../vim-7.3.1031/src/regexp_nfa.c 2013-05-27 11:21:59.000000000 +0200 +--- src/regexp_nfa.c 2013-05-27 20:06:16.000000000 +0200 +*************** +*** 159,165 **** + static int syntax_error = FALSE; + + /* NFA regexp \ze operator encountered. */ +! static int nfa_has_zend = FALSE; + + /* Number of sub expressions actually being used during execution. 1 if only + * the whole match (subexpr 0) is used. */ +--- 159,165 ---- + static int syntax_error = FALSE; + + /* NFA regexp \ze operator encountered. */ +! static int nfa_has_zend; + + /* Number of sub expressions actually being used during execution. 1 if only + * the whole match (subexpr 0) is used. */ +*************** +*** 791,799 **** + case 'e': + EMIT(NFA_ZEND); + nfa_has_zend = TRUE; +! /* TODO: Currently \ze does not work properly. */ +! return FAIL; +! /* break; */ + case '1': + case '2': + case '3': +--- 791,797 ---- + case 'e': + EMIT(NFA_ZEND); + nfa_has_zend = TRUE; +! break; + case '1': + case '2': + case '3': +*************** +*** 2711,2716 **** +--- 2709,2716 ---- + case NFA_MCLOSE + 0: + if (nfa_has_zend) + { ++ /* Do not overwrite the position set by \ze. If no \ze ++ * encountered end will be set in nfa_regtry(). */ + addstate(l, state->out, m, off, lid); + break; + } +*************** +*** 3635,3640 **** +--- 3635,3641 ---- + + case NFA_SKIP_CHAR: + case NFA_ZSTART: ++ case NFA_ZEND: + /* TODO: should not happen? */ + break; + +*************** +*** 3795,3800 **** +--- 3796,3802 ---- + } + if (reg_endpos[0].lnum < 0) + { ++ /* pattern has a \ze but it didn't match, use current end */ + reg_endpos[0].lnum = reglnum; + reg_endpos[0].col = (int)(reginput - regline); + } +*** ../vim-7.3.1031/src/testdir/test64.in 2013-05-26 18:40:11.000000000 +0200 +--- src/testdir/test64.in 2013-05-27 20:02:44.000000000 +0200 +*************** +*** 151,158 **** + :" Search multi-modifiers + :call add(tl, [2, 'x*', 'xcd', 'x']) + :call add(tl, [2, 'x*', 'xxxxxxxxxxxxxxxxsofijiojgf', 'xxxxxxxxxxxxxxxx']) +! :call add(tl, [2, 'x*', 'abcdoij', '']) " empty match is good +! :call add(tl, [2, 'x\+', 'abcdoin']) " no match here + :call add(tl, [2, 'x\+', 'abcdeoijdfxxiuhfij', 'xx']) + :call add(tl, [2, 'x\+', 'xxxxx', 'xxxxx']) + :call add(tl, [2, 'x\+', 'abc x siufhiush xxxxxxxxx', 'x']) +--- 151,160 ---- + :" Search multi-modifiers + :call add(tl, [2, 'x*', 'xcd', 'x']) + :call add(tl, [2, 'x*', 'xxxxxxxxxxxxxxxxsofijiojgf', 'xxxxxxxxxxxxxxxx']) +! :" empty match is good +! :call add(tl, [2, 'x*', 'abcdoij', '']) +! :" no match here +! :call add(tl, [2, 'x\+', 'abcdoin']) + :call add(tl, [2, 'x\+', 'abcdeoijdfxxiuhfij', 'xx']) + :call add(tl, [2, 'x\+', 'xxxxx', 'xxxxx']) + :call add(tl, [2, 'x\+', 'abc x siufhiush xxxxxxxxx', 'x']) +*************** +*** 160,171 **** + :call add(tl, [2, 'x\=', 'abc sfoij', '']) " empty match is good + :call add(tl, [2, 'x\=', 'xxxxxxxxx c', 'x']) + :call add(tl, [2, 'x\?', 'x sdfoij', 'x']) +! :call add(tl, [2, 'x\?', 'abc sfoij', '']) " empty match is good + :call add(tl, [2, 'x\?', 'xxxxxxxxxx c', 'x']) + :" + :call add(tl, [2, 'a\{0,0}', 'abcdfdoij', '']) +! :call add(tl, [2, 'a\{0,1}', 'asiubid axxxaaa', 'a']) " same thing as 'a?' +! :call add(tl, [2, 'a\{1,0}', 'asiubid axxxaaa', 'a']) " same thing as 'a\{0,1}' + :call add(tl, [2, 'a\{3,6}', 'aa siofuh']) + :call add(tl, [2, 'a\{3,6}', 'aaaaa asfoij afaa', 'aaaaa']) + :call add(tl, [2, 'a\{3,6}', 'aaaaaaaa', 'aaaaaa']) +--- 162,176 ---- + :call add(tl, [2, 'x\=', 'abc sfoij', '']) " empty match is good + :call add(tl, [2, 'x\=', 'xxxxxxxxx c', 'x']) + :call add(tl, [2, 'x\?', 'x sdfoij', 'x']) +! :" empty match is good +! :call add(tl, [2, 'x\?', 'abc sfoij', '']) + :call add(tl, [2, 'x\?', 'xxxxxxxxxx c', 'x']) + :" + :call add(tl, [2, 'a\{0,0}', 'abcdfdoij', '']) +! :" same thing as 'a?' +! :call add(tl, [2, 'a\{0,1}', 'asiubid axxxaaa', 'a']) +! :" same thing as 'a\{0,1}' +! :call add(tl, [2, 'a\{1,0}', 'asiubid axxxaaa', 'a']) + :call add(tl, [2, 'a\{3,6}', 'aa siofuh']) + :call add(tl, [2, 'a\{3,6}', 'aaaaa asfoij afaa', 'aaaaa']) + :call add(tl, [2, 'a\{3,6}', 'aaaaaaaa', 'aaaaaa']) +*************** +*** 173,190 **** + :call add(tl, [2, 'a\{2}', 'aaaa', 'aa']) + :call add(tl, [2, 'a\{2}', 'iuash fiusahfliusah fiushfilushfi uhsaifuh askfj nasfvius afg aaaa sfiuhuhiushf', 'aa']) + :call add(tl, [2, 'a\{2}', 'abcdefghijklmnopqrestuvwxyz1234567890']) +! :call add(tl, [2, 'a\{0,}', 'oij sdigfusnf', '']) " same thing as 'a*' + :call add(tl, [2, 'a\{0,}', 'aaaaa aa', 'aaaaa']) + :call add(tl, [2, 'a\{2,}', 'sdfiougjdsafg']) + :call add(tl, [0, 'a\{2,}', 'aaaaasfoij ', 'aaaaa']) + :call add(tl, [2, 'a\{,0}', 'oidfguih iuhi hiu aaaa', '']) + :call add(tl, [2, 'a\{,5}', 'abcd', 'a']) + :call add(tl, [2, 'a\{,5}', 'aaaaaaaaaa', 'aaaaa']) +! :call add(tl, [2, 'a\{}', 'bbbcddiuhfcd', '']) " same thing as 'a*' + :call add(tl, [2, 'a\{}', 'aaaaioudfh coisf jda', 'aaaa']) + :" + :call add(tl, [2, 'a\{-0,0}', 'abcdfdoij', '']) +! :call add(tl, [2, 'a\{-0,1}', 'asiubid axxxaaa', '']) " anti-greedy version of 'a?' + :call add(tl, [2, 'a\{-3,6}', 'aa siofuh']) + :call add(tl, [2, 'a\{-3,6}', 'aaaaa asfoij afaa', 'aaa']) + :call add(tl, [2, 'a\{-3,6}', 'aaaaaaaa', 'aaa']) +--- 178,198 ---- + :call add(tl, [2, 'a\{2}', 'aaaa', 'aa']) + :call add(tl, [2, 'a\{2}', 'iuash fiusahfliusah fiushfilushfi uhsaifuh askfj nasfvius afg aaaa sfiuhuhiushf', 'aa']) + :call add(tl, [2, 'a\{2}', 'abcdefghijklmnopqrestuvwxyz1234567890']) +! :" same thing as 'a*' +! :call add(tl, [2, 'a\{0,}', 'oij sdigfusnf', '']) + :call add(tl, [2, 'a\{0,}', 'aaaaa aa', 'aaaaa']) + :call add(tl, [2, 'a\{2,}', 'sdfiougjdsafg']) + :call add(tl, [0, 'a\{2,}', 'aaaaasfoij ', 'aaaaa']) + :call add(tl, [2, 'a\{,0}', 'oidfguih iuhi hiu aaaa', '']) + :call add(tl, [2, 'a\{,5}', 'abcd', 'a']) + :call add(tl, [2, 'a\{,5}', 'aaaaaaaaaa', 'aaaaa']) +! :" same thing as 'a*' +! :call add(tl, [2, 'a\{}', 'bbbcddiuhfcd', '']) + :call add(tl, [2, 'a\{}', 'aaaaioudfh coisf jda', 'aaaa']) + :" + :call add(tl, [2, 'a\{-0,0}', 'abcdfdoij', '']) +! :" anti-greedy version of 'a?' +! :call add(tl, [2, 'a\{-0,1}', 'asiubid axxxaaa', '']) + :call add(tl, [2, 'a\{-3,6}', 'aa siofuh']) + :call add(tl, [2, 'a\{-3,6}', 'aaaaa asfoij afaa', 'aaa']) + :call add(tl, [2, 'a\{-3,6}', 'aaaaaaaa', 'aaa']) +*************** +*** 198,204 **** + :call add(tl, [2, 'a\{-,0}', 'oidfguih iuhi hiu aaaa', '']) + :call add(tl, [2, 'a\{-,5}', 'abcd', '']) + :call add(tl, [2, 'a\{-,5}', 'aaaaaaaaaa', '']) +! :call add(tl, [0, 'a\{-}', 'bbbcddiuhfcd', '']) " anti-greedy version of 'a*' + :call add(tl, [0, 'a\{-}', 'aaaaioudfh coisf jda', '']) + :" + :" Test groups of characters and submatches +--- 206,213 ---- + :call add(tl, [2, 'a\{-,0}', 'oidfguih iuhi hiu aaaa', '']) + :call add(tl, [2, 'a\{-,5}', 'abcd', '']) + :call add(tl, [2, 'a\{-,5}', 'aaaaaaaaaa', '']) +! :" anti-greedy version of 'a*' +! :call add(tl, [0, 'a\{-}', 'bbbcddiuhfcd', '']) + :call add(tl, [0, 'a\{-}', 'aaaaioudfh coisf jda', '']) + :" + :" Test groups of characters and submatches +*************** +*** 243,252 **** + :call add(tl, [2, '[^[:alpha:]]\+','abcccadfoij7787ysf287yrnccdu','7787']) + :call add(tl, [2, '[-a]', '-', '-']) + :call add(tl, [2, '[a-]', '-', '-']) +! :call add(tl, [2, '[-./[:alnum:]_~]\+', 'log13.file', 'log13.file']) " filename regexp +! :call add(tl, [2, '[\]\^\-\\]\+', '\^\\\-\---^', '\^\\\-\---^']) " special chars +! :call add(tl, [2, '[[.a.]]\+', 'aa', 'aa']) " collation elem +! :call add(tl, [2, 'abc[0-9]*ddd', 'siuhabc ii']) " middle of regexp + :call add(tl, [2, 'abc[0-9]*ddd', 'adf abc44482ddd oijs', 'abc44482ddd']) + :call add(tl, [2, '\_[0-9]\+', 'asfi9888u', '9888']) + :call add(tl, [2, '[0-9\n]\+', 'asfi9888u', '9888']) +--- 252,265 ---- + :call add(tl, [2, '[^[:alpha:]]\+','abcccadfoij7787ysf287yrnccdu','7787']) + :call add(tl, [2, '[-a]', '-', '-']) + :call add(tl, [2, '[a-]', '-', '-']) +! :" filename regexp +! :call add(tl, [2, '[-./[:alnum:]_~]\+', 'log13.file', 'log13.file']) +! :" special chars +! :call add(tl, [2, '[\]\^\-\\]\+', '\^\\\-\---^', '\^\\\-\---^']) +! :" collation elem +! :call add(tl, [2, '[[.a.]]\+', 'aa', 'aa']) +! :" middle of regexp +! :call add(tl, [2, 'abc[0-9]*ddd', 'siuhabc ii']) + :call add(tl, [2, 'abc[0-9]*ddd', 'adf abc44482ddd oijs', 'abc44482ddd']) + :call add(tl, [2, '\_[0-9]\+', 'asfi9888u', '9888']) + :call add(tl, [2, '[0-9\n]\+', 'asfi9888u', '9888']) +*************** +*** 267,277 **** + :call add(tl, [2, '\C[^A-Z]\+', 'ABCOIJDEOIFNSD jsfoij sa', ' jsfoij sa']) + :" + :"""" Tests for \z features +! :call add(tl, [2, 'xx \ze test', 'xx ']) " must match after \ze +! :call add(tl, [0, 'abc\zeend', 'oij abcend', 'abc']) + :call add(tl, [2, 'abc\zsdd', 'ddabcddxyzt', 'dd']) +! :call add(tl, [2, 'aa \zsax', ' ax']) " must match before \zs +! :call add(tl, [0, 'abc \zsmatch\ze abc', 'abc abc abc match abc abc', 'match']) + :call add(tl, [2, '\v(a \zsif .*){2}', 'a if then a if last', 'if last', 'a if last']) + :call add(tl, [2, '\>\zs.', 'aword. ', '.']) + :" +--- 280,296 ---- + :call add(tl, [2, '\C[^A-Z]\+', 'ABCOIJDEOIFNSD jsfoij sa', ' jsfoij sa']) + :" + :"""" Tests for \z features +! :" match ends at \ze +! :call add(tl, [2, 'xx \ze test', 'xx ']) +! :call add(tl, [2, 'abc\zeend', 'oij abcend', 'abc']) +! :call add(tl, [2, 'aa\zebb\|aaxx', ' aabb ', 'aa']) +! :call add(tl, [2, 'aa\zebb\|aaxx', ' aaxx ', 'aaxx']) +! :call add(tl, [2, 'aabb\|aa\zebb', ' aabb ', 'aabb']) +! :call add(tl, [2, 'aa\zebb\|aaebb', ' aabb ', 'aa']) +! :" match starts at \zs + :call add(tl, [2, 'abc\zsdd', 'ddabcddxyzt', 'dd']) +! :call add(tl, [2, 'aa \zsax', ' ax']) +! :call add(tl, [2, 'abc \zsmatch\ze abc', 'abc abc abc match abc abc', 'match']) + :call add(tl, [2, '\v(a \zsif .*){2}', 'a if then a if last', 'if last', 'a if last']) + :call add(tl, [2, '\>\zs.', 'aword. ', '.']) + :" +*************** +*** 279,290 **** + :call add(tl, [0, 'abc\@=', 'abc', 'ab']) + :call add(tl, [0, 'abc\@=cd', 'abcd', 'abcd']) + :call add(tl, [0, 'abc\@=', 'ababc', 'ab']) +! :call add(tl, [2, 'abcd\@=e', 'abcd']) " will never match, no matter the input text +! :call add(tl, [2, 'abcd\@=e', 'any text in here ... ']) " will never match + :call add(tl, [0, '\v(abc)@=..', 'xabcd', 'ab', 'abc']) +! :call add(tl, [2, '\(.*John\)\@=.*Bob', 'here is John, and here is B']) " no match + :call add(tl, [0, '\(John.*\)\@=.*Bob', 'John is Bobs friend', 'John is Bob', 'John is Bobs friend']) +! :call add(tl, [2, '.*John\&.*Bob', 'here is John, and here is B']) " no match + :call add(tl, [0, '.*John\&.*Bob', 'John is Bobs friend', 'John is Bob']) + :call add(tl, [0, '\v(test1)@=.*yep', 'this is a test1, yep it is', 'test1, yep', 'test1']) + :" +--- 298,313 ---- + :call add(tl, [0, 'abc\@=', 'abc', 'ab']) + :call add(tl, [0, 'abc\@=cd', 'abcd', 'abcd']) + :call add(tl, [0, 'abc\@=', 'ababc', 'ab']) +! :" will never match, no matter the input text +! :call add(tl, [2, 'abcd\@=e', 'abcd']) +! :" will never match +! :call add(tl, [2, 'abcd\@=e', 'any text in here ... ']) + :call add(tl, [0, '\v(abc)@=..', 'xabcd', 'ab', 'abc']) +! :" no match +! :call add(tl, [2, '\(.*John\)\@=.*Bob', 'here is John, and here is B']) + :call add(tl, [0, '\(John.*\)\@=.*Bob', 'John is Bobs friend', 'John is Bob', 'John is Bobs friend']) +! :" no match +! :call add(tl, [2, '.*John\&.*Bob', 'here is John, and here is B']) + :call add(tl, [0, '.*John\&.*Bob', 'John is Bobs friend', 'John is Bob']) + :call add(tl, [0, '\v(test1)@=.*yep', 'this is a test1, yep it is', 'test1, yep', 'test1']) + :" +*** ../vim-7.3.1031/src/testdir/test64.ok 2013-05-26 18:40:11.000000000 +0200 +--- src/testdir/test64.ok 2013-05-27 20:04:55.000000000 +0200 +*************** +*** 617,622 **** +--- 617,635 ---- + OK 2 - xx \ze test + OK 0 - abc\zeend + OK 1 - abc\zeend ++ OK 2 - abc\zeend ++ OK 0 - aa\zebb\|aaxx ++ OK 1 - aa\zebb\|aaxx ++ OK 2 - aa\zebb\|aaxx ++ OK 0 - aa\zebb\|aaxx ++ OK 1 - aa\zebb\|aaxx ++ OK 2 - aa\zebb\|aaxx ++ OK 0 - aabb\|aa\zebb ++ OK 1 - aabb\|aa\zebb ++ OK 2 - aabb\|aa\zebb ++ OK 0 - aa\zebb\|aaebb ++ OK 1 - aa\zebb\|aaebb ++ OK 2 - aa\zebb\|aaebb + OK 0 - abc\zsdd + OK 1 - abc\zsdd + OK 2 - abc\zsdd +*************** +*** 625,630 **** +--- 638,644 ---- + OK 2 - aa \zsax + OK 0 - abc \zsmatch\ze abc + OK 1 - abc \zsmatch\ze abc ++ OK 2 - abc \zsmatch\ze abc + OK 0 - \v(a \zsif .*){2} + OK 1 - \v(a \zsif .*){2} + OK 2 - \v(a \zsif .*){2} +*** ../vim-7.3.1031/src/version.c 2013-05-27 11:21:59.000000000 +0200 +--- src/version.c 2013-05-27 20:04:19.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1032, + /**/ + +-- +An operatingsystem is just a name you give to the rest of bloating +idiosyncratic machine-based-features you left out of your editor. + (author unknown) + + /// 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 /// diff --git a/7.3.1033 b/7.3.1033 new file mode 100644 index 0000000..e7ff7cb --- /dev/null +++ b/7.3.1033 @@ -0,0 +1,1346 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1033 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1033 +Problem: "\1" .. "\9" are not supported in the new regexp engine. +Solution: Implement them. Add a few more tests. +Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok, + src/regexp.h + + +*** ../vim-7.3.1032/src/regexp_nfa.c 2013-05-27 20:10:40.000000000 +0200 +--- src/regexp_nfa.c 2013-05-28 21:57:24.000000000 +0200 +*************** +*** 73,78 **** +--- 73,89 ---- + NFA_PREV_ATOM_JUST_BEFORE_NEG, /* Used for \@ */ + ++ NFA_BACKREF1, /* \1 */ ++ NFA_BACKREF2, /* \2 */ ++ NFA_BACKREF3, /* \3 */ ++ NFA_BACKREF4, /* \4 */ ++ NFA_BACKREF5, /* \5 */ ++ NFA_BACKREF6, /* \6 */ ++ NFA_BACKREF7, /* \7 */ ++ NFA_BACKREF8, /* \8 */ ++ NFA_BACKREF9, /* \9 */ ++ NFA_SKIP, /* Skip characters */ ++ + NFA_MOPEN, + NFA_MCLOSE = NFA_MOPEN + NSUBEXP, + +*************** +*** 709,715 **** + p = vim_strchr(classchars, no_Magic(c)); + if (p == NULL) + { +! return FAIL; /* runtime error */ + } + #ifdef FEAT_MBYTE + /* When '.' is followed by a composing char ignore the dot, so that +--- 720,727 ---- + p = vim_strchr(classchars, no_Magic(c)); + if (p == NULL) + { +! EMSGN("INTERNAL: Unknown character class char: %ld", c); +! return FAIL; + } + #ifdef FEAT_MBYTE + /* When '.' is followed by a composing char ignore the dot, so that +*************** +*** 766,785 **** + return FAIL; + + case Magic('~'): /* previous substitute pattern */ +! /* Not supported yet */ + return FAIL; + +! case Magic('1'): +! case Magic('2'): +! case Magic('3'): +! case Magic('4'): +! case Magic('5'): +! case Magic('6'): +! case Magic('7'): +! case Magic('8'): +! case Magic('9'): +! /* not supported yet */ +! return FAIL; + + case Magic('z'): + c = no_Magic(getchr()); +--- 778,795 ---- + return FAIL; + + case Magic('~'): /* previous substitute pattern */ +! /* TODO: Not supported yet */ + return FAIL; + +! case Magic('1'): EMIT(NFA_BACKREF1); break; +! case Magic('2'): EMIT(NFA_BACKREF2); break; +! case Magic('3'): EMIT(NFA_BACKREF3); break; +! case Magic('4'): EMIT(NFA_BACKREF4); break; +! case Magic('5'): EMIT(NFA_BACKREF5); break; +! case Magic('6'): EMIT(NFA_BACKREF6); break; +! case Magic('7'): EMIT(NFA_BACKREF7); break; +! case Magic('8'): EMIT(NFA_BACKREF8); break; +! case Magic('9'): EMIT(NFA_BACKREF9); break; + + case Magic('z'): + c = no_Magic(getchr()); +*************** +*** 802,808 **** + case '8': + case '9': + case '(': +! /* \z1...\z9 and \z( not yet supported */ + return FAIL; + default: + syntax_error = TRUE; +--- 812,818 ---- + case '8': + case '9': + case '(': +! /* TODO: \z1...\z9 and \z( not yet supported */ + return FAIL; + default: + syntax_error = TRUE; +*************** +*** 854,885 **** + * pattern -- regardless of whether or not it makes sense. */ + case '^': + EMIT(NFA_BOF); +! /* Not yet supported */ + return FAIL; + break; + + case '$': + EMIT(NFA_EOF); +! /* Not yet supported */ + return FAIL; + break; + + case '#': +! /* not supported yet */ + return FAIL; + break; + + case 'V': +! /* not supported yet */ + return FAIL; + break; + + case '[': +! /* \%[abc] not supported yet */ + return FAIL; + + default: +! /* not supported yet */ + return FAIL; + } + break; +--- 864,913 ---- + * pattern -- regardless of whether or not it makes sense. */ + case '^': + EMIT(NFA_BOF); +! /* TODO: Not yet supported */ + return FAIL; + break; + + case '$': + EMIT(NFA_EOF); +! /* TODO: Not yet supported */ + return FAIL; + break; + + case '#': +! /* TODO: not supported yet */ + return FAIL; + break; + + case 'V': +! /* TODO: not supported yet */ + return FAIL; + break; + + case '[': +! /* TODO: \%[abc] not supported yet */ +! return FAIL; +! +! case '0': +! case '1': +! case '2': +! case '3': +! case '4': +! case '5': +! case '6': +! case '7': +! case '8': +! case '9': +! case '<': +! case '>': +! case '\'': +! /* TODO: not supported yet */ + return FAIL; + + default: +! syntax_error = TRUE; +! EMSGN(_("E867: (NFA) Unknown operator '\\%%%c'"), +! no_Magic(c)); + return FAIL; + } + break; +*************** +*** 1672,1677 **** +--- 1700,1716 ---- + case NFA_ZSTART: STRCPY(code, "NFA_ZSTART"); break; + case NFA_ZEND: STRCPY(code, "NFA_ZEND"); break; + ++ case NFA_BACKREF1: STRCPY(code, "NFA_BACKREF1"); break; ++ case NFA_BACKREF2: STRCPY(code, "NFA_BACKREF2"); break; ++ case NFA_BACKREF3: STRCPY(code, "NFA_BACKREF3"); break; ++ case NFA_BACKREF4: STRCPY(code, "NFA_BACKREF4"); break; ++ case NFA_BACKREF5: STRCPY(code, "NFA_BACKREF5"); break; ++ case NFA_BACKREF6: STRCPY(code, "NFA_BACKREF6"); break; ++ case NFA_BACKREF7: STRCPY(code, "NFA_BACKREF7"); break; ++ case NFA_BACKREF8: STRCPY(code, "NFA_BACKREF8"); break; ++ case NFA_BACKREF9: STRCPY(code, "NFA_BACKREF9"); break; ++ case NFA_SKIP: STRCPY(code, "NFA_SKIP"); break; ++ + case NFA_PREV_ATOM_NO_WIDTH: + STRCPY(code, "NFA_PREV_ATOM_NO_WIDTH"); break; + case NFA_NOPEN: STRCPY(code, "NFA_MOPEN_INVISIBLE"); break; +*************** +*** 1949,1955 **** + + s->id = istate; + s->lastlist = 0; +- s->visits = 0; + s->negated = FALSE; + + return s; +--- 1988,1993 ---- +*************** +*** 2416,2421 **** +--- 2454,2483 ---- + PUSH(frag(s, list1(&s1->out))); + break; + ++ case NFA_BACKREF1: ++ case NFA_BACKREF2: ++ case NFA_BACKREF3: ++ case NFA_BACKREF4: ++ case NFA_BACKREF5: ++ case NFA_BACKREF6: ++ case NFA_BACKREF7: ++ case NFA_BACKREF8: ++ case NFA_BACKREF9: ++ if (nfa_calc_size == TRUE) ++ { ++ nstate += 2; ++ break; ++ } ++ s = new_state(*p, NULL, NULL); ++ if (s == NULL) ++ goto theend; ++ s1 = new_state(NFA_SKIP, NULL, NULL); ++ if (s1 == NULL) ++ goto theend; ++ patch(list1(&s->out), s1); ++ PUSH(frag(s, list1(&s1->out))); ++ break; ++ + case NFA_ZSTART: + case NFA_ZEND: + default: +*************** +*** 2495,2523 **** + typedef struct + { + nfa_state_T *state; + regsub_T sub; /* submatch info, only party used */ + } nfa_thread_T; + + /* nfa_list_T contains the alternative NFA execution states. */ + typedef struct + { +! nfa_thread_T *t; +! int n; + } nfa_list_T; + + /* Used during execution: whether a match has been found. */ + static int nfa_match; + +! static void addstate __ARGS((nfa_list_T *l, nfa_state_T *state, regsub_T *m, int off, int lid)); +! static void addstate_here __ARGS((nfa_list_T *l, nfa_state_T *state, regsub_T *m, int lid, int *ip)); + + static void +! addstate(l, state, m, off, lid) + nfa_list_T *l; /* runtime state list */ + nfa_state_T *state; /* state to update */ +! regsub_T *m; /* pointers to subexpressions */ + int off; /* byte offset, when -1 go to next line */ +- int lid; + { + int subidx; + nfa_thread_T *lastthread; +--- 2557,2610 ---- + typedef struct + { + nfa_state_T *state; ++ int count; + regsub_T sub; /* submatch info, only party used */ + } nfa_thread_T; + + /* nfa_list_T contains the alternative NFA execution states. */ + typedef struct + { +! nfa_thread_T *t; /* allocated array of states */ +! int n; /* nr of states in "t" */ +! int id; /* ID of the list */ + } nfa_list_T; + ++ #ifdef ENABLE_LOG ++ static void ++ log_subexpr(sub) ++ regsub_T *sub; ++ { ++ int j; ++ ++ for (j = 0; j < sub->in_use; j++) ++ if (REG_MULTI) ++ fprintf(log_fd, "\n *** group %d, start: c=%d, l=%d, end: c=%d, l=%d", ++ j, ++ sub->multilist[j].start.col, ++ (int)sub->multilist[j].start.lnum, ++ sub->multilist[j].end.col, ++ (int)sub->multilist[j].end.lnum); ++ else ++ fprintf(log_fd, "\n *** group %d, start: \"%s\", end: \"%s\"", ++ j, ++ (char *)sub->linelist[j].start, ++ (char *)sub->linelist[j].end); ++ fprintf(log_fd, "\n"); ++ } ++ #endif ++ + /* Used during execution: whether a match has been found. */ + static int nfa_match; + +! static void addstate __ARGS((nfa_list_T *l, nfa_state_T *state, regsub_T *sub, int off)); +! static void addstate_here __ARGS((nfa_list_T *l, nfa_state_T *state, regsub_T *sub, int *ip)); + + static void +! addstate(l, state, sub, off) + nfa_list_T *l; /* runtime state list */ + nfa_state_T *state; /* state to update */ +! regsub_T *sub; /* pointers to subexpressions */ + int off; /* byte offset, when -1 go to next line */ + { + int subidx; + nfa_thread_T *lastthread; +*************** +*** 2545,2585 **** + case NFA_MCLOSE + 7: + case NFA_MCLOSE + 8: + case NFA_MCLOSE + 9: +! /* Do not remember these nodes in list "thislist" or "nextlist" */ + break; + + default: +! if (state->lastlist == lid) + { +! if (++state->visits > 2) +! return; + } +! else + { +! /* add the state to the list */ +! state->lastlist = lid; +! lastthread = &l->t[l->n++]; +! lastthread->state = state; +! lastthread->sub.in_use = m->in_use; +! if (m->in_use > 0) +! { +! /* Copy the match start and end positions. */ +! if (REG_MULTI) +! mch_memmove(&lastthread->sub.multilist[0], +! &m->multilist[0], +! sizeof(struct multipos) * m->in_use); +! else +! mch_memmove(&lastthread->sub.linelist[0], +! &m->linelist[0], +! sizeof(struct linepos) * m->in_use); +! } + } + } + + #ifdef ENABLE_LOG + nfa_set_code(state->c); +! fprintf(log_fd, "> Adding state %d to list. Character %s, code %d\n", +! abs(state->id), code, state->c); + #endif + switch (state->c) + { +--- 2632,2689 ---- + case NFA_MCLOSE + 7: + case NFA_MCLOSE + 8: + case NFA_MCLOSE + 9: +! /* These nodes are not added themselves but their "out" and/or +! * "out1" may be added below. */ +! break; +! +! case NFA_MOPEN: +! case NFA_MOPEN + 1: +! case NFA_MOPEN + 2: +! case NFA_MOPEN + 3: +! case NFA_MOPEN + 4: +! case NFA_MOPEN + 5: +! case NFA_MOPEN + 6: +! case NFA_MOPEN + 7: +! case NFA_MOPEN + 8: +! case NFA_MOPEN + 9: +! /* These nodes do not need to be added, but we need to bail out +! * when it was tried to be added to this list before. */ +! if (state->lastlist == l->id) +! return; +! state->lastlist = l->id; + break; + + default: +! if (state->lastlist == l->id) + { +! /* This state is already in the list, don't add it again, +! * unless it is an MOPEN that is used for a backreference. */ +! return; + } +! +! /* add the state to the list */ +! state->lastlist = l->id; +! lastthread = &l->t[l->n++]; +! lastthread->state = state; +! lastthread->sub.in_use = sub->in_use; +! if (sub->in_use > 0) + { +! /* Copy the match start and end positions. */ +! if (REG_MULTI) +! mch_memmove(&lastthread->sub.multilist[0], +! &sub->multilist[0], +! sizeof(struct multipos) * sub->in_use); +! else +! mch_memmove(&lastthread->sub.linelist[0], +! &sub->linelist[0], +! sizeof(struct linepos) * sub->in_use); + } + } + + #ifdef ENABLE_LOG + nfa_set_code(state->c); +! fprintf(log_fd, "> Adding state %d to list. Character %d: %s\n", +! abs(state->id), state->c, code); + #endif + switch (state->c) + { +*************** +*** 2588,2599 **** + break; + + case NFA_SPLIT: +! addstate(l, state->out, m, off, lid); +! addstate(l, state->out1, m, off, lid); +! break; +! +! case NFA_SKIP_CHAR: +! addstate(l, state->out, m, off, lid); + break; + + #if 0 +--- 2692,2699 ---- + break; + + case NFA_SPLIT: +! addstate(l, state->out, sub, off); +! addstate(l, state->out1, sub, off); + break; + + #if 0 +*************** +*** 2613,2621 **** + break; + #endif + + case NFA_NOPEN: + case NFA_NCLOSE: +! addstate(l, state->out, m, off, lid); + break; + + /* If this state is reached, then a recursive call of nfa_regmatch() +--- 2713,2722 ---- + break; + #endif + ++ case NFA_SKIP_CHAR: + case NFA_NOPEN: + case NFA_NCLOSE: +! addstate(l, state->out, sub, off); + break; + + /* If this state is reached, then a recursive call of nfa_regmatch() +*************** +*** 2646,2709 **** + * restore it when it was in use. Otherwise fill any gap. */ + if (REG_MULTI) + { +! if (subidx < m->in_use) + { +! save_lpos = m->multilist[subidx].start; + save_in_use = -1; + } + else + { +! save_in_use = m->in_use; +! for (i = m->in_use; i < subidx; ++i) + { +! m->multilist[i].start.lnum = -1; +! m->multilist[i].end.lnum = -1; + } +! m->in_use = subidx + 1; + } + if (off == -1) + { +! m->multilist[subidx].start.lnum = reglnum + 1; +! m->multilist[subidx].start.col = 0; + } + else + { +! m->multilist[subidx].start.lnum = reglnum; +! m->multilist[subidx].start.col = + (colnr_T)(reginput - regline + off); + } + } + else + { +! if (subidx < m->in_use) + { +! save_ptr = m->linelist[subidx].start; + save_in_use = -1; + } + else + { +! save_in_use = m->in_use; +! for (i = m->in_use; i < subidx; ++i) + { +! m->linelist[i].start = NULL; +! m->linelist[i].end = NULL; + } +! m->in_use = subidx + 1; + } +! m->linelist[subidx].start = reginput + off; + } + +! addstate(l, state->out, m, off, lid); + + if (save_in_use == -1) + { + if (REG_MULTI) +! m->multilist[subidx].start = save_lpos; + else +! m->linelist[subidx].start = save_ptr; + } + else +! m->in_use = save_in_use; + break; + + case NFA_MCLOSE + 0: +--- 2747,2810 ---- + * restore it when it was in use. Otherwise fill any gap. */ + if (REG_MULTI) + { +! if (subidx < sub->in_use) + { +! save_lpos = sub->multilist[subidx].start; + save_in_use = -1; + } + else + { +! save_in_use = sub->in_use; +! for (i = sub->in_use; i < subidx; ++i) + { +! sub->multilist[i].start.lnum = -1; +! sub->multilist[i].end.lnum = -1; + } +! sub->in_use = subidx + 1; + } + if (off == -1) + { +! sub->multilist[subidx].start.lnum = reglnum + 1; +! sub->multilist[subidx].start.col = 0; + } + else + { +! sub->multilist[subidx].start.lnum = reglnum; +! sub->multilist[subidx].start.col = + (colnr_T)(reginput - regline + off); + } + } + else + { +! if (subidx < sub->in_use) + { +! save_ptr = sub->linelist[subidx].start; + save_in_use = -1; + } + else + { +! save_in_use = sub->in_use; +! for (i = sub->in_use; i < subidx; ++i) + { +! sub->linelist[i].start = NULL; +! sub->linelist[i].end = NULL; + } +! sub->in_use = subidx + 1; + } +! sub->linelist[subidx].start = reginput + off; + } + +! addstate(l, state->out, sub, off); + + if (save_in_use == -1) + { + if (REG_MULTI) +! sub->multilist[subidx].start = save_lpos; + else +! sub->linelist[subidx].start = save_ptr; + } + else +! sub->in_use = save_in_use; + break; + + case NFA_MCLOSE + 0: +*************** +*** 2711,2717 **** + { + /* Do not overwrite the position set by \ze. If no \ze + * encountered end will be set in nfa_regtry(). */ +! addstate(l, state->out, m, off, lid); + break; + } + case NFA_MCLOSE + 1: +--- 2812,2818 ---- + { + /* Do not overwrite the position set by \ze. If no \ze + * encountered end will be set in nfa_regtry(). */ +! addstate(l, state->out, sub, off); + break; + } + case NFA_MCLOSE + 1: +*************** +*** 2731,2767 **** + + /* We don't fill in gaps here, there must have been an MOPEN that + * has done that. */ +! save_in_use = m->in_use; +! if (m->in_use <= subidx) +! m->in_use = subidx + 1; + if (REG_MULTI) + { +! save_lpos = m->multilist[subidx].end; + if (off == -1) + { +! m->multilist[subidx].end.lnum = reglnum + 1; +! m->multilist[subidx].end.col = 0; + } + else + { +! m->multilist[subidx].end.lnum = reglnum; +! m->multilist[subidx].end.col = + (colnr_T)(reginput - regline + off); + } + } + else + { +! save_ptr = m->linelist[subidx].end; +! m->linelist[subidx].end = reginput + off; + } + +! addstate(l, state->out, m, off, lid); + + if (REG_MULTI) +! m->multilist[subidx].end = save_lpos; + else +! m->linelist[subidx].end = save_ptr; +! m->in_use = save_in_use; + break; + } + } +--- 2832,2868 ---- + + /* We don't fill in gaps here, there must have been an MOPEN that + * has done that. */ +! save_in_use = sub->in_use; +! if (sub->in_use <= subidx) +! sub->in_use = subidx + 1; + if (REG_MULTI) + { +! save_lpos = sub->multilist[subidx].end; + if (off == -1) + { +! sub->multilist[subidx].end.lnum = reglnum + 1; +! sub->multilist[subidx].end.col = 0; + } + else + { +! sub->multilist[subidx].end.lnum = reglnum; +! sub->multilist[subidx].end.col = + (colnr_T)(reginput - regline + off); + } + } + else + { +! save_ptr = sub->linelist[subidx].end; +! sub->linelist[subidx].end = reginput + off; + } + +! addstate(l, state->out, sub, off); + + if (REG_MULTI) +! sub->multilist[subidx].end = save_lpos; + else +! sub->linelist[subidx].end = save_ptr; +! sub->in_use = save_in_use; + break; + } + } +*************** +*** 2773,2783 **** + * matters for alternatives. + */ + static void +! addstate_here(l, state, m, lid, ip) + nfa_list_T *l; /* runtime state list */ + nfa_state_T *state; /* state to update */ +! regsub_T *m; /* pointers to subexpressions */ +! int lid; + int *ip; + { + int tlen = l->n; +--- 2874,2883 ---- + * matters for alternatives. + */ + static void +! addstate_here(l, state, sub, ip) + nfa_list_T *l; /* runtime state list */ + nfa_state_T *state; /* state to update */ +! regsub_T *sub; /* pointers to subexpressions */ + int *ip; + { + int tlen = l->n; +*************** +*** 2785,2791 **** + int i = *ip; + + /* first add the state(s) at the end, so that we know how many there are */ +! addstate(l, state, m, 0, lid); + + /* when "*ip" was at the end of the list, nothing to do */ + if (i + 1 == tlen) +--- 2885,2891 ---- + int i = *ip; + + /* first add the state(s) at the end, so that we know how many there are */ +! addstate(l, state, sub, 0); + + /* when "*ip" was at the end of the list, nothing to do */ + if (i + 1 == tlen) +*************** +*** 2895,2900 **** +--- 2995,3052 ---- + return FAIL; + } + ++ static int match_backref __ARGS((regsub_T *sub, int subidx, int *bytelen)); ++ ++ /* ++ * Check for a match with subexpression "subidx". ++ * return TRUE if it matches. ++ */ ++ static int ++ match_backref(sub, subidx, bytelen) ++ regsub_T *sub; /* pointers to subexpressions */ ++ int subidx; ++ int *bytelen; /* out: length of match in bytes */ ++ { ++ int len; ++ ++ if (sub->in_use <= subidx) ++ { ++ retempty: ++ /* backref was not set, match an empty string */ ++ *bytelen = 0; ++ return TRUE; ++ } ++ ++ if (REG_MULTI) ++ { ++ if (sub->multilist[subidx].start.lnum < 0 ++ || sub->multilist[subidx].end.lnum < 0) ++ goto retempty; ++ /* TODO: line breaks */ ++ len = sub->multilist[subidx].end.col ++ - sub->multilist[subidx].start.col; ++ if (cstrncmp(regline + sub->multilist[subidx].start.col, ++ reginput, &len) == 0) ++ { ++ *bytelen = len; ++ return TRUE; ++ } ++ } ++ else ++ { ++ if (sub->linelist[subidx].start == NULL ++ || sub->linelist[subidx].end == NULL) ++ goto retempty; ++ len = (int)(sub->linelist[subidx].end - sub->linelist[subidx].start); ++ if (cstrncmp(sub->linelist[subidx].start, reginput, &len) == 0) ++ { ++ *bytelen = len; ++ return TRUE; ++ } ++ } ++ return FALSE; ++ } ++ + /* + * Set all NFA nodes' list ID equal to -1. + */ +*************** +*** 2902,2910 **** + nfa_set_neg_listids(start) + nfa_state_T *start; + { +! if (start == NULL) +! return; +! if (start->lastlist >= 0) + { + start->lastlist = -1; + nfa_set_neg_listids(start->out); +--- 3054,3060 ---- + nfa_set_neg_listids(start) + nfa_state_T *start; + { +! if (start != NULL && start->lastlist >= 0) + { + start->lastlist = -1; + nfa_set_neg_listids(start->out); +*************** +*** 2919,2927 **** + nfa_set_null_listids(start) + nfa_state_T *start; + { +! if (start == NULL) +! return; +! if (start->lastlist == -1) + { + start->lastlist = 0; + nfa_set_null_listids(start->out); +--- 3069,3075 ---- + nfa_set_null_listids(start) + nfa_state_T *start; + { +! if (start != NULL && start->lastlist == -1) + { + start->lastlist = 0; + nfa_set_null_listids(start->out); +*************** +*** 2937,2945 **** + nfa_state_T *start; + int *list; + { +! if (start == NULL) +! return; +! if (start->lastlist != -1) + { + list[abs(start->id)] = start->lastlist; + start->lastlist = -1; +--- 3085,3091 ---- + nfa_state_T *start; + int *list; + { +! if (start != NULL && start->lastlist != -1) + { + list[abs(start->id)] = start->lastlist; + start->lastlist = -1; +*************** +*** 2956,2964 **** + nfa_state_T *start; + int *list; + { +! if (start == NULL) +! return; +! if (start->lastlist == -1) + { + start->lastlist = list[abs(start->id)]; + nfa_restore_listids(start->out, list); +--- 3102,3108 ---- + nfa_state_T *start; + int *list; + { +! if (start != NULL && start->lastlist == -1) + { + start->lastlist = list[abs(start->id)]; + nfa_restore_listids(start->out, list); +*************** +*** 3047,3053 **** + #ifdef ENABLE_LOG + fprintf(log_fd, "(---) STARTSTATE\n"); + #endif +! addstate(thislist, start, m, 0, listid); + + /* There are two cases when the NFA advances: 1. input char matches the + * NFA node and 2. input char does not match the NFA node, but the next +--- 3191,3198 ---- + #ifdef ENABLE_LOG + fprintf(log_fd, "(---) STARTSTATE\n"); + #endif +! thislist->id = listid; +! addstate(thislist, start, m, 0); + + /* There are two cases when the NFA advances: 1. input char matches the + * NFA node and 2. input char does not match the NFA node, but the next +*************** +*** 3060,3066 **** + #define ADD_POS_NEG_STATE(node) \ + ll = listtbl[result ? 1 : 0][node->negated]; \ + if (ll != NULL) \ +! addstate(ll, node->out , &t->sub, clen, listid + 1); + + + /* +--- 3205,3211 ---- + #define ADD_POS_NEG_STATE(node) \ + ll = listtbl[result ? 1 : 0][node->negated]; \ + if (ll != NULL) \ +! addstate(ll, node->out , &t->sub, clen); + + + /* +*************** +*** 3092,3100 **** + /* swap lists */ + thislist = &list[flag]; + nextlist = &list[flag ^= 1]; +! nextlist->n = 0; /* `clear' nextlist */ + listtbl[1][0] = nextlist; + ++listid; + + #ifdef ENABLE_LOG + fprintf(log_fd, "------------------------------------------\n"); +--- 3237,3248 ---- + /* swap lists */ + thislist = &list[flag]; + nextlist = &list[flag ^= 1]; +! nextlist->n = 0; /* clear nextlist */ + listtbl[1][0] = nextlist; + ++listid; ++ thislist->id = listid; ++ nextlist->id = listid + 1; ++ neglist->id = listid + 1; + + #ifdef ENABLE_LOG + fprintf(log_fd, "------------------------------------------\n"); +*************** +*** 3156,3162 **** + if (REG_MULTI) + for (j = 0; j < submatch->in_use; j++) + { +! submatch->multilist[j].start = t->sub.multilist[j].start; + submatch->multilist[j].end = t->sub.multilist[j].end; + } + else +--- 3304,3311 ---- + if (REG_MULTI) + for (j = 0; j < submatch->in_use; j++) + { +! submatch->multilist[j].start = +! t->sub.multilist[j].start; + submatch->multilist[j].end = t->sub.multilist[j].end; + } + else +*************** +*** 3166,3185 **** + submatch->linelist[j].end = t->sub.linelist[j].end; + } + #ifdef ENABLE_LOG +! for (j = 0; j < t->sub.in_use; j++) +! if (REG_MULTI) +! fprintf(log_fd, "\n *** group %d, start: c=%d, l=%d, end: c=%d, l=%d", +! j, +! t->sub.multilist[j].start.col, +! (int)t->sub.multilist[j].start.lnum, +! t->sub.multilist[j].end.col, +! (int)t->sub.multilist[j].end.lnum); +! else +! fprintf(log_fd, "\n *** group %d, start: \"%s\", end: \"%s\"", +! j, +! (char *)t->sub.linelist[j].start, +! (char *)t->sub.linelist[j].end); +! fprintf(log_fd, "\n"); + #endif + /* Found the left-most longest match, do not look at any other + * states at this position. When the list of states is going +--- 3315,3321 ---- + submatch->linelist[j].end = t->sub.linelist[j].end; + } + #ifdef ENABLE_LOG +! log_subexpr(&t->sub); + #endif + /* Found the left-most longest match, do not look at any other + * states at this position. When the list of states is going +*************** +*** 3198,3205 **** + * nfa_regmatch(). Submatches are stored in *m, and used in + * the parent call. */ + if (start->c == NFA_MOPEN + 0) +! addstate_here(thislist, t->state->out, &t->sub, listid, +! &listidx); + else + { + *m = t->sub; +--- 3334,3340 ---- + * nfa_regmatch(). Submatches are stored in *m, and used in + * the parent call. */ + if (start->c == NFA_MOPEN + 0) +! addstate_here(thislist, t->state->out, &t->sub, &listidx); + else + { + *m = t->sub; +*************** +*** 3277,3283 **** + + /* t->state->out1 is the corresponding END_INVISIBLE node */ + addstate_here(thislist, t->state->out1->out, &t->sub, +! listid, &listidx); + } + else + { +--- 3412,3418 ---- + + /* t->state->out1 is the corresponding END_INVISIBLE node */ + addstate_here(thislist, t->state->out1->out, &t->sub, +! &listidx); + } + else + { +*************** +*** 3288,3301 **** + + case NFA_BOL: + if (reginput == regline) +! addstate_here(thislist, t->state->out, &t->sub, listid, +! &listidx); + break; + + case NFA_EOL: + if (curc == NUL) +! addstate_here(thislist, t->state->out, &t->sub, listid, +! &listidx); + break; + + case NFA_BOW: +--- 3423,3434 ---- + + case NFA_BOL: + if (reginput == regline) +! addstate_here(thislist, t->state->out, &t->sub, &listidx); + break; + + case NFA_EOL: + if (curc == NUL) +! addstate_here(thislist, t->state->out, &t->sub, &listidx); + break; + + case NFA_BOW: +*************** +*** 3322,3329 **** + && vim_iswordc_buf(reginput[-1], reg_buf))) + bow = FALSE; + if (bow) +! addstate_here(thislist, t->state->out, &t->sub, listid, +! &listidx); + break; + } + +--- 3455,3461 ---- + && vim_iswordc_buf(reginput[-1], reg_buf))) + bow = FALSE; + if (bow) +! addstate_here(thislist, t->state->out, &t->sub, &listidx); + break; + } + +*************** +*** 3351,3358 **** + && vim_iswordc_buf(curc, reg_buf))) + eow = FALSE; + if (eow) +! addstate_here(thislist, t->state->out, &t->sub, listid, +! &listidx); + break; + } + +--- 3483,3489 ---- + && vim_iswordc_buf(curc, reg_buf))) + eow = FALSE; + if (eow) +! addstate_here(thislist, t->state->out, &t->sub, &listidx); + break; + } + +*************** +*** 3442,3453 **** + go_to_nextline = TRUE; + /* Pass -1 for the offset, which means taking the position + * at the start of the next line. */ +! addstate(nextlist, t->state->out, &t->sub, -1, listid + 1); + } + else if (curc == '\n' && reg_line_lbr) + { + /* match \n as if it is an ordinary character */ +! addstate(nextlist, t->state->out, &t->sub, 1, listid + 1); + } + break; + +--- 3573,3584 ---- + go_to_nextline = TRUE; + /* Pass -1 for the offset, which means taking the position + * at the start of the next line. */ +! addstate(nextlist, t->state->out, &t->sub, -1); + } + else if (curc == '\n' && reg_line_lbr) + { + /* match \n as if it is an ordinary character */ +! addstate(nextlist, t->state->out, &t->sub, 1); + } + break; + +*************** +*** 3475,3489 **** + /* This follows a series of negated nodes, like: + * CHAR(x), NFA_NOT, CHAR(y), NFA_NOT etc. */ + if (curc > 0) +! addstate(nextlist, t->state->out, &t->sub, clen, +! listid + 1); + break; + + case NFA_ANY: + /* Any char except '\0', (end of input) does not match. */ + if (curc > 0) +! addstate(nextlist, t->state->out, &t->sub, clen, +! listid + 1); + break; + + /* +--- 3606,3618 ---- + /* This follows a series of negated nodes, like: + * CHAR(x), NFA_NOT, CHAR(y), NFA_NOT etc. */ + if (curc > 0) +! addstate(nextlist, t->state->out, &t->sub, clen); + break; + + case NFA_ANY: + /* Any char except '\0', (end of input) does not match. */ + if (curc > 0) +! addstate(nextlist, t->state->out, &t->sub, clen); + break; + + /* +*************** +*** 3620,3637 **** + ADD_POS_NEG_STATE(t->state); + break; + +! case NFA_MOPEN + 0: +! case NFA_MOPEN + 1: +! case NFA_MOPEN + 2: +! case NFA_MOPEN + 3: +! case NFA_MOPEN + 4: +! case NFA_MOPEN + 5: +! case NFA_MOPEN + 6: +! case NFA_MOPEN + 7: +! case NFA_MOPEN + 8: +! case NFA_MOPEN + 9: +! /* handled below */ + break; + + case NFA_SKIP_CHAR: + case NFA_ZSTART: +--- 3749,3822 ---- + ADD_POS_NEG_STATE(t->state); + break; + +! case NFA_BACKREF1: +! case NFA_BACKREF2: +! case NFA_BACKREF3: +! case NFA_BACKREF4: +! case NFA_BACKREF5: +! case NFA_BACKREF6: +! case NFA_BACKREF7: +! case NFA_BACKREF8: +! case NFA_BACKREF9: +! /* \1 .. \9 */ +! { +! int subidx = t->state->c - NFA_BACKREF1 + 1; +! int bytelen; +! +! result = match_backref(&t->sub, subidx, &bytelen); +! if (result) +! { +! if (bytelen == 0) +! { +! /* empty match always works, add NFA_SKIP with zero to +! * be used next */ +! addstate_here(thislist, t->state->out, &t->sub, +! &listidx); +! thislist->t[listidx + 1].count = 0; +! } +! else if (bytelen <= clen) +! { +! /* match current character, jump ahead to out of +! * NFA_SKIP */ +! addstate(nextlist, t->state->out->out, &t->sub, clen); +! #ifdef ENABLE_LOG +! log_subexpr(&nextlist->t[nextlist->n - 1].sub); +! #endif +! } +! else +! { +! /* skip ofer the matched characters, set character +! * count in NFA_SKIP */ +! addstate(nextlist, t->state->out, &t->sub, bytelen); +! nextlist->t[nextlist->n - 1].count = bytelen - clen; +! #ifdef ENABLE_LOG +! log_subexpr(&nextlist->t[nextlist->n - 1].sub); +! #endif +! } +! +! } + break; ++ } ++ case NFA_SKIP: ++ /* charater of previous matching \1 .. \9 */ ++ if (t->count - clen <= 0) ++ { ++ /* end of match, go to what follows */ ++ addstate(nextlist, t->state->out, &t->sub, clen); ++ #ifdef ENABLE_LOG ++ log_subexpr(&nextlist->t[nextlist->n - 1].sub); ++ #endif ++ } ++ else ++ { ++ /* add state again with decremented count */ ++ addstate(nextlist, t->state, &t->sub, 0); ++ nextlist->t[nextlist->n - 1].count = t->count - clen; ++ #ifdef ENABLE_LOG ++ log_subexpr(&nextlist->t[nextlist->n - 1].sub); ++ #endif ++ } ++ break; + + case NFA_SKIP_CHAR: + case NFA_ZSTART: +*************** +*** 3680,3686 **** + #ifdef ENABLE_LOG + fprintf(log_fd, "(---) STARTSTATE\n"); + #endif +! addstate(nextlist, start, m, clen, listid + 1); + } + + #ifdef ENABLE_LOG +--- 3865,3871 ---- + #ifdef ENABLE_LOG + fprintf(log_fd, "(---) STARTSTATE\n"); + #endif +! addstate(nextlist, start, m, clen); + } + + #ifdef ENABLE_LOG +*************** +*** 3884,3890 **** + { + prog->state[i].id = i; + prog->state[i].lastlist = 0; +- prog->state[i].visits = 0; + } + + retval = nfa_regtry(prog->start, col); +--- 4069,4074 ---- +*** ../vim-7.3.1032/src/testdir/test64.in 2013-05-27 20:10:40.000000000 +0200 +--- src/testdir/test64.in 2013-05-28 20:24:11.000000000 +0200 +*************** +*** 331,336 **** +--- 331,340 ---- + :call add(tl, [2, '\ +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1034 +Problem: New regexp code using strange multi-byte code. +Solution: Use the normal code to advance and backup pointers. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1033/src/regexp_nfa.c 2013-05-28 22:03:13.000000000 +0200 +--- src/regexp_nfa.c 2013-05-28 22:25:28.000000000 +0200 +*************** +*** 188,195 **** + static int nfa_regcomp_start __ARGS((char_u*expr, int re_flags)); + static int nfa_recognize_char_class __ARGS((char_u *start, char_u *end, int extra_newl)); + static int nfa_emit_equi_class __ARGS((int c, int neg)); +- static void nfa_inc __ARGS((char_u **p)); +- static void nfa_dec __ARGS((char_u **p)); + static int nfa_regatom __ARGS((void)); + static int nfa_regpiece __ARGS((void)); + static int nfa_regconcat __ARGS((void)); +--- 188,193 ---- +*************** +*** 554,601 **** + */ + + /* +- * Increments the pointer "p" by one (multi-byte) character. +- */ +- static void +- nfa_inc(p) +- char_u **p; +- { +- #ifdef FEAT_MBYTE +- if (has_mbyte) +- mb_ptr2char_adv(p); +- else +- #endif +- *p = *p + 1; +- } +- +- /* +- * Decrements the pointer "p" by one (multi-byte) character. +- */ +- static void +- nfa_dec(p) +- char_u **p; +- { +- #ifdef FEAT_MBYTE +- char_u *p2, *oldp; +- +- if (has_mbyte) +- { +- oldp = *p; +- /* Try to find the multibyte char that advances to the current +- * position. */ +- do +- { +- *p = *p - 1; +- p2 = *p; +- mb_ptr2char_adv(&p2); +- } while (p2 != oldp); +- } +- #else +- *p = *p - 1; +- #endif +- } +- +- /* + * Parse the lowest level. + * + * An atom can be one of a long list of items. Many atoms match one character +--- 552,557 ---- +*************** +*** 963,969 **** + EMIT(NFA_OR); + } + regparse = endp; +! nfa_inc(®parse); + return OK; + } + /* +--- 919,925 ---- + EMIT(NFA_OR); + } + regparse = endp; +! mb_ptr_adv(regparse); + return OK; + } + /* +*************** +*** 978,984 **** + { + negated = TRUE; + glue = NFA_CONCAT; +! nfa_inc(®parse); + } + if (*regparse == '-') + { +--- 934,940 ---- + { + negated = TRUE; + glue = NFA_CONCAT; +! mb_ptr_adv(regparse); + } + if (*regparse == '-') + { +*************** +*** 986,992 **** + EMIT(startc); + TRY_NEG(); + EMIT_GLUE(); +! nfa_inc(®parse); + } + /* Emit the OR branches for each character in the [] */ + emit_range = FALSE; +--- 942,948 ---- + EMIT(startc); + TRY_NEG(); + EMIT_GLUE(); +! mb_ptr_adv(regparse); + } + /* Emit the OR branches for each character in the [] */ + emit_range = FALSE; +*************** +*** 1090,1096 **** + { + emit_range = TRUE; + startc = oldstartc; +! nfa_inc(®parse); + continue; /* reading the end of the range */ + } + +--- 1046,1052 ---- + { + emit_range = TRUE; + startc = oldstartc; +! mb_ptr_adv(regparse); + continue; /* reading the end of the range */ + } + +*************** +*** 1110,1116 **** + ) + ) + { +! nfa_inc(®parse); + + if (*regparse == 'n') + startc = reg_string ? NL : NFA_NEWL; +--- 1066,1072 ---- + ) + ) + { +! mb_ptr_adv(regparse); + + if (*regparse == 'n') + startc = reg_string ? NL : NFA_NEWL; +*************** +*** 1125,1131 **** + /* TODO(RE) This needs more testing */ + startc = coll_get_char(); + got_coll_char = TRUE; +! nfa_dec(®parse); + } + else + { +--- 1081,1087 ---- + /* TODO(RE) This needs more testing */ + startc = coll_get_char(); + got_coll_char = TRUE; +! mb_ptr_back(old_regparse, regparse); + } + else + { +*************** +*** 1210,1226 **** + EMIT_GLUE(); + } + +! nfa_inc(®parse); + } /* while (p < endp) */ + +! nfa_dec(®parse); + if (*regparse == '-') /* if last, '-' is just a char */ + { + EMIT('-'); + TRY_NEG(); + EMIT_GLUE(); + } +! nfa_inc(®parse); + + if (extra == ADD_NL) /* \_[] also matches \n */ + { +--- 1166,1182 ---- + EMIT_GLUE(); + } + +! mb_ptr_adv(regparse); + } /* while (p < endp) */ + +! mb_ptr_back(old_regparse, regparse); + if (*regparse == '-') /* if last, '-' is just a char */ + { + EMIT('-'); + TRY_NEG(); + EMIT_GLUE(); + } +! mb_ptr_adv(regparse); + + if (extra == ADD_NL) /* \_[] also matches \n */ + { +*************** +*** 1231,1237 **** + + /* skip the trailing ] */ + regparse = endp; +! nfa_inc(®parse); + if (negated == TRUE) + { + /* Mark end of negated char range */ +--- 1187,1193 ---- + + /* skip the trailing ] */ + regparse = endp; +! mb_ptr_adv(regparse); + if (negated == TRUE) + { + /* Mark end of negated char range */ +*** ../vim-7.3.1033/src/version.c 2013-05-28 22:03:13.000000000 +0200 +--- src/version.c 2013-05-28 22:29:18.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1034, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +7. You finally do take that vacation, but only after buying a cellular modem + and a laptop. + + /// 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 /// diff --git a/7.3.1035 b/7.3.1035 new file mode 100644 index 0000000..a188e1e --- /dev/null +++ b/7.3.1035 @@ -0,0 +1,53 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1035 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1035 +Problem: Compiler warning on 64 bit windows. +Solution: Add type cast. (Mike Williams) +Files: src/if_py_both.h + + +*** ../vim-7.3.1034/src/if_py_both.h 2013-05-24 18:58:39.000000000 +0200 +--- src/if_py_both.h 2013-05-28 19:19:50.000000000 +0200 +*************** +*** 3547,3553 **** + int status; + PyObject *pyfunc, *pymain; + +! if (u_save(RangeStart - 1, RangeEnd + 1) != OK) + { + EMSG(_("cannot save undo information")); + return; +--- 3547,3553 ---- + int status; + PyObject *pyfunc, *pymain; + +! if (u_save((linenr_T)RangeStart - 1, (linenr_T)RangeEnd + 1) != OK) + { + EMSG(_("cannot save undo information")); + return; +*** ../vim-7.3.1034/src/version.c 2013-05-28 22:30:22.000000000 +0200 +--- src/version.c 2013-05-28 22:31:18.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1035, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +8. You spend half of the plane trip with your laptop on your lap...and your + child in the overhead compartment. + + /// 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 /// diff --git a/7.3.1036 b/7.3.1036 new file mode 100644 index 0000000..bad7d11 --- /dev/null +++ b/7.3.1036 @@ -0,0 +1,515 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1036 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1036 +Problem: Can't build on HP-UX. +Solution: Give the union a name. (John Marriott) +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1035/src/regexp_nfa.c 2013-05-28 22:30:22.000000000 +0200 +--- src/regexp_nfa.c 2013-05-28 22:35:55.000000000 +0200 +*************** +*** 2493,2512 **** + { + int in_use; /* number of subexpr with useful info */ + +! /* When REG_MULTI is TRUE multilist is used, otherwise linelist. */ + union + { + struct multipos + { + lpos_T start; + lpos_T end; +! } multilist[NSUBEXP]; + struct linepos + { + char_u *start; + char_u *end; +! } linelist[NSUBEXP]; +! }; + } regsub_T; + + /* nfa_thread_T contains execution information of a NFA state */ +--- 2493,2512 ---- + { + int in_use; /* number of subexpr with useful info */ + +! /* When REG_MULTI is TRUE list.multi is used, otherwise list.line. */ + union + { + struct multipos + { + lpos_T start; + lpos_T end; +! } multi[NSUBEXP]; + struct linepos + { + char_u *start; + char_u *end; +! } line[NSUBEXP]; +! } list; + } regsub_T; + + /* nfa_thread_T contains execution information of a NFA state */ +*************** +*** 2536,2550 **** + if (REG_MULTI) + fprintf(log_fd, "\n *** group %d, start: c=%d, l=%d, end: c=%d, l=%d", + j, +! sub->multilist[j].start.col, +! (int)sub->multilist[j].start.lnum, +! sub->multilist[j].end.col, +! (int)sub->multilist[j].end.lnum); + else + fprintf(log_fd, "\n *** group %d, start: \"%s\", end: \"%s\"", + j, +! (char *)sub->linelist[j].start, +! (char *)sub->linelist[j].end); + fprintf(log_fd, "\n"); + } + #endif +--- 2536,2550 ---- + if (REG_MULTI) + fprintf(log_fd, "\n *** group %d, start: c=%d, l=%d, end: c=%d, l=%d", + j, +! sub->list.multi[j].start.col, +! (int)sub->list.multi[j].start.lnum, +! sub->list.multi[j].end.col, +! (int)sub->list.multi[j].end.lnum); + else + fprintf(log_fd, "\n *** group %d, start: \"%s\", end: \"%s\"", + j, +! (char *)sub->list.line[j].start, +! (char *)sub->list.line[j].end); + fprintf(log_fd, "\n"); + } + #endif +*************** +*** 2626,2637 **** + { + /* Copy the match start and end positions. */ + if (REG_MULTI) +! mch_memmove(&lastthread->sub.multilist[0], +! &sub->multilist[0], + sizeof(struct multipos) * sub->in_use); + else +! mch_memmove(&lastthread->sub.linelist[0], +! &sub->linelist[0], + sizeof(struct linepos) * sub->in_use); + } + } +--- 2626,2637 ---- + { + /* Copy the match start and end positions. */ + if (REG_MULTI) +! mch_memmove(&lastthread->sub.list.multi[0], +! &sub->list.multi[0], + sizeof(struct multipos) * sub->in_use); + else +! mch_memmove(&lastthread->sub.list.line[0], +! &sub->list.line[0], + sizeof(struct linepos) * sub->in_use); + } + } +*************** +*** 2705,2711 **** + { + if (subidx < sub->in_use) + { +! save_lpos = sub->multilist[subidx].start; + save_in_use = -1; + } + else +--- 2705,2711 ---- + { + if (subidx < sub->in_use) + { +! save_lpos = sub->list.multi[subidx].start; + save_in_use = -1; + } + else +*************** +*** 2713,2732 **** + save_in_use = sub->in_use; + for (i = sub->in_use; i < subidx; ++i) + { +! sub->multilist[i].start.lnum = -1; +! sub->multilist[i].end.lnum = -1; + } + sub->in_use = subidx + 1; + } + if (off == -1) + { +! sub->multilist[subidx].start.lnum = reglnum + 1; +! sub->multilist[subidx].start.col = 0; + } + else + { +! sub->multilist[subidx].start.lnum = reglnum; +! sub->multilist[subidx].start.col = + (colnr_T)(reginput - regline + off); + } + } +--- 2713,2732 ---- + save_in_use = sub->in_use; + for (i = sub->in_use; i < subidx; ++i) + { +! sub->list.multi[i].start.lnum = -1; +! sub->list.multi[i].end.lnum = -1; + } + sub->in_use = subidx + 1; + } + if (off == -1) + { +! sub->list.multi[subidx].start.lnum = reglnum + 1; +! sub->list.multi[subidx].start.col = 0; + } + else + { +! sub->list.multi[subidx].start.lnum = reglnum; +! sub->list.multi[subidx].start.col = + (colnr_T)(reginput - regline + off); + } + } +*************** +*** 2734,2740 **** + { + if (subidx < sub->in_use) + { +! save_ptr = sub->linelist[subidx].start; + save_in_use = -1; + } + else +--- 2734,2740 ---- + { + if (subidx < sub->in_use) + { +! save_ptr = sub->list.line[subidx].start; + save_in_use = -1; + } + else +*************** +*** 2742,2753 **** + save_in_use = sub->in_use; + for (i = sub->in_use; i < subidx; ++i) + { +! sub->linelist[i].start = NULL; +! sub->linelist[i].end = NULL; + } + sub->in_use = subidx + 1; + } +! sub->linelist[subidx].start = reginput + off; + } + + addstate(l, state->out, sub, off); +--- 2742,2753 ---- + save_in_use = sub->in_use; + for (i = sub->in_use; i < subidx; ++i) + { +! sub->list.line[i].start = NULL; +! sub->list.line[i].end = NULL; + } + sub->in_use = subidx + 1; + } +! sub->list.line[subidx].start = reginput + off; + } + + addstate(l, state->out, sub, off); +*************** +*** 2755,2763 **** + if (save_in_use == -1) + { + if (REG_MULTI) +! sub->multilist[subidx].start = save_lpos; + else +! sub->linelist[subidx].start = save_ptr; + } + else + sub->in_use = save_in_use; +--- 2755,2763 ---- + if (save_in_use == -1) + { + if (REG_MULTI) +! sub->list.multi[subidx].start = save_lpos; + else +! sub->list.line[subidx].start = save_ptr; + } + else + sub->in_use = save_in_use; +*************** +*** 2793,2823 **** + sub->in_use = subidx + 1; + if (REG_MULTI) + { +! save_lpos = sub->multilist[subidx].end; + if (off == -1) + { +! sub->multilist[subidx].end.lnum = reglnum + 1; +! sub->multilist[subidx].end.col = 0; + } + else + { +! sub->multilist[subidx].end.lnum = reglnum; +! sub->multilist[subidx].end.col = + (colnr_T)(reginput - regline + off); + } + } + else + { +! save_ptr = sub->linelist[subidx].end; +! sub->linelist[subidx].end = reginput + off; + } + + addstate(l, state->out, sub, off); + + if (REG_MULTI) +! sub->multilist[subidx].end = save_lpos; + else +! sub->linelist[subidx].end = save_ptr; + sub->in_use = save_in_use; + break; + } +--- 2793,2823 ---- + sub->in_use = subidx + 1; + if (REG_MULTI) + { +! save_lpos = sub->list.multi[subidx].end; + if (off == -1) + { +! sub->list.multi[subidx].end.lnum = reglnum + 1; +! sub->list.multi[subidx].end.col = 0; + } + else + { +! sub->list.multi[subidx].end.lnum = reglnum; +! sub->list.multi[subidx].end.col = + (colnr_T)(reginput - regline + off); + } + } + else + { +! save_ptr = sub->list.line[subidx].end; +! sub->list.line[subidx].end = reginput + off; + } + + addstate(l, state->out, sub, off); + + if (REG_MULTI) +! sub->list.multi[subidx].end = save_lpos; + else +! sub->list.line[subidx].end = save_ptr; + sub->in_use = save_in_use; + break; + } +*************** +*** 2975,2987 **** + + if (REG_MULTI) + { +! if (sub->multilist[subidx].start.lnum < 0 +! || sub->multilist[subidx].end.lnum < 0) + goto retempty; + /* TODO: line breaks */ +! len = sub->multilist[subidx].end.col +! - sub->multilist[subidx].start.col; +! if (cstrncmp(regline + sub->multilist[subidx].start.col, + reginput, &len) == 0) + { + *bytelen = len; +--- 2975,2987 ---- + + if (REG_MULTI) + { +! if (sub->list.multi[subidx].start.lnum < 0 +! || sub->list.multi[subidx].end.lnum < 0) + goto retempty; + /* TODO: line breaks */ +! len = sub->list.multi[subidx].end.col +! - sub->list.multi[subidx].start.col; +! if (cstrncmp(regline + sub->list.multi[subidx].start.col, + reginput, &len) == 0) + { + *bytelen = len; +*************** +*** 2990,3000 **** + } + else + { +! if (sub->linelist[subidx].start == NULL +! || sub->linelist[subidx].end == NULL) + goto retempty; +! len = (int)(sub->linelist[subidx].end - sub->linelist[subidx].start); +! if (cstrncmp(sub->linelist[subidx].start, reginput, &len) == 0) + { + *bytelen = len; + return TRUE; +--- 2990,3000 ---- + } + else + { +! if (sub->list.line[subidx].start == NULL +! || sub->list.line[subidx].end == NULL) + goto retempty; +! len = (int)(sub->list.line[subidx].end - sub->list.line[subidx].start); +! if (cstrncmp(sub->list.line[subidx].start, reginput, &len) == 0) + { + *bytelen = len; + return TRUE; +*************** +*** 3260,3274 **** + if (REG_MULTI) + for (j = 0; j < submatch->in_use; j++) + { +! submatch->multilist[j].start = +! t->sub.multilist[j].start; +! submatch->multilist[j].end = t->sub.multilist[j].end; + } + else + for (j = 0; j < submatch->in_use; j++) + { +! submatch->linelist[j].start = t->sub.linelist[j].start; +! submatch->linelist[j].end = t->sub.linelist[j].end; + } + #ifdef ENABLE_LOG + log_subexpr(&t->sub); +--- 3260,3275 ---- + if (REG_MULTI) + for (j = 0; j < submatch->in_use; j++) + { +! submatch->list.multi[j].start = +! t->sub.list.multi[j].start; +! submatch->list.multi[j].end = t->sub.list.multi[j].end; + } + else + for (j = 0; j < submatch->in_use; j++) + { +! submatch->list.line[j].start = +! t->sub.list.line[j].start; +! submatch->list.line[j].end = t->sub.list.line[j].end; + } + #ifdef ENABLE_LOG + log_subexpr(&t->sub); +*************** +*** 3355,3368 **** + if (REG_MULTI) + for (j = 1; j < m->in_use; j++) + { +! t->sub.multilist[j].start = m->multilist[j].start; +! t->sub.multilist[j].end = m->multilist[j].end; + } + else + for (j = 1; j < m->in_use; j++) + { +! t->sub.linelist[j].start = m->linelist[j].start; +! t->sub.linelist[j].end = m->linelist[j].end; + } + t->sub.in_use = m->in_use; + +--- 3356,3369 ---- + if (REG_MULTI) + for (j = 1; j < m->in_use; j++) + { +! t->sub.list.multi[j].start = m->list.multi[j].start; +! t->sub.list.multi[j].end = m->list.multi[j].end; + } + else + for (j = 1; j < m->in_use; j++) + { +! t->sub.list.line[j].start = m->list.line[j].start; +! t->sub.list.line[j].end = m->list.line[j].end; + } + t->sub.in_use = m->in_use; + +*************** +*** 3907,3919 **** + if (REG_MULTI) + { + /* Use 0xff to set lnum to -1 */ +! vim_memset(sub.multilist, 0xff, sizeof(struct multipos) * nfa_nsubexpr); +! vim_memset(m.multilist, 0xff, sizeof(struct multipos) * nfa_nsubexpr); + } + else + { +! vim_memset(sub.linelist, 0, sizeof(struct linepos) * nfa_nsubexpr); +! vim_memset(m.linelist, 0, sizeof(struct linepos) * nfa_nsubexpr); + } + sub.in_use = 0; + m.in_use = 0; +--- 3908,3920 ---- + if (REG_MULTI) + { + /* Use 0xff to set lnum to -1 */ +! vim_memset(sub.list.multi, 0xff, sizeof(struct multipos) * nfa_nsubexpr); +! vim_memset(m.list.multi, 0xff, sizeof(struct multipos) * nfa_nsubexpr); + } + else + { +! vim_memset(sub.list.line, 0, sizeof(struct linepos) * nfa_nsubexpr); +! vim_memset(m.list.line, 0, sizeof(struct linepos) * nfa_nsubexpr); + } + sub.in_use = 0; + m.in_use = 0; +*************** +*** 3926,3933 **** + { + for (i = 0; i < sub.in_use; i++) + { +! reg_startpos[i] = sub.multilist[i].start; +! reg_endpos[i] = sub.multilist[i].end; + } + + if (reg_startpos[0].lnum < 0) +--- 3927,3934 ---- + { + for (i = 0; i < sub.in_use; i++) + { +! reg_startpos[i] = sub.list.multi[i].start; +! reg_endpos[i] = sub.list.multi[i].end; + } + + if (reg_startpos[0].lnum < 0) +*************** +*** 3949,3956 **** + { + for (i = 0; i < sub.in_use; i++) + { +! reg_startp[i] = sub.linelist[i].start; +! reg_endp[i] = sub.linelist[i].end; + } + + if (reg_startp[0] == NULL) +--- 3950,3957 ---- + { + for (i = 0; i < sub.in_use; i++) + { +! reg_startp[i] = sub.list.line[i].start; +! reg_endp[i] = sub.list.line[i].end; + } + + if (reg_startp[0] == NULL) +*** ../vim-7.3.1035/src/version.c 2013-05-28 22:31:43.000000000 +0200 +--- src/version.c 2013-05-28 22:37:01.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1036, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +9. All your daydreaming is preoccupied with getting a faster connection to the + net: 28.8...ISDN...cable modem...T1...T3. + + /// 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 /// diff --git a/7.3.1037 b/7.3.1037 new file mode 100644 index 0000000..994134d --- /dev/null +++ b/7.3.1037 @@ -0,0 +1,408 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1037 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1037 +Problem: Look-behind matching is very slow on long lines. +Solution: Add a byte limit to how far back an attempt is made. +Files: src/regexp.c, src/regexp_nfa.c, src/testdir/test64.in, + src/testdir/test64.ok + + +*** ../vim-7.3.1036/src/regexp.c 2013-05-21 21:37:01.000000000 +0200 +--- src/regexp.c 2013-05-29 14:34:51.000000000 +0200 +*************** +*** 701,706 **** +--- 701,707 ---- + # define CASEMBC(x) + #endif + static void reginsert __ARGS((int, char_u *)); ++ static void reginsert_nr __ARGS((int op, long val, char_u *opnd)); + static void reginsert_limits __ARGS((int, long, long, char_u *)); + static char_u *re_put_long __ARGS((char_u *pr, long_u val)); + static int read_limits __ARGS((long *, long *)); +*************** +*** 1781,1787 **** +--- 1782,1790 ---- + case Magic('@'): + { + int lop = END; ++ int nr; + ++ nr = getdecchrs(); + switch (no_Magic(getchr())) + { + case '=': lop = MATCH; break; /* \@= */ +*************** +*** 1803,1809 **** + *flagp |= HASLOOKBH; + } + regtail(ret, regnode(END)); /* operand ends */ +! reginsert(lop, ret); + break; + } + +--- 1806,1819 ---- + *flagp |= HASLOOKBH; + } + regtail(ret, regnode(END)); /* operand ends */ +! if (lop == BEHIND || lop == NOBEHIND) +! { +! if (nr < 0) +! nr = 0; /* no limit is same as zero limit */ +! reginsert_nr(lop, nr, ret); +! } +! else +! reginsert(lop, ret); + break; + } + +*************** +*** 2780,2785 **** +--- 2790,2827 ---- + + /* + * Insert an operator in front of already-emitted operand. ++ * Add a number to the operator. ++ */ ++ static void ++ reginsert_nr(op, val, opnd) ++ int op; ++ long val; ++ char_u *opnd; ++ { ++ char_u *src; ++ char_u *dst; ++ char_u *place; ++ ++ if (regcode == JUST_CALC_SIZE) ++ { ++ regsize += 7; ++ return; ++ } ++ src = regcode; ++ regcode += 7; ++ dst = regcode; ++ while (src > opnd) ++ *--dst = *--src; ++ ++ place = opnd; /* Op node, where operand used to be. */ ++ *place++ = op; ++ *place++ = NUL; ++ *place++ = NUL; ++ place = re_put_long(place, (long_u)val); ++ } ++ ++ /* ++ * Insert an operator in front of already-emitted operand. + * The operator has the given limit values as operands. Also set next pointer. + * + * Means relocating the operand. +*************** +*** 3182,3188 **** + } + + /* +! * get and return the value of the decimal string immediately after the + * current position. Return -1 for invalid. Consumes all digits. + */ + static int +--- 3224,3230 ---- + } + + /* +! * Get and return the value of the decimal string immediately after the + * current position. Return -1 for invalid. Consumes all digits. + */ + static int +*************** +*** 3200,3205 **** +--- 3242,3248 ---- + nr *= 10; + nr += c - '0'; + ++regparse; ++ curchr = -1; /* no longer valid */ + } + + if (i == 0) +*************** +*** 5432,5438 **** + /* save the position after the found match for next */ + reg_save(&(((regbehind_T *)rp) - 1)->save_after, &backpos); + +! /* start looking for a match with operand at the current + * position. Go back one character until we find the + * result, hitting the start of the line or the previous + * line (for multi-line matching). +--- 5475,5481 ---- + /* save the position after the found match for next */ + reg_save(&(((regbehind_T *)rp) - 1)->save_after, &backpos); + +! /* Start looking for a match with operand at the current + * position. Go back one character until we find the + * result, hitting the start of the line or the previous + * line (for multi-line matching). +*************** +*** 5444,5450 **** + rp->rs_state = RS_BEHIND2; + + reg_restore(&rp->rs_un.regsave, &backpos); +! scan = OPERAND(rp->rs_scan); + } + break; + +--- 5487,5493 ---- + rp->rs_state = RS_BEHIND2; + + reg_restore(&rp->rs_un.regsave, &backpos); +! scan = OPERAND(rp->rs_scan) + 4; + } + break; + +*************** +*** 5472,5480 **** +--- 5515,5526 ---- + } + else + { ++ long limit; ++ + /* No match or a match that doesn't end where we want it: Go + * back one character. May go to previous line once. */ + no = OK; ++ limit = OPERAND_MIN(rp->rs_scan); + if (REG_MULTI) + { + if (rp->rs_un.regsave.rs_u.pos.col == 0) +*************** +*** 5493,5519 **** + } + } + else + #ifdef FEAT_MBYTE +! if (has_mbyte) +! rp->rs_un.regsave.rs_u.pos.col -= +! (*mb_head_off)(regline, regline + + rp->rs_un.regsave.rs_u.pos.col - 1) + 1; +! else + #endif +! --rp->rs_un.regsave.rs_u.pos.col; + } + else + { + if (rp->rs_un.regsave.rs_u.ptr == regline) + no = FAIL; + else +! --rp->rs_un.regsave.rs_u.ptr; + } + if (no == OK) + { + /* Advanced, prepare for finding match again. */ + reg_restore(&rp->rs_un.regsave, &backpos); +! scan = OPERAND(rp->rs_scan); + if (status == RA_MATCH) + { + /* We did match, so subexpr may have been changed, +--- 5539,5579 ---- + } + } + else ++ { + #ifdef FEAT_MBYTE +! if (has_mbyte) +! rp->rs_un.regsave.rs_u.pos.col -= +! (*mb_head_off)(regline, regline + + rp->rs_un.regsave.rs_u.pos.col - 1) + 1; +! else + #endif +! --rp->rs_un.regsave.rs_u.pos.col; +! if (limit > 0 +! && ((rp->rs_un.regsave.rs_u.pos.lnum +! < behind_pos.rs_u.pos.lnum +! ? (colnr_T)STRLEN(regline) +! : behind_pos.rs_u.pos.col) +! - rp->rs_un.regsave.rs_u.pos.col > limit)) +! no = FAIL; +! } + } + else + { + if (rp->rs_un.regsave.rs_u.ptr == regline) + no = FAIL; + else +! { +! mb_ptr_back(regline, rp->rs_un.regsave.rs_u.ptr); +! if (limit > 0 && (long)(behind_pos.rs_u.ptr +! - rp->rs_un.regsave.rs_u.ptr) > limit) +! no = FAIL; +! } + } + if (no == OK) + { + /* Advanced, prepare for finding match again. */ + reg_restore(&rp->rs_un.regsave, &backpos); +! scan = OPERAND(rp->rs_scan) + 4; + if (status == RA_MATCH) + { + /* We did match, so subexpr may have been changed, +*************** +*** 7773,7779 **** + #ifdef DEBUG + static char_u regname[][30] = { + "AUTOMATIC Regexp Engine", +! "BACKTACKING Regexp Engine", + "NFA Regexp Engine" + }; + #endif +--- 7833,7839 ---- + #ifdef DEBUG + static char_u regname[][30] = { + "AUTOMATIC Regexp Engine", +! "BACKTRACKING Regexp Engine", + "NFA Regexp Engine" + }; + #endif +*** ../vim-7.3.1036/src/regexp_nfa.c 2013-05-28 22:52:11.000000000 +0200 +--- src/regexp_nfa.c 2013-05-29 16:31:13.000000000 +0200 +*************** +*** 1331,1336 **** +--- 1331,1346 ---- + case '=': + EMIT(NFA_PREV_ATOM_NO_WIDTH); + break; ++ case '0': ++ case '1': ++ case '2': ++ case '3': ++ case '4': ++ case '5': ++ case '6': ++ case '7': ++ case '8': ++ case '9': + case '!': + case '<': + case '>': +*************** +*** 3817,3823 **** + * because recursive calls should only start in the first position. + * Also don't start a match past the first line. */ + if (nfa_match == FALSE && start->c == NFA_MOPEN + 0 +! && reglnum == 0 && clen != 0) + { + #ifdef ENABLE_LOG + fprintf(log_fd, "(---) STARTSTATE\n"); +--- 3827,3835 ---- + * because recursive calls should only start in the first position. + * Also don't start a match past the first line. */ + if (nfa_match == FALSE && start->c == NFA_MOPEN + 0 +! && reglnum == 0 && clen != 0 +! && (ireg_maxcol == 0 +! || (colnr_T)(reginput - regline) < ireg_maxcol)) + { + #ifdef ENABLE_LOG + fprintf(log_fd, "(---) STARTSTATE\n"); +*** ../vim-7.3.1036/src/testdir/test64.in 2013-05-28 22:03:13.000000000 +0200 +--- src/testdir/test64.in 2013-05-29 14:56:44.000000000 +0200 +*************** +*** 336,341 **** +--- 336,349 ---- + :"call add(tl, [2, '\(\i\+\) \1', 'xgoo goox', 'goo goo', 'goo']) + :call add(tl, [2, '\(a\)\(b\)\(c\)\(dd\)\(e\)\(f\)\(g\)\(h\)\(i\)\1\2\3\4\5\6\7\8\9', 'xabcddefghiabcddefghix', 'abcddefghiabcddefghi', 'a', 'b', 'c', 'dd', 'e', 'f', 'g', 'h', 'i']) + :" ++ :"""" Look-behind with limit ++ :call add(tl, [0, '<\@<=span.', 'xxspanxxTa 5 + Ac 7 + ghi ++ ++ xxxstart3 +*** ../vim-7.3.1036/src/version.c 2013-05-28 22:52:11.000000000 +0200 +--- src/version.c 2013-05-29 13:20:48.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1037, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +11. You find yourself typing "com" after every period when using a word + processor.com + + /// 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 /// diff --git a/7.3.1038 b/7.3.1038 new file mode 100644 index 0000000..468ef46 --- /dev/null +++ b/7.3.1038 @@ -0,0 +1,134 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1038 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1038 +Problem: Crash when using Cscope. +Solution: Avoid negative argument to vim_strncpy(). (Narendran + Gopalakrishnan) +Files: src/if_cscope.c + + +*** ../vim-7.3.1037/src/if_cscope.c 2013-05-06 04:21:35.000000000 +0200 +--- src/if_cscope.c 2013-05-29 19:12:55.000000000 +0200 +*************** +*** 2460,2472 **** + /* + * PRIVATE: cs_resolve_file + * +! * construct the full pathname to a file found in the cscope database. + * (Prepends ppath, if there is one and if it's not already prepended, + * otherwise just uses the name found.) + * +! * we need to prepend the prefix because on some cscope's (e.g., the one that + * ships with Solaris 2.6), the output never has the prefix prepended. +! * contrast this with my development system (Digital Unix), which does. + */ + static char * + cs_resolve_file(i, name) +--- 2460,2472 ---- + /* + * PRIVATE: cs_resolve_file + * +! * Construct the full pathname to a file found in the cscope database. + * (Prepends ppath, if there is one and if it's not already prepended, + * otherwise just uses the name found.) + * +! * We need to prepend the prefix because on some cscope's (e.g., the one that + * ships with Solaris 2.6), the output never has the prefix prepended. +! * Contrast this with my development system (Digital Unix), which does. + */ + static char * + cs_resolve_file(i, name) +*************** +*** 2493,2506 **** + if (csdir != NULL) + { + vim_strncpy(csdir, (char_u *)csinfo[i].fname, +! gettail((char_u *)csinfo[i].fname) - 1 - (char_u *)csinfo[i].fname); + len += (int)STRLEN(csdir); + } + } + +- if ((fullname = (char *)alloc(len)) == NULL) +- return NULL; +- + /* Note/example: this won't work if the cscope output already starts + * "../.." and the prefix path is also "../..". if something like this + * happens, you are screwed up and need to fix how you're using cscope. */ +--- 2493,2504 ---- + if (csdir != NULL) + { + vim_strncpy(csdir, (char_u *)csinfo[i].fname, +! gettail((char_u *)csinfo[i].fname) +! - (char_u *)csinfo[i].fname); + len += (int)STRLEN(csdir); + } + } + + /* Note/example: this won't work if the cscope output already starts + * "../.." and the prefix path is also "../..". if something like this + * happens, you are screwed up and need to fix how you're using cscope. */ +*************** +*** 2511,2526 **** + && name[0] != '\\' && name[1] != ':' + #endif + ) +! (void)sprintf(fullname, "%s/%s", csinfo[i].ppath, name); +! else if (csdir != NULL && csinfo[i].fname != NULL && STRLEN(csdir) > 0) + { + /* Check for csdir to be non empty to avoid empty path concatenated to +! * cscope output. TODO: avoid the unnecessary alloc/free of fullname. */ +! vim_free(fullname); + fullname = (char *)concat_fnames(csdir, (char_u *)name, TRUE); + } + else +! (void)sprintf(fullname, "%s", name); + + vim_free(csdir); + return fullname; +--- 2509,2528 ---- + && name[0] != '\\' && name[1] != ':' + #endif + ) +! { +! if ((fullname = (char *)alloc(len)) != NULL) +! (void)sprintf(fullname, "%s/%s", csinfo[i].ppath, name); +! } +! else if (csdir != NULL && csinfo[i].fname != NULL && *csdir != NUL) + { + /* Check for csdir to be non empty to avoid empty path concatenated to +! * cscope output. */ + fullname = (char *)concat_fnames(csdir, (char_u *)name, TRUE); + } + else +! { +! fullname = (char *)vim_strsave((char_u *)name); +! } + + vim_free(csdir); + return fullname; +*** ../vim-7.3.1037/src/version.c 2013-05-29 18:45:07.000000000 +0200 +--- src/version.c 2013-05-29 19:17:16.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1038, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +12. You turn off your modem and get this awful empty feeling, like you just + pulled the plug on a loved one. + + /// 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 /// diff --git a/7.3.1039 b/7.3.1039 new file mode 100644 index 0000000..d41cb42 --- /dev/null +++ b/7.3.1039 @@ -0,0 +1,380 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1039 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1039 +Problem: New regexp engine does not support \%23c, \%<23c and the like. +Solution: Implement them. (partly by Yasuhiro Matsumoto) +Files: src/regexp.h, src/regexp_nfa.c, src/testdir/test64.in, + src/testdir/test64.ok + + +*** ../vim-7.3.1038/src/regexp.h 2013-05-28 22:03:13.000000000 +0200 +--- src/regexp.h 2013-05-29 20:35:35.000000000 +0200 +*************** +*** 72,77 **** +--- 72,78 ---- + int id; + int lastlist; + int negated; ++ int val; + }; + + /* +*** ../vim-7.3.1038/src/regexp_nfa.c 2013-05-29 18:45:07.000000000 +0200 +--- src/regexp_nfa.c 2013-05-29 20:59:34.000000000 +0200 +*************** +*** 117,122 **** +--- 117,134 ---- + NFA_NLOWER, /* Match non-lowercase char */ + NFA_UPPER, /* Match uppercase char */ + NFA_NUPPER, /* Match non-uppercase char */ ++ ++ NFA_CURSOR, /* Match cursor pos */ ++ NFA_LNUM, /* Match line number */ ++ NFA_LNUM_GT, /* Match > line number */ ++ NFA_LNUM_LT, /* Match < line number */ ++ NFA_COL, /* Match cursor column */ ++ NFA_COL_GT, /* Match > cursor column */ ++ NFA_COL_LT, /* Match < cursor column */ ++ NFA_VCOL, /* Match cursor virtual column */ ++ NFA_VCOL_GT, /* Match > cursor virtual column */ ++ NFA_VCOL_LT, /* Match < cursor virtual column */ ++ + NFA_FIRST_NL = NFA_ANY + ADD_NL, + NFA_LAST_NL = NFA_NUPPER + ADD_NL, + +*************** +*** 205,214 **** + static nfa_state_T *post2nfa __ARGS((int *postfix, int *end, int nfa_calc_size)); + static int check_char_class __ARGS((int class, int c)); + static void st_error __ARGS((int *postfix, int *end, int *p)); + static void nfa_save_listids __ARGS((nfa_state_T *start, int *list)); + static void nfa_restore_listids __ARGS((nfa_state_T *start, int *list)); +! static void nfa_set_null_listids __ARGS((nfa_state_T *start)); +! static void nfa_set_neg_listids __ARGS((nfa_state_T *start)); + static long nfa_regtry __ARGS((nfa_state_T *start, colnr_T col)); + static long nfa_regexec_both __ARGS((char_u *line, colnr_T col)); + static regprog_T *nfa_regcomp __ARGS((char_u *expr, int re_flags)); +--- 217,227 ---- + static nfa_state_T *post2nfa __ARGS((int *postfix, int *end, int nfa_calc_size)); + static int check_char_class __ARGS((int class, int c)); + static void st_error __ARGS((int *postfix, int *end, int *p)); ++ static void nfa_set_neg_listids __ARGS((nfa_state_T *start)); ++ static void nfa_set_null_listids __ARGS((nfa_state_T *start)); + static void nfa_save_listids __ARGS((nfa_state_T *start, int *list)); + static void nfa_restore_listids __ARGS((nfa_state_T *start, int *list)); +! static int nfa_re_num_cmp __ARGS((long_u val, int op, long_u pos)); + static long nfa_regtry __ARGS((nfa_state_T *start, colnr_T col)); + static long nfa_regexec_both __ARGS((char_u *line, colnr_T col)); + static regprog_T *nfa_regcomp __ARGS((char_u *expr, int re_flags)); +*************** +*** 831,838 **** + break; + + case '#': +! /* TODO: not supported yet */ +! return FAIL; + break; + + case 'V': +--- 844,850 ---- + break; + + case '#': +! EMIT(NFA_CURSOR); + break; + + case 'V': +*************** +*** 844,866 **** + /* TODO: \%[abc] not supported yet */ + return FAIL; + +- case '0': +- case '1': +- case '2': +- case '3': +- case '4': +- case '5': +- case '6': +- case '7': +- case '8': +- case '9': +- case '<': +- case '>': +- case '\'': +- /* TODO: not supported yet */ +- return FAIL; +- + default: + syntax_error = TRUE; + EMSGN(_("E867: (NFA) Unknown operator '\\%%%c'"), + no_Magic(c)); +--- 856,891 ---- + /* TODO: \%[abc] not supported yet */ + return FAIL; + + default: ++ { ++ long_u n = 0; ++ int cmp = c; ++ ++ if (c == '<' || c == '>') ++ c = getchr(); ++ while (VIM_ISDIGIT(c)) ++ { ++ n = n * 10 + (c - '0'); ++ c = getchr(); ++ } ++ if (c == 'l' || c == 'c' || c == 'v') ++ { ++ EMIT(n); ++ if (c == 'l') ++ EMIT(cmp == '<' ? NFA_LNUM_LT : ++ cmp == '>' ? NFA_LNUM_GT : NFA_LNUM); ++ else if (c == 'c') ++ EMIT(cmp == '<' ? NFA_COL_LT : ++ cmp == '>' ? NFA_COL_GT : NFA_COL); ++ else ++ EMIT(cmp == '<' ? NFA_VCOL_LT : ++ cmp == '>' ? NFA_VCOL_GT : NFA_VCOL); ++ break; ++ } ++ else if (c == '\'') ++ /* TODO: \%'m not supported yet */ ++ return FAIL; ++ } + syntax_error = TRUE; + EMSGN(_("E867: (NFA) Unknown operator '\\%%%c'"), + no_Magic(c)); +*************** +*** 1679,1684 **** +--- 1704,1711 ---- + + case NFA_PREV_ATOM_NO_WIDTH: + STRCPY(code, "NFA_PREV_ATOM_NO_WIDTH"); break; ++ case NFA_PREV_ATOM_NO_WIDTH_NEG: ++ STRCPY(code, "NFA_PREV_ATOM_NO_WIDTH_NEG"); break; + case NFA_NOPEN: STRCPY(code, "NFA_MOPEN_INVISIBLE"); break; + case NFA_NCLOSE: STRCPY(code, "NFA_MCLOSE_INVISIBLE"); break; + case NFA_START_INVISIBLE: STRCPY(code, "NFA_START_INVISIBLE"); break; +*************** +*** 2444,2449 **** +--- 2471,2498 ---- + PUSH(frag(s, list1(&s1->out))); + break; + ++ case NFA_LNUM: ++ case NFA_LNUM_GT: ++ case NFA_LNUM_LT: ++ case NFA_VCOL: ++ case NFA_VCOL_GT: ++ case NFA_VCOL_LT: ++ case NFA_COL: ++ case NFA_COL_GT: ++ case NFA_COL_LT: ++ if (nfa_calc_size == TRUE) ++ { ++ nstate += 1; ++ break; ++ } ++ e1 = POP(); ++ s = new_state(*p, NULL, NULL); ++ if (s == NULL) ++ goto theend; ++ s->val = e1.start->c; ++ PUSH(frag(s, list1(&s->out))); ++ break; ++ + case NFA_ZSTART: + case NFA_ZEND: + default: +*************** +*** 3076,3081 **** +--- 3125,3141 ---- + } + } + ++ static int ++ nfa_re_num_cmp(val, op, pos) ++ long_u val; ++ int op; ++ long_u pos; ++ { ++ if (op == 1) return pos > val; ++ if (op == 2) return pos < val; ++ return val == pos; ++ } ++ + static int nfa_regmatch __ARGS((nfa_state_T *start, regsub_T *submatch, regsub_T *m)); + + /* +*************** +*** 3791,3796 **** +--- 3851,3895 ---- + /* TODO: should not happen? */ + break; + ++ case NFA_LNUM: ++ case NFA_LNUM_GT: ++ case NFA_LNUM_LT: ++ result = (REG_MULTI && ++ nfa_re_num_cmp(t->state->val, t->state->c - NFA_LNUM, ++ (long_u)(reglnum + reg_firstlnum))); ++ if (result) ++ addstate_here(thislist, t->state->out, &t->sub, &listidx); ++ break; ++ ++ case NFA_COL: ++ case NFA_COL_GT: ++ case NFA_COL_LT: ++ result = nfa_re_num_cmp(t->state->val, t->state->c - NFA_COL, ++ (long_u)(reginput - regline) + 1); ++ if (result) ++ addstate_here(thislist, t->state->out, &t->sub, &listidx); ++ break; ++ ++ case NFA_VCOL: ++ case NFA_VCOL_GT: ++ case NFA_VCOL_LT: ++ result = nfa_re_num_cmp(t->state->val, t->state->c - NFA_VCOL, ++ (long_u)win_linetabsize( ++ reg_win == NULL ? curwin : reg_win, ++ regline, (colnr_T)(reginput - regline)) + 1); ++ if (result) ++ addstate_here(thislist, t->state->out, &t->sub, &listidx); ++ break; ++ ++ case NFA_CURSOR: ++ result = (reg_win != NULL ++ && (reglnum + reg_firstlnum == reg_win->w_cursor.lnum) ++ && ((colnr_T)(reginput - regline) ++ == reg_win->w_cursor.col)); ++ if (result) ++ addstate_here(thislist, t->state->out, &t->sub, &listidx); ++ break; ++ + default: /* regular character */ + { + int c = t->state->c; +*** ../vim-7.3.1038/src/testdir/test64.in 2013-05-29 18:45:07.000000000 +0200 +--- src/testdir/test64.in 2013-05-29 21:02:52.000000000 +0200 +*************** +*** 413,425 **** + :.yank + y$Gop:" + :" +- :" + :" Check a pattern with a look beind crossing a line boundary + /^Behind: + /\(<\_[xy]\+\)\@3<=start + :.yank + Gop:" + :" + :/\%#=1^Results/,$wq! test.out + ENDTEST + +--- 413,452 ---- + :.yank + y$Gop:" + :" + :" Check a pattern with a look beind crossing a line boundary + /^Behind: + /\(<\_[xy]\+\)\@3<=start + :.yank + Gop:" + :" ++ :" Check patterns matching cursor position. ++ :func! Postest() ++ new ++ call setline(1, ['ffooooo', 'boboooo', 'zoooooo', 'koooooo', 'moooooo', "\t\t\tfoo", 'abababababababfoo', 'bababababababafoo', '********_']) ++ call setpos('.', [0, 1, 0, 0]) ++ s/\%>3c.//g ++ call setpos('.', [0, 2, 4, 0]) ++ s/\%#.*$//g ++ call setpos('.', [0, 3, 0, 0]) ++ s/\%<3c./_/g ++ %s/\%4l\%>5c./_/g ++ %s/\%6l\%>25v./_/g ++ %s/\%>6l\%3c./!/g ++ %s/\%>7l\%12c./?/g ++ %s/\%>7l\%<9l\%>5v\%<8v./#/g ++ 1,$yank ++ quit! ++ endfunc ++ Go-0-:set re=0 ++ :call Postest() ++ :put ++ o-1-:set re=1 ++ :call Postest() ++ :put ++ o-2-:set re=2 ++ :call Postest() ++ :put ++ :" + :/\%#=1^Results/,$wq! test.out + ENDTEST + +*** ../vim-7.3.1038/src/testdir/test64.ok 2013-05-29 18:45:07.000000000 +0200 +--- src/testdir/test64.ok 2013-05-29 21:02:49.000000000 +0200 +*************** +*** 740,742 **** +--- 740,772 ---- + ghi + + xxxstart3 ++ -0- ++ ffo ++ bob ++ __ooooo ++ koooo__ ++ moooooo ++ f__ ++ ab!babababababfoo ++ ba!ab##abab?bafoo ++ **!*****_ ++ -1- ++ ffo ++ bob ++ __ooooo ++ koooo__ ++ moooooo ++ f__ ++ ab!babababababfoo ++ ba!ab##abab?bafoo ++ **!*****_ ++ -2- ++ ffo ++ bob ++ __ooooo ++ koooo__ ++ moooooo ++ f__ ++ ab!babababababfoo ++ ba!ab##abab?bafoo ++ **!*****_ +*** ../vim-7.3.1038/src/version.c 2013-05-29 19:17:55.000000000 +0200 +--- src/version.c 2013-05-29 21:11:47.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1039, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +16. You step out of your room and realize that your parents have moved and + you don't have a clue when it happened. + + /// 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 /// diff --git a/7.3.1040 b/7.3.1040 new file mode 100644 index 0000000..1a0825d --- /dev/null +++ b/7.3.1040 @@ -0,0 +1,298 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1040 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1040 +Problem: Python: Problems with debugging dynamic build. +Solution: Python patch 1. (ZyX) +Files: src/if_python.c, src/if_python3.c + + +*** ../vim-7.3.1039/src/if_python.c 2013-05-21 22:23:51.000000000 +0200 +--- src/if_python.c 2013-05-29 21:32:46.000000000 +0200 +*************** +*** 21,26 **** +--- 21,35 ---- + + #include + ++ /* uncomment this if used with the debug version of python. ++ * Checked on 2.7.4. */ ++ /* #define Py_DEBUG */ ++ /* Note: most of time you can add -DPy_DEBUG to CFLAGS in place of uncommenting ++ */ ++ /* uncomment this if used with the debug version of python, but without its ++ * allocator */ ++ /* #define Py_DEBUG_NO_PYMALLOC */ ++ + /* Python.h defines _POSIX_THREADS itself (if needed) */ + #ifdef _POSIX_THREADS + # undef _POSIX_THREADS +*************** +*** 240,247 **** + # define PyType_IsSubtype dll_PyType_IsSubtype + # endif + # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000 +! # define PyObject_Malloc dll_PyObject_Malloc +! # define PyObject_Free dll_PyObject_Free + # endif + # ifdef PY_USE_CAPSULE + # define PyCapsule_New dll_PyCapsule_New +--- 249,266 ---- + # define PyType_IsSubtype dll_PyType_IsSubtype + # endif + # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000 +! # ifdef Py_DEBUG +! # define _Py_NegativeRefcount dll__Py_NegativeRefcount +! # define _Py_RefTotal (*dll__Py_RefTotal) +! # define _Py_Dealloc dll__Py_Dealloc +! # endif +! # if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC) +! # define _PyObject_DebugMalloc dll__PyObject_DebugMalloc +! # define _PyObject_DebugFree dll__PyObject_DebugFree +! # else +! # define PyObject_Malloc dll_PyObject_Malloc +! # define PyObject_Free dll_PyObject_Free +! # endif + # endif + # ifdef PY_USE_CAPSULE + # define PyCapsule_New dll_PyCapsule_New +*************** +*** 350,357 **** +--- 369,386 ---- + static int (*dll_PyType_IsSubtype)(PyTypeObject *, PyTypeObject *); + # endif + # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000 ++ # ifdef Py_DEBUG ++ static void (*dll__Py_NegativeRefcount)(const char *fname, int lineno, PyObject *op); ++ static Py_ssize_t* dll__Py_RefTotal; ++ static void (*dll__Py_Dealloc)(PyObject *obj); ++ # endif ++ # if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC) ++ static void (*dll__PyObject_DebugFree)(void*); ++ static void* (*dll__PyObject_DebugMalloc)(size_t); ++ # else + static void* (*dll_PyObject_Malloc)(size_t); + static void (*dll_PyObject_Free)(void*); ++ # endif + # endif + # ifdef PY_USE_CAPSULE + static PyObject* (*dll_PyCapsule_New)(void *, char *, PyCapsule_Destructor); +*************** +*** 469,480 **** + {"PyType_Type", (PYTHON_PROC*)&dll_PyType_Type}, + {"PyType_Ready", (PYTHON_PROC*)&dll_PyType_Ready}, + {"Py_FindMethod", (PYTHON_PROC*)&dll_Py_FindMethod}, +- # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000 \ +- && SIZEOF_SIZE_T != SIZEOF_INT +- {"Py_InitModule4_64", (PYTHON_PROC*)&dll_Py_InitModule4}, +- # else +- {"Py_InitModule4", (PYTHON_PROC*)&dll_Py_InitModule4}, +- # endif + {"Py_SetPythonHome", (PYTHON_PROC*)&dll_Py_SetPythonHome}, + {"Py_Initialize", (PYTHON_PROC*)&dll_Py_Initialize}, + {"Py_Finalize", (PYTHON_PROC*)&dll_Py_Finalize}, +--- 498,503 ---- +*************** +*** 496,503 **** +--- 519,550 ---- + {"PyType_IsSubtype", (PYTHON_PROC*)&dll_PyType_IsSubtype}, + # endif + # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000 ++ # ifdef Py_DEBUG ++ {"_Py_NegativeRefcount", (PYTHON_PROC*)&dll__Py_NegativeRefcount}, ++ {"_Py_RefTotal", (PYTHON_PROC*)&dll__Py_RefTotal}, ++ {"_Py_Dealloc", (PYTHON_PROC*)&dll__Py_Dealloc}, ++ # endif ++ # if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC) ++ {"_PyObject_DebugFree", (PYTHON_PROC*)&dll__PyObject_DebugFree}, ++ {"_PyObject_DebugMalloc", (PYTHON_PROC*)&dll__PyObject_DebugMalloc}, ++ # else + {"PyObject_Malloc", (PYTHON_PROC*)&dll_PyObject_Malloc}, + {"PyObject_Free", (PYTHON_PROC*)&dll_PyObject_Free}, ++ # endif ++ # endif ++ # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000 \ ++ && SIZEOF_SIZE_T != SIZEOF_INT ++ # ifdef Py_DEBUG ++ {"Py_InitModule4TraceRefs_64", (PYTHON_PROC*)&dll_Py_InitModule4}, ++ # else ++ {"Py_InitModule4_64", (PYTHON_PROC*)&dll_Py_InitModule4}, ++ # endif ++ # else ++ # ifdef Py_DEBUG ++ {"Py_InitModule4TraceRefs", (PYTHON_PROC*)&dll_Py_InitModule4}, ++ # else ++ {"Py_InitModule4", (PYTHON_PROC*)&dll_Py_InitModule4}, ++ # endif + # endif + # ifdef PY_USE_CAPSULE + {"PyCapsule_New", (PYTHON_PROC*)&dll_PyCapsule_New}, +*** ../vim-7.3.1039/src/if_python3.c 2013-05-21 22:23:51.000000000 +0200 +--- src/if_python3.c 2013-05-29 21:32:46.000000000 +0200 +*************** +*** 24,29 **** +--- 24,34 ---- + + /* uncomment this if used with the debug version of python */ + /* #define Py_DEBUG */ ++ /* Note: most of time you can add -DPy_DEBUG to CFLAGS in place of uncommenting ++ */ ++ /* uncomment this if used with the debug version of python, but without its ++ * allocator */ ++ /* #define Py_DEBUG_NO_PYMALLOC */ + + #include "vim.h" + +*************** +*** 207,212 **** +--- 212,222 ---- + # define _Py_NegativeRefcount py3__Py_NegativeRefcount + # define _Py_RefTotal (*py3__Py_RefTotal) + # define _Py_Dealloc py3__Py_Dealloc ++ # define PyModule_Create2TraceRefs py3_PyModule_Create2TraceRefs ++ # else ++ # define PyModule_Create2 py3_PyModule_Create2 ++ # endif ++ # if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC) + # define _PyObject_DebugMalloc py3__PyObject_DebugMalloc + # define _PyObject_DebugFree py3__PyObject_DebugFree + # else +*************** +*** 218,224 **** + # define PyObject_GC_UnTrack py3_PyObject_GC_UnTrack + # define PyType_GenericAlloc py3_PyType_GenericAlloc + # define PyType_GenericNew py3_PyType_GenericNew +- # define PyModule_Create2 py3_PyModule_Create2 + # undef PyUnicode_FromString + # define PyUnicode_FromString py3_PyUnicode_FromString + # undef PyUnicode_Decode +--- 228,233 ---- +*************** +*** 227,233 **** + # define PyCapsule_New py3_PyCapsule_New + # define PyCapsule_GetPointer py3_PyCapsule_GetPointer + +! # ifdef Py_DEBUG + # undef PyObject_NEW + # define PyObject_NEW(type, typeobj) \ + ( (type *) PyObject_Init( \ +--- 236,242 ---- + # define PyCapsule_New py3_PyCapsule_New + # define PyCapsule_GetPointer py3_PyCapsule_GetPointer + +! # if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC) + # undef PyObject_NEW + # define PyObject_NEW(type, typeobj) \ + ( (type *) PyObject_Init( \ +*************** +*** 317,323 **** + static PyObject* (*py3_PyFloat_FromDouble)(double num); + static double (*py3_PyFloat_AsDouble)(PyObject *); + static PyObject* (*py3_PyObject_GenericGetAttr)(PyObject *obj, PyObject *name); +- static PyObject* (*py3_PyModule_Create2)(struct PyModuleDef* module, int module_api_version); + static PyObject* (*py3_PyType_GenericAlloc)(PyTypeObject *type, Py_ssize_t nitems); + static PyObject* (*py3_PyType_GenericNew)(PyTypeObject *type, PyObject *args, PyObject *kwds); + static PyTypeObject* py3_PyType_Type; +--- 326,331 ---- +*************** +*** 328,341 **** + static PyObject* (*py3_PyCapsule_New)(void *, char *, PyCapsule_Destructor); + static void* (*py3_PyCapsule_GetPointer)(PyObject *, char *); + # ifdef Py_DEBUG +! static void (*py3__Py_NegativeRefcount)(const char *fname, int lineno, PyObject *op); +! static Py_ssize_t* py3__Py_RefTotal; +! static void (*py3__Py_Dealloc)(PyObject *obj); +! static void (*py3__PyObject_DebugFree)(void*); +! static void* (*py3__PyObject_DebugMalloc)(size_t); + # else +! static void (*py3_PyObject_Free)(void*); +! static void* (*py3_PyObject_Malloc)(size_t); + # endif + static PyObject*(*py3__PyObject_GC_New)(PyTypeObject *); + static void(*py3_PyObject_GC_Del)(void *); +--- 336,354 ---- + static PyObject* (*py3_PyCapsule_New)(void *, char *, PyCapsule_Destructor); + static void* (*py3_PyCapsule_GetPointer)(PyObject *, char *); + # ifdef Py_DEBUG +! static void (*py3__Py_NegativeRefcount)(const char *fname, int lineno, PyObject *op); +! static Py_ssize_t* py3__Py_RefTotal; +! static void (*py3__Py_Dealloc)(PyObject *obj); +! static PyObject* (*py3_PyModule_Create2TraceRefs)(struct PyModuleDef* module, int module_api_version); +! # else +! static PyObject* (*py3_PyModule_Create2)(struct PyModuleDef* module, int module_api_version); +! # endif +! # if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC) +! static void (*py3__PyObject_DebugFree)(void*); +! static void* (*py3__PyObject_DebugMalloc)(size_t); + # else +! static void (*py3_PyObject_Free)(void*); +! static void* (*py3_PyObject_Malloc)(size_t); + # endif + static PyObject*(*py3__PyObject_GC_New)(PyTypeObject *); + static void(*py3_PyObject_GC_Del)(void *); +*************** +*** 451,457 **** + {"PyFloat_FromDouble", (PYTHON_PROC*)&py3_PyFloat_FromDouble}, + {"PyFloat_AsDouble", (PYTHON_PROC*)&py3_PyFloat_AsDouble}, + {"PyObject_GenericGetAttr", (PYTHON_PROC*)&py3_PyObject_GenericGetAttr}, +- {"PyModule_Create2", (PYTHON_PROC*)&py3_PyModule_Create2}, + {"PyType_GenericAlloc", (PYTHON_PROC*)&py3_PyType_GenericAlloc}, + {"PyType_GenericNew", (PYTHON_PROC*)&py3_PyType_GenericNew}, + {"PyType_Type", (PYTHON_PROC*)&py3_PyType_Type}, +--- 464,469 ---- +*************** +*** 463,468 **** +--- 475,485 ---- + {"_Py_NegativeRefcount", (PYTHON_PROC*)&py3__Py_NegativeRefcount}, + {"_Py_RefTotal", (PYTHON_PROC*)&py3__Py_RefTotal}, + {"_Py_Dealloc", (PYTHON_PROC*)&py3__Py_Dealloc}, ++ {"PyModule_Create2TraceRefs", (PYTHON_PROC*)&py3_PyModule_Create2TraceRefs}, ++ # else ++ {"PyModule_Create2", (PYTHON_PROC*)&py3_PyModule_Create2}, ++ # endif ++ # if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC) + {"_PyObject_DebugFree", (PYTHON_PROC*)&py3__PyObject_DebugFree}, + {"_PyObject_DebugMalloc", (PYTHON_PROC*)&py3__PyObject_DebugMalloc}, + # else +*************** +*** 656,662 **** + static void + call_PyObject_Free(void *p) + { +! #ifdef Py_DEBUG + _PyObject_DebugFree(p); + #else + PyObject_Free(p); +--- 673,679 ---- + static void + call_PyObject_Free(void *p) + { +! #if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC) + _PyObject_DebugFree(p); + #else + PyObject_Free(p); +*** ../vim-7.3.1039/src/version.c 2013-05-29 21:14:37.000000000 +0200 +--- src/version.c 2013-05-29 21:32:32.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1040, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +17. You turn on your intercom when leaving the room so you can hear if new + e-mail arrives. + + /// 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 /// diff --git a/7.3.1041 b/7.3.1041 new file mode 100644 index 0000000..e0a9f9c --- /dev/null +++ b/7.3.1041 @@ -0,0 +1,179 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1041 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1041 +Problem: Python: Invalid read valgrind errors. +Solution: Python patch 2: defer DICTKEY_UNREF until key is no longer needed. + (ZyX) +Files: src/if_py_both.h + + +*** ../vim-7.3.1040/src/if_py_both.h 2013-05-28 22:31:43.000000000 +0200 +--- src/if_py_both.h 2013-05-29 21:36:29.000000000 +0200 +*************** +*** 1603,1613 **** + flags = get_option_value_strict(key, NULL, NULL, + self->opt_type, self->from); + +- DICTKEY_UNREF +- + if (flags == 0) + { + PyErr_SetObject(PyExc_KeyError, keyObject); + return -1; + } + +--- 1603,1612 ---- + flags = get_option_value_strict(key, NULL, NULL, + self->opt_type, self->from); + + if (flags == 0) + { + PyErr_SetObject(PyExc_KeyError, keyObject); ++ DICTKEY_UNREF + return -1; + } + +*************** +*** 1617,1633 **** +--- 1616,1635 ---- + { + PyErr_SetString(PyExc_ValueError, + _("unable to unset global option")); ++ DICTKEY_UNREF + return -1; + } + else if (!(flags & SOPT_GLOBAL)) + { + PyErr_SetString(PyExc_ValueError, _("unable to unset option " + "without global value")); ++ DICTKEY_UNREF + return -1; + } + else + { + unset_global_local_option(key, self->from); ++ DICTKEY_UNREF + return 0; + } + } +*************** +*** 1639,1647 **** + int istrue = PyObject_IsTrue(valObject); + + if (istrue == -1) +! return -1; +! r = set_option_value_for(key, istrue, NULL, +! opt_flags, self->opt_type, self->from); + } + else if (flags & SOPT_NUM) + { +--- 1641,1650 ---- + int istrue = PyObject_IsTrue(valObject); + + if (istrue == -1) +! r = -1; +! else +! r = set_option_value_for(key, istrue, NULL, +! opt_flags, self->opt_type, self->from); + } + else if (flags & SOPT_NUM) + { +*************** +*** 1657,1662 **** +--- 1660,1666 ---- + else + { + PyErr_SetString(PyExc_TypeError, _("object must be integer")); ++ DICTKEY_UNREF + return -1; + } + +*************** +*** 1670,1678 **** +--- 1674,1688 ---- + { + + if (PyString_AsStringAndSize(valObject, (char **) &val, NULL) == -1) ++ { ++ DICTKEY_UNREF + return -1; ++ } + if (val == NULL) ++ { ++ DICTKEY_UNREF + return -1; ++ } + + val = vim_strsave(val); + } +*************** +*** 1682,1693 **** +--- 1692,1712 ---- + + bytes = PyUnicode_AsEncodedString(valObject, (char *)ENC_OPT, NULL); + if (bytes == NULL) ++ { ++ DICTKEY_UNREF + return -1; ++ } + + if(PyString_AsStringAndSize(bytes, (char **) &val, NULL) == -1) ++ { ++ DICTKEY_UNREF + return -1; ++ } + if (val == NULL) ++ { ++ DICTKEY_UNREF + return -1; ++ } + + val = vim_strsave(val); + Py_XDECREF(bytes); +*************** +*** 1695,1700 **** +--- 1714,1720 ---- + else + { + PyErr_SetString(PyExc_TypeError, _("object must be string")); ++ DICTKEY_UNREF + return -1; + } + +*************** +*** 1703,1708 **** +--- 1723,1730 ---- + vim_free(val); + } + ++ DICTKEY_UNREF ++ + return r; + } + +*** ../vim-7.3.1040/src/version.c 2013-05-29 21:33:34.000000000 +0200 +--- src/version.c 2013-05-29 21:36:47.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1041, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +18. Your wife drapes a blond wig over your monitor to remind you of what she + looks like. + + /// 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 /// diff --git a/7.3.1042 b/7.3.1042 new file mode 100644 index 0000000..a1d5bbb --- /dev/null +++ b/7.3.1042 @@ -0,0 +1,964 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1042 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1042 +Problem: Python: can't assign to vim.Buffer.name. +Solution: Python patch 3. (ZyX) +Files: runtime/doc/if_pyth.txt, src/ex_cmds.c, src/if_py_both.h, + src/if_python3.c, src/if_python.c, src/proto/ex_cmds.pro, + src/testdir/test86.in, src/testdir/test86.ok, + src/testdir/test87.in, src/testdir/test87.ok + + +*** ../vim-7.3.1041/runtime/doc/if_pyth.txt 2013-05-21 19:49:58.000000000 +0200 +--- runtime/doc/if_pyth.txt 2013-05-29 21:40:05.000000000 +0200 +*************** +*** 250,256 **** + object and always use windows from that tab page (or throw vim.error + in case tab page was deleted). You can keep a reference to both + without keeping a reference to vim module object or |python-tabpage|, +! they will not loose their properties in this case. + + vim.tabpages *python-tabpages* + A sequence object providing access to the list of vim tab pages. The +--- 250,256 ---- + object and always use windows from that tab page (or throw vim.error + in case tab page was deleted). You can keep a reference to both + without keeping a reference to vim module object or |python-tabpage|, +! they will not lose their properties in this case. + + vim.tabpages *python-tabpages* + A sequence object providing access to the list of vim tab pages. The +*************** +*** 361,366 **** +--- 361,371 ---- + this object will raise KeyError. If option is + |global-local| and local value is missing getting it + will return None. ++ b.name String, RW. Contains buffer name (full path). ++ Note: when assigning to b.name |BufFilePre| and ++ |BufFilePost| autocommands are launched. ++ b.number Buffer number. Can be used as |python-buffers| key. ++ Read-only. + + The buffer object methods are: + b.append(str) Append a line to the buffer +*** ../vim-7.3.1041/src/ex_cmds.c 2013-04-14 23:19:32.000000000 +0200 +--- src/ex_cmds.c 2013-05-29 21:44:19.000000000 +0200 +*************** +*** 784,789 **** +--- 784,790 ---- + */ + last_line = curbuf->b_ml.ml_line_count; + mark_adjust(line1, line2, last_line - line2, 0L); ++ changed_lines(last_line - num_lines + 1, 0, last_line + 1, num_lines); + if (dest >= line2) + { + mark_adjust(line2 + 1, dest, -num_lines, 0L); +*************** +*** 799,804 **** +--- 800,806 ---- + curbuf->b_op_start.col = curbuf->b_op_end.col = 0; + mark_adjust(last_line - num_lines + 1, last_line, + -(last_line - dest - extra), 0L); ++ changed_lines(last_line - num_lines + 1, 0, last_line + 1, -extra); + + /* + * Now we delete the original text -- webb +*************** +*** 2414,2419 **** +--- 2416,2473 ---- + info_message = FALSE; + } + ++ int ++ rename_buffer(new_fname) ++ char_u *new_fname; ++ { ++ char_u *fname, *sfname, *xfname; ++ #ifdef FEAT_AUTOCMD ++ buf_T *buf = curbuf; ++ ++ apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, buf); ++ /* buffer changed, don't change name now */ ++ if (buf != curbuf) ++ return FAIL; ++ # ifdef FEAT_EVAL ++ if (aborting()) /* autocmds may abort script processing */ ++ return FAIL; ++ # endif ++ #endif ++ /* ++ * The name of the current buffer will be changed. ++ * A new (unlisted) buffer entry needs to be made to hold the old file ++ * name, which will become the alternate file name. ++ * But don't set the alternate file name if the buffer didn't have a ++ * name. ++ */ ++ fname = buf->b_ffname; ++ sfname = buf->b_sfname; ++ xfname = buf->b_fname; ++ buf->b_ffname = NULL; ++ buf->b_sfname = NULL; ++ if (setfname(buf, new_fname, NULL, TRUE) == FAIL) ++ { ++ buf->b_ffname = fname; ++ buf->b_sfname = sfname; ++ return FAIL; ++ } ++ buf->b_flags |= BF_NOTEDITED; ++ if (xfname != NULL && *xfname != NUL) ++ { ++ buf = buflist_new(fname, xfname, curwin->w_cursor.lnum, 0); ++ if (buf != NULL && !cmdmod.keepalt) ++ curwin->w_alt_fnum = buf->b_fnum; ++ } ++ vim_free(fname); ++ vim_free(sfname); ++ #ifdef FEAT_AUTOCMD ++ apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, buf); ++ #endif ++ /* Change directories when the 'acd' option is set. */ ++ DO_AUTOCHDIR ++ return OK; ++ } ++ + /* + * ":file[!] [fname]". + */ +*************** +*** 2421,2429 **** + ex_file(eap) + exarg_T *eap; + { +- char_u *fname, *sfname, *xfname; +- buf_T *buf; +- + /* ":0file" removes the file name. Check for illegal uses ":3file", + * "0file name", etc. */ + if (eap->addr_count > 0 +--- 2475,2480 ---- +*************** +*** 2437,2485 **** + + if (*eap->arg != NUL || eap->addr_count == 1) + { +! #ifdef FEAT_AUTOCMD +! buf = curbuf; +! apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf); +! /* buffer changed, don't change name now */ +! if (buf != curbuf) +! return; +! # ifdef FEAT_EVAL +! if (aborting()) /* autocmds may abort script processing */ +! return; +! # endif +! #endif +! /* +! * The name of the current buffer will be changed. +! * A new (unlisted) buffer entry needs to be made to hold the old file +! * name, which will become the alternate file name. +! * But don't set the alternate file name if the buffer didn't have a +! * name. +! */ +! fname = curbuf->b_ffname; +! sfname = curbuf->b_sfname; +! xfname = curbuf->b_fname; +! curbuf->b_ffname = NULL; +! curbuf->b_sfname = NULL; +! if (setfname(curbuf, eap->arg, NULL, TRUE) == FAIL) +! { +! curbuf->b_ffname = fname; +! curbuf->b_sfname = sfname; + return; +- } +- curbuf->b_flags |= BF_NOTEDITED; +- if (xfname != NULL && *xfname != NUL) +- { +- buf = buflist_new(fname, xfname, curwin->w_cursor.lnum, 0); +- if (buf != NULL && !cmdmod.keepalt) +- curwin->w_alt_fnum = buf->b_fnum; +- } +- vim_free(fname); +- vim_free(sfname); +- #ifdef FEAT_AUTOCMD +- apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf); +- #endif +- /* Change directories when the 'acd' option is set. */ +- DO_AUTOCHDIR + } + /* print full file name if :cd used */ + fileinfo(FALSE, FALSE, eap->forceit); +--- 2488,2495 ---- + + if (*eap->arg != NUL || eap->addr_count == 1) + { +! if (rename_buffer(eap->arg) == FAIL) + return; + } + /* print full file name if :cd used */ + fileinfo(FALSE, FALSE, eap->forceit); +*** ../vim-7.3.1041/src/if_py_both.h 2013-05-29 21:37:29.000000000 +0200 +--- src/if_py_both.h 2013-05-29 21:47:35.000000000 +0200 +*************** +*** 30,35 **** +--- 30,43 ---- + #define INVALID_WINDOW_VALUE ((win_T *)(-1)) + #define INVALID_TABPAGE_VALUE ((tabpage_T *)(-1)) + ++ #define DICTKEY_DECL \ ++ PyObject *dictkey_todecref; ++ #define DICTKEY_GET(err) \ ++ if (!(key = StringToChars(keyObject, &dictkey_todecref))) \ ++ return err; ++ #define DICTKEY_UNREF \ ++ Py_XDECREF(dictkey_todecref); ++ + typedef void (*rangeinitializer)(void *); + typedef void (*runner)(const char *, void * + #ifdef PY_CAN_RECURSE +*************** +*** 64,69 **** +--- 72,122 ---- + { + } + ++ /* ++ * The "todecref" argument holds a pointer to PyObject * that must be ++ * DECREF'ed after returned char_u * is no longer needed or NULL if all what ++ * was needed to generate returned value is object. ++ * ++ * Use Py_XDECREF to decrement reference count. ++ */ ++ static char_u * ++ StringToChars(PyObject *object, PyObject **todecref) ++ { ++ char_u *p; ++ PyObject *bytes = NULL; ++ ++ if (PyBytes_Check(object)) ++ { ++ ++ if (PyString_AsStringAndSize(object, (char **) &p, NULL) == -1) ++ return NULL; ++ if (p == NULL) ++ return NULL; ++ ++ *todecref = NULL; ++ } ++ else if (PyUnicode_Check(object)) ++ { ++ bytes = PyUnicode_AsEncodedString(object, (char *)ENC_OPT, NULL); ++ if (bytes == NULL) ++ return NULL; ++ ++ if(PyString_AsStringAndSize(bytes, (char **) &p, NULL) == -1) ++ return NULL; ++ if (p == NULL) ++ return NULL; ++ ++ *todecref = bytes; ++ } ++ else ++ { ++ PyErr_SetString(PyExc_TypeError, _("object must be string")); ++ return NULL; ++ } ++ ++ return (char_u *) p; ++ } ++ + /* Output buffer management + */ + +*************** +*** 1586,1591 **** +--- 1639,1656 ---- + return VimTryEnd(); + } + ++ static void * ++ py_memsave(void *p, size_t len) ++ { ++ void *r; ++ if (!(r = PyMem_Malloc(len))) ++ return NULL; ++ mch_memmove(r, p, len); ++ return r; ++ } ++ ++ #define PY_STRSAVE(s) ((char_u *) py_memsave(s, STRLEN(s) + 1)) ++ + static int + OptionsAssItem(OptionsObject *self, PyObject *keyObject, PyObject *valObject) + { +*************** +*** 1670,1726 **** + else + { + char_u *val; +! if (PyBytes_Check(valObject)) +! { + +! if (PyString_AsStringAndSize(valObject, (char **) &val, NULL) == -1) +! { +! DICTKEY_UNREF +! return -1; +! } +! if (val == NULL) +! { +! DICTKEY_UNREF +! return -1; +! } +! +! val = vim_strsave(val); +! } +! else if (PyUnicode_Check(valObject)) + { +! PyObject *bytes; +! +! bytes = PyUnicode_AsEncodedString(valObject, (char *)ENC_OPT, NULL); +! if (bytes == NULL) +! { +! DICTKEY_UNREF +! return -1; +! } +! +! if(PyString_AsStringAndSize(bytes, (char **) &val, NULL) == -1) +! { +! DICTKEY_UNREF +! return -1; +! } +! if (val == NULL) +! { +! DICTKEY_UNREF +! return -1; +! } +! +! val = vim_strsave(val); +! Py_XDECREF(bytes); + } + else +! { +! PyErr_SetString(PyExc_TypeError, _("object must be string")); +! DICTKEY_UNREF +! return -1; +! } +! +! r = set_option_value_for(key, 0, val, opt_flags, +! self->opt_type, self->from); +! vim_free(val); + } + + DICTKEY_UNREF +--- 1735,1750 ---- + else + { + char_u *val; +! PyObject *todecref; + +! if ((val = StringToChars(valObject, &todecref))) + { +! r = set_option_value_for(key, 0, val, opt_flags, +! self->opt_type, self->from); +! Py_XDECREF(todecref); + } + else +! r = -1; + } + + DICTKEY_UNREF +*************** +*** 2541,2547 **** + array = NULL; + else + { +! array = (char **)alloc((unsigned)(new_len * sizeof(char *))); + if (array == NULL) + { + PyErr_NoMemory(); +--- 2565,2571 ---- + array = NULL; + else + { +! array = PyMem_New(char *, new_len); + if (array == NULL) + { + PyErr_NoMemory(); +*************** +*** 2558,2564 **** + { + while (i) + vim_free(array[--i]); +! vim_free(array); + return FAIL; + } + } +--- 2582,2588 ---- + { + while (i) + vim_free(array[--i]); +! PyMem_Free(array); + return FAIL; + } + } +*************** +*** 2635,2641 **** + * been dealt with (either freed, or the responsibility passed + * to vim. + */ +! vim_free(array); + + /* Adjust marks. Invalidate any which lie in the + * changed range, and move any in the remainder of the buffer. +--- 2659,2665 ---- + * been dealt with (either freed, or the responsibility passed + * to vim. + */ +! PyMem_Free(array); + + /* Adjust marks. Invalidate any which lie in the + * changed range, and move any in the remainder of the buffer. +*************** +*** 2717,2723 **** + char **array; + buf_T *savebuf; + +! array = (char **)alloc((unsigned)(size * sizeof(char *))); + if (array == NULL) + { + PyErr_NoMemory(); +--- 2741,2747 ---- + char **array; + buf_T *savebuf; + +! array = PyMem_New(char *, size); + if (array == NULL) + { + PyErr_NoMemory(); +*************** +*** 2733,2739 **** + { + while (i) + vim_free(array[--i]); +! vim_free(array); + return FAIL; + } + } +--- 2757,2763 ---- + { + while (i) + vim_free(array[--i]); +! PyMem_Free(array); + return FAIL; + } + } +*************** +*** 2768,2774 **** + /* Free the array of lines. All of its contents have now + * been freed. + */ +! vim_free(array); + + restore_buffer(savebuf); + update_screen(VALID); +--- 2792,2798 ---- + /* Free the array of lines. All of its contents have now + * been freed. + */ +! PyMem_Free(array); + + restore_buffer(savebuf); + update_screen(VALID); +*************** +*** 3179,3184 **** +--- 3203,3247 ---- + return NULL; + } + ++ static int ++ BufferSetattr(BufferObject *self, char *name, PyObject *valObject) ++ { ++ if (CheckBuffer(self)) ++ return -1; ++ ++ if (strcmp(name, "name") == 0) ++ { ++ char_u *val; ++ aco_save_T aco; ++ int r; ++ PyObject *todecref; ++ ++ if (!(val = StringToChars(valObject, &todecref))) ++ return -1; ++ ++ VimTryStart(); ++ /* Using aucmd_*: autocommands will be executed by rename_buffer */ ++ aucmd_prepbuf(&aco, self->buf); ++ r = rename_buffer(val); ++ aucmd_restbuf(&aco); ++ Py_XDECREF(todecref); ++ if (VimTryEnd()) ++ return -1; ++ ++ if (r == FAIL) ++ { ++ PyErr_SetVim(_("failed to rename buffer")); ++ return -1; ++ } ++ return 0; ++ } ++ else ++ { ++ PyErr_SetString(PyExc_AttributeError, name); ++ return -1; ++ } ++ } ++ + static PyObject * + BufferAppend(BufferObject *self, PyObject *args) + { +*************** +*** 4040,4046 **** + if (result == NULL) + return -1; + +! if (set_string_copy(result, tv) == -1) + { + Py_XDECREF(bytes); + return -1; +--- 4103,4109 ---- + if (result == NULL) + return -1; + +! if (set_string_copy(result, tv)) + { + Py_XDECREF(bytes); + return -1; +*************** +*** 4169,4179 **** +--- 4232,4244 ---- + BufferType.tp_methods = BufferMethods; + #if PY_MAJOR_VERSION >= 3 + BufferType.tp_getattro = (getattrofunc)BufferGetattro; ++ BufferType.tp_setattro = (setattrofunc)BufferSetattro; + BufferType.tp_alloc = call_PyType_GenericAlloc; + BufferType.tp_new = call_PyType_GenericNew; + BufferType.tp_free = call_PyObject_Free; + #else + BufferType.tp_getattr = (getattrfunc)BufferGetattr; ++ BufferType.tp_setattr = (setattrfunc)BufferSetattr; + #endif + + vim_memset(&WindowType, 0, sizeof(WindowType)); +*** ../vim-7.3.1041/src/if_python3.c 2013-05-29 21:33:34.000000000 +0200 +--- src/if_python3.c 2013-05-29 21:40:05.000000000 +0200 +*************** +*** 638,669 **** + + #define PYINITIALISED py3initialised + +- #define DICTKEY_DECL PyObject *bytes = NULL; +- +- #define DICTKEY_GET(err) \ +- if (PyBytes_Check(keyObject)) \ +- { \ +- if (PyString_AsStringAndSize(keyObject, (char **) &key, NULL) == -1) \ +- return err; \ +- } \ +- else if (PyUnicode_Check(keyObject)) \ +- { \ +- bytes = PyString_AsBytes(keyObject); \ +- if (bytes == NULL) \ +- return err; \ +- if (PyString_AsStringAndSize(bytes, (char **) &key, NULL) == -1) \ +- return err; \ +- } \ +- else \ +- { \ +- PyErr_SetString(PyExc_TypeError, _("only string keys are allowed")); \ +- return err; \ +- } +- +- #define DICTKEY_UNREF \ +- if (bytes != NULL) \ +- Py_XDECREF(bytes); +- + #define DESTRUCTOR_FINISH(self) Py_TYPE(self)->tp_free((PyObject*)self) + + #define WIN_PYTHON_REF(win) win->w_python3_ref +--- 638,643 ---- +*************** +*** 696,701 **** +--- 670,676 ---- + static PyObject *OutputGetattro(PyObject *, PyObject *); + static int OutputSetattro(PyObject *, PyObject *, PyObject *); + static PyObject *BufferGetattro(PyObject *, PyObject *); ++ static int BufferSetattro(PyObject *, PyObject *, PyObject *); + static PyObject *TabPageGetattro(PyObject *, PyObject *); + static PyObject *WindowGetattro(PyObject *, PyObject *); + static int WindowSetattro(PyObject *, PyObject *, PyObject *); +*************** +*** 1108,1113 **** +--- 1083,1096 ---- + return PyObject_GenericGetAttr(self, nameobj); + } + ++ static int ++ BufferSetattro(PyObject *self, PyObject *nameobj, PyObject *val) ++ { ++ GET_ATTR_STRING(name, nameobj); ++ ++ return BufferSetattr((BufferObject *)(self), name, val); ++ } ++ + static PyObject * + BufferDir(PyObject *self UNUSED) + { +*** ../vim-7.3.1041/src/if_python.c 2013-05-29 21:33:34.000000000 +0200 +--- src/if_python.c 2013-05-29 21:40:05.000000000 +0200 +*************** +*** 676,693 **** + static int initialised = 0; + #define PYINITIALISED initialised + +- #define DICTKEY_GET(err) \ +- if (!PyString_Check(keyObject)) \ +- { \ +- PyErr_SetString(PyExc_TypeError, _("only string keys are allowed")); \ +- return err; \ +- } \ +- if (PyString_AsStringAndSize(keyObject, (char **) &key, NULL) == -1) \ +- return err; +- +- #define DICTKEY_UNREF +- #define DICTKEY_DECL +- + #define DESTRUCTOR_FINISH(self) self->ob_type->tp_free((PyObject*)self); + + #define WIN_PYTHON_REF(win) win->w_python_ref +--- 676,681 ---- +*************** +*** 926,932 **** + else + { + /* Need to make a copy, value may change when setting new locale. */ +! saved_locale = (char *)vim_strsave((char_u *)saved_locale); + (void)setlocale(LC_NUMERIC, "C"); + } + #endif +--- 914,920 ---- + else + { + /* Need to make a copy, value may change when setting new locale. */ +! saved_locale = (char *) PY_STRSAVE(saved_locale); + (void)setlocale(LC_NUMERIC, "C"); + } + #endif +*************** +*** 953,959 **** + if (saved_locale != NULL) + { + (void)setlocale(LC_NUMERIC, saved_locale); +! vim_free(saved_locale); + } + #endif + +--- 941,947 ---- + if (saved_locale != NULL) + { + (void)setlocale(LC_NUMERIC, saved_locale); +! PyMem_Free(saved_locale); + } + #endif + +*** ../vim-7.3.1041/src/proto/ex_cmds.pro 2012-04-25 17:32:14.000000000 +0200 +--- src/proto/ex_cmds.pro 2013-05-29 21:40:05.000000000 +0200 +*************** +*** 19,24 **** +--- 19,25 ---- + void do_fixdel __ARGS((exarg_T *eap)); + void print_line_no_prefix __ARGS((linenr_T lnum, int use_number, int list)); + void print_line __ARGS((linenr_T lnum, int use_number, int list)); ++ int rename_buffer __ARGS((char_u *new_fname)); + void ex_file __ARGS((exarg_T *eap)); + void ex_update __ARGS((exarg_T *eap)); + void ex_write __ARGS((exarg_T *eap)); +*** ../vim-7.3.1041/src/testdir/test86.in 2013-05-21 22:23:51.000000000 +0200 +--- src/testdir/test86.in 2013-05-29 21:56:41.000000000 +0200 +*************** +*** 476,481 **** +--- 476,485 ---- + :py b=vim.current.buffer + :wincmd w + :mark a ++ :augroup BUFS ++ : autocmd BufFilePost * python cb.append(vim.eval('expand("")') + ':BufFilePost:' + vim.eval('bufnr("%")')) ++ : autocmd BufFilePre * python cb.append(vim.eval('expand("")') + ':BufFilePre:' + vim.eval('bufnr("%")')) ++ :augroup END + py << EOF + cb = vim.current.buffer + # Tests BufferAppend and BufferItem +*************** +*** 496,504 **** + b[0]='bar' + b[0:0]=['baz'] + vim.command('call append("$", getbufline(%i, 1, "$"))' % b.number) + # Test CheckBuffer +! vim.command('bwipeout! ' + str(b.number)) +! for expr in ('b[1]','b[:] = ["A", "B"]','b[:]','b.append("abc")'): + try: + exec(expr) + except vim.error: +--- 500,519 ---- + b[0]='bar' + b[0:0]=['baz'] + vim.command('call append("$", getbufline(%i, 1, "$"))' % b.number) ++ # Test assigning to name property ++ old_name = cb.name ++ cb.name = 'foo' ++ cb.append(cb.name[-11:]) ++ b.name = 'bar' ++ cb.append(b.name[-11:]) ++ cb.name = old_name ++ cb.append(cb.name[-17:]) + # Test CheckBuffer +! for _b in vim.buffers: +! if _b is not cb: +! vim.command('bwipeout! ' + str(_b.number)) +! del _b +! for expr in ('b[1]','b[:] = ["A", "B"]','b[:]','b.append("abc")', 'b.name = "!"'): + try: + exec(expr) + except vim.error: +*************** +*** 507,513 **** +--- 522,533 ---- + # Usually a SEGV here + # Should not happen in any case + cb.append('No exception for ' + expr) ++ vim.command('cd .') + EOF ++ :augroup BUFS ++ : autocmd! ++ :augroup END ++ :augroup! BUFS + :" + :" Test vim.buffers object + :set hidden +*************** +*** 586,592 **** + else: + return repr(w) + +! def Cursor(w, start=len(cb)): + if w.buffer is cb: + return repr((start - w.cursor[0], w.cursor[1])) + else: +--- 606,614 ---- + else: + return repr(w) + +! start = len(cb) +! +! def Cursor(w): + if w.buffer is cb: + return repr((start - w.cursor[0], w.cursor[1])) + else: +*** ../vim-7.3.1041/src/testdir/test86.ok 2013-05-21 22:38:14.000000000 +0200 +--- src/testdir/test86.ok 2013-05-29 21:57:30.000000000 +0200 +*************** +*** 319,332 **** + Second line + Third line + foo + i: + i2: + i: + i3: + 1:= +! 6:= +! 7:= +! 8:= + 4 + i4: + i4: +--- 319,341 ---- + Second line + Third line + foo ++ 1:BufFilePre:1 ++ 6:BufFilePost:1 ++ testdir/foo ++ 5:BufFilePre:5 ++ 5:BufFilePost:5 ++ testdir/bar ++ 1:BufFilePre:1 ++ 7:BufFilePost:1 ++ testdir/test86.in + i: + i2: + i: + i3: + 1:= +! 8:= +! 9:= +! 10:= + 4 + i4: + i4: +*************** +*** 335,341 **** + Current tab pages: + (1): 1 windows, current is + Windows: +! (1): displays buffer ; cursor is at (27, 0) + (2): 1 windows, current is + Windows: + (1): displays buffer ; cursor is at (1, 0) +--- 344,350 ---- + Current tab pages: + (1): 1 windows, current is + Windows: +! (1): displays buffer ; cursor is at (36, 0) + (2): 1 windows, current is + Windows: + (1): displays buffer ; cursor is at (1, 0) +*** ../vim-7.3.1041/src/testdir/test87.in 2013-05-21 22:23:51.000000000 +0200 +--- src/testdir/test87.in 2013-05-29 21:58:50.000000000 +0200 +*************** +*** 463,468 **** +--- 463,472 ---- + :py3 b=vim.current.buffer + :wincmd w + :mark a ++ :augroup BUFS ++ : autocmd BufFilePost * python3 cb.append(vim.eval('expand("")') + ':BufFilePost:' + vim.eval('bufnr("%")')) ++ : autocmd BufFilePre * python3 cb.append(vim.eval('expand("")') + ':BufFilePre:' + vim.eval('bufnr("%")')) ++ :augroup END + py3 << EOF + cb = vim.current.buffer + # Tests BufferAppend and BufferItem +*************** +*** 483,490 **** + b[0]='bar' + b[0:0]=['baz'] + vim.command('call append("$", getbufline(%i, 1, "$"))' % b.number) + # Test CheckBuffer +! vim.command('bwipeout! ' + str(b.number)) + for expr in ('b[1]','b[:] = ["A", "B"]','b[:]','b.append("abc")'): + try: + exec(expr) +--- 487,505 ---- + b[0]='bar' + b[0:0]=['baz'] + vim.command('call append("$", getbufline(%i, 1, "$"))' % b.number) ++ # Test assigning to name property ++ old_name = cb.name ++ cb.name = 'foo' ++ cb.append(cb.name[-11:]) ++ b.name = 'bar' ++ cb.append(b.name[-11:]) ++ cb.name = old_name ++ cb.append(cb.name[-17:]) + # Test CheckBuffer +! for _b in vim.buffers: +! if _b is not cb: +! vim.command('bwipeout! ' + str(_b.number)) +! del _b + for expr in ('b[1]','b[:] = ["A", "B"]','b[:]','b.append("abc")'): + try: + exec(expr) +*************** +*** 494,499 **** +--- 509,515 ---- + # Usually a SEGV here + # Should not happen in any case + cb.append('No exception for ' + expr) ++ vim.command('cd .') + EOF + :" + :" Test vim.buffers object +*** ../vim-7.3.1041/src/testdir/test87.ok 2013-05-21 22:38:14.000000000 +0200 +--- src/testdir/test87.ok 2013-05-29 21:59:04.000000000 +0200 +*************** +*** 308,321 **** + Second line + Third line + foo + i: + i2: + i: + i3: + 1:= +! 6:= +! 7:= +! 8:= + 4 + i4: + i4: +--- 308,330 ---- + Second line + Third line + foo ++ 1:BufFilePre:1 ++ 6:BufFilePost:1 ++ testdir/foo ++ 5:BufFilePre:5 ++ 5:BufFilePost:5 ++ testdir/bar ++ 1:BufFilePre:1 ++ 7:BufFilePost:1 ++ testdir/test87.in + i: + i2: + i: + i3: + 1:= +! 8:= +! 9:= +! 10:= + 4 + i4: + i4: +*************** +*** 324,330 **** + Current tab pages: + (1): 1 windows, current is + Windows: +! (1): displays buffer ; cursor is at (27, 0) + (2): 1 windows, current is + Windows: + (1): displays buffer ; cursor is at (1, 0) +--- 333,339 ---- + Current tab pages: + (1): 1 windows, current is + Windows: +! (1): displays buffer ; cursor is at (36, 0) + (2): 1 windows, current is + Windows: + (1): displays buffer ; cursor is at (1, 0) +*** ../vim-7.3.1041/src/version.c 2013-05-29 21:37:29.000000000 +0200 +--- src/version.c 2013-05-29 22:01:11.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1042, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +19. All of your friends have an @ in their names. + + /// 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 /// diff --git a/7.3.1043 b/7.3.1043 new file mode 100644 index 0000000..88d8b42 --- /dev/null +++ b/7.3.1043 @@ -0,0 +1,240 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1043 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1043 +Problem: Python: Dynamic compilation with 2.3 fails. +Solution: Python patch 4. (ZyX) +Files: src/if_python.c + + +*** ../vim-7.3.1042/src/if_python.c 2013-05-29 22:02:18.000000000 +0200 +--- src/if_python.c 2013-05-29 22:04:43.000000000 +0200 +*************** +*** 194,199 **** +--- 194,200 ---- + # define PyDict_New dll_PyDict_New + # define PyDict_GetItemString dll_PyDict_GetItemString + # define PyDict_Next dll_PyDict_Next ++ # define PyDict_Type (*dll_PyDict_Type) + # ifdef PyMapping_Items + # define PY_NO_MAPPING_ITEMS + # else +*************** +*** 234,241 **** + # define Py_IsInitialized dll_Py_IsInitialized + # define _PyObject_New dll__PyObject_New + # define _PyObject_GC_New dll__PyObject_GC_New +! # define PyObject_GC_Del dll_PyObject_GC_Del +! # define PyObject_GC_UnTrack dll_PyObject_GC_UnTrack + # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000 + # define _PyObject_NextNotImplemented (*dll__PyObject_NextNotImplemented) + # endif +--- 235,248 ---- + # define Py_IsInitialized dll_Py_IsInitialized + # define _PyObject_New dll__PyObject_New + # define _PyObject_GC_New dll__PyObject_GC_New +! # ifdef PyObject_GC_Del +! # define Py_underscore_GC +! # define _PyObject_GC_Del dll__PyObject_GC_Del +! # define _PyObject_GC_UnTrack dll__PyObject_GC_UnTrack +! # else +! # define PyObject_GC_Del dll_PyObject_GC_Del +! # define PyObject_GC_UnTrack dll_PyObject_GC_UnTrack +! # endif + # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02070000 + # define _PyObject_NextNotImplemented (*dll__PyObject_NextNotImplemented) + # endif +*************** +*** 247,259 **** + # define PyObject_IsTrue dll_PyObject_IsTrue + # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000 + # define PyType_IsSubtype dll_PyType_IsSubtype +- # endif +- # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000 + # ifdef Py_DEBUG + # define _Py_NegativeRefcount dll__Py_NegativeRefcount + # define _Py_RefTotal (*dll__Py_RefTotal) + # define _Py_Dealloc dll__Py_Dealloc + # endif + # if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC) + # define _PyObject_DebugMalloc dll__PyObject_DebugMalloc + # define _PyObject_DebugFree dll__PyObject_DebugFree +--- 254,266 ---- + # define PyObject_IsTrue dll_PyObject_IsTrue + # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000 + # define PyType_IsSubtype dll_PyType_IsSubtype + # ifdef Py_DEBUG + # define _Py_NegativeRefcount dll__Py_NegativeRefcount + # define _Py_RefTotal (*dll__Py_RefTotal) + # define _Py_Dealloc dll__Py_Dealloc + # endif ++ # endif ++ # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000 + # if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC) + # define _PyObject_DebugMalloc dll__PyObject_DebugMalloc + # define _PyObject_DebugFree dll__PyObject_DebugFree +*************** +*** 316,322 **** + static PyObject*(*dll_PyImport_ImportModule)(const char *); + static PyObject*(*dll_PyDict_New)(void); + static PyObject*(*dll_PyDict_GetItemString)(PyObject *, const char *); +! static int (*dll_PyDict_Next)(PyObject *, Py_ssize_t *, PyObject **, PyObject **); + # ifndef PY_NO_MAPPING_ITEMS + static PyObject* (*dll_PyMapping_Items)(PyObject *); + # endif +--- 323,330 ---- + static PyObject*(*dll_PyImport_ImportModule)(const char *); + static PyObject*(*dll_PyDict_New)(void); + static PyObject*(*dll_PyDict_GetItemString)(PyObject *, const char *); +! static int (*dll_PyDict_Next)(PyObject *, PyInt *, PyObject **, PyObject **); +! static PyTypeObject* dll_PyDict_Type; + # ifndef PY_NO_MAPPING_ITEMS + static PyObject* (*dll_PyMapping_Items)(PyObject *); + # endif +*************** +*** 354,361 **** +--- 362,374 ---- + static int(*dll_Py_IsInitialized)(void); + static PyObject*(*dll__PyObject_New)(PyTypeObject *, PyObject *); + static PyObject*(*dll__PyObject_GC_New)(PyTypeObject *); ++ # ifdef Py_underscore_GC ++ static void(*dll__PyObject_GC_Del)(void *); ++ static void(*dll__PyObject_GC_UnTrack)(void *); ++ # else + static void(*dll_PyObject_GC_Del)(void *); + static void(*dll_PyObject_GC_UnTrack)(void *); ++ # endif + static PyObject*(*dll__PyObject_Init)(PyObject *, PyTypeObject *); + static PyObject* (*dll_PyObject_GetIter)(PyObject *); + static int (*dll_PyObject_IsTrue)(PyObject *); +*************** +*** 367,379 **** + static PyObject* dll__Py_TrueStruct; + # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000 + static int (*dll_PyType_IsSubtype)(PyTypeObject *, PyTypeObject *); +- # endif +- # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000 + # ifdef Py_DEBUG + static void (*dll__Py_NegativeRefcount)(const char *fname, int lineno, PyObject *op); +! static Py_ssize_t* dll__Py_RefTotal; + static void (*dll__Py_Dealloc)(PyObject *obj); + # endif + # if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC) + static void (*dll__PyObject_DebugFree)(void*); + static void* (*dll__PyObject_DebugMalloc)(size_t); +--- 380,392 ---- + static PyObject* dll__Py_TrueStruct; + # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000 + static int (*dll_PyType_IsSubtype)(PyTypeObject *, PyTypeObject *); + # ifdef Py_DEBUG + static void (*dll__Py_NegativeRefcount)(const char *fname, int lineno, PyObject *op); +! static PyInt* dll__Py_RefTotal; + static void (*dll__Py_Dealloc)(PyObject *obj); + # endif ++ # endif ++ # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000 + # if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC) + static void (*dll__PyObject_DebugFree)(void*); + static void* (*dll__PyObject_DebugMalloc)(size_t); +*************** +*** 470,475 **** +--- 483,489 ---- + {"PyDict_GetItemString", (PYTHON_PROC*)&dll_PyDict_GetItemString}, + {"PyDict_Next", (PYTHON_PROC*)&dll_PyDict_Next}, + {"PyDict_New", (PYTHON_PROC*)&dll_PyDict_New}, ++ {"PyDict_Type", (PYTHON_PROC*)&dll_PyDict_Type}, + # ifndef PY_NO_MAPPING_ITEMS + {"PyMapping_Items", (PYTHON_PROC*)&dll_PyMapping_Items}, + # endif +*************** +*** 504,511 **** +--- 518,530 ---- + {"Py_IsInitialized", (PYTHON_PROC*)&dll_Py_IsInitialized}, + {"_PyObject_New", (PYTHON_PROC*)&dll__PyObject_New}, + {"_PyObject_GC_New", (PYTHON_PROC*)&dll__PyObject_GC_New}, ++ # ifdef Py_underscore_GC ++ {"_PyObject_GC_Del", (PYTHON_PROC*)&dll__PyObject_GC_Del}, ++ {"_PyObject_GC_UnTrack", (PYTHON_PROC*)&dll__PyObject_GC_UnTrack}, ++ # else + {"PyObject_GC_Del", (PYTHON_PROC*)&dll_PyObject_GC_Del}, + {"PyObject_GC_UnTrack", (PYTHON_PROC*)&dll_PyObject_GC_UnTrack}, ++ # endif + {"PyObject_Init", (PYTHON_PROC*)&dll__PyObject_Init}, + {"PyObject_GetIter", (PYTHON_PROC*)&dll_PyObject_GetIter}, + {"PyObject_IsTrue", (PYTHON_PROC*)&dll_PyObject_IsTrue}, +*************** +*** 516,529 **** + {"_Py_ZeroStruct", (PYTHON_PROC*)&dll__Py_ZeroStruct}, + {"_Py_TrueStruct", (PYTHON_PROC*)&dll__Py_TrueStruct}, + # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000 +- {"PyType_IsSubtype", (PYTHON_PROC*)&dll_PyType_IsSubtype}, +- # endif +- # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000 + # ifdef Py_DEBUG + {"_Py_NegativeRefcount", (PYTHON_PROC*)&dll__Py_NegativeRefcount}, + {"_Py_RefTotal", (PYTHON_PROC*)&dll__Py_RefTotal}, + {"_Py_Dealloc", (PYTHON_PROC*)&dll__Py_Dealloc}, + # endif + # if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC) + {"_PyObject_DebugFree", (PYTHON_PROC*)&dll__PyObject_DebugFree}, + {"_PyObject_DebugMalloc", (PYTHON_PROC*)&dll__PyObject_DebugMalloc}, +--- 535,548 ---- + {"_Py_ZeroStruct", (PYTHON_PROC*)&dll__Py_ZeroStruct}, + {"_Py_TrueStruct", (PYTHON_PROC*)&dll__Py_TrueStruct}, + # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02020000 + # ifdef Py_DEBUG + {"_Py_NegativeRefcount", (PYTHON_PROC*)&dll__Py_NegativeRefcount}, + {"_Py_RefTotal", (PYTHON_PROC*)&dll__Py_RefTotal}, + {"_Py_Dealloc", (PYTHON_PROC*)&dll__Py_Dealloc}, + # endif ++ {"PyType_IsSubtype", (PYTHON_PROC*)&dll_PyType_IsSubtype}, ++ # endif ++ # if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02030000 + # if defined(Py_DEBUG) && !defined(Py_DEBUG_NO_PYMALLOC) + {"_PyObject_DebugFree", (PYTHON_PROC*)&dll__PyObject_DebugFree}, + {"_PyObject_DebugMalloc", (PYTHON_PROC*)&dll__PyObject_DebugMalloc}, +*************** +*** 696,703 **** + #endif + #ifndef Py_CLEAR + # define Py_CLEAR(obj) \ +! Py_XDECREF(obj); \ +! obj = NULL; + #endif + + /* +--- 715,724 ---- + #endif + #ifndef Py_CLEAR + # define Py_CLEAR(obj) \ +! { \ +! Py_XDECREF(obj); \ +! obj = NULL; \ +! } + #endif + + /* +*** ../vim-7.3.1042/src/version.c 2013-05-29 22:02:18.000000000 +0200 +--- src/version.c 2013-05-29 22:04:56.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1043, + /**/ + +-- +When a fly lands on the ceiling, does it do a half roll or +a half loop? + + /// 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 /// diff --git a/7.3.1044 b/7.3.1044 new file mode 100644 index 0000000..aad7899 --- /dev/null +++ b/7.3.1044 @@ -0,0 +1,391 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1044 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1044 +Problem: Python: No {Buffer,TabPage,Window}.valid attributes. +Solution: Python patch 5: add .valid (ZyX) +Files: src/if_py_both.h, src/if_python3.c, src/if_python.c, + src/testdir/test86.in, src/testdir/test86.ok, + src/testdir/test87.in, src/testdir/test87.ok + + +*** ../vim-7.3.1043/src/if_py_both.h 2013-05-29 22:02:18.000000000 +0200 +--- src/if_py_both.h 2013-05-29 22:08:36.000000000 +0200 +*************** +*** 1815,1820 **** +--- 1815,1833 ---- + } + + static PyObject * ++ TabPageAttrValid(TabPageObject *self, char *name) ++ { ++ PyObject *r; ++ ++ if (strcmp(name, "valid") != 0) ++ return NULL; ++ ++ r = ((self->tab == INVALID_TABPAGE_VALUE) ? Py_False : Py_True); ++ Py_INCREF(r); ++ return r; ++ } ++ ++ static PyObject * + TabPageAttr(TabPageObject *self, char *name) + { + if (strcmp(name, "windows") == 0) +*************** +*** 2010,2015 **** +--- 2023,2041 ---- + } + + static PyObject * ++ WindowAttrValid(WindowObject *self, char *name) ++ { ++ PyObject *r; ++ ++ if (strcmp(name, "valid") != 0) ++ return NULL; ++ ++ r = ((self->win == INVALID_WINDOW_VALUE) ? Py_False : Py_True); ++ Py_INCREF(r); ++ return r; ++ } ++ ++ static PyObject * + WindowAttr(WindowObject *self, char *name) + { + if (strcmp(name, "buffer") == 0) +*************** +*** 2050,2057 **** + return (PyObject *)(self->tabObject); + } + else if (strcmp(name,"__members__") == 0) +! return Py_BuildValue("[sssssssss]", "buffer", "cursor", "height", +! "vars", "options", "number", "row", "col", "tabpage"); + else + return NULL; + } +--- 2076,2083 ---- + return (PyObject *)(self->tabObject); + } + else if (strcmp(name,"__members__") == 0) +! return Py_BuildValue("[ssssssssss]", "buffer", "cursor", "height", +! "vars", "options", "number", "row", "col", "tabpage", "valid"); + else + return NULL; + } +*************** +*** 3186,3191 **** +--- 3212,3230 ---- + } + + static PyObject * ++ BufferAttrValid(BufferObject *self, char *name) ++ { ++ PyObject *r; ++ ++ if (strcmp(name, "valid") != 0) ++ return NULL; ++ ++ r = ((self->buf == INVALID_BUFFER_VALUE) ? Py_False : Py_True); ++ Py_INCREF(r); ++ return r; ++ } ++ ++ static PyObject * + BufferAttr(BufferObject *self, char *name) + { + if (strcmp(name, "name") == 0) +*************** +*** 3198,3204 **** + return OptionsNew(SREQ_BUF, self->buf, (checkfun) CheckBuffer, + (PyObject *) self); + else if (strcmp(name,"__members__") == 0) +! return Py_BuildValue("[ssss]", "name", "number", "vars", "options"); + else + return NULL; + } +--- 3237,3244 ---- + return OptionsNew(SREQ_BUF, self->buf, (checkfun) CheckBuffer, + (PyObject *) self); + else if (strcmp(name,"__members__") == 0) +! return Py_BuildValue("[sssss]", "name", "number", "vars", "options", +! "valid"); + else + return NULL; + } +*** ../vim-7.3.1043/src/if_python3.c 2013-05-29 22:02:18.000000000 +0200 +--- src/if_python3.c 2013-05-29 22:08:36.000000000 +0200 +*************** +*** 1067,1078 **** + */ + + static PyObject * +! BufferGetattro(PyObject *self, PyObject*nameobj) + { + PyObject *r; + + GET_ATTR_STRING(name, nameobj); + + if (CheckBuffer((BufferObject *)(self))) + return NULL; + +--- 1067,1081 ---- + */ + + static PyObject * +! BufferGetattro(PyObject *self, PyObject *nameobj) + { + PyObject *r; + + GET_ATTR_STRING(name, nameobj); + ++ if ((r = BufferAttrValid((BufferObject *)(self), name))) ++ return r; ++ + if (CheckBuffer((BufferObject *)(self))) + return NULL; + +*************** +*** 1094,1101 **** + static PyObject * + BufferDir(PyObject *self UNUSED) + { +! return Py_BuildValue("[sssss]", "name", "number", +! "append", "mark", "range"); + } + + /******************/ +--- 1097,1105 ---- + static PyObject * + BufferDir(PyObject *self UNUSED) + { +! return Py_BuildValue("[ssssssss]", +! "name", "number", "vars", "options", "valid", +! "append", "mark", "range"); + } + + /******************/ +*************** +*** 1283,1288 **** +--- 1287,1295 ---- + + GET_ATTR_STRING(name, nameobj); + ++ if ((r = TabPageAttrValid((TabPageObject *)(self), name))) ++ return r; ++ + if (CheckTabPage((TabPageObject *)(self))) + return NULL; + +*************** +*** 1303,1308 **** +--- 1310,1318 ---- + + GET_ATTR_STRING(name, nameobj); + ++ if ((r = WindowAttrValid((WindowObject *)(self), name))) ++ return r; ++ + if (CheckWindow((WindowObject *)(self))) + return NULL; + +*** ../vim-7.3.1043/src/if_python.c 2013-05-29 22:05:51.000000000 +0200 +--- src/if_python.c 2013-05-29 22:08:36.000000000 +0200 +*************** +*** 1125,1130 **** +--- 1125,1133 ---- + { + PyObject *r; + ++ if ((r = BufferAttrValid((BufferObject *)(self), name))) ++ return r; ++ + if (CheckBuffer((BufferObject *)(self))) + return NULL; + +*************** +*** 1206,1211 **** +--- 1209,1217 ---- + { + PyObject *r; + ++ if ((r = TabPageAttrValid((TabPageObject *)(self), name))) ++ return r; ++ + if (CheckTabPage((TabPageObject *)(self))) + return NULL; + +*************** +*** 1224,1229 **** +--- 1230,1238 ---- + { + PyObject *r; + ++ if ((r = WindowAttrValid((WindowObject *)(self), name))) ++ return r; ++ + if (CheckWindow((WindowObject *)(self))) + return NULL; + +*** ../vim-7.3.1043/src/testdir/test86.in 2013-05-29 22:02:18.000000000 +0200 +--- src/testdir/test86.in 2013-05-29 22:08:36.000000000 +0200 +*************** +*** 513,518 **** +--- 513,519 ---- + if _b is not cb: + vim.command('bwipeout! ' + str(_b.number)) + del _b ++ cb.append('valid: b:%s, cb:%s' % (repr(b.valid), repr(cb.valid))) + for expr in ('b[1]','b[:] = ["A", "B"]','b[:]','b.append("abc")', 'b.name = "!"'): + try: + exec(expr) +*************** +*** 663,671 **** +--- 664,676 ---- + cb.append('Current window: ' + repr(vim.current.window)) + cb.append('Current buffer: ' + repr(vim.current.buffer)) + cb.append('Current line: ' + repr(vim.current.line)) ++ ws = list(vim.windows) ++ ts = list(vim.tabpages) + for b in vim.buffers: + if b is not cb: + vim.command('bwipeout! ' + str(b.number)) ++ cb.append('w.valid: ' + repr([w.valid for w in ws])) ++ cb.append('t.valid: ' + repr([t.valid for t in ts])) + EOF + :tabonly! + :only! +*** ../vim-7.3.1043/src/testdir/test86.ok 2013-05-29 22:02:18.000000000 +0200 +--- src/testdir/test86.ok 2013-05-29 22:09:47.000000000 +0200 +*************** +*** 328,333 **** +--- 328,334 ---- + 1:BufFilePre:1 + 7:BufFilePost:1 + testdir/test86.in ++ valid: b:False, cb:True + i: + i2: + i: +*************** +*** 344,350 **** + Current tab pages: + (1): 1 windows, current is + Windows: +! (1): displays buffer ; cursor is at (36, 0) + (2): 1 windows, current is + Windows: + (1): displays buffer ; cursor is at (1, 0) +--- 345,351 ---- + Current tab pages: + (1): 1 windows, current is + Windows: +! (1): displays buffer ; cursor is at (37, 0) + (2): 1 windows, current is + Windows: + (1): displays buffer ; cursor is at (1, 0) +*************** +*** 370,375 **** +--- 371,378 ---- + Current window: + Current buffer: + Current line: 'Type error at assigning None to vim.current.buffer' ++ w.valid: [True, False] ++ t.valid: [True, False, True, False] + vim.vars:Dictionary:True + vim.options:Options:True + vim.bindeval("{}"):Dictionary:True +*** ../vim-7.3.1043/src/testdir/test87.in 2013-05-29 22:02:18.000000000 +0200 +--- src/testdir/test87.in 2013-05-29 22:08:36.000000000 +0200 +*************** +*** 500,505 **** +--- 500,506 ---- + if _b is not cb: + vim.command('bwipeout! ' + str(_b.number)) + del _b ++ cb.append('valid: b:%s, cb:%s' % (repr(b.valid), repr(cb.valid))) + for expr in ('b[1]','b[:] = ["A", "B"]','b[:]','b.append("abc")'): + try: + exec(expr) +*************** +*** 641,649 **** +--- 642,654 ---- + cb.append('Current window: ' + repr(vim.current.window)) + cb.append('Current buffer: ' + repr(vim.current.buffer)) + cb.append('Current line: ' + repr(vim.current.line)) ++ ws = list(vim.windows) ++ ts = list(vim.tabpages) + for b in vim.buffers: + if b is not cb: + vim.command('bwipeout! ' + str(b.number)) ++ cb.append('w.valid: ' + repr([w.valid for w in ws])) ++ cb.append('t.valid: ' + repr([t.valid for t in ts])) + EOF + :tabonly! + :only! +*** ../vim-7.3.1043/src/testdir/test87.ok 2013-05-29 22:02:18.000000000 +0200 +--- src/testdir/test87.ok 2013-05-29 22:10:11.000000000 +0200 +*************** +*** 317,322 **** +--- 317,323 ---- + 1:BufFilePre:1 + 7:BufFilePost:1 + testdir/test87.in ++ valid: b:False, cb:True + i: + i2: + i: +*************** +*** 333,339 **** + Current tab pages: + (1): 1 windows, current is + Windows: +! (1): displays buffer ; cursor is at (36, 0) + (2): 1 windows, current is + Windows: + (1): displays buffer ; cursor is at (1, 0) +--- 334,340 ---- + Current tab pages: + (1): 1 windows, current is + Windows: +! (1): displays buffer ; cursor is at (37, 0) + (2): 1 windows, current is + Windows: + (1): displays buffer ; cursor is at (1, 0) +*************** +*** 359,364 **** +--- 360,367 ---- + Current window: + Current buffer: + Current line: 'Type error at assigning None to vim.current.buffer' ++ w.valid: [True, False] ++ t.valid: [True, False, True, False] + vim.vars:Dictionary:True + vim.options:Options:True + vim.bindeval("{}"):Dictionary:True +*** ../vim-7.3.1043/src/version.c 2013-05-29 22:05:51.000000000 +0200 +--- src/version.c 2013-05-29 22:10:45.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1044, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +20. When looking at a pageful of someone else's links, you notice all of them + are already highlighted in purple. + + /// 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 /// diff --git a/7.3.1045 b/7.3.1045 new file mode 100644 index 0000000..b82613c --- /dev/null +++ b/7.3.1045 @@ -0,0 +1,173 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1045 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1045 +Problem: Python: No error handling for VimToPython function. +Solution: Python patch 6. (ZyX) +Files: src/if_py_both.h + + +*** ../vim-7.3.1044/src/if_py_both.h 2013-05-29 22:15:26.000000000 +0200 +--- src/if_py_both.h 2013-05-29 22:17:56.000000000 +0200 +*************** +*** 432,439 **** + sprintf(ptrBuf, "%p", + our_tv->v_type == VAR_LIST ? (void *)our_tv->vval.v_list + : (void *)our_tv->vval.v_dict); +! result = PyDict_GetItemString(lookupDict, ptrBuf); +! if (result != NULL) + { + Py_INCREF(result); + return result; +--- 432,439 ---- + sprintf(ptrBuf, "%p", + our_tv->v_type == VAR_LIST ? (void *)our_tv->vval.v_list + : (void *)our_tv->vval.v_dict); +! +! if ((result = PyDict_GetItemString(lookupDict, ptrBuf))) + { + Py_INCREF(result); + return result; +*************** +*** 467,510 **** + list_T *list = our_tv->vval.v_list; + listitem_T *curr; + +! result = PyList_New(0); + +! if (list != NULL) + { +! PyDict_SetItemString(lookupDict, ptrBuf, result); + +! for (curr = list->lv_first; curr != NULL; curr = curr->li_next) + { +- newObj = VimToPython(&curr->li_tv, depth + 1, lookupDict); +- PyList_Append(result, newObj); + Py_DECREF(newObj); + } + } + } + else if (our_tv->v_type == VAR_DICT) + { +- result = PyDict_New(); + +! if (our_tv->vval.v_dict != NULL) +! { +! hashtab_T *ht = &our_tv->vval.v_dict->dv_hashtab; +! long_u todo = ht->ht_used; +! hashitem_T *hi; +! dictitem_T *di; + +! PyDict_SetItemString(lookupDict, ptrBuf, result); + +! for (hi = ht->ht_array; todo > 0; ++hi) + { +! if (!HASHITEM_EMPTY(hi)) +! { +! --todo; + +! di = dict_lookup(hi); +! newObj = VimToPython(&di->di_tv, depth + 1, lookupDict); +! PyDict_SetItemString(result, (char *)hi->hi_key, newObj); + Py_DECREF(newObj); + } + } + } + } +--- 467,538 ---- + list_T *list = our_tv->vval.v_list; + listitem_T *curr; + +! if (list == NULL) +! return NULL; +! +! if (!(result = PyList_New(0))) +! return NULL; + +! if (PyDict_SetItemString(lookupDict, ptrBuf, result)) + { +! Py_DECREF(result); +! return NULL; +! } + +! for (curr = list->lv_first; curr != NULL; curr = curr->li_next) +! { +! if (!(newObj = VimToPython(&curr->li_tv, depth + 1, lookupDict))) +! { +! Py_DECREF(result); +! return NULL; +! } +! if (PyList_Append(result, newObj)) + { + Py_DECREF(newObj); ++ Py_DECREF(result); ++ return NULL; + } ++ Py_DECREF(newObj); + } + } + else if (our_tv->v_type == VAR_DICT) + { + +! hashtab_T *ht = &our_tv->vval.v_dict->dv_hashtab; +! long_u todo = ht->ht_used; +! hashitem_T *hi; +! dictitem_T *di; +! if (our_tv->vval.v_dict == NULL) +! return NULL; +! +! if (!(result = PyDict_New())) +! return NULL; + +! if (PyDict_SetItemString(lookupDict, ptrBuf, result)) +! { +! Py_DECREF(result); +! return NULL; +! } + +! for (hi = ht->ht_array; todo > 0; ++hi) +! { +! if (!HASHITEM_EMPTY(hi)) + { +! --todo; + +! di = dict_lookup(hi); +! if (!(newObj = VimToPython(&di->di_tv, depth + 1, lookupDict))) +! { +! Py_DECREF(result); +! return NULL; +! } +! if (PyDict_SetItemString(result, (char *)hi->hi_key, newObj)) +! { +! Py_DECREF(result); + Py_DECREF(newObj); ++ return NULL; + } ++ Py_DECREF(newObj); + } + } + } +*** ../vim-7.3.1044/src/version.c 2013-05-29 22:15:26.000000000 +0200 +--- src/version.c 2013-05-29 22:17:30.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1045, + /**/ + +-- +Shift happens. + -- Doppler + + /// 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 /// diff --git a/7.3.1046 b/7.3.1046 new file mode 100644 index 0000000..a66e947 --- /dev/null +++ b/7.3.1046 @@ -0,0 +1,105 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1046 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1046 +Problem: Python: Using Py_BuildValue for building strings. +Solution: Python patch 7 and 7.5: Replace Py_BuildValue with + PyString_FromString. (ZyX) +Files: src/if_py_both.h + + +*** ../vim-7.3.1045/src/if_py_both.h 2013-05-29 22:19:57.000000000 +0200 +--- src/if_py_both.h 2013-05-29 22:24:52.000000000 +0200 +*************** +*** 442,448 **** + + if (our_tv->v_type == VAR_STRING) + { +! result = Py_BuildValue("s", our_tv->vval.v_string == NULL + ? "" : (char *)our_tv->vval.v_string); + } + else if (our_tv->v_type == VAR_NUMBER) +--- 442,448 ---- + + if (our_tv->v_type == VAR_STRING) + { +! result = PyString_FromString(our_tv->vval.v_string == NULL + ? "" : (char *)our_tv->vval.v_string); + } + else if (our_tv->v_type == VAR_NUMBER) +*************** +*** 451,457 **** + + /* For backwards compatibility numbers are stored as strings. */ + sprintf(buf, "%ld", (long)our_tv->vval.v_number); +! result = Py_BuildValue("s", buf); + } + # ifdef FEAT_FLOAT + else if (our_tv->v_type == VAR_FLOAT) +--- 451,457 ---- + + /* For backwards compatibility numbers are stored as strings. */ + sprintf(buf, "%ld", (long)our_tv->vval.v_number); +! result = PyString_FromString((char *) buf); + } + # ifdef FEAT_FLOAT + else if (our_tv->v_type == VAR_FLOAT) +*************** +*** 459,465 **** + char buf[NUMBUFLEN]; + + sprintf(buf, "%f", our_tv->vval.v_float); +! result = Py_BuildValue("s", buf); + } + # endif + else if (our_tv->v_type == VAR_LIST) +--- 459,465 ---- + char buf[NUMBUFLEN]; + + sprintf(buf, "%f", our_tv->vval.v_float); +! result = PyString_FromString((char *) buf); + } + # endif + else if (our_tv->v_type == VAR_LIST) +*************** +*** 3256,3262 **** + BufferAttr(BufferObject *self, char *name) + { + if (strcmp(name, "name") == 0) +! return Py_BuildValue("s", self->buf->b_ffname); + else if (strcmp(name, "number") == 0) + return Py_BuildValue(Py_ssize_t_fmt, self->buf->b_fnum); + else if (strcmp(name, "vars") == 0) +--- 3256,3263 ---- + BufferAttr(BufferObject *self, char *name) + { + if (strcmp(name, "name") == 0) +! return PyString_FromString((self->buf->b_ffname == NULL +! ? "" : (char *) self->buf->b_ffname)); + else if (strcmp(name, "number") == 0) + return Py_BuildValue(Py_ssize_t_fmt, self->buf->b_fnum); + else if (strcmp(name, "vars") == 0) +*** ../vim-7.3.1045/src/version.c 2013-05-29 22:19:57.000000000 +0200 +--- src/version.c 2013-05-29 22:25:14.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1046, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +21. Your dog has its own home page. + + /// 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 /// diff --git a/7.3.1047 b/7.3.1047 new file mode 100644 index 0000000..9d3a416 --- /dev/null +++ b/7.3.1047 @@ -0,0 +1,743 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1047 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1047 +Problem: Python: dir() does not work properly. +Solution: Python patch 8. Add __dir__ method to all objects with custom + tp_getattr supplemented by __members__ attribute for at least + python-2* versions. __members__ is not mentioned in python-3* + dir() output even if it is accessible. (ZyX) +Files: src/if_py_both.h, src/if_python3.c, src/if_python.c, + src/testdir/test86.in, src/testdir/test86.ok, + src/testdir/test87.in, src/testdir/test87.ok + + +*** ../vim-7.3.1046/src/if_py_both.h 2013-05-29 22:26:15.000000000 +0200 +--- src/if_py_both.h 2013-05-29 22:29:26.000000000 +0200 +*************** +*** 117,122 **** +--- 117,175 ---- + return (char_u *) p; + } + ++ static int ++ add_string(PyObject *list, char *s) ++ { ++ PyObject *string; ++ ++ if (!(string = PyString_FromString(s))) ++ return -1; ++ if (PyList_Append(list, string)) ++ { ++ Py_DECREF(string); ++ return -1; ++ } ++ ++ Py_DECREF(string); ++ return 0; ++ } ++ ++ static PyObject * ++ ObjectDir(PyObject *self, char **attributes) ++ { ++ PyMethodDef *method; ++ char **attr; ++ PyObject *r; ++ ++ if (!(r = PyList_New(0))) ++ return NULL; ++ ++ if (self) ++ for (method = self->ob_type->tp_methods ; method->ml_name != NULL ; ++method) ++ if (add_string(r, (char *) method->ml_name)) ++ { ++ Py_DECREF(r); ++ return NULL; ++ } ++ ++ for (attr = attributes ; *attr ; ++attr) ++ if (add_string(r, *attr)) ++ { ++ Py_DECREF(r); ++ return NULL; ++ } ++ ++ #if PY_MAJOR_VERSION < 3 ++ if (add_string(r, "__members__")) ++ { ++ Py_DECREF(r); ++ return NULL; ++ } ++ #endif ++ ++ return r; ++ } ++ + /* Output buffer management + */ + +*************** +*** 132,137 **** +--- 185,201 ---- + long error; + } OutputObject; + ++ static char *OutputAttrs[] = { ++ "softspace", ++ NULL ++ }; ++ ++ static PyObject * ++ OutputDir(PyObject *self) ++ { ++ return ObjectDir(self, OutputAttrs); ++ } ++ + static int + OutputSetattr(OutputObject *self, char *name, PyObject *val) + { +*************** +*** 291,296 **** +--- 355,361 ---- + {"write", (PyCFunction)OutputWrite, METH_VARARGS, ""}, + {"writelines", (PyCFunction)OutputWritelines, METH_VARARGS, ""}, + {"flush", (PyCFunction)OutputFlush, METH_NOARGS, ""}, ++ {"__dir__", (PyCFunction)OutputDir, METH_NOARGS, ""}, + { NULL, NULL, 0, NULL} + }; + +*************** +*** 826,831 **** +--- 891,907 ---- + DESTRUCTOR_FINISH(self); + } + ++ static char *DictionaryAttrs[] = { ++ "locked", "scope", ++ NULL ++ }; ++ ++ static PyObject * ++ DictionaryDir(PyObject *self) ++ { ++ return ObjectDir(self, DictionaryAttrs); ++ } ++ + static int + DictionarySetattr(DictionaryObject *self, char *name, PyObject *val) + { +*************** +*** 985,991 **** + + static struct PyMethodDef DictionaryMethods[] = { + {"keys", (PyCFunction)DictionaryListKeys, METH_NOARGS, ""}, +! { NULL, NULL, 0, NULL } + }; + + static PyTypeObject ListType; +--- 1061,1068 ---- + + static struct PyMethodDef DictionaryMethods[] = { + {"keys", (PyCFunction)DictionaryListKeys, METH_NOARGS, ""}, +! {"__dir__", (PyCFunction)DictionaryDir, METH_NOARGS, ""}, +! { NULL, NULL, 0, NULL} + }; + + static PyTypeObject ListType; +*************** +*** 1331,1336 **** +--- 1408,1424 ---- + return (PyObject *)(self); + } + ++ static char *ListAttrs[] = { ++ "locked", ++ NULL ++ }; ++ ++ static PyObject * ++ ListDir(PyObject *self) ++ { ++ return ObjectDir(self, ListAttrs); ++ } ++ + static int + ListSetattr(ListObject *self, char *name, PyObject *val) + { +*************** +*** 1368,1375 **** + } + + static struct PyMethodDef ListMethods[] = { +! {"extend", (PyCFunction)ListConcatInPlace, METH_O, ""}, +! { NULL, NULL, 0, NULL } + }; + + typedef struct +--- 1456,1464 ---- + } + + static struct PyMethodDef ListMethods[] = { +! {"extend", (PyCFunction)ListConcatInPlace, METH_O, ""}, +! {"__dir__", (PyCFunction)ListDir, METH_NOARGS, ""}, +! { NULL, NULL, 0, NULL} + }; + + typedef struct +*************** +*** 1408,1413 **** +--- 1497,1513 ---- + DESTRUCTOR_FINISH(self); + } + ++ static char *FunctionAttrs[] = { ++ "softspace", ++ NULL ++ }; ++ ++ static PyObject * ++ FunctionDir(PyObject *self) ++ { ++ return ObjectDir(self, FunctionAttrs); ++ } ++ + static PyObject * + FunctionCall(FunctionObject *self, PyObject *argsObject, PyObject *kwargs) + { +*************** +*** 1472,1479 **** + } + + static struct PyMethodDef FunctionMethods[] = { +! {"__call__", (PyCFunction)FunctionCall, METH_VARARGS|METH_KEYWORDS, ""}, +! { NULL, NULL, 0, NULL} + }; + + /* +--- 1572,1580 ---- + } + + static struct PyMethodDef FunctionMethods[] = { +! {"__call__",(PyCFunction)FunctionCall, METH_VARARGS|METH_KEYWORDS, ""}, +! {"__dir__", (PyCFunction)FunctionDir, METH_NOARGS, ""}, +! { NULL, NULL, 0, NULL} + }; + + /* +*************** +*** 1842,1847 **** +--- 1943,1959 ---- + DESTRUCTOR_FINISH(self); + } + ++ static char *TabPageAttrs[] = { ++ "windows", "number", "vars", "window", "valid", ++ NULL ++ }; ++ ++ static PyObject * ++ TabPageDir(PyObject *self) ++ { ++ return ObjectDir(self, TabPageAttrs); ++ } ++ + static PyObject * + TabPageAttrValid(TabPageObject *self, char *name) + { +*************** +*** 1873,1878 **** +--- 1985,1992 ---- + else + return WindowNew(self->tab->tp_curwin, self->tab); + } ++ else if (strcmp(name, "__members__") == 0) ++ return ObjectDir(NULL, TabPageAttrs); + return NULL; + } + +*************** +*** 1901,1908 **** + } + + static struct PyMethodDef TabPageMethods[] = { +! /* name, function, calling, documentation */ +! { NULL, NULL, 0, NULL } + }; + + /* +--- 2015,2023 ---- + } + + static struct PyMethodDef TabPageMethods[] = { +! /* name, function, calling, documentation */ +! {"__dir__", (PyCFunction)TabPageDir, METH_NOARGS, ""}, +! { NULL, NULL, 0, NULL} + }; + + /* +*************** +*** 2049,2054 **** +--- 2164,2180 ---- + else + return firstwin; + } ++ static char *WindowAttrs[] = { ++ "buffer", "cursor", "height", "vars", "options", "number", "row", "col", ++ "tabpage", "valid", ++ NULL ++ }; ++ ++ static PyObject * ++ WindowDir(PyObject *self) ++ { ++ return ObjectDir(self, WindowAttrs); ++ } + + static PyObject * + WindowAttrValid(WindowObject *self, char *name) +*************** +*** 2103,2111 **** + Py_INCREF(self->tabObject); + return (PyObject *)(self->tabObject); + } +! else if (strcmp(name,"__members__") == 0) +! return Py_BuildValue("[ssssssssss]", "buffer", "cursor", "height", +! "vars", "options", "number", "row", "col", "tabpage", "valid"); + else + return NULL; + } +--- 2229,2236 ---- + Py_INCREF(self->tabObject); + return (PyObject *)(self->tabObject); + } +! else if (strcmp(name, "__members__") == 0) +! return ObjectDir(NULL, WindowAttrs); + else + return NULL; + } +*************** +*** 2228,2235 **** + } + + static struct PyMethodDef WindowMethods[] = { +! /* name, function, calling, documentation */ +! { NULL, NULL, 0, NULL } + }; + + /* +--- 2353,2361 ---- + } + + static struct PyMethodDef WindowMethods[] = { +! /* name, function, calling, documentation */ +! {"__dir__", (PyCFunction)WindowDir, METH_NOARGS, ""}, +! { NULL, NULL, 0, NULL} + }; + + /* +*************** +*** 3122,3127 **** +--- 3248,3264 ---- + return RBSlice(self->buf, lo, hi, self->start, self->end); + } + ++ static char *RangeAttrs[] = { ++ "start", "end", ++ NULL ++ }; ++ ++ static PyObject * ++ RangeDir(PyObject *self) ++ { ++ return ObjectDir(self, RangeAttrs); ++ } ++ + static PyObject * + RangeAppend(RangeObject *self, PyObject *args) + { +*************** +*** 3162,3168 **** + static struct PyMethodDef RangeMethods[] = { + /* name, function, calling, documentation */ + {"append", (PyCFunction)RangeAppend, METH_VARARGS, "Append data to the Vim range" }, +! { NULL, NULL, 0, NULL } + }; + + static PyTypeObject BufferType; +--- 3299,3306 ---- + static struct PyMethodDef RangeMethods[] = { + /* name, function, calling, documentation */ + {"append", (PyCFunction)RangeAppend, METH_VARARGS, "Append data to the Vim range" }, +! {"__dir__", (PyCFunction)RangeDir, METH_NOARGS, ""}, +! { NULL, NULL, 0, NULL} + }; + + static PyTypeObject BufferType; +*************** +*** 3239,3244 **** +--- 3377,3393 ---- + return RBSlice(self, lo, hi, 1, -1); + } + ++ static char *BufferAttrs[] = { ++ "name", "number", "vars", "options", "valid", ++ NULL ++ }; ++ ++ static PyObject * ++ BufferDir(PyObject *self) ++ { ++ return ObjectDir(self, BufferAttrs); ++ } ++ + static PyObject * + BufferAttrValid(BufferObject *self, char *name) + { +*************** +*** 3265,3273 **** + else if (strcmp(name, "options") == 0) + return OptionsNew(SREQ_BUF, self->buf, (checkfun) CheckBuffer, + (PyObject *) self); +! else if (strcmp(name,"__members__") == 0) +! return Py_BuildValue("[sssss]", "name", "number", "vars", "options", +! "valid"); + else + return NULL; + } +--- 3414,3421 ---- + else if (strcmp(name, "options") == 0) + return OptionsNew(SREQ_BUF, self->buf, (checkfun) CheckBuffer, + (PyObject *) self); +! else if (strcmp(name, "__members__") == 0) +! return ObjectDir(NULL, BufferAttrs); + else + return NULL; + } +*************** +*** 3403,3412 **** + {"append", (PyCFunction)BufferAppend, METH_VARARGS, "Append data to Vim buffer" }, + {"mark", (PyCFunction)BufferMark, METH_VARARGS, "Return (row,col) representing position of named mark" }, + {"range", (PyCFunction)BufferRange, METH_VARARGS, "Return a range object which represents the part of the given buffer between line numbers s and e" }, +! #if PY_VERSION_HEX >= 0x03000000 +! {"__dir__", (PyCFunction)BufferDir, METH_NOARGS, "List buffer attributes" }, +! #endif +! { NULL, NULL, 0, NULL } + }; + + /* +--- 3551,3558 ---- + {"append", (PyCFunction)BufferAppend, METH_VARARGS, "Append data to Vim buffer" }, + {"mark", (PyCFunction)BufferMark, METH_VARARGS, "Return (row,col) representing position of named mark" }, + {"range", (PyCFunction)BufferRange, METH_VARARGS, "Return a range object which represents the part of the given buffer between line numbers s and e" }, +! {"__dir__", (PyCFunction)BufferDir, METH_NOARGS, ""}, +! { NULL, NULL, 0, NULL} + }; + + /* +*************** +*** 3538,3543 **** +--- 3684,3700 ---- + /* Current items object + */ + ++ static char *CurrentAttrs[] = { ++ "buffer", "window", "line", "range", "tabpage", ++ NULL ++ }; ++ ++ static PyObject * ++ CurrentDir(PyObject *self) ++ { ++ return ObjectDir(self, CurrentAttrs); ++ } ++ + static PyObject * + CurrentGetattr(PyObject *self UNUSED, char *name) + { +*************** +*** 3551,3564 **** + return GetBufferLine(curbuf, (PyInt)curwin->w_cursor.lnum); + else if (strcmp(name, "range") == 0) + return RangeNew(curbuf, RangeStart, RangeEnd); +! else if (strcmp(name,"__members__") == 0) +! return Py_BuildValue("[sssss]", "buffer", "window", "line", "range", +! "tabpage"); + else +! { +! PyErr_SetString(PyExc_AttributeError, name); + return NULL; +! } + } + + static int +--- 3708,3721 ---- + return GetBufferLine(curbuf, (PyInt)curwin->w_cursor.lnum); + else if (strcmp(name, "range") == 0) + return RangeNew(curbuf, RangeStart, RangeEnd); +! else if (strcmp(name, "__members__") == 0) +! return ObjectDir(NULL, CurrentAttrs); + else +! #if PY_MAJOR_VERSION < 3 +! return Py_FindMethod(WindowMethods, self, name); +! #else + return NULL; +! #endif + } + + static int +*************** +*** 3661,3666 **** +--- 3818,3829 ---- + } + } + ++ static struct PyMethodDef CurrentMethods[] = { ++ /* name, function, calling, documentation */ ++ {"__dir__", (PyCFunction)CurrentDir, METH_NOARGS, ""}, ++ { NULL, NULL, 0, NULL} ++ }; ++ + static void + init_range_cmd(exarg_T *eap) + { +*************** +*** 4397,4402 **** +--- 4560,4566 ---- + CurrentType.tp_basicsize = sizeof(CurrentObject); + CurrentType.tp_flags = Py_TPFLAGS_DEFAULT; + CurrentType.tp_doc = "vim current object"; ++ CurrentType.tp_methods = CurrentMethods; + #if PY_MAJOR_VERSION >= 3 + CurrentType.tp_getattro = (getattrofunc)CurrentGetattro; + CurrentType.tp_setattro = (setattrofunc)CurrentSetattro; +*** ../vim-7.3.1046/src/if_python3.c 2013-05-29 22:15:26.000000000 +0200 +--- src/if_python3.c 2013-05-29 22:29:26.000000000 +0200 +*************** +*** 666,672 **** + return PyType_GenericAlloc(type,nitems); + } + +- static PyObject *BufferDir(PyObject *); + static PyObject *OutputGetattro(PyObject *, PyObject *); + static int OutputSetattro(PyObject *, PyObject *, PyObject *); + static PyObject *BufferGetattro(PyObject *, PyObject *); +--- 666,671 ---- +*************** +*** 1094,1107 **** + return BufferSetattr((BufferObject *)(self), name, val); + } + +- static PyObject * +- BufferDir(PyObject *self UNUSED) +- { +- return Py_BuildValue("[ssssssss]", +- "name", "number", "vars", "options", "valid", +- "append", "mark", "range"); +- } +- + /******************/ + + static PyObject * +--- 1093,1098 ---- +*************** +*** 1368,1375 **** + static PyObject * + CurrentGetattro(PyObject *self, PyObject *nameobj) + { + GET_ATTR_STRING(name, nameobj); +! return CurrentGetattr(self, name); + } + + static int +--- 1359,1369 ---- + static PyObject * + CurrentGetattro(PyObject *self, PyObject *nameobj) + { ++ PyObject *r; + GET_ATTR_STRING(name, nameobj); +! if (!(r = CurrentGetattr(self, name))) +! return PyObject_GenericGetAttr(self, nameobj); +! return r; + } + + static int +*** ../vim-7.3.1046/src/if_python.c 2013-05-29 22:15:26.000000000 +0200 +--- src/if_python.c 2013-05-29 22:29:26.000000000 +0200 +*************** +*** 1066,1071 **** +--- 1066,1073 ---- + { + if (strcmp(name, "softspace") == 0) + return PyInt_FromLong(((OutputObject *)(self))->softspace); ++ else if (strcmp(name, "__members__") == 0) ++ return ObjectDir(NULL, OutputAttrs); + + return Py_FindMethod(OutputMethods, self, name); + } +*************** +*** 1177,1182 **** +--- 1179,1186 ---- + return Py_BuildValue(Py_ssize_t_fmt, ((RangeObject *)(self))->start - 1); + else if (strcmp(name, "end") == 0) + return Py_BuildValue(Py_ssize_t_fmt, ((RangeObject *)(self))->end - 1); ++ else if (strcmp(name, "__members__") == 0) ++ return ObjectDir(NULL, RangeAttrs); + else + return Py_FindMethod(RangeMethods, self, name); + } +*************** +*** 1396,1401 **** +--- 1400,1407 ---- + return PyInt_FromLong(this->dict->dv_lock); + else if (strcmp(name, "scope") == 0) + return PyInt_FromLong(this->dict->dv_scope); ++ else if (strcmp(name, "__members__") == 0) ++ return ObjectDir(NULL, DictionaryAttrs); + + return Py_FindMethod(DictionaryMethods, self, name); + } +*************** +*** 1420,1425 **** +--- 1426,1433 ---- + { + if (strcmp(name, "locked") == 0) + return PyInt_FromLong(((ListObject *)(self))->list->lv_lock); ++ else if (strcmp(name, "__members__") == 0) ++ return ObjectDir(NULL, ListAttrs); + + return Py_FindMethod(ListMethods, self, name); + } +*************** +*** 1431,1436 **** +--- 1439,1446 ---- + + if (strcmp(name, "name") == 0) + return PyString_FromString((char *)(this->name)); ++ else if (strcmp(name, "__members__") == 0) ++ return ObjectDir(NULL, FunctionAttrs); + else + return Py_FindMethod(FunctionMethods, self, name); + } +*** ../vim-7.3.1046/src/testdir/test86.in 2013-05-29 22:15:26.000000000 +0200 +--- src/testdir/test86.in 2013-05-29 22:29:26.000000000 +0200 +*************** +*** 691,696 **** +--- 691,714 ---- + cb.append(expr + ':' + attr + ':' + repr(type(eval(expr)) is getattr(vim, attr))) + EOF + :" ++ :" Test __dir__() method ++ py << EOF ++ for name, o in ( ++ ('current', vim.current), ++ ('buffer', vim.current.buffer), ++ ('window', vim.current.window), ++ ('tabpage', vim.current.tabpage), ++ ('range', vim.current.range), ++ ('dictionary', vim.bindeval('{}')), ++ ('list', vim.bindeval('[]')), ++ ('function', vim.bindeval('function("tr")')), ++ ('output', sys.stdout), ++ ): ++ cb.append(name + ':' + ','.join(dir(o))) ++ del name ++ del o ++ EOF ++ :" + :" Test exceptions + :fun Exe(e) + : execute a:e +*** ../vim-7.3.1046/src/testdir/test86.ok 2013-05-29 22:15:26.000000000 +0200 +--- src/testdir/test86.ok 2013-05-29 22:29:26.000000000 +0200 +*************** +*** 382,387 **** +--- 382,396 ---- + vim.current.range:Range:True + vim.current.window:Window:True + vim.current.tabpage:TabPage:True ++ current:__dir__,__members__,buffer,line,range,tabpage,window ++ buffer:__dir__,__members__,append,mark,name,number,options,range,valid,vars ++ window:__dir__,__members__,buffer,col,cursor,height,number,options,row,tabpage,valid,vars ++ tabpage:__dir__,__members__,number,valid,vars,window,windows ++ range:__dir__,__members__,append,end,start ++ dictionary:__dir__,__members__,keys,locked,scope ++ list:__dir__,__members__,extend,locked ++ function:__call__,__dir__,__members__,softspace ++ output:__dir__,__members__,flush,softspace,write,writelines + (, error('abc',)) + (, error('def',)) + (, error('ghi',)) +*** ../vim-7.3.1046/src/testdir/test87.in 2013-05-29 22:15:26.000000000 +0200 +--- src/testdir/test87.in 2013-05-29 22:29:26.000000000 +0200 +*************** +*** 669,674 **** +--- 669,692 ---- + cb.append(expr + ':' + attr + ':' + repr(type(eval(expr)) is getattr(vim, attr))) + EOF + :" ++ :" Test __dir__() method ++ py3 << EOF ++ for name, o in ( ++ ('current', vim.current), ++ ('buffer', vim.current.buffer), ++ ('window', vim.current.window), ++ ('tabpage', vim.current.tabpage), ++ ('range', vim.current.range), ++ ('dictionary', vim.bindeval('{}')), ++ ('list', vim.bindeval('[]')), ++ ('function', vim.bindeval('function("tr")')), ++ ('output', sys.stdout), ++ ): ++ cb.append(name + ':' + ','.join(dir(o))) ++ del name ++ del o ++ EOF ++ :" + :" Test exceptions + :fun Exe(e) + : execute a:e +*** ../vim-7.3.1046/src/testdir/test87.ok 2013-05-29 22:15:26.000000000 +0200 +--- src/testdir/test87.ok 2013-05-29 22:29:26.000000000 +0200 +*************** +*** 371,376 **** +--- 371,385 ---- + vim.current.range:Range:True + vim.current.window:Window:True + vim.current.tabpage:TabPage:True ++ current:__dir__,buffer,line,range,tabpage,window ++ buffer:__dir__,append,mark,name,number,options,range,valid,vars ++ window:__dir__,buffer,col,cursor,height,number,options,row,tabpage,valid,vars ++ tabpage:__dir__,number,valid,vars,window,windows ++ range:__dir__,append,end,start ++ dictionary:__dir__,keys,locked,scope ++ list:__dir__,extend,locked ++ function:__call__,__dir__,softspace ++ output:__dir__,flush,softspace,write,writelines + (, error('abc',)) + (, error('def',)) + (, error('ghi',)) +*** ../vim-7.3.1046/src/version.c 2013-05-29 22:26:15.000000000 +0200 +--- src/version.c 2013-05-29 22:35:24.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1047, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +22. You've already visited all the links at Yahoo and you're halfway through + Lycos. + + /// 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 /// diff --git a/7.3.1048 b/7.3.1048 new file mode 100644 index 0000000..3fcf610 --- /dev/null +++ b/7.3.1048 @@ -0,0 +1,614 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1048 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1048 +Problem: Python: no consistent naming. +Solution: Python patch 9: Rename d to dict and lookupDict to lookup_dict. + (ZyX) +Files: src/if_py_both.h + + +*** ../vim-7.3.1047/src/if_py_both.h 2013-05-29 22:36:06.000000000 +0200 +--- src/if_py_both.h 2013-05-29 22:39:16.000000000 +0200 +*************** +*** 475,481 **** + * you call VimToPython. + */ + static PyObject * +! VimToPython(typval_T *our_tv, int depth, PyObject *lookupDict) + { + PyObject *result; + PyObject *newObj; +--- 475,481 ---- + * you call VimToPython. + */ + static PyObject * +! VimToPython(typval_T *our_tv, int depth, PyObject *lookup_dict) + { + PyObject *result; + PyObject *newObj; +*************** +*** 489,495 **** + return result; + } + +! /* Check if we run into a recursive loop. The item must be in lookupDict + * then and we can use it again. */ + if ((our_tv->v_type == VAR_LIST && our_tv->vval.v_list != NULL) + || (our_tv->v_type == VAR_DICT && our_tv->vval.v_dict != NULL)) +--- 489,495 ---- + return result; + } + +! /* Check if we run into a recursive loop. The item must be in lookup_dict + * then and we can use it again. */ + if ((our_tv->v_type == VAR_LIST && our_tv->vval.v_list != NULL) + || (our_tv->v_type == VAR_DICT && our_tv->vval.v_dict != NULL)) +*************** +*** 498,504 **** + our_tv->v_type == VAR_LIST ? (void *)our_tv->vval.v_list + : (void *)our_tv->vval.v_dict); + +! if ((result = PyDict_GetItemString(lookupDict, ptrBuf))) + { + Py_INCREF(result); + return result; +--- 498,504 ---- + our_tv->v_type == VAR_LIST ? (void *)our_tv->vval.v_list + : (void *)our_tv->vval.v_dict); + +! if ((result = PyDict_GetItemString(lookup_dict, ptrBuf))) + { + Py_INCREF(result); + return result; +*************** +*** 538,544 **** + if (!(result = PyList_New(0))) + return NULL; + +! if (PyDict_SetItemString(lookupDict, ptrBuf, result)) + { + Py_DECREF(result); + return NULL; +--- 538,544 ---- + if (!(result = PyList_New(0))) + return NULL; + +! if (PyDict_SetItemString(lookup_dict, ptrBuf, result)) + { + Py_DECREF(result); + return NULL; +*************** +*** 546,552 **** + + for (curr = list->lv_first; curr != NULL; curr = curr->li_next) + { +! if (!(newObj = VimToPython(&curr->li_tv, depth + 1, lookupDict))) + { + Py_DECREF(result); + return NULL; +--- 546,552 ---- + + for (curr = list->lv_first; curr != NULL; curr = curr->li_next) + { +! if (!(newObj = VimToPython(&curr->li_tv, depth + 1, lookup_dict))) + { + Py_DECREF(result); + return NULL; +*************** +*** 573,579 **** + if (!(result = PyDict_New())) + return NULL; + +! if (PyDict_SetItemString(lookupDict, ptrBuf, result)) + { + Py_DECREF(result); + return NULL; +--- 573,579 ---- + if (!(result = PyDict_New())) + return NULL; + +! if (PyDict_SetItemString(lookup_dict, ptrBuf, result)) + { + Py_DECREF(result); + return NULL; +*************** +*** 586,592 **** + --todo; + + di = dict_lookup(hi); +! if (!(newObj = VimToPython(&di->di_tv, depth + 1, lookupDict))) + { + Py_DECREF(result); + return NULL; +--- 586,592 ---- + --todo; + + di = dict_lookup(hi); +! if (!(newObj = VimToPython(&di->di_tv, depth + 1, lookup_dict))) + { + Py_DECREF(result); + return NULL; +*************** +*** 970,980 **** + { + char_u *key; + typval_T tv; +! dict_T *d = self->dict; + dictitem_T *di; + DICTKEY_DECL + +! if (d->dv_lock) + { + PyErr_SetVim(_("dict is locked")); + return -1; +--- 970,980 ---- + { + char_u *key; + typval_T tv; +! dict_T *dict = self->dict; + dictitem_T *di; + DICTKEY_DECL + +! if (dict->dv_lock) + { + PyErr_SetVim(_("dict is locked")); + return -1; +*************** +*** 982,988 **** + + DICTKEY_GET_NOTEMPTY(-1) + +! di = dict_find(d, key, -1); + + if (valObject == NULL) + { +--- 982,988 ---- + + DICTKEY_GET_NOTEMPTY(-1) + +! di = dict_find(dict, key, -1); + + if (valObject == NULL) + { +*************** +*** 994,1001 **** + PyErr_SetObject(PyExc_KeyError, keyObject); + return -1; + } +! hi = hash_find(&d->dv_hashtab, di->di_key); +! hash_remove(&d->dv_hashtab, hi); + dictitem_free(di); + return 0; + } +--- 994,1001 ---- + PyErr_SetObject(PyExc_KeyError, keyObject); + return -1; + } +! hi = hash_find(&dict->dv_hashtab, di->di_key); +! hash_remove(&dict->dv_hashtab, hi); + dictitem_free(di); + return 0; + } +*************** +*** 1013,1019 **** + } + di->di_tv.v_lock = 0; + +! if (dict_add(d, di) == FAIL) + { + DICTKEY_UNREF + vim_free(di); +--- 1013,1019 ---- + } + di->di_tv.v_lock = 0; + +! if (dict_add(dict, di) == FAIL) + { + DICTKEY_UNREF + vim_free(di); +*************** +*** 1102,1108 **** + } + + static int +! list_py_concat(list_T *l, PyObject *obj, PyObject *lookupDict) + { + Py_ssize_t i; + Py_ssize_t lsize = PySequence_Size(obj); +--- 1102,1108 ---- + } + + static int +! list_py_concat(list_T *l, PyObject *obj, PyObject *lookup_dict) + { + Py_ssize_t i; + Py_ssize_t lsize = PySequence_Size(obj); +*************** +*** 1122,1128 **** + litem = PySequence_GetItem(obj, i); + if (litem == NULL) + return -1; +! if (_ConvertFromPyObject(litem, &li->li_tv, lookupDict) == -1) + return -1; + + list_append(l, li); +--- 1122,1128 ---- + litem = PySequence_GetItem(obj, i); + if (litem == NULL) + return -1; +! if (_ConvertFromPyObject(litem, &li->li_tv, lookup_dict) == -1) + return -1; + + list_append(l, li); +*************** +*** 4009,4032 **** + } + + static int +! pydict_to_tv(PyObject *obj, typval_T *tv, PyObject *lookupDict) + { +! dict_T *d; + char_u *key; + dictitem_T *di; + PyObject *keyObject; + PyObject *valObject; + Py_ssize_t iter = 0; + +! d = dict_alloc(); +! if (d == NULL) + { + PyErr_NoMemory(); + return -1; + } + + tv->v_type = VAR_DICT; +! tv->vval.v_dict = d; + + while (PyDict_Next(obj, &iter, &keyObject, &valObject)) + { +--- 4009,4032 ---- + } + + static int +! pydict_to_tv(PyObject *obj, typval_T *tv, PyObject *lookup_dict) + { +! dict_T *dict; + char_u *key; + dictitem_T *di; + PyObject *keyObject; + PyObject *valObject; + Py_ssize_t iter = 0; + +! dict = dict_alloc(); +! if (dict == NULL) + { + PyErr_NoMemory(); + return -1; + } + + tv->v_type = VAR_DICT; +! tv->vval.v_dict = dict; + + while (PyDict_Next(obj, &iter, &keyObject, &valObject)) + { +*************** +*** 4050,4061 **** + } + di->di_tv.v_lock = 0; + +! if (_ConvertFromPyObject(valObject, &di->di_tv, lookupDict) == -1) + { + vim_free(di); + return -1; + } +! if (dict_add(d, di) == FAIL) + { + vim_free(di); + PyErr_SetVim(_("failed to add key to dictionary")); +--- 4050,4062 ---- + } + di->di_tv.v_lock = 0; + +! if (_ConvertFromPyObject(valObject, &di->di_tv, lookup_dict) == -1) + { + vim_free(di); + return -1; + } +! +! if (dict_add(dict, di) == FAIL) + { + vim_free(di); + PyErr_SetVim(_("failed to add key to dictionary")); +*************** +*** 4066,4074 **** + } + + static int +! pymap_to_tv(PyObject *obj, typval_T *tv, PyObject *lookupDict) + { +! dict_T *d; + char_u *key; + dictitem_T *di; + PyObject *list; +--- 4067,4075 ---- + } + + static int +! pymap_to_tv(PyObject *obj, typval_T *tv, PyObject *lookup_dict) + { +! dict_T *dict; + char_u *key; + dictitem_T *di; + PyObject *list; +*************** +*** 4077,4091 **** + PyObject *valObject; + Py_ssize_t lsize; + +! d = dict_alloc(); +! if (d == NULL) + { + PyErr_NoMemory(); + return -1; + } + + tv->v_type = VAR_DICT; +! tv->vval.v_dict = d; + + list = PyMapping_Items(obj); + if (list == NULL) +--- 4078,4092 ---- + PyObject *valObject; + Py_ssize_t lsize; + +! dict = dict_alloc(); +! if (dict == NULL) + { + PyErr_NoMemory(); + return -1; + } + + tv->v_type = VAR_DICT; +! tv->vval.v_dict = dict; + + list = PyMapping_Items(obj); + if (list == NULL) +*************** +*** 4133,4146 **** + } + di->di_tv.v_lock = 0; + +! if (_ConvertFromPyObject(valObject, &di->di_tv, lookupDict) == -1) + { + vim_free(di); + Py_DECREF(list); + Py_DECREF(litem); + return -1; + } +! if (dict_add(d, di) == FAIL) + { + vim_free(di); + Py_DECREF(list); +--- 4134,4147 ---- + } + di->di_tv.v_lock = 0; + +! if (_ConvertFromPyObject(valObject, &di->di_tv, lookup_dict) == -1) + { + vim_free(di); + Py_DECREF(list); + Py_DECREF(litem); + return -1; + } +! if (dict_add(dict, di) == FAIL) + { + vim_free(di); + Py_DECREF(list); +*************** +*** 4155,4161 **** + } + + static int +! pyseq_to_tv(PyObject *obj, typval_T *tv, PyObject *lookupDict) + { + list_T *l; + +--- 4156,4162 ---- + } + + static int +! pyseq_to_tv(PyObject *obj, typval_T *tv, PyObject *lookup_dict) + { + list_T *l; + +*************** +*** 4169,4182 **** + tv->v_type = VAR_LIST; + tv->vval.v_list = l; + +! if (list_py_concat(l, obj, lookupDict) == -1) + return -1; + + return 0; + } + + static int +! pyiter_to_tv(PyObject *obj, typval_T *tv, PyObject *lookupDict) + { + PyObject *iterator = PyObject_GetIter(obj); + PyObject *item; +--- 4170,4183 ---- + tv->v_type = VAR_LIST; + tv->vval.v_list = l; + +! if (list_py_concat(l, obj, lookup_dict) == -1) + return -1; + + return 0; + } + + static int +! pyiter_to_tv(PyObject *obj, typval_T *tv, PyObject *lookup_dict) + { + PyObject *iterator = PyObject_GetIter(obj); + PyObject *item; +*************** +*** 4208,4214 **** + } + li->li_tv.v_lock = 0; + +! if (_ConvertFromPyObject(item, &li->li_tv, lookupDict) == -1) + return -1; + + list_append(l, li); +--- 4209,4215 ---- + } + li->li_tv.v_lock = 0; + +! if (_ConvertFromPyObject(item, &li->li_tv, lookup_dict) == -1) + return -1; + + list_append(l, li); +*************** +*** 4224,4230 **** + + static int + convert_dl(PyObject *obj, typval_T *tv, +! pytotvfunc py_to_tv, PyObject *lookupDict) + { + PyObject *capsule; + char hexBuf[sizeof(void *) * 2 + 3]; +--- 4225,4231 ---- + + static int + convert_dl(PyObject *obj, typval_T *tv, +! pytotvfunc py_to_tv, PyObject *lookup_dict) + { + PyObject *capsule; + char hexBuf[sizeof(void *) * 2 + 3]; +*************** +*** 4232,4240 **** + sprintf(hexBuf, "%p", obj); + + # ifdef PY_USE_CAPSULE +! capsule = PyDict_GetItemString(lookupDict, hexBuf); + # else +! capsule = (PyObject *)PyDict_GetItemString(lookupDict, hexBuf); + # endif + if (capsule == NULL) + { +--- 4233,4241 ---- + sprintf(hexBuf, "%p", obj); + + # ifdef PY_USE_CAPSULE +! capsule = PyDict_GetItemString(lookup_dict, hexBuf); + # else +! capsule = (PyObject *)PyDict_GetItemString(lookup_dict, hexBuf); + # endif + if (capsule == NULL) + { +*************** +*** 4243,4251 **** + # else + capsule = PyCObject_FromVoidPtr(tv, NULL); + # endif +! PyDict_SetItemString(lookupDict, hexBuf, capsule); + Py_DECREF(capsule); +! if (py_to_tv(obj, tv, lookupDict) == -1) + { + tv->v_type = VAR_UNKNOWN; + return -1; +--- 4244,4252 ---- + # else + capsule = PyCObject_FromVoidPtr(tv, NULL); + # endif +! PyDict_SetItemString(lookup_dict, hexBuf, capsule); + Py_DECREF(capsule); +! if (py_to_tv(obj, tv, lookup_dict) == -1) + { + tv->v_type = VAR_UNKNOWN; + return -1; +*************** +*** 4285,4291 **** + } + + static int +! _ConvertFromPyObject(PyObject *obj, typval_T *tv, PyObject *lookupDict) + { + if (obj->ob_type == &DictionaryType) + { +--- 4286,4292 ---- + } + + static int +! _ConvertFromPyObject(PyObject *obj, typval_T *tv, PyObject *lookup_dict) + { + if (obj->ob_type == &DictionaryType) + { +*************** +*** 4357,4363 **** + tv->vval.v_number = (varnumber_T) PyLong_AsLong(obj); + } + else if (PyDict_Check(obj)) +! return convert_dl(obj, tv, pydict_to_tv, lookupDict); + #ifdef FEAT_FLOAT + else if (PyFloat_Check(obj)) + { +--- 4358,4364 ---- + tv->vval.v_number = (varnumber_T) PyLong_AsLong(obj); + } + else if (PyDict_Check(obj)) +! return convert_dl(obj, tv, pydict_to_tv, lookup_dict); + #ifdef FEAT_FLOAT + else if (PyFloat_Check(obj)) + { +*************** +*** 4366,4376 **** + } + #endif + else if (PyIter_Check(obj)) +! return convert_dl(obj, tv, pyiter_to_tv, lookupDict); + else if (PySequence_Check(obj)) +! return convert_dl(obj, tv, pyseq_to_tv, lookupDict); + else if (PyMapping_Check(obj)) +! return convert_dl(obj, tv, pymap_to_tv, lookupDict); + else + { + PyErr_SetString(PyExc_TypeError, +--- 4367,4377 ---- + } + #endif + else if (PyIter_Check(obj)) +! return convert_dl(obj, tv, pyiter_to_tv, lookup_dict); + else if (PySequence_Check(obj)) +! return convert_dl(obj, tv, pyseq_to_tv, lookup_dict); + else if (PyMapping_Check(obj)) +! return convert_dl(obj, tv, pymap_to_tv, lookup_dict); + else + { + PyErr_SetString(PyExc_TypeError, +*** ../vim-7.3.1047/src/version.c 2013-05-29 22:36:06.000000000 +0200 +--- src/version.c 2013-05-29 22:38:23.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1048, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +23. You can't call your mother...she doesn't have a modem. + + /// 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 /// diff --git a/7.3.1049 b/7.3.1049 new file mode 100644 index 0000000..e275c12 --- /dev/null +++ b/7.3.1049 @@ -0,0 +1,177 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1049 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1049 +Problem: Python: no consistent naming +Solution: Python patch 10: Rename DICTKEY_GET_NOTEMPTY to DICTKEY_GET. (ZyX) +Files: src/if_py_both.h + + +*** ../vim-7.3.1048/src/if_py_both.h 2013-05-29 22:39:46.000000000 +0200 +--- src/if_py_both.h 2013-05-29 22:42:26.000000000 +0200 +*************** +*** 34,40 **** + PyObject *dictkey_todecref; + #define DICTKEY_GET(err) \ + if (!(key = StringToChars(keyObject, &dictkey_todecref))) \ +! return err; + #define DICTKEY_UNREF \ + Py_XDECREF(dictkey_todecref); + +--- 34,45 ---- + PyObject *dictkey_todecref; + #define DICTKEY_GET(err) \ + if (!(key = StringToChars(keyObject, &dictkey_todecref))) \ +! return err; \ +! if (*key == NUL) \ +! { \ +! PyErr_SetString(PyExc_ValueError, _("empty keys are not allowed")); \ +! return err; \ +! } + #define DICTKEY_UNREF \ + Py_XDECREF(dictkey_todecref); + +*************** +*** 851,864 **** + + static PyTypeObject DictionaryType; + +- #define DICTKEY_GET_NOTEMPTY(err) \ +- DICTKEY_GET(err) \ +- if (*key == NUL) \ +- { \ +- PyErr_SetString(PyExc_ValueError, _("empty keys are not allowed")); \ +- return err; \ +- } +- + typedef struct + { + PyObject_HEAD +--- 856,861 ---- +*************** +*** 950,956 **** + dictitem_T *di; + DICTKEY_DECL + +! DICTKEY_GET_NOTEMPTY(NULL) + + di = dict_find(self->dict, key, -1); + +--- 947,953 ---- + dictitem_T *di; + DICTKEY_DECL + +! DICTKEY_GET(NULL) + + di = dict_find(self->dict, key, -1); + +*************** +*** 980,986 **** + return -1; + } + +! DICTKEY_GET_NOTEMPTY(-1) + + di = dict_find(dict, key, -1); + +--- 977,983 ---- + return -1; + } + +! DICTKEY_GET(-1) + + di = dict_find(dict, key, -1); + +*************** +*** 1653,1659 **** + if (self->Check(self->from)) + return NULL; + +! DICTKEY_GET_NOTEMPTY(NULL) + + flags = get_option_value_strict(key, &numval, &stringval, + self->opt_type, self->from); +--- 1650,1656 ---- + if (self->Check(self->from)) + return NULL; + +! DICTKEY_GET(NULL) + + flags = get_option_value_strict(key, &numval, &stringval, + self->opt_type, self->from); +*************** +*** 1792,1798 **** + if (self->Check(self->from)) + return -1; + +! DICTKEY_GET_NOTEMPTY(-1) + + flags = get_option_value_strict(key, NULL, NULL, + self->opt_type, self->from); +--- 1789,1795 ---- + if (self->Check(self->from)) + return -1; + +! DICTKEY_GET(-1) + + flags = get_option_value_strict(key, NULL, NULL, + self->opt_type, self->from); +*************** +*** 4037,4043 **** + if (valObject == NULL) + return -1; + +! DICTKEY_GET_NOTEMPTY(-1) + + di = dictitem_alloc(key); + +--- 4034,4040 ---- + if (valObject == NULL) + return -1; + +! DICTKEY_GET(-1) + + di = dictitem_alloc(key); + +*************** +*** 4111,4117 **** + return -1; + } + +! DICTKEY_GET_NOTEMPTY(-1) + + valObject = PyTuple_GetItem(litem, 1); + if (valObject == NULL) +--- 4108,4114 ---- + return -1; + } + +! DICTKEY_GET(-1) + + valObject = PyTuple_GetItem(litem, 1); + if (valObject == NULL) +*** ../vim-7.3.1048/src/version.c 2013-05-29 22:39:46.000000000 +0200 +--- src/version.c 2013-05-29 22:42:23.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1049, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +24. You realize there is not a sound in the house and you have no idea where + your children are. + + /// 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 /// diff --git a/7.3.1050 b/7.3.1050 new file mode 100644 index 0000000..d1c4842 --- /dev/null +++ b/7.3.1050 @@ -0,0 +1,52 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1050 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1050 +Problem: Python: Typo in pyiter_to_tv. +Solution: Python patch 11. (ZyX) +Files: src/if_py_both.h + + +*** ../vim-7.3.1049/src/if_py_both.h 2013-05-29 22:43:32.000000000 +0200 +--- src/if_py_both.h 2013-05-29 22:45:42.000000000 +0200 +*************** +*** 4196,4202 **** + if (iterator == NULL) + return -1; + +! while ((item = PyIter_Next(obj))) + { + li = listitem_alloc(); + if (li == NULL) +--- 4196,4202 ---- + if (iterator == NULL) + return -1; + +! while ((item = PyIter_Next(iterator))) + { + li = listitem_alloc(); + if (li == NULL) +*** ../vim-7.3.1049/src/version.c 2013-05-29 22:43:32.000000000 +0200 +--- src/version.c 2013-05-29 22:45:58.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1050, + /**/ + +-- +Computers are useless. They can only give you answers. + -- Pablo Picasso + + /// 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 /// diff --git a/7.3.1051 b/7.3.1051 new file mode 100644 index 0000000..e937535 --- /dev/null +++ b/7.3.1051 @@ -0,0 +1,332 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1051 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1051 +Problem: Python: possible memory leaks. +Solution: Python patch 12: fix the leaks (ZyX) +Files: src/if_py_both.h + + +*** ../vim-7.3.1050/src/if_py_both.h 2013-05-29 22:46:22.000000000 +0200 +--- src/if_py_both.h 2013-05-29 22:48:45.000000000 +0200 +*************** +*** 32,40 **** + + #define DICTKEY_DECL \ + PyObject *dictkey_todecref; +! #define DICTKEY_GET(err) \ + if (!(key = StringToChars(keyObject, &dictkey_todecref))) \ + return err; \ + if (*key == NUL) \ + { \ + PyErr_SetString(PyExc_ValueError, _("empty keys are not allowed")); \ +--- 32,48 ---- + + #define DICTKEY_DECL \ + PyObject *dictkey_todecref; +! #define DICTKEY_GET(err, decref) \ + if (!(key = StringToChars(keyObject, &dictkey_todecref))) \ ++ { \ ++ if (decref) \ ++ { \ ++ Py_DECREF(keyObject); \ ++ } \ + return err; \ ++ } \ ++ if (decref && !dictkey_todecref) \ ++ dictkey_todecref = keyObject; \ + if (*key == NUL) \ + { \ + PyErr_SetString(PyExc_ValueError, _("empty keys are not allowed")); \ +*************** +*** 602,608 **** + Py_DECREF(newObj); + return NULL; + } +- Py_DECREF(newObj); + } + } + } +--- 610,615 ---- +*************** +*** 947,953 **** + dictitem_T *di; + DICTKEY_DECL + +! DICTKEY_GET(NULL) + + di = dict_find(self->dict, key, -1); + +--- 954,960 ---- + dictitem_T *di; + DICTKEY_DECL + +! DICTKEY_GET(NULL, 0) + + di = dict_find(self->dict, key, -1); + +*************** +*** 977,983 **** + return -1; + } + +! DICTKEY_GET(-1) + + di = dict_find(dict, key, -1); + +--- 984,990 ---- + return -1; + } + +! DICTKEY_GET(-1, 0) + + di = dict_find(dict, key, -1); + +*************** +*** 1650,1656 **** + if (self->Check(self->from)) + return NULL; + +! DICTKEY_GET(NULL) + + flags = get_option_value_strict(key, &numval, &stringval, + self->opt_type, self->from); +--- 1657,1663 ---- + if (self->Check(self->from)) + return NULL; + +! DICTKEY_GET(NULL, 0) + + flags = get_option_value_strict(key, &numval, &stringval, + self->opt_type, self->from); +*************** +*** 1789,1795 **** + if (self->Check(self->from)) + return -1; + +! DICTKEY_GET(-1) + + flags = get_option_value_strict(key, NULL, NULL, + self->opt_type, self->from); +--- 1796,1802 ---- + if (self->Check(self->from)) + return -1; + +! DICTKEY_GET(-1, 0) + + flags = get_option_value_strict(key, NULL, NULL, + self->opt_type, self->from); +*************** +*** 4029,4040 **** + { + DICTKEY_DECL + +! if (keyObject == NULL) +! return -1; +! if (valObject == NULL) + return -1; + +! DICTKEY_GET(-1) + + di = dictitem_alloc(key); + +--- 4036,4045 ---- + { + DICTKEY_DECL + +! if (keyObject == NULL || valObject == NULL) + return -1; + +! DICTKEY_GET(-1, 0) + + di = dictitem_alloc(key); + +*************** +*** 4055,4060 **** +--- 4060,4066 ---- + + if (dict_add(dict, di) == FAIL) + { ++ clear_tv(&di->di_tv); + vim_free(di); + PyErr_SetVim(_("failed to add key to dictionary")); + return -1; +*************** +*** 4100,4123 **** + return -1; + } + +! keyObject = PyTuple_GetItem(litem, 0); +! if (keyObject == NULL) + { + Py_DECREF(list); + Py_DECREF(litem); + return -1; + } + +! DICTKEY_GET(-1) + +! valObject = PyTuple_GetItem(litem, 1); +! if (valObject == NULL) + { + Py_DECREF(list); + Py_DECREF(litem); + return -1; + } + + di = dictitem_alloc(key); + + DICTKEY_UNREF +--- 4106,4130 ---- + return -1; + } + +! if (!(keyObject = PyTuple_GetItem(litem, 0))) + { + Py_DECREF(list); + Py_DECREF(litem); + return -1; + } + +! DICTKEY_GET(-1, 1) + +! if (!(valObject = PyTuple_GetItem(litem, 1))) + { + Py_DECREF(list); + Py_DECREF(litem); ++ DICTKEY_UNREF + return -1; + } + ++ Py_DECREF(litem); ++ + di = dictitem_alloc(key); + + DICTKEY_UNREF +*************** +*** 4125,4131 **** + if (di == NULL) + { + Py_DECREF(list); +! Py_DECREF(litem); + PyErr_NoMemory(); + return -1; + } +--- 4132,4138 ---- + if (di == NULL) + { + Py_DECREF(list); +! Py_DECREF(valObject); + PyErr_NoMemory(); + return -1; + } +*************** +*** 4135,4152 **** + { + vim_free(di); + Py_DECREF(list); +! Py_DECREF(litem); + return -1; + } + if (dict_add(dict, di) == FAIL) + { + vim_free(di); + Py_DECREF(list); +- Py_DECREF(litem); + PyErr_SetVim(_("failed to add key to dictionary")); + return -1; + } +- Py_DECREF(litem); + } + Py_DECREF(list); + return 0; +--- 4142,4161 ---- + { + vim_free(di); + Py_DECREF(list); +! Py_DECREF(valObject); + return -1; + } ++ ++ Py_DECREF(valObject); ++ + if (dict_add(dict, di) == FAIL) + { ++ clear_tv(&di->di_tv); + vim_free(di); + Py_DECREF(list); + PyErr_SetVim(_("failed to add key to dictionary")); + return -1; + } + } + Py_DECREF(list); + return 0; +*************** +*** 4201,4213 **** +--- 4210,4227 ---- + li = listitem_alloc(); + if (li == NULL) + { ++ Py_DECREF(iterator); + PyErr_NoMemory(); + return -1; + } + li->li_tv.v_lock = 0; + + if (_ConvertFromPyObject(item, &li->li_tv, lookup_dict) == -1) ++ { ++ Py_DECREF(item); ++ Py_DECREF(iterator); + return -1; ++ } + + list_append(l, li); + +*************** +*** 4241,4248 **** + # else + capsule = PyCObject_FromVoidPtr(tv, NULL); + # endif +! PyDict_SetItemString(lookup_dict, hexBuf, capsule); +! Py_DECREF(capsule); + if (py_to_tv(obj, tv, lookup_dict) == -1) + { + tv->v_type = VAR_UNKNOWN; +--- 4255,4266 ---- + # else + capsule = PyCObject_FromVoidPtr(tv, NULL); + # endif +! if (PyDict_SetItemString(lookup_dict, hexBuf, capsule)) +! { +! Py_DECREF(capsule); +! tv->v_type = VAR_UNKNOWN; +! return -1; +! } + if (py_to_tv(obj, tv, lookup_dict) == -1) + { + tv->v_type = VAR_UNKNOWN; +*** ../vim-7.3.1050/src/version.c 2013-05-29 22:46:22.000000000 +0200 +--- src/version.c 2013-05-29 22:48:31.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1051, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +25. You believe nothing looks sexier than a man in boxer shorts illuminated + only by a 17" inch svga monitor. + + /// 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 /// diff --git a/7.3.1052 b/7.3.1052 new file mode 100644 index 0000000..7f587a9 --- /dev/null +++ b/7.3.1052 @@ -0,0 +1,48 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1052 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1052 +Problem: Python: possible SEGV and negative refcount. +Solution: Python patch 13: Fix IterIter function. (ZyX) +Files: src/if_py_both.h + + +*** ../vim-7.3.1051/src/if_py_both.h 2013-05-29 22:49:21.000000000 +0200 +--- src/if_py_both.h 2013-05-29 22:51:59.000000000 +0200 +*************** +*** 814,819 **** +--- 814,820 ---- + static PyObject * + IterIter(PyObject *self) + { ++ Py_INCREF(self); + return self; + } + +*** ../vim-7.3.1051/src/version.c 2013-05-29 22:49:21.000000000 +0200 +--- src/version.c 2013-05-29 22:51:45.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1052, + /**/ + +-- +Q: What is the difference betwee open-source and commercial software? +A: If you have a problem with commercial software you can call a phone + number and they will tell you it might be solved in a future version. + For open-source software there isn't a phone number to call, but you + get the solution within a day. + + /// 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 /// diff --git a/7.3.1053 b/7.3.1053 new file mode 100644 index 0000000..456deb2 --- /dev/null +++ b/7.3.1053 @@ -0,0 +1,103 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1053 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1053 +Problem: Python: no flag for types with tp_traverse+tp_clear. +Solution: Python patch 14: Add Py_TPFLAGS_HAVE_GC. (ZyX) +Files: src/if_py_both.h + + +*** ../vim-7.3.1052/src/if_py_both.h 2013-05-29 22:52:29.000000000 +0200 +--- src/if_py_both.h 2013-05-29 22:55:08.000000000 +0200 +*************** +*** 4461,4467 **** + vim_memset(&IterType, 0, sizeof(IterType)); + IterType.tp_name = "vim.iter"; + IterType.tp_basicsize = sizeof(IterObject); +! IterType.tp_flags = Py_TPFLAGS_DEFAULT; + IterType.tp_doc = "generic iterator object"; + IterType.tp_iter = (getiterfunc)IterIter; + IterType.tp_iternext = (iternextfunc)IterNext; +--- 4461,4467 ---- + vim_memset(&IterType, 0, sizeof(IterType)); + IterType.tp_name = "vim.iter"; + IterType.tp_basicsize = sizeof(IterObject); +! IterType.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC; + IterType.tp_doc = "generic iterator object"; + IterType.tp_iter = (getiterfunc)IterIter; + IterType.tp_iternext = (iternextfunc)IterNext; +*************** +*** 4495,4501 **** + WindowType.tp_basicsize = sizeof(WindowObject); + WindowType.tp_dealloc = (destructor)WindowDestructor; + WindowType.tp_repr = (reprfunc)WindowRepr; +! WindowType.tp_flags = Py_TPFLAGS_DEFAULT; + WindowType.tp_doc = "vim Window object"; + WindowType.tp_methods = WindowMethods; + WindowType.tp_traverse = (traverseproc)WindowTraverse; +--- 4495,4501 ---- + WindowType.tp_basicsize = sizeof(WindowObject); + WindowType.tp_dealloc = (destructor)WindowDestructor; + WindowType.tp_repr = (reprfunc)WindowRepr; +! WindowType.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC; + WindowType.tp_doc = "vim Window object"; + WindowType.tp_methods = WindowMethods; + WindowType.tp_traverse = (traverseproc)WindowTraverse; +*************** +*** 4558,4564 **** + RangeType.tp_repr = (reprfunc)RangeRepr; + RangeType.tp_as_sequence = &RangeAsSeq; + RangeType.tp_as_mapping = &RangeAsMapping; +! RangeType.tp_flags = Py_TPFLAGS_DEFAULT; + RangeType.tp_doc = "vim Range object"; + RangeType.tp_methods = RangeMethods; + RangeType.tp_traverse = (traverseproc)RangeTraverse; +--- 4558,4564 ---- + RangeType.tp_repr = (reprfunc)RangeRepr; + RangeType.tp_as_sequence = &RangeAsSeq; + RangeType.tp_as_mapping = &RangeAsMapping; +! RangeType.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC; + RangeType.tp_doc = "vim Range object"; + RangeType.tp_methods = RangeMethods; + RangeType.tp_traverse = (traverseproc)RangeTraverse; +*************** +*** 4637,4643 **** + vim_memset(&OptionsType, 0, sizeof(OptionsType)); + OptionsType.tp_name = "vim.options"; + OptionsType.tp_basicsize = sizeof(OptionsObject); +! OptionsType.tp_flags = Py_TPFLAGS_DEFAULT; + OptionsType.tp_doc = "object for manipulating options"; + OptionsType.tp_as_mapping = &OptionsAsMapping; + OptionsType.tp_dealloc = (destructor)OptionsDestructor; +--- 4637,4643 ---- + vim_memset(&OptionsType, 0, sizeof(OptionsType)); + OptionsType.tp_name = "vim.options"; + OptionsType.tp_basicsize = sizeof(OptionsObject); +! OptionsType.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC; + OptionsType.tp_doc = "object for manipulating options"; + OptionsType.tp_as_mapping = &OptionsAsMapping; + OptionsType.tp_dealloc = (destructor)OptionsDestructor; +*** ../vim-7.3.1052/src/version.c 2013-05-29 22:52:29.000000000 +0200 +--- src/version.c 2013-05-29 22:54:46.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1053, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +26. You check your mail. It says "no new messages." So you check it again. + + /// 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 /// diff --git a/7.3.1054 b/7.3.1054 new file mode 100644 index 0000000..c354a6b --- /dev/null +++ b/7.3.1054 @@ -0,0 +1,178 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1054 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1054 (after 7.3.1042) +Problem: Can't build without the +autocmd feature. (Elimar Riesebieter) +Solution: Fix use of buf and curbuf. +Files: src/ex_cmds.c, src/testdir/test86.ok, src/testdir/test87.ok + + +*** ../vim-7.3.1053/src/ex_cmds.c 2013-05-29 22:02:18.000000000 +0200 +--- src/ex_cmds.c 2013-05-30 11:24:41.000000000 +0200 +*************** +*** 2421,2430 **** + char_u *new_fname; + { + char_u *fname, *sfname, *xfname; +! #ifdef FEAT_AUTOCMD +! buf_T *buf = curbuf; + +! apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, buf); + /* buffer changed, don't change name now */ + if (buf != curbuf) + return FAIL; +--- 2421,2431 ---- + char_u *new_fname; + { + char_u *fname, *sfname, *xfname; +! buf_T *buf; + +! #ifdef FEAT_AUTOCMD +! buf = curbuf; +! apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf); + /* buffer changed, don't change name now */ + if (buf != curbuf) + return FAIL; +*************** +*** 2440,2457 **** + * But don't set the alternate file name if the buffer didn't have a + * name. + */ +! fname = buf->b_ffname; +! sfname = buf->b_sfname; +! xfname = buf->b_fname; +! buf->b_ffname = NULL; +! buf->b_sfname = NULL; +! if (setfname(buf, new_fname, NULL, TRUE) == FAIL) + { +! buf->b_ffname = fname; +! buf->b_sfname = sfname; + return FAIL; + } +! buf->b_flags |= BF_NOTEDITED; + if (xfname != NULL && *xfname != NUL) + { + buf = buflist_new(fname, xfname, curwin->w_cursor.lnum, 0); +--- 2441,2458 ---- + * But don't set the alternate file name if the buffer didn't have a + * name. + */ +! fname = curbuf->b_ffname; +! sfname = curbuf->b_sfname; +! xfname = curbuf->b_fname; +! curbuf->b_ffname = NULL; +! curbuf->b_sfname = NULL; +! if (setfname(curbuf, new_fname, NULL, TRUE) == FAIL) + { +! curbuf->b_ffname = fname; +! curbuf->b_sfname = sfname; + return FAIL; + } +! curbuf->b_flags |= BF_NOTEDITED; + if (xfname != NULL && *xfname != NUL) + { + buf = buflist_new(fname, xfname, curwin->w_cursor.lnum, 0); +*************** +*** 2461,2467 **** + vim_free(fname); + vim_free(sfname); + #ifdef FEAT_AUTOCMD +! apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, buf); + #endif + /* Change directories when the 'acd' option is set. */ + DO_AUTOCHDIR +--- 2462,2468 ---- + vim_free(fname); + vim_free(sfname); + #ifdef FEAT_AUTOCMD +! apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf); + #endif + /* Change directories when the 'acd' option is set. */ + DO_AUTOCHDIR +*** ../vim-7.3.1053/src/testdir/test86.ok 2013-05-29 22:36:06.000000000 +0200 +--- src/testdir/test86.ok 2013-05-30 11:34:12.000000000 +0200 +*************** +*** 320,332 **** + Third line + foo + 1:BufFilePre:1 +! 6:BufFilePost:1 + testdir/foo + 5:BufFilePre:5 + 5:BufFilePost:5 + testdir/bar + 1:BufFilePre:1 +! 7:BufFilePost:1 + testdir/test86.in + valid: b:False, cb:True + i: +--- 320,332 ---- + Third line + foo + 1:BufFilePre:1 +! 1:BufFilePost:1 + testdir/foo + 5:BufFilePre:5 + 5:BufFilePost:5 + testdir/bar + 1:BufFilePre:1 +! 1:BufFilePost:1 + testdir/test86.in + valid: b:False, cb:True + i: +*** ../vim-7.3.1053/src/testdir/test87.ok 2013-05-29 22:36:06.000000000 +0200 +--- src/testdir/test87.ok 2013-05-30 11:34:26.000000000 +0200 +*************** +*** 309,321 **** + Third line + foo + 1:BufFilePre:1 +! 6:BufFilePost:1 + testdir/foo + 5:BufFilePre:5 + 5:BufFilePost:5 + testdir/bar + 1:BufFilePre:1 +! 7:BufFilePost:1 + testdir/test87.in + valid: b:False, cb:True + i: +--- 309,321 ---- + Third line + foo + 1:BufFilePre:1 +! 1:BufFilePost:1 + testdir/foo + 5:BufFilePre:5 + 5:BufFilePost:5 + testdir/bar + 1:BufFilePre:1 +! 1:BufFilePost:1 + testdir/test87.in + valid: b:False, cb:True + i: +*** ../vim-7.3.1053/src/version.c 2013-05-29 22:58:28.000000000 +0200 +--- src/version.c 2013-05-30 11:40:54.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1054, + /**/ + +-- +For a moment, nothing happened. +Then, after a second or so, nothing continued to happen. + -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" + + /// 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 /// diff --git a/7.3.1055 b/7.3.1055 new file mode 100644 index 0000000..0b7be2a --- /dev/null +++ b/7.3.1055 @@ -0,0 +1,112 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1055 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1055 +Problem: Negated collection does not match newline. +Solution: Handle newline differently. (Hiroshi Shirosaki) +Files: src/regexp_nfa.c, src/testdir/test64.ok, src/testdir/test64.in + + +*** ../vim-7.3.1054/src/regexp_nfa.c 2013-05-29 21:14:37.000000000 +0200 +--- src/regexp_nfa.c 2013-05-30 11:47:40.000000000 +0200 +*************** +*** 1203,1215 **** + } + mb_ptr_adv(regparse); + +- if (extra == ADD_NL) /* \_[] also matches \n */ +- { +- EMIT(reg_string ? NL : NFA_NEWL); +- TRY_NEG(); +- EMIT_GLUE(); +- } +- + /* skip the trailing ] */ + regparse = endp; + mb_ptr_adv(regparse); +--- 1203,1208 ---- +*************** +*** 1219,1224 **** +--- 1212,1225 ---- + EMIT(NFA_END_NEG_RANGE); + EMIT(NFA_CONCAT); + } ++ ++ /* \_[] also matches \n but it's not negated */ ++ if (extra == ADD_NL) ++ { ++ EMIT(reg_string ? NL : NFA_NEWL); ++ EMIT(NFA_OR); ++ } ++ + return OK; + } /* if exists closing ] */ + +*** ../vim-7.3.1054/src/testdir/test64.ok 2013-05-29 21:14:37.000000000 +0200 +--- src/testdir/test64.ok 2013-05-30 11:48:31.000000000 +0200 +*************** +*** 731,736 **** +--- 731,742 ---- + OK 1 - \(<<\)\@1<=span. + OK 0 - \(<<\)\@2<=span. + OK 1 - \(<<\)\@2<=span. ++ OK 0 - \_[^8-9]\+ ++ OK 1 - \_[^8-9]\+ ++ OK 2 - \_[^8-9]\+ ++ OK 0 - \_[^a]\+ ++ OK 1 - \_[^a]\+ ++ OK 2 - \_[^a]\+ + 192.168.0.1 + 192.168.0.1 + 192.168.0.1 +*** ../vim-7.3.1054/src/testdir/test64.in 2013-05-29 21:14:37.000000000 +0200 +--- src/testdir/test64.in 2013-05-30 11:45:59.000000000 +0200 +*************** +*** 344,351 **** + :call add(tl, [0, '\(<<\)\@1<=span.', 'xxspanxxxx +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1056 +Problem: Python: possible memory leaks. +Solution: Python patch 15. (ZyX) Fix will follow later. +Files: src/eval.c, src/if_py_both.h, src/proto/eval.pro + + +*** ../vim-7.3.1055/src/eval.c 2013-05-17 16:03:53.000000000 +0200 +--- src/eval.c 2013-05-30 12:11:40.000000000 +0200 +*************** +*** 412,418 **** + static int get_lit_string_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate)); + static int get_list_tv __ARGS((char_u **arg, typval_T *rettv, int evaluate)); + static int rettv_list_alloc __ARGS((typval_T *rettv)); +- static void listitem_free __ARGS((listitem_T *item)); + static long list_len __ARGS((list_T *l)); + static int list_equal __ARGS((list_T *l1, list_T *l2, int ic, int recursive)); + static int dict_equal __ARGS((dict_T *d1, dict_T *d2, int ic, int recursive)); +--- 412,417 ---- +*************** +*** 428,434 **** + static int list_join __ARGS((garray_T *gap, list_T *l, char_u *sep, int echo, int copyID)); + static int free_unref_items __ARGS((int copyID)); + static int rettv_dict_alloc __ARGS((typval_T *rettv)); +- static void dict_free __ARGS((dict_T *d, int recurse)); + static dictitem_T *dictitem_copy __ARGS((dictitem_T *org)); + static void dictitem_remove __ARGS((dict_T *dict, dictitem_T *item)); + static dict_T *dict_copy __ARGS((dict_T *orig, int deep, int copyID)); +--- 427,432 ---- +*************** +*** 5955,5961 **** + /* + * Free a list item. Also clears the value. Does not notify watchers. + */ +! static void + listitem_free(item) + listitem_T *item; + { +--- 5953,5959 ---- + /* + * Free a list item. Also clears the value. Does not notify watchers. + */ +! void + listitem_free(item) + listitem_T *item; + { +*************** +*** 7031,7037 **** + * Free a Dictionary, including all items it contains. + * Ignores the reference count. + */ +! static void + dict_free(d, recurse) + dict_T *d; + int recurse; /* Free Lists and Dictionaries recursively. */ +--- 7029,7035 ---- + * Free a Dictionary, including all items it contains. + * Ignores the reference count. + */ +! void + dict_free(d, recurse) + dict_T *d; + int recurse; /* Free Lists and Dictionaries recursively. */ +*************** +*** 8353,8359 **** + + /* + * Call a function with its resolved parameters +! * Return OK when the function can't be called, FAIL otherwise. + * Also returns OK when an error was encountered while executing the function. + */ + static int +--- 8351,8357 ---- + + /* + * Call a function with its resolved parameters +! * Return FAIL when the function can't be called, OK otherwise. + * Also returns OK when an error was encountered while executing the function. + */ + static int +*** ../vim-7.3.1055/src/if_py_both.h 2013-05-29 22:58:28.000000000 +0200 +--- src/if_py_both.h 2013-05-30 12:13:37.000000000 +0200 +*************** +*** 32,39 **** + + #define DICTKEY_DECL \ + PyObject *dictkey_todecref; + #define DICTKEY_GET(err, decref) \ +! if (!(key = StringToChars(keyObject, &dictkey_todecref))) \ + { \ + if (decref) \ + { \ +--- 32,46 ---- + + #define DICTKEY_DECL \ + PyObject *dictkey_todecref; ++ #define DICTKEY_CHECK_EMPTY(err) \ ++ if (*key == NUL) \ ++ { \ ++ PyErr_SetString(PyExc_ValueError, _("empty keys are not allowed")); \ ++ return err; \ ++ } ++ #define DICTKEY_SET_KEY (key = StringToChars(keyObject, &dictkey_todecref)) + #define DICTKEY_GET(err, decref) \ +! if (!DICTKEY_SET_KEY) \ + { \ + if (decref) \ + { \ +*************** +*** 43,53 **** + } \ + if (decref && !dictkey_todecref) \ + dictkey_todecref = keyObject; \ +! if (*key == NUL) \ +! { \ +! PyErr_SetString(PyExc_ValueError, _("empty keys are not allowed")); \ +! return err; \ +! } + #define DICTKEY_UNREF \ + Py_XDECREF(dictkey_todecref); + +--- 50,56 ---- + } \ + if (decref && !dictkey_todecref) \ + dictkey_todecref = keyObject; \ +! DICTKEY_CHECK_EMPTY(err) + #define DICTKEY_UNREF \ + Py_XDECREF(dictkey_todecref); + +*************** +*** 651,659 **** + + /* Convert the Vim type into a Python type. Create a dictionary that's + * used to check for recursive loops. */ +! lookup_dict = PyDict_New(); +! result = VimToPython(our_tv, 1, lookup_dict); +! Py_DECREF(lookup_dict); + + + Py_BEGIN_ALLOW_THREADS +--- 654,666 ---- + + /* Convert the Vim type into a Python type. Create a dictionary that's + * used to check for recursive loops. */ +! if (!(lookup_dict = PyDict_New())) +! result = NULL; +! else +! { +! result = VimToPython(our_tv, 1, lookup_dict); +! Py_DECREF(lookup_dict); +! } + + + Py_BEGIN_ALLOW_THREADS +*************** +*** 1401,1407 **** + return NULL; + } + +! lookup_dict = PyDict_New(); + if (list_py_concat(l, obj, lookup_dict) == -1) + { + Py_DECREF(lookup_dict); +--- 1408,1416 ---- + return NULL; + } + +! if (!(lookup_dict = PyDict_New())) +! return NULL; +! + if (list_py_concat(l, obj, lookup_dict) == -1) + { + Py_DECREF(lookup_dict); +*************** +*** 4023,4034 **** + PyObject *valObject; + Py_ssize_t iter = 0; + +! dict = dict_alloc(); +! if (dict == NULL) +! { +! PyErr_NoMemory(); + return -1; +- } + + tv->v_type = VAR_DICT; + tv->vval.v_dict = dict; +--- 4032,4039 ---- + PyObject *valObject; + Py_ssize_t iter = 0; + +! if (!(dict = dict_alloc())) + return -1; + + tv->v_type = VAR_DICT; + tv->vval.v_dict = dict; +*************** +*** 4038,4046 **** + DICTKEY_DECL + + if (keyObject == NULL || valObject == NULL) + return -1; + +! DICTKEY_GET(-1, 0) + + di = dictitem_alloc(key); + +--- 4043,4059 ---- + DICTKEY_DECL + + if (keyObject == NULL || valObject == NULL) ++ { ++ dict_unref(dict); + return -1; ++ } + +! if (!DICTKEY_SET_KEY) +! { +! dict_unref(dict); +! return -1; +! } +! DICTKEY_CHECK_EMPTY(-1) + + di = dictitem_alloc(key); + +*************** +*** 4049,4054 **** +--- 4062,4068 ---- + if (di == NULL) + { + PyErr_NoMemory(); ++ dict_unref(dict); + return -1; + } + di->di_tv.v_lock = 0; +*************** +*** 4056,4061 **** +--- 4070,4076 ---- + if (_ConvertFromPyObject(valObject, &di->di_tv, lookup_dict) == -1) + { + vim_free(di); ++ dict_unref(dict); + return -1; + } + +*************** +*** 4063,4072 **** +--- 4078,4090 ---- + { + clear_tv(&di->di_tv); + vim_free(di); ++ dict_unref(dict); + PyErr_SetVim(_("failed to add key to dictionary")); + return -1; + } + } ++ ++ --dict->dv_refcount; + return 0; + } + +*************** +*** 4082,4100 **** + PyObject *valObject; + Py_ssize_t lsize; + +! dict = dict_alloc(); +! if (dict == NULL) +! { +! PyErr_NoMemory(); + return -1; +- } + + tv->v_type = VAR_DICT; + tv->vval.v_dict = dict; + + list = PyMapping_Items(obj); + if (list == NULL) + return -1; + lsize = PyList_Size(list); + while (lsize--) + { +--- 4100,4117 ---- + PyObject *valObject; + Py_ssize_t lsize; + +! if (!(dict = dict_alloc())) + return -1; + + tv->v_type = VAR_DICT; + tv->vval.v_dict = dict; + + list = PyMapping_Items(obj); + if (list == NULL) ++ { ++ dict_unref(dict); + return -1; ++ } + lsize = PyList_Size(list); + while (lsize--) + { +*************** +*** 4104,4109 **** +--- 4121,4127 ---- + if (litem == NULL) + { + Py_DECREF(list); ++ dict_unref(dict); + return -1; + } + +*************** +*** 4111,4125 **** + { + Py_DECREF(list); + Py_DECREF(litem); + return -1; + } + +! DICTKEY_GET(-1, 1) + + if (!(valObject = PyTuple_GetItem(litem, 1))) + { + Py_DECREF(list); + Py_DECREF(litem); + DICTKEY_UNREF + return -1; + } +--- 4129,4153 ---- + { + Py_DECREF(list); + Py_DECREF(litem); ++ dict_unref(dict); + return -1; + } + +! if (!DICTKEY_SET_KEY) +! { +! dict_unref(dict); +! Py_DECREF(list); +! Py_DECREF(litem); +! DICTKEY_UNREF +! return -1; +! } +! DICTKEY_CHECK_EMPTY(-1) + + if (!(valObject = PyTuple_GetItem(litem, 1))) + { + Py_DECREF(list); + Py_DECREF(litem); ++ dict_unref(dict); + DICTKEY_UNREF + return -1; + } +*************** +*** 4133,4139 **** + if (di == NULL) + { + Py_DECREF(list); +! Py_DECREF(valObject); + PyErr_NoMemory(); + return -1; + } +--- 4161,4167 ---- + if (di == NULL) + { + Py_DECREF(list); +! dict_unref(dict); + PyErr_NoMemory(); + return -1; + } +*************** +*** 4142,4216 **** + if (_ConvertFromPyObject(valObject, &di->di_tv, lookup_dict) == -1) + { + vim_free(di); + Py_DECREF(list); +- Py_DECREF(valObject); + return -1; + } + +- Py_DECREF(valObject); +- + if (dict_add(dict, di) == FAIL) + { +! clear_tv(&di->di_tv); +! vim_free(di); + Py_DECREF(list); + PyErr_SetVim(_("failed to add key to dictionary")); + return -1; + } + } + Py_DECREF(list); + return 0; + } + + static int + pyseq_to_tv(PyObject *obj, typval_T *tv, PyObject *lookup_dict) + { + list_T *l; + +! l = list_alloc(); +! if (l == NULL) +! { +! PyErr_NoMemory(); + return -1; +- } + + tv->v_type = VAR_LIST; + tv->vval.v_list = l; + + if (list_py_concat(l, obj, lookup_dict) == -1) + return -1; + + return 0; + } + + static int + pyiter_to_tv(PyObject *obj, typval_T *tv, PyObject *lookup_dict) + { +! PyObject *iterator = PyObject_GetIter(obj); + PyObject *item; + list_T *l; + listitem_T *li; + +! l = list_alloc(); +! +! if (l == NULL) +! { +! PyErr_NoMemory(); + return -1; +- } + + tv->vval.v_list = l; + tv->v_type = VAR_LIST; + +! +! if (iterator == NULL) + return -1; + + while ((item = PyIter_Next(iterator))) + { + li = listitem_alloc(); + if (li == NULL) + { + Py_DECREF(iterator); + PyErr_NoMemory(); + return -1; +--- 4170,4256 ---- + if (_ConvertFromPyObject(valObject, &di->di_tv, lookup_dict) == -1) + { + vim_free(di); ++ dict_unref(dict); + Py_DECREF(list); + return -1; + } + + if (dict_add(dict, di) == FAIL) + { +! dictitem_free(di); +! dict_unref(dict); + Py_DECREF(list); + PyErr_SetVim(_("failed to add key to dictionary")); + return -1; + } + } ++ --dict->dv_refcount; + Py_DECREF(list); + return 0; + } + ++ static list_T * ++ py_list_alloc() ++ { ++ list_T *r; ++ ++ if (!(r = list_alloc())) ++ { ++ PyErr_NoMemory(); ++ return NULL; ++ } ++ ++r->lv_refcount; ++ ++ return r; ++ } ++ + static int + pyseq_to_tv(PyObject *obj, typval_T *tv, PyObject *lookup_dict) + { + list_T *l; + +! if (!(l = py_list_alloc())) + return -1; + + tv->v_type = VAR_LIST; + tv->vval.v_list = l; + + if (list_py_concat(l, obj, lookup_dict) == -1) ++ { ++ list_unref(l); + return -1; ++ } + ++ --l->lv_refcount; + return 0; + } + + static int + pyiter_to_tv(PyObject *obj, typval_T *tv, PyObject *lookup_dict) + { +! PyObject *iterator; + PyObject *item; + list_T *l; + listitem_T *li; + +! if (!(l = py_list_alloc())) + return -1; + + tv->vval.v_list = l; + tv->v_type = VAR_LIST; + +! if (!(iterator = PyObject_GetIter(obj))) +! { +! list_unref(l); + return -1; ++ } + + while ((item = PyIter_Next(iterator))) + { + li = listitem_alloc(); + if (li == NULL) + { ++ list_unref(l); + Py_DECREF(iterator); + PyErr_NoMemory(); + return -1; +*************** +*** 4219,4224 **** +--- 4259,4266 ---- + + if (_ConvertFromPyObject(item, &li->li_tv, lookup_dict) == -1) + { ++ list_unref(l); ++ listitem_free(li); + Py_DECREF(item); + Py_DECREF(iterator); + return -1; +*************** +*** 4230,4235 **** +--- 4272,4286 ---- + } + + Py_DECREF(iterator); ++ ++ /* Iterator may have finished due to an exception */ ++ if (PyErr_Occurred()) ++ { ++ list_unref(l); ++ return -1; ++ } ++ ++ --l->lv_refcount; + return 0; + } + +*************** +*** 4295,4301 **** + PyObject *lookup_dict; + int r; + +! lookup_dict = PyDict_New(); + r = _ConvertFromPyObject(obj, tv, lookup_dict); + Py_DECREF(lookup_dict); + return r; +--- 4346,4353 ---- + PyObject *lookup_dict; + int r; + +! if (!(lookup_dict = PyDict_New())) +! return -1; + r = _ConvertFromPyObject(obj, tv, lookup_dict); + Py_DECREF(lookup_dict); + return r; +*** ../vim-7.3.1055/src/proto/eval.pro 2013-05-17 16:03:53.000000000 +0200 +--- src/proto/eval.pro 2013-05-30 12:11:40.000000000 +0200 +*************** +*** 49,54 **** +--- 49,55 ---- + void list_unref __ARGS((list_T *l)); + void list_free __ARGS((list_T *l, int recurse)); + listitem_T *listitem_alloc __ARGS((void)); ++ void listitem_free __ARGS((listitem_T *item)); + void listitem_remove __ARGS((list_T *l, listitem_T *item)); + dictitem_T *dict_lookup __ARGS((hashitem_T *hi)); + listitem_T *list_find __ARGS((list_T *l, long n)); +*************** +*** 65,70 **** +--- 66,72 ---- + void set_ref_in_item __ARGS((typval_T *tv, int copyID)); + dict_T *dict_alloc __ARGS((void)); + void dict_unref __ARGS((dict_T *d)); ++ void dict_free __ARGS((dict_T *d, int recurse)); + dictitem_T *dictitem_alloc __ARGS((char_u *key)); + void dictitem_free __ARGS((dictitem_T *item)); + int dict_add __ARGS((dict_T *d, dictitem_T *item)); +*** ../vim-7.3.1055/src/version.c 2013-05-30 11:51:04.000000000 +0200 +--- src/version.c 2013-05-30 12:13:57.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1056, + /**/ + +-- +I have a drinking problem -- I can't afford it. + + /// 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 /// diff --git a/7.3.1057 b/7.3.1057 new file mode 100644 index 0000000..a47b6bc --- /dev/null +++ b/7.3.1057 @@ -0,0 +1,205 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1057 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1057 +Problem: Python: not enough compatibilty. +Solution: Python patch 16: Make OutputWritelines support any sequence object + (ZyX) Note: tests fail +Files: src/if_py_both.h, src/testdir/test86.in, src/testdir/test86.ok, + src/testdir/test87.in, src/testdir/test87.ok + + +*** ../vim-7.3.1056/src/if_py_both.h 2013-05-30 12:14:44.000000000 +0200 +--- src/if_py_both.h 2013-05-30 12:18:09.000000000 +0200 +*************** +*** 312,347 **** + static PyObject * + OutputWritelines(OutputObject *self, PyObject *args) + { +! PyInt n; +! PyInt i; +! PyObject *list; + int error = self->error; + +! if (!PyArg_ParseTuple(args, "O", &list)) + return NULL; +- Py_INCREF(list); + +! if (!PyList_Check(list)) +! { +! PyErr_SetString(PyExc_TypeError, _("writelines() requires list of strings")); +! Py_DECREF(list); + return NULL; +- } +- +- n = PyList_Size(list); + +! for (i = 0; i < n; ++i) + { +- PyObject *line = PyList_GetItem(list, i); + char *str = NULL; + PyInt len; + +! if (!PyArg_Parse(line, "et#", ENC_OPT, &str, &len)) + { + PyErr_SetString(PyExc_TypeError, _("writelines() requires list of strings")); +! Py_DECREF(list); + return NULL; + } + + Py_BEGIN_ALLOW_THREADS + Python_Lock_Vim(); +--- 312,341 ---- + static PyObject * + OutputWritelines(OutputObject *self, PyObject *args) + { +! PyObject *seq; +! PyObject *iterator; +! PyObject *item; + int error = self->error; + +! if (!PyArg_ParseTuple(args, "O", &seq)) + return NULL; + +! if (!(iterator = PyObject_GetIter(seq))) + return NULL; + +! while ((item = PyIter_Next(iterator))) + { + char *str = NULL; + PyInt len; + +! if (!PyArg_Parse(item, "et#", ENC_OPT, &str, &len)) + { + PyErr_SetString(PyExc_TypeError, _("writelines() requires list of strings")); +! Py_DECREF(iterator); +! Py_DECREF(item); + return NULL; + } ++ Py_DECREF(item); + + Py_BEGIN_ALLOW_THREADS + Python_Lock_Vim(); +*************** +*** 351,357 **** + PyMem_Free(str); + } + +! Py_DECREF(list); + Py_INCREF(Py_None); + return Py_None; + } +--- 345,356 ---- + PyMem_Free(str); + } + +! Py_DECREF(iterator); +! +! /* Iterator may have finished due to an exception */ +! if (PyErr_Occurred()) +! return NULL; +! + Py_INCREF(Py_None); + return Py_None; + } +*** ../vim-7.3.1056/src/testdir/test86.in 2013-05-29 22:36:06.000000000 +0200 +--- src/testdir/test86.in 2013-05-30 12:18:09.000000000 +0200 +*************** +*** 709,714 **** +--- 709,724 ---- + del o + EOF + :" ++ :" ++ :" Test stdout/stderr ++ :redir => messages ++ :py sys.stdout.write('abc') ; sys.stdout.write('def') ++ :py sys.stderr.write('abc') ; sys.stderr.write('def') ++ :py sys.stdout.writelines(iter('abc')) ++ :py sys.stderr.writelines(iter('abc')) ++ :redir END ++ :$put =string(substitute(messages, '\d\+', '', 'g')) ++ :" + :" Test exceptions + :fun Exe(e) + : execute a:e +*** ../vim-7.3.1056/src/testdir/test86.ok 2013-05-30 11:43:11.000000000 +0200 +--- src/testdir/test86.ok 2013-05-30 12:18:09.000000000 +0200 +*************** +*** 391,396 **** +--- 391,403 ---- + list:__dir__,__members__,extend,locked + function:__call__,__dir__,__members__,softspace + output:__dir__,__members__,flush,softspace,write,writelines ++ ' ++ abcdef ++ line : ++ abcdef ++ abc ++ line : ++ abc' + (, error('abc',)) + (, error('def',)) + (, error('ghi',)) +*** ../vim-7.3.1056/src/testdir/test87.in 2013-05-29 22:36:06.000000000 +0200 +--- src/testdir/test87.in 2013-05-30 12:18:09.000000000 +0200 +*************** +*** 687,692 **** +--- 687,702 ---- + del o + EOF + :" ++ :" ++ :" Test stdout/stderr ++ :redir => messages ++ :py sys.stdout.write('abc') ; sys.stdout.write('def') ++ :py sys.stderr.write('abc') ; sys.stderr.write('def') ++ :py sys.stdout.writelines(iter('abc')) ++ :py sys.stderr.writelines(iter('abc')) ++ :redir END ++ :$put =string(substitute(messages, '\d\+', '', 'g')) ++ :" + :" Test exceptions + :fun Exe(e) + : execute a:e +*** ../vim-7.3.1056/src/testdir/test87.ok 2013-05-30 11:43:11.000000000 +0200 +--- src/testdir/test87.ok 2013-05-30 12:18:09.000000000 +0200 +*************** +*** 380,385 **** +--- 380,392 ---- + list:__dir__,extend,locked + function:__call__,__dir__,softspace + output:__dir__,flush,softspace,write,writelines ++ ' ++ abcdef ++ line : ++ abcdef ++ abc ++ line : ++ abc' + (, error('abc',)) + (, error('def',)) + (, error('ghi',)) +*** ../vim-7.3.1056/src/version.c 2013-05-30 12:14:44.000000000 +0200 +--- src/version.c 2013-05-30 12:20:02.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1057, + /**/ + +-- +I have a drinking problem -- I don't have a drink! + + /// 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 /// diff --git a/7.3.1058 b/7.3.1058 new file mode 100644 index 0000000..cacdac7 --- /dev/null +++ b/7.3.1058 @@ -0,0 +1,163 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1058 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1058 +Problem: Call of funcref does not succeed in other script. +Solution: Python patch 17: add get_expanded_name(). (ZyX) +Files: src/eval.c, src/proto/eval.pro + + +*** ../vim-7.3.1057/src/eval.c 2013-05-30 12:14:44.000000000 +0200 +--- src/eval.c 2013-05-30 12:31:55.000000000 +0200 +*************** +*** 810,816 **** + # endif + prof_self_cmp __ARGS((const void *s1, const void *s2)); + #endif +- static int script_autoload __ARGS((char_u *name, int reload)); + static char_u *autoload_name __ARGS((char_u *name)); + static void cat_func_name __ARGS((char_u *buf, ufunc_T *fp)); + static void func_free __ARGS((ufunc_T *fp)); +--- 810,815 ---- +*************** +*** 10946,10961 **** + typval_T *rettv; + { + char_u *s; + + s = get_tv_string(&argvars[0]); + if (s == NULL || *s == NUL || VIM_ISDIGIT(*s)) + EMSG2(_(e_invarg2), s); +! /* Don't check an autoload name for existence here. */ +! else if (vim_strchr(s, AUTOLOAD_CHAR) == NULL && !function_exists(s)) + EMSG2(_("E700: Unknown function: %s"), s); + else + { +! rettv->vval.v_string = vim_strsave(s); + rettv->v_type = VAR_FUNC; + } + } +--- 10945,10969 ---- + typval_T *rettv; + { + char_u *s; ++ char_u *name = NULL; + + s = get_tv_string(&argvars[0]); + if (s == NULL || *s == NUL || VIM_ISDIGIT(*s)) + EMSG2(_(e_invarg2), s); +! /* Don't check an autoload name for existence here, but still expand it +! * checking for validity */ +! else if ((name = get_expanded_name(s, vim_strchr(s, AUTOLOAD_CHAR) == NULL)) +! == NULL) + EMSG2(_("E700: Unknown function: %s"), s); + else + { +! if (name == NULL) +! /* Autoload function, need to copy string */ +! rettv->vval.v_string = vim_strsave(s); +! else +! /* Function found by get_expanded_name, string allocated by +! * trans_function_name: no need to copy */ +! rettv->vval.v_string = name; + rettv->v_type = VAR_FUNC; + } + } +*************** +*** 21938,21943 **** +--- 21946,21978 ---- + return n; + } + ++ char_u * ++ get_expanded_name(name, check) ++ char_u *name; ++ int check; ++ { ++ char_u *nm = name; ++ char_u *p; ++ ++ p = trans_function_name(&nm, FALSE, TFN_INT|TFN_QUIET, NULL); ++ ++ if (p != NULL && *nm == NUL) ++ { ++ if (!check) ++ return p; ++ else if (builtin_function(p)) ++ { ++ if (find_internal_func(p) >= 0) ++ return p; ++ } ++ else ++ if (find_func(p) != NULL) ++ return p; ++ } ++ vim_free(p); ++ return NULL; ++ } ++ + /* + * Return TRUE if "name" looks like a builtin function name: starts with a + * lower case letter and doesn't contain a ':' or AUTOLOAD_CHAR. +*************** +*** 22146,22152 **** + * If "name" has a package name try autoloading the script for it. + * Return TRUE if a package was loaded. + */ +! static int + script_autoload(name, reload) + char_u *name; + int reload; /* load script again when already loaded */ +--- 22181,22187 ---- + * If "name" has a package name try autoloading the script for it. + * Return TRUE if a package was loaded. + */ +! int + script_autoload(name, reload) + char_u *name; + int reload; /* load script again when already loaded */ +*** ../vim-7.3.1057/src/proto/eval.pro 2013-05-30 12:14:44.000000000 +0200 +--- src/proto/eval.pro 2013-05-30 12:31:55.000000000 +0200 +*************** +*** 77,82 **** +--- 77,83 ---- + long get_dict_number __ARGS((dict_T *d, char_u *key)); + char_u *get_function_name __ARGS((expand_T *xp, int idx)); + char_u *get_expr_name __ARGS((expand_T *xp, int idx)); ++ char_u *get_expanded_name __ARGS((char_u *name, int check)); + int func_call __ARGS((char_u *name, typval_T *args, dict_T *selfdict, typval_T *rettv)); + void mzscheme_call_vim __ARGS((char_u *name, typval_T *args, typval_T *rettv)); + long do_searchpair __ARGS((char_u *spat, char_u *mpat, char_u *epat, int dir, char_u *skip, int flags, pos_T *match_pos, linenr_T lnum_stop, long time_limit)); +*************** +*** 129,132 **** +--- 130,134 ---- + void ex_oldfiles __ARGS((exarg_T *eap)); + int modify_fname __ARGS((char_u *src, int *usedlen, char_u **fnamep, char_u **bufp, int *fnamelen)); + char_u *do_string_sub __ARGS((char_u *str, char_u *pat, char_u *sub, char_u *flags)); ++ int script_autoload __ARGS((char_u *name, int reload)); + /* vim: set ft=c : */ +*** ../vim-7.3.1057/src/version.c 2013-05-30 12:26:52.000000000 +0200 +--- src/version.c 2013-05-30 12:29:55.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1058, + /**/ + +-- +How To Keep A Healthy Level Of Insanity: +1. At lunch time, sit in your parked car with sunglasses on and point + a hair dryer at passing cars. See if they slow down. + + /// 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 /// diff --git a/7.3.1059 b/7.3.1059 new file mode 100644 index 0000000..61b158e --- /dev/null +++ b/7.3.1059 @@ -0,0 +1,321 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1059 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1059 +Problem: Python: Using fixed size buffers. +Solution: Python patch 18: Use python's own formatter. (ZyX) +Files: src/if_py_both.h, src/if_python3.c, src/if_python.c + + +*** ../vim-7.3.1058/src/if_py_both.h 2013-05-30 12:26:52.000000000 +0200 +--- src/if_py_both.h 2013-05-30 12:38:22.000000000 +0200 +*************** +*** 2006,2029 **** + static PyObject * + TabPageRepr(TabPageObject *self) + { +- static char repr[100]; +- + if (self->tab == INVALID_TABPAGE_VALUE) +! { +! vim_snprintf(repr, 100, _(""), (self)); +! return PyString_FromString(repr); +! } + else + { + int t = get_tab_number(self->tab); + + if (t == 0) +! vim_snprintf(repr, 100, _(""), +! (self)); + else +! vim_snprintf(repr, 100, _(""), t - 1); +! +! return PyString_FromString(repr); + } + } + +--- 2006,2022 ---- + static PyObject * + TabPageRepr(TabPageObject *self) + { + if (self->tab == INVALID_TABPAGE_VALUE) +! return PyString_FromFormat("", (self)); + else + { + int t = get_tab_number(self->tab); + + if (t == 0) +! return PyString_FromFormat("", +! (self)); + else +! return PyString_FromFormat("", t - 1); + } + } + +*************** +*** 2344,2367 **** + static PyObject * + WindowRepr(WindowObject *self) + { +- static char repr[100]; +- + if (self->win == INVALID_WINDOW_VALUE) +! { +! vim_snprintf(repr, 100, _(""), (self)); +! return PyString_FromString(repr); +! } + else + { + int w = get_win_number(self->win, firstwin); + + if (w == 0) +! vim_snprintf(repr, 100, _(""), + (self)); + else +! vim_snprintf(repr, 100, _(""), w - 1); +! +! return PyString_FromString(repr); + } + } + +--- 2337,2353 ---- + static PyObject * + WindowRepr(WindowObject *self) + { + if (self->win == INVALID_WINDOW_VALUE) +! return PyString_FromFormat("", (self)); + else + { + int w = get_win_number(self->win, firstwin); + + if (w == 0) +! return PyString_FromFormat("", + (self)); + else +! return PyString_FromFormat("", w - 1); + } + } + +*************** +*** 3281,3311 **** + static PyObject * + RangeRepr(RangeObject *self) + { +- static char repr[100]; +- + if (self->buf->buf == INVALID_BUFFER_VALUE) +! { +! vim_snprintf(repr, 100, "", +! (self)); +! return PyString_FromString(repr); +! } + else + { + char *name = (char *)self->buf->buf->b_fname; +- int len; + + if (name == NULL) + name = ""; +- len = (int)strlen(name); +- +- if (len > 45) +- name = name + (45 - len); +- +- vim_snprintf(repr, 100, "", +- len > 45 ? "..." : "", name, +- self->start, self->end); + +! return PyString_FromString(repr); + } + } + +--- 3267,3284 ---- + static PyObject * + RangeRepr(RangeObject *self) + { + if (self->buf->buf == INVALID_BUFFER_VALUE) +! return PyString_FromFormat("", +! (self)); + else + { + char *name = (char *)self->buf->buf->b_fname; + + if (name == NULL) + name = ""; + +! return PyString_FromFormat("", +! name, self->start, self->end); + } + } + +*************** +*** 3534,3561 **** + static PyObject * + BufferRepr(BufferObject *self) + { +- static char repr[100]; +- + if (self->buf == INVALID_BUFFER_VALUE) +! { +! vim_snprintf(repr, 100, _(""), (self)); +! return PyString_FromString(repr); +! } + else + { +! char *name = (char *)self->buf->b_fname; +! PyInt len; + + if (name == NULL) + name = ""; +- len = strlen(name); +- +- if (len > 35) +- name = name + (35 - len); +- +- vim_snprintf(repr, 100, "", len > 35 ? "..." : "", name); + +! return PyString_FromString(repr); + } + } + +--- 3507,3522 ---- + static PyObject * + BufferRepr(BufferObject *self) + { + if (self->buf == INVALID_BUFFER_VALUE) +! return PyString_FromFormat("", self); + else + { +! char *name = (char *)self->buf->b_fname; + + if (name == NULL) + name = ""; + +! return PyString_FromFormat("", name); + } + } + +*** ../vim-7.3.1058/src/if_python3.c 2013-05-29 22:36:06.000000000 +0200 +--- src/if_python3.c 2013-05-30 12:39:25.000000000 +0200 +*************** +*** 90,95 **** +--- 90,96 ---- + #define PyString_AsString(obj) PyBytes_AsString(obj) + #define PyString_Size(obj) PyBytes_GET_SIZE(bytes) + #define PyString_FromString(repr) PyUnicode_FromString(repr) ++ #define PyString_FromFormat PyUnicode_FromFormat + #define PyString_AsStringAndSize(obj, buffer, len) PyBytes_AsStringAndSize(obj, buffer, len) + #define PyInt_Check(obj) PyLong_Check(obj) + #define PyInt_FromLong(i) PyLong_FromLong(i) +*************** +*** 230,235 **** +--- 231,246 ---- + # define PyType_GenericNew py3_PyType_GenericNew + # undef PyUnicode_FromString + # define PyUnicode_FromString py3_PyUnicode_FromString ++ # ifndef PyUnicode_FromFormat ++ # define PyUnicode_FromFormat py3_PyUnicode_FromFormat ++ # else ++ # define Py_UNICODE_USE_UCS_FUNCTIONS ++ # ifdef Py_UNICODE_WIDE ++ # define PyUnicodeUCS4_FromFormat py3_PyUnicodeUCS4_FromFormat ++ # else ++ # define PyUnicodeUCS2_FromFormat py3_PyUnicodeUCS2_FromFormat ++ # endif ++ # endif + # undef PyUnicode_Decode + # define PyUnicode_Decode py3_PyUnicode_Decode + # define PyType_IsSubtype py3_PyType_IsSubtype +*************** +*** 293,298 **** +--- 304,318 ---- + static int (*py3_PyType_Ready)(PyTypeObject *type); + static int (*py3_PyDict_SetItemString)(PyObject *dp, char *key, PyObject *item); + static PyObject* (*py3_PyUnicode_FromString)(const char *u); ++ # ifndef Py_UNICODE_USE_UCS_FUNCTIONS ++ static PyObject* (*py3_PyUnicode_FromFormat)(const char *u, ...); ++ # else ++ # ifdef Py_UNICODE_WIDE ++ static PyObject* (*py3_PyUnicodeUCS4_FromFormat)(const char *u, ...); ++ # else ++ static PyObject* (*py3_PyUnicodeUCS2_FromFormat)(const char *u, ...); ++ # endif ++ # endif + static PyObject* (*py3_PyUnicode_Decode)(const char *u, Py_ssize_t size, + const char *encoding, const char *errors); + static long (*py3_PyLong_AsLong)(PyObject *); +*************** +*** 458,463 **** +--- 478,492 ---- + # else + {"_PyUnicode_AsString", (PYTHON_PROC*)&py3__PyUnicode_AsString}, + # endif ++ # ifndef Py_UNICODE_USE_UCS_FUNCTIONS ++ {"PyUnicode_FromFormat", (PYTHON_PROC*)&py3_PyUnicode_FromFormat}, ++ # else ++ # ifdef Py_UNICODE_WIDE ++ {"PyUnicodeUCS4_FromFormat", (PYTHON_PROC*)&py3_PyUnicodeUCS4_FromFormat}, ++ # else ++ {"PyUnicodeUCS2_FromFormat", (PYTHON_PROC*)&py3_PyUnicodeUCS2_FromFormat}, ++ # endif ++ # endif + {"PyBytes_AsString", (PYTHON_PROC*)&py3_PyBytes_AsString}, + {"PyBytes_AsStringAndSize", (PYTHON_PROC*)&py3_PyBytes_AsStringAndSize}, + {"PyBytes_FromString", (PYTHON_PROC*)&py3_PyBytes_FromString}, +*** ../vim-7.3.1058/src/if_python.c 2013-05-29 22:36:06.000000000 +0200 +--- src/if_python.c 2013-05-30 12:38:22.000000000 +0200 +*************** +*** 212,217 **** +--- 212,218 ---- + # define PyString_AsString dll_PyString_AsString + # define PyString_AsStringAndSize dll_PyString_AsStringAndSize + # define PyString_FromString dll_PyString_FromString ++ # define PyString_FromFormat dll_PyString_FromFormat + # define PyString_FromStringAndSize dll_PyString_FromStringAndSize + # define PyString_Size dll_PyString_Size + # define PyString_Type (*dll_PyString_Type) +*************** +*** 340,345 **** +--- 341,347 ---- + static char*(*dll_PyString_AsString)(PyObject *); + static int(*dll_PyString_AsStringAndSize)(PyObject *, char **, int *); + static PyObject*(*dll_PyString_FromString)(const char *); ++ static PyObject*(*dll_PyString_FromFormat)(const char *, ...); + static PyObject*(*dll_PyString_FromStringAndSize)(const char *, PyInt); + static PyInt(*dll_PyString_Size)(PyObject *); + static PyTypeObject* dll_PyString_Type; +*************** +*** 499,504 **** +--- 501,507 ---- + {"PyString_AsString", (PYTHON_PROC*)&dll_PyString_AsString}, + {"PyString_AsStringAndSize", (PYTHON_PROC*)&dll_PyString_AsStringAndSize}, + {"PyString_FromString", (PYTHON_PROC*)&dll_PyString_FromString}, ++ {"PyString_FromFormat", (PYTHON_PROC*)&dll_PyString_FromFormat}, + {"PyString_FromStringAndSize", (PYTHON_PROC*)&dll_PyString_FromStringAndSize}, + {"PyString_Size", (PYTHON_PROC*)&dll_PyString_Size}, + {"PyString_Type", (PYTHON_PROC*)&dll_PyString_Type}, +*** ../vim-7.3.1058/src/version.c 2013-05-30 12:35:48.000000000 +0200 +--- src/version.c 2013-05-30 12:39:51.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1059, + /**/ + +-- +How To Keep A Healthy Level Of Insanity: +2. Page yourself over the intercom. Don't disguise your voice. + + /// 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 /// diff --git a/7.3.1060 b/7.3.1060 new file mode 100644 index 0000000..085aed5 --- /dev/null +++ b/7.3.1060 @@ -0,0 +1,61 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1060 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1060 +Problem: Python: can't repr() a function. +Solution: Python patch 19: add FunctionRepr(). (ZyX) +Files: src/if_py_both.h + + +*** ../vim-7.3.1059/src/if_py_both.h 2013-05-30 12:40:36.000000000 +0200 +--- src/if_py_both.h 2013-05-30 12:43:16.000000000 +0200 +*************** +*** 1584,1589 **** +--- 1584,1595 ---- + return result; + } + ++ static PyObject * ++ FunctionRepr(FunctionObject *self) ++ { ++ return PyString_FromFormat("", self->name); ++ } ++ + static struct PyMethodDef FunctionMethods[] = { + {"__call__",(PyCFunction)FunctionCall, METH_VARARGS|METH_KEYWORDS, ""}, + {"__dir__", (PyCFunction)FunctionDir, METH_NOARGS, ""}, +*************** +*** 4640,4645 **** +--- 4646,4652 ---- + FunctionType.tp_flags = Py_TPFLAGS_DEFAULT; + FunctionType.tp_doc = "object that calls vim function"; + FunctionType.tp_methods = FunctionMethods; ++ FunctionType.tp_repr = (reprfunc)FunctionRepr; + #if PY_MAJOR_VERSION >= 3 + FunctionType.tp_getattro = (getattrofunc)FunctionGetattro; + #else +*** ../vim-7.3.1059/src/version.c 2013-05-30 12:40:36.000000000 +0200 +--- src/version.c 2013-05-30 12:43:06.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1060, + /**/ + +-- +How To Keep A Healthy Level Of Insanity: +3. Every time someone asks you to do something, ask if they want fries + with that. + + /// 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 /// diff --git a/7.3.1061 b/7.3.1061 new file mode 100644 index 0000000..a263d65 --- /dev/null +++ b/7.3.1061 @@ -0,0 +1,1964 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1061 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1061 +Problem: Python: Dictionary is not standard. +Solution: Python patch 20: Add standard methods and fields. (ZyX) +Files: runtime/doc/if_pyth.txt, src/eval.c, src/if_py_both.h, + src/if_python3.c, src/if_python.c, src/proto/eval.pro, + src/testdir/test86.in, src/testdir/test86.ok, + src/testdir/test87.in, src/testdir/test87.ok + + +*** ../vim-7.3.1060/runtime/doc/if_pyth.txt 2013-05-29 22:02:18.000000000 +0200 +--- runtime/doc/if_pyth.txt 2013-05-30 12:47:48.000000000 +0200 +*************** +*** 12,20 **** + 4. Range objects |python-range| + 5. Window objects |python-window| + 6. Tab page objects |python-tabpage| +! 7. pyeval(), py3eval() Vim functions |python-pyeval| +! 8. Dynamic loading |python-dynamic| +! 9. Python 3 |python3| + + {Vi does not have any of these commands} + +--- 12,21 ---- + 4. Range objects |python-range| + 5. Window objects |python-window| + 6. Tab page objects |python-tabpage| +! 7. vim.bindeval objects |python-bindeval-objects| +! 8. pyeval(), py3eval() Vim functions |python-pyeval| +! 9. Dynamic loading |python-dynamic| +! 10. Python 3 |python3| + + {Vi does not have any of these commands} + +*************** +*** 171,217 **** + 'eval_expr', 'kind': 'f', 'filename': './src/eval.c'}] + + vim.bindeval(str) *python-bindeval* +! Like |python-eval|, but +! 1. if expression evaluates to |List| or |Dictionary| it is returned as +! vimlist or vimdictionary python type that are connected to original +! list or dictionary. Thus modifications to these objects imply +! modifications of the original. +! +! Additionally, vim.List and vim.Dictionary type have read-write +! `.locked` attribute that returns +! Value Meaning ~ +! zero Variable is not locked +! vim.VAR_LOCKED Variable is locked, but can be unlocked +! vim.VAR_FIXED Variable is locked and can't be unlocked +! integer constants. If variable is not fixed, you can do +! `var.locked=True` to lock it and `var.locked=False` to unlock. +! There is no recursive locking like |:lockvar|! does. There is also +! no way to lock a specific key or check whether it is locked (in any +! case these locks are ignored by anything except |:let|: |extend()| +! does not care, neither does python interface). +! +! vim.Dictionary type also supports `.scope` attribute which is one +! of +! Value Meaning ~ +! zero Dictionary is not a scope one +! vim.VAR_DEF_SCOPE Function-local or global scope dictionary +! vim.VAR_SCOPE Other scope dictionary +! +! 2. if expression evaluates to a function reference, then it returns +! callable vim.Function object. Use self keyword argument to assign +! |self| object for dictionary functions. +! +! Note: this function has the same behavior as |lua-eval| (except that +! lua does not support running vim functions), |python-eval| is +! kept for backwards compatibility in order not to make scripts +! relying on outputs of vim.eval() being a copy of original or +! vim.eval("1") returning a string. +! +! You can use "List", "Dictionary" and "Function" vim module attributes +! to test whether object has given type. These types are currently not +! subclassable, neither they contain constructors, so you can use them +! only for checks like `isinstance(obj, vim.List)`. +! + + Error object of the "vim" module + +--- 172,180 ---- + 'eval_expr', 'kind': 'f', 'filename': './src/eval.c'}] + + vim.bindeval(str) *python-bindeval* +! Like |python-eval|, but returns special objects described in +! |python-bindeval-objects|. These python objects let you modify (|List| +! or |Dictionary|) or call (|Funcref|) vim objecs. + + Error object of the "vim" module + +*************** +*** 497,509 **** + TabPage object type is available using "TabPage" attribute of vim module. + + ============================================================================== +! 7. pyeval() and py3eval() Vim functions *python-pyeval* + + To facilitate bi-directional interface, you can use |pyeval()| and |py3eval()| + functions to evaluate Python expressions and pass their values to VimL. + + ============================================================================== +! 8. Dynamic loading *python-dynamic* + + On MS-Windows the Python library can be loaded dynamically. The |:version| + output then includes |+python/dyn|. +--- 460,549 ---- + TabPage object type is available using "TabPage" attribute of vim module. + + ============================================================================== +! 7. vim.bindeval objects *python-bindeval-objects* +! +! vim.Dictionary object *python-Dictionary* +! Dictionary-like object providing access to vim |Dictionary| type. +! Attributes: +! Attribute Description ~ +! locked One of *python-.locked* +! Value Description ~ +! zero Variable is not locked +! vim.VAR_LOCKED Variable is locked, but can be unlocked +! vim.VAR_FIXED Variable is locked and can't be unlocked +! Read-write. You can unlock locked variable by assigning +! `True` or `False` to this attribute. No recursive locking +! is supported. +! scope One of +! Value Description ~ +! zero Dictionary is not a scope one +! vim.VAR_DEF_SCOPE |g:| or |l:| dictionary +! vim.VAR_SCOPE Other scope dictionary, +! see |internal-variables| +! Methods: +! Method Description ~ +! keys() Returns a list with dictionary keys. +! values() Returns a list with dictionary values. +! items() Returns a list of 2-tuples with dictionary contents. +! update(iterable) +! update(dictionary) +! update(**kwargs) +! Adds keys to dictionary. +! Examples: > +! py d = vim.bindeval('{}') +! d['a'] = 'b' # Item assignment +! print d['a'] # getting item +! d.update({'c': 'd'}) # .update(dictionary) +! d.update(e='f') # .update(**kwargs) +! d.update((('g', 'h'), ('i', 'j'))) # .update(iterable) +! for key in d.keys(): # .keys() +! for val in d.values(): # .values() +! for key, val in d.items(): # .items() +! print isinstance(d, vim.Dictionary) # True +! for key in d: # Iteration over keys +! < +! Note: when iterating over keys you should not modify dictionary. +! +! vim.List object *python-List* +! Sequence-like object providing access to vim |List| type. +! Supports `.locked` attribute, see |python-.locked|. Also supports the +! following methods: +! Method Description ~ +! extend(item) Add items to the list. +! Examples: > +! l = vim.bindeval('[]') +! l.extend(['abc', 'def']) # .extend() method +! print l[1:] # slicing +! l[:0] = ['ghi', 'jkl'] # slice assignment +! print l[0] # getting item +! l[0] = 'mno' # assignment +! for i in l: # iteration +! print isinstance(l, vim.List) # True +! +! vim.Function object *python-Function* +! Function-like object, acting like vim |Funcref| object. Supports `.name` +! attribute and is callable. Accepts special keyword argument `self`, see +! |Dictionary-function|. +! Examples: > +! f = vim.bindeval('function("tr")') +! print f('abc', 'a', 'b') # Calls tr('abc', 'a', 'b') +! vim.command(''' +! function DictFun() dict +! return self +! endfunction +! ''') +! f = vim.bindeval('function("DictFun")') +! print f(self={}) # Like call('DictFun', [], {}) +! print isinstance(f, vim.Function) # True +! +! ============================================================================== +! 8. pyeval() and py3eval() Vim functions *python-pyeval* + + To facilitate bi-directional interface, you can use |pyeval()| and |py3eval()| + functions to evaluate Python expressions and pass their values to VimL. + + ============================================================================== +! 9. Dynamic loading *python-dynamic* + + On MS-Windows the Python library can be loaded dynamically. The |:version| + output then includes |+python/dyn|. +*************** +*** 520,526 **** + sure edit "gvim.exe" and search for "python\d*.dll\c". + + ============================================================================== +! 9. Python 3 *python3* + + *:py3* *:python3* + The `:py3` and `:python3` commands work similar to `:python`. A simple check +--- 560,566 ---- + sure edit "gvim.exe" and search for "python\d*.dll\c". + + ============================================================================== +! 10. Python 3 *python3* + + *:py3* *:python3* + The `:py3` and `:python3` commands work similar to `:python`. A simple check +*** ../vim-7.3.1060/src/eval.c 2013-05-30 12:35:48.000000000 +0200 +--- src/eval.c 2013-05-30 12:52:11.000000000 +0200 +*************** +*** 10157,10162 **** +--- 10157,10218 ---- + } + + /* ++ * Go over all entries in "d2" and add them to "d1". ++ * When "action" is "error" then a duplicate key is an error. ++ * When "action" is "force" then a duplicate key is overwritten. ++ * Otherwise duplicate keys are ignored ("action" is "keep"). ++ */ ++ void ++ dict_extend(d1, d2, action) ++ dict_T *d1; ++ dict_T *d2; ++ char_u *action; ++ { ++ dictitem_T *di1; ++ hashitem_T *hi2; ++ int todo; ++ ++ todo = (int)d2->dv_hashtab.ht_used; ++ for (hi2 = d2->dv_hashtab.ht_array; todo > 0; ++hi2) ++ { ++ if (!HASHITEM_EMPTY(hi2)) ++ { ++ --todo; ++ di1 = dict_find(d1, hi2->hi_key, -1); ++ if (d1->dv_scope != 0) ++ { ++ /* Disallow replacing a builtin function in l: and g:. ++ * Check the key to be valid when adding to any ++ * scope. */ ++ if (d1->dv_scope == VAR_DEF_SCOPE ++ && HI2DI(hi2)->di_tv.v_type == VAR_FUNC ++ && var_check_func_name(hi2->hi_key, ++ di1 == NULL)) ++ break; ++ if (!valid_varname(hi2->hi_key)) ++ break; ++ } ++ if (di1 == NULL) ++ { ++ di1 = dictitem_copy(HI2DI(hi2)); ++ if (di1 != NULL && dict_add(d1, di1) == FAIL) ++ dictitem_free(di1); ++ } ++ else if (*action == 'e') ++ { ++ EMSG2(_("E737: Key already exists: %s"), hi2->hi_key); ++ break; ++ } ++ else if (*action == 'f' && HI2DI(hi2) != di1) ++ { ++ clear_tv(&di1->di_tv); ++ copy_tv(&HI2DI(hi2)->di_tv, &di1->di_tv); ++ } ++ } ++ } ++ } ++ ++ /* + * "extend(list, list [, idx])" function + * "extend(dict, dict [, action])" function + */ +*************** +*** 10206,10217 **** + } + else if (argvars[0].v_type == VAR_DICT && argvars[1].v_type == VAR_DICT) + { +! dict_T *d1, *d2; +! dictitem_T *di1; +! char_u *action; +! int i; +! hashitem_T *hi2; +! int todo; + + d1 = argvars[0].vval.v_dict; + d2 = argvars[1].vval.v_dict; +--- 10262,10270 ---- + } + else if (argvars[0].v_type == VAR_DICT && argvars[1].v_type == VAR_DICT) + { +! dict_T *d1, *d2; +! char_u *action; +! int i; + + d1 = argvars[0].vval.v_dict; + d2 = argvars[1].vval.v_dict; +*************** +*** 10238,10283 **** + else + action = (char_u *)"force"; + +! /* Go over all entries in the second dict and add them to the +! * first dict. */ +! todo = (int)d2->dv_hashtab.ht_used; +! for (hi2 = d2->dv_hashtab.ht_array; todo > 0; ++hi2) +! { +! if (!HASHITEM_EMPTY(hi2)) +! { +! --todo; +! di1 = dict_find(d1, hi2->hi_key, -1); +! if (d1->dv_scope != 0) +! { +! /* Disallow replacing a builtin function in l: and g:. +! * Check the key to be valid when adding to any +! * scope. */ +! if (d1->dv_scope == VAR_DEF_SCOPE +! && HI2DI(hi2)->di_tv.v_type == VAR_FUNC +! && var_check_func_name(hi2->hi_key, +! di1 == NULL)) +! break; +! if (!valid_varname(hi2->hi_key)) +! break; +! } +! if (di1 == NULL) +! { +! di1 = dictitem_copy(HI2DI(hi2)); +! if (di1 != NULL && dict_add(d1, di1) == FAIL) +! dictitem_free(di1); +! } +! else if (*action == 'e') +! { +! EMSG2(_("E737: Key already exists: %s"), hi2->hi_key); +! break; +! } +! else if (*action == 'f' && HI2DI(hi2) != di1) +! { +! clear_tv(&di1->di_tv); +! copy_tv(&HI2DI(hi2)->di_tv, &di1->di_tv); +! } +! } +! } + + copy_tv(&argvars[0], rettv); + } +--- 10291,10297 ---- + else + action = (char_u *)"force"; + +! dict_extend(d1, d2, action); + + copy_tv(&argvars[0], rettv); + } +*** ../vim-7.3.1060/src/if_py_both.h 2013-05-30 12:43:50.000000000 +0200 +--- src/if_py_both.h 2013-05-30 12:52:42.000000000 +0200 +*************** +*** 31,37 **** + #define INVALID_TABPAGE_VALUE ((tabpage_T *)(-1)) + + #define DICTKEY_DECL \ +! PyObject *dictkey_todecref; + #define DICTKEY_CHECK_EMPTY(err) \ + if (*key == NUL) \ + { \ +--- 31,37 ---- + #define INVALID_TABPAGE_VALUE ((tabpage_T *)(-1)) + + #define DICTKEY_DECL \ +! PyObject *dictkey_todecref = NULL; + #define DICTKEY_CHECK_EMPTY(err) \ + if (*key == NUL) \ + { \ +*************** +*** 63,68 **** +--- 63,69 ---- + + static int ConvertFromPyObject(PyObject *, typval_T *); + static int _ConvertFromPyObject(PyObject *, typval_T *, PyObject *); ++ static int ConvertFromPyMapping(PyObject *, typval_T *); + static PyObject *WindowNew(win_T *, tabpage_T *); + static PyObject *BufferNew (buf_T *); + static PyObject *LineToString(const char *); +*************** +*** 877,888 **** + pylinkedlist_T ref; + } DictionaryObject; + + static PyObject * +! DictionaryNew(dict_T *dict) + { + DictionaryObject *self; + +! self = PyObject_NEW(DictionaryObject, &DictionaryType); + if (self == NULL) + return NULL; + self->dict = dict; +--- 878,893 ---- + pylinkedlist_T ref; + } DictionaryObject; + ++ static PyObject *DictionaryUpdate(DictionaryObject *, PyObject *, PyObject *); ++ ++ #define NEW_DICTIONARY(dict) DictionaryNew(&DictionaryType, dict) ++ + static PyObject * +! DictionaryNew(PyTypeObject *subtype, dict_T *dict) + { + DictionaryObject *self; + +! self = (DictionaryObject *) subtype->tp_alloc(subtype, 0); + if (self == NULL) + return NULL; + self->dict = dict; +*************** +*** 893,898 **** +--- 898,946 ---- + return (PyObject *)(self); + } + ++ static dict_T * ++ py_dict_alloc() ++ { ++ dict_T *r; ++ ++ if (!(r = dict_alloc())) ++ { ++ PyErr_NoMemory(); ++ return NULL; ++ } ++ ++r->dv_refcount; ++ ++ return r; ++ } ++ ++ static PyObject * ++ DictionaryConstructor(PyTypeObject *subtype, PyObject *args, PyObject *kwargs) ++ { ++ DictionaryObject *self; ++ dict_T *dict; ++ ++ if (!(dict = py_dict_alloc())) ++ return NULL; ++ ++ self = (DictionaryObject *) DictionaryNew(subtype, dict); ++ ++ --dict->dv_refcount; ++ ++ if (kwargs || PyTuple_Size(args)) ++ { ++ PyObject *tmp; ++ if (!(tmp = DictionaryUpdate(self, args, kwargs))) ++ { ++ Py_DECREF(self); ++ return NULL; ++ } ++ ++ Py_DECREF(tmp); ++ } ++ ++ return (PyObject *)(self); ++ } ++ + static void + DictionaryDestructor(DictionaryObject *self) + { +*************** +*** 918,924 **** + { + if (val == NULL) + { +! PyErr_SetString(PyExc_AttributeError, _("Cannot delete DictionaryObject attributes")); + return -1; + } + +--- 966,973 ---- + { + if (val == NULL) + { +! PyErr_SetString(PyExc_AttributeError, +! _("cannot delete vim.Dictionary attributes")); + return -1; + } + +*************** +*** 926,932 **** + { + if (self->dict->dv_lock == VAR_FIXED) + { +! PyErr_SetString(PyExc_TypeError, _("Cannot modify fixed dictionary")); + return -1; + } + else +--- 975,981 ---- + { + if (self->dict->dv_lock == VAR_FIXED) + { +! PyErr_SetString(PyExc_TypeError, _("cannot modify fixed dictionary")); + return -1; + } + else +*************** +*** 943,949 **** + } + else + { +! PyErr_SetString(PyExc_AttributeError, _("Cannot set this attribute")); + return -1; + } + } +--- 992,998 ---- + } + else + { +! PyErr_SetString(PyExc_AttributeError, _("cannot set this attribute")); + return -1; + } + } +*************** +*** 954,979 **** + return ((PyInt) (self->dict->dv_hashtab.ht_used)); + } + + static PyObject * +! DictionaryItem(DictionaryObject *self, PyObject *keyObject) + { + char_u *key; + dictitem_T *di; + DICTKEY_DECL + + DICTKEY_GET(NULL, 0) + +! di = dict_find(self->dict, key, -1); + + DICTKEY_UNREF + +! if (di == NULL) + { +! PyErr_SetObject(PyExc_KeyError, keyObject); + return NULL; + } + +! return ConvertToPyObject(&di->di_tv); + } + + static PyInt +--- 1003,1172 ---- + return ((PyInt) (self->dict->dv_hashtab.ht_used)); + } + ++ #define DICT_FLAG_HAS_DEFAULT 0x01 ++ #define DICT_FLAG_POP 0x02 ++ #define DICT_FLAG_NONE_DEFAULT 0x04 ++ #define DICT_FLAG_RETURN_BOOL 0x08 /* Incompatible with DICT_FLAG_POP */ ++ #define DICT_FLAG_RETURN_PAIR 0x10 ++ + static PyObject * +! _DictionaryItem(DictionaryObject *self, PyObject *args, int flags) + { ++ PyObject *keyObject; ++ PyObject *defObject = ((flags & DICT_FLAG_NONE_DEFAULT)? Py_None : NULL); ++ PyObject *r; + char_u *key; + dictitem_T *di; ++ dict_T *dict = self->dict; ++ hashitem_T *hi; ++ + DICTKEY_DECL + ++ if (flags & DICT_FLAG_HAS_DEFAULT) ++ { ++ if (!PyArg_ParseTuple(args, "O|O", &keyObject, &defObject)) ++ return NULL; ++ } ++ else ++ keyObject = args; ++ ++ if (flags & DICT_FLAG_RETURN_BOOL) ++ defObject = Py_False; ++ + DICTKEY_GET(NULL, 0) + +! hi = hash_find(&dict->dv_hashtab, key); + + DICTKEY_UNREF + +! if (HASHITEM_EMPTY(hi)) + { +! if (defObject) +! { +! Py_INCREF(defObject); +! return defObject; +! } +! else +! { +! PyErr_SetObject(PyExc_KeyError, keyObject); +! return NULL; +! } +! } +! else if (flags & DICT_FLAG_RETURN_BOOL) +! { +! Py_INCREF(Py_True); +! return Py_True; +! } +! +! di = dict_lookup(hi); +! +! if (!(r = ConvertToPyObject(&di->di_tv))) + return NULL; ++ ++ if (flags & DICT_FLAG_POP) ++ { ++ if (dict->dv_lock) ++ { ++ PyErr_SetVim(_("dict is locked")); ++ Py_DECREF(r); ++ return NULL; ++ } ++ ++ hash_remove(&dict->dv_hashtab, hi); ++ dictitem_free(di); + } + +! if (flags & DICT_FLAG_RETURN_PAIR) +! { +! PyObject *tmp = r; +! +! if (!(r = Py_BuildValue("(" Py_bytes_fmt "O)", hi->hi_key, tmp))) +! { +! Py_DECREF(tmp); +! return NULL; +! } +! } +! +! return r; +! } +! +! static PyObject * +! DictionaryItem(DictionaryObject *self, PyObject *keyObject) +! { +! return _DictionaryItem(self, keyObject, 0); +! } +! +! static int +! DictionaryContains(DictionaryObject *self, PyObject *keyObject) +! { +! PyObject *rObj = _DictionaryItem(self, keyObject, DICT_FLAG_RETURN_BOOL); +! int r; +! +! r = (rObj == Py_True); +! +! Py_DECREF(Py_True); +! +! return r; +! } +! +! typedef struct +! { +! hashitem_T *ht_array; +! long_u ht_used; +! hashtab_T *ht; +! hashitem_T *hi; +! int todo; +! } dictiterinfo_T; +! +! static PyObject * +! DictionaryIterNext(dictiterinfo_T **dii) +! { +! PyObject *r; +! +! if (!(*dii)->todo) +! return NULL; +! +! if ((*dii)->ht->ht_array != (*dii)->ht_array || +! (*dii)->ht->ht_used != (*dii)->ht_used) +! { +! PyErr_SetString(PyExc_RuntimeError, +! _("hashtab changed during iteration")); +! return NULL; +! } +! +! while (((*dii)->todo) && HASHITEM_EMPTY((*dii)->hi)) +! ++((*dii)->hi); +! +! --((*dii)->todo); +! +! if (!(r = PyBytes_FromString((char *) (*dii)->hi->hi_key))) +! return NULL; +! +! return r; +! } +! +! static PyObject * +! DictionaryIter(DictionaryObject *self) +! { +! dictiterinfo_T *dii; +! hashtab_T *ht; +! +! if (!(dii = PyMem_New(dictiterinfo_T, 1))) +! { +! PyErr_NoMemory(); +! return NULL; +! } +! +! ht = &self->dict->dv_hashtab; +! dii->ht_array = ht->ht_array; +! dii->ht_used = ht->ht_used; +! dii->ht = ht; +! dii->hi = dii->ht_array; +! dii->todo = dii->ht_used; +! +! return IterNew(dii, +! (destructorfun) PyMem_Free, (nextfun) DictionaryIterNext, +! NULL, NULL); + } + + static PyInt +*************** +*** 1016,1033 **** + + if (di == NULL) + { +! di = dictitem_alloc(key); +! if (di == NULL) + { + PyErr_NoMemory(); + return -1; + } + di->di_tv.v_lock = 0; + + if (dict_add(dict, di) == FAIL) + { + DICTKEY_UNREF + vim_free(di); + PyErr_SetVim(_("failed to add key to dictionary")); + return -1; + } +--- 1209,1227 ---- + + if (di == NULL) + { +! if (!(di = dictitem_alloc(key))) + { + PyErr_NoMemory(); + return -1; + } + di->di_tv.v_lock = 0; ++ di->di_tv.v_type = VAR_UNKNOWN; + + if (dict_add(dict, di) == FAIL) + { + DICTKEY_UNREF + vim_free(di); ++ dictitem_free(di); + PyErr_SetVim(_("failed to add key to dictionary")); + return -1; + } +*************** +*** 1042,1062 **** + return 0; + } + + static PyObject * +! DictionaryListKeys(DictionaryObject *self) + { + dict_T *dict = self->dict; + long_u todo = dict->dv_hashtab.ht_used; + Py_ssize_t i = 0; + PyObject *r; + hashitem_T *hi; + + r = PyList_New(todo); + for (hi = dict->dv_hashtab.ht_array; todo > 0; ++hi) + { + if (!HASHITEM_EMPTY(hi)) + { +! PyList_SetItem(r, i, PyBytes_FromString((char *)(hi->hi_key))); + --todo; + ++i; + } +--- 1236,1269 ---- + return 0; + } + ++ typedef PyObject *(*hi_to_py)(hashitem_T *); ++ + static PyObject * +! DictionaryListObjects(DictionaryObject *self, hi_to_py hiconvert) + { + dict_T *dict = self->dict; + long_u todo = dict->dv_hashtab.ht_used; + Py_ssize_t i = 0; + PyObject *r; + hashitem_T *hi; ++ PyObject *newObj; + + r = PyList_New(todo); + for (hi = dict->dv_hashtab.ht_array; todo > 0; ++hi) + { + if (!HASHITEM_EMPTY(hi)) + { +! if (!(newObj = hiconvert(hi))) +! { +! Py_DECREF(r); +! return NULL; +! } +! if (PyList_SetItem(r, i, newObj)) +! { +! Py_DECREF(r); +! Py_DECREF(newObj); +! return NULL; +! } + --todo; + ++i; + } +*************** +*** 1064,1069 **** +--- 1271,1505 ---- + return r; + } + ++ static PyObject * ++ dict_key(hashitem_T *hi) ++ { ++ return PyBytes_FromString((char *)(hi->hi_key)); ++ } ++ ++ static PyObject * ++ DictionaryListKeys(DictionaryObject *self) ++ { ++ return DictionaryListObjects(self, dict_key); ++ } ++ ++ static PyObject * ++ dict_val(hashitem_T *hi) ++ { ++ dictitem_T *di; ++ ++ di = dict_lookup(hi); ++ return ConvertToPyObject(&di->di_tv); ++ } ++ ++ static PyObject * ++ DictionaryListValues(DictionaryObject *self) ++ { ++ return DictionaryListObjects(self, dict_val); ++ } ++ ++ static PyObject * ++ dict_item(hashitem_T *hi) ++ { ++ PyObject *keyObject; ++ PyObject *valObject; ++ PyObject *r; ++ ++ if (!(keyObject = dict_key(hi))) ++ return NULL; ++ ++ if (!(valObject = dict_val(hi))) ++ { ++ Py_DECREF(keyObject); ++ return NULL; ++ } ++ ++ r = Py_BuildValue("(OO)", keyObject, valObject); ++ ++ Py_DECREF(keyObject); ++ Py_DECREF(valObject); ++ ++ return r; ++ } ++ ++ static PyObject * ++ DictionaryListItems(DictionaryObject *self) ++ { ++ return DictionaryListObjects(self, dict_item); ++ } ++ ++ static PyObject * ++ DictionaryUpdate(DictionaryObject *self, PyObject *args, PyObject *kwargs) ++ { ++ dict_T *dict = self->dict; ++ ++ if (dict->dv_lock) ++ { ++ PyErr_SetVim(_("dict is locked")); ++ return NULL; ++ } ++ ++ if (kwargs) ++ { ++ typval_T tv; ++ ++ if (ConvertFromPyMapping(kwargs, &tv) == -1) ++ return NULL; ++ ++ VimTryStart(); ++ dict_extend(self->dict, tv.vval.v_dict, (char_u *) "force"); ++ clear_tv(&tv); ++ if (VimTryEnd()) ++ return NULL; ++ } ++ else ++ { ++ PyObject *object; ++ ++ if (!PyArg_Parse(args, "(O)", &object)) ++ return NULL; ++ ++ if (PyObject_HasAttrString(object, "keys")) ++ return DictionaryUpdate(self, NULL, object); ++ else ++ { ++ PyObject *iterator; ++ PyObject *item; ++ ++ if (!(iterator = PyObject_GetIter(object))) ++ return NULL; ++ ++ while ((item = PyIter_Next(iterator))) ++ { ++ PyObject *fast; ++ PyObject *keyObject; ++ PyObject *valObject; ++ PyObject *todecref; ++ char_u *key; ++ dictitem_T *di; ++ ++ if (!(fast = PySequence_Fast(item, ""))) ++ { ++ Py_DECREF(iterator); ++ Py_DECREF(item); ++ return NULL; ++ } ++ ++ Py_DECREF(item); ++ ++ if (PySequence_Fast_GET_SIZE(fast) != 2) ++ { ++ Py_DECREF(iterator); ++ Py_DECREF(fast); ++ PyErr_SetString(PyExc_ValueError, ++ _("expected sequence element of size 2")); ++ return NULL; ++ } ++ ++ keyObject = PySequence_Fast_GET_ITEM(fast, 0); ++ ++ if (!(key = StringToChars(keyObject, &todecref))) ++ { ++ Py_DECREF(iterator); ++ Py_DECREF(fast); ++ return NULL; ++ } ++ ++ di = dictitem_alloc(key); ++ ++ Py_XDECREF(todecref); ++ ++ if (di == NULL) ++ { ++ Py_DECREF(fast); ++ Py_DECREF(iterator); ++ PyErr_NoMemory(); ++ return NULL; ++ } ++ di->di_tv.v_lock = 0; ++ di->di_tv.v_type = VAR_UNKNOWN; ++ ++ valObject = PySequence_Fast_GET_ITEM(fast, 1); ++ ++ if (ConvertFromPyObject(valObject, &di->di_tv) == -1) ++ { ++ Py_DECREF(iterator); ++ Py_DECREF(fast); ++ dictitem_free(di); ++ return NULL; ++ } ++ ++ Py_DECREF(fast); ++ ++ if (dict_add(dict, di) == FAIL) ++ { ++ Py_DECREF(iterator); ++ dictitem_free(di); ++ PyErr_SetVim(_("failed to add key to dictionary")); ++ return NULL; ++ } ++ } ++ ++ Py_DECREF(iterator); ++ ++ /* Iterator may have finished due to an exception */ ++ if (PyErr_Occurred()) ++ return NULL; ++ } ++ } ++ Py_INCREF(Py_None); ++ return Py_None; ++ } ++ ++ static PyObject * ++ DictionaryGet(DictionaryObject *self, PyObject *args) ++ { ++ return _DictionaryItem(self, args, ++ DICT_FLAG_HAS_DEFAULT|DICT_FLAG_NONE_DEFAULT); ++ } ++ ++ static PyObject * ++ DictionaryPop(DictionaryObject *self, PyObject *args) ++ { ++ return _DictionaryItem(self, args, DICT_FLAG_HAS_DEFAULT|DICT_FLAG_POP); ++ } ++ ++ static PyObject * ++ DictionaryPopItem(DictionaryObject *self, PyObject *args) ++ { ++ PyObject *keyObject; ++ ++ if (!PyArg_ParseTuple(args, "O", &keyObject)) ++ return NULL; ++ ++ return _DictionaryItem(self, keyObject, ++ DICT_FLAG_POP|DICT_FLAG_RETURN_PAIR); ++ } ++ ++ static PyObject * ++ DictionaryHasKey(DictionaryObject *self, PyObject *args) ++ { ++ PyObject *keyObject; ++ ++ if (!PyArg_ParseTuple(args, "O", &keyObject)) ++ return NULL; ++ ++ return _DictionaryItem(self, keyObject, DICT_FLAG_RETURN_BOOL); ++ } ++ ++ static PySequenceMethods DictionaryAsSeq = { ++ 0, /* sq_length */ ++ 0, /* sq_concat */ ++ 0, /* sq_repeat */ ++ 0, /* sq_item */ ++ 0, /* sq_slice */ ++ 0, /* sq_ass_item */ ++ 0, /* sq_ass_slice */ ++ (objobjproc) DictionaryContains, /* sq_contains */ ++ 0, /* sq_inplace_concat */ ++ 0, /* sq_inplace_repeat */ ++ }; ++ + static PyMappingMethods DictionaryAsMapping = { + (lenfunc) DictionaryLength, + (binaryfunc) DictionaryItem, +*************** +*** 1072,1077 **** +--- 1508,1520 ---- + + static struct PyMethodDef DictionaryMethods[] = { + {"keys", (PyCFunction)DictionaryListKeys, METH_NOARGS, ""}, ++ {"values", (PyCFunction)DictionaryListValues, METH_NOARGS, ""}, ++ {"items", (PyCFunction)DictionaryListItems, METH_NOARGS, ""}, ++ {"update", (PyCFunction)DictionaryUpdate, METH_VARARGS|METH_KEYWORDS, ""}, ++ {"get", (PyCFunction)DictionaryGet, METH_VARARGS, ""}, ++ {"pop", (PyCFunction)DictionaryPop, METH_VARARGS, ""}, ++ {"popitem", (PyCFunction)DictionaryPopItem, METH_VARARGS, ""}, ++ {"has_key", (PyCFunction)DictionaryHasKey, METH_VARARGS, ""}, + {"__dir__", (PyCFunction)DictionaryDir, METH_NOARGS, ""}, + { NULL, NULL, 0, NULL} + }; +*************** +*** 1541,1554 **** + selfdictObject = PyDict_GetItemString(kwargs, "self"); + if (selfdictObject != NULL) + { +! if (!PyMapping_Check(selfdictObject)) +! { +! PyErr_SetString(PyExc_TypeError, +! _("'self' argument must be a dictionary")); +! clear_tv(&args); +! return NULL; +! } +! if (ConvertFromPyObject(selfdictObject, &selfdicttv) == -1) + { + clear_tv(&args); + return NULL; +--- 1984,1990 ---- + selfdictObject = PyDict_GetItemString(kwargs, "self"); + if (selfdictObject != NULL) + { +! if (ConvertFromPyMapping(selfdictObject, &selfdicttv) == -1) + { + clear_tv(&args); + return NULL; +*************** +*** 1994,2000 **** + else if (strcmp(name, "number") == 0) + return PyLong_FromLong((long) get_tab_number(self->tab)); + else if (strcmp(name, "vars") == 0) +! return DictionaryNew(self->tab->tp_vars); + else if (strcmp(name, "window") == 0) + { + /* For current tab window.c does not bother to set or update tp_curwin +--- 2430,2436 ---- + else if (strcmp(name, "number") == 0) + return PyLong_FromLong((long) get_tab_number(self->tab)); + else if (strcmp(name, "vars") == 0) +! return NEW_DICTIONARY(self->tab->tp_vars); + else if (strcmp(name, "window") == 0) + { + /* For current tab window.c does not bother to set or update tp_curwin +*************** +*** 2225,2231 **** + return PyLong_FromLong((long)(W_WINCOL(self->win))); + #endif + else if (strcmp(name, "vars") == 0) +! return DictionaryNew(self->win->w_vars); + else if (strcmp(name, "options") == 0) + return OptionsNew(SREQ_WIN, self->win, (checkfun) CheckWindow, + (PyObject *) self); +--- 2661,2667 ---- + return PyLong_FromLong((long)(W_WINCOL(self->win))); + #endif + else if (strcmp(name, "vars") == 0) +! return NEW_DICTIONARY(self->win->w_vars); + else if (strcmp(name, "options") == 0) + return OptionsNew(SREQ_WIN, self->win, (checkfun) CheckWindow, + (PyObject *) self); +*************** +*** 3402,3408 **** + else if (strcmp(name, "number") == 0) + return Py_BuildValue(Py_ssize_t_fmt, self->buf->b_fnum); + else if (strcmp(name, "vars") == 0) +! return DictionaryNew(self->buf->b_vars); + else if (strcmp(name, "options") == 0) + return OptionsNew(SREQ_BUF, self->buf, (checkfun) CheckBuffer, + (PyObject *) self); +--- 3838,3844 ---- + else if (strcmp(name, "number") == 0) + return Py_BuildValue(Py_ssize_t_fmt, self->buf->b_fnum); + else if (strcmp(name, "vars") == 0) +! return NEW_DICTIONARY(self->buf->b_vars); + else if (strcmp(name, "options") == 0) + return OptionsNew(SREQ_BUF, self->buf, (checkfun) CheckBuffer, + (PyObject *) self); +*************** +*** 4307,4312 **** +--- 4743,4778 ---- + } + + static int ++ ConvertFromPyMapping(PyObject *obj, typval_T *tv) ++ { ++ PyObject *lookup_dict; ++ int r; ++ ++ if (!(lookup_dict = PyDict_New())) ++ return -1; ++ ++ if (PyType_IsSubtype(obj->ob_type, &DictionaryType)) ++ { ++ tv->v_type = VAR_DICT; ++ tv->vval.v_dict = (((DictionaryObject *)(obj))->dict); ++ ++tv->vval.v_dict->dv_refcount; ++ r = 0; ++ } ++ else if (PyDict_Check(obj)) ++ r = convert_dl(obj, tv, pydict_to_tv, lookup_dict); ++ else if (PyMapping_Check(obj)) ++ r = convert_dl(obj, tv, pymap_to_tv, lookup_dict); ++ else ++ { ++ PyErr_SetString(PyExc_TypeError, ++ _("unable to convert object to vim dictionary")); ++ r = -1; ++ } ++ Py_DECREF(lookup_dict); ++ return r; ++ } ++ ++ static int + ConvertFromPyObject(PyObject *obj, typval_T *tv) + { + PyObject *lookup_dict; +*************** +*** 4322,4328 **** + static int + _ConvertFromPyObject(PyObject *obj, typval_T *tv, PyObject *lookup_dict) + { +! if (obj->ob_type == &DictionaryType) + { + tv->v_type = VAR_DICT; + tv->vval.v_dict = (((DictionaryObject *)(obj))->dict); +--- 4788,4794 ---- + static int + _ConvertFromPyObject(PyObject *obj, typval_T *tv, PyObject *lookup_dict) + { +! if (PyType_IsSubtype(obj->ob_type, &DictionaryType)) + { + tv->v_type = VAR_DICT; + tv->vval.v_dict = (((DictionaryObject *)(obj))->dict); +*************** +*** 4437,4443 **** + case VAR_LIST: + return ListNew(tv->vval.v_list); + case VAR_DICT: +! return DictionaryNew(tv->vval.v_dict); + case VAR_FUNC: + return FunctionNew(tv->vval.v_string == NULL + ? (char_u *)"" : tv->vval.v_string); +--- 4903,4909 ---- + case VAR_LIST: + return ListNew(tv->vval.v_list); + case VAR_DICT: +! return NEW_DICTIONARY(tv->vval.v_dict); + case VAR_FUNC: + return FunctionNew(tv->vval.v_string == NULL + ? (char_u *)"" : tv->vval.v_string); +*************** +*** 4608,4617 **** + DictionaryType.tp_name = "vim.dictionary"; + DictionaryType.tp_basicsize = sizeof(DictionaryObject); + DictionaryType.tp_dealloc = (destructor)DictionaryDestructor; + DictionaryType.tp_as_mapping = &DictionaryAsMapping; +! DictionaryType.tp_flags = Py_TPFLAGS_DEFAULT; + DictionaryType.tp_doc = "dictionary pushing modifications to vim structure"; + DictionaryType.tp_methods = DictionaryMethods; + #if PY_MAJOR_VERSION >= 3 + DictionaryType.tp_getattro = (getattrofunc)DictionaryGetattro; + DictionaryType.tp_setattro = (setattrofunc)DictionarySetattro; +--- 5074,5087 ---- + DictionaryType.tp_name = "vim.dictionary"; + DictionaryType.tp_basicsize = sizeof(DictionaryObject); + DictionaryType.tp_dealloc = (destructor)DictionaryDestructor; ++ DictionaryType.tp_as_sequence = &DictionaryAsSeq; + DictionaryType.tp_as_mapping = &DictionaryAsMapping; +! DictionaryType.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE; + DictionaryType.tp_doc = "dictionary pushing modifications to vim structure"; + DictionaryType.tp_methods = DictionaryMethods; ++ DictionaryType.tp_iter = (getiterfunc)DictionaryIter; ++ DictionaryType.tp_new = (newfunc)DictionaryConstructor; ++ DictionaryType.tp_alloc = (allocfunc)PyType_GenericAlloc; + #if PY_MAJOR_VERSION >= 3 + DictionaryType.tp_getattro = (getattrofunc)DictionaryGetattro; + DictionaryType.tp_setattro = (setattrofunc)DictionarySetattro; +*************** +*** 4786,4793 **** + return -1; + ADD_OBJECT(m, "error", VimError); + +! ADD_CHECKED_OBJECT(m, "vars", DictionaryNew(&globvardict)); +! ADD_CHECKED_OBJECT(m, "vvars", DictionaryNew(&vimvardict)); + ADD_CHECKED_OBJECT(m, "options", + OptionsNew(SREQ_GLOBAL, NULL, dummy_check, NULL)); + return 0; +--- 5256,5263 ---- + return -1; + ADD_OBJECT(m, "error", VimError); + +! ADD_CHECKED_OBJECT(m, "vars", NEW_DICTIONARY(&globvardict)); +! ADD_CHECKED_OBJECT(m, "vvars", NEW_DICTIONARY(&vimvardict)); + ADD_CHECKED_OBJECT(m, "options", + OptionsNew(SREQ_GLOBAL, NULL, dummy_check, NULL)); + return 0; +*** ../vim-7.3.1060/src/if_python3.c 2013-05-30 12:40:36.000000000 +0200 +--- src/if_python3.c 2013-05-30 12:47:48.000000000 +0200 +*************** +*** 96,101 **** +--- 96,102 ---- + #define PyInt_FromLong(i) PyLong_FromLong(i) + #define PyInt_AsLong(obj) PyLong_AsLong(obj) + #define Py_ssize_t_fmt "n" ++ #define Py_bytes_fmt "y" + + #if defined(DYNAMIC_PYTHON3) || defined(PROTO) + +*************** +*** 149,154 **** +--- 150,156 ---- + # define PySequence_Check py3_PySequence_Check + # define PySequence_Size py3_PySequence_Size + # define PySequence_GetItem py3_PySequence_GetItem ++ # define PySequence_Fast py3_PySequence_Fast + # define PyTuple_Size py3_PyTuple_Size + # define PyTuple_GetItem py3_PyTuple_GetItem + # define PySlice_GetIndicesEx py3_PySlice_GetIndicesEx +*************** +*** 168,173 **** +--- 170,176 ---- + #undef PyRun_String + # define PyRun_String py3_PyRun_String + # define PyObject_GetAttrString py3_PyObject_GetAttrString ++ # define PyObject_HasAttrString py3_PyObject_HasAttrString + # define PyObject_SetAttrString py3_PyObject_SetAttrString + # define PyObject_CallFunctionObjArgs py3_PyObject_CallFunctionObjArgs + # define PyEval_GetLocals py3_PyEval_GetLocals +*************** +*** 269,274 **** +--- 272,278 ---- + static int (*py3_PySequence_Check)(PyObject *); + static Py_ssize_t (*py3_PySequence_Size)(PyObject *); + static PyObject* (*py3_PySequence_GetItem)(PyObject *, Py_ssize_t); ++ static PyObject* (*py3_PySequence_Fast)(PyObject *, const char *); + static Py_ssize_t (*py3_PyTuple_Size)(PyObject *); + static PyObject* (*py3_PyTuple_GetItem)(PyObject *, Py_ssize_t); + static int (*py3_PyMapping_Check)(PyObject *); +*************** +*** 282,287 **** +--- 286,292 ---- + static int (*py3_PyRun_SimpleString)(char *); + static PyObject* (*py3_PyRun_String)(char *, int, PyObject *, PyObject *); + static PyObject* (*py3_PyObject_GetAttrString)(PyObject *, const char *); ++ static int (*py3_PyObject_HasAttrString)(PyObject *, const char *); + static PyObject* (*py3_PyObject_SetAttrString)(PyObject *, const char *, PyObject *); + static PyObject* (*py3_PyObject_CallFunctionObjArgs)(PyObject *, ...); + static PyObject* (*py3_PyEval_GetGlobals)(); +*************** +*** 425,430 **** +--- 430,436 ---- + {"PySequence_Check", (PYTHON_PROC*)&py3_PySequence_Check}, + {"PySequence_Size", (PYTHON_PROC*)&py3_PySequence_Size}, + {"PySequence_GetItem", (PYTHON_PROC*)&py3_PySequence_GetItem}, ++ {"PySequence_Fast", (PYTHON_PROC*)&py3_PySequence_Fast}, + {"PyTuple_Size", (PYTHON_PROC*)&py3_PyTuple_Size}, + {"PyTuple_GetItem", (PYTHON_PROC*)&py3_PyTuple_GetItem}, + {"PySlice_GetIndicesEx", (PYTHON_PROC*)&py3_PySlice_GetIndicesEx}, +*************** +*** 435,440 **** +--- 441,447 ---- + {"PyRun_SimpleString", (PYTHON_PROC*)&py3_PyRun_SimpleString}, + {"PyRun_String", (PYTHON_PROC*)&py3_PyRun_String}, + {"PyObject_GetAttrString", (PYTHON_PROC*)&py3_PyObject_GetAttrString}, ++ {"PyObject_HasAttrString", (PYTHON_PROC*)&py3_PyObject_HasAttrString}, + {"PyObject_SetAttrString", (PYTHON_PROC*)&py3_PyObject_SetAttrString}, + {"PyObject_CallFunctionObjArgs", (PYTHON_PROC*)&py3_PyObject_CallFunctionObjArgs}, + {"PyEval_GetGlobals", (PYTHON_PROC*)&py3_PyEval_GetGlobals}, +*** ../vim-7.3.1060/src/if_python.c 2013-05-30 12:40:36.000000000 +0200 +--- src/if_python.c 2013-05-30 12:48:47.000000000 +0200 +*************** +*** 103,108 **** +--- 103,109 ---- + # define PyIntIntObjArgProc intintobjargproc + # define Py_ssize_t_fmt "i" + #endif ++ #define Py_bytes_fmt "s" + + /* Parser flags */ + #define single_input 256 +*************** +*** 187,192 **** +--- 188,194 ---- + # define PySequence_Check dll_PySequence_Check + # define PySequence_Size dll_PySequence_Size + # define PySequence_GetItem dll_PySequence_GetItem ++ # define PySequence_Fast dll_PySequence_Fast + # define PyTuple_Size dll_PyTuple_Size + # define PyTuple_GetItem dll_PyTuple_GetItem + # define PyTuple_Type (*dll_PyTuple_Type) +*************** +*** 207,212 **** +--- 209,215 ---- + # define PyRun_SimpleString dll_PyRun_SimpleString + # define PyRun_String dll_PyRun_String + # define PyObject_GetAttrString dll_PyObject_GetAttrString ++ # define PyObject_HasAttrString dll_PyObject_HasAttrString + # define PyObject_SetAttrString dll_PyObject_SetAttrString + # define PyObject_CallFunctionObjArgs dll_PyObject_CallFunctionObjArgs + # define PyString_AsString dll_PyString_AsString +*************** +*** 227,232 **** +--- 230,236 ---- + # define PySys_SetArgv dll_PySys_SetArgv + # define PyType_Type (*dll_PyType_Type) + # define PyType_Ready (*dll_PyType_Ready) ++ # define PyType_GenericAlloc dll_PyType_GenericAlloc + # define Py_BuildValue dll_Py_BuildValue + # define Py_FindMethod dll_Py_FindMethod + # define Py_InitModule4 dll_Py_InitModule4 +*************** +*** 318,323 **** +--- 322,328 ---- + static int (*dll_PySequence_Check)(PyObject *); + static PyInt(*dll_PySequence_Size)(PyObject *); + static PyObject*(*dll_PySequence_GetItem)(PyObject *, PyInt); ++ static PyObject*(*dll_PySequence_Fast)(PyObject *, const char *); + static PyInt(*dll_PyTuple_Size)(PyObject *); + static PyObject*(*dll_PyTuple_GetItem)(PyObject *, PyInt); + static PyTypeObject* dll_PyTuple_Type; +*************** +*** 336,341 **** +--- 341,347 ---- + static int(*dll_PyRun_SimpleString)(char *); + static PyObject *(*dll_PyRun_String)(char *, int, PyObject *, PyObject *); + static PyObject* (*dll_PyObject_GetAttrString)(PyObject *, const char *); ++ static int (*dll_PyObject_HasAttrString)(PyObject *, const char *); + static PyObject* (*dll_PyObject_SetAttrString)(PyObject *, const char *, PyObject *); + static PyObject* (*dll_PyObject_CallFunctionObjArgs)(PyObject *, ...); + static char*(*dll_PyString_AsString)(PyObject *); +*************** +*** 354,359 **** +--- 360,366 ---- + static int(*dll_PySys_SetArgv)(int, char **); + static PyTypeObject* dll_PyType_Type; + static int (*dll_PyType_Ready)(PyTypeObject *type); ++ static PyObject* (*dll_PyType_GenericAlloc)(PyTypeObject *type, PyInt nitems); + static PyObject*(*dll_Py_BuildValue)(char *, ...); + static PyObject*(*dll_Py_FindMethod)(struct PyMethodDef[], PyObject *, char *); + static PyObject*(*dll_Py_InitModule4)(char *, struct PyMethodDef *, char *, PyObject *, int); +*************** +*** 475,483 **** + {"PyList_SetItem", (PYTHON_PROC*)&dll_PyList_SetItem}, + {"PyList_Size", (PYTHON_PROC*)&dll_PyList_Size}, + {"PyList_Type", (PYTHON_PROC*)&dll_PyList_Type}, +- {"PySequence_GetItem", (PYTHON_PROC*)&dll_PySequence_GetItem}, + {"PySequence_Size", (PYTHON_PROC*)&dll_PySequence_Size}, + {"PySequence_Check", (PYTHON_PROC*)&dll_PySequence_Check}, + {"PyTuple_GetItem", (PYTHON_PROC*)&dll_PyTuple_GetItem}, + {"PyTuple_Size", (PYTHON_PROC*)&dll_PyTuple_Size}, + {"PyTuple_Type", (PYTHON_PROC*)&dll_PyTuple_Type}, +--- 482,491 ---- + {"PyList_SetItem", (PYTHON_PROC*)&dll_PyList_SetItem}, + {"PyList_Size", (PYTHON_PROC*)&dll_PyList_Size}, + {"PyList_Type", (PYTHON_PROC*)&dll_PyList_Type}, + {"PySequence_Size", (PYTHON_PROC*)&dll_PySequence_Size}, + {"PySequence_Check", (PYTHON_PROC*)&dll_PySequence_Check}, ++ {"PySequence_GetItem", (PYTHON_PROC*)&dll_PySequence_GetItem}, ++ {"PySequence_Fast", (PYTHON_PROC*)&dll_PySequence_Fast}, + {"PyTuple_GetItem", (PYTHON_PROC*)&dll_PyTuple_GetItem}, + {"PyTuple_Size", (PYTHON_PROC*)&dll_PyTuple_Size}, + {"PyTuple_Type", (PYTHON_PROC*)&dll_PyTuple_Type}, +*************** +*** 496,501 **** +--- 504,510 ---- + {"PyRun_SimpleString", (PYTHON_PROC*)&dll_PyRun_SimpleString}, + {"PyRun_String", (PYTHON_PROC*)&dll_PyRun_String}, + {"PyObject_GetAttrString", (PYTHON_PROC*)&dll_PyObject_GetAttrString}, ++ {"PyObject_HasAttrString", (PYTHON_PROC*)&dll_PyObject_HasAttrString}, + {"PyObject_SetAttrString", (PYTHON_PROC*)&dll_PyObject_SetAttrString}, + {"PyObject_CallFunctionObjArgs", (PYTHON_PROC*)&dll_PyObject_CallFunctionObjArgs}, + {"PyString_AsString", (PYTHON_PROC*)&dll_PyString_AsString}, +*************** +*** 514,519 **** +--- 523,529 ---- + {"PySys_SetArgv", (PYTHON_PROC*)&dll_PySys_SetArgv}, + {"PyType_Type", (PYTHON_PROC*)&dll_PyType_Type}, + {"PyType_Ready", (PYTHON_PROC*)&dll_PyType_Ready}, ++ {"PyType_GenericAlloc", (PYTHON_PROC*)&dll_PyType_GenericAlloc}, + {"Py_FindMethod", (PYTHON_PROC*)&dll_Py_FindMethod}, + {"Py_SetPythonHome", (PYTHON_PROC*)&dll_Py_SetPythonHome}, + {"Py_Initialize", (PYTHON_PROC*)&dll_Py_Initialize}, +*************** +*** 1116,1125 **** + (PyIntObjArgProc) BufferAssItem, /* sq_ass_item, x[i]=v */ + (PyIntIntObjArgProc) BufferAssSlice, /* sq_ass_slice, x[i:j]=v */ + (objobjproc) 0, +- #if PY_MAJOR_VERSION >= 2 + (binaryfunc) 0, + 0, +- #endif + }; + + /* Buffer object - Implementation +--- 1126,1133 ---- +*** ../vim-7.3.1060/src/proto/eval.pro 2013-05-30 12:35:48.000000000 +0200 +--- src/proto/eval.pro 2013-05-30 12:47:48.000000000 +0200 +*************** +*** 75,80 **** +--- 75,81 ---- + dictitem_T *dict_find __ARGS((dict_T *d, char_u *key, int len)); + char_u *get_dict_string __ARGS((dict_T *d, char_u *key, int save)); + long get_dict_number __ARGS((dict_T *d, char_u *key)); ++ void dict_extend __ARGS((dict_T *d1, dict_T *d2, char_u *action)); + char_u *get_function_name __ARGS((expand_T *xp, int idx)); + char_u *get_expr_name __ARGS((expand_T *xp, int idx)); + char_u *get_expanded_name __ARGS((char_u *name, int check)); +*** ../vim-7.3.1060/src/testdir/test86.in 2013-05-30 12:26:52.000000000 +0200 +--- src/testdir/test86.in 2013-05-30 12:47:48.000000000 +0200 +*************** +*** 31,46 **** + :" + :" Extending Dictionary directly with different types + :let d = {} +! :py d=vim.bindeval('d') +! :py d['1']='asd' +! :py d['b']=[1, 2, f] +! :py d['-1']={'a': 1} +! :let dkeys = [] +! :py dk=vim.bindeval('dkeys') +! :py dkeys=d.keys() +! :py dkeys.sort() +! :py dk.extend(dkeys) +! :$put =string(dkeys) + :for [key, val] in sort(items(d)) + : $put =string(key) . ' : ' . string(val) + : unlet key val +--- 31,52 ---- + :" + :" Extending Dictionary directly with different types + :let d = {} +! py << EOF +! d=vim.bindeval('d') +! d['1']='asd' +! d.update(b=[1, 2, f]) +! d.update((('-1', {'a': 1}),)) +! d.update({'0': -1}) +! dk = d.keys() +! dv = d.values() +! di = d.items() +! dk.sort(key=repr) +! dv.sort(key=repr) +! di.sort(key=repr) +! EOF +! :$put =pyeval('repr(dk)') +! :$put =substitute(pyeval('repr(dv)'),'0x\x\+','','g') +! :$put =substitute(pyeval('repr(di)'),'0x\x\+','','g') + :for [key, val] in sort(items(d)) + : $put =string(key) . ' : ' . string(val) + : unlet key val +*************** +*** 60,66 **** +--- 66,85 ---- + :$put =string(l) + :" + :py del d['-1'] ++ :$put =string(pyeval('d.get(''b'', 1)')) ++ :$put =string(pyeval('d.pop(''b'')')) ++ :$put =string(pyeval('d.get(''b'', 1)')) ++ :$put =string(pyeval('d.pop(''1'', 2)')) ++ :$put =string(pyeval('d.pop(''1'', 2)')) ++ :$put =pyeval('repr(d.has_key(''0''))') ++ :$put =pyeval('repr(d.has_key(''1''))') ++ :$put =pyeval('repr(''0'' in d)') ++ :$put =pyeval('repr(''1'' in d)') ++ :$put =pyeval('repr(list(iter(d)))') + :$put =string(d) ++ :$put =pyeval('repr(d.popitem(''0''))') ++ :$put =pyeval('repr(d.get(''0''))') ++ :$put =pyeval('repr(list(iter(d)))') + :" + :" removing items out of range: silently skip items that don't exist + :let l = [0, 1, 2, 3] +*************** +*** 198,203 **** +--- 217,225 ---- + em('d[""]=1') + em('d["a\\0b"]=1') + em('d[u"a\\0b"]=1') ++ ++ em('d.pop("abc")') ++ em('d.popitem("abc")') + EOF + :$put =messages + :unlet messages +*************** +*** 709,714 **** +--- 731,740 ---- + del o + EOF + :" ++ :" Test vim.*.__new__ ++ :$put =string(pyeval('vim.Dictionary({})')) ++ :$put =string(pyeval('vim.Dictionary(a=1)')) ++ :$put =string(pyeval('vim.Dictionary(((''a'', 1),))')) + :" + :" Test stdout/stderr + :redir => messages +*************** +*** 718,723 **** +--- 744,759 ---- + :py sys.stderr.writelines(iter('abc')) + :redir END + :$put =string(substitute(messages, '\d\+', '', 'g')) ++ :" Test subclassing ++ py << EOF ++ class DupDict(vim.Dictionary): ++ def __setitem__(self, key, value): ++ super(DupDict, self).__setitem__(key, value) ++ super(DupDict, self).__setitem__('dup_' + key, value) ++ dd = DupDict() ++ dd['a'] = 'b' ++ EOF ++ :$put =string(sort(keys(pyeval('dd')))) + :" + :" Test exceptions + :fun Exe(e) +*** ../vim-7.3.1060/src/testdir/test86.ok 2013-05-30 12:26:52.000000000 +0200 +--- src/testdir/test86.ok 2013-05-30 12:47:48.000000000 +0200 +*************** +*** 4,16 **** + Vim(put):E684: + [0, 'as''d', [1, 2, function('strlen'), {'a': 1}]] + [0, function('strlen'), [1, 2, function('strlen'), {'a': 1}]] +! ['-1', '1', 'b'] + '-1' : {'a': 1} + '1' : 'asd' + 'b' : [1, 2, function('strlen')] + [0, function('strlen')] + [3] +! {'1': 'asd', 'b': [1, 2, function('strlen')]} + [0, 1, 2, 3] + [0, 1, 2, 3] + [0, 1, 3] +--- 4,32 ---- + Vim(put):E684: + [0, 'as''d', [1, 2, function('strlen'), {'a': 1}]] + [0, function('strlen'), [1, 2, function('strlen'), {'a': 1}]] +! ['-1', '0', '1', 'b'] +! ['asd', -1L, , ] +! [('-1', ), ('0', -1L), ('1', 'asd'), ('b', )] + '-1' : {'a': 1} ++ '0' : -1 + '1' : 'asd' + 'b' : [1, 2, function('strlen')] + [0, function('strlen')] + [3] +! [1, 2, function('strlen')] +! [1, 2, function('strlen')] +! 1 +! 'asd' +! 2 +! True +! False +! True +! False +! ['0'] +! {'0': -1} +! ('', -1L) +! None +! [] + [0, 1, 2, 3] + [0, 1, 2, 3] + [0, 1, 3] +*************** +*** 44,49 **** +--- 60,67 ---- + ValueError + TypeError + TypeError ++ KeyError ++ KeyError + d : locked:0;scope:0 + dl : locked:1;scope:0 + v: : locked:2;scope:1 +*************** +*** 387,396 **** + window:__dir__,__members__,buffer,col,cursor,height,number,options,row,tabpage,valid,vars + tabpage:__dir__,__members__,number,valid,vars,window,windows + range:__dir__,__members__,append,end,start +! dictionary:__dir__,__members__,keys,locked,scope + list:__dir__,__members__,extend,locked + function:__call__,__dir__,__members__,softspace + output:__dir__,__members__,flush,softspace,write,writelines + ' + abcdef + line : +--- 405,417 ---- + window:__dir__,__members__,buffer,col,cursor,height,number,options,row,tabpage,valid,vars + tabpage:__dir__,__members__,number,valid,vars,window,windows + range:__dir__,__members__,append,end,start +! dictionary:__dir__,__members__,get,has_key,items,keys,locked,pop,popitem,scope,update,values + list:__dir__,__members__,extend,locked + function:__call__,__dir__,__members__,softspace + output:__dir__,__members__,flush,softspace,write,writelines ++ {} ++ {'a': 1} ++ {'a': 1} + ' + abcdef + line : +*************** +*** 398,403 **** +--- 419,425 ---- + abc + line : + abc' ++ ['a', 'dup_a'] + (, error('abc',)) + (, error('def',)) + (, error('ghi',)) +*** ../vim-7.3.1060/src/testdir/test87.in 2013-05-30 12:26:52.000000000 +0200 +--- src/testdir/test87.in 2013-05-30 12:47:48.000000000 +0200 +*************** +*** 26,41 **** + :" + :" Extending Dictionary directly with different types + :let d = {} +! :py3 d=vim.bindeval('d') +! :py3 d['1']='asd' +! :py3 d['b']=[1, 2, f] +! :py3 d['-1']={'a': 1} +! :let dkeys = [] +! :py3 dk=vim.bindeval('dkeys') +! :py3 dkeys=d.keys() +! :py3 dkeys.sort() +! :py3 dk+=dkeys +! :$put =string(dkeys) + :for [key, val] in sort(items(d)) + : $put =string(key) . ' : ' . string(val) + : unlet key val +--- 26,47 ---- + :" + :" Extending Dictionary directly with different types + :let d = {} +! py3 << EOF +! d=vim.bindeval('d') +! d['1']='asd' +! d.update(b=[1, 2, f]) +! d.update((('-1', {'a': 1}),)) +! d.update({'0': -1}) +! dk = d.keys() +! dv = d.values() +! di = d.items() +! dk.sort(key=repr) +! dv.sort(key=repr) +! di.sort(key=repr) +! EOF +! :$put =py3eval('repr(dk)') +! :$put =substitute(py3eval('repr(dv)'),'0x\x\+','','g') +! :$put =substitute(py3eval('repr(di)'),'0x\x\+','','g') + :for [key, val] in sort(items(d)) + : $put =string(key) . ' : ' . string(val) + : unlet key val +*************** +*** 55,61 **** +--- 61,80 ---- + :$put =string(l) + :" + :py3 del d['-1'] ++ :$put =string(py3eval('d.get(''b'', 1)')) ++ :$put =string(py3eval('d.pop(''b'')')) ++ :$put =string(py3eval('d.get(''b'', 1)')) ++ :$put =string(py3eval('d.pop(''1'', 2)')) ++ :$put =string(py3eval('d.pop(''1'', 2)')) ++ :$put =py3eval('repr(d.has_key(''0''))') ++ :$put =py3eval('repr(d.has_key(''1''))') ++ :$put =py3eval('repr(''0'' in d)') ++ :$put =py3eval('repr(''1'' in d)') ++ :$put =py3eval('repr(list(iter(d)))') + :$put =string(d) ++ :$put =py3eval('repr(d.popitem(''0''))') ++ :$put =py3eval('repr(d.get(''0''))') ++ :$put =py3eval('repr(list(iter(d)))') + :" + :" removing items out of range: silently skip items that don't exist + :let l = [0, 1, 2, 3] +*************** +*** 181,215 **** + :py3 < messages +*************** +*** 696,701 **** +--- 705,720 ---- + :py sys.stderr.writelines(iter('abc')) + :redir END + :$put =string(substitute(messages, '\d\+', '', 'g')) ++ :" Test subclassing ++ py3 << EOF ++ class DupDict(vim.Dictionary): ++ def __setitem__(self, key, value): ++ super(DupDict, self).__setitem__(key, value) ++ super(DupDict, self).__setitem__('dup_' + key, value) ++ dd = DupDict() ++ dd['a'] = 'b' ++ EOF ++ :$put =string(sort(keys(py3eval('dd')))) + :" + :" Test exceptions + :fun Exe(e) +*** ../vim-7.3.1060/src/testdir/test87.ok 2013-05-30 12:26:52.000000000 +0200 +--- src/testdir/test87.ok 2013-05-30 12:47:48.000000000 +0200 +*************** +*** 4,16 **** + Vim(put):E684: + [0, 'as''d', [1, 2, function('strlen'), {'a': 1}]] + [0, function('strlen'), [1, 2, function('strlen'), {'a': 1}]] +! ['-1', '1', 'b'] + '-1' : {'a': 1} + '1' : 'asd' + 'b' : [1, 2, function('strlen')] + [0, function('strlen')] + [3] +! {'1': 'asd', 'b': [1, 2, function('strlen')]} + [0, 1, 2, 3] + [0, 1, 2, 3] + [0, 1, 3] +--- 4,32 ---- + Vim(put):E684: + [0, 'as''d', [1, 2, function('strlen'), {'a': 1}]] + [0, function('strlen'), [1, 2, function('strlen'), {'a': 1}]] +! [b'-1', b'0', b'1', b'b'] +! [-1, , , b'asd'] +! [(b'-1', ), (b'0', -1), (b'1', b'asd'), (b'b', )] + '-1' : {'a': 1} ++ '0' : -1 + '1' : 'asd' + 'b' : [1, 2, function('strlen')] + [0, function('strlen')] + [3] +! [1, 2, function('strlen')] +! [1, 2, function('strlen')] +! 1 +! 'asd' +! 2 +! True +! False +! True +! False +! [b'0'] +! {'0': -1} +! (b'', -1) +! None +! [] + [0, 1, 2, 3] + [0, 1, 2, 3] + [0, 1, 3] +*************** +*** 44,49 **** +--- 60,67 ---- + ValueError + TypeError + TypeError ++ KeyError ++ KeyError + d : locked:0;scope:0 + dl : locked:1;scope:0 + v: : locked:2;scope:1 +*************** +*** 376,385 **** + window:__dir__,buffer,col,cursor,height,number,options,row,tabpage,valid,vars + tabpage:__dir__,number,valid,vars,window,windows + range:__dir__,append,end,start +! dictionary:__dir__,keys,locked,scope + list:__dir__,extend,locked + function:__call__,__dir__,softspace + output:__dir__,flush,softspace,write,writelines + ' + abcdef + line : +--- 394,406 ---- + window:__dir__,buffer,col,cursor,height,number,options,row,tabpage,valid,vars + tabpage:__dir__,number,valid,vars,window,windows + range:__dir__,append,end,start +! dictionary:__dir__,get,has_key,items,keys,locked,pop,popitem,scope,update,values + list:__dir__,extend,locked + function:__call__,__dir__,softspace + output:__dir__,flush,softspace,write,writelines ++ {} ++ {'a': 1} ++ {'a': 1} + ' + abcdef + line : +*************** +*** 387,392 **** +--- 408,414 ---- + abc + line : + abc' ++ ['a', 'dup_a'] + (, error('abc',)) + (, error('def',)) + (, error('ghi',)) +*** ../vim-7.3.1060/src/version.c 2013-05-30 12:43:50.000000000 +0200 +--- src/version.c 2013-05-30 12:59:48.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1061, + /**/ + +-- +How To Keep A Healthy Level Of Insanity: +4. Put your garbage can on your desk and label it "in". + + /// 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 /// diff --git a/7.3.1062 b/7.3.1062 new file mode 100644 index 0000000..dbc46f6 --- /dev/null +++ b/7.3.1062 @@ -0,0 +1,642 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1062 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1062 +Problem: Python: List is not standard. +Solution: Python patch 21: Add standard methods and fields. (ZyX) +Files: src/if_py_both.h, src/testdir/test86.in, src/testdir/test86.ok, + src/testdir/test87.in, src/testdir/test87.ok + + +*** ../vim-7.3.1061/src/if_py_both.h 2013-05-30 13:01:14.000000000 +0200 +--- src/if_py_both.h 2013-05-30 13:03:54.000000000 +0200 +*************** +*** 1530,1541 **** + pylinkedlist_T ref; + } ListObject; + + static PyObject * +! ListNew(list_T *list) + { + ListObject *self; + +! self = PyObject_NEW(ListObject, &ListType); + if (self == NULL) + return NULL; + self->list = list; +--- 1530,1543 ---- + pylinkedlist_T ref; + } ListObject; + ++ #define NEW_LIST(list) ListNew(&ListType, list) ++ + static PyObject * +! ListNew(PyTypeObject *subtype, list_T *list) + { + ListObject *self; + +! self = (ListObject *) subtype->tp_alloc(subtype, 0); + if (self == NULL) + return NULL; + self->list = list; +*************** +*** 1546,1589 **** + return (PyObject *)(self); + } + +! static void +! ListDestructor(ListObject *self) + { +! pyll_remove(&self->ref, &lastlist); +! list_unref(self->list); + +! DESTRUCTOR_FINISH(self); + } + + static int + list_py_concat(list_T *l, PyObject *obj, PyObject *lookup_dict) + { +! Py_ssize_t i; +! Py_ssize_t lsize = PySequence_Size(obj); +! PyObject *litem; + listitem_T *li; + +! for(i=0; ili_tv.v_lock = 0; + +! litem = PySequence_GetItem(obj, i); +! if (litem == NULL) +! return -1; +! if (_ConvertFromPyObject(litem, &li->li_tv, lookup_dict) == -1) + return -1; + + list_append(l, li); + } + return 0; + } + + static PyInt + ListLength(ListObject *self) + { +--- 1548,1663 ---- + return (PyObject *)(self); + } + +! static list_T * +! py_list_alloc() + { +! list_T *r; + +! if (!(r = list_alloc())) +! { +! PyErr_NoMemory(); +! return NULL; +! } +! ++r->lv_refcount; +! +! return r; + } + + static int + list_py_concat(list_T *l, PyObject *obj, PyObject *lookup_dict) + { +! PyObject *iterator; +! PyObject *item; + listitem_T *li; + +! if (!(iterator = PyObject_GetIter(obj))) +! return -1; +! +! while ((item = PyIter_Next(iterator))) + { +! if (!(li = listitem_alloc())) + { + PyErr_NoMemory(); ++ Py_DECREF(item); ++ Py_DECREF(iterator); + return -1; + } + li->li_tv.v_lock = 0; ++ li->li_tv.v_type = VAR_UNKNOWN; + +! if (_ConvertFromPyObject(item, &li->li_tv, lookup_dict) == -1) +! { +! Py_DECREF(item); +! Py_DECREF(iterator); +! listitem_free(li); + return -1; ++ } ++ ++ Py_DECREF(item); + + list_append(l, li); + } ++ ++ Py_DECREF(iterator); ++ ++ /* Iterator may have finished due to an exception */ ++ if (PyErr_Occurred()) ++ return -1; ++ + return 0; + } + ++ static PyObject * ++ ListConstructor(PyTypeObject *subtype, PyObject *args, PyObject *kwargs) ++ { ++ list_T *list; ++ PyObject *obj = NULL; ++ ++ if (kwargs) ++ { ++ PyErr_SetString(PyExc_TypeError, ++ _("list constructor does not accept keyword arguments")); ++ return NULL; ++ } ++ ++ if (!PyArg_ParseTuple(args, "|O", &obj)) ++ return NULL; ++ ++ if (!(list = py_list_alloc())) ++ return NULL; ++ ++ if (obj) ++ { ++ PyObject *lookup_dict; ++ ++ if (!(lookup_dict = PyDict_New())) ++ { ++ list_unref(list); ++ return NULL; ++ } ++ ++ if (list_py_concat(list, obj, lookup_dict) == -1) ++ { ++ Py_DECREF(lookup_dict); ++ list_unref(list); ++ return NULL; ++ } ++ ++ Py_DECREF(lookup_dict); ++ } ++ ++ return ListNew(subtype, list); ++ } ++ ++ static void ++ ListDestructor(ListObject *self) ++ { ++ pyll_remove(&self->ref, &lastlist); ++ list_unref(self->list); ++ ++ DESTRUCTOR_FINISH(self); ++ } ++ + static PyInt + ListLength(ListObject *self) + { +*************** +*** 1747,1753 **** + if (list_append_tv(l, &tv) == FAIL) + { + clear_tv(&tv); +! PyErr_SetVim(_("Failed to add item to list")); + return -1; + } + } +--- 1821,1827 ---- + if (list_append_tv(l, &tv) == FAIL) + { + clear_tv(&tv); +! PyErr_SetVim(_("failed to add item to list")); + return -1; + } + } +*************** +*** 1765,1777 **** + ListAssSlice(ListObject *self, Py_ssize_t first, Py_ssize_t last, PyObject *obj) + { + PyInt size = ListLength(self); +! Py_ssize_t i; +! Py_ssize_t lsize; +! PyObject *litem; + listitem_T *li; + listitem_T *next; + typval_T v; + list_T *l = self->list; + + if (l->lv_lock) + { +--- 1839,1851 ---- + ListAssSlice(ListObject *self, Py_ssize_t first, Py_ssize_t last, PyObject *obj) + { + PyInt size = ListLength(self); +! PyObject *iterator; +! PyObject *item; + listitem_T *li; + listitem_T *next; + typval_T v; + list_T *l = self->list; ++ PyInt i; + + if (l->lv_lock) + { +*************** +*** 1806,1826 **** + if (obj == NULL) + return 0; + +! if (!PyList_Check(obj)) +! { +! PyErr_SetString(PyExc_TypeError, _("can only assign lists to slice")); + return -1; +- } +- +- lsize = PyList_Size(obj); + +! for(i=0; ilv_refcount; +- +- return r; +- } +- + static int + pyseq_to_tv(PyObject *obj, typval_T *tv, PyObject *lookup_dict) + { +--- 4657,4662 ---- +*************** +*** 4627,4691 **** + return 0; + } + +- static int +- pyiter_to_tv(PyObject *obj, typval_T *tv, PyObject *lookup_dict) +- { +- PyObject *iterator; +- PyObject *item; +- list_T *l; +- listitem_T *li; +- +- if (!(l = py_list_alloc())) +- return -1; +- +- tv->vval.v_list = l; +- tv->v_type = VAR_LIST; +- +- if (!(iterator = PyObject_GetIter(obj))) +- { +- list_unref(l); +- return -1; +- } +- +- while ((item = PyIter_Next(iterator))) +- { +- li = listitem_alloc(); +- if (li == NULL) +- { +- list_unref(l); +- Py_DECREF(iterator); +- PyErr_NoMemory(); +- return -1; +- } +- li->li_tv.v_lock = 0; +- +- if (_ConvertFromPyObject(item, &li->li_tv, lookup_dict) == -1) +- { +- list_unref(l); +- listitem_free(li); +- Py_DECREF(item); +- Py_DECREF(iterator); +- return -1; +- } +- +- list_append(l, li); +- +- Py_DECREF(item); +- } +- +- Py_DECREF(iterator); +- +- /* Iterator may have finished due to an exception */ +- if (PyErr_Occurred()) +- { +- list_unref(l); +- return -1; +- } +- +- --l->lv_refcount; +- return 0; +- } +- + typedef int (*pytotvfunc)(PyObject *, typval_T *, PyObject *); + + static int +--- 4678,4683 ---- +*************** +*** 4866,4874 **** + tv->vval.v_float = (float_T) PyFloat_AsDouble(obj); + } + #endif +! else if (PyIter_Check(obj)) +! return convert_dl(obj, tv, pyiter_to_tv, lookup_dict); +! else if (PySequence_Check(obj)) + return convert_dl(obj, tv, pyseq_to_tv, lookup_dict); + else if (PyMapping_Check(obj)) + return convert_dl(obj, tv, pymap_to_tv, lookup_dict); +--- 4858,4864 ---- + tv->vval.v_float = (float_T) PyFloat_AsDouble(obj); + } + #endif +! else if (PyIter_Check(obj) || PySequence_Check(obj)) + return convert_dl(obj, tv, pyseq_to_tv, lookup_dict); + else if (PyMapping_Check(obj)) + return convert_dl(obj, tv, pymap_to_tv, lookup_dict); +*************** +*** 4901,4907 **** + return PyFloat_FromDouble((double) tv->vval.v_float); + #endif + case VAR_LIST: +! return ListNew(tv->vval.v_list); + case VAR_DICT: + return NEW_DICTIONARY(tv->vval.v_dict); + case VAR_FUNC: +--- 4891,4897 ---- + return PyFloat_FromDouble((double) tv->vval.v_float); + #endif + case VAR_LIST: +! return NEW_LIST(tv->vval.v_list); + case VAR_DICT: + return NEW_DICTIONARY(tv->vval.v_dict); + case VAR_FUNC: +*************** +*** 5096,5105 **** + ListType.tp_basicsize = sizeof(ListObject); + ListType.tp_as_sequence = &ListAsSeq; + ListType.tp_as_mapping = &ListAsMapping; +! ListType.tp_flags = Py_TPFLAGS_DEFAULT; + ListType.tp_doc = "list pushing modifications to vim structure"; + ListType.tp_methods = ListMethods; + ListType.tp_iter = (getiterfunc)ListIter; + #if PY_MAJOR_VERSION >= 3 + ListType.tp_getattro = (getattrofunc)ListGetattro; + ListType.tp_setattro = (setattrofunc)ListSetattro; +--- 5086,5097 ---- + ListType.tp_basicsize = sizeof(ListObject); + ListType.tp_as_sequence = &ListAsSeq; + ListType.tp_as_mapping = &ListAsMapping; +! ListType.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE; + ListType.tp_doc = "list pushing modifications to vim structure"; + ListType.tp_methods = ListMethods; + ListType.tp_iter = (getiterfunc)ListIter; ++ ListType.tp_new = (newfunc)ListConstructor; ++ ListType.tp_alloc = (allocfunc)PyType_GenericAlloc; + #if PY_MAJOR_VERSION >= 3 + ListType.tp_getattro = (getattrofunc)ListGetattro; + ListType.tp_setattro = (setattrofunc)ListSetattro; +*** ../vim-7.3.1061/src/testdir/test86.in 2013-05-30 13:01:14.000000000 +0200 +--- src/testdir/test86.in 2013-05-30 13:03:54.000000000 +0200 +*************** +*** 735,740 **** +--- 735,742 ---- + :$put =string(pyeval('vim.Dictionary({})')) + :$put =string(pyeval('vim.Dictionary(a=1)')) + :$put =string(pyeval('vim.Dictionary(((''a'', 1),))')) ++ :$put =string(pyeval('vim.List()')) ++ :$put =string(pyeval('vim.List(iter(''abc''))')) + :" + :" Test stdout/stderr + :redir => messages +*************** +*** 752,759 **** +--- 754,771 ---- + super(DupDict, self).__setitem__('dup_' + key, value) + dd = DupDict() + dd['a'] = 'b' ++ ++ class DupList(vim.List): ++ def __getitem__(self, idx): ++ return [super(DupList, self).__getitem__(idx)] * 2 ++ ++ dl = DupList() ++ dl2 = DupList(iter('abc')) ++ dl.extend(dl2[0]) + EOF + :$put =string(sort(keys(pyeval('dd')))) ++ :$put =string(pyeval('dl')) ++ :$put =string(pyeval('dl2')) + :" + :" Test exceptions + :fun Exe(e) +*** ../vim-7.3.1061/src/testdir/test86.ok 2013-05-30 13:01:14.000000000 +0200 +--- src/testdir/test86.ok 2013-05-30 13:03:54.000000000 +0200 +*************** +*** 412,417 **** +--- 412,419 ---- + {} + {'a': 1} + {'a': 1} ++ [] ++ ['a', 'b', 'c'] + ' + abcdef + line : +*************** +*** 420,425 **** +--- 422,429 ---- + line : + abc' + ['a', 'dup_a'] ++ ['a', 'a'] ++ ['a', 'b', 'c'] + (, error('abc',)) + (, error('def',)) + (, error('ghi',)) +*** ../vim-7.3.1061/src/testdir/test87.in 2013-05-30 13:01:14.000000000 +0200 +--- src/testdir/test87.in 2013-05-30 13:03:54.000000000 +0200 +*************** +*** 692,701 **** + del o + EOF + :" +! :" Test vim.Dictionary.__new__ + :$put =string(py3eval('vim.Dictionary({})')) + :$put =string(py3eval('vim.Dictionary(a=1)')) + :$put =string(py3eval('vim.Dictionary(((''a'', 1),))')) + :" + :" Test stdout/stderr + :redir => messages +--- 692,703 ---- + del o + EOF + :" +! :" Test vim.*.__new__ + :$put =string(py3eval('vim.Dictionary({})')) + :$put =string(py3eval('vim.Dictionary(a=1)')) + :$put =string(py3eval('vim.Dictionary(((''a'', 1),))')) ++ :$put =string(py3eval('vim.List()')) ++ :$put =string(py3eval('vim.List(iter(''abc''))')) + :" + :" Test stdout/stderr + :redir => messages +*************** +*** 713,720 **** +--- 715,732 ---- + super(DupDict, self).__setitem__('dup_' + key, value) + dd = DupDict() + dd['a'] = 'b' ++ ++ class DupList(vim.List): ++ def __getitem__(self, idx): ++ return [super(DupList, self).__getitem__(idx)] * 2 ++ ++ dl = DupList() ++ dl2 = DupList(iter('abc')) ++ dl.extend(dl2[0]) + EOF + :$put =string(sort(keys(py3eval('dd')))) ++ :$put =string(py3eval('dl')) ++ :$put =string(py3eval('dl2')) + :" + :" Test exceptions + :fun Exe(e) +*** ../vim-7.3.1061/src/testdir/test87.ok 2013-05-30 13:01:14.000000000 +0200 +--- src/testdir/test87.ok 2013-05-30 13:03:54.000000000 +0200 +*************** +*** 401,406 **** +--- 401,408 ---- + {} + {'a': 1} + {'a': 1} ++ [] ++ ['a', 'b', 'c'] + ' + abcdef + line : +*************** +*** 409,414 **** +--- 411,418 ---- + line : + abc' + ['a', 'dup_a'] ++ ['a', 'a'] ++ ['a', 'b', 'c'] + (, error('abc',)) + (, error('def',)) + (, error('ghi',)) +*** ../vim-7.3.1061/src/version.c 2013-05-30 13:01:14.000000000 +0200 +--- src/version.c 2013-05-30 13:02:28.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1062, + /**/ + +-- +How To Keep A Healthy Level Of Insanity: +5. Put decaf in the coffee maker for 3 weeks. Once everyone has gotten + over their caffeine addictions, switch to espresso. + + /// 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 /// diff --git a/7.3.1063 b/7.3.1063 new file mode 100644 index 0000000..179b0b3 --- /dev/null +++ b/7.3.1063 @@ -0,0 +1,661 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1063 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1063 +Problem: Python: Function is not standard. +Solution: Python patch 22: make Function subclassable. (ZyX) +Files: src/eval.c, src/if_py_both.h, src/proto/eval.pro, + src/testdir/test86.in, src/testdir/test86.ok, + src/testdir/test87.in, src/testdir/test87.ok + + +*** ../vim-7.3.1062/src/eval.c 2013-05-30 13:01:14.000000000 +0200 +--- src/eval.c 2013-05-30 13:13:53.000000000 +0200 +*************** +*** 21933,21938 **** +--- 21933,21947 ---- + } + #endif + ++ int ++ translated_function_exists(name) ++ char_u *name; ++ { ++ if (builtin_function(name)) ++ return find_internal_func(name) >= 0; ++ return find_func(name) != NULL; ++ } ++ + /* + * Return TRUE if a function "name" exists. + */ +*************** +*** 21950,21961 **** + /* Only accept "funcname", "funcname ", "funcname (..." and + * "funcname(...", not "funcname!...". */ + if (p != NULL && (*nm == NUL || *nm == '(')) +! { +! if (builtin_function(p)) +! n = (find_internal_func(p) >= 0); +! else +! n = (find_func(p) != NULL); +! } + vim_free(p); + return n; + } +--- 21959,21965 ---- + /* Only accept "funcname", "funcname ", "funcname (..." and + * "funcname(...", not "funcname!...". */ + if (p != NULL && (*nm == NUL || *nm == '(')) +! n = translated_function_exists(p); + vim_free(p); + return n; + } +*************** +*** 21971,21988 **** + p = trans_function_name(&nm, FALSE, TFN_INT|TFN_QUIET, NULL); + + if (p != NULL && *nm == NUL) +! { +! if (!check) + return p; +! else if (builtin_function(p)) +! { +! if (find_internal_func(p) >= 0) +! return p; +! } +! else +! if (find_func(p) != NULL) +! return p; +! } + vim_free(p); + return NULL; + } +--- 21975,21983 ---- + p = trans_function_name(&nm, FALSE, TFN_INT|TFN_QUIET, NULL); + + if (p != NULL && *nm == NUL) +! if (!check || translated_function_exists(p)) + return p; +! + vim_free(p); + return NULL; + } +*** ../vim-7.3.1062/src/if_py_both.h 2013-05-30 13:05:55.000000000 +0200 +--- src/if_py_both.h 2013-05-30 13:08:09.000000000 +0200 +*************** +*** 1991,2020 **** + + static PyTypeObject FunctionType; + + static PyObject * +! FunctionNew(char_u *name) + { + FunctionObject *self; + +! self = PyObject_NEW(FunctionObject, &FunctionType); + if (self == NULL) + return NULL; +! self->name = PyMem_New(char_u, STRLEN(name) + 1); +! if (self->name == NULL) + { +! PyErr_NoMemory(); +! return NULL; + } +! STRCPY(self->name, name); +! func_ref(name); + return (PyObject *)(self); + } + + static void + FunctionDestructor(FunctionObject *self) + { + func_unref(self->name); +! PyMem_Free(self->name); + + DESTRUCTOR_FINISH(self); + } +--- 1991,2063 ---- + + static PyTypeObject FunctionType; + ++ #define NEW_FUNCTION(name) FunctionNew(&FunctionType, name) ++ + static PyObject * +! FunctionNew(PyTypeObject *subtype, char_u *name) + { + FunctionObject *self; + +! self = (FunctionObject *) subtype->tp_alloc(subtype, 0); +! + if (self == NULL) + return NULL; +! +! if (isdigit(*name)) + { +! if (!translated_function_exists(name)) +! { +! PyErr_SetString(PyExc_ValueError, +! _("unnamed function does not exist")); +! return NULL; +! } +! self->name = vim_strsave(name); +! func_ref(self->name); + } +! else +! { +! self->name = get_expanded_name(name, TRUE); +! if (self->name == NULL) +! { +! if (script_autoload(name, TRUE) && !aborting()) +! self->name = get_expanded_name(name, TRUE); +! if (self->name == NULL) +! { +! PyErr_SetString(PyExc_ValueError, _("function does not exist")); +! return NULL; +! } +! } +! } +! + return (PyObject *)(self); + } + ++ static PyObject * ++ FunctionConstructor(PyTypeObject *subtype, PyObject *args, PyObject *kwargs) ++ { ++ PyObject *self; ++ char_u *name; ++ ++ if (kwargs) ++ { ++ PyErr_SetString(PyExc_TypeError, ++ _("function constructor does not accept keyword arguments")); ++ return NULL; ++ } ++ ++ if (!PyArg_ParseTuple(args, "s", &name)) ++ return NULL; ++ ++ self = FunctionNew(subtype, name); ++ ++ return self; ++ } ++ + static void + FunctionDestructor(FunctionObject *self) + { + func_unref(self->name); +! vim_free(self->name); + + DESTRUCTOR_FINISH(self); + } +*************** +*** 2093,2099 **** + } + + static struct PyMethodDef FunctionMethods[] = { +- {"__call__",(PyCFunction)FunctionCall, METH_VARARGS|METH_KEYWORDS, ""}, + {"__dir__", (PyCFunction)FunctionDir, METH_NOARGS, ""}, + { NULL, NULL, 0, NULL} + }; +--- 2136,2141 ---- +*************** +*** 4895,4901 **** + case VAR_DICT: + return NEW_DICTIONARY(tv->vval.v_dict); + case VAR_FUNC: +! return FunctionNew(tv->vval.v_string == NULL + ? (char_u *)"" : tv->vval.v_string); + case VAR_UNKNOWN: + Py_INCREF(Py_None); +--- 4937,4943 ---- + case VAR_DICT: + return NEW_DICTIONARY(tv->vval.v_dict); + case VAR_FUNC: +! return NEW_FUNCTION(tv->vval.v_string == NULL + ? (char_u *)"" : tv->vval.v_string); + case VAR_UNKNOWN: + Py_INCREF(Py_None); +*************** +*** 5105,5114 **** + FunctionType.tp_basicsize = sizeof(FunctionObject); + FunctionType.tp_dealloc = (destructor)FunctionDestructor; + FunctionType.tp_call = (ternaryfunc)FunctionCall; +! FunctionType.tp_flags = Py_TPFLAGS_DEFAULT; + FunctionType.tp_doc = "object that calls vim function"; + FunctionType.tp_methods = FunctionMethods; + FunctionType.tp_repr = (reprfunc)FunctionRepr; + #if PY_MAJOR_VERSION >= 3 + FunctionType.tp_getattro = (getattrofunc)FunctionGetattro; + #else +--- 5147,5158 ---- + FunctionType.tp_basicsize = sizeof(FunctionObject); + FunctionType.tp_dealloc = (destructor)FunctionDestructor; + FunctionType.tp_call = (ternaryfunc)FunctionCall; +! FunctionType.tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE; + FunctionType.tp_doc = "object that calls vim function"; + FunctionType.tp_methods = FunctionMethods; + FunctionType.tp_repr = (reprfunc)FunctionRepr; ++ FunctionType.tp_new = (newfunc)FunctionConstructor; ++ FunctionType.tp_alloc = (allocfunc)PyType_GenericAlloc; + #if PY_MAJOR_VERSION >= 3 + FunctionType.tp_getattro = (getattrofunc)FunctionGetattro; + #else +*** ../vim-7.3.1062/src/proto/eval.pro 2013-05-30 13:01:14.000000000 +0200 +--- src/proto/eval.pro 2013-05-30 13:08:09.000000000 +0200 +*************** +*** 79,84 **** +--- 79,85 ---- + char_u *get_function_name __ARGS((expand_T *xp, int idx)); + char_u *get_expr_name __ARGS((expand_T *xp, int idx)); + char_u *get_expanded_name __ARGS((char_u *name, int check)); ++ int translated_function_exists __ARGS((char_u *name)); + int func_call __ARGS((char_u *name, typval_T *args, dict_T *selfdict, typval_T *rettv)); + void mzscheme_call_vim __ARGS((char_u *name, typval_T *args, typval_T *rettv)); + long do_searchpair __ARGS((char_u *spat, char_u *mpat, char_u *epat, int dir, char_u *skip, int flags, pos_T *match_pos, linenr_T lnum_stop, long time_limit)); +*** ../vim-7.3.1062/src/testdir/test86.in 2013-05-30 13:05:55.000000000 +0200 +--- src/testdir/test86.in 2013-05-30 13:08:09.000000000 +0200 +*************** +*** 31,36 **** +--- 31,39 ---- + :" + :" Extending Dictionary directly with different types + :let d = {} ++ :fun d.f() ++ : return 1 ++ :endfun + py << EOF + d=vim.bindeval('d') + d['1']='asd' +*************** +*** 44,55 **** + dv.sort(key=repr) + di.sort(key=repr) + EOF + :$put =pyeval('repr(dk)') + :$put =substitute(pyeval('repr(dv)'),'0x\x\+','','g') + :$put =substitute(pyeval('repr(di)'),'0x\x\+','','g') +! :for [key, val] in sort(items(d)) +! : $put =string(key) . ' : ' . string(val) +! : unlet key val + :endfor + :" + :" removing items with del +--- 47,59 ---- + dv.sort(key=repr) + di.sort(key=repr) + EOF ++ :$put =pyeval('d[''f''](self={})') + :$put =pyeval('repr(dk)') + :$put =substitute(pyeval('repr(dv)'),'0x\x\+','','g') + :$put =substitute(pyeval('repr(di)'),'0x\x\+','','g') +! :for [key, Val] in sort(items(d)) +! : $put =string(key) . ' : ' . string(Val) +! : unlet key Val + :endfor + :" + :" removing items with del +*************** +*** 66,71 **** +--- 70,76 ---- + :$put =string(l) + :" + :py del d['-1'] ++ :py del d['f'] + :$put =string(pyeval('d.get(''b'', 1)')) + :$put =string(pyeval('d.pop(''b'')')) + :$put =string(pyeval('d.get(''b'', 1)')) +*************** +*** 187,195 **** + :catch + : $put =v:exception[:16] + :endtry + :delfunction New + :try +! : py l[0](1, 2, 3) + :catch + : $put =v:exception[:16] + :endtry +--- 192,201 ---- + :catch + : $put =v:exception[:16] + :endtry ++ :py f=l[0] + :delfunction New + :try +! : py f(1, 2, 3) + :catch + : $put =v:exception[:16] + :endtry +*************** +*** 737,742 **** +--- 743,749 ---- + :$put =string(pyeval('vim.Dictionary(((''a'', 1),))')) + :$put =string(pyeval('vim.List()')) + :$put =string(pyeval('vim.List(iter(''abc''))')) ++ :$put =string(pyeval('vim.Function(''tr'')')) + :" + :" Test stdout/stderr + :redir => messages +*************** +*** 747,752 **** +--- 754,763 ---- + :redir END + :$put =string(substitute(messages, '\d\+', '', 'g')) + :" Test subclassing ++ :fun Put(...) ++ : $put =string(a:000) ++ : return a:000 ++ :endfun + py << EOF + class DupDict(vim.Dictionary): + def __setitem__(self, key, value): +*************** +*** 762,771 **** +--- 773,789 ---- + dl = DupList() + dl2 = DupList(iter('abc')) + dl.extend(dl2[0]) ++ ++ class DupFun(vim.Function): ++ def __call__(self, arg): ++ return super(DupFun, self).__call__(arg, arg) ++ ++ df = DupFun('Put') + EOF + :$put =string(sort(keys(pyeval('dd')))) + :$put =string(pyeval('dl')) + :$put =string(pyeval('dl2')) ++ :$put =string(pyeval('df(2)')) + :" + :" Test exceptions + :fun Exe(e) +*** ../vim-7.3.1062/src/testdir/test86.ok 2013-05-30 13:05:55.000000000 +0200 +--- src/testdir/test86.ok 2013-05-30 13:08:09.000000000 +0200 +*************** +*** 4,16 **** + Vim(put):E684: + [0, 'as''d', [1, 2, function('strlen'), {'a': 1}]] + [0, function('strlen'), [1, 2, function('strlen'), {'a': 1}]] +! ['-1', '0', '1', 'b'] +! ['asd', -1L, , ] +! [('-1', ), ('0', -1L), ('1', 'asd'), ('b', )] + '-1' : {'a': 1} + '0' : -1 + '1' : 'asd' + 'b' : [1, 2, function('strlen')] + [0, function('strlen')] + [3] + [1, 2, function('strlen')] +--- 4,18 ---- + Vim(put):E684: + [0, 'as''d', [1, 2, function('strlen'), {'a': 1}]] + [0, function('strlen'), [1, 2, function('strlen'), {'a': 1}]] +! 1 +! ['-1', '0', '1', 'b', 'f'] +! ['asd', -1L, , , ] +! [('-1', ), ('0', -1L), ('1', 'asd'), ('b', ), ('f', )] + '-1' : {'a': 1} + '0' : -1 + '1' : 'asd' + 'b' : [1, 2, function('strlen')] ++ 'f' : function('1') + [0, function('strlen')] + [3] + [1, 2, function('strlen')] +*************** +*** 407,419 **** + range:__dir__,__members__,append,end,start + dictionary:__dir__,__members__,get,has_key,items,keys,locked,pop,popitem,scope,update,values + list:__dir__,__members__,extend,locked +! function:__call__,__dir__,__members__,softspace + output:__dir__,__members__,flush,softspace,write,writelines + {} + {'a': 1} + {'a': 1} + [] + ['a', 'b', 'c'] + ' + abcdef + line : +--- 409,422 ---- + range:__dir__,__members__,append,end,start + dictionary:__dir__,__members__,get,has_key,items,keys,locked,pop,popitem,scope,update,values + list:__dir__,__members__,extend,locked +! function:__dir__,__members__,softspace + output:__dir__,__members__,flush,softspace,write,writelines + {} + {'a': 1} + {'a': 1} + [] + ['a', 'b', 'c'] ++ function('tr') + ' + abcdef + line : +*************** +*** 424,429 **** +--- 427,434 ---- + ['a', 'dup_a'] + ['a', 'a'] + ['a', 'b', 'c'] ++ [2, 2] ++ [2, 2] + (, error('abc',)) + (, error('def',)) + (, error('ghi',)) +*** ../vim-7.3.1062/src/testdir/test87.in 2013-05-30 13:05:55.000000000 +0200 +--- src/testdir/test87.in 2013-05-30 13:08:09.000000000 +0200 +*************** +*** 26,31 **** +--- 26,34 ---- + :" + :" Extending Dictionary directly with different types + :let d = {} ++ :fun d.f() ++ : return 1 ++ :endfun + py3 << EOF + d=vim.bindeval('d') + d['1']='asd' +*************** +*** 39,50 **** + dv.sort(key=repr) + di.sort(key=repr) + EOF + :$put =py3eval('repr(dk)') + :$put =substitute(py3eval('repr(dv)'),'0x\x\+','','g') + :$put =substitute(py3eval('repr(di)'),'0x\x\+','','g') +! :for [key, val] in sort(items(d)) +! : $put =string(key) . ' : ' . string(val) +! : unlet key val + :endfor + :" + :" removing items with del +--- 42,54 ---- + dv.sort(key=repr) + di.sort(key=repr) + EOF ++ :$put =py3eval('d[''f''](self={})') + :$put =py3eval('repr(dk)') + :$put =substitute(py3eval('repr(dv)'),'0x\x\+','','g') + :$put =substitute(py3eval('repr(di)'),'0x\x\+','','g') +! :for [key, Val] in sort(items(d)) +! : $put =string(key) . ' : ' . string(Val) +! : unlet key Val + :endfor + :" + :" removing items with del +*************** +*** 61,66 **** +--- 65,71 ---- + :$put =string(l) + :" + :py3 del d['-1'] ++ :py3 del d['f'] + :$put =string(py3eval('d.get(''b'', 1)')) + :$put =string(py3eval('d.pop(''b'')')) + :$put =string(py3eval('d.get(''b'', 1)')) +*************** +*** 182,190 **** + :catch + : $put =v:exception[:13] + :endtry + :delfunction New + :try +! : py3 l[0](1, 2, 3) + :catch + : $put =v:exception[:13] + :endtry +--- 187,196 ---- + :catch + : $put =v:exception[:13] + :endtry ++ :py3 f=l[0] + :delfunction New + :try +! : py3 f(1, 2, 3) + :catch + : $put =v:exception[:13] + :endtry +*************** +*** 698,703 **** +--- 704,710 ---- + :$put =string(py3eval('vim.Dictionary(((''a'', 1),))')) + :$put =string(py3eval('vim.List()')) + :$put =string(py3eval('vim.List(iter(''abc''))')) ++ :$put =string(py3eval('vim.Function(''tr'')')) + :" + :" Test stdout/stderr + :redir => messages +*************** +*** 708,713 **** +--- 715,724 ---- + :redir END + :$put =string(substitute(messages, '\d\+', '', 'g')) + :" Test subclassing ++ :fun Put(...) ++ : $put =string(a:000) ++ : return a:000 ++ :endfun + py3 << EOF + class DupDict(vim.Dictionary): + def __setitem__(self, key, value): +*************** +*** 723,732 **** +--- 734,750 ---- + dl = DupList() + dl2 = DupList(iter('abc')) + dl.extend(dl2[0]) ++ ++ class DupFun(vim.Function): ++ def __call__(self, arg): ++ return super(DupFun, self).__call__(arg, arg) ++ ++ df = DupFun('Put') + EOF + :$put =string(sort(keys(py3eval('dd')))) + :$put =string(py3eval('dl')) + :$put =string(py3eval('dl2')) ++ :$put =string(py3eval('df(2)')) + :" + :" Test exceptions + :fun Exe(e) +*** ../vim-7.3.1062/src/testdir/test87.ok 2013-05-30 13:05:55.000000000 +0200 +--- src/testdir/test87.ok 2013-05-30 13:08:09.000000000 +0200 +*************** +*** 4,16 **** + Vim(put):E684: + [0, 'as''d', [1, 2, function('strlen'), {'a': 1}]] + [0, function('strlen'), [1, 2, function('strlen'), {'a': 1}]] +! [b'-1', b'0', b'1', b'b'] +! [-1, , , b'asd'] +! [(b'-1', ), (b'0', -1), (b'1', b'asd'), (b'b', )] + '-1' : {'a': 1} + '0' : -1 + '1' : 'asd' + 'b' : [1, 2, function('strlen')] + [0, function('strlen')] + [3] + [1, 2, function('strlen')] +--- 4,18 ---- + Vim(put):E684: + [0, 'as''d', [1, 2, function('strlen'), {'a': 1}]] + [0, function('strlen'), [1, 2, function('strlen'), {'a': 1}]] +! 1 +! [b'-1', b'0', b'1', b'b', b'f'] +! [-1, , , , b'asd'] +! [(b'-1', ), (b'0', -1), (b'1', b'asd'), (b'b', ), (b'f', )] + '-1' : {'a': 1} + '0' : -1 + '1' : 'asd' + 'b' : [1, 2, function('strlen')] ++ 'f' : function('1') + [0, function('strlen')] + [3] + [1, 2, function('strlen')] +*************** +*** 396,408 **** + range:__dir__,append,end,start + dictionary:__dir__,get,has_key,items,keys,locked,pop,popitem,scope,update,values + list:__dir__,extend,locked +! function:__call__,__dir__,softspace + output:__dir__,flush,softspace,write,writelines + {} + {'a': 1} + {'a': 1} + [] + ['a', 'b', 'c'] + ' + abcdef + line : +--- 398,411 ---- + range:__dir__,append,end,start + dictionary:__dir__,get,has_key,items,keys,locked,pop,popitem,scope,update,values + list:__dir__,extend,locked +! function:__dir__,softspace + output:__dir__,flush,softspace,write,writelines + {} + {'a': 1} + {'a': 1} + [] + ['a', 'b', 'c'] ++ function('tr') + ' + abcdef + line : +*************** +*** 413,418 **** +--- 416,423 ---- + ['a', 'dup_a'] + ['a', 'a'] + ['a', 'b', 'c'] ++ [2, 2] ++ [2, 2] + (, error('abc',)) + (, error('def',)) + (, error('ghi',)) +*** ../vim-7.3.1062/src/version.c 2013-05-30 13:05:55.000000000 +0200 +--- src/version.c 2013-05-30 13:07:47.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1063, + /**/ + +-- +How To Keep A Healthy Level Of Insanity: +6. In the memo field of all your checks, write "for sexual favors". + + /// 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 /// diff --git a/7.3.1064 b/7.3.1064 new file mode 100644 index 0000000..c2e2749 --- /dev/null +++ b/7.3.1064 @@ -0,0 +1,192 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1064 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1064 +Problem: Python: insufficient error checking. +Solution: Python patch 23. (ZyX) +Files: src/if_py_both.h + + +*** ../vim-7.3.1063/src/if_py_both.h 2013-05-30 13:14:06.000000000 +0200 +--- src/if_py_both.h 2013-05-30 13:16:23.000000000 +0200 +*************** +*** 3304,3313 **** + + for (i = 0; i < new_len; ++i) + { +! PyObject *line = PyList_GetItem(list, i); + +! array[i] = StringToLine(line); +! if (array[i] == NULL) + { + while (i) + vim_free(array[--i]); +--- 3304,3313 ---- + + for (i = 0; i < new_len; ++i) + { +! PyObject *line; + +! if (!(line = PyList_GetItem(list, i)) || +! !(array[i] = StringToLine(line))) + { + while (i) + vim_free(array[--i]); +*************** +*** 3319,3325 **** + VimTryStart(); + PyErr_Clear(); + +! // START of region without "return". Must call restore_buffer()! + switch_buffer(&savebuf, buf); + + if (u_save((linenr_T)(lo-1), (linenr_T)hi) == FAIL) +--- 3319,3325 ---- + VimTryStart(); + PyErr_Clear(); + +! /* START of region without "return". Must call restore_buffer()! */ + switch_buffer(&savebuf, buf); + + if (u_save((linenr_T)(lo-1), (linenr_T)hi) == FAIL) +*************** +*** 3400,3406 **** + if (buf == savebuf) + py_fix_cursor((linenr_T)lo, (linenr_T)hi, (linenr_T)extra); + +! // END of region without "return". + restore_buffer(savebuf); + + if (VimTryEnd()) +--- 3400,3406 ---- + if (buf == savebuf) + py_fix_cursor((linenr_T)lo, (linenr_T)hi, (linenr_T)extra); + +! /* END of region without "return". */ + restore_buffer(savebuf); + + if (VimTryEnd()) +*************** +*** 3479,3488 **** + + for (i = 0; i < size; ++i) + { +! PyObject *line = PyList_GetItem(lines, i); +! array[i] = StringToLine(line); + +! if (array[i] == NULL) + { + while (i) + vim_free(array[--i]); +--- 3479,3488 ---- + + for (i = 0; i < size; ++i) + { +! PyObject *line; + +! if (!(line = PyList_GetItem(lines, i)) || +! !(array[i] = StringToLine(line))) + { + while (i) + vim_free(array[--i]); +*************** +*** 4014,4021 **** + + if (!PyArg_ParseTuple(args, "s", &pmark)) + return NULL; +- mark = *pmark; + + VimTryStart(); + switch_buffer(&savebuf, self->buf); + posp = getmark(mark, FALSE); +--- 4014,4028 ---- + + if (!PyArg_ParseTuple(args, "s", &pmark)) + return NULL; + ++ if (STRLEN(pmark) != 1) ++ { ++ PyErr_SetString(PyExc_ValueError, ++ _("mark name must be a single character")); ++ return NULL; ++ } ++ ++ mark = *pmark; + VimTryStart(); + switch_buffer(&savebuf, self->buf); + posp = getmark(mark, FALSE); +*************** +*** 4258,4264 **** + + if (value->ob_type != &BufferType) + { +! PyErr_SetString(PyExc_TypeError, _("expected vim.buffer object")); + return -1; + } + +--- 4265,4271 ---- + + if (value->ob_type != &BufferType) + { +! PyErr_SetString(PyExc_TypeError, _("expected vim.Buffer object")); + return -1; + } + +*************** +*** 4283,4289 **** + + if (value->ob_type != &WindowType) + { +! PyErr_SetString(PyExc_TypeError, _("expected vim.window object")); + return -1; + } + +--- 4290,4296 ---- + + if (value->ob_type != &WindowType) + { +! PyErr_SetString(PyExc_TypeError, _("expected vim.Window object")); + return -1; + } + +*************** +*** 4315,4321 **** + { + if (value->ob_type != &TabPageType) + { +! PyErr_SetString(PyExc_TypeError, _("expected vim.tabpage object")); + return -1; + } + +--- 4322,4328 ---- + { + if (value->ob_type != &TabPageType) + { +! PyErr_SetString(PyExc_TypeError, _("expected vim.TabPage object")); + return -1; + } + +*** ../vim-7.3.1063/src/version.c 2013-05-30 13:14:06.000000000 +0200 +--- src/version.c 2013-05-30 13:15:32.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1064, + /**/ + +-- +How To Keep A Healthy Level Of Insanity: +7. Finish all your sentences with "in accordance with the prophecy". + + /// 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 /// diff --git a/7.3.1065 b/7.3.1065 new file mode 100644 index 0000000..bb62400 --- /dev/null +++ b/7.3.1065 @@ -0,0 +1,381 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1065 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1065 +Problem: Python: key mapping is not standard. +Solution: Puthon patch 24: use PyMapping_Keys. (ZyX) +Files: src/if_py_both.h, src/if_python3.c, src/if_python.c + + +*** ../vim-7.3.1064/src/if_py_both.h 2013-05-30 13:17:13.000000000 +0200 +--- src/if_py_both.h 2013-05-30 13:19:50.000000000 +0200 +*************** +*** 4612,4621 **** + char_u *key; + dictitem_T *di; + PyObject *list; +! PyObject *litem; + PyObject *keyObject; + PyObject *valObject; +- Py_ssize_t lsize; + + if (!(dict = dict_alloc())) + return -1; +--- 4612,4620 ---- + char_u *key; + dictitem_T *di; + PyObject *list; +! PyObject *iterator; + PyObject *keyObject; + PyObject *valObject; + + if (!(dict = dict_alloc())) + return -1; +*************** +*** 4623,4683 **** + tv->v_type = VAR_DICT; + tv->vval.v_dict = dict; + +! list = PyMapping_Items(obj); +! if (list == NULL) + { + dict_unref(dict); + return -1; + } +- lsize = PyList_Size(list); +- while (lsize--) +- { +- DICTKEY_DECL + +! litem = PyList_GetItem(list, lsize); +! if (litem == NULL) +! { +! Py_DECREF(list); +! dict_unref(dict); +! return -1; +! } + +! if (!(keyObject = PyTuple_GetItem(litem, 0))) +! { +! Py_DECREF(list); +! Py_DECREF(litem); +! dict_unref(dict); +! return -1; +! } + + if (!DICTKEY_SET_KEY) + { + dict_unref(dict); +- Py_DECREF(list); +- Py_DECREF(litem); + DICTKEY_UNREF + return -1; + } + DICTKEY_CHECK_EMPTY(-1) + +! if (!(valObject = PyTuple_GetItem(litem, 1))) + { +! Py_DECREF(list); +! Py_DECREF(litem); + dict_unref(dict); + DICTKEY_UNREF + return -1; + } + +- Py_DECREF(litem); +- + di = dictitem_alloc(key); + + DICTKEY_UNREF + + if (di == NULL) + { +! Py_DECREF(list); + dict_unref(dict); + PyErr_NoMemory(); + return -1; +--- 4622,4673 ---- + tv->v_type = VAR_DICT; + tv->vval.v_dict = dict; + +! if (!(list = PyMapping_Keys(obj))) + { + dict_unref(dict); + return -1; + } + +! if (!(iterator = PyObject_GetIter(list))) +! { +! dict_unref(dict); +! Py_DECREF(list); +! return -1; +! } +! Py_DECREF(list); + +! while ((keyObject = PyIter_Next(iterator))) +! { +! DICTKEY_DECL + + if (!DICTKEY_SET_KEY) + { ++ Py_DECREF(iterator); + dict_unref(dict); + DICTKEY_UNREF + return -1; + } + DICTKEY_CHECK_EMPTY(-1) + +! if (!(valObject = PyObject_GetItem(obj, keyObject))) + { +! Py_DECREF(keyObject); +! Py_DECREF(iterator); + dict_unref(dict); + DICTKEY_UNREF + return -1; + } + + di = dictitem_alloc(key); + + DICTKEY_UNREF + ++ Py_DECREF(keyObject); ++ + if (di == NULL) + { +! Py_DECREF(iterator); +! Py_DECREF(valObject); + dict_unref(dict); + PyErr_NoMemory(); + return -1; +*************** +*** 4686,4708 **** + + if (_ConvertFromPyObject(valObject, &di->di_tv, lookup_dict) == -1) + { + vim_free(di); + dict_unref(dict); +- Py_DECREF(list); + return -1; + } + + if (dict_add(dict, di) == FAIL) + { + dictitem_free(di); + dict_unref(dict); +- Py_DECREF(list); + PyErr_SetVim(_("failed to add key to dictionary")); + return -1; + } + } + --dict->dv_refcount; +- Py_DECREF(list); + return 0; + } + +--- 4676,4701 ---- + + if (_ConvertFromPyObject(valObject, &di->di_tv, lookup_dict) == -1) + { ++ Py_DECREF(iterator); ++ Py_DECREF(valObject); + vim_free(di); + dict_unref(dict); + return -1; + } + ++ Py_DECREF(valObject); ++ + if (dict_add(dict, di) == FAIL) + { ++ Py_DECREF(iterator); + dictitem_free(di); + dict_unref(dict); + PyErr_SetVim(_("failed to add key to dictionary")); + return -1; + } + } ++ Py_DECREF(iterator); + --dict->dv_refcount; + return 0; + } + +*************** +*** 4907,4912 **** +--- 4900,4907 ---- + tv->vval.v_float = (float_T) PyFloat_AsDouble(obj); + } + #endif ++ else if (PyObject_HasAttrString(obj, "keys")) ++ return convert_dl(obj, tv, pymap_to_tv, lookup_dict); + else if (PyIter_Check(obj) || PySequence_Check(obj)) + return convert_dl(obj, tv, pyseq_to_tv, lookup_dict); + else if (PyMapping_Check(obj)) +*** ../vim-7.3.1064/src/if_python3.c 2013-05-30 13:01:14.000000000 +0200 +--- src/if_python3.c 2013-05-30 13:19:50.000000000 +0200 +*************** +*** 160,168 **** + # define PyDict_GetItemString py3_PyDict_GetItemString + # define PyDict_Next py3_PyDict_Next + # define PyMapping_Check py3_PyMapping_Check +! # define PyMapping_Items py3_PyMapping_Items + # define PyIter_Next py3_PyIter_Next + # define PyObject_GetIter py3_PyObject_GetIter + # define PyObject_IsTrue py3_PyObject_IsTrue + # define PyModule_GetDict py3_PyModule_GetDict + #undef PyRun_SimpleString +--- 160,169 ---- + # define PyDict_GetItemString py3_PyDict_GetItemString + # define PyDict_Next py3_PyDict_Next + # define PyMapping_Check py3_PyMapping_Check +! # define PyMapping_Keys py3_PyMapping_Keys + # define PyIter_Next py3_PyIter_Next + # define PyObject_GetIter py3_PyObject_GetIter ++ # define PyObject_GetItem py3_PyObject_GetItem + # define PyObject_IsTrue py3_PyObject_IsTrue + # define PyModule_GetDict py3_PyModule_GetDict + #undef PyRun_SimpleString +*************** +*** 276,282 **** + static Py_ssize_t (*py3_PyTuple_Size)(PyObject *); + static PyObject* (*py3_PyTuple_GetItem)(PyObject *, Py_ssize_t); + static int (*py3_PyMapping_Check)(PyObject *); +! static PyObject* (*py3_PyMapping_Items)(PyObject *); + static int (*py3_PySlice_GetIndicesEx)(PyObject *r, Py_ssize_t length, + Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, Py_ssize_t *slicelength); + static PyObject* (*py3_PyErr_NoMemory)(void); +--- 277,283 ---- + static Py_ssize_t (*py3_PyTuple_Size)(PyObject *); + static PyObject* (*py3_PyTuple_GetItem)(PyObject *, Py_ssize_t); + static int (*py3_PyMapping_Check)(PyObject *); +! static PyObject* (*py3_PyMapping_Keys)(PyObject *); + static int (*py3_PySlice_GetIndicesEx)(PyObject *r, Py_ssize_t length, + Py_ssize_t *start, Py_ssize_t *stop, Py_ssize_t *step, Py_ssize_t *slicelength); + static PyObject* (*py3_PyErr_NoMemory)(void); +*************** +*** 304,309 **** +--- 305,311 ---- + static PyObject* (*py3_PyDict_New)(void); + static PyObject* (*py3_PyIter_Next)(PyObject *); + static PyObject* (*py3_PyObject_GetIter)(PyObject *); ++ static PyObject* (*py3_PyObject_GetItem)(PyObject *, PyObject *); + static int (*py3_PyObject_IsTrue)(PyObject *); + static PyObject* (*py3_Py_BuildValue)(char *, ...); + static int (*py3_PyType_Ready)(PyTypeObject *type); +*************** +*** 456,464 **** + {"PyDict_GetItemString", (PYTHON_PROC*)&py3_PyDict_GetItemString}, + {"PyDict_Next", (PYTHON_PROC*)&py3_PyDict_Next}, + {"PyMapping_Check", (PYTHON_PROC*)&py3_PyMapping_Check}, +! {"PyMapping_Items", (PYTHON_PROC*)&py3_PyMapping_Items}, + {"PyIter_Next", (PYTHON_PROC*)&py3_PyIter_Next}, + {"PyObject_GetIter", (PYTHON_PROC*)&py3_PyObject_GetIter}, + {"PyObject_IsTrue", (PYTHON_PROC*)&py3_PyObject_IsTrue}, + {"PyLong_FromLong", (PYTHON_PROC*)&py3_PyLong_FromLong}, + {"PyDict_New", (PYTHON_PROC*)&py3_PyDict_New}, +--- 458,467 ---- + {"PyDict_GetItemString", (PYTHON_PROC*)&py3_PyDict_GetItemString}, + {"PyDict_Next", (PYTHON_PROC*)&py3_PyDict_Next}, + {"PyMapping_Check", (PYTHON_PROC*)&py3_PyMapping_Check}, +! {"PyMapping_Keys", (PYTHON_PROC*)&py3_PyMapping_Keys}, + {"PyIter_Next", (PYTHON_PROC*)&py3_PyIter_Next}, + {"PyObject_GetIter", (PYTHON_PROC*)&py3_PyObject_GetIter}, ++ {"PyObject_GetItem", (PYTHON_PROC*)&py3_PyObject_GetItem}, + {"PyObject_IsTrue", (PYTHON_PROC*)&py3_PyObject_IsTrue}, + {"PyLong_FromLong", (PYTHON_PROC*)&py3_PyLong_FromLong}, + {"PyDict_New", (PYTHON_PROC*)&py3_PyDict_New}, +*** ../vim-7.3.1064/src/if_python.c 2013-05-30 13:01:14.000000000 +0200 +--- src/if_python.c 2013-05-30 13:19:50.000000000 +0200 +*************** +*** 197,207 **** + # define PyDict_GetItemString dll_PyDict_GetItemString + # define PyDict_Next dll_PyDict_Next + # define PyDict_Type (*dll_PyDict_Type) +! # ifdef PyMapping_Items +! # define PY_NO_MAPPING_ITEMS + # else +! # define PyMapping_Items dll_PyMapping_Items + # endif + # define PyObject_CallMethod dll_PyObject_CallMethod + # define PyMapping_Check dll_PyMapping_Check + # define PyIter_Next dll_PyIter_Next +--- 197,208 ---- + # define PyDict_GetItemString dll_PyDict_GetItemString + # define PyDict_Next dll_PyDict_Next + # define PyDict_Type (*dll_PyDict_Type) +! # ifdef PyMapping_Keys +! # define PY_NO_MAPPING_KEYS + # else +! # define PyMapping_Keys dll_PyMapping_Keys + # endif ++ # define PyObject_GetItem dll_PyObject_GetItem + # define PyObject_CallMethod dll_PyObject_CallMethod + # define PyMapping_Check dll_PyMapping_Check + # define PyIter_Next dll_PyIter_Next +*************** +*** 331,339 **** + static PyObject*(*dll_PyDict_GetItemString)(PyObject *, const char *); + static int (*dll_PyDict_Next)(PyObject *, PyInt *, PyObject **, PyObject **); + static PyTypeObject* dll_PyDict_Type; +! # ifndef PY_NO_MAPPING_ITEMS +! static PyObject* (*dll_PyMapping_Items)(PyObject *); + # endif + static PyObject* (*dll_PyObject_CallMethod)(PyObject *, char *, PyObject *); + static int (*dll_PyMapping_Check)(PyObject *); + static PyObject* (*dll_PyIter_Next)(PyObject *); +--- 332,341 ---- + static PyObject*(*dll_PyDict_GetItemString)(PyObject *, const char *); + static int (*dll_PyDict_Next)(PyObject *, PyInt *, PyObject **, PyObject **); + static PyTypeObject* dll_PyDict_Type; +! # ifndef PY_NO_MAPPING_KEYS +! static PyObject* (*dll_PyMapping_Keys)(PyObject *); + # endif ++ static PyObject* (*dll_PyObject_GetItem)(PyObject *, PyObject *); + static PyObject* (*dll_PyObject_CallMethod)(PyObject *, char *, PyObject *); + static int (*dll_PyMapping_Check)(PyObject *); + static PyObject* (*dll_PyIter_Next)(PyObject *); +*************** +*** 494,502 **** + {"PyDict_Next", (PYTHON_PROC*)&dll_PyDict_Next}, + {"PyDict_New", (PYTHON_PROC*)&dll_PyDict_New}, + {"PyDict_Type", (PYTHON_PROC*)&dll_PyDict_Type}, +! # ifndef PY_NO_MAPPING_ITEMS +! {"PyMapping_Items", (PYTHON_PROC*)&dll_PyMapping_Items}, + # endif + {"PyObject_CallMethod", (PYTHON_PROC*)&dll_PyObject_CallMethod}, + {"PyMapping_Check", (PYTHON_PROC*)&dll_PyMapping_Check}, + {"PyIter_Next", (PYTHON_PROC*)&dll_PyIter_Next}, +--- 496,505 ---- + {"PyDict_Next", (PYTHON_PROC*)&dll_PyDict_Next}, + {"PyDict_New", (PYTHON_PROC*)&dll_PyDict_New}, + {"PyDict_Type", (PYTHON_PROC*)&dll_PyDict_Type}, +! # ifndef PY_NO_MAPPING_KEYS +! {"PyMapping_Keys", (PYTHON_PROC*)&dll_PyMapping_Keys}, + # endif ++ {"PyObject_GetItem", (PYTHON_PROC*)&dll_PyObject_GetItem}, + {"PyObject_CallMethod", (PYTHON_PROC*)&dll_PyObject_CallMethod}, + {"PyMapping_Check", (PYTHON_PROC*)&dll_PyMapping_Check}, + {"PyIter_Next", (PYTHON_PROC*)&dll_PyIter_Next}, +*** ../vim-7.3.1064/src/version.c 2013-05-30 13:17:13.000000000 +0200 +--- src/version.c 2013-05-30 13:19:32.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1065, + /**/ + +-- +How To Keep A Healthy Level Of Insanity: +8. Don't use any punctuation marks. + + /// 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 /// diff --git a/7.3.1066 b/7.3.1066 new file mode 100644 index 0000000..8bb89b5 --- /dev/null +++ b/7.3.1066 @@ -0,0 +1,1979 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1066 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1066 +Problem: Python: Insufficient exception and error testing. +Solution: Python patch 25. (ZyX) +Files: src/testdir/test86.in, src/testdir/test86.ok, + src/testdir/test87.in, src/testdir/test87.ok + + +*** ../vim-7.3.1065/src/testdir/test86.in 2013-05-30 13:14:06.000000000 +0200 +--- src/testdir/test86.in 2013-05-30 13:25:22.000000000 +0200 +*************** +*** 7,12 **** +--- 7,13 ---- + + STARTTEST + :so small.vim ++ :set encoding=latin1 + :if !has('python') | e! test.ok | wq! test.out | endif + :lang C + :py import vim +*************** +*** 785,800 **** + :$put =string(pyeval('dl2')) + :$put =string(pyeval('df(2)')) + :" +! :" Test exceptions +! :fun Exe(e) +! : execute a:e + :endfun + py << EOF + def ee(expr, g=globals(), l=locals()): + try: + exec(expr, g, l) + except: +! cb.append(repr(sys.exc_info()[:2])) + Exe = vim.bindeval('function("Exe")') + ee('vim.command("throw \'abc\'")') + ee('Exe("throw \'def\'")') +--- 786,1062 ---- + :$put =string(pyeval('dl2')) + :$put =string(pyeval('df(2)')) + :" +! :" Test errors +! :fun F() dict +! :endfun +! :fun D() + :endfun + py << EOF + def ee(expr, g=globals(), l=locals()): + try: + exec(expr, g, l) + except: +! cb.append(expr + ':' + repr(sys.exc_info()[:2])) +! else: +! cb.append(expr + ':NOT FAILED') +! d = vim.Dictionary() +! ned = vim.Dictionary(foo='bar', baz='abc') +! dl = vim.Dictionary(a=1) +! dl.locked = True +! l = vim.List() +! ll = vim.List('abc') +! ll.locked = True +! f = vim.Function('string') +! fd = vim.Function('F') +! fdel = vim.Function('D') +! vim.command('delfunction D') +! +! def subexpr_test(expr, name, subexprs): +! cb.append('>>> Testing %s using %s' % (name, expr)) +! for subexpr in subexprs: +! ee(expr % subexpr) +! cb.append('<<< Finished') +! +! def stringtochars_test(expr): +! return subexpr_test(expr, 'StringToChars', ( +! '1', # Fail type checks +! 'u"\\0"', # Fail PyString_AsStringAndSize(bytes, , NULL) check +! '"\\0"', # Fail PyString_AsStringAndSize(object, , NULL) check +! )) +! +! class Mapping(object): +! def __init__(self, d): +! self.d = d +! +! def __getitem__(self, key): +! return self.d[key] +! +! def keys(self): +! return self.d.keys() +! +! def items(self): +! return self.d.items() +! +! def convertfrompyobject_test(expr, recurse=True): +! # pydict_to_tv +! stringtochars_test(expr % '{%s : 1}') +! if recurse: +! convertfrompyobject_test(expr % '{"abc" : %s}', False) +! # pymap_to_tv +! stringtochars_test(expr % 'Mapping({%s : 1})') +! if recurse: +! convertfrompyobject_test(expr % 'Mapping({"abc" : %s})', False) +! # pyseq_to_tv +! iter_test(expr) +! return subexpr_test(expr, 'ConvertFromPyObject', ( +! 'None', # Not conversible +! '{"": 1}', # Empty key not allowed +! 'FailingMapping()', # +! 'FailingMappingKey()', # +! )) +! +! def convertfrompymapping_test(expr): +! convertfrompyobject_test(expr) +! return subexpr_test(expr, 'ConvertFromPyMapping', ( +! '[]', +! )) +! +! def iter_test(expr): +! return subexpr_test(expr, '*Iter*', ( +! 'FailingIter()', +! 'FailingIterNext()', +! )) +! +! class FailingTrue(object): +! def __nonzero__(self): +! raise NotImplementedError +! +! class FailingIter(object): +! def __iter__(self): +! raise NotImplementedError +! +! class FailingIterNext(object): +! def __iter__(self): +! return self +! +! def next(self): +! raise NotImplementedError +! +! class FailingMappingKey(object): +! def __getitem__(self, item): +! raise NotImplementedError +! +! def keys(self): +! return list("abc") +! +! class FailingMapping(object): +! def __getitem__(self): +! raise NotImplementedError +! +! def keys(self): +! raise NotImplementedError +! +! class FailingList(list): +! def __getitem__(self, idx): +! if i == 2: +! raise NotImplementedError +! else: +! return super(FailingList, self).__getitem__(idx) +! +! cb.append("> Output") +! cb.append(">> OutputSetattr") +! ee('del sys.stdout.softspace') +! ee('sys.stdout.softspace = []') +! ee('sys.stdout.attr = None') +! cb.append(">> OutputWrite") +! ee('sys.stdout.write(None)') +! cb.append(">> OutputWriteLines") +! ee('sys.stdout.writelines(None)') +! ee('sys.stdout.writelines([1])') +! iter_test('sys.stdout.writelines(%s)') +! cb.append("> VimCommand") +! ee('vim.command(1)') +! #! Not checked: vim->python exceptions translating: checked later +! cb.append("> VimToPython") +! #! Not checked: everything: needs errors in internal python functions +! cb.append("> VimEval") +! ee('vim.eval(1)') +! #! Not checked: everything: needs errors in internal python functions +! cb.append("> VimEvalPy") +! ee('vim.bindeval(1)') +! #! Not checked: vim->python exceptions translating: checked later +! cb.append("> VimStrwidth") +! ee('vim.strwidth(1)') +! cb.append("> Dictionary") +! cb.append(">> DictionaryConstructor") +! ee('vim.Dictionary("abc")') +! ##! Not checked: py_dict_alloc failure +! cb.append(">> DictionarySetattr") +! ee('del d.locked') +! ee('d.locked = FailingTrue()') +! ee('vim.vvars.locked = False') +! ee('d.scope = True') +! ee('d.xxx = True') +! cb.append(">> _DictionaryItem") +! ee('d.get("a", 2, 3)') +! stringtochars_test('d.get(%s)') +! ee('d.pop("a")') +! ee('dl.pop("a")') +! cb.append(">> DictionaryIterNext") +! ee('for i in ned: ned["a"] = 1') +! cb.append(">> DictionaryAssItem") +! ee('dl["b"] = 1') +! stringtochars_test('d[%s] = 1') +! convertfrompyobject_test('d["a"] = %s') +! cb.append(">> DictionaryUpdate") +! cb.append(">>> kwargs") +! cb.append(">>> iter") +! ee('d.update(FailingMapping())') +! ee('d.update([FailingIterNext()])') +! iter_test('d.update(%s)') +! convertfrompyobject_test('d.update(%s)') +! stringtochars_test('d.update(((%s, 0),))') +! convertfrompyobject_test('d.update((("a", %s),))') +! cb.append(">> DictionaryPopItem") +! ee('d.popitem(1, 2)') +! cb.append(">> DictionaryHasKey") +! ee('d.has_key()') +! cb.append("> List") +! cb.append(">> ListConstructor") +! ee('vim.List(1, 2)') +! ee('vim.List(a=1)') +! iter_test('vim.List(%s)') +! convertfrompyobject_test('vim.List([%s])') +! cb.append(">> ListItem") +! ee('l[1000]') +! cb.append(">> ListAssItem") +! ee('ll[1] = 2') +! ee('l[1000] = 3') +! cb.append(">> ListAssSlice") +! ee('ll[1:100] = "abc"') +! iter_test('l[:] = %s') +! convertfrompyobject_test('l[:] = [%s]') +! cb.append(">> ListConcatInPlace") +! iter_test('l.extend(%s)') +! convertfrompyobject_test('l.extend([%s])') +! cb.append(">> ListSetattr") +! ee('del l.locked') +! ee('l.locked = FailingTrue()') +! ee('l.xxx = True') +! cb.append("> Function") +! cb.append(">> FunctionConstructor") +! ee('vim.Function("123")') +! ee('vim.Function("xxx_non_existent_function_xxx")') +! ee('vim.Function("xxx#non#existent#function#xxx")') +! cb.append(">> FunctionCall") +! convertfrompyobject_test('f(%s)') +! convertfrompymapping_test('fd(self=%s)') +! cb.append("> TabPage") +! cb.append(">> TabPageAttr") +! ee('vim.current.tabpage.xxx') +! cb.append("> TabList") +! cb.append(">> TabListItem") +! ee('vim.tabpages[1000]') +! cb.append("> Window") +! cb.append(">> WindowAttr") +! ee('vim.current.window.xxx') +! cb.append(">> WindowSetattr") +! ee('vim.current.window.buffer = 0') +! ee('vim.current.window.cursor = (10000000000, 100000000)') +! ee('vim.current.window.cursor = True') +! ee('vim.current.window.height = "abc"') +! ee('vim.current.window.width = "abc"') +! ee('vim.current.window.xxxxxx = True') +! cb.append("> WinList") +! cb.append(">> WinListItem") +! ee('vim.windows[1000]') +! cb.append("> Buffer") +! cb.append(">> StringToLine (indirect)") +! ee('vim.current.buffer[0] = "\\na"') +! cb.append(">> SetBufferLine (indirect)") +! ee('vim.current.buffer[0] = True') +! cb.append(">> SetBufferLines (indirect)") +! ee('vim.current.buffer[:] = True') +! ee('vim.current.buffer[:] = ["\\na", "bc"]') +! cb.append(">> InsertBufferLines (indirect)") +! ee('vim.current.buffer.append(None)') +! ee('vim.current.buffer.append(["\\na", "bc"])') +! ee('vim.current.buffer.append("\\nbc")') +! cb.append(">> RBItem") +! ee('vim.current.buffer[10000000000]') +! cb.append(">> RBAsItem") +! ee('vim.current.buffer[10000000000] = ""') +! cb.append(">> BufferAttr") +! ee('vim.current.buffer.xxx') +! cb.append(">> BufferSetattr") +! ee('vim.current.buffer.name = True') +! ee('vim.current.buffer.xxx = True') +! cb.append(">> BufferMark") +! ee('vim.current.buffer.mark(0)') +! ee('vim.current.buffer.mark("abc")') +! ee('vim.current.buffer.mark("!")') +! cb.append(">> BufferRange") +! ee('vim.current.buffer.range(1, 2, 3)') +! cb.append("> BufMap") +! cb.append(">> BufMapItem") +! ee('vim.buffers[None]') +! ee('vim.buffers[100000000]') +! cb.append("> Current") +! cb.append(">> CurrentGetattr") +! ee('vim.current.xxx') +! cb.append(">> CurrentSetattr") +! ee('vim.current.line = True') +! ee('vim.current.buffer = True') +! ee('vim.current.window = True') +! ee('vim.current.tabpage = True') +! ee('vim.current.xxx = True') +! EOF +! :" +! :" Test exceptions +! :fun Exe(e) +! : execute a:e +! :endfun +! py << EOF + Exe = vim.bindeval('function("Exe")') + ee('vim.command("throw \'abc\'")') + ee('Exe("throw \'def\'")') +*** ../vim-7.3.1065/src/testdir/test86.ok 2013-05-30 13:14:06.000000000 +0200 +--- src/testdir/test86.ok 2013-05-30 13:25:22.000000000 +0200 +*************** +*** 429,437 **** + ['a', 'b', 'c'] + [2, 2] + [2, 2] +! (, error('abc',)) +! (, error('def',)) +! (, error('ghi',)) +! (, error('Vim(echoerr):jkl',)) +! (, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',)) +! (, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',)) +--- 429,1081 ---- + ['a', 'b', 'c'] + [2, 2] + [2, 2] +! > Output +! >> OutputSetattr +! del sys.stdout.softspace:(, AttributeError("can't delete OutputObject attributes",)) +! sys.stdout.softspace = []:(, TypeError('softspace must be an integer',)) +! sys.stdout.attr = None:(, AttributeError('invalid attribute',)) +! >> OutputWrite +! sys.stdout.write(None):(, TypeError('coercing to Unicode: need string or buffer, NoneType found',)) +! >> OutputWriteLines +! sys.stdout.writelines(None):(, TypeError("'NoneType' object is not iterable",)) +! sys.stdout.writelines([1]):(, TypeError('writelines() requires list of strings',)) +! >>> Testing *Iter* using sys.stdout.writelines(%s) +! sys.stdout.writelines(FailingIter()):(, NotImplementedError()) +! sys.stdout.writelines(FailingIterNext()):(, NotImplementedError()) +! <<< Finished +! > VimCommand +! vim.command(1):(, TypeError('must be string, not int',)) +! > VimToPython +! > VimEval +! vim.eval(1):(, TypeError('must be string, not int',)) +! > VimEvalPy +! vim.bindeval(1):(, TypeError('must be string, not int',)) +! > VimStrwidth +! vim.strwidth(1):(, TypeError('must be string, not int',)) +! > Dictionary +! >> DictionaryConstructor +! vim.Dictionary("abc"):(, ValueError('expected sequence element of size 2',)) +! >> DictionarySetattr +! del d.locked:(, AttributeError('cannot delete vim.Dictionary attributes',)) +! d.locked = FailingTrue():(, NotImplementedError()) +! vim.vvars.locked = False:(, TypeError('cannot modify fixed dictionary',)) +! d.scope = True:(, AttributeError('cannot set this attribute',)) +! d.xxx = True:(, AttributeError('cannot set this attribute',)) +! >> _DictionaryItem +! d.get("a", 2, 3):(, TypeError('function takes at most 2 arguments (3 given)',)) +! >>> Testing StringToChars using d.get(%s) +! d.get(1):(, TypeError('object must be string',)) +! d.get(u"\0"):(, TypeError('expected string without null bytes',)) +! d.get("\0"):(, TypeError('expected string without null bytes',)) +! <<< Finished +! d.pop("a"):(, KeyError('a',)) +! dl.pop("a"):(, error('dict is locked',)) +! >> DictionaryIterNext +! for i in ned: ned["a"] = 1:(, RuntimeError('hashtab changed during iteration',)) +! >> DictionaryAssItem +! dl["b"] = 1:(, error('dict is locked',)) +! >>> Testing StringToChars using d[%s] = 1 +! d[1] = 1:(, TypeError('object must be string',)) +! d[u"\0"] = 1:(, TypeError('expected string without null bytes',)) +! d["\0"] = 1:(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using d["a"] = {%s : 1} +! d["a"] = {1 : 1}:(, TypeError('object must be string',)) +! d["a"] = {u"\0" : 1}:(, TypeError('expected string without null bytes',)) +! d["a"] = {"\0" : 1}:(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using d["a"] = {"abc" : {%s : 1}} +! d["a"] = {"abc" : {1 : 1}}:(, TypeError('object must be string',)) +! d["a"] = {"abc" : {u"\0" : 1}}:(, TypeError('expected string without null bytes',)) +! d["a"] = {"abc" : {"\0" : 1}}:(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using d["a"] = {"abc" : Mapping({%s : 1})} +! d["a"] = {"abc" : Mapping({1 : 1})}:(, TypeError('object must be string',)) +! d["a"] = {"abc" : Mapping({u"\0" : 1})}:(, TypeError('expected string without null bytes',)) +! d["a"] = {"abc" : Mapping({"\0" : 1})}:(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing *Iter* using d["a"] = {"abc" : %s} +! d["a"] = {"abc" : FailingIter()}:(, TypeError('unable to convert to vim structure',)) +! d["a"] = {"abc" : FailingIterNext()}:(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d["a"] = {"abc" : %s} +! d["a"] = {"abc" : None}:(, TypeError('unable to convert to vim structure',)) +! d["a"] = {"abc" : {"": 1}}:(, ValueError('empty keys are not allowed',)) +! d["a"] = {"abc" : FailingMapping()}:(, NotImplementedError()) +! d["a"] = {"abc" : FailingMappingKey()}:(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using d["a"] = Mapping({%s : 1}) +! d["a"] = Mapping({1 : 1}):(, TypeError('object must be string',)) +! d["a"] = Mapping({u"\0" : 1}):(, TypeError('expected string without null bytes',)) +! d["a"] = Mapping({"\0" : 1}):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using d["a"] = Mapping({"abc" : {%s : 1}}) +! d["a"] = Mapping({"abc" : {1 : 1}}):(, TypeError('object must be string',)) +! d["a"] = Mapping({"abc" : {u"\0" : 1}}):(, TypeError('expected string without null bytes',)) +! d["a"] = Mapping({"abc" : {"\0" : 1}}):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using d["a"] = Mapping({"abc" : Mapping({%s : 1})}) +! d["a"] = Mapping({"abc" : Mapping({1 : 1})}):(, TypeError('object must be string',)) +! d["a"] = Mapping({"abc" : Mapping({u"\0" : 1})}):(, TypeError('expected string without null bytes',)) +! d["a"] = Mapping({"abc" : Mapping({"\0" : 1})}):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing *Iter* using d["a"] = Mapping({"abc" : %s}) +! d["a"] = Mapping({"abc" : FailingIter()}):(, TypeError('unable to convert to vim structure',)) +! d["a"] = Mapping({"abc" : FailingIterNext()}):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abc" : %s}) +! d["a"] = Mapping({"abc" : None}):(, TypeError('unable to convert to vim structure',)) +! d["a"] = Mapping({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! d["a"] = Mapping({"abc" : FailingMapping()}):(, NotImplementedError()) +! d["a"] = Mapping({"abc" : FailingMappingKey()}):(, NotImplementedError()) +! <<< Finished +! >>> Testing *Iter* using d["a"] = %s +! d["a"] = FailingIter():(, TypeError('unable to convert to vim structure',)) +! d["a"] = FailingIterNext():(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d["a"] = %s +! d["a"] = None:(, TypeError('unable to convert to vim structure',)) +! d["a"] = {"": 1}:(, ValueError('empty keys are not allowed',)) +! d["a"] = FailingMapping():(, NotImplementedError()) +! d["a"] = FailingMappingKey():(, NotImplementedError()) +! <<< Finished +! >> DictionaryUpdate +! >>> kwargs +! >>> iter +! d.update(FailingMapping()):(, NotImplementedError()) +! d.update([FailingIterNext()]):(, NotImplementedError()) +! >>> Testing *Iter* using d.update(%s) +! d.update(FailingIter()):(, NotImplementedError()) +! d.update(FailingIterNext()):(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using d.update({%s : 1}) +! d.update({1 : 1}):(, TypeError('object must be string',)) +! d.update({u"\0" : 1}):(, TypeError('expected string without null bytes',)) +! d.update({"\0" : 1}):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using d.update({"abc" : {%s : 1}}) +! d.update({"abc" : {1 : 1}}):(, TypeError('object must be string',)) +! d.update({"abc" : {u"\0" : 1}}):(, TypeError('expected string without null bytes',)) +! d.update({"abc" : {"\0" : 1}}):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using d.update({"abc" : Mapping({%s : 1})}) +! d.update({"abc" : Mapping({1 : 1})}):(, TypeError('object must be string',)) +! d.update({"abc" : Mapping({u"\0" : 1})}):(, TypeError('expected string without null bytes',)) +! d.update({"abc" : Mapping({"\0" : 1})}):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing *Iter* using d.update({"abc" : %s}) +! d.update({"abc" : FailingIter()}):(, TypeError('unable to convert to vim structure',)) +! d.update({"abc" : FailingIterNext()}):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update({"abc" : %s}) +! d.update({"abc" : None}):(, TypeError('unable to convert to vim structure',)) +! d.update({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! d.update({"abc" : FailingMapping()}):(, NotImplementedError()) +! d.update({"abc" : FailingMappingKey()}):(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using d.update(Mapping({%s : 1})) +! d.update(Mapping({1 : 1})):(, TypeError('object must be string',)) +! d.update(Mapping({u"\0" : 1})):(, TypeError('expected string without null bytes',)) +! d.update(Mapping({"\0" : 1})):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using d.update(Mapping({"abc" : {%s : 1}})) +! d.update(Mapping({"abc" : {1 : 1}})):(, TypeError('object must be string',)) +! d.update(Mapping({"abc" : {u"\0" : 1}})):(, TypeError('expected string without null bytes',)) +! d.update(Mapping({"abc" : {"\0" : 1}})):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using d.update(Mapping({"abc" : Mapping({%s : 1})})) +! d.update(Mapping({"abc" : Mapping({1 : 1})})):(, TypeError('object must be string',)) +! d.update(Mapping({"abc" : Mapping({u"\0" : 1})})):(, TypeError('expected string without null bytes',)) +! d.update(Mapping({"abc" : Mapping({"\0" : 1})})):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing *Iter* using d.update(Mapping({"abc" : %s})) +! d.update(Mapping({"abc" : FailingIter()})):(, TypeError('unable to convert to vim structure',)) +! d.update(Mapping({"abc" : FailingIterNext()})):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update(Mapping({"abc" : %s})) +! d.update(Mapping({"abc" : None})):(, TypeError('unable to convert to vim structure',)) +! d.update(Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) +! d.update(Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) +! d.update(Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) +! <<< Finished +! >>> Testing *Iter* using d.update(%s) +! d.update(FailingIter()):(, NotImplementedError()) +! d.update(FailingIterNext()):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update(%s) +! d.update(None):(, TypeError("'NoneType' object is not iterable",)) +! d.update({"": 1}):(, ValueError('empty keys are not allowed',)) +! d.update(FailingMapping()):(, NotImplementedError()) +! d.update(FailingMappingKey()):(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using d.update(((%s, 0),)) +! d.update(((1, 0),)):(, TypeError('object must be string',)) +! d.update(((u"\0", 0),)):(, TypeError('expected string without null bytes',)) +! d.update((("\0", 0),)):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using d.update((("a", {%s : 1}),)) +! d.update((("a", {1 : 1}),)):(, TypeError('object must be string',)) +! d.update((("a", {u"\0" : 1}),)):(, TypeError('expected string without null bytes',)) +! d.update((("a", {"\0" : 1}),)):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using d.update((("a", {"abc" : {%s : 1}}),)) +! d.update((("a", {"abc" : {1 : 1}}),)):(, TypeError('object must be string',)) +! d.update((("a", {"abc" : {u"\0" : 1}}),)):(, TypeError('expected string without null bytes',)) +! d.update((("a", {"abc" : {"\0" : 1}}),)):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using d.update((("a", {"abc" : Mapping({%s : 1})}),)) +! d.update((("a", {"abc" : Mapping({1 : 1})}),)):(, TypeError('object must be string',)) +! d.update((("a", {"abc" : Mapping({u"\0" : 1})}),)):(, TypeError('expected string without null bytes',)) +! d.update((("a", {"abc" : Mapping({"\0" : 1})}),)):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing *Iter* using d.update((("a", {"abc" : %s}),)) +! d.update((("a", {"abc" : FailingIter()}),)):(, TypeError('unable to convert to vim structure',)) +! d.update((("a", {"abc" : FailingIterNext()}),)):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update((("a", {"abc" : %s}),)) +! d.update((("a", {"abc" : None}),)):(, TypeError('unable to convert to vim structure',)) +! d.update((("a", {"abc" : {"": 1}}),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", {"abc" : FailingMapping()}),)):(, NotImplementedError()) +! d.update((("a", {"abc" : FailingMappingKey()}),)):(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),)) +! d.update((("a", Mapping({1 : 1})),)):(, TypeError('object must be string',)) +! d.update((("a", Mapping({u"\0" : 1})),)):(, TypeError('expected string without null bytes',)) +! d.update((("a", Mapping({"\0" : 1})),)):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using d.update((("a", Mapping({"abc" : {%s : 1}})),)) +! d.update((("a", Mapping({"abc" : {1 : 1}})),)):(, TypeError('object must be string',)) +! d.update((("a", Mapping({"abc" : {u"\0" : 1}})),)):(, TypeError('expected string without null bytes',)) +! d.update((("a", Mapping({"abc" : {"\0" : 1}})),)):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using d.update((("a", Mapping({"abc" : Mapping({%s : 1})})),)) +! d.update((("a", Mapping({"abc" : Mapping({1 : 1})})),)):(, TypeError('object must be string',)) +! d.update((("a", Mapping({"abc" : Mapping({u"\0" : 1})})),)):(, TypeError('expected string without null bytes',)) +! d.update((("a", Mapping({"abc" : Mapping({"\0" : 1})})),)):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing *Iter* using d.update((("a", Mapping({"abc" : %s})),)) +! d.update((("a", Mapping({"abc" : FailingIter()})),)):(, TypeError('unable to convert to vim structure',)) +! d.update((("a", Mapping({"abc" : FailingIterNext()})),)):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abc" : %s})),)) +! d.update((("a", Mapping({"abc" : None})),)):(, TypeError('unable to convert to vim structure',)) +! d.update((("a", Mapping({"abc" : {"": 1}})),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", Mapping({"abc" : FailingMapping()})),)):(, NotImplementedError()) +! d.update((("a", Mapping({"abc" : FailingMappingKey()})),)):(, NotImplementedError()) +! <<< Finished +! >>> Testing *Iter* using d.update((("a", %s),)) +! d.update((("a", FailingIter()),)):(, TypeError('unable to convert to vim structure',)) +! d.update((("a", FailingIterNext()),)):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update((("a", %s),)) +! d.update((("a", None),)):(, TypeError('unable to convert to vim structure',)) +! d.update((("a", {"": 1}),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", FailingMapping()),)):(, NotImplementedError()) +! d.update((("a", FailingMappingKey()),)):(, NotImplementedError()) +! <<< Finished +! >> DictionaryPopItem +! d.popitem(1, 2):(, TypeError('function takes exactly 1 argument (2 given)',)) +! >> DictionaryHasKey +! d.has_key():(, TypeError('function takes exactly 1 argument (0 given)',)) +! > List +! >> ListConstructor +! vim.List(1, 2):(, TypeError('function takes at most 1 argument (2 given)',)) +! vim.List(a=1):(, TypeError('list constructor does not accept keyword arguments',)) +! >>> Testing *Iter* using vim.List(%s) +! vim.List(FailingIter()):(, NotImplementedError()) +! vim.List(FailingIterNext()):(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using vim.List([{%s : 1}]) +! vim.List([{1 : 1}]):(, TypeError('object must be string',)) +! vim.List([{u"\0" : 1}]):(, TypeError('expected string without null bytes',)) +! vim.List([{"\0" : 1}]):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using vim.List([{"abc" : {%s : 1}}]) +! vim.List([{"abc" : {1 : 1}}]):(, TypeError('object must be string',)) +! vim.List([{"abc" : {u"\0" : 1}}]):(, TypeError('expected string without null bytes',)) +! vim.List([{"abc" : {"\0" : 1}}]):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using vim.List([{"abc" : Mapping({%s : 1})}]) +! vim.List([{"abc" : Mapping({1 : 1})}]):(, TypeError('object must be string',)) +! vim.List([{"abc" : Mapping({u"\0" : 1})}]):(, TypeError('expected string without null bytes',)) +! vim.List([{"abc" : Mapping({"\0" : 1})}]):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing *Iter* using vim.List([{"abc" : %s}]) +! vim.List([{"abc" : FailingIter()}]):(, TypeError('unable to convert to vim structure',)) +! vim.List([{"abc" : FailingIterNext()}]):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using vim.List([{"abc" : %s}]) +! vim.List([{"abc" : None}]):(, TypeError('unable to convert to vim structure',)) +! vim.List([{"abc" : {"": 1}}]):(, ValueError('empty keys are not allowed',)) +! vim.List([{"abc" : FailingMapping()}]):(, NotImplementedError()) +! vim.List([{"abc" : FailingMappingKey()}]):(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using vim.List([Mapping({%s : 1})]) +! vim.List([Mapping({1 : 1})]):(, TypeError('object must be string',)) +! vim.List([Mapping({u"\0" : 1})]):(, TypeError('expected string without null bytes',)) +! vim.List([Mapping({"\0" : 1})]):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using vim.List([Mapping({"abc" : {%s : 1}})]) +! vim.List([Mapping({"abc" : {1 : 1}})]):(, TypeError('object must be string',)) +! vim.List([Mapping({"abc" : {u"\0" : 1}})]):(, TypeError('expected string without null bytes',)) +! vim.List([Mapping({"abc" : {"\0" : 1}})]):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using vim.List([Mapping({"abc" : Mapping({%s : 1})})]) +! vim.List([Mapping({"abc" : Mapping({1 : 1})})]):(, TypeError('object must be string',)) +! vim.List([Mapping({"abc" : Mapping({u"\0" : 1})})]):(, TypeError('expected string without null bytes',)) +! vim.List([Mapping({"abc" : Mapping({"\0" : 1})})]):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing *Iter* using vim.List([Mapping({"abc" : %s})]) +! vim.List([Mapping({"abc" : FailingIter()})]):(, TypeError('unable to convert to vim structure',)) +! vim.List([Mapping({"abc" : FailingIterNext()})]):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using vim.List([Mapping({"abc" : %s})]) +! vim.List([Mapping({"abc" : None})]):(, TypeError('unable to convert to vim structure',)) +! vim.List([Mapping({"abc" : {"": 1}})]):(, ValueError('empty keys are not allowed',)) +! vim.List([Mapping({"abc" : FailingMapping()})]):(, NotImplementedError()) +! vim.List([Mapping({"abc" : FailingMappingKey()})]):(, NotImplementedError()) +! <<< Finished +! >>> Testing *Iter* using vim.List([%s]) +! vim.List([FailingIter()]):(, TypeError('unable to convert to vim structure',)) +! vim.List([FailingIterNext()]):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using vim.List([%s]) +! vim.List([None]):(, TypeError('unable to convert to vim structure',)) +! vim.List([{"": 1}]):(, ValueError('empty keys are not allowed',)) +! vim.List([FailingMapping()]):(, NotImplementedError()) +! vim.List([FailingMappingKey()]):(, NotImplementedError()) +! <<< Finished +! >> ListItem +! l[1000]:(, IndexError('list index out of range',)) +! >> ListAssItem +! ll[1] = 2:(, error('list is locked',)) +! l[1000] = 3:(, IndexError('list index out of range',)) +! >> ListAssSlice +! ll[1:100] = "abc":(, error('list is locked',)) +! >>> Testing *Iter* using l[:] = %s +! l[:] = FailingIter():(, NotImplementedError()) +! l[:] = FailingIterNext():(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using l[:] = [{%s : 1}] +! l[:] = [{1 : 1}]:(, TypeError('object must be string',)) +! l[:] = [{u"\0" : 1}]:(, TypeError('expected string without null bytes',)) +! l[:] = [{"\0" : 1}]:(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using l[:] = [{"abc" : {%s : 1}}] +! l[:] = [{"abc" : {1 : 1}}]:(, TypeError('object must be string',)) +! l[:] = [{"abc" : {u"\0" : 1}}]:(, TypeError('expected string without null bytes',)) +! l[:] = [{"abc" : {"\0" : 1}}]:(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using l[:] = [{"abc" : Mapping({%s : 1})}] +! l[:] = [{"abc" : Mapping({1 : 1})}]:(, TypeError('object must be string',)) +! l[:] = [{"abc" : Mapping({u"\0" : 1})}]:(, TypeError('expected string without null bytes',)) +! l[:] = [{"abc" : Mapping({"\0" : 1})}]:(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing *Iter* using l[:] = [{"abc" : %s}] +! l[:] = [{"abc" : FailingIter()}]:(, TypeError('unable to convert to vim structure',)) +! l[:] = [{"abc" : FailingIterNext()}]:(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using l[:] = [{"abc" : %s}] +! l[:] = [{"abc" : None}]:(, TypeError('unable to convert to vim structure',)) +! l[:] = [{"abc" : {"": 1}}]:(, ValueError('empty keys are not allowed',)) +! l[:] = [{"abc" : FailingMapping()}]:(, NotImplementedError()) +! l[:] = [{"abc" : FailingMappingKey()}]:(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using l[:] = [Mapping({%s : 1})] +! l[:] = [Mapping({1 : 1})]:(, TypeError('object must be string',)) +! l[:] = [Mapping({u"\0" : 1})]:(, TypeError('expected string without null bytes',)) +! l[:] = [Mapping({"\0" : 1})]:(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using l[:] = [Mapping({"abc" : {%s : 1}})] +! l[:] = [Mapping({"abc" : {1 : 1}})]:(, TypeError('object must be string',)) +! l[:] = [Mapping({"abc" : {u"\0" : 1}})]:(, TypeError('expected string without null bytes',)) +! l[:] = [Mapping({"abc" : {"\0" : 1}})]:(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using l[:] = [Mapping({"abc" : Mapping({%s : 1})})] +! l[:] = [Mapping({"abc" : Mapping({1 : 1})})]:(, TypeError('object must be string',)) +! l[:] = [Mapping({"abc" : Mapping({u"\0" : 1})})]:(, TypeError('expected string without null bytes',)) +! l[:] = [Mapping({"abc" : Mapping({"\0" : 1})})]:(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing *Iter* using l[:] = [Mapping({"abc" : %s})] +! l[:] = [Mapping({"abc" : FailingIter()})]:(, TypeError('unable to convert to vim structure',)) +! l[:] = [Mapping({"abc" : FailingIterNext()})]:(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abc" : %s})] +! l[:] = [Mapping({"abc" : None})]:(, TypeError('unable to convert to vim structure',)) +! l[:] = [Mapping({"abc" : {"": 1}})]:(, ValueError('empty keys are not allowed',)) +! l[:] = [Mapping({"abc" : FailingMapping()})]:(, NotImplementedError()) +! l[:] = [Mapping({"abc" : FailingMappingKey()})]:(, NotImplementedError()) +! <<< Finished +! >>> Testing *Iter* using l[:] = [%s] +! l[:] = [FailingIter()]:(, TypeError('unable to convert to vim structure',)) +! l[:] = [FailingIterNext()]:(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using l[:] = [%s] +! l[:] = [None]:(, TypeError('unable to convert to vim structure',)) +! l[:] = [{"": 1}]:(, ValueError('empty keys are not allowed',)) +! l[:] = [FailingMapping()]:(, NotImplementedError()) +! l[:] = [FailingMappingKey()]:(, NotImplementedError()) +! <<< Finished +! >> ListConcatInPlace +! >>> Testing *Iter* using l.extend(%s) +! l.extend(FailingIter()):(, NotImplementedError()) +! l.extend(FailingIterNext()):(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using l.extend([{%s : 1}]) +! l.extend([{1 : 1}]):(, TypeError('object must be string',)) +! l.extend([{u"\0" : 1}]):(, TypeError('expected string without null bytes',)) +! l.extend([{"\0" : 1}]):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using l.extend([{"abc" : {%s : 1}}]) +! l.extend([{"abc" : {1 : 1}}]):(, TypeError('object must be string',)) +! l.extend([{"abc" : {u"\0" : 1}}]):(, TypeError('expected string without null bytes',)) +! l.extend([{"abc" : {"\0" : 1}}]):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using l.extend([{"abc" : Mapping({%s : 1})}]) +! l.extend([{"abc" : Mapping({1 : 1})}]):(, TypeError('object must be string',)) +! l.extend([{"abc" : Mapping({u"\0" : 1})}]):(, TypeError('expected string without null bytes',)) +! l.extend([{"abc" : Mapping({"\0" : 1})}]):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing *Iter* using l.extend([{"abc" : %s}]) +! l.extend([{"abc" : FailingIter()}]):(, TypeError('unable to convert to vim structure',)) +! l.extend([{"abc" : FailingIterNext()}]):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using l.extend([{"abc" : %s}]) +! l.extend([{"abc" : None}]):(, TypeError('unable to convert to vim structure',)) +! l.extend([{"abc" : {"": 1}}]):(, ValueError('empty keys are not allowed',)) +! l.extend([{"abc" : FailingMapping()}]):(, NotImplementedError()) +! l.extend([{"abc" : FailingMappingKey()}]):(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using l.extend([Mapping({%s : 1})]) +! l.extend([Mapping({1 : 1})]):(, TypeError('object must be string',)) +! l.extend([Mapping({u"\0" : 1})]):(, TypeError('expected string without null bytes',)) +! l.extend([Mapping({"\0" : 1})]):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using l.extend([Mapping({"abc" : {%s : 1}})]) +! l.extend([Mapping({"abc" : {1 : 1}})]):(, TypeError('object must be string',)) +! l.extend([Mapping({"abc" : {u"\0" : 1}})]):(, TypeError('expected string without null bytes',)) +! l.extend([Mapping({"abc" : {"\0" : 1}})]):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using l.extend([Mapping({"abc" : Mapping({%s : 1})})]) +! l.extend([Mapping({"abc" : Mapping({1 : 1})})]):(, TypeError('object must be string',)) +! l.extend([Mapping({"abc" : Mapping({u"\0" : 1})})]):(, TypeError('expected string without null bytes',)) +! l.extend([Mapping({"abc" : Mapping({"\0" : 1})})]):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing *Iter* using l.extend([Mapping({"abc" : %s})]) +! l.extend([Mapping({"abc" : FailingIter()})]):(, TypeError('unable to convert to vim structure',)) +! l.extend([Mapping({"abc" : FailingIterNext()})]):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using l.extend([Mapping({"abc" : %s})]) +! l.extend([Mapping({"abc" : None})]):(, TypeError('unable to convert to vim structure',)) +! l.extend([Mapping({"abc" : {"": 1}})]):(, ValueError('empty keys are not allowed',)) +! l.extend([Mapping({"abc" : FailingMapping()})]):(, NotImplementedError()) +! l.extend([Mapping({"abc" : FailingMappingKey()})]):(, NotImplementedError()) +! <<< Finished +! >>> Testing *Iter* using l.extend([%s]) +! l.extend([FailingIter()]):(, TypeError('unable to convert to vim structure',)) +! l.extend([FailingIterNext()]):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using l.extend([%s]) +! l.extend([None]):(, TypeError('unable to convert to vim structure',)) +! l.extend([{"": 1}]):(, ValueError('empty keys are not allowed',)) +! l.extend([FailingMapping()]):(, NotImplementedError()) +! l.extend([FailingMappingKey()]):(, NotImplementedError()) +! <<< Finished +! >> ListSetattr +! del l.locked:(, AttributeError('cannot delete vim.List attributes',)) +! l.locked = FailingTrue():(, NotImplementedError()) +! l.xxx = True:(, AttributeError('cannot set this attribute',)) +! > Function +! >> FunctionConstructor +! vim.Function("123"):(, ValueError('unnamed function does not exist',)) +! vim.Function("xxx_non_existent_function_xxx"):(, ValueError('function does not exist',)) +! vim.Function("xxx#non#existent#function#xxx"):(, ValueError('function does not exist',)) +! >> FunctionCall +! >>> Testing StringToChars using f({%s : 1}) +! f({1 : 1}):(, TypeError('object must be string',)) +! f({u"\0" : 1}):(, TypeError('expected string without null bytes',)) +! f({"\0" : 1}):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using f({"abc" : {%s : 1}}) +! f({"abc" : {1 : 1}}):(, TypeError('object must be string',)) +! f({"abc" : {u"\0" : 1}}):(, TypeError('expected string without null bytes',)) +! f({"abc" : {"\0" : 1}}):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using f({"abc" : Mapping({%s : 1})}) +! f({"abc" : Mapping({1 : 1})}):(, TypeError('object must be string',)) +! f({"abc" : Mapping({u"\0" : 1})}):(, TypeError('expected string without null bytes',)) +! f({"abc" : Mapping({"\0" : 1})}):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing *Iter* using f({"abc" : %s}) +! f({"abc" : FailingIter()}):(, TypeError('unable to convert to vim structure',)) +! f({"abc" : FailingIterNext()}):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using f({"abc" : %s}) +! f({"abc" : None}):(, TypeError('unable to convert to vim structure',)) +! f({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! f({"abc" : FailingMapping()}):(, NotImplementedError()) +! f({"abc" : FailingMappingKey()}):(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using f(Mapping({%s : 1})) +! f(Mapping({1 : 1})):(, TypeError('object must be string',)) +! f(Mapping({u"\0" : 1})):(, TypeError('expected string without null bytes',)) +! f(Mapping({"\0" : 1})):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using f(Mapping({"abc" : {%s : 1}})) +! f(Mapping({"abc" : {1 : 1}})):(, TypeError('object must be string',)) +! f(Mapping({"abc" : {u"\0" : 1}})):(, TypeError('expected string without null bytes',)) +! f(Mapping({"abc" : {"\0" : 1}})):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using f(Mapping({"abc" : Mapping({%s : 1})})) +! f(Mapping({"abc" : Mapping({1 : 1})})):(, TypeError('object must be string',)) +! f(Mapping({"abc" : Mapping({u"\0" : 1})})):(, TypeError('expected string without null bytes',)) +! f(Mapping({"abc" : Mapping({"\0" : 1})})):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing *Iter* using f(Mapping({"abc" : %s})) +! f(Mapping({"abc" : FailingIter()})):(, TypeError('unable to convert to vim structure',)) +! f(Mapping({"abc" : FailingIterNext()})):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using f(Mapping({"abc" : %s})) +! f(Mapping({"abc" : None})):(, TypeError('unable to convert to vim structure',)) +! f(Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) +! f(Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) +! f(Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) +! <<< Finished +! >>> Testing *Iter* using f(%s) +! f(FailingIter()):(, TypeError('unable to convert to vim structure',)) +! f(FailingIterNext()):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using f(%s) +! f(None):(, TypeError('unable to convert to vim structure',)) +! f({"": 1}):(, ValueError('empty keys are not allowed',)) +! f(FailingMapping()):(, NotImplementedError()) +! f(FailingMappingKey()):(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using fd(self={%s : 1}) +! fd(self={1 : 1}):(, TypeError('object must be string',)) +! fd(self={u"\0" : 1}):(, TypeError('expected string without null bytes',)) +! fd(self={"\0" : 1}):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using fd(self={"abc" : {%s : 1}}) +! fd(self={"abc" : {1 : 1}}):(, TypeError('object must be string',)) +! fd(self={"abc" : {u"\0" : 1}}):(, TypeError('expected string without null bytes',)) +! fd(self={"abc" : {"\0" : 1}}):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using fd(self={"abc" : Mapping({%s : 1})}) +! fd(self={"abc" : Mapping({1 : 1})}):(, TypeError('object must be string',)) +! fd(self={"abc" : Mapping({u"\0" : 1})}):(, TypeError('expected string without null bytes',)) +! fd(self={"abc" : Mapping({"\0" : 1})}):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing *Iter* using fd(self={"abc" : %s}) +! fd(self={"abc" : FailingIter()}):(, TypeError('unable to convert to vim structure',)) +! fd(self={"abc" : FailingIterNext()}):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using fd(self={"abc" : %s}) +! fd(self={"abc" : None}):(, TypeError('unable to convert to vim structure',)) +! fd(self={"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! fd(self={"abc" : FailingMapping()}):(, NotImplementedError()) +! fd(self={"abc" : FailingMappingKey()}):(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using fd(self=Mapping({%s : 1})) +! fd(self=Mapping({1 : 1})):(, TypeError('object must be string',)) +! fd(self=Mapping({u"\0" : 1})):(, TypeError('expected string without null bytes',)) +! fd(self=Mapping({"\0" : 1})):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using fd(self=Mapping({"abc" : {%s : 1}})) +! fd(self=Mapping({"abc" : {1 : 1}})):(, TypeError('object must be string',)) +! fd(self=Mapping({"abc" : {u"\0" : 1}})):(, TypeError('expected string without null bytes',)) +! fd(self=Mapping({"abc" : {"\0" : 1}})):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing StringToChars using fd(self=Mapping({"abc" : Mapping({%s : 1})})) +! fd(self=Mapping({"abc" : Mapping({1 : 1})})):(, TypeError('object must be string',)) +! fd(self=Mapping({"abc" : Mapping({u"\0" : 1})})):(, TypeError('expected string without null bytes',)) +! fd(self=Mapping({"abc" : Mapping({"\0" : 1})})):(, TypeError('expected string without null bytes',)) +! <<< Finished +! >>> Testing *Iter* using fd(self=Mapping({"abc" : %s})) +! fd(self=Mapping({"abc" : FailingIter()})):(, TypeError('unable to convert to vim structure',)) +! fd(self=Mapping({"abc" : FailingIterNext()})):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using fd(self=Mapping({"abc" : %s})) +! fd(self=Mapping({"abc" : None})):(, TypeError('unable to convert to vim structure',)) +! fd(self=Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) +! fd(self=Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) +! fd(self=Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) +! <<< Finished +! >>> Testing *Iter* using fd(self=%s) +! fd(self=FailingIter()):(, TypeError('unable to convert object to vim dictionary',)) +! fd(self=FailingIterNext()):(, TypeError('unable to convert object to vim dictionary',)) +! <<< Finished +! >>> Testing ConvertFromPyObject using fd(self=%s) +! fd(self=None):(, TypeError('unable to convert object to vim dictionary',)) +! fd(self={"": 1}):(, ValueError('empty keys are not allowed',)) +! fd(self=FailingMapping()):(, NotImplementedError()) +! fd(self=FailingMappingKey()):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyMapping using fd(self=%s) +! fd(self=[]):(, TypeError('unable to convert object to vim dictionary',)) +! <<< Finished +! > TabPage +! >> TabPageAttr +! vim.current.tabpage.xxx:(, AttributeError('xxx',)) +! > TabList +! >> TabListItem +! vim.tabpages[1000]:(, IndexError('no such tab page',)) +! > Window +! >> WindowAttr +! vim.current.window.xxx:(, AttributeError('xxx',)) +! >> WindowSetattr +! vim.current.window.buffer = 0:(, TypeError('readonly attribute',)) +! vim.current.window.cursor = (10000000000, 100000000):(, error('cursor position outside buffer',)) +! vim.current.window.cursor = True:(, TypeError('argument must be 2-item sequence, not bool',)) +! vim.current.window.height = "abc":(, TypeError('an integer is required',)) +! vim.current.window.width = "abc":(, TypeError('an integer is required',)) +! vim.current.window.xxxxxx = True:(, AttributeError('xxxxxx',)) +! > WinList +! >> WinListItem +! vim.windows[1000]:(, IndexError('no such window',)) +! > Buffer +! >> StringToLine (indirect) +! vim.current.buffer[0] = "\na":(, error('string cannot contain newlines',)) +! >> SetBufferLine (indirect) +! vim.current.buffer[0] = True:(, TypeError('bad argument type for built-in operation',)) +! >> SetBufferLines (indirect) +! vim.current.buffer[:] = True:(, TypeError('bad argument type for built-in operation',)) +! vim.current.buffer[:] = ["\na", "bc"]:(, error('string cannot contain newlines',)) +! >> InsertBufferLines (indirect) +! vim.current.buffer.append(None):(, TypeError('bad argument type for built-in operation',)) +! vim.current.buffer.append(["\na", "bc"]):(, error('string cannot contain newlines',)) +! vim.current.buffer.append("\nbc"):(, error('string cannot contain newlines',)) +! >> RBItem +! vim.current.buffer[10000000000]:(, IndexError('line number out of range',)) +! >> RBAsItem +! vim.current.buffer[10000000000] = "":(, IndexError('line number out of range',)) +! >> BufferAttr +! vim.current.buffer.xxx:(, AttributeError('xxx',)) +! >> BufferSetattr +! vim.current.buffer.name = True:(, TypeError('object must be string',)) +! vim.current.buffer.xxx = True:(, AttributeError('xxx',)) +! >> BufferMark +! vim.current.buffer.mark(0):(, TypeError('must be string, not int',)) +! vim.current.buffer.mark("abc"):(, ValueError('mark name must be a single character',)) +! vim.current.buffer.mark("!"):(, error('invalid mark name',)) +! >> BufferRange +! vim.current.buffer.range(1, 2, 3):(, TypeError('function takes exactly 2 arguments (3 given)',)) +! > BufMap +! >> BufMapItem +! vim.buffers[None]:(, TypeError('key must be integer',)) +! vim.buffers[100000000]:(, KeyError(100000000,)) +! > Current +! >> CurrentGetattr +! vim.current.xxx:(, AttributeError('xxx',)) +! >> CurrentSetattr +! vim.current.line = True:(, TypeError('bad argument type for built-in operation',)) +! vim.current.buffer = True:(, TypeError('expected vim.Buffer object',)) +! vim.current.window = True:(, TypeError('expected vim.Window object',)) +! vim.current.tabpage = True:(, TypeError('expected vim.TabPage object',)) +! vim.current.xxx = True:(, AttributeError('xxx',)) +! vim.command("throw 'abc'"):(, error('abc',)) +! Exe("throw 'def'"):(, error('def',)) +! vim.eval("Exe('throw ''ghi''')"):(, error('ghi',)) +! vim.eval("Exe('echoerr ''jkl''')"):(, error('Vim(echoerr):jkl',)) +! vim.eval("Exe('xxx_non_existent_command_xxx')"):(, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',)) +! vim.bindeval("Exe('xxx_non_existent_command_xxx')"):(, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',)) +*** ../vim-7.3.1065/src/testdir/test87.in 2013-05-30 13:14:06.000000000 +0200 +--- src/testdir/test87.in 2013-05-30 13:25:22.000000000 +0200 +*************** +*** 746,761 **** + :$put =string(py3eval('dl2')) + :$put =string(py3eval('df(2)')) + :" +! :" Test exceptions +! :fun Exe(e) +! : execute a:e + :endfun + py3 << EOF + def ee(expr, g=globals(), l=locals()): + try: +! exec(expr, g, l) + except Exception as e: +! cb.append(repr((e.__class__, e))) + Exe = vim.bindeval('function("Exe")') + ee('vim.command("throw \'abc\'")') + ee('Exe("throw \'def\'")') +--- 746,1026 ---- + :$put =string(py3eval('dl2')) + :$put =string(py3eval('df(2)')) + :" +! :" Test errors +! :fun F() dict +! :endfun +! :fun D() + :endfun + py3 << EOF + def ee(expr, g=globals(), l=locals()): + try: +! try: +! exec(expr, g, l) +! except Exception as e: +! cb.append(expr + ':' + repr((e.__class__, e))) +! else: +! cb.append(expr + ':NOT FAILED') + except Exception as e: +! cb.append(expr + '::' + repr((e.__class__, e))) +! +! d = vim.Dictionary() +! ned = vim.Dictionary(foo='bar', baz='abc') +! dl = vim.Dictionary(a=1) +! dl.locked = True +! l = vim.List() +! ll = vim.List('abc') +! ll.locked = True +! f = vim.Function('string') +! fd = vim.Function('F') +! fdel = vim.Function('D') +! vim.command('delfunction D') +! +! def subexpr_test(expr, name, subexprs): +! cb.append('>>> Testing %s using %s' % (name, expr)) +! for subexpr in subexprs: +! ee(expr % subexpr) +! cb.append('<<< Finished') +! +! def stringtochars_test(expr): +! return subexpr_test(expr, 'StringToChars', ( +! '1', # Fail type checks +! 'u"\\0"', # Fail PyString_AsStringAndSize(bytes, , NULL) check +! '"\\0"', # Fail PyString_AsStringAndSize(object, , NULL) check +! )) +! +! class Mapping(object): +! def __init__(self, d): +! self.d = d +! +! def __getitem__(self, key): +! return self.d[key] +! +! def keys(self): +! return self.d.keys() +! +! def items(self): +! return self.d.items() +! +! def convertfrompyobject_test(expr, recurse=True): +! # pydict_to_tv +! stringtochars_test(expr % '{%s : 1}') +! if recurse: +! convertfrompyobject_test(expr % '{"abc" : %s}', False) +! # pymap_to_tv +! stringtochars_test(expr % 'Mapping({%s : 1})') +! if recurse: +! convertfrompyobject_test(expr % 'Mapping({"abc" : %s})', False) +! # pyseq_to_tv +! iter_test(expr) +! return subexpr_test(expr, 'ConvertFromPyObject', ( +! 'None', # Not conversible +! '{"": 1}', # Empty key not allowed +! 'FailingMapping()', # +! 'FailingMappingKey()', # +! )) +! +! def convertfrompymapping_test(expr): +! convertfrompyobject_test(expr) +! return subexpr_test(expr, 'ConvertFromPyMapping', ( +! '[]', +! )) +! +! def iter_test(expr): +! return subexpr_test(expr, '*Iter*', ( +! 'FailingIter()', +! 'FailingIterNext()', +! )) +! +! class FailingTrue(object): +! def __bool__(self): +! raise NotImplementedError +! +! class FailingIter(object): +! def __iter__(self): +! raise NotImplementedError +! +! class FailingIterNext(object): +! def __iter__(self): +! return self +! +! def __next__(self): +! raise NotImplementedError +! +! class FailingMappingKey(object): +! def __getitem__(self, item): +! raise NotImplementedError +! +! def keys(self): +! return list("abc") +! +! class FailingMapping(object): +! def __getitem__(self): +! raise NotImplementedError +! +! def keys(self): +! raise NotImplementedError +! +! class FailingList(list): +! def __getitem__(self, idx): +! if i == 2: +! raise NotImplementedError +! else: +! return super(FailingList, self).__getitem__(idx) +! +! cb.append("> Output") +! cb.append(">> OutputSetattr") +! ee('del sys.stdout.softspace') +! ee('sys.stdout.softspace = []') +! ee('sys.stdout.attr = None') +! cb.append(">> OutputWrite") +! ee('sys.stdout.write(None)') +! cb.append(">> OutputWriteLines") +! ee('sys.stdout.writelines(None)') +! ee('sys.stdout.writelines([1])') +! iter_test('sys.stdout.writelines(%s)') +! cb.append("> VimCommand") +! ee('vim.command(1)') +! #! Not checked: vim->python exceptions translating: checked later +! cb.append("> VimToPython") +! #! Not checked: everything: needs errors in internal python functions +! cb.append("> VimEval") +! ee('vim.eval(1)') +! #! Not checked: everything: needs errors in internal python functions +! cb.append("> VimEvalPy") +! ee('vim.bindeval(1)') +! #! Not checked: vim->python exceptions translating: checked later +! cb.append("> VimStrwidth") +! ee('vim.strwidth(1)') +! cb.append("> Dictionary") +! cb.append(">> DictionaryConstructor") +! ee('vim.Dictionary("abc")') +! ##! Not checked: py_dict_alloc failure +! cb.append(">> DictionarySetattr") +! ee('del d.locked') +! ee('d.locked = FailingTrue()') +! ee('vim.vvars.locked = False') +! ee('d.scope = True') +! ee('d.xxx = True') +! cb.append(">> _DictionaryItem") +! ee('d.get("a", 2, 3)') +! stringtochars_test('d.get(%s)') +! ee('d.pop("a")') +! ee('dl.pop("a")') +! cb.append(">> DictionaryIterNext") +! ee('for i in ned: ned["a"] = 1') +! cb.append(">> DictionaryAssItem") +! ee('dl["b"] = 1') +! stringtochars_test('d[%s] = 1') +! convertfrompyobject_test('d["a"] = %s') +! cb.append(">> DictionaryUpdate") +! cb.append(">>> kwargs") +! cb.append(">>> iter") +! ee('d.update(FailingMapping())') +! ee('d.update([FailingIterNext()])') +! iter_test('d.update(%s)') +! convertfrompyobject_test('d.update(%s)') +! stringtochars_test('d.update(((%s, 0),))') +! convertfrompyobject_test('d.update((("a", %s),))') +! cb.append(">> DictionaryPopItem") +! ee('d.popitem(1, 2)') +! cb.append(">> DictionaryHasKey") +! ee('d.has_key()') +! cb.append("> List") +! cb.append(">> ListConstructor") +! ee('vim.List(1, 2)') +! ee('vim.List(a=1)') +! iter_test('vim.List(%s)') +! convertfrompyobject_test('vim.List([%s])') +! cb.append(">> ListItem") +! ee('l[1000]') +! cb.append(">> ListAssItem") +! ee('ll[1] = 2') +! ee('l[1000] = 3') +! cb.append(">> ListAssSlice") +! ee('ll[1:100] = "abc"') +! iter_test('l[:] = %s') +! convertfrompyobject_test('l[:] = [%s]') +! cb.append(">> ListConcatInPlace") +! iter_test('l.extend(%s)') +! convertfrompyobject_test('l.extend([%s])') +! cb.append(">> ListSetattr") +! ee('del l.locked') +! ee('l.locked = FailingTrue()') +! ee('l.xxx = True') +! cb.append("> Function") +! cb.append(">> FunctionConstructor") +! ee('vim.Function("123")') +! ee('vim.Function("xxx_non_existent_function_xxx")') +! ee('vim.Function("xxx#non#existent#function#xxx")') +! cb.append(">> FunctionCall") +! convertfrompyobject_test('f(%s)') +! convertfrompymapping_test('fd(self=%s)') +! cb.append("> TabPage") +! cb.append(">> TabPageAttr") +! ee('vim.current.tabpage.xxx') +! cb.append("> TabList") +! cb.append(">> TabListItem") +! ee('vim.tabpages[1000]') +! cb.append("> Window") +! cb.append(">> WindowAttr") +! ee('vim.current.window.xxx') +! cb.append(">> WindowSetattr") +! ee('vim.current.window.buffer = 0') +! ee('vim.current.window.cursor = (10000000000, 100000000)') +! ee('vim.current.window.cursor = True') +! ee('vim.current.window.height = "abc"') +! ee('vim.current.window.width = "abc"') +! ee('vim.current.window.xxxxxx = True') +! cb.append("> WinList") +! cb.append(">> WinListItem") +! ee('vim.windows[1000]') +! cb.append("> Buffer") +! cb.append(">> StringToLine (indirect)") +! ee('vim.current.buffer[0] = "\\na"') +! cb.append(">> SetBufferLine (indirect)") +! ee('vim.current.buffer[0] = True') +! cb.append(">> SetBufferLines (indirect)") +! ee('vim.current.buffer[:] = True') +! ee('vim.current.buffer[:] = ["\\na", "bc"]') +! cb.append(">> InsertBufferLines (indirect)") +! ee('vim.current.buffer.append(None)') +! ee('vim.current.buffer.append(["\\na", "bc"])') +! ee('vim.current.buffer.append("\\nbc")') +! cb.append(">> RBItem") +! ee('vim.current.buffer[10000000000]') +! cb.append(">> RBAsItem") +! ee('vim.current.buffer[10000000000] = ""') +! cb.append(">> BufferAttr") +! ee('vim.current.buffer.xxx') +! cb.append(">> BufferSetattr") +! ee('vim.current.buffer.name = True') +! ee('vim.current.buffer.xxx = True') +! cb.append(">> BufferMark") +! ee('vim.current.buffer.mark(0)') +! ee('vim.current.buffer.mark("abc")') +! ee('vim.current.buffer.mark("!")') +! cb.append(">> BufferRange") +! ee('vim.current.buffer.range(1, 2, 3)') +! cb.append("> BufMap") +! cb.append(">> BufMapItem") +! ee('vim.buffers[None]') +! ee('vim.buffers[100000000]') +! cb.append("> Current") +! cb.append(">> CurrentGetattr") +! ee('vim.current.xxx') +! cb.append(">> CurrentSetattr") +! ee('vim.current.line = True') +! ee('vim.current.buffer = True') +! ee('vim.current.window = True') +! ee('vim.current.tabpage = True') +! ee('vim.current.xxx = True') +! EOF +! :" +! :" Test exceptions +! :fun Exe(e) +! : execute a:e +! :endfun +! py3 << EOF + Exe = vim.bindeval('function("Exe")') + ee('vim.command("throw \'abc\'")') + ee('Exe("throw \'def\'")') +*** ../vim-7.3.1065/src/testdir/test87.ok 2013-05-30 13:14:06.000000000 +0200 +--- src/testdir/test87.ok 2013-05-30 13:25:22.000000000 +0200 +*************** +*** 418,426 **** + ['a', 'b', 'c'] + [2, 2] + [2, 2] +! (, error('abc',)) +! (, error('def',)) +! (, error('ghi',)) +! (, error('Vim(echoerr):jkl',)) +! (, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',)) +! (, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',)) +--- 418,1070 ---- + ['a', 'b', 'c'] + [2, 2] + [2, 2] +! > Output +! >> OutputSetattr +! del sys.stdout.softspace:(, AttributeError("can't delete OutputObject attributes",)) +! sys.stdout.softspace = []:(, TypeError('softspace must be an integer',)) +! sys.stdout.attr = None:(, AttributeError('invalid attribute',)) +! >> OutputWrite +! sys.stdout.write(None):(, TypeError("Can't convert 'NoneType' object to str implicitly",)) +! >> OutputWriteLines +! sys.stdout.writelines(None):(, TypeError("'NoneType' object is not iterable",)) +! sys.stdout.writelines([1]):(, TypeError('writelines() requires list of strings',)) +! >>> Testing *Iter* using sys.stdout.writelines(%s) +! sys.stdout.writelines(FailingIter()):(, NotImplementedError()) +! sys.stdout.writelines(FailingIterNext()):(, NotImplementedError()) +! <<< Finished +! > VimCommand +! vim.command(1):(, TypeError('must be str, not int',)) +! > VimToPython +! > VimEval +! vim.eval(1):(, TypeError('must be str, not int',)) +! > VimEvalPy +! vim.bindeval(1):(, TypeError('must be str, not int',)) +! > VimStrwidth +! vim.strwidth(1):(, TypeError('must be str, not int',)) +! > Dictionary +! >> DictionaryConstructor +! vim.Dictionary("abc"):(, ValueError('expected sequence element of size 2',)) +! >> DictionarySetattr +! del d.locked:(, AttributeError('cannot delete vim.Dictionary attributes',)) +! d.locked = FailingTrue():(, NotImplementedError()) +! vim.vvars.locked = False:(, TypeError('cannot modify fixed dictionary',)) +! d.scope = True:(, AttributeError('cannot set this attribute',)) +! d.xxx = True:(, AttributeError('cannot set this attribute',)) +! >> _DictionaryItem +! d.get("a", 2, 3):(, TypeError('function takes at most 2 arguments (3 given)',)) +! >>> Testing StringToChars using d.get(%s) +! d.get(1):(, TypeError('object must be string',)) +! d.get(u"\0"):(, TypeError('expected bytes with no null',)) +! d.get("\0"):(, TypeError('expected bytes with no null',)) +! <<< Finished +! d.pop("a"):(, KeyError('a',)) +! dl.pop("a"):(, error('dict is locked',)) +! >> DictionaryIterNext +! for i in ned: ned["a"] = 1:(, RuntimeError('hashtab changed during iteration',)) +! >> DictionaryAssItem +! dl["b"] = 1:(, error('dict is locked',)) +! >>> Testing StringToChars using d[%s] = 1 +! d[1] = 1:(, TypeError('object must be string',)) +! d[u"\0"] = 1:(, TypeError('expected bytes with no null',)) +! d["\0"] = 1:(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d["a"] = {%s : 1} +! d["a"] = {1 : 1}:(, TypeError('object must be string',)) +! d["a"] = {u"\0" : 1}:(, TypeError('expected bytes with no null',)) +! d["a"] = {"\0" : 1}:(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d["a"] = {"abc" : {%s : 1}} +! d["a"] = {"abc" : {1 : 1}}:(, TypeError('object must be string',)) +! d["a"] = {"abc" : {u"\0" : 1}}:(, TypeError('expected bytes with no null',)) +! d["a"] = {"abc" : {"\0" : 1}}:(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d["a"] = {"abc" : Mapping({%s : 1})} +! d["a"] = {"abc" : Mapping({1 : 1})}:(, TypeError('object must be string',)) +! d["a"] = {"abc" : Mapping({u"\0" : 1})}:(, TypeError('expected bytes with no null',)) +! d["a"] = {"abc" : Mapping({"\0" : 1})}:(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using d["a"] = {"abc" : %s} +! d["a"] = {"abc" : FailingIter()}:(, TypeError('unable to convert to vim structure',)) +! d["a"] = {"abc" : FailingIterNext()}:(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d["a"] = {"abc" : %s} +! d["a"] = {"abc" : None}:(, TypeError('unable to convert to vim structure',)) +! d["a"] = {"abc" : {"": 1}}:(, ValueError('empty keys are not allowed',)) +! d["a"] = {"abc" : FailingMapping()}:(, NotImplementedError()) +! d["a"] = {"abc" : FailingMappingKey()}:(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using d["a"] = Mapping({%s : 1}) +! d["a"] = Mapping({1 : 1}):(, TypeError('object must be string',)) +! d["a"] = Mapping({u"\0" : 1}):(, TypeError('expected bytes with no null',)) +! d["a"] = Mapping({"\0" : 1}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d["a"] = Mapping({"abc" : {%s : 1}}) +! d["a"] = Mapping({"abc" : {1 : 1}}):(, TypeError('object must be string',)) +! d["a"] = Mapping({"abc" : {u"\0" : 1}}):(, TypeError('expected bytes with no null',)) +! d["a"] = Mapping({"abc" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d["a"] = Mapping({"abc" : Mapping({%s : 1})}) +! d["a"] = Mapping({"abc" : Mapping({1 : 1})}):(, TypeError('object must be string',)) +! d["a"] = Mapping({"abc" : Mapping({u"\0" : 1})}):(, TypeError('expected bytes with no null',)) +! d["a"] = Mapping({"abc" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using d["a"] = Mapping({"abc" : %s}) +! d["a"] = Mapping({"abc" : FailingIter()}):(, TypeError('unable to convert to vim structure',)) +! d["a"] = Mapping({"abc" : FailingIterNext()}):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abc" : %s}) +! d["a"] = Mapping({"abc" : None}):(, TypeError('unable to convert to vim structure',)) +! d["a"] = Mapping({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! d["a"] = Mapping({"abc" : FailingMapping()}):(, NotImplementedError()) +! d["a"] = Mapping({"abc" : FailingMappingKey()}):(, NotImplementedError()) +! <<< Finished +! >>> Testing *Iter* using d["a"] = %s +! d["a"] = FailingIter():(, TypeError('unable to convert to vim structure',)) +! d["a"] = FailingIterNext():(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d["a"] = %s +! d["a"] = None:(, TypeError('unable to convert to vim structure',)) +! d["a"] = {"": 1}:(, ValueError('empty keys are not allowed',)) +! d["a"] = FailingMapping():(, NotImplementedError()) +! d["a"] = FailingMappingKey():(, NotImplementedError()) +! <<< Finished +! >> DictionaryUpdate +! >>> kwargs +! >>> iter +! d.update(FailingMapping()):(, NotImplementedError()) +! d.update([FailingIterNext()]):(, NotImplementedError()) +! >>> Testing *Iter* using d.update(%s) +! d.update(FailingIter()):(, NotImplementedError()) +! d.update(FailingIterNext()):(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using d.update({%s : 1}) +! d.update({1 : 1}):(, TypeError('object must be string',)) +! d.update({u"\0" : 1}):(, TypeError('expected bytes with no null',)) +! d.update({"\0" : 1}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d.update({"abc" : {%s : 1}}) +! d.update({"abc" : {1 : 1}}):(, TypeError('object must be string',)) +! d.update({"abc" : {u"\0" : 1}}):(, TypeError('expected bytes with no null',)) +! d.update({"abc" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d.update({"abc" : Mapping({%s : 1})}) +! d.update({"abc" : Mapping({1 : 1})}):(, TypeError('object must be string',)) +! d.update({"abc" : Mapping({u"\0" : 1})}):(, TypeError('expected bytes with no null',)) +! d.update({"abc" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using d.update({"abc" : %s}) +! d.update({"abc" : FailingIter()}):(, TypeError('unable to convert to vim structure',)) +! d.update({"abc" : FailingIterNext()}):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update({"abc" : %s}) +! d.update({"abc" : None}):(, TypeError('unable to convert to vim structure',)) +! d.update({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! d.update({"abc" : FailingMapping()}):(, NotImplementedError()) +! d.update({"abc" : FailingMappingKey()}):(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using d.update(Mapping({%s : 1})) +! d.update(Mapping({1 : 1})):(, TypeError('object must be string',)) +! d.update(Mapping({u"\0" : 1})):(, TypeError('expected bytes with no null',)) +! d.update(Mapping({"\0" : 1})):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d.update(Mapping({"abc" : {%s : 1}})) +! d.update(Mapping({"abc" : {1 : 1}})):(, TypeError('object must be string',)) +! d.update(Mapping({"abc" : {u"\0" : 1}})):(, TypeError('expected bytes with no null',)) +! d.update(Mapping({"abc" : {"\0" : 1}})):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d.update(Mapping({"abc" : Mapping({%s : 1})})) +! d.update(Mapping({"abc" : Mapping({1 : 1})})):(, TypeError('object must be string',)) +! d.update(Mapping({"abc" : Mapping({u"\0" : 1})})):(, TypeError('expected bytes with no null',)) +! d.update(Mapping({"abc" : Mapping({"\0" : 1})})):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using d.update(Mapping({"abc" : %s})) +! d.update(Mapping({"abc" : FailingIter()})):(, TypeError('unable to convert to vim structure',)) +! d.update(Mapping({"abc" : FailingIterNext()})):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update(Mapping({"abc" : %s})) +! d.update(Mapping({"abc" : None})):(, TypeError('unable to convert to vim structure',)) +! d.update(Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) +! d.update(Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) +! d.update(Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) +! <<< Finished +! >>> Testing *Iter* using d.update(%s) +! d.update(FailingIter()):(, NotImplementedError()) +! d.update(FailingIterNext()):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update(%s) +! d.update(None):(, TypeError("'NoneType' object is not iterable",)) +! d.update({"": 1}):(, ValueError('empty keys are not allowed',)) +! d.update(FailingMapping()):(, NotImplementedError()) +! d.update(FailingMappingKey()):(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using d.update(((%s, 0),)) +! d.update(((1, 0),)):(, TypeError('object must be string',)) +! d.update(((u"\0", 0),)):(, TypeError('expected bytes with no null',)) +! d.update((("\0", 0),)):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d.update((("a", {%s : 1}),)) +! d.update((("a", {1 : 1}),)):(, TypeError('object must be string',)) +! d.update((("a", {u"\0" : 1}),)):(, TypeError('expected bytes with no null',)) +! d.update((("a", {"\0" : 1}),)):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d.update((("a", {"abc" : {%s : 1}}),)) +! d.update((("a", {"abc" : {1 : 1}}),)):(, TypeError('object must be string',)) +! d.update((("a", {"abc" : {u"\0" : 1}}),)):(, TypeError('expected bytes with no null',)) +! d.update((("a", {"abc" : {"\0" : 1}}),)):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d.update((("a", {"abc" : Mapping({%s : 1})}),)) +! d.update((("a", {"abc" : Mapping({1 : 1})}),)):(, TypeError('object must be string',)) +! d.update((("a", {"abc" : Mapping({u"\0" : 1})}),)):(, TypeError('expected bytes with no null',)) +! d.update((("a", {"abc" : Mapping({"\0" : 1})}),)):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using d.update((("a", {"abc" : %s}),)) +! d.update((("a", {"abc" : FailingIter()}),)):(, TypeError('unable to convert to vim structure',)) +! d.update((("a", {"abc" : FailingIterNext()}),)):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update((("a", {"abc" : %s}),)) +! d.update((("a", {"abc" : None}),)):(, TypeError('unable to convert to vim structure',)) +! d.update((("a", {"abc" : {"": 1}}),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", {"abc" : FailingMapping()}),)):(, NotImplementedError()) +! d.update((("a", {"abc" : FailingMappingKey()}),)):(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),)) +! d.update((("a", Mapping({1 : 1})),)):(, TypeError('object must be string',)) +! d.update((("a", Mapping({u"\0" : 1})),)):(, TypeError('expected bytes with no null',)) +! d.update((("a", Mapping({"\0" : 1})),)):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d.update((("a", Mapping({"abc" : {%s : 1}})),)) +! d.update((("a", Mapping({"abc" : {1 : 1}})),)):(, TypeError('object must be string',)) +! d.update((("a", Mapping({"abc" : {u"\0" : 1}})),)):(, TypeError('expected bytes with no null',)) +! d.update((("a", Mapping({"abc" : {"\0" : 1}})),)):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d.update((("a", Mapping({"abc" : Mapping({%s : 1})})),)) +! d.update((("a", Mapping({"abc" : Mapping({1 : 1})})),)):(, TypeError('object must be string',)) +! d.update((("a", Mapping({"abc" : Mapping({u"\0" : 1})})),)):(, TypeError('expected bytes with no null',)) +! d.update((("a", Mapping({"abc" : Mapping({"\0" : 1})})),)):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using d.update((("a", Mapping({"abc" : %s})),)) +! d.update((("a", Mapping({"abc" : FailingIter()})),)):(, TypeError('unable to convert to vim structure',)) +! d.update((("a", Mapping({"abc" : FailingIterNext()})),)):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abc" : %s})),)) +! d.update((("a", Mapping({"abc" : None})),)):(, TypeError('unable to convert to vim structure',)) +! d.update((("a", Mapping({"abc" : {"": 1}})),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", Mapping({"abc" : FailingMapping()})),)):(, NotImplementedError()) +! d.update((("a", Mapping({"abc" : FailingMappingKey()})),)):(, NotImplementedError()) +! <<< Finished +! >>> Testing *Iter* using d.update((("a", %s),)) +! d.update((("a", FailingIter()),)):(, TypeError('unable to convert to vim structure',)) +! d.update((("a", FailingIterNext()),)):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update((("a", %s),)) +! d.update((("a", None),)):(, TypeError('unable to convert to vim structure',)) +! d.update((("a", {"": 1}),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", FailingMapping()),)):(, NotImplementedError()) +! d.update((("a", FailingMappingKey()),)):(, NotImplementedError()) +! <<< Finished +! >> DictionaryPopItem +! d.popitem(1, 2):(, TypeError('function takes exactly 1 argument (2 given)',)) +! >> DictionaryHasKey +! d.has_key():(, TypeError('function takes exactly 1 argument (0 given)',)) +! > List +! >> ListConstructor +! vim.List(1, 2):(, TypeError('function takes at most 1 argument (2 given)',)) +! vim.List(a=1):(, TypeError('list constructor does not accept keyword arguments',)) +! >>> Testing *Iter* using vim.List(%s) +! vim.List(FailingIter()):(, NotImplementedError()) +! vim.List(FailingIterNext()):(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using vim.List([{%s : 1}]) +! vim.List([{1 : 1}]):(, TypeError('object must be string',)) +! vim.List([{u"\0" : 1}]):(, TypeError('expected bytes with no null',)) +! vim.List([{"\0" : 1}]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using vim.List([{"abc" : {%s : 1}}]) +! vim.List([{"abc" : {1 : 1}}]):(, TypeError('object must be string',)) +! vim.List([{"abc" : {u"\0" : 1}}]):(, TypeError('expected bytes with no null',)) +! vim.List([{"abc" : {"\0" : 1}}]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using vim.List([{"abc" : Mapping({%s : 1})}]) +! vim.List([{"abc" : Mapping({1 : 1})}]):(, TypeError('object must be string',)) +! vim.List([{"abc" : Mapping({u"\0" : 1})}]):(, TypeError('expected bytes with no null',)) +! vim.List([{"abc" : Mapping({"\0" : 1})}]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using vim.List([{"abc" : %s}]) +! vim.List([{"abc" : FailingIter()}]):(, TypeError('unable to convert to vim structure',)) +! vim.List([{"abc" : FailingIterNext()}]):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using vim.List([{"abc" : %s}]) +! vim.List([{"abc" : None}]):(, TypeError('unable to convert to vim structure',)) +! vim.List([{"abc" : {"": 1}}]):(, ValueError('empty keys are not allowed',)) +! vim.List([{"abc" : FailingMapping()}]):(, NotImplementedError()) +! vim.List([{"abc" : FailingMappingKey()}]):(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using vim.List([Mapping({%s : 1})]) +! vim.List([Mapping({1 : 1})]):(, TypeError('object must be string',)) +! vim.List([Mapping({u"\0" : 1})]):(, TypeError('expected bytes with no null',)) +! vim.List([Mapping({"\0" : 1})]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using vim.List([Mapping({"abc" : {%s : 1}})]) +! vim.List([Mapping({"abc" : {1 : 1}})]):(, TypeError('object must be string',)) +! vim.List([Mapping({"abc" : {u"\0" : 1}})]):(, TypeError('expected bytes with no null',)) +! vim.List([Mapping({"abc" : {"\0" : 1}})]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using vim.List([Mapping({"abc" : Mapping({%s : 1})})]) +! vim.List([Mapping({"abc" : Mapping({1 : 1})})]):(, TypeError('object must be string',)) +! vim.List([Mapping({"abc" : Mapping({u"\0" : 1})})]):(, TypeError('expected bytes with no null',)) +! vim.List([Mapping({"abc" : Mapping({"\0" : 1})})]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using vim.List([Mapping({"abc" : %s})]) +! vim.List([Mapping({"abc" : FailingIter()})]):(, TypeError('unable to convert to vim structure',)) +! vim.List([Mapping({"abc" : FailingIterNext()})]):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using vim.List([Mapping({"abc" : %s})]) +! vim.List([Mapping({"abc" : None})]):(, TypeError('unable to convert to vim structure',)) +! vim.List([Mapping({"abc" : {"": 1}})]):(, ValueError('empty keys are not allowed',)) +! vim.List([Mapping({"abc" : FailingMapping()})]):(, NotImplementedError()) +! vim.List([Mapping({"abc" : FailingMappingKey()})]):(, NotImplementedError()) +! <<< Finished +! >>> Testing *Iter* using vim.List([%s]) +! vim.List([FailingIter()]):(, TypeError('unable to convert to vim structure',)) +! vim.List([FailingIterNext()]):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using vim.List([%s]) +! vim.List([None]):(, TypeError('unable to convert to vim structure',)) +! vim.List([{"": 1}]):(, ValueError('empty keys are not allowed',)) +! vim.List([FailingMapping()]):(, NotImplementedError()) +! vim.List([FailingMappingKey()]):(, NotImplementedError()) +! <<< Finished +! >> ListItem +! l[1000]:(, IndexError('list index out of range',)) +! >> ListAssItem +! ll[1] = 2:(, error('list is locked',)) +! l[1000] = 3:(, IndexError('list index out of range',)) +! >> ListAssSlice +! ll[1:100] = "abc":(, error('list is locked',)) +! >>> Testing *Iter* using l[:] = %s +! l[:] = FailingIter():(, NotImplementedError()) +! l[:] = FailingIterNext()::(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using l[:] = [{%s : 1}] +! l[:] = [{1 : 1}]:(, TypeError('object must be string',)) +! l[:] = [{u"\0" : 1}]:(, TypeError('expected bytes with no null',)) +! l[:] = [{"\0" : 1}]:(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using l[:] = [{"abc" : {%s : 1}}] +! l[:] = [{"abc" : {1 : 1}}]:(, TypeError('object must be string',)) +! l[:] = [{"abc" : {u"\0" : 1}}]:(, TypeError('expected bytes with no null',)) +! l[:] = [{"abc" : {"\0" : 1}}]:(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using l[:] = [{"abc" : Mapping({%s : 1})}] +! l[:] = [{"abc" : Mapping({1 : 1})}]:(, TypeError('object must be string',)) +! l[:] = [{"abc" : Mapping({u"\0" : 1})}]:(, TypeError('expected bytes with no null',)) +! l[:] = [{"abc" : Mapping({"\0" : 1})}]:(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using l[:] = [{"abc" : %s}] +! l[:] = [{"abc" : FailingIter()}]:(, TypeError('unable to convert to vim structure',)) +! l[:] = [{"abc" : FailingIterNext()}]:(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using l[:] = [{"abc" : %s}] +! l[:] = [{"abc" : None}]:(, TypeError('unable to convert to vim structure',)) +! l[:] = [{"abc" : {"": 1}}]:(, ValueError('empty keys are not allowed',)) +! l[:] = [{"abc" : FailingMapping()}]:(, NotImplementedError()) +! l[:] = [{"abc" : FailingMappingKey()}]:(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using l[:] = [Mapping({%s : 1})] +! l[:] = [Mapping({1 : 1})]:(, TypeError('object must be string',)) +! l[:] = [Mapping({u"\0" : 1})]:(, TypeError('expected bytes with no null',)) +! l[:] = [Mapping({"\0" : 1})]:(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using l[:] = [Mapping({"abc" : {%s : 1}})] +! l[:] = [Mapping({"abc" : {1 : 1}})]:(, TypeError('object must be string',)) +! l[:] = [Mapping({"abc" : {u"\0" : 1}})]:(, TypeError('expected bytes with no null',)) +! l[:] = [Mapping({"abc" : {"\0" : 1}})]:(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using l[:] = [Mapping({"abc" : Mapping({%s : 1})})] +! l[:] = [Mapping({"abc" : Mapping({1 : 1})})]:(, TypeError('object must be string',)) +! l[:] = [Mapping({"abc" : Mapping({u"\0" : 1})})]:(, TypeError('expected bytes with no null',)) +! l[:] = [Mapping({"abc" : Mapping({"\0" : 1})})]:(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using l[:] = [Mapping({"abc" : %s})] +! l[:] = [Mapping({"abc" : FailingIter()})]:(, TypeError('unable to convert to vim structure',)) +! l[:] = [Mapping({"abc" : FailingIterNext()})]:(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abc" : %s})] +! l[:] = [Mapping({"abc" : None})]:(, TypeError('unable to convert to vim structure',)) +! l[:] = [Mapping({"abc" : {"": 1}})]:(, ValueError('empty keys are not allowed',)) +! l[:] = [Mapping({"abc" : FailingMapping()})]:(, NotImplementedError()) +! l[:] = [Mapping({"abc" : FailingMappingKey()})]:(, NotImplementedError()) +! <<< Finished +! >>> Testing *Iter* using l[:] = [%s] +! l[:] = [FailingIter()]:(, TypeError('unable to convert to vim structure',)) +! l[:] = [FailingIterNext()]:(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using l[:] = [%s] +! l[:] = [None]:(, TypeError('unable to convert to vim structure',)) +! l[:] = [{"": 1}]:(, ValueError('empty keys are not allowed',)) +! l[:] = [FailingMapping()]:(, NotImplementedError()) +! l[:] = [FailingMappingKey()]:(, NotImplementedError()) +! <<< Finished +! >> ListConcatInPlace +! >>> Testing *Iter* using l.extend(%s) +! l.extend(FailingIter()):(, NotImplementedError()) +! l.extend(FailingIterNext()):(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using l.extend([{%s : 1}]) +! l.extend([{1 : 1}]):(, TypeError('object must be string',)) +! l.extend([{u"\0" : 1}]):(, TypeError('expected bytes with no null',)) +! l.extend([{"\0" : 1}]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using l.extend([{"abc" : {%s : 1}}]) +! l.extend([{"abc" : {1 : 1}}]):(, TypeError('object must be string',)) +! l.extend([{"abc" : {u"\0" : 1}}]):(, TypeError('expected bytes with no null',)) +! l.extend([{"abc" : {"\0" : 1}}]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using l.extend([{"abc" : Mapping({%s : 1})}]) +! l.extend([{"abc" : Mapping({1 : 1})}]):(, TypeError('object must be string',)) +! l.extend([{"abc" : Mapping({u"\0" : 1})}]):(, TypeError('expected bytes with no null',)) +! l.extend([{"abc" : Mapping({"\0" : 1})}]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using l.extend([{"abc" : %s}]) +! l.extend([{"abc" : FailingIter()}]):(, TypeError('unable to convert to vim structure',)) +! l.extend([{"abc" : FailingIterNext()}]):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using l.extend([{"abc" : %s}]) +! l.extend([{"abc" : None}]):(, TypeError('unable to convert to vim structure',)) +! l.extend([{"abc" : {"": 1}}]):(, ValueError('empty keys are not allowed',)) +! l.extend([{"abc" : FailingMapping()}]):(, NotImplementedError()) +! l.extend([{"abc" : FailingMappingKey()}]):(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using l.extend([Mapping({%s : 1})]) +! l.extend([Mapping({1 : 1})]):(, TypeError('object must be string',)) +! l.extend([Mapping({u"\0" : 1})]):(, TypeError('expected bytes with no null',)) +! l.extend([Mapping({"\0" : 1})]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using l.extend([Mapping({"abc" : {%s : 1}})]) +! l.extend([Mapping({"abc" : {1 : 1}})]):(, TypeError('object must be string',)) +! l.extend([Mapping({"abc" : {u"\0" : 1}})]):(, TypeError('expected bytes with no null',)) +! l.extend([Mapping({"abc" : {"\0" : 1}})]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using l.extend([Mapping({"abc" : Mapping({%s : 1})})]) +! l.extend([Mapping({"abc" : Mapping({1 : 1})})]):(, TypeError('object must be string',)) +! l.extend([Mapping({"abc" : Mapping({u"\0" : 1})})]):(, TypeError('expected bytes with no null',)) +! l.extend([Mapping({"abc" : Mapping({"\0" : 1})})]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using l.extend([Mapping({"abc" : %s})]) +! l.extend([Mapping({"abc" : FailingIter()})]):(, TypeError('unable to convert to vim structure',)) +! l.extend([Mapping({"abc" : FailingIterNext()})]):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using l.extend([Mapping({"abc" : %s})]) +! l.extend([Mapping({"abc" : None})]):(, TypeError('unable to convert to vim structure',)) +! l.extend([Mapping({"abc" : {"": 1}})]):(, ValueError('empty keys are not allowed',)) +! l.extend([Mapping({"abc" : FailingMapping()})]):(, NotImplementedError()) +! l.extend([Mapping({"abc" : FailingMappingKey()})]):(, NotImplementedError()) +! <<< Finished +! >>> Testing *Iter* using l.extend([%s]) +! l.extend([FailingIter()]):(, TypeError('unable to convert to vim structure',)) +! l.extend([FailingIterNext()]):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using l.extend([%s]) +! l.extend([None]):(, TypeError('unable to convert to vim structure',)) +! l.extend([{"": 1}]):(, ValueError('empty keys are not allowed',)) +! l.extend([FailingMapping()]):(, NotImplementedError()) +! l.extend([FailingMappingKey()]):(, NotImplementedError()) +! <<< Finished +! >> ListSetattr +! del l.locked:(, AttributeError('cannot delete vim.List attributes',)) +! l.locked = FailingTrue():(, NotImplementedError()) +! l.xxx = True:(, AttributeError('cannot set this attribute',)) +! > Function +! >> FunctionConstructor +! vim.Function("123"):(, ValueError('unnamed function does not exist',)) +! vim.Function("xxx_non_existent_function_xxx"):(, ValueError('function does not exist',)) +! vim.Function("xxx#non#existent#function#xxx"):(, ValueError('function does not exist',)) +! >> FunctionCall +! >>> Testing StringToChars using f({%s : 1}) +! f({1 : 1}):(, TypeError('object must be string',)) +! f({u"\0" : 1}):(, TypeError('expected bytes with no null',)) +! f({"\0" : 1}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using f({"abc" : {%s : 1}}) +! f({"abc" : {1 : 1}}):(, TypeError('object must be string',)) +! f({"abc" : {u"\0" : 1}}):(, TypeError('expected bytes with no null',)) +! f({"abc" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using f({"abc" : Mapping({%s : 1})}) +! f({"abc" : Mapping({1 : 1})}):(, TypeError('object must be string',)) +! f({"abc" : Mapping({u"\0" : 1})}):(, TypeError('expected bytes with no null',)) +! f({"abc" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using f({"abc" : %s}) +! f({"abc" : FailingIter()}):(, TypeError('unable to convert to vim structure',)) +! f({"abc" : FailingIterNext()}):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using f({"abc" : %s}) +! f({"abc" : None}):(, TypeError('unable to convert to vim structure',)) +! f({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! f({"abc" : FailingMapping()}):(, NotImplementedError()) +! f({"abc" : FailingMappingKey()}):(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using f(Mapping({%s : 1})) +! f(Mapping({1 : 1})):(, TypeError('object must be string',)) +! f(Mapping({u"\0" : 1})):(, TypeError('expected bytes with no null',)) +! f(Mapping({"\0" : 1})):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using f(Mapping({"abc" : {%s : 1}})) +! f(Mapping({"abc" : {1 : 1}})):(, TypeError('object must be string',)) +! f(Mapping({"abc" : {u"\0" : 1}})):(, TypeError('expected bytes with no null',)) +! f(Mapping({"abc" : {"\0" : 1}})):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using f(Mapping({"abc" : Mapping({%s : 1})})) +! f(Mapping({"abc" : Mapping({1 : 1})})):(, TypeError('object must be string',)) +! f(Mapping({"abc" : Mapping({u"\0" : 1})})):(, TypeError('expected bytes with no null',)) +! f(Mapping({"abc" : Mapping({"\0" : 1})})):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using f(Mapping({"abc" : %s})) +! f(Mapping({"abc" : FailingIter()})):(, TypeError('unable to convert to vim structure',)) +! f(Mapping({"abc" : FailingIterNext()})):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using f(Mapping({"abc" : %s})) +! f(Mapping({"abc" : None})):(, TypeError('unable to convert to vim structure',)) +! f(Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) +! f(Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) +! f(Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) +! <<< Finished +! >>> Testing *Iter* using f(%s) +! f(FailingIter()):(, TypeError('unable to convert to vim structure',)) +! f(FailingIterNext()):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using f(%s) +! f(None):(, TypeError('unable to convert to vim structure',)) +! f({"": 1}):(, ValueError('empty keys are not allowed',)) +! f(FailingMapping()):(, NotImplementedError()) +! f(FailingMappingKey()):(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using fd(self={%s : 1}) +! fd(self={1 : 1}):(, TypeError('object must be string',)) +! fd(self={u"\0" : 1}):(, TypeError('expected bytes with no null',)) +! fd(self={"\0" : 1}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using fd(self={"abc" : {%s : 1}}) +! fd(self={"abc" : {1 : 1}}):(, TypeError('object must be string',)) +! fd(self={"abc" : {u"\0" : 1}}):(, TypeError('expected bytes with no null',)) +! fd(self={"abc" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using fd(self={"abc" : Mapping({%s : 1})}) +! fd(self={"abc" : Mapping({1 : 1})}):(, TypeError('object must be string',)) +! fd(self={"abc" : Mapping({u"\0" : 1})}):(, TypeError('expected bytes with no null',)) +! fd(self={"abc" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using fd(self={"abc" : %s}) +! fd(self={"abc" : FailingIter()}):(, TypeError('unable to convert to vim structure',)) +! fd(self={"abc" : FailingIterNext()}):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using fd(self={"abc" : %s}) +! fd(self={"abc" : None}):(, TypeError('unable to convert to vim structure',)) +! fd(self={"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! fd(self={"abc" : FailingMapping()}):(, NotImplementedError()) +! fd(self={"abc" : FailingMappingKey()}):(, NotImplementedError()) +! <<< Finished +! >>> Testing StringToChars using fd(self=Mapping({%s : 1})) +! fd(self=Mapping({1 : 1})):(, TypeError('object must be string',)) +! fd(self=Mapping({u"\0" : 1})):(, TypeError('expected bytes with no null',)) +! fd(self=Mapping({"\0" : 1})):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using fd(self=Mapping({"abc" : {%s : 1}})) +! fd(self=Mapping({"abc" : {1 : 1}})):(, TypeError('object must be string',)) +! fd(self=Mapping({"abc" : {u"\0" : 1}})):(, TypeError('expected bytes with no null',)) +! fd(self=Mapping({"abc" : {"\0" : 1}})):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using fd(self=Mapping({"abc" : Mapping({%s : 1})})) +! fd(self=Mapping({"abc" : Mapping({1 : 1})})):(, TypeError('object must be string',)) +! fd(self=Mapping({"abc" : Mapping({u"\0" : 1})})):(, TypeError('expected bytes with no null',)) +! fd(self=Mapping({"abc" : Mapping({"\0" : 1})})):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using fd(self=Mapping({"abc" : %s})) +! fd(self=Mapping({"abc" : FailingIter()})):(, TypeError('unable to convert to vim structure',)) +! fd(self=Mapping({"abc" : FailingIterNext()})):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using fd(self=Mapping({"abc" : %s})) +! fd(self=Mapping({"abc" : None})):(, TypeError('unable to convert to vim structure',)) +! fd(self=Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) +! fd(self=Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) +! fd(self=Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) +! <<< Finished +! >>> Testing *Iter* using fd(self=%s) +! fd(self=FailingIter()):(, TypeError('unable to convert object to vim dictionary',)) +! fd(self=FailingIterNext()):(, TypeError('unable to convert object to vim dictionary',)) +! <<< Finished +! >>> Testing ConvertFromPyObject using fd(self=%s) +! fd(self=None):(, TypeError('unable to convert object to vim dictionary',)) +! fd(self={"": 1}):(, ValueError('empty keys are not allowed',)) +! fd(self=FailingMapping()):(, NotImplementedError()) +! fd(self=FailingMappingKey()):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyMapping using fd(self=%s) +! fd(self=[]):(, AttributeError("'list' object has no attribute 'keys'",)) +! <<< Finished +! > TabPage +! >> TabPageAttr +! vim.current.tabpage.xxx:(, AttributeError("'vim.tabpage' object has no attribute 'xxx'",)) +! > TabList +! >> TabListItem +! vim.tabpages[1000]:(, IndexError('no such tab page',)) +! > Window +! >> WindowAttr +! vim.current.window.xxx:(, AttributeError("'vim.window' object has no attribute 'xxx'",)) +! >> WindowSetattr +! vim.current.window.buffer = 0:(, TypeError('readonly attribute',)) +! vim.current.window.cursor = (10000000000, 100000000):(, error('cursor position outside buffer',)) +! vim.current.window.cursor = True:(, TypeError('argument must be 2-item sequence, not bool',)) +! vim.current.window.height = "abc":(, TypeError('an integer is required',)) +! vim.current.window.width = "abc":(, TypeError('an integer is required',)) +! vim.current.window.xxxxxx = True:(, AttributeError('xxxxxx',)) +! > WinList +! >> WinListItem +! vim.windows[1000]:(, IndexError('no such window',)) +! > Buffer +! >> StringToLine (indirect) +! vim.current.buffer[0] = "\na":(, error('string cannot contain newlines',)) +! >> SetBufferLine (indirect) +! vim.current.buffer[0] = True:(, TypeError('bad argument type for built-in operation',)) +! >> SetBufferLines (indirect) +! vim.current.buffer[:] = True:(, TypeError('bad argument type for built-in operation',)) +! vim.current.buffer[:] = ["\na", "bc"]:(, error('string cannot contain newlines',)) +! >> InsertBufferLines (indirect) +! vim.current.buffer.append(None):(, TypeError('bad argument type for built-in operation',)) +! vim.current.buffer.append(["\na", "bc"]):(, error('string cannot contain newlines',)) +! vim.current.buffer.append("\nbc"):(, error('string cannot contain newlines',)) +! >> RBItem +! vim.current.buffer[10000000000]:(, IndexError('line number out of range',)) +! >> RBAsItem +! vim.current.buffer[10000000000] = "":(, IndexError('line number out of range',)) +! >> BufferAttr +! vim.current.buffer.xxx:(, AttributeError("'vim.buffer' object has no attribute 'xxx'",)) +! >> BufferSetattr +! vim.current.buffer.name = True:(, TypeError('object must be string',)) +! vim.current.buffer.xxx = True:(, AttributeError('xxx',)) +! >> BufferMark +! vim.current.buffer.mark(0):(, TypeError('must be str, not int',)) +! vim.current.buffer.mark("abc"):(, ValueError('mark name must be a single character',)) +! vim.current.buffer.mark("!"):(, error('invalid mark name',)) +! >> BufferRange +! vim.current.buffer.range(1, 2, 3):(, TypeError('function takes exactly 2 arguments (3 given)',)) +! > BufMap +! >> BufMapItem +! vim.buffers[None]:(, TypeError('key must be integer',)) +! vim.buffers[100000000]:(, KeyError(100000000,)) +! > Current +! >> CurrentGetattr +! vim.current.xxx:(, AttributeError("'vim.currentdata' object has no attribute 'xxx'",)) +! >> CurrentSetattr +! vim.current.line = True:(, TypeError('bad argument type for built-in operation',)) +! vim.current.buffer = True:(, TypeError('expected vim.Buffer object',)) +! vim.current.window = True:(, TypeError('expected vim.Window object',)) +! vim.current.tabpage = True:(, TypeError('expected vim.TabPage object',)) +! vim.current.xxx = True:(, AttributeError('xxx',)) +! vim.command("throw 'abc'"):(, error('abc',)) +! Exe("throw 'def'"):(, error('def',)) +! vim.eval("Exe('throw ''ghi''')"):(, error('ghi',)) +! vim.eval("Exe('echoerr ''jkl''')"):(, error('Vim(echoerr):jkl',)) +! vim.eval("Exe('xxx_non_existent_command_xxx')"):(, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',)) +! vim.bindeval("Exe('xxx_non_existent_command_xxx')"):(, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',)) +*** ../vim-7.3.1065/src/version.c 2013-05-30 13:22:07.000000000 +0200 +--- src/version.c 2013-05-30 13:24:41.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1066, + /**/ + +-- +If Pacman had affected us as kids we'd be running around in dark rooms, +munching pills and listening to repetitive music. + -- Marcus Brigstocke + + /// 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 /// diff --git a/7.3.1067 b/7.3.1067 new file mode 100644 index 0000000..0725a8b --- /dev/null +++ b/7.3.1067 @@ -0,0 +1,158 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1067 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1067 +Problem: Python: documentation lags behind. +Solution: Python patch 26. (ZyX) +Files: runtime/doc/if_pyth.txt + + +*** ../vim-7.3.1066/runtime/doc/if_pyth.txt 2013-05-30 13:01:14.000000000 +0200 +--- runtime/doc/if_pyth.txt 2013-05-30 13:31:16.000000000 +0200 +*************** +*** 480,496 **** + vim.VAR_DEF_SCOPE |g:| or |l:| dictionary + vim.VAR_SCOPE Other scope dictionary, + see |internal-variables| +! Methods: + Method Description ~ + keys() Returns a list with dictionary keys. + values() Returns a list with dictionary values. + items() Returns a list of 2-tuples with dictionary contents. +! update(iterable) +! update(dictionary) +! update(**kwargs) + Adds keys to dictionary. + Examples: > +! py d = vim.bindeval('{}') + d['a'] = 'b' # Item assignment + print d['a'] # getting item + d.update({'c': 'd'}) # .update(dictionary) +--- 480,515 ---- + vim.VAR_DEF_SCOPE |g:| or |l:| dictionary + vim.VAR_SCOPE Other scope dictionary, + see |internal-variables| +! Methods (note: methods do not support keyword arguments): + Method Description ~ + keys() Returns a list with dictionary keys. + values() Returns a list with dictionary values. + items() Returns a list of 2-tuples with dictionary contents. +! update(iterable), update(dictionary), update(**kwargs) + Adds keys to dictionary. ++ get(key[, default=None]) ++ Obtain key from dictionary, returning the default if it is ++ not present. ++ pop(key[, default]) ++ Remove specified key from dictionary and return ++ corresponding value. If key is not found and default is ++ given returns the default, otherwise raises KeyError. ++ popitem(key) ++ Remove specified key from dictionary and return a pair ++ with it and the corresponding value. Returned key is a new ++ object. ++ has_key(key) ++ Check whether dictionary contains specified key, similar ++ to `key in dict`. ++ ++ __new__(), __new__(iterable), __new__(dictionary), __new__(update) ++ You can use `vim.Dictionary()` to create new vim ++ dictionaries. `d=vim.Dictionary(arg)` is the same as ++ `d=vim.bindeval('{}');d.update(arg)`. Without arguments ++ constructs empty dictionary. ++ + Examples: > +! d = vim.Dictionary(food="bar") # Constructor + d['a'] = 'b' # Item assignment + print d['a'] # getting item + d.update({'c': 'd'}) # .update(dictionary) +*************** +*** 501,506 **** +--- 520,526 ---- + for key, val in d.items(): # .items() + print isinstance(d, vim.Dictionary) # True + for key in d: # Iteration over keys ++ class Dict(vim.Dictionary): # Subclassing + < + Note: when iterating over keys you should not modify dictionary. + +*************** +*** 510,517 **** + following methods: + Method Description ~ + extend(item) Add items to the list. + Examples: > +! l = vim.bindeval('[]') + l.extend(['abc', 'def']) # .extend() method + print l[1:] # slicing + l[:0] = ['ghi', 'jkl'] # slice assignment +--- 530,543 ---- + following methods: + Method Description ~ + extend(item) Add items to the list. ++ ++ __new__(), __new__(iterable) ++ You can use `vim.List()` to create new vim lists. ++ `l=vim.List(iterable)` is the same as ++ `l=vim.bindeval('[]');l.extend(iterable)`. Without ++ arguments constructs empty list. + Examples: > +! l = vim.List("abc") # Constructor, result: ['a', 'b', 'c'] + l.extend(['abc', 'def']) # .extend() method + print l[1:] # slicing + l[:0] = ['ghi', 'jkl'] # slice assignment +*************** +*** 519,531 **** + l[0] = 'mno' # assignment + for i in l: # iteration + print isinstance(l, vim.List) # True + + vim.Function object *python-Function* + Function-like object, acting like vim |Funcref| object. Supports `.name` + attribute and is callable. Accepts special keyword argument `self`, see +! |Dictionary-function|. + Examples: > +! f = vim.bindeval('function("tr")') + print f('abc', 'a', 'b') # Calls tr('abc', 'a', 'b') + vim.command(''' + function DictFun() dict +--- 545,560 ---- + l[0] = 'mno' # assignment + for i in l: # iteration + print isinstance(l, vim.List) # True ++ class List(vim.List): # Subclassing + + vim.Function object *python-Function* + Function-like object, acting like vim |Funcref| object. Supports `.name` + attribute and is callable. Accepts special keyword argument `self`, see +! |Dictionary-function|. You can also use `vim.Function(name)` constructor, +! it is the same as `vim.bindeval('function(%s)'%json.dumps(name))`. +! + Examples: > +! f = vim.Function('tr') # Constructor + print f('abc', 'a', 'b') # Calls tr('abc', 'a', 'b') + vim.command(''' + function DictFun() dict +*** ../vim-7.3.1066/src/version.c 2013-05-30 13:28:37.000000000 +0200 +--- src/version.c 2013-05-30 13:31:42.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1067, + /**/ + +-- +How To Keep A Healthy Level Of Insanity: +9. As often as possible, skip rather than walk. + + /// 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 /// diff --git a/7.3.1068 b/7.3.1068 new file mode 100644 index 0000000..b796776 --- /dev/null +++ b/7.3.1068 @@ -0,0 +1,173 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1068 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1068 +Problem: Python: Script is auto-loaded on function creation. +Solution: Python patch 27. (ZyX) +Files: src/eval.c, src/if_py_both.h, src/proto/eval.pro, + src/testdir/test86.ok, src/testdir/test87.ok, src/vim.h + + +*** ../vim-7.3.1067/src/eval.c 2013-05-30 13:14:06.000000000 +0200 +--- src/eval.c 2013-05-30 13:35:15.000000000 +0200 +*************** +*** 810,815 **** +--- 810,816 ---- + # endif + prof_self_cmp __ARGS((const void *s1, const void *s2)); + #endif ++ static int script_autoload __ARGS((char_u *name, int reload)); + static char_u *autoload_name __ARGS((char_u *name)); + static void cat_func_name __ARGS((char_u *buf, ufunc_T *fp)); + static void func_free __ARGS((ufunc_T *fp)); +*************** +*** 829,838 **** + static void sortFunctions __ARGS(()); + #endif + +- +- /* Character used as separated in autoload function/variable names. */ +- #define AUTOLOAD_CHAR '#' +- + /* + * Initialize the global and v: variables. + */ +--- 830,835 ---- +*************** +*** 22190,22196 **** + * If "name" has a package name try autoloading the script for it. + * Return TRUE if a package was loaded. + */ +! int + script_autoload(name, reload) + char_u *name; + int reload; /* load script again when already loaded */ +--- 22187,22193 ---- + * If "name" has a package name try autoloading the script for it. + * Return TRUE if a package was loaded. + */ +! static int + script_autoload(name, reload) + char_u *name; + int reload; /* load script again when already loaded */ +*** ../vim-7.3.1067/src/if_py_both.h 2013-05-30 13:22:07.000000000 +0200 +--- src/if_py_both.h 2013-05-30 13:35:15.000000000 +0200 +*************** +*** 2015,2033 **** + func_ref(self->name); + } + else +! { +! self->name = get_expanded_name(name, TRUE); +! if (self->name == NULL) + { +! if (script_autoload(name, TRUE) && !aborting()) +! self->name = get_expanded_name(name, TRUE); +! if (self->name == NULL) +! { +! PyErr_SetString(PyExc_ValueError, _("function does not exist")); +! return NULL; +! } + } +- } + + return (PyObject *)(self); + } +--- 2015,2027 ---- + func_ref(self->name); + } + else +! if ((self->name = get_expanded_name(name, +! vim_strchr(name, AUTOLOAD_CHAR) == NULL)) +! == NULL) + { +! PyErr_SetString(PyExc_ValueError, _("function does not exist")); +! return NULL; + } + + return (PyObject *)(self); + } +*** ../vim-7.3.1067/src/proto/eval.pro 2013-05-30 13:14:06.000000000 +0200 +--- src/proto/eval.pro 2013-05-30 13:35:15.000000000 +0200 +*************** +*** 132,136 **** + void ex_oldfiles __ARGS((exarg_T *eap)); + int modify_fname __ARGS((char_u *src, int *usedlen, char_u **fnamep, char_u **bufp, int *fnamelen)); + char_u *do_string_sub __ARGS((char_u *str, char_u *pat, char_u *sub, char_u *flags)); +- int script_autoload __ARGS((char_u *name, int reload)); + /* vim: set ft=c : */ +--- 132,135 ---- +*** ../vim-7.3.1067/src/testdir/test86.ok 2013-05-30 13:28:37.000000000 +0200 +--- src/testdir/test86.ok 2013-05-30 13:35:15.000000000 +0200 +*************** +*** 889,895 **** + >> FunctionConstructor + vim.Function("123"):(, ValueError('unnamed function does not exist',)) + vim.Function("xxx_non_existent_function_xxx"):(, ValueError('function does not exist',)) +! vim.Function("xxx#non#existent#function#xxx"):(, ValueError('function does not exist',)) + >> FunctionCall + >>> Testing StringToChars using f({%s : 1}) + f({1 : 1}):(, TypeError('object must be string',)) +--- 889,895 ---- + >> FunctionConstructor + vim.Function("123"):(, ValueError('unnamed function does not exist',)) + vim.Function("xxx_non_existent_function_xxx"):(, ValueError('function does not exist',)) +! vim.Function("xxx#non#existent#function#xxx"):NOT FAILED + >> FunctionCall + >>> Testing StringToChars using f({%s : 1}) + f({1 : 1}):(, TypeError('object must be string',)) +*** ../vim-7.3.1067/src/testdir/test87.ok 2013-05-30 13:28:37.000000000 +0200 +--- src/testdir/test87.ok 2013-05-30 13:35:15.000000000 +0200 +*************** +*** 878,884 **** + >> FunctionConstructor + vim.Function("123"):(, ValueError('unnamed function does not exist',)) + vim.Function("xxx_non_existent_function_xxx"):(, ValueError('function does not exist',)) +! vim.Function("xxx#non#existent#function#xxx"):(, ValueError('function does not exist',)) + >> FunctionCall + >>> Testing StringToChars using f({%s : 1}) + f({1 : 1}):(, TypeError('object must be string',)) +--- 878,884 ---- + >> FunctionConstructor + vim.Function("123"):(, ValueError('unnamed function does not exist',)) + vim.Function("xxx_non_existent_function_xxx"):(, ValueError('function does not exist',)) +! vim.Function("xxx#non#existent#function#xxx"):NOT FAILED + >> FunctionCall + >>> Testing StringToChars using f({%s : 1}) + f({1 : 1}):(, TypeError('object must be string',)) +*** ../vim-7.3.1067/src/vim.h 2013-05-06 03:52:44.000000000 +0200 +--- src/vim.h 2013-05-30 13:35:15.000000000 +0200 +*************** +*** 2243,2246 **** +--- 2243,2249 ---- + #define SREQ_WIN 1 /* Request window-local option */ + #define SREQ_BUF 2 /* Request buffer-local option */ + ++ /* Character used as separated in autoload function/variable names. */ ++ #define AUTOLOAD_CHAR '#' ++ + #endif /* VIM__H */ +*** ../vim-7.3.1067/src/version.c 2013-05-30 13:32:26.000000000 +0200 +--- src/version.c 2013-05-30 13:34:44.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1068, + /**/ + +-- +How To Keep A Healthy Level Of Insanity: +10. Ask people what sex they are. Laugh hysterically after they answer. + + /// 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 /// diff --git a/7.3.1069 b/7.3.1069 new file mode 100644 index 0000000..a966c9d --- /dev/null +++ b/7.3.1069 @@ -0,0 +1,210 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1069 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1069 +Problem: Python: memory leaks. +Solution: Python patch 28: Purge out DICTKEY_CHECK_EMPTY macros. (ZyX) +Files: src/if_py_both.h + + +*** ../vim-7.3.1068/src/if_py_both.h 2013-05-30 13:37:23.000000000 +0200 +--- src/if_py_both.h 2013-05-30 14:50:11.000000000 +0200 +*************** +*** 32,46 **** + + #define DICTKEY_DECL \ + PyObject *dictkey_todecref = NULL; +- #define DICTKEY_CHECK_EMPTY(err) \ +- if (*key == NUL) \ +- { \ +- PyErr_SetString(PyExc_ValueError, _("empty keys are not allowed")); \ +- return err; \ +- } +- #define DICTKEY_SET_KEY (key = StringToChars(keyObject, &dictkey_todecref)) + #define DICTKEY_GET(err, decref) \ +! if (!DICTKEY_SET_KEY) \ + { \ + if (decref) \ + { \ +--- 32,39 ---- + + #define DICTKEY_DECL \ + PyObject *dictkey_todecref = NULL; + #define DICTKEY_GET(err, decref) \ +! if (!(key = StringToChars(keyObject, &dictkey_todecref))) \ + { \ + if (decref) \ + { \ +*************** +*** 50,56 **** + } \ + if (decref && !dictkey_todecref) \ + dictkey_todecref = keyObject; \ +! DICTKEY_CHECK_EMPTY(err) + #define DICTKEY_UNREF \ + Py_XDECREF(dictkey_todecref); + +--- 43,53 ---- + } \ + if (decref && !dictkey_todecref) \ + dictkey_todecref = keyObject; \ +! if (*key == NUL) \ +! { \ +! PyErr_SetString(PyExc_ValueError, _("empty keys are not allowed")); \ +! return err; \ +! } + #define DICTKEY_UNREF \ + Py_XDECREF(dictkey_todecref); + +*************** +*** 4551,4557 **** + + while (PyDict_Next(obj, &iter, &keyObject, &valObject)) + { +! DICTKEY_DECL + + if (keyObject == NULL || valObject == NULL) + { +--- 4548,4554 ---- + + while (PyDict_Next(obj, &iter, &keyObject, &valObject)) + { +! PyObject *todecref = NULL; + + if (keyObject == NULL || valObject == NULL) + { +*************** +*** 4559,4574 **** + return -1; + } + +! if (!DICTKEY_SET_KEY) + { + dict_unref(dict); + return -1; + } +- DICTKEY_CHECK_EMPTY(-1) + + di = dictitem_alloc(key); + +! DICTKEY_UNREF + + if (di == NULL) + { +--- 4556,4576 ---- + return -1; + } + +! if (!(key = StringToChars(keyObject, &todecref))) +! { +! dict_unref(dict); +! return -1; +! } +! if (*key == NUL) + { + dict_unref(dict); ++ Py_XDECREF(todecref); + return -1; + } + + di = dictitem_alloc(key); + +! Py_XDECREF(todecref); + + if (di == NULL) + { +*************** +*** 4632,4662 **** + + while ((keyObject = PyIter_Next(iterator))) + { +! DICTKEY_DECL + +! if (!DICTKEY_SET_KEY) + { + Py_DECREF(iterator); + dict_unref(dict); +- DICTKEY_UNREF + return -1; + } +! DICTKEY_CHECK_EMPTY(-1) + + if (!(valObject = PyObject_GetItem(obj, keyObject))) + { + Py_DECREF(keyObject); + Py_DECREF(iterator); + dict_unref(dict); +- DICTKEY_UNREF + return -1; + } + + di = dictitem_alloc(key); + +- DICTKEY_UNREF +- + Py_DECREF(keyObject); + + if (di == NULL) + { +--- 4634,4670 ---- + + while ((keyObject = PyIter_Next(iterator))) + { +! PyObject *todecref; + +! if (!(key = StringToChars(keyObject, &todecref))) + { ++ Py_DECREF(keyObject); + Py_DECREF(iterator); + dict_unref(dict); + return -1; + } +! if (*key == NUL) +! { +! Py_DECREF(keyObject); +! Py_DECREF(iterator); +! Py_XDECREF(todecref); +! dict_unref(dict); +! return -1; +! } + + if (!(valObject = PyObject_GetItem(obj, keyObject))) + { + Py_DECREF(keyObject); + Py_DECREF(iterator); ++ Py_XDECREF(todecref); + dict_unref(dict); + return -1; + } + + di = dictitem_alloc(key); + + Py_DECREF(keyObject); ++ Py_XDECREF(todecref); + + if (di == NULL) + { +*** ../vim-7.3.1068/src/version.c 2013-05-30 13:37:23.000000000 +0200 +--- src/version.c 2013-05-30 13:38:46.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1069, + /**/ + +-- +How To Keep A Healthy Level Of Insanity: +11. Specify that your drive-through order is "to go". + + /// 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 /// diff --git a/7.3.1070 b/7.3.1070 new file mode 100644 index 0000000..4120898 --- /dev/null +++ b/7.3.1070 @@ -0,0 +1,109 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1070 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1070 +Problem: Vim crashes in Python tests. Compiler warning for unused function. +Solution: Disable the tests for now. Move the function. +Files: src/if_py_both.h, src/if_python.c, src/testdir/test86.in, + src/testdir/test87.in + + +*** ../vim-7.3.1069/src/if_py_both.h 2013-05-30 14:52:32.000000000 +0200 +--- src/if_py_both.h 2013-05-30 15:09:46.000000000 +0200 +*************** +*** 2322,2339 **** + return VimTryEnd(); + } + +- static void * +- py_memsave(void *p, size_t len) +- { +- void *r; +- if (!(r = PyMem_Malloc(len))) +- return NULL; +- mch_memmove(r, p, len); +- return r; +- } +- +- #define PY_STRSAVE(s) ((char_u *) py_memsave(s, STRLEN(s) + 1)) +- + static int + OptionsAssItem(OptionsObject *self, PyObject *keyObject, PyObject *valObject) + { +--- 2322,2327 ---- +*** ../vim-7.3.1069/src/if_python.c 2013-05-30 13:22:07.000000000 +0200 +--- src/if_python.c 2013-05-30 15:12:08.000000000 +0200 +*************** +*** 737,742 **** +--- 737,757 ---- + } + #endif + ++ #if defined(HAVE_LOCALE_H) || defined(X_LOCALE) ++ static void * ++ py_memsave(void *p, size_t len) ++ { ++ void *r; ++ ++ if (!(r = PyMem_Malloc(len))) ++ return NULL; ++ mch_memmove(r, p, len); ++ return r; ++ } ++ ++ # define PY_STRSAVE(s) ((char_u *) py_memsave(s, STRLEN(s) + 1)) ++ #endif ++ + /* + * Include the code shared with if_python3.c + */ +*** ../vim-7.3.1069/src/testdir/test86.in 2013-05-30 13:28:37.000000000 +0200 +--- src/testdir/test86.in 2013-05-30 15:13:46.000000000 +0200 +*************** +*** 8,13 **** +--- 8,15 ---- + STARTTEST + :so small.vim + :set encoding=latin1 ++ :" HACK: currently crashes, skip the test ++ :e! test.ok | wq! test.out + :if !has('python') | e! test.ok | wq! test.out | endif + :lang C + :py import vim +*** ../vim-7.3.1069/src/testdir/test87.in 2013-05-30 13:28:37.000000000 +0200 +--- src/testdir/test87.in 2013-05-30 15:13:55.000000000 +0200 +*************** +*** 2,7 **** +--- 2,9 ---- + + STARTTEST + :so small.vim ++ :" HACK: currently crashes, skip the test ++ :e! test.ok | wq! test.out + :if !has('python3') | e! test.ok | wq! test.out | endif + :lang C + :py3 import vim +*** ../vim-7.3.1069/src/version.c 2013-05-30 14:52:32.000000000 +0200 +--- src/version.c 2013-05-30 15:36:00.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1070, + /**/ + +-- +How To Keep A Healthy Level Of Insanity: +13. Go to a poetry recital and ask why the poems don't rhyme. + + /// 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 /// diff --git a/7.3.1071 b/7.3.1071 new file mode 100644 index 0000000..f3380b9 --- /dev/null +++ b/7.3.1071 @@ -0,0 +1,437 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1071 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1071 +Problem: New regexp engine: backreferences don't work correctly. +Solution: Add every possible start/end position on the state stack. +Files: src/regexp_nfa.c, src/regexp.h, src/testdir/test64.in, + src/testdir/test64.ok + + +*** ../vim-7.3.1070/src/regexp_nfa.c 2013-05-30 11:51:04.000000000 +0200 +--- src/regexp_nfa.c 2013-05-30 16:43:43.000000000 +0200 +*************** +*** 184,189 **** +--- 184,192 ---- + /* NFA regexp \ze operator encountered. */ + static int nfa_has_zend; + ++ /* NFA regexp \1 .. \9 encountered. */ ++ static int nfa_has_backref; ++ + /* Number of sub expressions actually being used during execution. 1 if only + * the whole match (subexpr 0) is used. */ + static int nfa_nsubexpr; +*************** +*** 266,271 **** +--- 269,275 ---- + post_ptr = post_start; + post_end = post_start + nstate_max; + nfa_has_zend = FALSE; ++ nfa_has_backref = FALSE; + + regcomp_start(expr, re_flags); + +*************** +*** 750,764 **** + /* TODO: Not supported yet */ + return FAIL; + +! case Magic('1'): EMIT(NFA_BACKREF1); break; +! case Magic('2'): EMIT(NFA_BACKREF2); break; +! case Magic('3'): EMIT(NFA_BACKREF3); break; +! case Magic('4'): EMIT(NFA_BACKREF4); break; +! case Magic('5'): EMIT(NFA_BACKREF5); break; +! case Magic('6'): EMIT(NFA_BACKREF6); break; +! case Magic('7'): EMIT(NFA_BACKREF7); break; +! case Magic('8'): EMIT(NFA_BACKREF8); break; +! case Magic('9'): EMIT(NFA_BACKREF9); break; + + case Magic('z'): + c = no_Magic(getchr()); +--- 754,771 ---- + /* TODO: Not supported yet */ + return FAIL; + +! case Magic('1'): +! case Magic('2'): +! case Magic('3'): +! case Magic('4'): +! case Magic('5'): +! case Magic('6'): +! case Magic('7'): +! case Magic('8'): +! case Magic('9'): +! EMIT(NFA_BACKREF1 + (no_Magic(c) - '1')); +! nfa_has_backref = TRUE; +! break; + + case Magic('z'): + c = no_Magic(getchr()); +*************** +*** 2581,2587 **** + typedef struct + { + nfa_thread_T *t; /* allocated array of states */ +! int n; /* nr of states in "t" */ + int id; /* ID of the list */ + } nfa_list_T; + +--- 2588,2595 ---- + typedef struct + { + nfa_thread_T *t; /* allocated array of states */ +! int n; /* nr of states currently in "t" */ +! int len; /* max nr of states in "t" */ + int id; /* ID of the list */ + } nfa_list_T; + +*************** +*** 2612,2620 **** +--- 2620,2711 ---- + /* Used during execution: whether a match has been found. */ + static int nfa_match; + ++ static int sub_equal __ARGS((regsub_T *sub1, regsub_T *sub2)); + static void addstate __ARGS((nfa_list_T *l, nfa_state_T *state, regsub_T *sub, int off)); + static void addstate_here __ARGS((nfa_list_T *l, nfa_state_T *state, regsub_T *sub, int *ip)); + ++ /* ++ * Return TRUE if "sub1" and "sub2" have the same positions. ++ */ ++ static int ++ sub_equal(sub1, sub2) ++ regsub_T *sub1; ++ regsub_T *sub2; ++ { ++ int i; ++ int todo; ++ linenr_T s1, e1; ++ linenr_T s2, e2; ++ char_u *sp1, *ep1; ++ char_u *sp2, *ep2; ++ ++ todo = sub1->in_use > sub2->in_use ? sub1->in_use : sub2->in_use; ++ if (REG_MULTI) ++ { ++ for (i = 0; i < todo; ++i) ++ { ++ if (i < sub1->in_use) ++ { ++ s1 = sub1->list.multi[i].start.lnum; ++ e1 = sub1->list.multi[i].end.lnum; ++ } ++ else ++ { ++ s1 = 0; ++ e1 = 0; ++ } ++ if (i < sub2->in_use) ++ { ++ s2 = sub2->list.multi[i].start.lnum; ++ e2 = sub2->list.multi[i].end.lnum; ++ } ++ else ++ { ++ s2 = 0; ++ e2 = 0; ++ } ++ if (s1 != s2 || e1 != e2) ++ return FALSE; ++ if (s1 != 0 && sub1->list.multi[i].start.col ++ != sub2->list.multi[i].start.col) ++ return FALSE; ++ if (e1 != 0 && sub1->list.multi[i].end.col ++ != sub2->list.multi[i].end.col) ++ return FALSE; ++ } ++ } ++ else ++ { ++ for (i = 0; i < todo; ++i) ++ { ++ if (i < sub1->in_use) ++ { ++ sp1 = sub1->list.line[i].start; ++ ep1 = sub1->list.line[i].end; ++ } ++ else ++ { ++ sp1 = NULL; ++ ep1 = NULL; ++ } ++ if (i < sub2->in_use) ++ { ++ sp2 = sub2->list.line[i].start; ++ ep2 = sub2->list.line[i].end; ++ } ++ else ++ { ++ sp2 = NULL; ++ ep2 = NULL; ++ } ++ if (sp1 != sp2 || ep1 != ep2) ++ return FALSE; ++ } ++ } ++ ++ return TRUE; ++ } ++ + static void + addstate(l, state, sub, off) + nfa_list_T *l; /* runtime state list */ +*************** +*** 2623,2629 **** + int off; /* byte offset, when -1 go to next line */ + { + int subidx; +! nfa_thread_T *lastthread; + lpos_T save_lpos; + int save_in_use; + char_u *save_ptr; +--- 2714,2720 ---- + int off; /* byte offset, when -1 go to next line */ + { + int subidx; +! nfa_thread_T *thread; + lpos_T save_lpos; + int save_in_use; + char_u *save_ptr; +*************** +*** 2674,2696 **** + { + /* This state is already in the list, don't add it again, + * unless it is an MOPEN that is used for a backreference. */ +! return; + } + + /* add the state to the list */ + state->lastlist = l->id; +! lastthread = &l->t[l->n++]; +! lastthread->state = state; +! lastthread->sub.in_use = sub->in_use; + if (sub->in_use > 0) + { + /* Copy the match start and end positions. */ + if (REG_MULTI) +! mch_memmove(&lastthread->sub.list.multi[0], + &sub->list.multi[0], + sizeof(struct multipos) * sub->in_use); + else +! mch_memmove(&lastthread->sub.list.line[0], + &sub->list.line[0], + sizeof(struct linepos) * sub->in_use); + } +--- 2765,2808 ---- + { + /* This state is already in the list, don't add it again, + * unless it is an MOPEN that is used for a backreference. */ +! if (!nfa_has_backref) +! return; +! +! /* See if the same state is already in the list with the same +! * positions. */ +! for (i = 0; i < l->n; ++i) +! { +! thread = &l->t[i]; +! if (thread->state->id == state->id +! && sub_equal(&thread->sub, sub)) +! return; +! } +! } +! +! /* when there are backreferences the number of states may be (a +! * lot) bigger */ +! if (nfa_has_backref && l->n == l->len) +! { +! int newlen = l->len * 3 / 2 + 50; +! +! l->t = vim_realloc(l->t, newlen * sizeof(nfa_thread_T)); +! l->len = newlen; + } + + /* add the state to the list */ + state->lastlist = l->id; +! thread = &l->t[l->n++]; +! thread->state = state; +! thread->sub.in_use = sub->in_use; + if (sub->in_use > 0) + { + /* Copy the match start and end positions. */ + if (REG_MULTI) +! mch_memmove(&thread->sub.list.multi[0], + &sub->list.multi[0], + sizeof(struct multipos) * sub->in_use); + else +! mch_memmove(&thread->sub.list.line[0], + &sub->list.line[0], + sizeof(struct linepos) * sub->in_use); + } +*************** +*** 2909,2915 **** + + /* re-order to put the new state at the current position */ + count = l->n - tlen; +! if (count > 1) + { + /* make space for new states, then move them from the + * end to the current position */ +--- 3021,3032 ---- + + /* re-order to put the new state at the current position */ + count = l->n - tlen; +! if (count == 1) +! { +! /* overwrite the current state */ +! l->t[i] = l->t[l->n - 1]; +! } +! else if (count > 1) + { + /* make space for new states, then move them from the + * end to the current position */ +*************** +*** 2920,2930 **** + &(l->t[l->n - 1]), + sizeof(nfa_thread_T) * count); + } +- else +- { +- /* overwrite the current state */ +- l->t[i] = l->t[l->n - 1]; +- } + --l->n; + *ip = i - 1; + } +--- 3037,3042 ---- +*************** +*** 3183,3196 **** + + /* Allocate memory for the lists of nodes. */ + size = (nstate + 1) * sizeof(nfa_thread_T); +! list[0].t = (nfa_thread_T *)lalloc(size, TRUE); +! list[1].t = (nfa_thread_T *)lalloc(size, TRUE); +! list[2].t = (nfa_thread_T *)lalloc(size, TRUE); + if (list[0].t == NULL || list[1].t == NULL || list[2].t == NULL) + goto theend; +- vim_memset(list[0].t, 0, size); +- vim_memset(list[1].t, 0, size); +- vim_memset(list[2].t, 0, size); + + #ifdef ENABLE_LOG + log_fd = fopen(NFA_REGEXP_RUN_LOG, "a"); +--- 3295,3308 ---- + + /* Allocate memory for the lists of nodes. */ + size = (nstate + 1) * sizeof(nfa_thread_T); +! list[0].t = (nfa_thread_T *)lalloc_clear(size, TRUE); +! list[0].len = nstate + 1; +! list[1].t = (nfa_thread_T *)lalloc_clear(size, TRUE); +! list[1].len = nstate + 1; +! list[2].t = (nfa_thread_T *)lalloc_clear(size, TRUE); +! list[2].len = nstate + 1; + if (list[0].t == NULL || list[1].t == NULL || list[2].t == NULL) + goto theend; + + #ifdef ENABLE_LOG + log_fd = fopen(NFA_REGEXP_RUN_LOG, "a"); +*************** +*** 3970,3976 **** + vim_free(list[0].t); + vim_free(list[1].t); + vim_free(list[2].t); +- list[0].t = list[1].t = list[2].t = NULL; + vim_free(listids); + #undef ADD_POS_NEG_STATE + #ifdef NFA_REGEXP_DEBUG_LOG +--- 4082,4087 ---- +*************** +*** 4131,4136 **** +--- 4242,4248 ---- + reglnum = 0; /* relative to line */ + + nfa_has_zend = prog->has_zend; ++ nfa_has_backref = prog->has_backref; + nfa_nsubexpr = prog->nsubexp; + + nstate = prog->nstate; +*************** +*** 4225,4230 **** +--- 4337,4343 ---- + prog->engine = &nfa_regengine; + prog->nstate = nstate; + prog->has_zend = nfa_has_zend; ++ prog->has_backref = nfa_has_backref; + prog->nsubexp = regnpar; + #ifdef ENABLE_LOG + nfa_postfix_dump(expr, OK); +*** ../vim-7.3.1070/src/regexp.h 2013-05-29 21:14:37.000000000 +0200 +--- src/regexp.h 2013-05-30 15:54:53.000000000 +0200 +*************** +*** 87,92 **** +--- 87,93 ---- + regprog_T regprog; + nfa_state_T *start; + int has_zend; /* pattern contains \ze */ ++ int has_backref; /* pattern contains \1 .. \9 */ + int nsubexp; /* number of () */ + int nstate; + nfa_state_T state[0]; /* actually longer.. */ +*** ../vim-7.3.1070/src/testdir/test64.in 2013-05-30 11:51:04.000000000 +0200 +--- src/testdir/test64.in 2013-05-30 16:47:29.000000000 +0200 +*************** +*** 333,339 **** + :" + :"""" Back references + :call add(tl, [2, '\(\i\+\) \1', ' abc abc', 'abc abc', 'abc']) +! :"call add(tl, [2, '\(\i\+\) \1', 'xgoo goox', 'goo goo', 'goo']) + :call add(tl, [2, '\(a\)\(b\)\(c\)\(dd\)\(e\)\(f\)\(g\)\(h\)\(i\)\1\2\3\4\5\6\7\8\9', 'xabcddefghiabcddefghix', 'abcddefghiabcddefghi', 'a', 'b', 'c', 'dd', 'e', 'f', 'g', 'h', 'i']) + :" + :"""" Look-behind with limit +--- 333,339 ---- + :" + :"""" Back references + :call add(tl, [2, '\(\i\+\) \1', ' abc abc', 'abc abc', 'abc']) +! :call add(tl, [2, '\(\i\+\) \1', 'xgoo goox', 'goo goo', 'goo']) + :call add(tl, [2, '\(a\)\(b\)\(c\)\(dd\)\(e\)\(f\)\(g\)\(h\)\(i\)\1\2\3\4\5\6\7\8\9', 'xabcddefghiabcddefghix', 'abcddefghiabcddefghi', 'a', 'b', 'c', 'dd', 'e', 'f', 'g', 'h', 'i']) + :" + :"""" Look-behind with limit +*** ../vim-7.3.1070/src/testdir/test64.ok 2013-05-30 11:51:04.000000000 +0200 +--- src/testdir/test64.ok 2013-05-30 17:00:27.000000000 +0200 +*************** +*** 716,721 **** +--- 716,724 ---- + OK 0 - \(\i\+\) \1 + OK 1 - \(\i\+\) \1 + OK 2 - \(\i\+\) \1 ++ OK 0 - \(\i\+\) \1 ++ OK 1 - \(\i\+\) \1 ++ OK 2 - \(\i\+\) \1 + OK 0 - \(a\)\(b\)\(c\)\(dd\)\(e\)\(f\)\(g\)\(h\)\(i\)\1\2\3\4\5\6\7\8\9 + OK 1 - \(a\)\(b\)\(c\)\(dd\)\(e\)\(f\)\(g\)\(h\)\(i\)\1\2\3\4\5\6\7\8\9 + OK 2 - \(a\)\(b\)\(c\)\(dd\)\(e\)\(f\)\(g\)\(h\)\(i\)\1\2\3\4\5\6\7\8\9 +*** ../vim-7.3.1070/src/version.c 2013-05-30 15:38:20.000000000 +0200 +--- src/version.c 2013-05-30 17:02:40.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1071, + /**/ + +-- +How To Keep A Healthy Level Of Insanity: +14. Put mosquito netting around your work area. Play a tape of jungle + sounds all day. + + /// 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 /// diff --git a/7.3.1072 b/7.3.1072 new file mode 100644 index 0000000..9ff64b7 --- /dev/null +++ b/7.3.1072 @@ -0,0 +1,45 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1072 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1072 +Problem: Compiler warning for unitialized variable. +Solution: Initialize it. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1071/src/regexp_nfa.c 2013-05-30 17:05:34.000000000 +0200 +--- src/regexp_nfa.c 2013-05-30 17:37:48.000000000 +0200 +*************** +*** 2873,2878 **** +--- 2873,2879 ---- + + /* Set the position (with "off") in the subexpression. Save and + * restore it when it was in use. Otherwise fill any gap. */ ++ save_ptr = NULL; + if (REG_MULTI) + { + if (subidx < sub->in_use) +*** ../vim-7.3.1071/src/version.c 2013-05-30 17:05:34.000000000 +0200 +--- src/version.c 2013-05-30 17:48:42.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1072, + /**/ + +-- +How To Keep A Healthy Level Of Insanity: +16. Have your coworkers address you by your wrestling name, Rock Hard Kim. + + /// 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 /// diff --git a/7.3.1073 b/7.3.1073 new file mode 100644 index 0000000..30ffa94 --- /dev/null +++ b/7.3.1073 @@ -0,0 +1,339 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1073 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1073 +Problem: New regexp engine may run out of states. +Solution: Allocate states dynamically. Also make the test report errors. +Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok, + src/testdir/test95.in + + +*** ../vim-7.3.1072/src/regexp_nfa.c 2013-05-30 17:49:19.000000000 +0200 +--- src/regexp_nfa.c 2013-05-30 18:36:12.000000000 +0200 +*************** +*** 233,239 **** + + /* helper functions used when doing re2post() ... regatom() parsing */ + #define EMIT(c) do { \ +! if (post_ptr >= post_end) \ + return FAIL; \ + *post_ptr++ = c; \ + } while (0) +--- 233,239 ---- + + /* helper functions used when doing re2post() ... regatom() parsing */ + #define EMIT(c) do { \ +! if (post_ptr >= post_end && realloc_post_list() == FAIL) \ + return FAIL; \ + *post_ptr++ = c; \ + } while (0) +*************** +*** 256,266 **** + nstate_max = (int)(STRLEN(expr) + 1) * NFA_POSTFIX_MULTIPLIER; + + /* Some items blow up in size, such as [A-z]. Add more space for that. +! * TODO: some patterns may still fail. */ + nstate_max += 1000; + + /* Size for postfix representation of expr. */ +! postfix_size = sizeof(*post_start) * nstate_max; + + post_start = (int *)lalloc(postfix_size, TRUE); + if (post_start == NULL) +--- 256,266 ---- + nstate_max = (int)(STRLEN(expr) + 1) * NFA_POSTFIX_MULTIPLIER; + + /* Some items blow up in size, such as [A-z]. Add more space for that. +! * When it is still not enough realloc_post_list() will be used. */ + nstate_max += 1000; + + /* Size for postfix representation of expr. */ +! postfix_size = sizeof(int) * nstate_max; + + post_start = (int *)lalloc(postfix_size, TRUE); + if (post_start == NULL) +*************** +*** 277,282 **** +--- 277,307 ---- + } + + /* ++ * Allocate more space for post_start. Called when ++ * running above the estimated number of states. ++ */ ++ static int ++ realloc_post_list() ++ { ++ int nstate_max = post_end - post_start; ++ int new_max = nstate_max + 1000; ++ int *new_start; ++ int *old_start; ++ ++ new_start = (int *)lalloc(new_max * sizeof(int), TRUE); ++ if (new_start == NULL) ++ return FAIL; ++ mch_memmove(new_start, post_start, nstate_max * sizeof(int)); ++ vim_memset(new_start + nstate_max, 0, 1000 * sizeof(int)); ++ old_start = post_start; ++ post_start = new_start; ++ post_ptr = new_start + (post_ptr - old_start); ++ post_end = post_start + new_max; ++ vim_free(old_start); ++ return OK; ++ } ++ ++ /* + * Search between "start" and "end" and try to recognize a + * character class in expanded form. For example [0-9]. + * On success, return the id the character class to be emitted. +*************** +*** 1306,1312 **** + int greedy = TRUE; /* Braces are prefixed with '-' ? */ + char_u *old_regparse, *new_regparse; + int c2; +! int *old_post_ptr, *my_post_start; + int old_regnpar; + int quest; + +--- 1331,1338 ---- + int greedy = TRUE; /* Braces are prefixed with '-' ? */ + char_u *old_regparse, *new_regparse; + int c2; +! int old_post_pos; +! int my_post_start; + int old_regnpar; + int quest; + +*************** +*** 1317,1323 **** + * {m,n} is next */ + old_regnpar = regnpar; + /* store current pos in the postfix form, for \{m,n} involving 0s */ +! my_post_start = post_ptr; + + ret = nfa_regatom(); + if (ret == FAIL) +--- 1343,1349 ---- + * {m,n} is next */ + old_regnpar = regnpar; + /* store current pos in the postfix form, for \{m,n} involving 0s */ +! my_post_start = (int)(post_ptr - post_start); + + ret = nfa_regatom(); + if (ret == FAIL) +*************** +*** 1430,1443 **** + if (maxval == 0) + { + /* Ignore result of previous call to nfa_regatom() */ +! post_ptr = my_post_start; + /* NFA_SKIP_CHAR has 0-length and works everywhere */ + EMIT(NFA_SKIP_CHAR); + return OK; + } + + /* Ignore previous call to nfa_regatom() */ +! post_ptr = my_post_start; + /* Save pos after the repeated atom and the \{} */ + new_regparse = regparse; + +--- 1456,1469 ---- + if (maxval == 0) + { + /* Ignore result of previous call to nfa_regatom() */ +! post_ptr = post_start + my_post_start; + /* NFA_SKIP_CHAR has 0-length and works everywhere */ + EMIT(NFA_SKIP_CHAR); + return OK; + } + + /* Ignore previous call to nfa_regatom() */ +! post_ptr = post_start + my_post_start; + /* Save pos after the repeated atom and the \{} */ + new_regparse = regparse; + +*************** +*** 1449,1461 **** + curchr = -1; + /* Restore count of parenthesis */ + regnpar = old_regnpar; +! old_post_ptr = post_ptr; + if (nfa_regatom() == FAIL) + return FAIL; + /* after "minval" times, atoms are optional */ + if (i + 1 > minval) + EMIT(quest); +! if (old_post_ptr != my_post_start) + EMIT(NFA_CONCAT); + } + +--- 1475,1487 ---- + curchr = -1; + /* Restore count of parenthesis */ + regnpar = old_regnpar; +! old_post_pos = (int)(post_ptr - post_start); + if (nfa_regatom() == FAIL) + return FAIL; + /* after "minval" times, atoms are optional */ + if (i + 1 > minval) + EMIT(quest); +! if (old_post_pos != my_post_start) + EMIT(NFA_CONCAT); + } + +*************** +*** 1572,1580 **** + nfa_regbranch() + { + int ch; +! int *old_post_ptr; + +! old_post_ptr = post_ptr; + + /* First branch, possibly the only one */ + if (nfa_regconcat() == FAIL) +--- 1598,1606 ---- + nfa_regbranch() + { + int ch; +! int old_post_pos; + +! old_post_pos = (int)(post_ptr - post_start); + + /* First branch, possibly the only one */ + if (nfa_regconcat() == FAIL) +*************** +*** 1587,1604 **** + skipchr(); + EMIT(NFA_NOPEN); + EMIT(NFA_PREV_ATOM_NO_WIDTH); +! old_post_ptr = post_ptr; + if (nfa_regconcat() == FAIL) + return FAIL; + /* if concat is empty, skip a input char. But do emit a node */ +! if (old_post_ptr == post_ptr) + EMIT(NFA_SKIP_CHAR); + EMIT(NFA_CONCAT); + ch = peekchr(); + } + + /* Even if a branch is empty, emit one node for it */ +! if (old_post_ptr == post_ptr) + EMIT(NFA_SKIP_CHAR); + + return OK; +--- 1613,1630 ---- + skipchr(); + EMIT(NFA_NOPEN); + EMIT(NFA_PREV_ATOM_NO_WIDTH); +! old_post_pos = (int)(post_ptr - post_start); + if (nfa_regconcat() == FAIL) + return FAIL; + /* if concat is empty, skip a input char. But do emit a node */ +! if (old_post_pos == (int)(post_ptr - post_start)) + EMIT(NFA_SKIP_CHAR); + EMIT(NFA_CONCAT); + ch = peekchr(); + } + + /* Even if a branch is empty, emit one node for it */ +! if (old_post_pos == (int)(post_ptr - post_start)) + EMIT(NFA_SKIP_CHAR); + + return OK; +*** ../vim-7.3.1072/src/testdir/test64.in 2013-05-30 17:05:34.000000000 +0200 +--- src/testdir/test64.in 2013-05-30 18:38:49.000000000 +0200 +*************** +*** 348,353 **** +--- 348,356 ---- + :call add(tl, [2, '\_[^8-9]\+', "asfi\n9888", "asfi\n"]) + :call add(tl, [2, '\_[^a]\+', "asfi\n9888", "sfi\n9888"]) + :" ++ :"""" Requiring lots of states. ++ :call add(tl, [0, '[0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}-\)\{3}[0-9a-zA-Z]\{12}', " 12345678-1234-1234-1234-123456789012 ", "12345678-1234-1234-1234-123456789012", "1234-"]) ++ :" + :" + :"""" Run the tests + :" +*************** +*** 361,367 **** + : continue + : endif + : let ®expengine = engine +! : let l = matchlist(text, pat) + :" check the match itself + : if len(l) == 0 && len(t) > matchidx + : $put ='ERROR: pat: \"' . pat . '\", text: \"' . text . '\", did not match, expected: \"' . t[matchidx] . '\"' +--- 364,374 ---- + : continue + : endif + : let ®expengine = engine +! : try +! : let l = matchlist(text, pat) +! : catch +! : $put ='ERROR: pat: \"' . pat . '\", text: \"' . text . '\", caused an exception: \"' . v:exception . '\"' +! : endtry + :" check the match itself + : if len(l) == 0 && len(t) > matchidx + : $put ='ERROR: pat: \"' . pat . '\", text: \"' . text . '\", did not match, expected: \"' . t[matchidx] . '\"' +*** ../vim-7.3.1072/src/testdir/test64.ok 2013-05-30 17:05:34.000000000 +0200 +--- src/testdir/test64.ok 2013-05-30 18:42:43.000000000 +0200 +*************** +*** 740,745 **** +--- 740,747 ---- + OK 0 - \_[^a]\+ + OK 1 - \_[^a]\+ + OK 2 - \_[^a]\+ ++ OK 0 - [0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}-\)\{3}[0-9a-zA-Z]\{12} ++ OK 1 - [0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}-\)\{3}[0-9a-zA-Z]\{12} + 192.168.0.1 + 192.168.0.1 + 192.168.0.1 +*** ../vim-7.3.1072/src/testdir/test95.in 2013-05-26 15:14:49.000000000 +0200 +--- src/testdir/test95.in 2013-05-30 18:13:59.000000000 +0200 +*************** +*** 85,91 **** + : continue + : endif + : let ®expengine = engine +! : let l = matchlist(text, pat) + :" check the match itself + : if len(l) == 0 && len(t) > matchidx + : $put ='ERROR: pat: \"' . pat . '\", text: \"' . text . '\", did not match, expected: \"' . t[matchidx] . '\"' +--- 85,95 ---- + : continue + : endif + : let ®expengine = engine +! : try +! : let l = matchlist(text, pat) +! : catch +! : $put ='ERROR: pat: \"' . pat . '\", text: \"' . text . '\", caused an exception: \"' . v:exception . '\"' +! : endtry + :" check the match itself + : if len(l) == 0 && len(t) > matchidx + : $put ='ERROR: pat: \"' . pat . '\", text: \"' . text . '\", did not match, expected: \"' . t[matchidx] . '\"' +*** ../vim-7.3.1072/src/version.c 2013-05-30 17:49:19.000000000 +0200 +--- src/version.c 2013-05-30 18:43:08.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1073, + /**/ + +-- +How To Keep A Healthy Level Of Insanity: +17. When the money comes out the ATM, scream "I won!, I won! 3rd + time this week!!!!!" + + /// 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 /// diff --git a/7.3.1074 b/7.3.1074 new file mode 100644 index 0000000..4d06267 --- /dev/null +++ b/7.3.1074 @@ -0,0 +1,59 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1074 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1074 +Problem: Compiler warning for printf format. (Manuel Ortega) +Solution: Add type casts. +Files: src/if_py_both.h + + +*** ../vim-7.3.1073/src/if_py_both.h 2013-05-30 15:38:20.000000000 +0200 +--- src/if_py_both.h 2013-05-30 18:58:57.000000000 +0200 +*************** +*** 3807,3813 **** + name = ""; + + return PyString_FromFormat("", +! name, self->start, self->end); + } + } + +--- 3807,3813 ---- + name = ""; + + return PyString_FromFormat("", +! name, (int)self->start, (int)self->end); + } + } + +*** ../vim-7.3.1073/src/version.c 2013-05-30 18:45:20.000000000 +0200 +--- src/version.c 2013-05-30 18:59:37.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1074, + /**/ + +-- +In many of the more relaxed civilizations on the Outer Eastern Rim of the +Galaxy, "The Hitchhiker's Guide to the Galaxy" has already supplanted the +great "Encyclopedia Galactica" as the standard repository of all knowledge +and wisdom, for though it has many omissions and contains much that is +apocryphal, or at least wildly inaccurate, it scores over the older, more +pedestrian work in two important respects. +First, it is slightly cheaper; and second, it has the words "DON'T PANIC" +inscribed in large friendly letters on its cover. + -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" + + /// 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 /// diff --git a/7.3.1075 b/7.3.1075 new file mode 100644 index 0000000..c86f42e --- /dev/null +++ b/7.3.1075 @@ -0,0 +1,52 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1075 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1075 +Problem: Compiler warning for storing a long_u in an int. +Solution: Declare the number as an int. (Mike Williams) +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1074/src/regexp_nfa.c 2013-05-30 18:45:20.000000000 +0200 +--- src/regexp_nfa.c 2013-05-30 19:15:50.000000000 +0200 +*************** +*** 890,896 **** + + default: + { +! long_u n = 0; + int cmp = c; + + if (c == '<' || c == '>') +--- 890,896 ---- + + default: + { +! int n = 0; + int cmp = c; + + if (c == '<' || c == '>') +*** ../vim-7.3.1074/src/version.c 2013-05-30 19:01:20.000000000 +0200 +--- src/version.c 2013-05-30 19:16:36.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1075, + /**/ + +-- +One difference between a man and a machine is that a machine is quiet +when well oiled. + + /// 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 /// diff --git a/7.3.1076 b/7.3.1076 new file mode 100644 index 0000000..b01ad27 --- /dev/null +++ b/7.3.1076 @@ -0,0 +1,397 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1076 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1076 +Problem: New regexp engine: \@= and \& don't work. +Solution: Make these items work. Add column info to logging. +Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok + + +*** ../vim-7.3.1075/src/regexp_nfa.c 2013-05-30 19:18:27.000000000 +0200 +--- src/regexp_nfa.c 2013-05-30 21:41:51.000000000 +0200 +*************** +*** 1740,1747 **** + STRCPY(code, "NFA_PREV_ATOM_NO_WIDTH"); break; + case NFA_PREV_ATOM_NO_WIDTH_NEG: + STRCPY(code, "NFA_PREV_ATOM_NO_WIDTH_NEG"); break; +! case NFA_NOPEN: STRCPY(code, "NFA_MOPEN_INVISIBLE"); break; +! case NFA_NCLOSE: STRCPY(code, "NFA_MCLOSE_INVISIBLE"); break; + case NFA_START_INVISIBLE: STRCPY(code, "NFA_START_INVISIBLE"); break; + case NFA_END_INVISIBLE: STRCPY(code, "NFA_END_INVISIBLE"); break; + +--- 1740,1747 ---- + STRCPY(code, "NFA_PREV_ATOM_NO_WIDTH"); break; + case NFA_PREV_ATOM_NO_WIDTH_NEG: + STRCPY(code, "NFA_PREV_ATOM_NO_WIDTH_NEG"); break; +! case NFA_NOPEN: STRCPY(code, "NFA_NOPEN"); break; +! case NFA_NCLOSE: STRCPY(code, "NFA_NCLOSE"); break; + case NFA_START_INVISIBLE: STRCPY(code, "NFA_START_INVISIBLE"); break; + case NFA_END_INVISIBLE: STRCPY(code, "NFA_END_INVISIBLE"); break; + +*************** +*** 2373,2384 **** + break; + + case NFA_PREV_ATOM_NO_WIDTH: +! /* The \@= operator: match the preceding atom with 0 width. + * Surrounds the preceding atom with START_INVISIBLE and +! * END_INVISIBLE, similarly to MOPEN. +! */ +! /* TODO: Maybe this drops the speed? */ +! goto theend; + + if (nfa_calc_size == TRUE) + { +--- 2373,2381 ---- + break; + + case NFA_PREV_ATOM_NO_WIDTH: +! /* The \@= operator: match the preceding atom with zero width. + * Surrounds the preceding atom with START_INVISIBLE and +! * END_INVISIBLE, similarly to MOPEN. */ + + if (nfa_calc_size == TRUE) + { +*************** +*** 2745,2750 **** +--- 2742,2750 ---- + int save_in_use; + char_u *save_ptr; + int i; ++ #ifdef ENABLE_LOG ++ int did_print = FALSE; ++ #endif + + if (l == NULL || state == NULL) + return; +*************** +*** 2782,2788 **** + /* These nodes do not need to be added, but we need to bail out + * when it was tried to be added to this list before. */ + if (state->lastlist == l->id) +! return; + state->lastlist = l->id; + break; + +--- 2782,2788 ---- + /* These nodes do not need to be added, but we need to bail out + * when it was tried to be added to this list before. */ + if (state->lastlist == l->id) +! goto skip_add; + state->lastlist = l->id; + break; + +*************** +*** 2792,2798 **** +--- 2792,2806 ---- + /* This state is already in the list, don't add it again, + * unless it is an MOPEN that is used for a backreference. */ + if (!nfa_has_backref) ++ { ++ skip_add: ++ #ifdef ENABLE_LOG ++ nfa_set_code(state->c); ++ fprintf(log_fd, "> Not adding state %d to list %d. char %d: %s\n", ++ abs(state->id), l->id, state->c, code); ++ #endif + return; ++ } + + /* See if the same state is already in the list with the same + * positions. */ +*************** +*** 2801,2807 **** + thread = &l->t[i]; + if (thread->state->id == state->id + && sub_equal(&thread->sub, sub)) +! return; + } + } + +--- 2809,2815 ---- + thread = &l->t[i]; + if (thread->state->id == state->id + && sub_equal(&thread->sub, sub)) +! goto skip_add; + } + } + +*************** +*** 2832,2843 **** + &sub->list.line[0], + sizeof(struct linepos) * sub->in_use); + } + } + + #ifdef ENABLE_LOG +! nfa_set_code(state->c); +! fprintf(log_fd, "> Adding state %d to list. Character %d: %s\n", +! abs(state->id), state->c, code); + #endif + switch (state->c) + { +--- 2840,2878 ---- + &sub->list.line[0], + sizeof(struct linepos) * sub->in_use); + } ++ #ifdef ENABLE_LOG ++ { ++ int col; ++ ++ if (thread->sub.in_use <= 0) ++ col = -1; ++ else if (REG_MULTI) ++ col = thread->sub.list.multi[0].start.col; ++ else ++ col = (int)(thread->sub.list.line[0].start - regline); ++ nfa_set_code(state->c); ++ fprintf(log_fd, "> Adding state %d to list %d. char %d: %s (start col %d)\n", ++ abs(state->id), l->id, state->c, code, col); ++ did_print = TRUE; ++ } ++ #endif + } + + #ifdef ENABLE_LOG +! if (!did_print) +! { +! int col; +! +! if (sub->in_use <= 0) +! col = -1; +! else if (REG_MULTI) +! col = sub->list.multi[0].start.col; +! else +! col = (int)(sub->list.line[0].start - regline); +! nfa_set_code(state->c); +! fprintf(log_fd, "> Processing state %d for list %d. char %d: %s (start col %d)\n", +! abs(state->id), l->id, state->c, code, col); +! } + #endif + switch (state->c) + { +*************** +*** 2873,2886 **** + addstate(l, state->out, sub, off); + break; + +- /* If this state is reached, then a recursive call of nfa_regmatch() +- * succeeded. the next call saves the found submatches in the +- * first state after the "invisible" branch. */ +- #if 0 +- case NFA_END_INVISIBLE: +- break; +- #endif +- + case NFA_MOPEN + 0: + case NFA_MOPEN + 1: + case NFA_MOPEN + 2: +--- 2908,2913 ---- +*************** +*** 3450,3458 **** + fprintf(debug, "%s, ", code); + #endif + #ifdef ENABLE_LOG +! nfa_set_code(t->state->c); +! fprintf(log_fd, "(%d) %s, code %d ... \n", abs(t->state->id), +! code, (int)t->state->c); + #endif + + /* +--- 3477,3495 ---- + fprintf(debug, "%s, ", code); + #endif + #ifdef ENABLE_LOG +! { +! int col; +! +! if (t->sub.in_use <= 0) +! col = -1; +! else if (REG_MULTI) +! col = t->sub.list.multi[0].start.col; +! else +! col = (int)(t->sub.list.line[0].start - regline); +! nfa_set_code(t->state->c); +! fprintf(log_fd, "(%d) char %d %s (start col %d) ... \n", +! abs(t->state->id), (int)t->state->c, code, col); +! } + #endif + + /* +*************** +*** 3504,3509 **** +--- 3541,3547 ---- + addstate_here(thislist, t->state->out, &t->sub, &listidx); + else + { ++ /* TODO: only copy positions in use. */ + *m = t->sub; + nfa_match = TRUE; + } +*************** +*** 3538,3543 **** +--- 3576,3582 ---- + result = nfa_regmatch(t->state->out, submatch, m); + nfa_set_neg_listids(start); + nfa_restore_listids(start, listids); ++ nfa_match = FALSE; + + #ifdef ENABLE_LOG + log_fd = fopen(NFA_REGEXP_RUN_LOG, "a"); +*************** +*** 3575,3583 **** + t->sub.list.line[j].start = m->list.line[j].start; + t->sub.list.line[j].end = m->list.line[j].end; + } +! t->sub.in_use = m->in_use; + +! /* t->state->out1 is the corresponding END_INVISIBLE node */ + addstate_here(thislist, t->state->out1->out, &t->sub, + &listidx); + } +--- 3614,3624 ---- + t->sub.list.line[j].start = m->list.line[j].start; + t->sub.list.line[j].end = m->list.line[j].end; + } +! if (m->in_use > t->sub.in_use) +! t->sub.in_use = m->in_use; + +! /* t->state->out1 is the corresponding END_INVISIBLE node; +! * Add it to the current list (zero-width match). */ + addstate_here(thislist, t->state->out1->out, &t->sub, + &listidx); + } +*************** +*** 4146,4152 **** + fprintf(f, "\tRegexp is \"%s\"\n", nfa_regengine.expr); + #endif + fprintf(f, "\tInput text is \"%s\" \n", reginput); +! fprintf(f, " =======================================================\n\n\n\n\n\n\n"); + nfa_print_state(f, start); + fprintf(f, "\n\n"); + fclose(f); +--- 4187,4193 ---- + fprintf(f, "\tRegexp is \"%s\"\n", nfa_regengine.expr); + #endif + fprintf(f, "\tInput text is \"%s\" \n", reginput); +! fprintf(f, " =======================================================\n\n"); + nfa_print_state(f, start); + fprintf(f, "\n\n"); + fclose(f); +*** ../vim-7.3.1075/src/testdir/test64.in 2013-05-30 18:45:20.000000000 +0200 +--- src/testdir/test64.in 2013-05-30 21:28:06.000000000 +0200 +*************** +*** 294,315 **** + :call add(tl, [2, '\v(a \zsif .*){2}', 'a if then a if last', 'if last', 'a if last']) + :call add(tl, [2, '\>\zs.', 'aword. ', '.']) + :" +! :"""" Tests for \@ features +! :call add(tl, [0, 'abc\@=', 'abc', 'ab']) +! :call add(tl, [0, 'abc\@=cd', 'abcd', 'abcd']) +! :call add(tl, [0, 'abc\@=', 'ababc', 'ab']) + :" will never match, no matter the input text + :call add(tl, [2, 'abcd\@=e', 'abcd']) + :" will never match + :call add(tl, [2, 'abcd\@=e', 'any text in here ... ']) +! :call add(tl, [0, '\v(abc)@=..', 'xabcd', 'ab', 'abc']) + :" no match + :call add(tl, [2, '\(.*John\)\@=.*Bob', 'here is John, and here is B']) +! :call add(tl, [0, '\(John.*\)\@=.*Bob', 'John is Bobs friend', 'John is Bob', 'John is Bobs friend']) + :" no match + :call add(tl, [2, '.*John\&.*Bob', 'here is John, and here is B']) +! :call add(tl, [0, '.*John\&.*Bob', 'John is Bobs friend', 'John is Bob']) +! :call add(tl, [0, '\v(test1)@=.*yep', 'this is a test1, yep it is', 'test1, yep', 'test1']) + :" + :"""" Combining different tests and features + :call add(tl, [2, '[[:alpha:]]\{-2,6}', '787abcdiuhsasiuhb4', 'ab']) +--- 294,315 ---- + :call add(tl, [2, '\v(a \zsif .*){2}', 'a if then a if last', 'if last', 'a if last']) + :call add(tl, [2, '\>\zs.', 'aword. ', '.']) + :" +! :"""" Tests for \@= and \& features +! :call add(tl, [2, 'abc\@=', 'abc', 'ab']) +! :call add(tl, [2, 'abc\@=cd', 'abcd', 'abcd']) +! :call add(tl, [2, 'abc\@=', 'ababc', 'ab']) + :" will never match, no matter the input text + :call add(tl, [2, 'abcd\@=e', 'abcd']) + :" will never match + :call add(tl, [2, 'abcd\@=e', 'any text in here ... ']) +! :call add(tl, [2, '\v(abc)@=..', 'xabcd', 'ab', 'abc']) + :" no match + :call add(tl, [2, '\(.*John\)\@=.*Bob', 'here is John, and here is B']) +! :call add(tl, [2, '\(John.*\)\@=.*Bob', 'John is Bobs friend', 'John is Bob', 'John is Bobs friend']) + :" no match + :call add(tl, [2, '.*John\&.*Bob', 'here is John, and here is B']) +! :call add(tl, [2, '.*John\&.*Bob', 'John is Bobs friend', 'John is Bob']) +! :call add(tl, [2, '\v(test1)@=.*yep', 'this is a test1, yep it is', 'test1, yep', 'test1']) + :" + :"""" Combining different tests and features + :call add(tl, [2, '[[:alpha:]]\{-2,6}', '787abcdiuhsasiuhb4', 'ab']) +*** ../vim-7.3.1075/src/testdir/test64.ok 2013-05-30 18:45:20.000000000 +0200 +--- src/testdir/test64.ok 2013-05-30 21:29:06.000000000 +0200 +*************** +*** 647,656 **** +--- 647,659 ---- + OK 2 - \>\zs. + OK 0 - abc\@= + OK 1 - abc\@= ++ OK 2 - abc\@= + OK 0 - abc\@=cd + OK 1 - abc\@=cd ++ OK 2 - abc\@=cd + OK 0 - abc\@= + OK 1 - abc\@= ++ OK 2 - abc\@= + OK 0 - abcd\@=e + OK 1 - abcd\@=e + OK 2 - abcd\@=e +*************** +*** 659,676 **** +--- 662,683 ---- + OK 2 - abcd\@=e + OK 0 - \v(abc)@=.. + OK 1 - \v(abc)@=.. ++ OK 2 - \v(abc)@=.. + OK 0 - \(.*John\)\@=.*Bob + OK 1 - \(.*John\)\@=.*Bob + OK 2 - \(.*John\)\@=.*Bob + OK 0 - \(John.*\)\@=.*Bob + OK 1 - \(John.*\)\@=.*Bob ++ OK 2 - \(John.*\)\@=.*Bob + OK 0 - .*John\&.*Bob + OK 1 - .*John\&.*Bob + OK 2 - .*John\&.*Bob + OK 0 - .*John\&.*Bob + OK 1 - .*John\&.*Bob ++ OK 2 - .*John\&.*Bob + OK 0 - \v(test1)@=.*yep + OK 1 - \v(test1)@=.*yep ++ OK 2 - \v(test1)@=.*yep + OK 0 - [[:alpha:]]\{-2,6} + OK 1 - [[:alpha:]]\{-2,6} + OK 2 - [[:alpha:]]\{-2,6} +*** ../vim-7.3.1075/src/version.c 2013-05-30 19:18:27.000000000 +0200 +--- src/version.c 2013-05-30 21:34:53.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1076, + /**/ + +-- +I'm not familiar with this proof, but I'm aware of a significant +following of toddlers who believe that peanut butter is the solution +to all of life's problems... -- Tim Hammerquist + + /// 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 /// diff --git a/7.3.1077 b/7.3.1077 new file mode 100644 index 0000000..3006835 --- /dev/null +++ b/7.3.1077 @@ -0,0 +1,462 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1077 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1077 +Problem: Python: Allocating dict the wrong way, causing a crash. +Solution: Use py_dict_alloc(). Fix some exception problems. (ZyX) +Files: src/if_py_both.h + + +*** ../vim-7.3.1076/src/if_py_both.h 2013-05-30 19:01:20.000000000 +0200 +--- src/if_py_both.h 2013-05-30 21:53:00.000000000 +0200 +*************** +*** 26,56 **** + + #define PyErr_SetVim(str) PyErr_SetString(VimError, str) + + #define INVALID_BUFFER_VALUE ((buf_T *)(-1)) + #define INVALID_WINDOW_VALUE ((win_T *)(-1)) + #define INVALID_TABPAGE_VALUE ((tabpage_T *)(-1)) + +- #define DICTKEY_DECL \ +- PyObject *dictkey_todecref = NULL; +- #define DICTKEY_GET(err, decref) \ +- if (!(key = StringToChars(keyObject, &dictkey_todecref))) \ +- { \ +- if (decref) \ +- { \ +- Py_DECREF(keyObject); \ +- } \ +- return err; \ +- } \ +- if (decref && !dictkey_todecref) \ +- dictkey_todecref = keyObject; \ +- if (*key == NUL) \ +- { \ +- PyErr_SetString(PyExc_ValueError, _("empty keys are not allowed")); \ +- return err; \ +- } +- #define DICTKEY_UNREF \ +- Py_XDECREF(dictkey_todecref); +- + typedef void (*rangeinitializer)(void *); + typedef void (*runner)(const char *, void * + #ifdef PY_CAN_RECURSE +--- 26,38 ---- + + #define PyErr_SetVim(str) PyErr_SetString(VimError, str) + ++ #define RAISE_NO_EMPTY_KEYS PyErr_SetString(PyExc_ValueError, \ ++ _("empty keys are not allowed")) ++ + #define INVALID_BUFFER_VALUE ((buf_T *)(-1)) + #define INVALID_WINDOW_VALUE ((win_T *)(-1)) + #define INVALID_TABPAGE_VALUE ((tabpage_T *)(-1)) + + typedef void (*rangeinitializer)(void *); + typedef void (*runner)(const char *, void * + #ifdef PY_CAN_RECURSE +*************** +*** 1016,1023 **** + dictitem_T *di; + dict_T *dict = self->dict; + hashitem_T *hi; +! +! DICTKEY_DECL + + if (flags & DICT_FLAG_HAS_DEFAULT) + { +--- 998,1004 ---- + dictitem_T *di; + dict_T *dict = self->dict; + hashitem_T *hi; +! PyObject *todecref; + + if (flags & DICT_FLAG_HAS_DEFAULT) + { +*************** +*** 1030,1040 **** + if (flags & DICT_FLAG_RETURN_BOOL) + defObject = Py_False; + +! DICTKEY_GET(NULL, 0) + + hi = hash_find(&dict->dv_hashtab, key); + +! DICTKEY_UNREF + + if (HASHITEM_EMPTY(hi)) + { +--- 1011,1028 ---- + if (flags & DICT_FLAG_RETURN_BOOL) + defObject = Py_False; + +! if (!(key = StringToChars(keyObject, &todecref))) +! return NULL; +! +! if (*key == NUL) +! { +! RAISE_NO_EMPTY_KEYS; +! return NULL; +! } + + hi = hash_find(&dict->dv_hashtab, key); + +! Py_XDECREF(todecref); + + if (HASHITEM_EMPTY(hi)) + { +*************** +*** 1173,1179 **** + typval_T tv; + dict_T *dict = self->dict; + dictitem_T *di; +! DICTKEY_DECL + + if (dict->dv_lock) + { +--- 1161,1167 ---- + typval_T tv; + dict_T *dict = self->dict; + dictitem_T *di; +! PyObject *todecref; + + if (dict->dv_lock) + { +*************** +*** 1181,1187 **** + return -1; + } + +! DICTKEY_GET(-1, 0) + + di = dict_find(dict, key, -1); + +--- 1169,1181 ---- + return -1; + } + +! if (!(key = StringToChars(keyObject, &todecref))) +! return -1; +! if (*key == NUL) +! { +! RAISE_NO_EMPTY_KEYS; +! return -1; +! } + + di = dict_find(dict, key, -1); + +*************** +*** 1191,1197 **** + + if (di == NULL) + { +! DICTKEY_UNREF + PyErr_SetObject(PyExc_KeyError, keyObject); + return -1; + } +--- 1185,1191 ---- + + if (di == NULL) + { +! Py_XDECREF(todecref); + PyErr_SetObject(PyExc_KeyError, keyObject); + return -1; + } +*************** +*** 1208,1213 **** +--- 1202,1208 ---- + { + if (!(di = dictitem_alloc(key))) + { ++ Py_XDECREF(todecref); + PyErr_NoMemory(); + return -1; + } +*************** +*** 1216,1222 **** + + if (dict_add(dict, di) == FAIL) + { +! DICTKEY_UNREF + vim_free(di); + dictitem_free(di); + PyErr_SetVim(_("failed to add key to dictionary")); +--- 1211,1217 ---- + + if (dict_add(dict, di) == FAIL) + { +! Py_XDECREF(todecref); + vim_free(di); + dictitem_free(di); + PyErr_SetVim(_("failed to add key to dictionary")); +*************** +*** 1226,1232 **** + else + clear_tv(&di->di_tv); + +! DICTKEY_UNREF + + copy_tv(&tv, &di->di_tv); + clear_tv(&tv); +--- 1221,1227 ---- + else + clear_tv(&di->di_tv); + +! Py_XDECREF(todecref); + + copy_tv(&tv, &di->di_tv); + clear_tv(&tv); +*************** +*** 2202,2218 **** + int flags; + long numval; + char_u *stringval; +! DICTKEY_DECL + + if (self->Check(self->from)) + return NULL; + +! DICTKEY_GET(NULL, 0) + + flags = get_option_value_strict(key, &numval, &stringval, + self->opt_type, self->from); + +! DICTKEY_UNREF + + if (flags == 0) + { +--- 2197,2219 ---- + int flags; + long numval; + char_u *stringval; +! PyObject *todecref; + + if (self->Check(self->from)) + return NULL; + +! if (!(key = StringToChars(keyObject, &todecref))) +! return NULL; +! if (*key == NUL) +! { +! RAISE_NO_EMPTY_KEYS; +! return NULL; +! } + + flags = get_option_value_strict(key, &numval, &stringval, + self->opt_type, self->from); + +! Py_XDECREF(todecref); + + if (flags == 0) + { +*************** +*** 2329,2340 **** + int flags; + int opt_flags; + int r = 0; +! DICTKEY_DECL + + if (self->Check(self->from)) + return -1; + +! DICTKEY_GET(-1, 0) + + flags = get_option_value_strict(key, NULL, NULL, + self->opt_type, self->from); +--- 2330,2347 ---- + int flags; + int opt_flags; + int r = 0; +! PyObject *todecref; + + if (self->Check(self->from)) + return -1; + +! if (!(key = StringToChars(keyObject, &todecref))) +! return -1; +! if (*key == NUL) +! { +! RAISE_NO_EMPTY_KEYS; +! return -1; +! } + + flags = get_option_value_strict(key, NULL, NULL, + self->opt_type, self->from); +*************** +*** 2342,2348 **** + if (flags == 0) + { + PyErr_SetObject(PyExc_KeyError, keyObject); +! DICTKEY_UNREF + return -1; + } + +--- 2349,2355 ---- + if (flags == 0) + { + PyErr_SetObject(PyExc_KeyError, keyObject); +! Py_XDECREF(todecref); + return -1; + } + +*************** +*** 2352,2371 **** + { + PyErr_SetString(PyExc_ValueError, + _("unable to unset global option")); +! DICTKEY_UNREF + return -1; + } + else if (!(flags & SOPT_GLOBAL)) + { + PyErr_SetString(PyExc_ValueError, _("unable to unset option " + "without global value")); +! DICTKEY_UNREF + return -1; + } + else + { + unset_global_local_option(key, self->from); +! DICTKEY_UNREF + return 0; + } + } +--- 2359,2378 ---- + { + PyErr_SetString(PyExc_ValueError, + _("unable to unset global option")); +! Py_XDECREF(todecref); + return -1; + } + else if (!(flags & SOPT_GLOBAL)) + { + PyErr_SetString(PyExc_ValueError, _("unable to unset option " + "without global value")); +! Py_XDECREF(todecref); + return -1; + } + else + { + unset_global_local_option(key, self->from); +! Py_XDECREF(todecref); + return 0; + } + } +*************** +*** 2396,2402 **** + else + { + PyErr_SetString(PyExc_TypeError, _("object must be integer")); +! DICTKEY_UNREF + return -1; + } + +--- 2403,2409 ---- + else + { + PyErr_SetString(PyExc_TypeError, _("object must be integer")); +! Py_XDECREF(todecref); + return -1; + } + +*************** +*** 2418,2424 **** + r = -1; + } + +! DICTKEY_UNREF + + return r; + } +--- 2425,2431 ---- + r = -1; + } + +! Py_XDECREF(todecref); + + return r; + } +*************** +*** 4528,4534 **** + PyObject *valObject; + Py_ssize_t iter = 0; + +! if (!(dict = dict_alloc())) + return -1; + + tv->v_type = VAR_DICT; +--- 4535,4541 ---- + PyObject *valObject; + Py_ssize_t iter = 0; + +! if (!(dict = py_dict_alloc())) + return -1; + + tv->v_type = VAR_DICT; +*************** +*** 4553,4558 **** +--- 4560,4566 ---- + { + dict_unref(dict); + Py_XDECREF(todecref); ++ RAISE_NO_EMPTY_KEYS; + return -1; + } + +*************** +*** 4600,4606 **** + PyObject *keyObject; + PyObject *valObject; + +! if (!(dict = dict_alloc())) + return -1; + + tv->v_type = VAR_DICT; +--- 4608,4614 ---- + PyObject *keyObject; + PyObject *valObject; + +! if (!(dict = py_dict_alloc())) + return -1; + + tv->v_type = VAR_DICT; +*************** +*** 4637,4642 **** +--- 4645,4651 ---- + Py_DECREF(iterator); + Py_XDECREF(todecref); + dict_unref(dict); ++ RAISE_NO_EMPTY_KEYS; + return -1; + } + +*** ../vim-7.3.1076/src/version.c 2013-05-30 21:42:09.000000000 +0200 +--- src/version.c 2013-05-30 21:49:50.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1077, + /**/ + +-- +The History of every major Galactic Civilization tends to pass through +three distinct and recognizable phases, those of Survival, Inquiry and +Sophistication, otherwise known as the How, Why and Where phases. +For instance, the first phase is characterized by the question 'How can +we eat?' the second by the question 'Why do we eat?' and the third by +the question 'Where shall we have lunch?' + -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" + + /// 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 /// diff --git a/7.3.1078 b/7.3.1078 new file mode 100644 index 0000000..e34f0fc --- /dev/null +++ b/7.3.1078 @@ -0,0 +1,205 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1078 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1078 +Problem: New regexp engine: \@! doesn't work. +Solution: Implement the negated version of \@=. +Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok + + +*** ../vim-7.3.1077/src/regexp_nfa.c 2013-05-30 21:42:09.000000000 +0200 +--- src/regexp_nfa.c 2013-05-30 22:39:40.000000000 +0200 +*************** +*** 1390,1395 **** +--- 1390,1398 ---- + case '=': + EMIT(NFA_PREV_ATOM_NO_WIDTH); + break; ++ case '!': ++ EMIT(NFA_PREV_ATOM_NO_WIDTH_NEG); ++ break; + case '0': + case '1': + case '2': +*************** +*** 1400,1406 **** + case '7': + case '8': + case '9': +- case '!': + case '<': + case '>': + /* Not supported yet */ +--- 1403,1408 ---- +*************** +*** 2373,2379 **** +--- 2375,2383 ---- + break; + + case NFA_PREV_ATOM_NO_WIDTH: ++ case NFA_PREV_ATOM_NO_WIDTH_NEG: + /* The \@= operator: match the preceding atom with zero width. ++ * The \@! operator: no match for the preceding atom. + * Surrounds the preceding atom with START_INVISIBLE and + * END_INVISIBLE, similarly to MOPEN. */ + +*************** +*** 2391,2396 **** +--- 2395,2406 ---- + s = new_state(NFA_START_INVISIBLE, e.start, s1); + if (s == NULL) + goto theend; ++ if (*p == NFA_PREV_ATOM_NO_WIDTH_NEG) ++ { ++ s->negated = TRUE; ++ s1->negated = TRUE; ++ } ++ + PUSH(frag(s, list1(&s1->out))); + break; + +*************** +*** 3541,3548 **** + addstate_here(thislist, t->state->out, &t->sub, &listidx); + else + { +! /* TODO: only copy positions in use. */ +! *m = t->sub; + nfa_match = TRUE; + } + break; +--- 3551,3560 ---- + addstate_here(thislist, t->state->out, &t->sub, &listidx); + else + { +! /* do not set submatches for \@! */ +! if (!t->state->negated) +! /* TODO: only copy positions in use. */ +! *m = t->sub; + nfa_match = TRUE; + } + break; +*************** +*** 3593,3599 **** + log_fd = stderr; + } + #endif +! if (result == TRUE) + { + int j; + +--- 3605,3612 ---- + log_fd = stderr; + } + #endif +! /* for \@! it is a match when result is FALSE */ +! if (result != t->state->negated) + { + int j; + +*** ../vim-7.3.1077/src/testdir/test64.in 2013-05-30 21:42:09.000000000 +0200 +--- src/testdir/test64.in 2013-05-30 22:41:38.000000000 +0200 +*************** +*** 303,315 **** + :" will never match + :call add(tl, [2, 'abcd\@=e', 'any text in here ... ']) + :call add(tl, [2, '\v(abc)@=..', 'xabcd', 'ab', 'abc']) +- :" no match + :call add(tl, [2, '\(.*John\)\@=.*Bob', 'here is John, and here is B']) + :call add(tl, [2, '\(John.*\)\@=.*Bob', 'John is Bobs friend', 'John is Bob', 'John is Bobs friend']) +- :" no match + :call add(tl, [2, '.*John\&.*Bob', 'here is John, and here is B']) + :call add(tl, [2, '.*John\&.*Bob', 'John is Bobs friend', 'John is Bob']) + :call add(tl, [2, '\v(test1)@=.*yep', 'this is a test1, yep it is', 'test1, yep', 'test1']) + :" + :"""" Combining different tests and features + :call add(tl, [2, '[[:alpha:]]\{-2,6}', '787abcdiuhsasiuhb4', 'ab']) +--- 303,322 ---- + :" will never match + :call add(tl, [2, 'abcd\@=e', 'any text in here ... ']) + :call add(tl, [2, '\v(abc)@=..', 'xabcd', 'ab', 'abc']) + :call add(tl, [2, '\(.*John\)\@=.*Bob', 'here is John, and here is B']) + :call add(tl, [2, '\(John.*\)\@=.*Bob', 'John is Bobs friend', 'John is Bob', 'John is Bobs friend']) + :call add(tl, [2, '.*John\&.*Bob', 'here is John, and here is B']) + :call add(tl, [2, '.*John\&.*Bob', 'John is Bobs friend', 'John is Bob']) + :call add(tl, [2, '\v(test1)@=.*yep', 'this is a test1, yep it is', 'test1, yep', 'test1']) ++ :call add(tl, [2, 'foo\(bar\)\@!', 'foobar']) ++ :call add(tl, [2, 'foo\(bar\)\@!', 'foo bar', 'foo']) ++ :call add(tl, [2, 'if \(\(then\)\@!.\)*$', ' if then else']) ++ :call add(tl, [2, 'if \(\(then\)\@!.\)*$', ' if else ', 'if else ', ' ']) ++ :call add(tl, [2, '\(foo\)\@!bar', 'foobar', 'bar']) ++ :call add(tl, [2, '\(foo\)\@!...bar', 'foobar']) ++ :call add(tl, [2, '^\%(.*bar\)\@!.*\zsfoo', ' bar foo ']) ++ :call add(tl, [2, '^\%(.*bar\)\@!.*\zsfoo', ' foo bar ']) ++ :call add(tl, [2, '^\%(.*bar\)\@!.*\zsfoo', ' foo xxx ', 'foo']) + :" + :"""" Combining different tests and features + :call add(tl, [2, '[[:alpha:]]\{-2,6}', '787abcdiuhsasiuhb4', 'ab']) +*** ../vim-7.3.1077/src/testdir/test64.ok 2013-05-30 21:42:09.000000000 +0200 +--- src/testdir/test64.ok 2013-05-30 22:42:02.000000000 +0200 +*************** +*** 678,683 **** +--- 678,710 ---- + OK 0 - \v(test1)@=.*yep + OK 1 - \v(test1)@=.*yep + OK 2 - \v(test1)@=.*yep ++ OK 0 - foo\(bar\)\@! ++ OK 1 - foo\(bar\)\@! ++ OK 2 - foo\(bar\)\@! ++ OK 0 - foo\(bar\)\@! ++ OK 1 - foo\(bar\)\@! ++ OK 2 - foo\(bar\)\@! ++ OK 0 - if \(\(then\)\@!.\)*$ ++ OK 1 - if \(\(then\)\@!.\)*$ ++ OK 2 - if \(\(then\)\@!.\)*$ ++ OK 0 - if \(\(then\)\@!.\)*$ ++ OK 1 - if \(\(then\)\@!.\)*$ ++ OK 2 - if \(\(then\)\@!.\)*$ ++ OK 0 - \(foo\)\@!bar ++ OK 1 - \(foo\)\@!bar ++ OK 2 - \(foo\)\@!bar ++ OK 0 - \(foo\)\@!...bar ++ OK 1 - \(foo\)\@!...bar ++ OK 2 - \(foo\)\@!...bar ++ OK 0 - ^\%(.*bar\)\@!.*\zsfoo ++ OK 1 - ^\%(.*bar\)\@!.*\zsfoo ++ OK 2 - ^\%(.*bar\)\@!.*\zsfoo ++ OK 0 - ^\%(.*bar\)\@!.*\zsfoo ++ OK 1 - ^\%(.*bar\)\@!.*\zsfoo ++ OK 2 - ^\%(.*bar\)\@!.*\zsfoo ++ OK 0 - ^\%(.*bar\)\@!.*\zsfoo ++ OK 1 - ^\%(.*bar\)\@!.*\zsfoo ++ OK 2 - ^\%(.*bar\)\@!.*\zsfoo + OK 0 - [[:alpha:]]\{-2,6} + OK 1 - [[:alpha:]]\{-2,6} + OK 2 - [[:alpha:]]\{-2,6} +*** ../vim-7.3.1077/src/version.c 2013-05-30 22:06:28.000000000 +0200 +--- src/version.c 2013-05-30 22:42:59.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1078, + /**/ + +-- +The startling truth finally became apparent, and it was this: Numbers +written on restaurant checks within the confines of restaurants do not follow +the same mathematical laws as numbers written on any other pieces of paper in +any other parts of the Universe. This single statement took the scientific +world by storm. So many mathematical conferences got held in such good +restaurants that many of the finest minds of a generation died of obesity and +heart failure, and the science of mathematics was put back by years. + -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" + + /// 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 /// diff --git a/7.3.1079 b/7.3.1079 new file mode 100644 index 0000000..8b07dbc --- /dev/null +++ b/7.3.1079 @@ -0,0 +1,832 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1079 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1079 +Problem: Test 87 fails. +Solution: Fix the test for Python 3.3. (ZyX) Make it pass on 32 bit systems. +Files: src/testdir/test87.in, src/testdir/test87.ok + + +*** ../vim-7.3.1078/src/testdir/test87.in 2013-05-30 15:38:20.000000000 +0200 +--- src/testdir/test87.in 2013-05-31 18:40:40.000000000 +0200 +*************** +*** 2,9 **** + + STARTTEST + :so small.vim +- :" HACK: currently crashes, skip the test +- :e! test.ok | wq! test.out + :if !has('python3') | e! test.ok | wq! test.out | endif + :lang C + :py3 import vim +--- 2,7 ---- +*************** +*** 710,719 **** + :" + :" Test stdout/stderr + :redir => messages +! :py sys.stdout.write('abc') ; sys.stdout.write('def') +! :py sys.stderr.write('abc') ; sys.stderr.write('def') +! :py sys.stdout.writelines(iter('abc')) +! :py sys.stderr.writelines(iter('abc')) + :redir END + :$put =string(substitute(messages, '\d\+', '', 'g')) + :" Test subclassing +--- 708,717 ---- + :" + :" Test stdout/stderr + :redir => messages +! :py3 sys.stdout.write('abc') ; sys.stdout.write('def') +! :py3 sys.stderr.write('abc') ; sys.stderr.write('def') +! :py3 sys.stdout.writelines(iter('abc')) +! :py3 sys.stderr.writelines(iter('abc')) + :redir END + :$put =string(substitute(messages, '\d\+', '', 'g')) + :" Test subclassing +*************** +*** 759,765 **** + try: + exec(expr, g, l) + except Exception as e: +! cb.append(expr + ':' + repr((e.__class__, e))) + else: + cb.append(expr + ':NOT FAILED') + except Exception as e: +--- 757,766 ---- + try: + exec(expr, g, l) + except Exception as e: +! if sys.version_info >= (3, 3) and e.__class__ is AttributeError and str(e).find('has no attribute')>=0 and not str(e).startswith("'vim."): +! cb.append(expr + ':' + repr((e.__class__, AttributeError(str(e)[str(e).rfind(" '") + 2:-1])))) +! else: +! cb.append(expr + ':' + repr((e.__class__, e))) + else: + cb.append(expr + ':NOT FAILED') + except Exception as e: +*************** +*** 786,793 **** + def stringtochars_test(expr): + return subexpr_test(expr, 'StringToChars', ( + '1', # Fail type checks +! 'u"\\0"', # Fail PyString_AsStringAndSize(bytes, , NULL) check +! '"\\0"', # Fail PyString_AsStringAndSize(object, , NULL) check + )) + + class Mapping(object): +--- 787,794 ---- + def stringtochars_test(expr): + return subexpr_test(expr, 'StringToChars', ( + '1', # Fail type checks +! 'b"\\0"', # Fail PyString_AsStringAndSize(object, , NULL) check +! '"\\0"', # Fail PyString_AsStringAndSize(bytes, , NULL) check + )) + + class Mapping(object): +*************** +*** 968,974 **** + ee('vim.current.window.xxx') + cb.append(">> WindowSetattr") + ee('vim.current.window.buffer = 0') +! ee('vim.current.window.cursor = (10000000000, 100000000)') + ee('vim.current.window.cursor = True') + ee('vim.current.window.height = "abc"') + ee('vim.current.window.width = "abc"') +--- 969,975 ---- + ee('vim.current.window.xxx') + cb.append(">> WindowSetattr") + ee('vim.current.window.buffer = 0') +! ee('vim.current.window.cursor = (100000000, 100000000)') + ee('vim.current.window.cursor = True') + ee('vim.current.window.height = "abc"') + ee('vim.current.window.width = "abc"') +*************** +*** 989,997 **** + ee('vim.current.buffer.append(["\\na", "bc"])') + ee('vim.current.buffer.append("\\nbc")') + cb.append(">> RBItem") +! ee('vim.current.buffer[10000000000]') + cb.append(">> RBAsItem") +! ee('vim.current.buffer[10000000000] = ""') + cb.append(">> BufferAttr") + ee('vim.current.buffer.xxx') + cb.append(">> BufferSetattr") +--- 990,998 ---- + ee('vim.current.buffer.append(["\\na", "bc"])') + ee('vim.current.buffer.append("\\nbc")') + cb.append(">> RBItem") +! ee('vim.current.buffer[100000000]') + cb.append(">> RBAsItem") +! ee('vim.current.buffer[100000000] = ""') + cb.append(">> BufferAttr") + ee('vim.current.buffer.xxx') + cb.append(">> BufferSetattr") +*** ../vim-7.3.1078/src/testdir/test87.ok 2013-05-30 13:37:23.000000000 +0200 +--- src/testdir/test87.ok 2013-05-31 18:41:15.000000000 +0200 +*************** +*** 454,460 **** + d.get("a", 2, 3):(, TypeError('function takes at most 2 arguments (3 given)',)) + >>> Testing StringToChars using d.get(%s) + d.get(1):(, TypeError('object must be string',)) +! d.get(u"\0"):(, TypeError('expected bytes with no null',)) + d.get("\0"):(, TypeError('expected bytes with no null',)) + <<< Finished + d.pop("a"):(, KeyError('a',)) +--- 454,460 ---- + d.get("a", 2, 3):(, TypeError('function takes at most 2 arguments (3 given)',)) + >>> Testing StringToChars using d.get(%s) + d.get(1):(, TypeError('object must be string',)) +! d.get(b"\0"):(, TypeError('expected bytes with no null',)) + d.get("\0"):(, TypeError('expected bytes with no null',)) + <<< Finished + d.pop("a"):(, KeyError('a',)) +*************** +*** 465,486 **** + dl["b"] = 1:(, error('dict is locked',)) + >>> Testing StringToChars using d[%s] = 1 + d[1] = 1:(, TypeError('object must be string',)) +! d[u"\0"] = 1:(, TypeError('expected bytes with no null',)) + d["\0"] = 1:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d["a"] = {%s : 1} + d["a"] = {1 : 1}:(, TypeError('object must be string',)) +! d["a"] = {u"\0" : 1}:(, TypeError('expected bytes with no null',)) + d["a"] = {"\0" : 1}:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d["a"] = {"abc" : {%s : 1}} + d["a"] = {"abc" : {1 : 1}}:(, TypeError('object must be string',)) +! d["a"] = {"abc" : {u"\0" : 1}}:(, TypeError('expected bytes with no null',)) + d["a"] = {"abc" : {"\0" : 1}}:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d["a"] = {"abc" : Mapping({%s : 1})} + d["a"] = {"abc" : Mapping({1 : 1})}:(, TypeError('object must be string',)) +! d["a"] = {"abc" : Mapping({u"\0" : 1})}:(, TypeError('expected bytes with no null',)) + d["a"] = {"abc" : Mapping({"\0" : 1})}:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using d["a"] = {"abc" : %s} +--- 465,486 ---- + dl["b"] = 1:(, error('dict is locked',)) + >>> Testing StringToChars using d[%s] = 1 + d[1] = 1:(, TypeError('object must be string',)) +! d[b"\0"] = 1:(, TypeError('expected bytes with no null',)) + d["\0"] = 1:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d["a"] = {%s : 1} + d["a"] = {1 : 1}:(, TypeError('object must be string',)) +! d["a"] = {b"\0" : 1}:(, TypeError('expected bytes with no null',)) + d["a"] = {"\0" : 1}:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d["a"] = {"abc" : {%s : 1}} + d["a"] = {"abc" : {1 : 1}}:(, TypeError('object must be string',)) +! d["a"] = {"abc" : {b"\0" : 1}}:(, TypeError('expected bytes with no null',)) + d["a"] = {"abc" : {"\0" : 1}}:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d["a"] = {"abc" : Mapping({%s : 1})} + d["a"] = {"abc" : Mapping({1 : 1})}:(, TypeError('object must be string',)) +! d["a"] = {"abc" : Mapping({b"\0" : 1})}:(, TypeError('expected bytes with no null',)) + d["a"] = {"abc" : Mapping({"\0" : 1})}:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using d["a"] = {"abc" : %s} +*************** +*** 495,511 **** + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({%s : 1}) + d["a"] = Mapping({1 : 1}):(, TypeError('object must be string',)) +! d["a"] = Mapping({u"\0" : 1}):(, TypeError('expected bytes with no null',)) + d["a"] = Mapping({"\0" : 1}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({"abc" : {%s : 1}}) + d["a"] = Mapping({"abc" : {1 : 1}}):(, TypeError('object must be string',)) +! d["a"] = Mapping({"abc" : {u"\0" : 1}}):(, TypeError('expected bytes with no null',)) + d["a"] = Mapping({"abc" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({"abc" : Mapping({%s : 1})}) + d["a"] = Mapping({"abc" : Mapping({1 : 1})}):(, TypeError('object must be string',)) +! d["a"] = Mapping({"abc" : Mapping({u"\0" : 1})}):(, TypeError('expected bytes with no null',)) + d["a"] = Mapping({"abc" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using d["a"] = Mapping({"abc" : %s}) +--- 495,511 ---- + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({%s : 1}) + d["a"] = Mapping({1 : 1}):(, TypeError('object must be string',)) +! d["a"] = Mapping({b"\0" : 1}):(, TypeError('expected bytes with no null',)) + d["a"] = Mapping({"\0" : 1}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({"abc" : {%s : 1}}) + d["a"] = Mapping({"abc" : {1 : 1}}):(, TypeError('object must be string',)) +! d["a"] = Mapping({"abc" : {b"\0" : 1}}):(, TypeError('expected bytes with no null',)) + d["a"] = Mapping({"abc" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({"abc" : Mapping({%s : 1})}) + d["a"] = Mapping({"abc" : Mapping({1 : 1})}):(, TypeError('object must be string',)) +! d["a"] = Mapping({"abc" : Mapping({b"\0" : 1})}):(, TypeError('expected bytes with no null',)) + d["a"] = Mapping({"abc" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using d["a"] = Mapping({"abc" : %s}) +*************** +*** 539,555 **** + <<< Finished + >>> Testing StringToChars using d.update({%s : 1}) + d.update({1 : 1}):(, TypeError('object must be string',)) +! d.update({u"\0" : 1}):(, TypeError('expected bytes with no null',)) + d.update({"\0" : 1}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update({"abc" : {%s : 1}}) + d.update({"abc" : {1 : 1}}):(, TypeError('object must be string',)) +! d.update({"abc" : {u"\0" : 1}}):(, TypeError('expected bytes with no null',)) + d.update({"abc" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update({"abc" : Mapping({%s : 1})}) + d.update({"abc" : Mapping({1 : 1})}):(, TypeError('object must be string',)) +! d.update({"abc" : Mapping({u"\0" : 1})}):(, TypeError('expected bytes with no null',)) + d.update({"abc" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using d.update({"abc" : %s}) +--- 539,555 ---- + <<< Finished + >>> Testing StringToChars using d.update({%s : 1}) + d.update({1 : 1}):(, TypeError('object must be string',)) +! d.update({b"\0" : 1}):(, TypeError('expected bytes with no null',)) + d.update({"\0" : 1}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update({"abc" : {%s : 1}}) + d.update({"abc" : {1 : 1}}):(, TypeError('object must be string',)) +! d.update({"abc" : {b"\0" : 1}}):(, TypeError('expected bytes with no null',)) + d.update({"abc" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update({"abc" : Mapping({%s : 1})}) + d.update({"abc" : Mapping({1 : 1})}):(, TypeError('object must be string',)) +! d.update({"abc" : Mapping({b"\0" : 1})}):(, TypeError('expected bytes with no null',)) + d.update({"abc" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using d.update({"abc" : %s}) +*************** +*** 564,580 **** + <<< Finished + >>> Testing StringToChars using d.update(Mapping({%s : 1})) + d.update(Mapping({1 : 1})):(, TypeError('object must be string',)) +! d.update(Mapping({u"\0" : 1})):(, TypeError('expected bytes with no null',)) + d.update(Mapping({"\0" : 1})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update(Mapping({"abc" : {%s : 1}})) + d.update(Mapping({"abc" : {1 : 1}})):(, TypeError('object must be string',)) +! d.update(Mapping({"abc" : {u"\0" : 1}})):(, TypeError('expected bytes with no null',)) + d.update(Mapping({"abc" : {"\0" : 1}})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update(Mapping({"abc" : Mapping({%s : 1})})) + d.update(Mapping({"abc" : Mapping({1 : 1})})):(, TypeError('object must be string',)) +! d.update(Mapping({"abc" : Mapping({u"\0" : 1})})):(, TypeError('expected bytes with no null',)) + d.update(Mapping({"abc" : Mapping({"\0" : 1})})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using d.update(Mapping({"abc" : %s})) +--- 564,580 ---- + <<< Finished + >>> Testing StringToChars using d.update(Mapping({%s : 1})) + d.update(Mapping({1 : 1})):(, TypeError('object must be string',)) +! d.update(Mapping({b"\0" : 1})):(, TypeError('expected bytes with no null',)) + d.update(Mapping({"\0" : 1})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update(Mapping({"abc" : {%s : 1}})) + d.update(Mapping({"abc" : {1 : 1}})):(, TypeError('object must be string',)) +! d.update(Mapping({"abc" : {b"\0" : 1}})):(, TypeError('expected bytes with no null',)) + d.update(Mapping({"abc" : {"\0" : 1}})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update(Mapping({"abc" : Mapping({%s : 1})})) + d.update(Mapping({"abc" : Mapping({1 : 1})})):(, TypeError('object must be string',)) +! d.update(Mapping({"abc" : Mapping({b"\0" : 1})})):(, TypeError('expected bytes with no null',)) + d.update(Mapping({"abc" : Mapping({"\0" : 1})})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using d.update(Mapping({"abc" : %s})) +*************** +*** 599,620 **** + <<< Finished + >>> Testing StringToChars using d.update(((%s, 0),)) + d.update(((1, 0),)):(, TypeError('object must be string',)) +! d.update(((u"\0", 0),)):(, TypeError('expected bytes with no null',)) + d.update((("\0", 0),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", {%s : 1}),)) + d.update((("a", {1 : 1}),)):(, TypeError('object must be string',)) +! d.update((("a", {u"\0" : 1}),)):(, TypeError('expected bytes with no null',)) + d.update((("a", {"\0" : 1}),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", {"abc" : {%s : 1}}),)) + d.update((("a", {"abc" : {1 : 1}}),)):(, TypeError('object must be string',)) +! d.update((("a", {"abc" : {u"\0" : 1}}),)):(, TypeError('expected bytes with no null',)) + d.update((("a", {"abc" : {"\0" : 1}}),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", {"abc" : Mapping({%s : 1})}),)) + d.update((("a", {"abc" : Mapping({1 : 1})}),)):(, TypeError('object must be string',)) +! d.update((("a", {"abc" : Mapping({u"\0" : 1})}),)):(, TypeError('expected bytes with no null',)) + d.update((("a", {"abc" : Mapping({"\0" : 1})}),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using d.update((("a", {"abc" : %s}),)) +--- 599,620 ---- + <<< Finished + >>> Testing StringToChars using d.update(((%s, 0),)) + d.update(((1, 0),)):(, TypeError('object must be string',)) +! d.update(((b"\0", 0),)):(, TypeError('expected bytes with no null',)) + d.update((("\0", 0),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", {%s : 1}),)) + d.update((("a", {1 : 1}),)):(, TypeError('object must be string',)) +! d.update((("a", {b"\0" : 1}),)):(, TypeError('expected bytes with no null',)) + d.update((("a", {"\0" : 1}),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", {"abc" : {%s : 1}}),)) + d.update((("a", {"abc" : {1 : 1}}),)):(, TypeError('object must be string',)) +! d.update((("a", {"abc" : {b"\0" : 1}}),)):(, TypeError('expected bytes with no null',)) + d.update((("a", {"abc" : {"\0" : 1}}),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", {"abc" : Mapping({%s : 1})}),)) + d.update((("a", {"abc" : Mapping({1 : 1})}),)):(, TypeError('object must be string',)) +! d.update((("a", {"abc" : Mapping({b"\0" : 1})}),)):(, TypeError('expected bytes with no null',)) + d.update((("a", {"abc" : Mapping({"\0" : 1})}),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using d.update((("a", {"abc" : %s}),)) +*************** +*** 629,645 **** + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),)) + d.update((("a", Mapping({1 : 1})),)):(, TypeError('object must be string',)) +! d.update((("a", Mapping({u"\0" : 1})),)):(, TypeError('expected bytes with no null',)) + d.update((("a", Mapping({"\0" : 1})),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({"abc" : {%s : 1}})),)) + d.update((("a", Mapping({"abc" : {1 : 1}})),)):(, TypeError('object must be string',)) +! d.update((("a", Mapping({"abc" : {u"\0" : 1}})),)):(, TypeError('expected bytes with no null',)) + d.update((("a", Mapping({"abc" : {"\0" : 1}})),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({"abc" : Mapping({%s : 1})})),)) + d.update((("a", Mapping({"abc" : Mapping({1 : 1})})),)):(, TypeError('object must be string',)) +! d.update((("a", Mapping({"abc" : Mapping({u"\0" : 1})})),)):(, TypeError('expected bytes with no null',)) + d.update((("a", Mapping({"abc" : Mapping({"\0" : 1})})),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using d.update((("a", Mapping({"abc" : %s})),)) +--- 629,645 ---- + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),)) + d.update((("a", Mapping({1 : 1})),)):(, TypeError('object must be string',)) +! d.update((("a", Mapping({b"\0" : 1})),)):(, TypeError('expected bytes with no null',)) + d.update((("a", Mapping({"\0" : 1})),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({"abc" : {%s : 1}})),)) + d.update((("a", Mapping({"abc" : {1 : 1}})),)):(, TypeError('object must be string',)) +! d.update((("a", Mapping({"abc" : {b"\0" : 1}})),)):(, TypeError('expected bytes with no null',)) + d.update((("a", Mapping({"abc" : {"\0" : 1}})),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({"abc" : Mapping({%s : 1})})),)) + d.update((("a", Mapping({"abc" : Mapping({1 : 1})})),)):(, TypeError('object must be string',)) +! d.update((("a", Mapping({"abc" : Mapping({b"\0" : 1})})),)):(, TypeError('expected bytes with no null',)) + d.update((("a", Mapping({"abc" : Mapping({"\0" : 1})})),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using d.update((("a", Mapping({"abc" : %s})),)) +*************** +*** 676,692 **** + <<< Finished + >>> Testing StringToChars using vim.List([{%s : 1}]) + vim.List([{1 : 1}]):(, TypeError('object must be string',)) +! vim.List([{u"\0" : 1}]):(, TypeError('expected bytes with no null',)) + vim.List([{"\0" : 1}]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using vim.List([{"abc" : {%s : 1}}]) + vim.List([{"abc" : {1 : 1}}]):(, TypeError('object must be string',)) +! vim.List([{"abc" : {u"\0" : 1}}]):(, TypeError('expected bytes with no null',)) + vim.List([{"abc" : {"\0" : 1}}]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using vim.List([{"abc" : Mapping({%s : 1})}]) + vim.List([{"abc" : Mapping({1 : 1})}]):(, TypeError('object must be string',)) +! vim.List([{"abc" : Mapping({u"\0" : 1})}]):(, TypeError('expected bytes with no null',)) + vim.List([{"abc" : Mapping({"\0" : 1})}]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using vim.List([{"abc" : %s}]) +--- 676,692 ---- + <<< Finished + >>> Testing StringToChars using vim.List([{%s : 1}]) + vim.List([{1 : 1}]):(, TypeError('object must be string',)) +! vim.List([{b"\0" : 1}]):(, TypeError('expected bytes with no null',)) + vim.List([{"\0" : 1}]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using vim.List([{"abc" : {%s : 1}}]) + vim.List([{"abc" : {1 : 1}}]):(, TypeError('object must be string',)) +! vim.List([{"abc" : {b"\0" : 1}}]):(, TypeError('expected bytes with no null',)) + vim.List([{"abc" : {"\0" : 1}}]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using vim.List([{"abc" : Mapping({%s : 1})}]) + vim.List([{"abc" : Mapping({1 : 1})}]):(, TypeError('object must be string',)) +! vim.List([{"abc" : Mapping({b"\0" : 1})}]):(, TypeError('expected bytes with no null',)) + vim.List([{"abc" : Mapping({"\0" : 1})}]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using vim.List([{"abc" : %s}]) +*************** +*** 701,717 **** + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({%s : 1})]) + vim.List([Mapping({1 : 1})]):(, TypeError('object must be string',)) +! vim.List([Mapping({u"\0" : 1})]):(, TypeError('expected bytes with no null',)) + vim.List([Mapping({"\0" : 1})]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({"abc" : {%s : 1}})]) + vim.List([Mapping({"abc" : {1 : 1}})]):(, TypeError('object must be string',)) +! vim.List([Mapping({"abc" : {u"\0" : 1}})]):(, TypeError('expected bytes with no null',)) + vim.List([Mapping({"abc" : {"\0" : 1}})]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({"abc" : Mapping({%s : 1})})]) + vim.List([Mapping({"abc" : Mapping({1 : 1})})]):(, TypeError('object must be string',)) +! vim.List([Mapping({"abc" : Mapping({u"\0" : 1})})]):(, TypeError('expected bytes with no null',)) + vim.List([Mapping({"abc" : Mapping({"\0" : 1})})]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using vim.List([Mapping({"abc" : %s})]) +--- 701,717 ---- + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({%s : 1})]) + vim.List([Mapping({1 : 1})]):(, TypeError('object must be string',)) +! vim.List([Mapping({b"\0" : 1})]):(, TypeError('expected bytes with no null',)) + vim.List([Mapping({"\0" : 1})]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({"abc" : {%s : 1}})]) + vim.List([Mapping({"abc" : {1 : 1}})]):(, TypeError('object must be string',)) +! vim.List([Mapping({"abc" : {b"\0" : 1}})]):(, TypeError('expected bytes with no null',)) + vim.List([Mapping({"abc" : {"\0" : 1}})]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({"abc" : Mapping({%s : 1})})]) + vim.List([Mapping({"abc" : Mapping({1 : 1})})]):(, TypeError('object must be string',)) +! vim.List([Mapping({"abc" : Mapping({b"\0" : 1})})]):(, TypeError('expected bytes with no null',)) + vim.List([Mapping({"abc" : Mapping({"\0" : 1})})]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using vim.List([Mapping({"abc" : %s})]) +*************** +*** 747,763 **** + <<< Finished + >>> Testing StringToChars using l[:] = [{%s : 1}] + l[:] = [{1 : 1}]:(, TypeError('object must be string',)) +! l[:] = [{u"\0" : 1}]:(, TypeError('expected bytes with no null',)) + l[:] = [{"\0" : 1}]:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l[:] = [{"abc" : {%s : 1}}] + l[:] = [{"abc" : {1 : 1}}]:(, TypeError('object must be string',)) +! l[:] = [{"abc" : {u"\0" : 1}}]:(, TypeError('expected bytes with no null',)) + l[:] = [{"abc" : {"\0" : 1}}]:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l[:] = [{"abc" : Mapping({%s : 1})}] + l[:] = [{"abc" : Mapping({1 : 1})}]:(, TypeError('object must be string',)) +! l[:] = [{"abc" : Mapping({u"\0" : 1})}]:(, TypeError('expected bytes with no null',)) + l[:] = [{"abc" : Mapping({"\0" : 1})}]:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using l[:] = [{"abc" : %s}] +--- 747,763 ---- + <<< Finished + >>> Testing StringToChars using l[:] = [{%s : 1}] + l[:] = [{1 : 1}]:(, TypeError('object must be string',)) +! l[:] = [{b"\0" : 1}]:(, TypeError('expected bytes with no null',)) + l[:] = [{"\0" : 1}]:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l[:] = [{"abc" : {%s : 1}}] + l[:] = [{"abc" : {1 : 1}}]:(, TypeError('object must be string',)) +! l[:] = [{"abc" : {b"\0" : 1}}]:(, TypeError('expected bytes with no null',)) + l[:] = [{"abc" : {"\0" : 1}}]:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l[:] = [{"abc" : Mapping({%s : 1})}] + l[:] = [{"abc" : Mapping({1 : 1})}]:(, TypeError('object must be string',)) +! l[:] = [{"abc" : Mapping({b"\0" : 1})}]:(, TypeError('expected bytes with no null',)) + l[:] = [{"abc" : Mapping({"\0" : 1})}]:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using l[:] = [{"abc" : %s}] +*************** +*** 772,788 **** + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({%s : 1})] + l[:] = [Mapping({1 : 1})]:(, TypeError('object must be string',)) +! l[:] = [Mapping({u"\0" : 1})]:(, TypeError('expected bytes with no null',)) + l[:] = [Mapping({"\0" : 1})]:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({"abc" : {%s : 1}})] + l[:] = [Mapping({"abc" : {1 : 1}})]:(, TypeError('object must be string',)) +! l[:] = [Mapping({"abc" : {u"\0" : 1}})]:(, TypeError('expected bytes with no null',)) + l[:] = [Mapping({"abc" : {"\0" : 1}})]:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({"abc" : Mapping({%s : 1})})] + l[:] = [Mapping({"abc" : Mapping({1 : 1})})]:(, TypeError('object must be string',)) +! l[:] = [Mapping({"abc" : Mapping({u"\0" : 1})})]:(, TypeError('expected bytes with no null',)) + l[:] = [Mapping({"abc" : Mapping({"\0" : 1})})]:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using l[:] = [Mapping({"abc" : %s})] +--- 772,788 ---- + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({%s : 1})] + l[:] = [Mapping({1 : 1})]:(, TypeError('object must be string',)) +! l[:] = [Mapping({b"\0" : 1})]:(, TypeError('expected bytes with no null',)) + l[:] = [Mapping({"\0" : 1})]:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({"abc" : {%s : 1}})] + l[:] = [Mapping({"abc" : {1 : 1}})]:(, TypeError('object must be string',)) +! l[:] = [Mapping({"abc" : {b"\0" : 1}})]:(, TypeError('expected bytes with no null',)) + l[:] = [Mapping({"abc" : {"\0" : 1}})]:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({"abc" : Mapping({%s : 1})})] + l[:] = [Mapping({"abc" : Mapping({1 : 1})})]:(, TypeError('object must be string',)) +! l[:] = [Mapping({"abc" : Mapping({b"\0" : 1})})]:(, TypeError('expected bytes with no null',)) + l[:] = [Mapping({"abc" : Mapping({"\0" : 1})})]:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using l[:] = [Mapping({"abc" : %s})] +*************** +*** 812,828 **** + <<< Finished + >>> Testing StringToChars using l.extend([{%s : 1}]) + l.extend([{1 : 1}]):(, TypeError('object must be string',)) +! l.extend([{u"\0" : 1}]):(, TypeError('expected bytes with no null',)) + l.extend([{"\0" : 1}]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l.extend([{"abc" : {%s : 1}}]) + l.extend([{"abc" : {1 : 1}}]):(, TypeError('object must be string',)) +! l.extend([{"abc" : {u"\0" : 1}}]):(, TypeError('expected bytes with no null',)) + l.extend([{"abc" : {"\0" : 1}}]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l.extend([{"abc" : Mapping({%s : 1})}]) + l.extend([{"abc" : Mapping({1 : 1})}]):(, TypeError('object must be string',)) +! l.extend([{"abc" : Mapping({u"\0" : 1})}]):(, TypeError('expected bytes with no null',)) + l.extend([{"abc" : Mapping({"\0" : 1})}]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using l.extend([{"abc" : %s}]) +--- 812,828 ---- + <<< Finished + >>> Testing StringToChars using l.extend([{%s : 1}]) + l.extend([{1 : 1}]):(, TypeError('object must be string',)) +! l.extend([{b"\0" : 1}]):(, TypeError('expected bytes with no null',)) + l.extend([{"\0" : 1}]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l.extend([{"abc" : {%s : 1}}]) + l.extend([{"abc" : {1 : 1}}]):(, TypeError('object must be string',)) +! l.extend([{"abc" : {b"\0" : 1}}]):(, TypeError('expected bytes with no null',)) + l.extend([{"abc" : {"\0" : 1}}]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l.extend([{"abc" : Mapping({%s : 1})}]) + l.extend([{"abc" : Mapping({1 : 1})}]):(, TypeError('object must be string',)) +! l.extend([{"abc" : Mapping({b"\0" : 1})}]):(, TypeError('expected bytes with no null',)) + l.extend([{"abc" : Mapping({"\0" : 1})}]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using l.extend([{"abc" : %s}]) +*************** +*** 837,853 **** + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({%s : 1})]) + l.extend([Mapping({1 : 1})]):(, TypeError('object must be string',)) +! l.extend([Mapping({u"\0" : 1})]):(, TypeError('expected bytes with no null',)) + l.extend([Mapping({"\0" : 1})]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({"abc" : {%s : 1}})]) + l.extend([Mapping({"abc" : {1 : 1}})]):(, TypeError('object must be string',)) +! l.extend([Mapping({"abc" : {u"\0" : 1}})]):(, TypeError('expected bytes with no null',)) + l.extend([Mapping({"abc" : {"\0" : 1}})]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({"abc" : Mapping({%s : 1})})]) + l.extend([Mapping({"abc" : Mapping({1 : 1})})]):(, TypeError('object must be string',)) +! l.extend([Mapping({"abc" : Mapping({u"\0" : 1})})]):(, TypeError('expected bytes with no null',)) + l.extend([Mapping({"abc" : Mapping({"\0" : 1})})]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using l.extend([Mapping({"abc" : %s})]) +--- 837,853 ---- + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({%s : 1})]) + l.extend([Mapping({1 : 1})]):(, TypeError('object must be string',)) +! l.extend([Mapping({b"\0" : 1})]):(, TypeError('expected bytes with no null',)) + l.extend([Mapping({"\0" : 1})]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({"abc" : {%s : 1}})]) + l.extend([Mapping({"abc" : {1 : 1}})]):(, TypeError('object must be string',)) +! l.extend([Mapping({"abc" : {b"\0" : 1}})]):(, TypeError('expected bytes with no null',)) + l.extend([Mapping({"abc" : {"\0" : 1}})]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({"abc" : Mapping({%s : 1})})]) + l.extend([Mapping({"abc" : Mapping({1 : 1})})]):(, TypeError('object must be string',)) +! l.extend([Mapping({"abc" : Mapping({b"\0" : 1})})]):(, TypeError('expected bytes with no null',)) + l.extend([Mapping({"abc" : Mapping({"\0" : 1})})]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using l.extend([Mapping({"abc" : %s})]) +*************** +*** 882,898 **** + >> FunctionCall + >>> Testing StringToChars using f({%s : 1}) + f({1 : 1}):(, TypeError('object must be string',)) +! f({u"\0" : 1}):(, TypeError('expected bytes with no null',)) + f({"\0" : 1}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using f({"abc" : {%s : 1}}) + f({"abc" : {1 : 1}}):(, TypeError('object must be string',)) +! f({"abc" : {u"\0" : 1}}):(, TypeError('expected bytes with no null',)) + f({"abc" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using f({"abc" : Mapping({%s : 1})}) + f({"abc" : Mapping({1 : 1})}):(, TypeError('object must be string',)) +! f({"abc" : Mapping({u"\0" : 1})}):(, TypeError('expected bytes with no null',)) + f({"abc" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using f({"abc" : %s}) +--- 882,898 ---- + >> FunctionCall + >>> Testing StringToChars using f({%s : 1}) + f({1 : 1}):(, TypeError('object must be string',)) +! f({b"\0" : 1}):(, TypeError('expected bytes with no null',)) + f({"\0" : 1}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using f({"abc" : {%s : 1}}) + f({"abc" : {1 : 1}}):(, TypeError('object must be string',)) +! f({"abc" : {b"\0" : 1}}):(, TypeError('expected bytes with no null',)) + f({"abc" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using f({"abc" : Mapping({%s : 1})}) + f({"abc" : Mapping({1 : 1})}):(, TypeError('object must be string',)) +! f({"abc" : Mapping({b"\0" : 1})}):(, TypeError('expected bytes with no null',)) + f({"abc" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using f({"abc" : %s}) +*************** +*** 907,923 **** + <<< Finished + >>> Testing StringToChars using f(Mapping({%s : 1})) + f(Mapping({1 : 1})):(, TypeError('object must be string',)) +! f(Mapping({u"\0" : 1})):(, TypeError('expected bytes with no null',)) + f(Mapping({"\0" : 1})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using f(Mapping({"abc" : {%s : 1}})) + f(Mapping({"abc" : {1 : 1}})):(, TypeError('object must be string',)) +! f(Mapping({"abc" : {u"\0" : 1}})):(, TypeError('expected bytes with no null',)) + f(Mapping({"abc" : {"\0" : 1}})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using f(Mapping({"abc" : Mapping({%s : 1})})) + f(Mapping({"abc" : Mapping({1 : 1})})):(, TypeError('object must be string',)) +! f(Mapping({"abc" : Mapping({u"\0" : 1})})):(, TypeError('expected bytes with no null',)) + f(Mapping({"abc" : Mapping({"\0" : 1})})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using f(Mapping({"abc" : %s})) +--- 907,923 ---- + <<< Finished + >>> Testing StringToChars using f(Mapping({%s : 1})) + f(Mapping({1 : 1})):(, TypeError('object must be string',)) +! f(Mapping({b"\0" : 1})):(, TypeError('expected bytes with no null',)) + f(Mapping({"\0" : 1})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using f(Mapping({"abc" : {%s : 1}})) + f(Mapping({"abc" : {1 : 1}})):(, TypeError('object must be string',)) +! f(Mapping({"abc" : {b"\0" : 1}})):(, TypeError('expected bytes with no null',)) + f(Mapping({"abc" : {"\0" : 1}})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using f(Mapping({"abc" : Mapping({%s : 1})})) + f(Mapping({"abc" : Mapping({1 : 1})})):(, TypeError('object must be string',)) +! f(Mapping({"abc" : Mapping({b"\0" : 1})})):(, TypeError('expected bytes with no null',)) + f(Mapping({"abc" : Mapping({"\0" : 1})})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using f(Mapping({"abc" : %s})) +*************** +*** 942,958 **** + <<< Finished + >>> Testing StringToChars using fd(self={%s : 1}) + fd(self={1 : 1}):(, TypeError('object must be string',)) +! fd(self={u"\0" : 1}):(, TypeError('expected bytes with no null',)) + fd(self={"\0" : 1}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using fd(self={"abc" : {%s : 1}}) + fd(self={"abc" : {1 : 1}}):(, TypeError('object must be string',)) +! fd(self={"abc" : {u"\0" : 1}}):(, TypeError('expected bytes with no null',)) + fd(self={"abc" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using fd(self={"abc" : Mapping({%s : 1})}) + fd(self={"abc" : Mapping({1 : 1})}):(, TypeError('object must be string',)) +! fd(self={"abc" : Mapping({u"\0" : 1})}):(, TypeError('expected bytes with no null',)) + fd(self={"abc" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using fd(self={"abc" : %s}) +--- 942,958 ---- + <<< Finished + >>> Testing StringToChars using fd(self={%s : 1}) + fd(self={1 : 1}):(, TypeError('object must be string',)) +! fd(self={b"\0" : 1}):(, TypeError('expected bytes with no null',)) + fd(self={"\0" : 1}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using fd(self={"abc" : {%s : 1}}) + fd(self={"abc" : {1 : 1}}):(, TypeError('object must be string',)) +! fd(self={"abc" : {b"\0" : 1}}):(, TypeError('expected bytes with no null',)) + fd(self={"abc" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using fd(self={"abc" : Mapping({%s : 1})}) + fd(self={"abc" : Mapping({1 : 1})}):(, TypeError('object must be string',)) +! fd(self={"abc" : Mapping({b"\0" : 1})}):(, TypeError('expected bytes with no null',)) + fd(self={"abc" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using fd(self={"abc" : %s}) +*************** +*** 967,983 **** + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({%s : 1})) + fd(self=Mapping({1 : 1})):(, TypeError('object must be string',)) +! fd(self=Mapping({u"\0" : 1})):(, TypeError('expected bytes with no null',)) + fd(self=Mapping({"\0" : 1})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({"abc" : {%s : 1}})) + fd(self=Mapping({"abc" : {1 : 1}})):(, TypeError('object must be string',)) +! fd(self=Mapping({"abc" : {u"\0" : 1}})):(, TypeError('expected bytes with no null',)) + fd(self=Mapping({"abc" : {"\0" : 1}})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({"abc" : Mapping({%s : 1})})) + fd(self=Mapping({"abc" : Mapping({1 : 1})})):(, TypeError('object must be string',)) +! fd(self=Mapping({"abc" : Mapping({u"\0" : 1})})):(, TypeError('expected bytes with no null',)) + fd(self=Mapping({"abc" : Mapping({"\0" : 1})})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using fd(self=Mapping({"abc" : %s})) +--- 967,983 ---- + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({%s : 1})) + fd(self=Mapping({1 : 1})):(, TypeError('object must be string',)) +! fd(self=Mapping({b"\0" : 1})):(, TypeError('expected bytes with no null',)) + fd(self=Mapping({"\0" : 1})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({"abc" : {%s : 1}})) + fd(self=Mapping({"abc" : {1 : 1}})):(, TypeError('object must be string',)) +! fd(self=Mapping({"abc" : {b"\0" : 1}})):(, TypeError('expected bytes with no null',)) + fd(self=Mapping({"abc" : {"\0" : 1}})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({"abc" : Mapping({%s : 1})})) + fd(self=Mapping({"abc" : Mapping({1 : 1})})):(, TypeError('object must be string',)) +! fd(self=Mapping({"abc" : Mapping({b"\0" : 1})})):(, TypeError('expected bytes with no null',)) + fd(self=Mapping({"abc" : Mapping({"\0" : 1})})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using fd(self=Mapping({"abc" : %s})) +*************** +*** 1001,1007 **** + fd(self=FailingMappingKey()):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyMapping using fd(self=%s) +! fd(self=[]):(, AttributeError("'list' object has no attribute 'keys'",)) + <<< Finished + > TabPage + >> TabPageAttr +--- 1001,1007 ---- + fd(self=FailingMappingKey()):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyMapping using fd(self=%s) +! fd(self=[]):(, AttributeError('keys',)) + <<< Finished + > TabPage + >> TabPageAttr +*************** +*** 1014,1020 **** + vim.current.window.xxx:(, AttributeError("'vim.window' object has no attribute 'xxx'",)) + >> WindowSetattr + vim.current.window.buffer = 0:(, TypeError('readonly attribute',)) +! vim.current.window.cursor = (10000000000, 100000000):(, error('cursor position outside buffer',)) + vim.current.window.cursor = True:(, TypeError('argument must be 2-item sequence, not bool',)) + vim.current.window.height = "abc":(, TypeError('an integer is required',)) + vim.current.window.width = "abc":(, TypeError('an integer is required',)) +--- 1014,1020 ---- + vim.current.window.xxx:(, AttributeError("'vim.window' object has no attribute 'xxx'",)) + >> WindowSetattr + vim.current.window.buffer = 0:(, TypeError('readonly attribute',)) +! vim.current.window.cursor = (100000000, 100000000):(, error('cursor position outside buffer',)) + vim.current.window.cursor = True:(, TypeError('argument must be 2-item sequence, not bool',)) + vim.current.window.height = "abc":(, TypeError('an integer is required',)) + vim.current.window.width = "abc":(, TypeError('an integer is required',)) +*************** +*** 1035,1043 **** + vim.current.buffer.append(["\na", "bc"]):(, error('string cannot contain newlines',)) + vim.current.buffer.append("\nbc"):(, error('string cannot contain newlines',)) + >> RBItem +! vim.current.buffer[10000000000]:(, IndexError('line number out of range',)) + >> RBAsItem +! vim.current.buffer[10000000000] = "":(, IndexError('line number out of range',)) + >> BufferAttr + vim.current.buffer.xxx:(, AttributeError("'vim.buffer' object has no attribute 'xxx'",)) + >> BufferSetattr +--- 1035,1043 ---- + vim.current.buffer.append(["\na", "bc"]):(, error('string cannot contain newlines',)) + vim.current.buffer.append("\nbc"):(, error('string cannot contain newlines',)) + >> RBItem +! vim.current.buffer[100000000]:(, IndexError('line number out of range',)) + >> RBAsItem +! vim.current.buffer[100000000] = "":(, IndexError('line number out of range',)) + >> BufferAttr + vim.current.buffer.xxx:(, AttributeError("'vim.buffer' object has no attribute 'xxx'",)) + >> BufferSetattr +*** ../vim-7.3.1078/src/version.c 2013-05-30 22:43:57.000000000 +0200 +--- src/version.c 2013-05-31 18:41:58.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1079, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +29. Your phone bill comes to your doorstep in a box. + + /// 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 /// diff --git a/7.3.1080 b/7.3.1080 new file mode 100644 index 0000000..858a1d4 --- /dev/null +++ b/7.3.1080 @@ -0,0 +1,265 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1080 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1080 +Problem: Test 86 fails. +Solution: Comment out the parts that don't work. Make it pass on 32 bit + systems. +Files: src/testdir/test86.in, src/testdir/test86.ok + + +*** ../vim-7.3.1079/src/testdir/test86.in 2013-05-30 15:38:20.000000000 +0200 +--- src/testdir/test86.in 2013-05-31 18:59:05.000000000 +0200 +*************** +*** 8,15 **** + STARTTEST + :so small.vim + :set encoding=latin1 +- :" HACK: currently crashes, skip the test +- :e! test.ok | wq! test.out + :if !has('python') | e! test.ok | wq! test.out | endif + :lang C + :py import vim +--- 8,13 ---- +*************** +*** 915,921 **** + cb.append(">> OutputWriteLines") + ee('sys.stdout.writelines(None)') + ee('sys.stdout.writelines([1])') +! iter_test('sys.stdout.writelines(%s)') + cb.append("> VimCommand") + ee('vim.command(1)') + #! Not checked: vim->python exceptions translating: checked later +--- 913,919 ---- + cb.append(">> OutputWriteLines") + ee('sys.stdout.writelines(None)') + ee('sys.stdout.writelines([1])') +! #iter_test('sys.stdout.writelines(%s)') + cb.append("> VimCommand") + ee('vim.command(1)') + #! Not checked: vim->python exceptions translating: checked later +*************** +*** 955,961 **** + cb.append(">>> iter") + ee('d.update(FailingMapping())') + ee('d.update([FailingIterNext()])') +! iter_test('d.update(%s)') + convertfrompyobject_test('d.update(%s)') + stringtochars_test('d.update(((%s, 0),))') + convertfrompyobject_test('d.update((("a", %s),))') +--- 953,959 ---- + cb.append(">>> iter") + ee('d.update(FailingMapping())') + ee('d.update([FailingIterNext()])') +! #iter_test('d.update(%s)') + convertfrompyobject_test('d.update(%s)') + stringtochars_test('d.update(((%s, 0),))') + convertfrompyobject_test('d.update((("a", %s),))') +*************** +*** 967,973 **** + cb.append(">> ListConstructor") + ee('vim.List(1, 2)') + ee('vim.List(a=1)') +! iter_test('vim.List(%s)') + convertfrompyobject_test('vim.List([%s])') + cb.append(">> ListItem") + ee('l[1000]') +--- 965,971 ---- + cb.append(">> ListConstructor") + ee('vim.List(1, 2)') + ee('vim.List(a=1)') +! #iter_test('vim.List(%s)') + convertfrompyobject_test('vim.List([%s])') + cb.append(">> ListItem") + ee('l[1000]') +*************** +*** 976,985 **** + ee('l[1000] = 3') + cb.append(">> ListAssSlice") + ee('ll[1:100] = "abc"') +! iter_test('l[:] = %s') + convertfrompyobject_test('l[:] = [%s]') + cb.append(">> ListConcatInPlace") +! iter_test('l.extend(%s)') + convertfrompyobject_test('l.extend([%s])') + cb.append(">> ListSetattr") + ee('del l.locked') +--- 974,983 ---- + ee('l[1000] = 3') + cb.append(">> ListAssSlice") + ee('ll[1:100] = "abc"') +! #iter_test('l[:] = %s') + convertfrompyobject_test('l[:] = [%s]') + cb.append(">> ListConcatInPlace") +! #iter_test('l.extend(%s)') + convertfrompyobject_test('l.extend([%s])') + cb.append(">> ListSetattr") + ee('del l.locked') +*************** +*** 1004,1010 **** + ee('vim.current.window.xxx') + cb.append(">> WindowSetattr") + ee('vim.current.window.buffer = 0') +! ee('vim.current.window.cursor = (10000000000, 100000000)') + ee('vim.current.window.cursor = True') + ee('vim.current.window.height = "abc"') + ee('vim.current.window.width = "abc"') +--- 1002,1008 ---- + ee('vim.current.window.xxx') + cb.append(">> WindowSetattr") + ee('vim.current.window.buffer = 0') +! ee('vim.current.window.cursor = (100000000, 100000000)') + ee('vim.current.window.cursor = True') + ee('vim.current.window.height = "abc"') + ee('vim.current.window.width = "abc"') +*************** +*** 1025,1033 **** + ee('vim.current.buffer.append(["\\na", "bc"])') + ee('vim.current.buffer.append("\\nbc")') + cb.append(">> RBItem") +! ee('vim.current.buffer[10000000000]') + cb.append(">> RBAsItem") +! ee('vim.current.buffer[10000000000] = ""') + cb.append(">> BufferAttr") + ee('vim.current.buffer.xxx') + cb.append(">> BufferSetattr") +--- 1023,1031 ---- + ee('vim.current.buffer.append(["\\na", "bc"])') + ee('vim.current.buffer.append("\\nbc")') + cb.append(">> RBItem") +! ee('vim.current.buffer[100000000]') + cb.append(">> RBAsItem") +! ee('vim.current.buffer[100000000] = ""') + cb.append(">> BufferAttr") + ee('vim.current.buffer.xxx') + cb.append(">> BufferSetattr") +*** ../vim-7.3.1079/src/testdir/test86.ok 2013-05-30 13:37:23.000000000 +0200 +--- src/testdir/test86.ok 2013-05-31 18:59:34.000000000 +0200 +*************** +*** 439,448 **** + >> OutputWriteLines + sys.stdout.writelines(None):(, TypeError("'NoneType' object is not iterable",)) + sys.stdout.writelines([1]):(, TypeError('writelines() requires list of strings',)) +- >>> Testing *Iter* using sys.stdout.writelines(%s) +- sys.stdout.writelines(FailingIter()):(, NotImplementedError()) +- sys.stdout.writelines(FailingIterNext()):(, NotImplementedError()) +- <<< Finished + > VimCommand + vim.command(1):(, TypeError('must be string, not int',)) + > VimToPython +--- 439,444 ---- +*************** +*** 544,553 **** + >>> iter + d.update(FailingMapping()):(, NotImplementedError()) + d.update([FailingIterNext()]):(, NotImplementedError()) +- >>> Testing *Iter* using d.update(%s) +- d.update(FailingIter()):(, NotImplementedError()) +- d.update(FailingIterNext()):(, NotImplementedError()) +- <<< Finished + >>> Testing StringToChars using d.update({%s : 1}) + d.update({1 : 1}):(, TypeError('object must be string',)) + d.update({u"\0" : 1}):(, TypeError('expected string without null bytes',)) +--- 540,545 ---- +*************** +*** 681,690 **** + >> ListConstructor + vim.List(1, 2):(, TypeError('function takes at most 1 argument (2 given)',)) + vim.List(a=1):(, TypeError('list constructor does not accept keyword arguments',)) +- >>> Testing *Iter* using vim.List(%s) +- vim.List(FailingIter()):(, NotImplementedError()) +- vim.List(FailingIterNext()):(, NotImplementedError()) +- <<< Finished + >>> Testing StringToChars using vim.List([{%s : 1}]) + vim.List([{1 : 1}]):(, TypeError('object must be string',)) + vim.List([{u"\0" : 1}]):(, TypeError('expected string without null bytes',)) +--- 673,678 ---- +*************** +*** 752,761 **** + l[1000] = 3:(, IndexError('list index out of range',)) + >> ListAssSlice + ll[1:100] = "abc":(, error('list is locked',)) +- >>> Testing *Iter* using l[:] = %s +- l[:] = FailingIter():(, NotImplementedError()) +- l[:] = FailingIterNext():(, NotImplementedError()) +- <<< Finished + >>> Testing StringToChars using l[:] = [{%s : 1}] + l[:] = [{1 : 1}]:(, TypeError('object must be string',)) + l[:] = [{u"\0" : 1}]:(, TypeError('expected string without null bytes',)) +--- 740,745 ---- +*************** +*** 817,826 **** + l[:] = [FailingMappingKey()]:(, NotImplementedError()) + <<< Finished + >> ListConcatInPlace +- >>> Testing *Iter* using l.extend(%s) +- l.extend(FailingIter()):(, NotImplementedError()) +- l.extend(FailingIterNext()):(, NotImplementedError()) +- <<< Finished + >>> Testing StringToChars using l.extend([{%s : 1}]) + l.extend([{1 : 1}]):(, TypeError('object must be string',)) + l.extend([{u"\0" : 1}]):(, TypeError('expected string without null bytes',)) +--- 801,806 ---- +*************** +*** 1025,1031 **** + vim.current.window.xxx:(, AttributeError('xxx',)) + >> WindowSetattr + vim.current.window.buffer = 0:(, TypeError('readonly attribute',)) +! vim.current.window.cursor = (10000000000, 100000000):(, error('cursor position outside buffer',)) + vim.current.window.cursor = True:(, TypeError('argument must be 2-item sequence, not bool',)) + vim.current.window.height = "abc":(, TypeError('an integer is required',)) + vim.current.window.width = "abc":(, TypeError('an integer is required',)) +--- 1005,1011 ---- + vim.current.window.xxx:(, AttributeError('xxx',)) + >> WindowSetattr + vim.current.window.buffer = 0:(, TypeError('readonly attribute',)) +! vim.current.window.cursor = (100000000, 100000000):(, error('cursor position outside buffer',)) + vim.current.window.cursor = True:(, TypeError('argument must be 2-item sequence, not bool',)) + vim.current.window.height = "abc":(, TypeError('an integer is required',)) + vim.current.window.width = "abc":(, TypeError('an integer is required',)) +*************** +*** 1046,1054 **** + vim.current.buffer.append(["\na", "bc"]):(, error('string cannot contain newlines',)) + vim.current.buffer.append("\nbc"):(, error('string cannot contain newlines',)) + >> RBItem +! vim.current.buffer[10000000000]:(, IndexError('line number out of range',)) + >> RBAsItem +! vim.current.buffer[10000000000] = "":(, IndexError('line number out of range',)) + >> BufferAttr + vim.current.buffer.xxx:(, AttributeError('xxx',)) + >> BufferSetattr +--- 1026,1034 ---- + vim.current.buffer.append(["\na", "bc"]):(, error('string cannot contain newlines',)) + vim.current.buffer.append("\nbc"):(, error('string cannot contain newlines',)) + >> RBItem +! vim.current.buffer[100000000]:(, IndexError('line number out of range',)) + >> RBAsItem +! vim.current.buffer[100000000] = "":(, IndexError('line number out of range',)) + >> BufferAttr + vim.current.buffer.xxx:(, AttributeError('xxx',)) + >> BufferSetattr +*** ../vim-7.3.1079/src/version.c 2013-05-31 18:46:06.000000000 +0200 +--- src/version.c 2013-05-31 19:00:29.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1080, + /**/ + +-- +If you put 7 of the most talented OSS developers in a room for a week +and asked them to fix a bug in a spreadsheet program, in 1 week +you'd have 2 new mail readers and a text-based web browser. + + /// 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 /// diff --git a/7.3.1081 b/7.3.1081 new file mode 100644 index 0000000..1436295 --- /dev/null +++ b/7.3.1081 @@ -0,0 +1,73 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.10 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1081 +Problem: Compiler warnings on 64-bit Windows. +Solution: Change variable types. (Mike Williams) +Files: src/if_py_both.h, src/regexp_nfa.c + + +*** ../vim-7.3.1080/src/if_py_both.h 2013-05-30 22:06:28.000000000 +0200 +--- src/if_py_both.h 2013-05-31 20:39:37.000000000 +0200 +*************** +*** 1100,1106 **** + long_u ht_used; + hashtab_T *ht; + hashitem_T *hi; +! int todo; + } dictiterinfo_T; + + static PyObject * +--- 1100,1106 ---- + long_u ht_used; + hashtab_T *ht; + hashitem_T *hi; +! long_u todo; + } dictiterinfo_T; + + static PyObject * +*** ../vim-7.3.1080/src/regexp_nfa.c 2013-05-30 22:43:57.000000000 +0200 +--- src/regexp_nfa.c 2013-05-31 20:45:03.000000000 +0200 +*************** +*** 283,289 **** + static int + realloc_post_list() + { +! int nstate_max = post_end - post_start; + int new_max = nstate_max + 1000; + int *new_start; + int *old_start; +--- 283,289 ---- + static int + realloc_post_list() + { +! int nstate_max = (int)(post_end - post_start); + int new_max = nstate_max + 1000; + int *new_start; + int *old_start; +*** ../vim-7.3.1080/src/version.c 2013-05-31 19:01:13.000000000 +0200 +--- src/version.c 2013-05-31 20:40:19.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1081, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +32. You don't know what sex three of your closest friends are, because they + have neutral nicknames and you never bothered to ask. + normal GA + + /// 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 /// diff --git a/7.3.1082 b/7.3.1082 new file mode 100644 index 0000000..cd4da8b --- /dev/null +++ b/7.3.1082 @@ -0,0 +1,168 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1082 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1082 +Problem: New regexp engine: Problem with \@= matching. +Solution: Save and restore nfa_match. +Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok + + +*** ../vim-7.3.1081/src/regexp_nfa.c 2013-05-31 20:49:27.000000000 +0200 +--- src/regexp_nfa.c 2013-05-31 21:19:15.000000000 +0200 +*************** +*** 3332,3342 **** + int result; + int size = 0; + int flag = 0; +- int old_reglnum = -1; + int go_to_nextline = FALSE; + nfa_thread_T *t; +- char_u *old_reginput = NULL; +- char_u *old_regline = NULL; + nfa_list_T list[3]; + nfa_list_T *listtbl[2][2]; + nfa_list_T *ll; +--- 3332,3339 ---- +*************** +*** 3560,3574 **** + break; + + case NFA_START_INVISIBLE: +! /* Save global variables, and call nfa_regmatch() to check if +! * the current concat matches at this position. The concat +! * ends with the node NFA_END_INVISIBLE */ +! old_reginput = reginput; +! old_regline = regline; +! old_reglnum = reglnum; + if (listids == NULL) + { +! listids = (int *) lalloc(sizeof(int) * nstate, TRUE); + if (listids == NULL) + { + EMSG(_("E878: (NFA) Could not allocate memory for branch traversal!")); +--- 3557,3574 ---- + break; + + case NFA_START_INVISIBLE: +! { +! char_u *save_reginput = reginput; +! char_u *save_regline = regline; +! int save_reglnum = reglnum; +! int save_nfa_match = nfa_match; +! +! /* Call nfa_regmatch() to check if the current concat matches +! * at this position. The concat ends with the node +! * NFA_END_INVISIBLE */ + if (listids == NULL) + { +! listids = (int *)lalloc(sizeof(int) * nstate, TRUE); + if (listids == NULL) + { + EMSG(_("E878: (NFA) Could not allocate memory for branch traversal!")); +*************** +*** 3588,3594 **** + result = nfa_regmatch(t->state->out, submatch, m); + nfa_set_neg_listids(start); + nfa_restore_listids(start, listids); +! nfa_match = FALSE; + + #ifdef ENABLE_LOG + log_fd = fopen(NFA_REGEXP_RUN_LOG, "a"); +--- 3588,3599 ---- + result = nfa_regmatch(t->state->out, submatch, m); + nfa_set_neg_listids(start); + nfa_restore_listids(start, listids); +! +! /* restore position in input text */ +! reginput = save_reginput; +! regline = save_regline; +! reglnum = save_reglnum; +! nfa_match = save_nfa_match; + + #ifdef ENABLE_LOG + log_fd = fopen(NFA_REGEXP_RUN_LOG, "a"); +*************** +*** 3610,3619 **** + { + int j; + +- /* Restore position in input text */ +- reginput = old_reginput; +- regline = old_regline; +- reglnum = old_reglnum; + /* Copy submatch info from the recursive call */ + if (REG_MULTI) + for (j = 1; j < m->in_use; j++) +--- 3615,3620 ---- +*************** +*** 3635,3646 **** + addstate_here(thislist, t->state->out1->out, &t->sub, + &listidx); + } +- else +- { +- /* continue with next input char */ +- reginput = old_reginput; +- } + break; + + case NFA_BOL: + if (reginput == regline) +--- 3636,3643 ---- + addstate_here(thislist, t->state->out1->out, &t->sub, + &listidx); + } + break; ++ } + + case NFA_BOL: + if (reginput == regline) +*** ../vim-7.3.1081/src/testdir/test64.in 2013-05-30 22:43:57.000000000 +0200 +--- src/testdir/test64.in 2013-05-31 21:14:37.000000000 +0200 +*************** +*** 305,310 **** +--- 305,311 ---- + :call add(tl, [2, '\v(abc)@=..', 'xabcd', 'ab', 'abc']) + :call add(tl, [2, '\(.*John\)\@=.*Bob', 'here is John, and here is B']) + :call add(tl, [2, '\(John.*\)\@=.*Bob', 'John is Bobs friend', 'John is Bob', 'John is Bobs friend']) ++ :call add(tl, [2, '\<\S\+\())\)\@=', '$((i=i+1))', 'i=i+1', '))']) + :call add(tl, [2, '.*John\&.*Bob', 'here is John, and here is B']) + :call add(tl, [2, '.*John\&.*Bob', 'John is Bobs friend', 'John is Bob']) + :call add(tl, [2, '\v(test1)@=.*yep', 'this is a test1, yep it is', 'test1, yep', 'test1']) +*** ../vim-7.3.1081/src/testdir/test64.ok 2013-05-30 22:43:57.000000000 +0200 +--- src/testdir/test64.ok 2013-05-31 21:16:29.000000000 +0200 +*************** +*** 669,674 **** +--- 669,677 ---- + OK 0 - \(John.*\)\@=.*Bob + OK 1 - \(John.*\)\@=.*Bob + OK 2 - \(John.*\)\@=.*Bob ++ OK 0 - \<\S\+\())\)\@= ++ OK 1 - \<\S\+\())\)\@= ++ OK 2 - \<\S\+\())\)\@= + OK 0 - .*John\&.*Bob + OK 1 - .*John\&.*Bob + OK 2 - .*John\&.*Bob +*** ../vim-7.3.1081/src/version.c 2013-05-31 20:49:27.000000000 +0200 +--- src/version.c 2013-05-31 21:21:12.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1082, + /**/ + +-- +To define recursion, we must first define recursion. + + /// 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 /// diff --git a/7.3.1083 b/7.3.1083 new file mode 100644 index 0000000..c9022ce --- /dev/null +++ b/7.3.1083 @@ -0,0 +1,166 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1083 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1083 +Problem: New regexp engine: Does not support \%^ and \%$. +Solution: Support matching start and end of file. +Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok + + +*** ../vim-7.3.1082/src/regexp_nfa.c 2013-05-31 21:45:05.000000000 +0200 +--- src/regexp_nfa.c 2013-05-31 21:55:35.000000000 +0200 +*************** +*** 865,878 **** + * pattern -- regardless of whether or not it makes sense. */ + case '^': + EMIT(NFA_BOF); +- /* TODO: Not yet supported */ +- return FAIL; + break; + + case '$': + EMIT(NFA_EOF); +- /* TODO: Not yet supported */ +- return FAIL; + break; + + case '#': +--- 865,874 ---- +*************** +*** 1780,1785 **** +--- 1776,1783 ---- + case NFA_BOL: STRCPY(code, "NFA_BOL "); break; + case NFA_EOW: STRCPY(code, "NFA_EOW "); break; + case NFA_BOW: STRCPY(code, "NFA_BOW "); break; ++ case NFA_EOF: STRCPY(code, "NFA_EOF "); break; ++ case NFA_BOF: STRCPY(code, "NFA_BOF "); break; + case NFA_STAR: STRCPY(code, "NFA_STAR "); break; + case NFA_PLUS: STRCPY(code, "NFA_PLUS "); break; + case NFA_NOT: STRCPY(code, "NFA_NOT "); break; +*************** +*** 3705,3710 **** +--- 3703,3719 ---- + break; + } + ++ case NFA_BOF: ++ if (reglnum == 0 && reginput == regline ++ && (!REG_MULTI || reg_firstlnum == 1)) ++ addstate_here(thislist, t->state->out, &t->sub, &listidx); ++ break; ++ ++ case NFA_EOF: ++ if (reglnum == reg_maxline && curc == NUL) ++ addstate_here(thislist, t->state->out, &t->sub, &listidx); ++ break; ++ + #ifdef FEAT_MBYTE + case NFA_COMPOSING: + { +*** ../vim-7.3.1082/src/testdir/test64.in 2013-05-31 21:45:05.000000000 +0200 +--- src/testdir/test64.in 2013-05-31 22:10:12.000000000 +0200 +*************** +*** 267,272 **** +--- 267,281 ---- + :call add(tl, [2, '\_f', " \na ", "\n"]) + :call add(tl, [2, '\_f\+', " \na ", "\na"]) + :" ++ :"""" Test start/end of line, start/end of file ++ :call add(tl, [2, '^a.', "a_\nb ", "a_"]) ++ :call add(tl, [2, '^a.', "b a \na_"]) ++ :call add(tl, [2, '.a$', " a\n "]) ++ :call add(tl, [2, '.a$', " a b\n_a", "_a"]) ++ :call add(tl, [2, '\%^a.', "a a\na", "a "]) ++ :call add(tl, [2, '\%^a', " a \na "]) ++ :call add(tl, [2, '.a\%$', " a\n "]) ++ :call add(tl, [2, '.a\%$', " a\n_a", "_a"]) + :" + :"""" Test recognition of some character classes + :call add(tl, [2, '[0-9]', '8', '8']) +*************** +*** 466,471 **** +--- 475,489 ---- + :call Postest() + :put + :" ++ :" start and end of buffer ++ /\%^ ++ yeGop:" ++ 50%/\%^.. ++ yeGopA END:" ++ 50%/\%$ ++ "ayb20gg/..\%$ ++ "bybGo"apo"bp:" ++ :" + :/\%#=1^Results/,$wq! test.out + ENDTEST + +*** ../vim-7.3.1082/src/testdir/test64.ok 2013-05-31 21:45:05.000000000 +0200 +--- src/testdir/test64.ok 2013-05-31 22:10:47.000000000 +0200 +*************** +*** 585,590 **** +--- 585,614 ---- + OK 0 - \_f\+ + OK 1 - \_f\+ + OK 2 - \_f\+ ++ OK 0 - ^a. ++ OK 1 - ^a. ++ OK 2 - ^a. ++ OK 0 - ^a. ++ OK 1 - ^a. ++ OK 2 - ^a. ++ OK 0 - .a$ ++ OK 1 - .a$ ++ OK 2 - .a$ ++ OK 0 - .a$ ++ OK 1 - .a$ ++ OK 2 - .a$ ++ OK 0 - \%^a. ++ OK 1 - \%^a. ++ OK 2 - \%^a. ++ OK 0 - \%^a ++ OK 1 - \%^a ++ OK 2 - \%^a ++ OK 0 - .a\%$ ++ OK 1 - .a\%$ ++ OK 2 - .a\%$ ++ OK 0 - .a\%$ ++ OK 1 - .a\%$ ++ OK 2 - .a\%$ + OK 0 - [0-9] + OK 1 - [0-9] + OK 2 - [0-9] +*************** +*** 818,820 **** +--- 842,848 ---- + ab!babababababfoo + ba!ab##abab?bafoo + **!*****_ ++ Test ++ Test END ++ EN ++ E +*** ../vim-7.3.1082/src/version.c 2013-05-31 21:45:05.000000000 +0200 +--- src/version.c 2013-05-31 21:57:03.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1083, + /**/ + +-- +Have you heard about the new Beowulf cluster? It's so fast, it executes +an infinite loop in 6 seconds. + + /// 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 /// diff --git a/7.3.1084 b/7.3.1084 new file mode 100644 index 0000000..7ea8b36 --- /dev/null +++ b/7.3.1084 @@ -0,0 +1,280 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1084 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1084 +Problem: New regexp engine: only accepts up to \{,10}. +Solution: Remove upper limit. Remove dead code with NFA_PLUS. +Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok + + +*** ../vim-7.3.1083/src/regexp_nfa.c 2013-05-31 22:14:48.000000000 +0200 +--- src/regexp_nfa.c 2013-05-31 23:09:16.000000000 +0200 +*************** +*** 29,39 **** + # define NFA_REGEXP_DEBUG_LOG "nfa_regexp_debug.log" + #endif + +- /* Upper limit allowed for {m,n} repetitions handled by NFA */ +- #define NFA_BRACES_MAXLIMIT 10 +- /* For allocating space for the postfix representation */ +- #define NFA_POSTFIX_MULTIPLIER (NFA_BRACES_MAXLIMIT + 2)*2 +- + enum + { + NFA_SPLIT = -1024, +--- 29,34 ---- +*************** +*** 44,50 **** + NFA_CONCAT, + NFA_OR, + NFA_STAR, +- NFA_PLUS, + NFA_QUEST, + NFA_QUEST_NONGREEDY, /* Non-greedy version of \? */ + NFA_NOT, /* used for [^ab] negated char ranges */ +--- 39,44 ---- +*************** +*** 253,259 **** + nstate = 0; + istate = 0; + /* A reasonable estimation for maximum size */ +! nstate_max = (int)(STRLEN(expr) + 1) * NFA_POSTFIX_MULTIPLIER; + + /* Some items blow up in size, such as [A-z]. Add more space for that. + * When it is still not enough realloc_post_list() will be used. */ +--- 247,253 ---- + nstate = 0; + istate = 0; + /* A reasonable estimation for maximum size */ +! nstate_max = (int)(STRLEN(expr) + 1) * 25; + + /* Some items blow up in size, such as [A-z]. Add more space for that. + * When it is still not enough realloc_post_list() will be used. */ +*************** +*** 1365,1374 **** + * string. + * The submatch will the empty string. + * +! * In order to be consistent with the old engine, we disable +! * NFA_PLUS, and replace + with * + */ +- /* EMIT(NFA_PLUS); */ + regnpar = old_regnpar; + regparse = old_regparse; + curchr = -1; +--- 1359,1367 ---- + * string. + * The submatch will the empty string. + * +! * In order to be consistent with the old engine, we replace +! * + with * + */ + regnpar = old_regnpar; + regparse = old_regparse; + curchr = -1; +*************** +*** 1443,1454 **** + break; + } + +! if (maxval > NFA_BRACES_MAXLIMIT) +! { +! /* This would yield a huge automaton and use too much memory. +! * Revert to old engine */ + return FAIL; +- } + + /* Special case: x{0} or x{-0} */ + if (maxval == 0) +--- 1436,1444 ---- + break; + } + +! /* TODO: \{-} doesn't work yet */ +! if (maxval == MAX_LIMIT && !greedy) + return FAIL; + + /* Special case: x{0} or x{-0} */ + if (maxval == 0) +*************** +*** 1478,1486 **** + return FAIL; + /* after "minval" times, atoms are optional */ + if (i + 1 > minval) +! EMIT(quest); + if (old_post_pos != my_post_start) + EMIT(NFA_CONCAT); + } + + /* Go to just after the repeated atom and the \{} */ +--- 1468,1483 ---- + return FAIL; + /* after "minval" times, atoms are optional */ + if (i + 1 > minval) +! { +! if (maxval == MAX_LIMIT) +! EMIT(NFA_STAR); +! else +! EMIT(quest); +! } + if (old_post_pos != my_post_start) + EMIT(NFA_CONCAT); ++ if (i + 1 > minval && maxval == MAX_LIMIT) ++ break; + } + + /* Go to just after the repeated atom and the \{} */ +*************** +*** 1779,1785 **** + case NFA_EOF: STRCPY(code, "NFA_EOF "); break; + case NFA_BOF: STRCPY(code, "NFA_BOF "); break; + case NFA_STAR: STRCPY(code, "NFA_STAR "); break; +- case NFA_PLUS: STRCPY(code, "NFA_PLUS "); break; + case NFA_NOT: STRCPY(code, "NFA_NOT "); break; + case NFA_SKIP_CHAR: STRCPY(code, "NFA_SKIP_CHAR"); break; + case NFA_OR: STRCPY(code, "NFA_OR"); break; +--- 1776,1781 ---- +*************** +*** 2343,2363 **** + PUSH(frag(s, append(e.out, list1(&s->out)))); + break; + +- case NFA_PLUS: +- /* One or more */ +- if (nfa_calc_size == TRUE) +- { +- nstate++; +- break; +- } +- e = POP(); +- s = new_state(NFA_SPLIT, e.start, NULL); +- if (s == NULL) +- goto theend; +- patch(e.out, s); +- PUSH(frag(e.start, list1(&s->out1))); +- break; +- + case NFA_SKIP_CHAR: + /* Symbol of 0-length, Used in a repetition + * with max/min count of 0 */ +--- 2339,2344 ---- +*** ../vim-7.3.1083/src/testdir/test64.in 2013-05-31 22:14:48.000000000 +0200 +--- src/testdir/test64.in 2013-05-31 22:55:52.000000000 +0200 +*************** +*** 182,188 **** + :call add(tl, [2, 'a\{0,}', 'oij sdigfusnf', '']) + :call add(tl, [2, 'a\{0,}', 'aaaaa aa', 'aaaaa']) + :call add(tl, [2, 'a\{2,}', 'sdfiougjdsafg']) +! :call add(tl, [0, 'a\{2,}', 'aaaaasfoij ', 'aaaaa']) + :call add(tl, [2, 'a\{,0}', 'oidfguih iuhi hiu aaaa', '']) + :call add(tl, [2, 'a\{,5}', 'abcd', 'a']) + :call add(tl, [2, 'a\{,5}', 'aaaaaaaaaa', 'aaaaa']) +--- 182,190 ---- + :call add(tl, [2, 'a\{0,}', 'oij sdigfusnf', '']) + :call add(tl, [2, 'a\{0,}', 'aaaaa aa', 'aaaaa']) + :call add(tl, [2, 'a\{2,}', 'sdfiougjdsafg']) +! :call add(tl, [2, 'a\{2,}', 'aaaaasfoij ', 'aaaaa']) +! :call add(tl, [2, 'a\{5,}', 'xxaaaaxxx ']) +! :call add(tl, [2, 'a\{5,}', 'xxaaaaaxxx ', 'aaaaa']) + :call add(tl, [2, 'a\{,0}', 'oidfguih iuhi hiu aaaa', '']) + :call add(tl, [2, 'a\{,5}', 'abcd', 'a']) + :call add(tl, [2, 'a\{,5}', 'aaaaaaaaaa', 'aaaaa']) +*************** +*** 225,231 **** +--- 227,235 ---- + :" + :" Test greedy-ness and lazy-ness + :call add(tl, [2, 'a\{-2,7}','aaaaaaaaaaaaa', 'aa']) ++ :call add(tl, [2, 'a\{-2,7}x','aaaaaaaaax', 'aaaaaaax']) + :call add(tl, [2, 'a\{2,7}','aaaaaaaaaaaaaaaaaaaa', 'aaaaaaa']) ++ :call add(tl, [2, 'a\{2,7}x','aaaaaaaaax', 'aaaaaaax']) + :call add(tl, [2, '\vx(.{-,8})yz(.*)','xayxayzxayzxayz','xayxayzxayzxayz','ayxa','xayzxayz']) + :call add(tl, [2, '\vx(.*)yz(.*)','xayxayzxayzxayz','xayxayzxayzxayz', 'ayxayzxayzxa','']) + :call add(tl, [2, '\v(a{1,2}){-2,3}','aaaaaaa','aaaa','aa']) +*************** +*** 366,372 **** + :call add(tl, [2, '\_[^a]\+', "asfi\n9888", "sfi\n9888"]) + :" + :"""" Requiring lots of states. +! :call add(tl, [0, '[0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}-\)\{3}[0-9a-zA-Z]\{12}', " 12345678-1234-1234-1234-123456789012 ", "12345678-1234-1234-1234-123456789012", "1234-"]) + :" + :" + :"""" Run the tests +--- 370,376 ---- + :call add(tl, [2, '\_[^a]\+', "asfi\n9888", "sfi\n9888"]) + :" + :"""" Requiring lots of states. +! :call add(tl, [2, '[0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}-\)\{3}[0-9a-zA-Z]\{12}', " 12345678-1234-1234-1234-123456789012 ", "12345678-1234-1234-1234-123456789012", "1234-"]) + :" + :" + :"""" Run the tests +*** ../vim-7.3.1083/src/testdir/test64.ok 2013-05-31 22:14:48.000000000 +0200 +--- src/testdir/test64.ok 2013-05-31 23:02:02.000000000 +0200 +*************** +*** 389,394 **** +--- 389,401 ---- + OK 2 - a\{2,} + OK 0 - a\{2,} + OK 1 - a\{2,} ++ OK 2 - a\{2,} ++ OK 0 - a\{5,} ++ OK 1 - a\{5,} ++ OK 2 - a\{5,} ++ OK 0 - a\{5,} ++ OK 1 - a\{5,} ++ OK 2 - a\{5,} + OK 0 - a\{,0} + OK 1 - a\{,0} + OK 2 - a\{,0} +*************** +*** 486,494 **** +--- 493,507 ---- + OK 0 - a\{-2,7} + OK 1 - a\{-2,7} + OK 2 - a\{-2,7} ++ OK 0 - a\{-2,7}x ++ OK 1 - a\{-2,7}x ++ OK 2 - a\{-2,7}x + OK 0 - a\{2,7} + OK 1 - a\{2,7} + OK 2 - a\{2,7} ++ OK 0 - a\{2,7}x ++ OK 1 - a\{2,7}x ++ OK 2 - a\{2,7}x + OK 0 - \vx(.{-,8})yz(.*) + OK 1 - \vx(.{-,8})yz(.*) + OK 2 - \vx(.{-,8})yz(.*) +*************** +*** 803,808 **** +--- 816,822 ---- + OK 2 - \_[^a]\+ + OK 0 - [0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}-\)\{3}[0-9a-zA-Z]\{12} + OK 1 - [0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}-\)\{3}[0-9a-zA-Z]\{12} ++ OK 2 - [0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}-\)\{3}[0-9a-zA-Z]\{12} + 192.168.0.1 + 192.168.0.1 + 192.168.0.1 +*** ../vim-7.3.1083/src/version.c 2013-05-31 22:14:48.000000000 +0200 +--- src/version.c 2013-05-31 23:10:36.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1084, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +34. You laugh at people with a 10 Mbit connection. + + /// 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 /// diff --git a/7.3.1085 b/7.3.1085 new file mode 100644 index 0000000..93952de --- /dev/null +++ b/7.3.1085 @@ -0,0 +1,285 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1085 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1085 +Problem: New regexp engine: Non-greedy multi doesn't work. +Solution: Implement \{-}. +Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok + + +*** ../vim-7.3.1084/src/regexp_nfa.c 2013-05-31 23:17:56.000000000 +0200 +--- src/regexp_nfa.c 2013-06-01 12:22:17.000000000 +0200 +*************** +*** 38,46 **** + + NFA_CONCAT, + NFA_OR, +! NFA_STAR, +! NFA_QUEST, +! NFA_QUEST_NONGREEDY, /* Non-greedy version of \? */ + NFA_NOT, /* used for [^ab] negated char ranges */ + + NFA_BOL, /* ^ Begin line */ +--- 38,47 ---- + + NFA_CONCAT, + NFA_OR, +! NFA_STAR, /* greedy * */ +! NFA_STAR_NONGREEDY, /* non-greedy * */ +! NFA_QUEST, /* greedy \? */ +! NFA_QUEST_NONGREEDY, /* non-greedy \? */ + NFA_NOT, /* used for [^ab] negated char ranges */ + + NFA_BOL, /* ^ Begin line */ +*************** +*** 1430,1445 **** + } + /* {0,inf}, {0,} and {} are equivalent to + * * */ +! if (minval == 0 && maxval == MAX_LIMIT && greedy) + { +! EMIT(NFA_STAR); + break; + } + +- /* TODO: \{-} doesn't work yet */ +- if (maxval == MAX_LIMIT && !greedy) +- return FAIL; +- + /* Special case: x{0} or x{-0} */ + if (maxval == 0) + { +--- 1431,1447 ---- + } + /* {0,inf}, {0,} and {} are equivalent to + * * */ +! if (minval == 0 && maxval == MAX_LIMIT) + { +! if (greedy) +! /* \{}, \{0,} */ +! EMIT(NFA_STAR); +! else +! /* \{-}, \{-0,} */ +! EMIT(NFA_STAR_NONGREEDY); + break; + } + + /* Special case: x{0} or x{-0} */ + if (maxval == 0) + { +*************** +*** 1470,1476 **** + if (i + 1 > minval) + { + if (maxval == MAX_LIMIT) +! EMIT(NFA_STAR); + else + EMIT(quest); + } +--- 1472,1483 ---- + if (i + 1 > minval) + { + if (maxval == MAX_LIMIT) +! { +! if (greedy) +! EMIT(NFA_STAR); +! else +! EMIT(NFA_STAR_NONGREEDY); +! } + else + EMIT(quest); + } +*************** +*** 1776,1786 **** + case NFA_EOF: STRCPY(code, "NFA_EOF "); break; + case NFA_BOF: STRCPY(code, "NFA_BOF "); break; + case NFA_STAR: STRCPY(code, "NFA_STAR "); break; + case NFA_NOT: STRCPY(code, "NFA_NOT "); break; + case NFA_SKIP_CHAR: STRCPY(code, "NFA_SKIP_CHAR"); break; + case NFA_OR: STRCPY(code, "NFA_OR"); break; +- case NFA_QUEST: STRCPY(code, "NFA_QUEST"); break; +- case NFA_QUEST_NONGREEDY: STRCPY(code, "NFA_QUEST_NON_GREEDY"); break; + case NFA_END_NEG_RANGE: STRCPY(code, "NFA_END_NEG_RANGE"); break; + case NFA_CLASS_ALNUM: STRCPY(code, "NFA_CLASS_ALNUM"); break; + case NFA_CLASS_ALPHA: STRCPY(code, "NFA_CLASS_ALPHA"); break; +--- 1783,1794 ---- + case NFA_EOF: STRCPY(code, "NFA_EOF "); break; + case NFA_BOF: STRCPY(code, "NFA_BOF "); break; + case NFA_STAR: STRCPY(code, "NFA_STAR "); break; ++ case NFA_STAR_NONGREEDY: STRCPY(code, "NFA_STAR_NONGREEDY "); break; ++ case NFA_QUEST: STRCPY(code, "NFA_QUEST"); break; ++ case NFA_QUEST_NONGREEDY: STRCPY(code, "NFA_QUEST_NON_GREEDY"); break; + case NFA_NOT: STRCPY(code, "NFA_NOT "); break; + case NFA_SKIP_CHAR: STRCPY(code, "NFA_SKIP_CHAR"); break; + case NFA_OR: STRCPY(code, "NFA_OR"); break; + case NFA_END_NEG_RANGE: STRCPY(code, "NFA_END_NEG_RANGE"); break; + case NFA_CLASS_ALNUM: STRCPY(code, "NFA_CLASS_ALNUM"); break; + case NFA_CLASS_ALPHA: STRCPY(code, "NFA_CLASS_ALPHA"); break; +*************** +*** 2297,2303 **** + break; + + case NFA_STAR: +! /* Zero or more */ + if (nfa_calc_size == TRUE) + { + nstate++; +--- 2305,2311 ---- + break; + + case NFA_STAR: +! /* Zero or more, prefer more */ + if (nfa_calc_size == TRUE) + { + nstate++; +*************** +*** 2311,2316 **** +--- 2319,2339 ---- + PUSH(frag(s, list1(&s->out1))); + break; + ++ case NFA_STAR_NONGREEDY: ++ /* Zero or more, prefer zero */ ++ if (nfa_calc_size == TRUE) ++ { ++ nstate++; ++ break; ++ } ++ e = POP(); ++ s = new_state(NFA_SPLIT, NULL, e.start); ++ if (s == NULL) ++ goto theend; ++ patch(e.out, s); ++ PUSH(frag(s, list1(&s->out))); ++ break; ++ + case NFA_QUEST: + /* one or zero atoms=> greedy match */ + if (nfa_calc_size == TRUE) +*** ../vim-7.3.1084/src/testdir/test64.in 2013-05-31 23:17:56.000000000 +0200 +--- src/testdir/test64.in 2013-06-01 12:29:19.000000000 +0200 +*************** +*** 23,30 **** + :call add(tl, [2, 'ab', 'aab', 'ab']) + :call add(tl, [2, 'b', 'abcdef', 'b']) + :call add(tl, [2, 'bc*', 'abccccdef', 'bcccc']) +! :call add(tl, [0, 'bc\{-}', 'abccccdef', 'b']) +! :call add(tl, [0, 'bc\{-}\(d\)', 'abccccdef', 'bccccd', 'd']) + :call add(tl, [2, 'bc*', 'abbdef', 'b']) + :call add(tl, [2, 'c*', 'ccc', 'ccc']) + :call add(tl, [2, 'bc*', 'abdef', 'b']) +--- 23,30 ---- + :call add(tl, [2, 'ab', 'aab', 'ab']) + :call add(tl, [2, 'b', 'abcdef', 'b']) + :call add(tl, [2, 'bc*', 'abccccdef', 'bcccc']) +! :call add(tl, [2, 'bc\{-}', 'abccccdef', 'b']) +! :call add(tl, [2, 'bc\{-}\(d\)', 'abccccdef', 'bccccd', 'd']) + :call add(tl, [2, 'bc*', 'abbdef', 'b']) + :call add(tl, [2, 'c*', 'ccc', 'ccc']) + :call add(tl, [2, 'bc*', 'abdef', 'b']) +*************** +*** 201,216 **** + :call add(tl, [2, 'a\{-0}', 'asoiuj', '']) + :call add(tl, [2, 'a\{-2}', 'aaaa', 'aa']) + :call add(tl, [2, 'a\{-2}', 'abcdefghijklmnopqrestuvwxyz1234567890']) +! :call add(tl, [0, 'a\{-0,}', 'oij sdigfusnf', '']) +! :call add(tl, [0, 'a\{-0,}', 'aaaaa aa', '']) + :call add(tl, [2, 'a\{-2,}', 'sdfiougjdsafg']) +! :call add(tl, [0, 'a\{-2,}', 'aaaaasfoij ', 'aa']) + :call add(tl, [2, 'a\{-,0}', 'oidfguih iuhi hiu aaaa', '']) + :call add(tl, [2, 'a\{-,5}', 'abcd', '']) + :call add(tl, [2, 'a\{-,5}', 'aaaaaaaaaa', '']) + :" anti-greedy version of 'a*' +! :call add(tl, [0, 'a\{-}', 'bbbcddiuhfcd', '']) +! :call add(tl, [0, 'a\{-}', 'aaaaioudfh coisf jda', '']) + :" + :" Test groups of characters and submatches + :call add(tl, [2, '\(abc\)*', 'abcabcabc', 'abcabcabc', 'abc']) +--- 201,216 ---- + :call add(tl, [2, 'a\{-0}', 'asoiuj', '']) + :call add(tl, [2, 'a\{-2}', 'aaaa', 'aa']) + :call add(tl, [2, 'a\{-2}', 'abcdefghijklmnopqrestuvwxyz1234567890']) +! :call add(tl, [2, 'a\{-0,}', 'oij sdigfusnf', '']) +! :call add(tl, [2, 'a\{-0,}', 'aaaaa aa', '']) + :call add(tl, [2, 'a\{-2,}', 'sdfiougjdsafg']) +! :call add(tl, [2, 'a\{-2,}', 'aaaaasfoij ', 'aa']) + :call add(tl, [2, 'a\{-,0}', 'oidfguih iuhi hiu aaaa', '']) + :call add(tl, [2, 'a\{-,5}', 'abcd', '']) + :call add(tl, [2, 'a\{-,5}', 'aaaaaaaaaa', '']) + :" anti-greedy version of 'a*' +! :call add(tl, [2, 'a\{-}', 'bbbcddiuhfcd', '']) +! :call add(tl, [2, 'a\{-}', 'aaaaioudfh coisf jda', '']) + :" + :" Test groups of characters and submatches + :call add(tl, [2, '\(abc\)*', 'abcabcabc', 'abcabcabc', 'abc']) +*** ../vim-7.3.1084/src/testdir/test64.ok 2013-05-31 23:17:56.000000000 +0200 +--- src/testdir/test64.ok 2013-06-01 12:29:38.000000000 +0200 +*************** +*** 10,17 **** +--- 10,19 ---- + OK 2 - bc* + OK 0 - bc\{-} + OK 1 - bc\{-} ++ OK 2 - bc\{-} + OK 0 - bc\{-}\(d\) + OK 1 - bc\{-}\(d\) ++ OK 2 - bc\{-}\(d\) + OK 0 - bc* + OK 1 - bc* + OK 2 - bc* +*************** +*** 437,449 **** +--- 439,454 ---- + OK 2 - a\{-2} + OK 0 - a\{-0,} + OK 1 - a\{-0,} ++ OK 2 - a\{-0,} + OK 0 - a\{-0,} + OK 1 - a\{-0,} ++ OK 2 - a\{-0,} + OK 0 - a\{-2,} + OK 1 - a\{-2,} + OK 2 - a\{-2,} + OK 0 - a\{-2,} + OK 1 - a\{-2,} ++ OK 2 - a\{-2,} + OK 0 - a\{-,0} + OK 1 - a\{-,0} + OK 2 - a\{-,0} +*************** +*** 455,462 **** +--- 460,469 ---- + OK 2 - a\{-,5} + OK 0 - a\{-} + OK 1 - a\{-} ++ OK 2 - a\{-} + OK 0 - a\{-} + OK 1 - a\{-} ++ OK 2 - a\{-} + OK 0 - \(abc\)* + OK 1 - \(abc\)* + OK 2 - \(abc\)* +*** ../vim-7.3.1084/src/version.c 2013-05-31 23:17:56.000000000 +0200 +--- src/version.c 2013-06-01 12:39:01.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1085, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +35. Your husband tells you he's had the beard for 2 months. + + /// 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 /// diff --git a/7.3.1086 b/7.3.1086 new file mode 100644 index 0000000..779977a --- /dev/null +++ b/7.3.1086 @@ -0,0 +1,144 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1086 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1086 +Problem: Old regexp engine accepts illegal range, new one doesn't. +Solution: Also accept the illegal range with the new engine. +Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok + + +*** ../vim-7.3.1085/src/regexp_nfa.c 2013-06-01 12:40:14.000000000 +0200 +--- src/regexp_nfa.c 2013-06-01 13:16:34.000000000 +0200 +*************** +*** 1089,1096 **** + * while loop. */ + } + } +! /* Try a range like 'a-x' or '\t-z' */ +! if (*regparse == '-') + { + emit_range = TRUE; + startc = oldstartc; +--- 1089,1097 ---- + * while loop. */ + } + } +! /* Try a range like 'a-x' or '\t-z'. Also allows '-' as a +! * start character. */ +! if (*regparse == '-' && oldstartc != -1) + { + emit_range = TRUE; + startc = oldstartc; +*************** +*** 1140,1155 **** + + /* Normal printable char */ + if (startc == -1) +! #ifdef FEAT_MBYTE +! startc = (*mb_ptr2char)(regparse); +! #else +! startc = *regparse; +! #endif + + /* Previous char was '-', so this char is end of range. */ + if (emit_range) + { +! endc = startc; startc = oldstartc; + if (startc > endc) + EMSG_RET_FAIL(_(e_invrange)); + #ifdef FEAT_MBYTE +--- 1141,1153 ---- + + /* Normal printable char */ + if (startc == -1) +! startc = PTR2CHAR(regparse); + + /* Previous char was '-', so this char is end of range. */ + if (emit_range) + { +! endc = startc; +! startc = oldstartc; + if (startc > endc) + EMSG_RET_FAIL(_(e_invrange)); + #ifdef FEAT_MBYTE +*************** +*** 1166,1172 **** + TRY_NEG(); + EMIT_GLUE(); + } +- emit_range = FALSE; + } + else + #endif +--- 1164,1169 ---- +*************** +*** 1190,1197 **** + TRY_NEG(); + EMIT_GLUE(); + } +- emit_range = FALSE; + } + } + else + { +--- 1187,1195 ---- + TRY_NEG(); + EMIT_GLUE(); + } + } ++ emit_range = FALSE; ++ startc = -1; + } + else + { +*** ../vim-7.3.1085/src/testdir/test64.in 2013-06-01 12:40:14.000000000 +0200 +--- src/testdir/test64.in 2013-06-01 13:14:51.000000000 +0200 +*************** +*** 270,275 **** +--- 270,276 ---- + :call add(tl, [2, '\_[0-9]\+', "asfi\n9888u", "\n9888"]) + :call add(tl, [2, '\_f', " \na ", "\n"]) + :call add(tl, [2, '\_f\+', " \na ", "\na"]) ++ :call add(tl, [2, '[0-9A-Za-z-_.]\+', " @0_a.A-{ ", "0_a.A-"]) + :" + :"""" Test start/end of line, start/end of file + :call add(tl, [2, '^a.', "a_\nb ", "a_"]) +*** ../vim-7.3.1085/src/testdir/test64.ok 2013-06-01 12:40:14.000000000 +0200 +--- src/testdir/test64.ok 2013-06-01 13:22:58.000000000 +0200 +*************** +*** 605,610 **** +--- 605,613 ---- + OK 0 - \_f\+ + OK 1 - \_f\+ + OK 2 - \_f\+ ++ OK 0 - [0-9A-Za-z-_.]\+ ++ OK 1 - [0-9A-Za-z-_.]\+ ++ OK 2 - [0-9A-Za-z-_.]\+ + OK 0 - ^a. + OK 1 - ^a. + OK 2 - ^a. +*** ../vim-7.3.1085/src/version.c 2013-06-01 12:40:14.000000000 +0200 +--- src/version.c 2013-06-01 13:17:56.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1086, + /**/ + +-- +Micro$oft: where do you want to go today? + Linux: where do you want to go tomorrow? + FreeBSD: are you guys coming, or what? + + /// 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 /// diff --git a/7.3.1087 b/7.3.1087 new file mode 100644 index 0000000..d751f34 --- /dev/null +++ b/7.3.1087 @@ -0,0 +1,255 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1087 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1087 +Problem: A leading star is not seen as a normal char when \{} follows. +Solution: Save and restore the parse state properly. +Files: src/regexp.c, src/regexp_nfa.c, src/testdir/test64.in, + src/testdir/test64.ok + + +*** ../vim-7.3.1086/src/regexp.c 2013-05-29 18:45:07.000000000 +0200 +--- src/regexp.c 2013-06-01 14:33:26.000000000 +0200 +*************** +*** 665,674 **** +--- 665,689 ---- + #define REG_ZPAREN 2 /* \z(\) */ + #define REG_NPAREN 3 /* \%(\) */ + ++ typedef struct ++ { ++ char_u *regparse; ++ int prevchr_len; ++ int curchr; ++ int prevchr; ++ int prevprevchr; ++ int nextchr; ++ int at_start; ++ int prev_at_start; ++ int regnpar; ++ } parse_state_T; ++ + /* + * Forward declarations for vim_regcomp()'s friends. + */ + static void initchr __ARGS((char_u *)); ++ static void save_parse_state __ARGS((parse_state_T *ps)); ++ static void restore_parse_state __ARGS((parse_state_T *ps)); + static int getchr __ARGS((void)); + static void skipchr_keepstart __ARGS((void)); + static int peekchr __ARGS((void)); +*************** +*** 2951,2956 **** +--- 2966,3009 ---- + } + + /* ++ * Save the current parse state, so that it can be restored and parsing ++ * starts in the same state again. ++ */ ++ static void ++ save_parse_state(ps) ++ parse_state_T *ps; ++ { ++ ps->regparse = regparse; ++ ps->prevchr_len = prevchr_len; ++ ps->curchr = curchr; ++ ps->prevchr = prevchr; ++ ps->prevprevchr = prevprevchr; ++ ps->nextchr = nextchr; ++ ps->at_start = at_start; ++ ps->prev_at_start = prev_at_start; ++ ps->regnpar = regnpar; ++ } ++ ++ /* ++ * Restore a previously saved parse state. ++ */ ++ static void ++ restore_parse_state(ps) ++ parse_state_T *ps; ++ { ++ regparse = ps->regparse; ++ prevchr_len = ps->prevchr_len; ++ curchr = ps->curchr; ++ prevchr = ps->prevchr; ++ prevprevchr = ps->prevprevchr; ++ nextchr = ps->nextchr; ++ at_start = ps->at_start; ++ prev_at_start = ps->prev_at_start; ++ regnpar = ps->regnpar; ++ } ++ ++ ++ /* + * Get the next character without advancing. + */ + static int +*** ../vim-7.3.1086/src/regexp_nfa.c 2013-06-01 13:24:19.000000000 +0200 +--- src/regexp_nfa.c 2013-06-01 14:30:27.000000000 +0200 +*************** +*** 1318,1336 **** + int ret; + long minval, maxval; + int greedy = TRUE; /* Braces are prefixed with '-' ? */ +! char_u *old_regparse, *new_regparse; + int c2; + int old_post_pos; + int my_post_start; +- int old_regnpar; + int quest; + +! /* Save the current position in the regexp, so that we can use it if +! * {m,n} is next. */ +! old_regparse = regparse; +! /* Save current number of open parenthesis, so we can use it if +! * {m,n} is next */ +! old_regnpar = regnpar; + /* store current pos in the postfix form, for \{m,n} involving 0s */ + my_post_start = (int)(post_ptr - post_start); + +--- 1318,1334 ---- + int ret; + long minval, maxval; + int greedy = TRUE; /* Braces are prefixed with '-' ? */ +! parse_state_T old_state; +! parse_state_T new_state; + int c2; + int old_post_pos; + int my_post_start; + int quest; + +! /* Save the current parse state, so that we can use it if {m,n} is +! * next. */ +! save_parse_state(&old_state); +! + /* store current pos in the postfix form, for \{m,n} involving 0s */ + my_post_start = (int)(post_ptr - post_start); + +*************** +*** 1361,1368 **** + * In order to be consistent with the old engine, we replace + * + with * + */ +! regnpar = old_regnpar; +! regparse = old_regparse; + curchr = -1; + if (nfa_regatom() == FAIL) + return FAIL; +--- 1359,1365 ---- + * In order to be consistent with the old engine, we replace + * + with * + */ +! restore_parse_state(&old_state); + curchr = -1; + if (nfa_regatom() == FAIL) + return FAIL; +*************** +*** 1452,1468 **** + + /* Ignore previous call to nfa_regatom() */ + post_ptr = post_start + my_post_start; +! /* Save pos after the repeated atom and the \{} */ +! new_regparse = regparse; + + quest = (greedy == TRUE? NFA_QUEST : NFA_QUEST_NONGREEDY); + for (i = 0; i < maxval; i++) + { + /* Goto beginning of the repeated atom */ +! regparse = old_regparse; +! curchr = -1; +! /* Restore count of parenthesis */ +! regnpar = old_regnpar; + old_post_pos = (int)(post_ptr - post_start); + if (nfa_regatom() == FAIL) + return FAIL; +--- 1449,1462 ---- + + /* Ignore previous call to nfa_regatom() */ + post_ptr = post_start + my_post_start; +! /* Save parse state after the repeated atom and the \{} */ +! save_parse_state(&new_state); + + quest = (greedy == TRUE? NFA_QUEST : NFA_QUEST_NONGREEDY); + for (i = 0; i < maxval; i++) + { + /* Goto beginning of the repeated atom */ +! restore_parse_state(&old_state); + old_post_pos = (int)(post_ptr - post_start); + if (nfa_regatom() == FAIL) + return FAIL; +*************** +*** 1486,1492 **** + } + + /* Go to just after the repeated atom and the \{} */ +! regparse = new_regparse; + curchr = -1; + + break; +--- 1480,1486 ---- + } + + /* Go to just after the repeated atom and the \{} */ +! restore_parse_state(&new_state); + curchr = -1; + + break; +*** ../vim-7.3.1086/src/testdir/test64.in 2013-06-01 13:24:19.000000000 +0200 +--- src/testdir/test64.in 2013-06-01 14:36:15.000000000 +0200 +*************** +*** 188,193 **** +--- 188,197 ---- + :call add(tl, [2, 'a\{,0}', 'oidfguih iuhi hiu aaaa', '']) + :call add(tl, [2, 'a\{,5}', 'abcd', 'a']) + :call add(tl, [2, 'a\{,5}', 'aaaaaaaaaa', 'aaaaa']) ++ :" leading star as normal char when \{} follows ++ :call add(tl, [2, '^*\{4,}$', '***']) ++ :call add(tl, [2, '^*\{4,}$', '****', '****']) ++ :call add(tl, [2, '^*\{4,}$', '*****', '*****']) + :" same thing as 'a*' + :call add(tl, [2, 'a\{}', 'bbbcddiuhfcd', '']) + :call add(tl, [2, 'a\{}', 'aaaaioudfh coisf jda', 'aaaa']) +*** ../vim-7.3.1086/src/testdir/test64.ok 2013-06-01 13:24:19.000000000 +0200 +--- src/testdir/test64.ok 2013-06-01 14:36:39.000000000 +0200 +*************** +*** 407,412 **** +--- 407,421 ---- + OK 0 - a\{,5} + OK 1 - a\{,5} + OK 2 - a\{,5} ++ OK 0 - ^*\{4,}$ ++ OK 1 - ^*\{4,}$ ++ OK 2 - ^*\{4,}$ ++ OK 0 - ^*\{4,}$ ++ OK 1 - ^*\{4,}$ ++ OK 2 - ^*\{4,}$ ++ OK 0 - ^*\{4,}$ ++ OK 1 - ^*\{4,}$ ++ OK 2 - ^*\{4,}$ + OK 0 - a\{} + OK 1 - a\{} + OK 2 - a\{} +*** ../vim-7.3.1086/src/version.c 2013-06-01 13:24:19.000000000 +0200 +--- src/version.c 2013-06-01 14:37:37.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1087, + /**/ + +-- +Change is inevitable, except from a vending machine. + + /// 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 /// diff --git a/7.3.1088 b/7.3.1088 new file mode 100644 index 0000000..108cc44 --- /dev/null +++ b/7.3.1088 @@ -0,0 +1,626 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1088 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1088 +Problem: New regexp engine: \@<= and \@rs_scan); + if (REG_MULTI) + { +! if (rp->rs_un.regsave.rs_u.pos.col == 0) + { + if (rp->rs_un.regsave.rs_u.pos.lnum + < behind_pos.rs_u.pos.lnum +--- 5576,5589 ---- + limit = OPERAND_MIN(rp->rs_scan); + if (REG_MULTI) + { +! if (limit > 0 +! && ((rp->rs_un.regsave.rs_u.pos.lnum +! < behind_pos.rs_u.pos.lnum +! ? (colnr_T)STRLEN(regline) +! : behind_pos.rs_u.pos.col) +! - rp->rs_un.regsave.rs_u.pos.col >= limit)) +! no = FAIL; +! else if (rp->rs_un.regsave.rs_u.pos.col == 0) + { + if (rp->rs_un.regsave.rs_u.pos.lnum + < behind_pos.rs_u.pos.lnum +*************** +*** 5601,5613 **** + else + #endif + --rp->rs_un.regsave.rs_u.pos.col; +- if (limit > 0 +- && ((rp->rs_un.regsave.rs_u.pos.lnum +- < behind_pos.rs_u.pos.lnum +- ? (colnr_T)STRLEN(regline) +- : behind_pos.rs_u.pos.col) +- - rp->rs_un.regsave.rs_u.pos.col > limit)) +- no = FAIL; + } + } + else +--- 5608,5613 ---- +*** ../vim-7.3.1087/src/regexp_nfa.c 2013-06-01 14:42:51.000000000 +0200 +--- src/regexp_nfa.c 2013-06-01 19:42:22.000000000 +0200 +*************** +*** 56,61 **** +--- 56,62 ---- + NFA_NOPEN, /* Start of subexpression marked with \%( */ + NFA_NCLOSE, /* End of subexpr. marked with \%( ... \) */ + NFA_START_INVISIBLE, ++ NFA_START_INVISIBLE_BEFORE, + NFA_END_INVISIBLE, + NFA_COMPOSING, /* Next nodes in NFA are part of the + composing multibyte char */ +*************** +*** 1369,1402 **** + break; + + case Magic('@'): + op = no_Magic(getchr()); + switch(op) + { + case '=': +! EMIT(NFA_PREV_ATOM_NO_WIDTH); + break; + case '!': +! EMIT(NFA_PREV_ATOM_NO_WIDTH_NEG); + break; +- case '0': +- case '1': +- case '2': +- case '3': +- case '4': +- case '5': +- case '6': +- case '7': +- case '8': +- case '9': + case '<': + case '>': +! /* Not supported yet */ +! return FAIL; +! default: +! syntax_error = TRUE; +! EMSGN(_("E869: (NFA) Unknown operator '\\@%c'"), op); + return FAIL; + } + break; + + case Magic('?'): +--- 1370,1412 ---- + break; + + case Magic('@'): ++ c2 = getdecchrs(); + op = no_Magic(getchr()); ++ i = 0; + switch(op) + { + case '=': +! /* \@= */ +! i = NFA_PREV_ATOM_NO_WIDTH; + break; + case '!': +! /* \@! */ +! i = NFA_PREV_ATOM_NO_WIDTH_NEG; + break; + case '<': ++ op = no_Magic(getchr()); ++ if (op == '=') ++ /* \@<= */ ++ i = NFA_PREV_ATOM_JUST_BEFORE; ++ else if (op == '!') ++ /* \@': +! /* \@> Not supported yet */ +! /* i = NFA_PREV_ATOM_LIKE_PATTERN; */ + return FAIL; + } ++ if (i == 0) ++ { ++ syntax_error = TRUE; ++ EMSGN(_("E869: (NFA) Unknown operator '\\@%c'"), op); ++ return FAIL; ++ } ++ EMIT(i); ++ if (i == NFA_PREV_ATOM_JUST_BEFORE ++ || i == NFA_PREV_ATOM_JUST_BEFORE_NEG) ++ EMIT(c2); + break; + + case Magic('?'): +*************** +*** 1734,1742 **** +--- 1744,1758 ---- + STRCPY(code, "NFA_PREV_ATOM_NO_WIDTH"); break; + case NFA_PREV_ATOM_NO_WIDTH_NEG: + STRCPY(code, "NFA_PREV_ATOM_NO_WIDTH_NEG"); break; ++ case NFA_PREV_ATOM_JUST_BEFORE: ++ STRCPY(code, "NFA_PREV_ATOM_JUST_BEFORE"); break; ++ case NFA_PREV_ATOM_JUST_BEFORE_NEG: ++ STRCPY(code, "NFA_PREV_ATOM_JUST_BEFORE_NEG"); break; + case NFA_NOPEN: STRCPY(code, "NFA_NOPEN"); break; + case NFA_NCLOSE: STRCPY(code, "NFA_NCLOSE"); break; + case NFA_START_INVISIBLE: STRCPY(code, "NFA_START_INVISIBLE"); break; ++ case NFA_START_INVISIBLE_BEFORE: ++ STRCPY(code, "NFA_START_INVISIBLE_BEFORE"); break; + case NFA_END_INVISIBLE: STRCPY(code, "NFA_END_INVISIBLE"); break; + + case NFA_COMPOSING: STRCPY(code, "NFA_COMPOSING"); break; +*************** +*** 2237,2243 **** + if (nfa_calc_size == FALSE) + { + /* Allocate space for the stack. Max states on the stack : nstate */ +! stack = (Frag_T *) lalloc((nstate + 1) * sizeof(Frag_T), TRUE); + stackp = stack; + stack_end = stack + (nstate + 1); + } +--- 2253,2259 ---- + if (nfa_calc_size == FALSE) + { + /* Allocate space for the stack. Max states on the stack : nstate */ +! stack = (Frag_T *)lalloc((nstate + 1) * sizeof(Frag_T), TRUE); + stackp = stack; + stack_end = stack + (nstate + 1); + } +*************** +*** 2370,2377 **** +--- 2386,2397 ---- + + case NFA_PREV_ATOM_NO_WIDTH: + case NFA_PREV_ATOM_NO_WIDTH_NEG: ++ case NFA_PREV_ATOM_JUST_BEFORE: ++ case NFA_PREV_ATOM_JUST_BEFORE_NEG: + /* The \@= operator: match the preceding atom with zero width. + * The \@! operator: no match for the preceding atom. ++ * The \@<= operator: match for the preceding atom. ++ * The \@negated = TRUE; + s1->negated = TRUE; + } + + PUSH(frag(s, list1(&s1->out))); + break; +--- 2409,2426 ---- + s = new_state(NFA_START_INVISIBLE, e.start, s1); + if (s == NULL) + goto theend; +! if (*p == NFA_PREV_ATOM_NO_WIDTH_NEG +! || *p == NFA_PREV_ATOM_JUST_BEFORE_NEG) + { + s->negated = TRUE; + s1->negated = TRUE; + } ++ if (*p == NFA_PREV_ATOM_JUST_BEFORE ++ || *p == NFA_PREV_ATOM_JUST_BEFORE_NEG) ++ { ++ s->val = *++p; /* get the count */ ++ ++s->c; /* NFA_START_INVISIBLE -> NFA_START_INVISIBLE_BEFORE */ ++ } + + PUSH(frag(s, list1(&s1->out))); + break; +*************** +*** 3307,3327 **** + return val == pos; + } + +! static int nfa_regmatch __ARGS((nfa_state_T *start, regsub_T *submatch, regsub_T *m)); + + /* + * Main matching routine. + * + * Run NFA to determine whether it matches reginput. + * + * Return TRUE if there is a match, FALSE otherwise. + * Note: Caller must ensure that: start != NULL. + */ + static int +! nfa_regmatch(start, submatch, m) + nfa_state_T *start; + regsub_T *submatch; + regsub_T *m; + { + int result; + int size = 0; +--- 3334,3357 ---- + return val == pos; + } + +! static int nfa_regmatch __ARGS((nfa_state_T *start, regsub_T *submatch, regsub_T *m, save_se_T *endp)); + + /* + * Main matching routine. + * + * Run NFA to determine whether it matches reginput. + * ++ * When "endp" is not NULL it is a required end-of-match position. ++ * + * Return TRUE if there is a match, FALSE otherwise. + * Note: Caller must ensure that: start != NULL. + */ + static int +! nfa_regmatch(start, submatch, m, endp) + nfa_state_T *start; + regsub_T *submatch; + regsub_T *m; ++ save_se_T *endp; + { + int result; + int size = 0; +*************** +*** 3532,3547 **** + } + + case NFA_END_INVISIBLE: +! /* This is only encountered after a NFA_START_INVISIBLE node. +! * They surround a zero-width group, used with "\@=" and "\&". + * If we got here, it means that the current "invisible" group + * finished successfully, so return control to the parent + * nfa_regmatch(). Submatches are stored in *m, and used in + * the parent call. */ + if (start->c == NFA_MOPEN + 0) + addstate_here(thislist, t->state->out, &t->sub, &listidx); + else + { + /* do not set submatches for \@! */ + if (!t->state->negated) + /* TODO: only copy positions in use. */ +--- 3562,3603 ---- + } + + case NFA_END_INVISIBLE: +! /* This is only encountered after a NFA_START_INVISIBLE or +! * NFA_START_INVISIBLE_BEFORE node. +! * They surround a zero-width group, used with "\@=", "\&", +! * "\@!", "\@<=" and "\@c == NFA_MOPEN + 0) ++ /* TODO: do we ever get here? */ + addstate_here(thislist, t->state->out, &t->sub, &listidx); + else + { ++ #ifdef ENABLE_LOG ++ if (endp != NULL) ++ { ++ if (REG_MULTI) ++ fprintf(log_fd, "Current lnum: %d, endp lnum: %d; current col: %d, endp col: %d\n", ++ (int)reglnum, ++ (int)endp->se_u.pos.lnum, ++ (int)(reginput - regline), ++ endp->se_u.pos.col); ++ else ++ fprintf(log_fd, "Current col: %d, endp col: %d\n", ++ (int)(reginput - regline), ++ (int)(endp->se_u.ptr - reginput)); ++ } ++ #endif ++ /* It's only a match if it ends at "endp" */ ++ if (endp != NULL && (REG_MULTI ++ ? (reglnum != endp->se_u.pos.lnum ++ || (int)(reginput - regline) ++ != endp->se_u.pos.col) ++ : reginput != endp->se_u.ptr)) ++ break; ++ + /* do not set submatches for \@! */ + if (!t->state->negated) + /* TODO: only copy positions in use. */ +*************** +*** 3551,3561 **** + break; + + case NFA_START_INVISIBLE: + { +! char_u *save_reginput = reginput; +! char_u *save_regline = regline; +! int save_reglnum = reglnum; +! int save_nfa_match = nfa_match; + + /* Call nfa_regmatch() to check if the current concat matches + * at this position. The concat ends with the node +--- 3607,3676 ---- + break; + + case NFA_START_INVISIBLE: ++ case NFA_START_INVISIBLE_BEFORE: + { +! char_u *save_reginput = reginput; +! char_u *save_regline = regline; +! int save_reglnum = reglnum; +! int save_nfa_match = nfa_match; +! save_se_T endpos; +! save_se_T *endposp = NULL; +! +! if (t->state->c == NFA_START_INVISIBLE_BEFORE) +! { +! /* The recursive match must end at the current position. */ +! endposp = &endpos; +! if (REG_MULTI) +! { +! endpos.se_u.pos.col = (int)(reginput - regline); +! endpos.se_u.pos.lnum = reglnum; +! } +! else +! endpos.se_u.ptr = reginput; +! +! /* Go back the specified number of bytes, or as far as the +! * start of the previous line, to try matching "\@<=" or +! * not matching "\@state->val <= 0) +! { +! if (REG_MULTI) +! { +! regline = reg_getline(--reglnum); +! if (regline == NULL) +! /* can't go before the first line */ +! regline = reg_getline(++reglnum); +! } +! reginput = regline; +! } +! else +! { +! if (REG_MULTI +! && (int)(reginput - regline) < t->state->val) +! { +! /* Not enough bytes in this line, go to end of +! * previous line. */ +! regline = reg_getline(--reglnum); +! if (regline == NULL) +! { +! /* can't go before the first line */ +! regline = reg_getline(++reglnum); +! reginput = regline; +! } +! else +! reginput = regline + STRLEN(regline); +! } +! if ((int)(reginput - regline) >= t->state->val) +! { +! reginput -= t->state->val; +! #ifdef FEAT_MBYTE +! if (has_mbyte) +! reginput -= mb_head_off(regline, reginput); +! #endif +! } +! else +! reginput = regline; +! } +! } + + /* Call nfa_regmatch() to check if the current concat matches + * at this position. The concat ends with the node +*************** +*** 3579,3585 **** + * recursion. */ + nfa_save_listids(start, listids); + nfa_set_null_listids(start); +! result = nfa_regmatch(t->state->out, submatch, m); + nfa_set_neg_listids(start); + nfa_restore_listids(start, listids); + +--- 3694,3700 ---- + * recursion. */ + nfa_save_listids(start, listids); + nfa_set_null_listids(start); +! result = nfa_regmatch(t->state->out, submatch, m, endposp); + nfa_set_neg_listids(start); + nfa_restore_listids(start, listids); + +*************** +*** 4120,4130 **** + * matters! + * Do not add the start state in recursive calls of nfa_regmatch(), + * because recursive calls should only start in the first position. + * Also don't start a match past the first line. */ +! if (nfa_match == FALSE && start->c == NFA_MOPEN + 0 +! && reglnum == 0 && clen != 0 +! && (ireg_maxcol == 0 +! || (colnr_T)(reginput - regline) < ireg_maxcol)) + { + #ifdef ENABLE_LOG + fprintf(log_fd, "(---) STARTSTATE\n"); +--- 4235,4255 ---- + * matters! + * Do not add the start state in recursive calls of nfa_regmatch(), + * because recursive calls should only start in the first position. ++ * Unless "endp" is not NULL, then we match the end position. + * Also don't start a match past the first line. */ +! if (nfa_match == FALSE +! && ((start->c == NFA_MOPEN + 0 +! && reglnum == 0 +! && clen != 0 +! && (ireg_maxcol == 0 +! || (colnr_T)(reginput - regline) < ireg_maxcol)) +! || (endp != NULL +! && (REG_MULTI +! ? (reglnum < endp->se_u.pos.lnum +! || (reglnum == endp->se_u.pos.lnum +! && (int)(reginput - regline) +! < endp->se_u.pos.col)) +! : reginput < endp->se_u.ptr)))) + { + #ifdef ENABLE_LOG + fprintf(log_fd, "(---) STARTSTATE\n"); +*************** +*** 4148,4154 **** + * finish. */ + if (clen != 0) + reginput += clen; +! else if (go_to_nextline) + reg_nextline(); + else + break; +--- 4273,4280 ---- + * finish. */ + if (clen != 0) + reginput += clen; +! else if (go_to_nextline || (endp != NULL && REG_MULTI +! && reglnum < endp->se_u.pos.lnum)) + reg_nextline(); + else + break; +*************** +*** 4225,4231 **** + sub.in_use = 0; + m.in_use = 0; + +! if (nfa_regmatch(start, &sub, &m) == FALSE) + return 0; + + cleanup_subexpr(); +--- 4351,4357 ---- + sub.in_use = 0; + m.in_use = 0; + +! if (nfa_regmatch(start, &sub, &m, NULL) == FALSE) + return 0; + + cleanup_subexpr(); +*** ../vim-7.3.1087/src/testdir/test64.in 2013-06-01 14:42:51.000000000 +0200 +--- src/testdir/test64.in 2013-06-01 18:45:09.000000000 +0200 +*************** +*** 363,374 **** + :call add(tl, [2, '\(a\)\(b\)\(c\)\(dd\)\(e\)\(f\)\(g\)\(h\)\(i\)\1\2\3\4\5\6\7\8\9', 'xabcddefghiabcddefghix', 'abcddefghiabcddefghi', 'a', 'b', 'c', 'dd', 'e', 'f', 'g', 'h', 'i']) + :" + :"""" Look-behind with limit +! :call add(tl, [0, '<\@<=span.', 'xxspanxxAc 7 + ghi + +! xxxstart3 + -0- + ffo + bob +--- 853,859 ---- + Ac 7 + ghi + +! xxstart3 + -0- + ffo + bob +*** ../vim-7.3.1087/src/version.c 2013-06-01 14:42:51.000000000 +0200 +--- src/version.c 2013-06-01 18:37:11.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1088, + /**/ + +-- +Seen it all, done it all, can't remember most of it. + + /// 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 /// diff --git a/7.3.1089 b/7.3.1089 new file mode 100644 index 0000000..6b8a4b6 --- /dev/null +++ b/7.3.1089 @@ -0,0 +1,155 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1089 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1089 +Problem: Tests 86 and 87 fail on MS-Windows. (Ken Takata) +Solution: Fix platform-specific stuff. (ZyX) +Files: src/testdir/test86.in, src/testdir/test86.ok, + src/testdir/test87.in, src/testdir/test87.ok + + +*** ../vim-7.3.1088/src/testdir/test86.in 2013-05-31 19:01:13.000000000 +0200 +--- src/testdir/test86.in 2013-06-01 20:27:14.000000000 +0200 +*************** +*** 435,440 **** +--- 435,441 ---- + :py bopts1=vim.buffers[vim.bindeval("g:bufs")[2]].options + :py bopts2=vim.buffers[vim.bindeval("g:bufs")[1]].options + :py bopts3=vim.buffers[vim.bindeval("g:bufs")[0]].options ++ :set path=.,..,, + :let lst=[] + :let lst+=[['paste', 1, 0, 1, 2, 1, 1, 0 ]] + :let lst+=[['previewheight', 5, 1, 6, 'a', 0, 1, 0 ]] +*************** +*** 530,542 **** + b[0:0]=['baz'] + vim.command('call append("$", getbufline(%i, 1, "$"))' % b.number) + # Test assigning to name property + old_name = cb.name + cb.name = 'foo' +! cb.append(cb.name[-11:]) + b.name = 'bar' +! cb.append(b.name[-11:]) + cb.name = old_name +! cb.append(cb.name[-17:]) + # Test CheckBuffer + for _b in vim.buffers: + if _b is not cb: +--- 531,544 ---- + b[0:0]=['baz'] + vim.command('call append("$", getbufline(%i, 1, "$"))' % b.number) + # Test assigning to name property ++ import os + old_name = cb.name + cb.name = 'foo' +! cb.append(cb.name[-11:].replace(os.path.sep, '/')) + b.name = 'bar' +! cb.append(b.name[-11:].replace(os.path.sep, '/')) + cb.name = old_name +! cb.append(cb.name[-17:].replace(os.path.sep, '/')) + # Test CheckBuffer + for _b in vim.buffers: + if _b is not cb: +*** ../vim-7.3.1088/src/testdir/test86.ok 2013-05-31 19:01:13.000000000 +0200 +--- src/testdir/test86.ok 2013-06-01 20:27:14.000000000 +0200 +*************** +*** 310,316 **** + W: 1:0 2:1 3:0 4:1 + B: 1:0 2:1 3:0 4:1 + >>> path +! p/gopts1: '.,/usr/include,,' + inv: 0! TypeError + p/wopts1! KeyError + inv: 0! KeyError +--- 310,316 ---- + W: 1:0 2:1 3:0 4:1 + B: 1:0 2:1 3:0 4:1 + >>> path +! p/gopts1: '.,..,,' + inv: 0! TypeError + p/wopts1! KeyError + inv: 0! KeyError +*** ../vim-7.3.1088/src/testdir/test87.in 2013-05-31 18:46:06.000000000 +0200 +--- src/testdir/test87.in 2013-06-01 20:27:14.000000000 +0200 +*************** +*** 404,409 **** +--- 404,410 ---- + :py3 bopts1=vim.buffers[vim.bindeval("g:bufs")[2]].options + :py3 bopts2=vim.buffers[vim.bindeval("g:bufs")[1]].options + :py3 bopts3=vim.buffers[vim.bindeval("g:bufs")[0]].options ++ :set path=.,..,, + :let lst=[] + :let lst+=[['paste', 1, 0, 1, 2, 1, 1, 0 ]] + :let lst+=[['previewheight', 5, 1, 6, 'a', 0, 1, 0 ]] +*************** +*** 499,511 **** + b[0:0]=['baz'] + vim.command('call append("$", getbufline(%i, 1, "$"))' % b.number) + # Test assigning to name property + old_name = cb.name + cb.name = 'foo' +! cb.append(cb.name[-11:]) + b.name = 'bar' +! cb.append(b.name[-11:]) + cb.name = old_name +! cb.append(cb.name[-17:]) + # Test CheckBuffer + for _b in vim.buffers: + if _b is not cb: +--- 500,513 ---- + b[0:0]=['baz'] + vim.command('call append("$", getbufline(%i, 1, "$"))' % b.number) + # Test assigning to name property ++ import os + old_name = cb.name + cb.name = 'foo' +! cb.append(cb.name[-11:].replace(os.path.sep, '/')) + b.name = 'bar' +! cb.append(b.name[-11:].replace(os.path.sep, '/')) + cb.name = old_name +! cb.append(cb.name[-17:].replace(os.path.sep, '/')) + # Test CheckBuffer + for _b in vim.buffers: + if _b is not cb: +*** ../vim-7.3.1088/src/testdir/test87.ok 2013-05-31 18:46:06.000000000 +0200 +--- src/testdir/test87.ok 2013-06-01 20:27:14.000000000 +0200 +*************** +*** 299,305 **** + W: 1:0 2:1 3:0 4:1 + B: 1:0 2:1 3:0 4:1 + >>> path +! p/gopts1: b'.,/usr/include,,' + inv: 0! TypeError + p/wopts1! KeyError + inv: 0! KeyError +--- 299,305 ---- + W: 1:0 2:1 3:0 4:1 + B: 1:0 2:1 3:0 4:1 + >>> path +! p/gopts1: b'.,..,,' + inv: 0! TypeError + p/wopts1! KeyError + inv: 0! KeyError +*** ../vim-7.3.1088/src/version.c 2013-06-01 19:54:39.000000000 +0200 +--- src/version.c 2013-06-01 20:28:22.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1089, + /**/ + +-- +I wonder how much deeper the ocean would be without sponges. + + /// 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 /// diff --git a/7.3.1090 b/7.3.1090 new file mode 100644 index 0000000..1278fae --- /dev/null +++ b/7.3.1090 @@ -0,0 +1,1893 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.10 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1090 +Problem: New regexp engine does not support \z1 .. \z9 and \z(. +Solution: Implement the syntax submatches. +Files: src/regexp.h, src/regexp_nfa.c + + +*** ../vim-7.3.1089/src/regexp.h 2013-05-30 17:05:34.000000000 +0200 +--- src/regexp.h 2013-06-01 22:18:07.000000000 +0200 +*************** +*** 55,61 **** +--- 55,63 ---- + char_u reganch; + char_u *regmust; + int regmlen; ++ #ifdef FEAT_SYN_HL + char_u reghasz; ++ #endif + char_u program[1]; /* actually longer.. */ + } bt_regprog_T; + +*************** +*** 88,93 **** +--- 90,98 ---- + nfa_state_T *start; + int has_zend; /* pattern contains \ze */ + int has_backref; /* pattern contains \1 .. \9 */ ++ #ifdef FEAT_SYN_HL ++ int reghasz; ++ #endif + int nsubexp; /* number of () */ + int nstate; + nfa_state_T state[0]; /* actually longer.. */ +*** ../vim-7.3.1089/src/regexp_nfa.c 2013-06-01 19:54:39.000000000 +0200 +--- src/regexp_nfa.c 2013-06-01 22:54:08.000000000 +0200 +*************** +*** 78,90 **** + NFA_BACKREF7, /* \7 */ + NFA_BACKREF8, /* \8 */ + NFA_BACKREF9, /* \9 */ + NFA_SKIP, /* Skip characters */ + + NFA_MOPEN, +! NFA_MCLOSE = NFA_MOPEN + NSUBEXP, + + /* NFA_FIRST_NL */ +! NFA_ANY = NFA_MCLOSE + NSUBEXP, /* Match any one character. */ + NFA_ANYOF, /* Match any character in this string. */ + NFA_ANYBUT, /* Match any character not in this string. */ + NFA_IDENT, /* Match identifier char */ +--- 78,144 ---- + NFA_BACKREF7, /* \7 */ + NFA_BACKREF8, /* \8 */ + NFA_BACKREF9, /* \9 */ ++ #ifdef FEAT_SYN_HL ++ NFA_ZREF1, /* \z1 */ ++ NFA_ZREF2, /* \z2 */ ++ NFA_ZREF3, /* \z3 */ ++ NFA_ZREF4, /* \z4 */ ++ NFA_ZREF5, /* \z5 */ ++ NFA_ZREF6, /* \z6 */ ++ NFA_ZREF7, /* \z7 */ ++ NFA_ZREF8, /* \z8 */ ++ NFA_ZREF9, /* \z9 */ ++ #endif + NFA_SKIP, /* Skip characters */ + + NFA_MOPEN, +! NFA_MOPEN1, +! NFA_MOPEN2, +! NFA_MOPEN3, +! NFA_MOPEN4, +! NFA_MOPEN5, +! NFA_MOPEN6, +! NFA_MOPEN7, +! NFA_MOPEN8, +! NFA_MOPEN9, +! +! NFA_MCLOSE, +! NFA_MCLOSE1, +! NFA_MCLOSE2, +! NFA_MCLOSE3, +! NFA_MCLOSE4, +! NFA_MCLOSE5, +! NFA_MCLOSE6, +! NFA_MCLOSE7, +! NFA_MCLOSE8, +! NFA_MCLOSE9, +! +! #ifdef FEAT_SYN_HL +! NFA_ZOPEN, +! NFA_ZOPEN1, +! NFA_ZOPEN2, +! NFA_ZOPEN3, +! NFA_ZOPEN4, +! NFA_ZOPEN5, +! NFA_ZOPEN6, +! NFA_ZOPEN7, +! NFA_ZOPEN8, +! NFA_ZOPEN9, +! +! NFA_ZCLOSE, +! NFA_ZCLOSE1, +! NFA_ZCLOSE2, +! NFA_ZCLOSE3, +! NFA_ZCLOSE4, +! NFA_ZCLOSE5, +! NFA_ZCLOSE6, +! NFA_ZCLOSE7, +! NFA_ZCLOSE8, +! NFA_ZCLOSE9, +! #endif + + /* NFA_FIRST_NL */ +! NFA_ANY, /* Match any one character. */ + NFA_ANYOF, /* Match any character in this string. */ + NFA_ANYBUT, /* Match any character not in this string. */ + NFA_IDENT, /* Match identifier char */ +*************** +*** 221,227 **** + static void nfa_save_listids __ARGS((nfa_state_T *start, int *list)); + static void nfa_restore_listids __ARGS((nfa_state_T *start, int *list)); + static int nfa_re_num_cmp __ARGS((long_u val, int op, long_u pos)); +! static long nfa_regtry __ARGS((nfa_state_T *start, colnr_T col)); + static long nfa_regexec_both __ARGS((char_u *line, colnr_T col)); + static regprog_T *nfa_regcomp __ARGS((char_u *expr, int re_flags)); + static int nfa_regexec __ARGS((regmatch_T *rmp, char_u *line, colnr_T col)); +--- 275,281 ---- + static void nfa_save_listids __ARGS((nfa_state_T *start, int *list)); + static void nfa_restore_listids __ARGS((nfa_state_T *start, int *list)); + static int nfa_re_num_cmp __ARGS((long_u val, int op, long_u pos)); +! static long nfa_regtry __ARGS((nfa_regprog_T *prog, colnr_T col)); + static long nfa_regexec_both __ARGS((char_u *line, colnr_T col)); + static regprog_T *nfa_regcomp __ARGS((char_u *expr, int re_flags)); + static int nfa_regexec __ARGS((regmatch_T *rmp, char_u *line, colnr_T col)); +*************** +*** 267,272 **** +--- 321,327 ---- + nfa_has_zend = FALSE; + nfa_has_backref = FALSE; + ++ /* shared with BT engine */ + regcomp_start(expr, re_flags); + + return OK; +*************** +*** 799,804 **** +--- 854,860 ---- + EMIT(NFA_ZEND); + nfa_has_zend = TRUE; + break; ++ #ifdef FEAT_SYN_HL + case '1': + case '2': + case '3': +*************** +*** 808,816 **** + case '7': + case '8': + case '9': + case '(': +! /* TODO: \z1...\z9 and \z( not yet supported */ +! return FAIL; + default: + syntax_error = TRUE; + EMSGN(_("E867: (NFA) Unknown operator '\\z%c'"), +--- 864,882 ---- + case '7': + case '8': + case '9': ++ /* \z1...\z9 */ ++ EMIT(NFA_ZREF1 + (no_Magic(c) - '1')); ++ /* No need to set nfa_has_backref, the sub-matches don't ++ * change when \z1 .. \z9 maches or not. */ ++ re_has_z = REX_USE; ++ break; + case '(': +! /* \z( */ +! if (nfa_reg(REG_ZPAREN) == FAIL) +! return FAIL; /* cascaded error */ +! re_has_z = REX_SET; +! break; +! #endif + default: + syntax_error = TRUE; + EMSGN(_("E867: (NFA) Unknown operator '\\z%c'"), +*************** +*** 1651,1658 **** + { + int parno = 0; + +- #ifdef FEAT_SYN_HL +- #endif + if (paren == REG_PAREN) + { + if (regnpar >= NSUBEXP) /* Too many `(' */ +--- 1717,1722 ---- +*************** +*** 1662,1667 **** +--- 1726,1743 ---- + } + parno = regnpar++; + } ++ #ifdef FEAT_SYN_HL ++ else if (paren == REG_ZPAREN) ++ { ++ /* Make a ZOPEN node. */ ++ if (regnzpar >= NSUBEXP) ++ { ++ syntax_error = TRUE; ++ EMSG_RET_FAIL(_("E879: (NFA regexp) Too many \\z(")); ++ } ++ parno = regnzpar++; ++ } ++ #endif + + if (nfa_regbranch() == FAIL) + return FAIL; /* cascaded error */ +*************** +*** 1700,1705 **** +--- 1776,1785 ---- + had_endbrace[parno] = TRUE; /* have seen the close paren */ + EMIT(NFA_MOPEN + parno); + } ++ #ifdef FEAT_SYN_HL ++ else if (paren == REG_ZPAREN) ++ EMIT(NFA_ZOPEN + parno); ++ #endif + + return OK; + } +*************** +*** 1738,1743 **** +--- 1818,1834 ---- + case NFA_BACKREF7: STRCPY(code, "NFA_BACKREF7"); break; + case NFA_BACKREF8: STRCPY(code, "NFA_BACKREF8"); break; + case NFA_BACKREF9: STRCPY(code, "NFA_BACKREF9"); break; ++ #ifdef FEAT_SYN_HL ++ case NFA_ZREF1: STRCPY(code, "NFA_ZREF1"); break; ++ case NFA_ZREF2: STRCPY(code, "NFA_ZREF2"); break; ++ case NFA_ZREF3: STRCPY(code, "NFA_ZREF3"); break; ++ case NFA_ZREF4: STRCPY(code, "NFA_ZREF4"); break; ++ case NFA_ZREF5: STRCPY(code, "NFA_ZREF5"); break; ++ case NFA_ZREF6: STRCPY(code, "NFA_ZREF6"); break; ++ case NFA_ZREF7: STRCPY(code, "NFA_ZREF7"); break; ++ case NFA_ZREF8: STRCPY(code, "NFA_ZREF8"); break; ++ case NFA_ZREF9: STRCPY(code, "NFA_ZREF9"); break; ++ #endif + case NFA_SKIP: STRCPY(code, "NFA_SKIP"); break; + + case NFA_PREV_ATOM_NO_WIDTH: +*************** +*** 1758,1789 **** + case NFA_COMPOSING: STRCPY(code, "NFA_COMPOSING"); break; + case NFA_END_COMPOSING: STRCPY(code, "NFA_END_COMPOSING"); break; + +! case NFA_MOPEN + 0: +! case NFA_MOPEN + 1: +! case NFA_MOPEN + 2: +! case NFA_MOPEN + 3: +! case NFA_MOPEN + 4: +! case NFA_MOPEN + 5: +! case NFA_MOPEN + 6: +! case NFA_MOPEN + 7: +! case NFA_MOPEN + 8: +! case NFA_MOPEN + 9: + STRCPY(code, "NFA_MOPEN(x)"); + code[10] = c - NFA_MOPEN + '0'; + break; +! case NFA_MCLOSE + 0: +! case NFA_MCLOSE + 1: +! case NFA_MCLOSE + 2: +! case NFA_MCLOSE + 3: +! case NFA_MCLOSE + 4: +! case NFA_MCLOSE + 5: +! case NFA_MCLOSE + 6: +! case NFA_MCLOSE + 7: +! case NFA_MCLOSE + 8: +! case NFA_MCLOSE + 9: + STRCPY(code, "NFA_MCLOSE(x)"); + code[11] = c - NFA_MCLOSE + '0'; + break; + case NFA_EOL: STRCPY(code, "NFA_EOL "); break; + case NFA_BOL: STRCPY(code, "NFA_BOL "); break; + case NFA_EOW: STRCPY(code, "NFA_EOW "); break; +--- 1849,1908 ---- + case NFA_COMPOSING: STRCPY(code, "NFA_COMPOSING"); break; + case NFA_END_COMPOSING: STRCPY(code, "NFA_END_COMPOSING"); break; + +! case NFA_MOPEN: +! case NFA_MOPEN1: +! case NFA_MOPEN2: +! case NFA_MOPEN3: +! case NFA_MOPEN4: +! case NFA_MOPEN5: +! case NFA_MOPEN6: +! case NFA_MOPEN7: +! case NFA_MOPEN8: +! case NFA_MOPEN9: + STRCPY(code, "NFA_MOPEN(x)"); + code[10] = c - NFA_MOPEN + '0'; + break; +! case NFA_MCLOSE: +! case NFA_MCLOSE1: +! case NFA_MCLOSE2: +! case NFA_MCLOSE3: +! case NFA_MCLOSE4: +! case NFA_MCLOSE5: +! case NFA_MCLOSE6: +! case NFA_MCLOSE7: +! case NFA_MCLOSE8: +! case NFA_MCLOSE9: + STRCPY(code, "NFA_MCLOSE(x)"); + code[11] = c - NFA_MCLOSE + '0'; + break; ++ #ifdef FEAT_SYN_HL ++ case NFA_ZOPEN: ++ case NFA_ZOPEN1: ++ case NFA_ZOPEN2: ++ case NFA_ZOPEN3: ++ case NFA_ZOPEN4: ++ case NFA_ZOPEN5: ++ case NFA_ZOPEN6: ++ case NFA_ZOPEN7: ++ case NFA_ZOPEN8: ++ case NFA_ZOPEN9: ++ STRCPY(code, "NFA_ZOPEN(x)"); ++ code[10] = c - NFA_ZOPEN + '0'; ++ break; ++ case NFA_ZCLOSE: ++ case NFA_ZCLOSE1: ++ case NFA_ZCLOSE2: ++ case NFA_ZCLOSE3: ++ case NFA_ZCLOSE4: ++ case NFA_ZCLOSE5: ++ case NFA_ZCLOSE6: ++ case NFA_ZCLOSE7: ++ case NFA_ZCLOSE8: ++ case NFA_ZCLOSE9: ++ STRCPY(code, "NFA_ZCLOSE(x)"); ++ code[11] = c - NFA_ZCLOSE + '0'; ++ break; ++ #endif + case NFA_EOL: STRCPY(code, "NFA_EOL "); break; + case NFA_BOL: STRCPY(code, "NFA_BOL "); break; + case NFA_EOW: STRCPY(code, "NFA_EOW "); break; +*************** +*** 2437,2453 **** + /* FALLTHROUGH */ + #endif + +! case NFA_MOPEN + 0: /* Submatch */ +! case NFA_MOPEN + 1: +! case NFA_MOPEN + 2: +! case NFA_MOPEN + 3: +! case NFA_MOPEN + 4: +! case NFA_MOPEN + 5: +! case NFA_MOPEN + 6: +! case NFA_MOPEN + 7: +! case NFA_MOPEN + 8: +! case NFA_MOPEN + 9: +! case NFA_NOPEN: /* \%( "Invisible Submatch" */ + if (nfa_calc_size == TRUE) + { + nstate += 2; +--- 2556,2584 ---- + /* FALLTHROUGH */ + #endif + +! case NFA_MOPEN: /* \( \) Submatch */ +! case NFA_MOPEN1: +! case NFA_MOPEN2: +! case NFA_MOPEN3: +! case NFA_MOPEN4: +! case NFA_MOPEN5: +! case NFA_MOPEN6: +! case NFA_MOPEN7: +! case NFA_MOPEN8: +! case NFA_MOPEN9: +! #ifdef FEAT_SYN_HL +! case NFA_ZOPEN: /* \z( \) Submatch */ +! case NFA_ZOPEN1: +! case NFA_ZOPEN2: +! case NFA_ZOPEN3: +! case NFA_ZOPEN4: +! case NFA_ZOPEN5: +! case NFA_ZOPEN6: +! case NFA_ZOPEN7: +! case NFA_ZOPEN8: +! case NFA_ZOPEN9: +! #endif +! case NFA_NOPEN: /* \%( \) "Invisible Submatch" */ + if (nfa_calc_size == TRUE) + { + nstate += 2; +*************** +*** 2457,2472 **** + mopen = *p; + switch (*p) + { +! case NFA_NOPEN: +! mclose = NFA_NCLOSE; +! break; + #ifdef FEAT_MBYTE +! case NFA_COMPOSING: +! mclose = NFA_END_COMPOSING; +! break; + #endif + default: +! /* NFA_MOPEN(0) ... NFA_MOPEN(9) */ + mclose = *p + NSUBEXP; + break; + } +--- 2588,2611 ---- + mopen = *p; + switch (*p) + { +! case NFA_NOPEN: mclose = NFA_NCLOSE; break; +! #ifdef FEAT_SYN_HL +! case NFA_ZOPEN: mclose = NFA_ZCLOSE; break; +! case NFA_ZOPEN1: mclose = NFA_ZCLOSE1; break; +! case NFA_ZOPEN2: mclose = NFA_ZCLOSE2; break; +! case NFA_ZOPEN3: mclose = NFA_ZCLOSE3; break; +! case NFA_ZOPEN4: mclose = NFA_ZCLOSE4; break; +! case NFA_ZOPEN5: mclose = NFA_ZCLOSE5; break; +! case NFA_ZOPEN6: mclose = NFA_ZCLOSE6; break; +! case NFA_ZOPEN7: mclose = NFA_ZCLOSE7; break; +! case NFA_ZOPEN8: mclose = NFA_ZCLOSE8; break; +! case NFA_ZOPEN9: mclose = NFA_ZCLOSE9; break; +! #endif + #ifdef FEAT_MBYTE +! case NFA_COMPOSING: mclose = NFA_END_COMPOSING; break; + #endif + default: +! /* NFA_MOPEN, NFA_MOPEN1 .. NFA_MOPEN9 */ + mclose = *p + NSUBEXP; + break; + } +*************** +*** 2518,2523 **** +--- 2657,2673 ---- + case NFA_BACKREF7: + case NFA_BACKREF8: + case NFA_BACKREF9: ++ #ifdef FEAT_SYN_HL ++ case NFA_ZREF1: ++ case NFA_ZREF2: ++ case NFA_ZREF3: ++ case NFA_ZREF4: ++ case NFA_ZREF5: ++ case NFA_ZREF6: ++ case NFA_ZREF7: ++ case NFA_ZREF8: ++ case NFA_ZREF9: ++ #endif + if (nfa_calc_size == TRUE) + { + nstate += 2; +*************** +*** 2630,2641 **** + } list; + } regsub_T; + + /* nfa_thread_T contains execution information of a NFA state */ + typedef struct + { + nfa_state_T *state; + int count; +! regsub_T sub; /* submatch info, only party used */ + } nfa_thread_T; + + /* nfa_list_T contains the alternative NFA execution states. */ +--- 2780,2799 ---- + } list; + } regsub_T; + ++ typedef struct ++ { ++ regsub_T norm; /* \( .. \) matches */ ++ #ifdef FEAT_SYN_HL ++ regsub_T synt; /* \z( .. \) matches */ ++ #endif ++ } regsubs_T; ++ + /* nfa_thread_T contains execution information of a NFA state */ + typedef struct + { + nfa_state_T *state; + int count; +! regsubs_T subs; /* submatch info, only party used */ + } nfa_thread_T; + + /* nfa_list_T contains the alternative NFA execution states. */ +*************** +*** 2648,2653 **** +--- 2806,2824 ---- + } nfa_list_T; + + #ifdef ENABLE_LOG ++ static void log_subsexpr __ARGS((regsubs_T *subs)); ++ static void log_subexpr __ARGS((regsub_T *sub)); ++ ++ static void ++ log_subsexpr(subs) ++ regsubs_T *subs; ++ { ++ log_subexpr(&subs->norm); ++ # ifdef FEAT_SYN_HL ++ log_subexpr(&subs->synt); ++ # endif ++ } ++ + static void + log_subexpr(sub) + regsub_T *sub; +*************** +*** 2674,2682 **** + /* Used during execution: whether a match has been found. */ + static int nfa_match; + + static int sub_equal __ARGS((regsub_T *sub1, regsub_T *sub2)); +! static void addstate __ARGS((nfa_list_T *l, nfa_state_T *state, regsub_T *sub, int off)); +! static void addstate_here __ARGS((nfa_list_T *l, nfa_state_T *state, regsub_T *sub, int *ip)); + + /* + * Return TRUE if "sub1" and "sub2" have the same positions. +--- 2845,2916 ---- + /* Used during execution: whether a match has been found. */ + static int nfa_match; + ++ static void clear_sub __ARGS((regsub_T *sub)); ++ static void copy_sub __ARGS((regsub_T *to, regsub_T *from)); ++ static void copy_sub_off __ARGS((regsub_T *to, regsub_T *from)); + static int sub_equal __ARGS((regsub_T *sub1, regsub_T *sub2)); +! static void addstate __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs, int off)); +! static void addstate_here __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs, int *ip)); +! +! static void +! clear_sub(sub) +! regsub_T *sub; +! { +! if (REG_MULTI) +! /* Use 0xff to set lnum to -1 */ +! vim_memset(sub->list.multi, 0xff, +! sizeof(struct multipos) * nfa_nsubexpr); +! else +! vim_memset(sub->list.line, 0, sizeof(struct linepos) * nfa_nsubexpr); +! sub->in_use = 0; +! } +! +! /* +! * Copy the submatches from "from" to "to". +! */ +! static void +! copy_sub(to, from) +! regsub_T *to; +! regsub_T *from; +! { +! to->in_use = from->in_use; +! if (from->in_use > 0) +! { +! /* Copy the match start and end positions. */ +! if (REG_MULTI) +! mch_memmove(&to->list.multi[0], +! &from->list.multi[0], +! sizeof(struct multipos) * from->in_use); +! else +! mch_memmove(&to->list.line[0], +! &from->list.line[0], +! sizeof(struct linepos) * from->in_use); +! } +! } +! +! /* +! * Like copy_sub() but exclude the main match. +! */ +! static void +! copy_sub_off(to, from) +! regsub_T *to; +! regsub_T *from; +! { +! if (to->in_use < from->in_use) +! to->in_use = from->in_use; +! if (from->in_use > 1) +! { +! /* Copy the match start and end positions. */ +! if (REG_MULTI) +! mch_memmove(&to->list.multi[1], +! &from->list.multi[1], +! sizeof(struct multipos) * (from->in_use - 1)); +! else +! mch_memmove(&to->list.line[1], +! &from->list.line[1], +! sizeof(struct linepos) * (from->in_use - 1)); +! } +! } + + /* + * Return TRUE if "sub1" and "sub2" have the same positions. +*************** +*** 2761,2770 **** + } + + static void +! addstate(l, state, sub, off) + nfa_list_T *l; /* runtime state list */ + nfa_state_T *state; /* state to update */ +! regsub_T *sub; /* pointers to subexpressions */ + int off; /* byte offset, when -1 go to next line */ + { + int subidx; +--- 2995,3004 ---- + } + + static void +! addstate(l, state, subs, off) + nfa_list_T *l; /* runtime state list */ + nfa_state_T *state; /* state to update */ +! regsubs_T *subs; /* pointers to subexpressions */ + int off; /* byte offset, when -1 go to next line */ + { + int subidx; +*************** +*** 2773,2778 **** +--- 3007,3013 ---- + int save_in_use; + char_u *save_ptr; + int i; ++ regsub_T *sub; + #ifdef ENABLE_LOG + int did_print = FALSE; + #endif +*************** +*** 2787,2815 **** + case NFA_NOPEN: + case NFA_NCLOSE: + case NFA_MCLOSE: +! case NFA_MCLOSE + 1: +! case NFA_MCLOSE + 2: +! case NFA_MCLOSE + 3: +! case NFA_MCLOSE + 4: +! case NFA_MCLOSE + 5: +! case NFA_MCLOSE + 6: +! case NFA_MCLOSE + 7: +! case NFA_MCLOSE + 8: +! case NFA_MCLOSE + 9: + /* These nodes are not added themselves but their "out" and/or + * "out1" may be added below. */ + break; + + case NFA_MOPEN: +! case NFA_MOPEN + 1: +! case NFA_MOPEN + 2: +! case NFA_MOPEN + 3: +! case NFA_MOPEN + 4: +! case NFA_MOPEN + 5: +! case NFA_MOPEN + 6: +! case NFA_MOPEN + 7: +! case NFA_MOPEN + 8: +! case NFA_MOPEN + 9: + /* These nodes do not need to be added, but we need to bail out + * when it was tried to be added to this list before. */ + if (state->lastlist == l->id) +--- 3022,3074 ---- + case NFA_NOPEN: + case NFA_NCLOSE: + case NFA_MCLOSE: +! case NFA_MCLOSE1: +! case NFA_MCLOSE2: +! case NFA_MCLOSE3: +! case NFA_MCLOSE4: +! case NFA_MCLOSE5: +! case NFA_MCLOSE6: +! case NFA_MCLOSE7: +! case NFA_MCLOSE8: +! case NFA_MCLOSE9: +! #ifdef FEAT_SYN_HL +! case NFA_ZCLOSE: +! case NFA_ZCLOSE1: +! case NFA_ZCLOSE2: +! case NFA_ZCLOSE3: +! case NFA_ZCLOSE4: +! case NFA_ZCLOSE5: +! case NFA_ZCLOSE6: +! case NFA_ZCLOSE7: +! case NFA_ZCLOSE8: +! case NFA_ZCLOSE9: +! #endif + /* These nodes are not added themselves but their "out" and/or + * "out1" may be added below. */ + break; + + case NFA_MOPEN: +! case NFA_MOPEN1: +! case NFA_MOPEN2: +! case NFA_MOPEN3: +! case NFA_MOPEN4: +! case NFA_MOPEN5: +! case NFA_MOPEN6: +! case NFA_MOPEN7: +! case NFA_MOPEN8: +! case NFA_MOPEN9: +! #ifdef FEAT_SYN_HL +! case NFA_ZOPEN: +! case NFA_ZOPEN1: +! case NFA_ZOPEN2: +! case NFA_ZOPEN3: +! case NFA_ZOPEN4: +! case NFA_ZOPEN5: +! case NFA_ZOPEN6: +! case NFA_ZOPEN7: +! case NFA_ZOPEN8: +! case NFA_ZOPEN9: +! #endif + /* These nodes do not need to be added, but we need to bail out + * when it was tried to be added to this list before. */ + if (state->lastlist == l->id) +*************** +*** 2839,2845 **** + { + thread = &l->t[i]; + if (thread->state->id == state->id +! && sub_equal(&thread->sub, sub)) + goto skip_add; + } + } +--- 3098,3108 ---- + { + thread = &l->t[i]; + if (thread->state->id == state->id +! && sub_equal(&thread->subs.norm, &subs->norm) +! #ifdef FEAT_SYN_HL +! && sub_equal(&thread->subs.synt, &subs->synt) +! #endif +! ) + goto skip_add; + } + } +*************** +*** 2858,2876 **** + state->lastlist = l->id; + thread = &l->t[l->n++]; + thread->state = state; +! thread->sub.in_use = sub->in_use; +! if (sub->in_use > 0) +! { +! /* Copy the match start and end positions. */ +! if (REG_MULTI) +! mch_memmove(&thread->sub.list.multi[0], +! &sub->list.multi[0], +! sizeof(struct multipos) * sub->in_use); +! else +! mch_memmove(&thread->sub.list.line[0], +! &sub->list.line[0], +! sizeof(struct linepos) * sub->in_use); +! } + #ifdef ENABLE_LOG + { + int col; +--- 3121,3130 ---- + state->lastlist = l->id; + thread = &l->t[l->n++]; + thread->state = state; +! copy_sub(&thread->subs.norm, &subs->norm); +! #ifdef FEAT_SYN_HL +! copy_sub(&thread->subs.synt, &subs->synt); +! #endif + #ifdef ENABLE_LOG + { + int col; +*************** +*** 2912,2959 **** + break; + + case NFA_SPLIT: +! addstate(l, state->out, sub, off); +! addstate(l, state->out1, sub, off); + break; + +- #if 0 +- case NFA_END_NEG_RANGE: +- /* Nothing to handle here. nfa_regmatch() will take care of it */ +- break; +- +- case NFA_NOT: +- EMSG(_("E999: (NFA regexp internal error) Should not process NOT node !")); +- #ifdef ENABLE_LOG +- fprintf(f, "\n\n>>> E999: Added state NFA_NOT to a list ... Something went wrong ! Why wasn't it processed already? \n\n"); +- #endif +- break; +- +- case NFA_COMPOSING: +- /* nfa_regmatch() will match all the bytes of this composing char. */ +- break; +- #endif +- + case NFA_SKIP_CHAR: + case NFA_NOPEN: + case NFA_NCLOSE: +! addstate(l, state->out, sub, off); + break; + +! case NFA_MOPEN + 0: +! case NFA_MOPEN + 1: +! case NFA_MOPEN + 2: +! case NFA_MOPEN + 3: +! case NFA_MOPEN + 4: +! case NFA_MOPEN + 5: +! case NFA_MOPEN + 6: +! case NFA_MOPEN + 7: +! case NFA_MOPEN + 8: +! case NFA_MOPEN + 9: + case NFA_ZSTART: + if (state->c == NFA_ZSTART) + subidx = 0; + else + subidx = state->c - NFA_MOPEN; + + /* Set the position (with "off") in the subexpression. Save and + * restore it when it was in use. Otherwise fill any gap. */ +--- 3166,3222 ---- + break; + + case NFA_SPLIT: +! /* order matters here */ +! addstate(l, state->out, subs, off); +! addstate(l, state->out1, subs, off); + break; + + case NFA_SKIP_CHAR: + case NFA_NOPEN: + case NFA_NCLOSE: +! addstate(l, state->out, subs, off); + break; + +! case NFA_MOPEN: +! case NFA_MOPEN1: +! case NFA_MOPEN2: +! case NFA_MOPEN3: +! case NFA_MOPEN4: +! case NFA_MOPEN5: +! case NFA_MOPEN6: +! case NFA_MOPEN7: +! case NFA_MOPEN8: +! case NFA_MOPEN9: +! #ifdef FEAT_SYN_HL +! case NFA_ZOPEN: +! case NFA_ZOPEN1: +! case NFA_ZOPEN2: +! case NFA_ZOPEN3: +! case NFA_ZOPEN4: +! case NFA_ZOPEN5: +! case NFA_ZOPEN6: +! case NFA_ZOPEN7: +! case NFA_ZOPEN8: +! case NFA_ZOPEN9: +! #endif + case NFA_ZSTART: + if (state->c == NFA_ZSTART) ++ { + subidx = 0; ++ sub = &subs->norm; ++ } ++ #ifdef FEAT_SYN_HL ++ else if (state->c >= NFA_ZOPEN) ++ { ++ subidx = state->c - NFA_ZOPEN; ++ sub = &subs->synt; ++ } ++ #endif + else ++ { + subidx = state->c - NFA_MOPEN; ++ sub = &subs->norm; ++ } + + /* Set the position (with "off") in the subexpression. Save and + * restore it when it was in use. Otherwise fill any gap. */ +*************** +*** 3007,3013 **** + sub->list.line[subidx].start = reginput + off; + } + +! addstate(l, state->out, sub, off); + + if (save_in_use == -1) + { +--- 3270,3276 ---- + sub->list.line[subidx].start = reginput + off; + } + +! addstate(l, state->out, subs, off); + + if (save_in_use == -1) + { +*************** +*** 3020,3047 **** + sub->in_use = save_in_use; + break; + +! case NFA_MCLOSE + 0: + if (nfa_has_zend) + { + /* Do not overwrite the position set by \ze. If no \ze + * encountered end will be set in nfa_regtry(). */ +! addstate(l, state->out, sub, off); + break; + } +! case NFA_MCLOSE + 1: +! case NFA_MCLOSE + 2: +! case NFA_MCLOSE + 3: +! case NFA_MCLOSE + 4: +! case NFA_MCLOSE + 5: +! case NFA_MCLOSE + 6: +! case NFA_MCLOSE + 7: +! case NFA_MCLOSE + 8: +! case NFA_MCLOSE + 9: + case NFA_ZEND: + if (state->c == NFA_ZEND) + subidx = 0; + else + subidx = state->c - NFA_MCLOSE; + + /* We don't fill in gaps here, there must have been an MOPEN that + * has done that. */ +--- 3283,3335 ---- + sub->in_use = save_in_use; + break; + +! case NFA_MCLOSE: + if (nfa_has_zend) + { + /* Do not overwrite the position set by \ze. If no \ze + * encountered end will be set in nfa_regtry(). */ +! addstate(l, state->out, subs, off); + break; + } +! case NFA_MCLOSE1: +! case NFA_MCLOSE2: +! case NFA_MCLOSE3: +! case NFA_MCLOSE4: +! case NFA_MCLOSE5: +! case NFA_MCLOSE6: +! case NFA_MCLOSE7: +! case NFA_MCLOSE8: +! case NFA_MCLOSE9: +! #ifdef FEAT_SYN_HL +! case NFA_ZCLOSE: +! case NFA_ZCLOSE1: +! case NFA_ZCLOSE2: +! case NFA_ZCLOSE3: +! case NFA_ZCLOSE4: +! case NFA_ZCLOSE5: +! case NFA_ZCLOSE6: +! case NFA_ZCLOSE7: +! case NFA_ZCLOSE8: +! case NFA_ZCLOSE9: +! #endif + case NFA_ZEND: + if (state->c == NFA_ZEND) ++ { + subidx = 0; ++ sub = &subs->norm; ++ } ++ #ifdef FEAT_SYN_HL ++ else if (state->c >= NFA_ZCLOSE) ++ { ++ subidx = state->c - NFA_ZCLOSE; ++ sub = &subs->synt; ++ } ++ #endif + else ++ { + subidx = state->c - NFA_MCLOSE; ++ sub = &subs->norm; ++ } + + /* We don't fill in gaps here, there must have been an MOPEN that + * has done that. */ +*************** +*** 3069,3075 **** + sub->list.line[subidx].end = reginput + off; + } + +! addstate(l, state->out, sub, off); + + if (REG_MULTI) + sub->list.multi[subidx].end = save_lpos; +--- 3357,3363 ---- + sub->list.line[subidx].end = reginput + off; + } + +! addstate(l, state->out, subs, off); + + if (REG_MULTI) + sub->list.multi[subidx].end = save_lpos; +*************** +*** 3087,3096 **** + * matters for alternatives. + */ + static void +! addstate_here(l, state, sub, ip) + nfa_list_T *l; /* runtime state list */ + nfa_state_T *state; /* state to update */ +! regsub_T *sub; /* pointers to subexpressions */ + int *ip; + { + int tlen = l->n; +--- 3375,3384 ---- + * matters for alternatives. + */ + static void +! addstate_here(l, state, subs, ip) + nfa_list_T *l; /* runtime state list */ + nfa_state_T *state; /* state to update */ +! regsubs_T *subs; /* pointers to subexpressions */ + int *ip; + { + int tlen = l->n; +*************** +*** 3098,3104 **** + int i = *ip; + + /* first add the state(s) at the end, so that we know how many there are */ +! addstate(l, state, sub, 0); + + /* when "*ip" was at the end of the list, nothing to do */ + if (i + 1 == tlen) +--- 3386,3392 ---- + int i = *ip; + + /* first add the state(s) at the end, so that we know how many there are */ +! addstate(l, state, subs, 0); + + /* when "*ip" was at the end of the list, nothing to do */ + if (i + 1 == tlen) +*************** +*** 3212,3218 **** + + /* + * Check for a match with subexpression "subidx". +! * return TRUE if it matches. + */ + static int + match_backref(sub, subidx, bytelen) +--- 3500,3506 ---- + + /* + * Check for a match with subexpression "subidx". +! * Return TRUE if it matches. + */ + static int + match_backref(sub, subidx, bytelen) +*************** +*** 3260,3265 **** +--- 3548,3586 ---- + return FALSE; + } + ++ #ifdef FEAT_SYN_HL ++ ++ static int match_zref __ARGS((int subidx, int *bytelen)); ++ ++ /* ++ * Check for a match with \z subexpression "subidx". ++ * Return TRUE if it matches. ++ */ ++ static int ++ match_zref(subidx, bytelen) ++ int subidx; ++ int *bytelen; /* out: length of match in bytes */ ++ { ++ int len; ++ ++ cleanup_zsubexpr(); ++ if (re_extmatch_in == NULL || re_extmatch_in->matches[subidx] == NULL) ++ { ++ /* backref was not set, match an empty string */ ++ *bytelen = 0; ++ return TRUE; ++ } ++ ++ len = (int)STRLEN(re_extmatch_in->matches[subidx]); ++ if (cstrncmp(re_extmatch_in->matches[subidx], reginput, &len) == 0) ++ { ++ *bytelen = len; ++ return TRUE; ++ } ++ return FALSE; ++ } ++ #endif ++ + /* + * Set all NFA nodes' list ID equal to -1. + */ +*************** +*** 3334,3340 **** + return val == pos; + } + +! static int nfa_regmatch __ARGS((nfa_state_T *start, regsub_T *submatch, regsub_T *m, save_se_T *endp)); + + /* + * Main matching routine. +--- 3655,3661 ---- + return val == pos; + } + +! static int nfa_regmatch __ARGS((nfa_state_T *start, regsubs_T *submatch, regsubs_T *m, save_se_T *endp)); + + /* + * Main matching routine. +*************** +*** 3349,3356 **** + static int + nfa_regmatch(start, submatch, m, endp) + nfa_state_T *start; +! regsub_T *submatch; +! regsub_T *m; + save_se_T *endp; + { + int result; +--- 3670,3677 ---- + static int + nfa_regmatch(start, submatch, m, endp) + nfa_state_T *start; +! regsubs_T *submatch; +! regsubs_T *m; + save_se_T *endp; + { + int result; +*************** +*** 3429,3435 **** + #define ADD_POS_NEG_STATE(node) \ + ll = listtbl[result ? 1 : 0][node->negated]; \ + if (ll != NULL) \ +! addstate(ll, node->out , &t->sub, clen); + + + /* +--- 3750,3756 ---- + #define ADD_POS_NEG_STATE(node) \ + ll = listtbl[result ? 1 : 0][node->negated]; \ + if (ll != NULL) \ +! addstate(ll, node->out , &t->subs, clen); + + + /* +*************** +*** 3531,3556 **** + { + case NFA_MATCH: + { +- int j; +- + nfa_match = TRUE; +! submatch->in_use = t->sub.in_use; +! if (REG_MULTI) +! for (j = 0; j < submatch->in_use; j++) +! { +! submatch->list.multi[j].start = +! t->sub.list.multi[j].start; +! submatch->list.multi[j].end = t->sub.list.multi[j].end; +! } +! else +! for (j = 0; j < submatch->in_use; j++) +! { +! submatch->list.line[j].start = +! t->sub.list.line[j].start; +! submatch->list.line[j].end = t->sub.list.line[j].end; +! } + #ifdef ENABLE_LOG +! log_subexpr(&t->sub); + #endif + /* Found the left-most longest match, do not look at any other + * states at this position. When the list of states is going +--- 3852,3864 ---- + { + case NFA_MATCH: + { + nfa_match = TRUE; +! copy_sub(&submatch->norm, &t->subs.norm); +! #ifdef FEAT_SYN_HL +! copy_sub(&submatch->synt, &t->subs.synt); +! #endif + #ifdef ENABLE_LOG +! log_subsexpr(&t->subs); + #endif + /* Found the left-most longest match, do not look at any other + * states at this position. When the list of states is going +*************** +*** 3570,3578 **** + * finished successfully, so return control to the parent + * nfa_regmatch(). Submatches are stored in *m, and used in + * the parent call. */ +! if (start->c == NFA_MOPEN + 0) + /* TODO: do we ever get here? */ +! addstate_here(thislist, t->state->out, &t->sub, &listidx); + else + { + #ifdef ENABLE_LOG +--- 3878,3886 ---- + * finished successfully, so return control to the parent + * nfa_regmatch(). Submatches are stored in *m, and used in + * the parent call. */ +! if (start->c == NFA_MOPEN) + /* TODO: do we ever get here? */ +! addstate_here(thislist, t->state->out, &t->subs, &listidx); + else + { + #ifdef ENABLE_LOG +*************** +*** 3600,3607 **** + + /* do not set submatches for \@! */ + if (!t->state->negated) +! /* TODO: only copy positions in use. */ +! *m = t->sub; + nfa_match = TRUE; + } + break; +--- 3908,3919 ---- + + /* do not set submatches for \@! */ + if (!t->state->negated) +! { +! copy_sub(&m->norm, &t->subs.norm); +! #ifdef FEAT_SYN_HL +! copy_sub(&m->synt, &t->subs.synt); +! #endif +! } + nfa_match = TRUE; + } + break; +*************** +*** 3630,3636 **** + + /* Go back the specified number of bytes, or as far as the + * start of the previous line, to try matching "\@<=" or +! * not matching "\@state->val <= 0) + { + if (REG_MULTI) +--- 3942,3950 ---- + + /* Go back the specified number of bytes, or as far as the + * start of the previous line, to try matching "\@<=" or +! * not matching "\@state->val <= 0) + { + if (REG_MULTI) +*************** +*** 3722,3748 **** + /* for \@! it is a match when result is FALSE */ + if (result != t->state->negated) + { +- int j; +- + /* Copy submatch info from the recursive call */ +! if (REG_MULTI) +! for (j = 1; j < m->in_use; j++) +! { +! t->sub.list.multi[j].start = m->list.multi[j].start; +! t->sub.list.multi[j].end = m->list.multi[j].end; +! } +! else +! for (j = 1; j < m->in_use; j++) +! { +! t->sub.list.line[j].start = m->list.line[j].start; +! t->sub.list.line[j].end = m->list.line[j].end; +! } +! if (m->in_use > t->sub.in_use) +! t->sub.in_use = m->in_use; + + /* t->state->out1 is the corresponding END_INVISIBLE node; + * Add it to the current list (zero-width match). */ +! addstate_here(thislist, t->state->out1->out, &t->sub, + &listidx); + } + break; +--- 4036,4050 ---- + /* for \@! it is a match when result is FALSE */ + if (result != t->state->negated) + { + /* Copy submatch info from the recursive call */ +! copy_sub_off(&t->subs.norm, &m->norm); +! #ifdef FEAT_SYN_HL +! copy_sub_off(&t->subs.synt, &m->synt); +! #endif + + /* t->state->out1 is the corresponding END_INVISIBLE node; + * Add it to the current list (zero-width match). */ +! addstate_here(thislist, t->state->out1->out, &t->subs, + &listidx); + } + break; +*************** +*** 3750,3761 **** + + case NFA_BOL: + if (reginput == regline) +! addstate_here(thislist, t->state->out, &t->sub, &listidx); + break; + + case NFA_EOL: + if (curc == NUL) +! addstate_here(thislist, t->state->out, &t->sub, &listidx); + break; + + case NFA_BOW: +--- 4052,4063 ---- + + case NFA_BOL: + if (reginput == regline) +! addstate_here(thislist, t->state->out, &t->subs, &listidx); + break; + + case NFA_EOL: + if (curc == NUL) +! addstate_here(thislist, t->state->out, &t->subs, &listidx); + break; + + case NFA_BOW: +*************** +*** 3782,3788 **** + && vim_iswordc_buf(reginput[-1], reg_buf))) + bow = FALSE; + if (bow) +! addstate_here(thislist, t->state->out, &t->sub, &listidx); + break; + } + +--- 4084,4090 ---- + && vim_iswordc_buf(reginput[-1], reg_buf))) + bow = FALSE; + if (bow) +! addstate_here(thislist, t->state->out, &t->subs, &listidx); + break; + } + +*************** +*** 3810,3828 **** + && vim_iswordc_buf(curc, reg_buf))) + eow = FALSE; + if (eow) +! addstate_here(thislist, t->state->out, &t->sub, &listidx); + break; + } + + case NFA_BOF: + if (reglnum == 0 && reginput == regline + && (!REG_MULTI || reg_firstlnum == 1)) +! addstate_here(thislist, t->state->out, &t->sub, &listidx); + break; + + case NFA_EOF: + if (reglnum == reg_maxline && curc == NUL) +! addstate_here(thislist, t->state->out, &t->sub, &listidx); + break; + + #ifdef FEAT_MBYTE +--- 4112,4130 ---- + && vim_iswordc_buf(curc, reg_buf))) + eow = FALSE; + if (eow) +! addstate_here(thislist, t->state->out, &t->subs, &listidx); + break; + } + + case NFA_BOF: + if (reglnum == 0 && reginput == regline + && (!REG_MULTI || reg_firstlnum == 1)) +! addstate_here(thislist, t->state->out, &t->subs, &listidx); + break; + + case NFA_EOF: + if (reglnum == reg_maxline && curc == NUL) +! addstate_here(thislist, t->state->out, &t->subs, &listidx); + break; + + #ifdef FEAT_MBYTE +*************** +*** 3911,3922 **** + go_to_nextline = TRUE; + /* Pass -1 for the offset, which means taking the position + * at the start of the next line. */ +! addstate(nextlist, t->state->out, &t->sub, -1); + } + else if (curc == '\n' && reg_line_lbr) + { + /* match \n as if it is an ordinary character */ +! addstate(nextlist, t->state->out, &t->sub, 1); + } + break; + +--- 4213,4224 ---- + go_to_nextline = TRUE; + /* Pass -1 for the offset, which means taking the position + * at the start of the next line. */ +! addstate(nextlist, t->state->out, &t->subs, -1); + } + else if (curc == '\n' && reg_line_lbr) + { + /* match \n as if it is an ordinary character */ +! addstate(nextlist, t->state->out, &t->subs, 1); + } + break; + +*************** +*** 3944,3956 **** + /* This follows a series of negated nodes, like: + * CHAR(x), NFA_NOT, CHAR(y), NFA_NOT etc. */ + if (curc > 0) +! addstate(nextlist, t->state->out, &t->sub, clen); + break; + + case NFA_ANY: + /* Any char except '\0', (end of input) does not match. */ + if (curc > 0) +! addstate(nextlist, t->state->out, &t->sub, clen); + break; + + /* +--- 4246,4258 ---- + /* This follows a series of negated nodes, like: + * CHAR(x), NFA_NOT, CHAR(y), NFA_NOT etc. */ + if (curc > 0) +! addstate(nextlist, t->state->out, &t->subs, clen); + break; + + case NFA_ANY: + /* Any char except '\0', (end of input) does not match. */ + if (curc > 0) +! addstate(nextlist, t->state->out, &t->subs, clen); + break; + + /* +*************** +*** 4096,4114 **** + case NFA_BACKREF7: + case NFA_BACKREF8: + case NFA_BACKREF9: +! /* \1 .. \9 */ + { +! int subidx = t->state->c - NFA_BACKREF1 + 1; + int bytelen; + +! result = match_backref(&t->sub, subidx, &bytelen); + if (result) + { + if (bytelen == 0) + { + /* empty match always works, add NFA_SKIP with zero to + * be used next */ +! addstate_here(thislist, t->state->out, &t->sub, + &listidx); + thislist->t[listidx + 1].count = 0; + } +--- 4398,4439 ---- + case NFA_BACKREF7: + case NFA_BACKREF8: + case NFA_BACKREF9: +! #ifdef FEAT_SYN_HL +! case NFA_ZREF1: +! case NFA_ZREF2: +! case NFA_ZREF3: +! case NFA_ZREF4: +! case NFA_ZREF5: +! case NFA_ZREF6: +! case NFA_ZREF7: +! case NFA_ZREF8: +! case NFA_ZREF9: +! #endif +! /* \1 .. \9 \z1 .. \z9 */ + { +! int subidx; + int bytelen; + +! if (t->state->c <= NFA_BACKREF9) +! { +! subidx = t->state->c - NFA_BACKREF1 + 1; +! result = match_backref(&t->subs.norm, subidx, &bytelen); +! } +! #ifdef FEAT_SYN_HL +! else +! { +! subidx = t->state->c - NFA_ZREF1 + 1; +! result = match_zref(subidx, &bytelen); +! } +! #endif +! + if (result) + { + if (bytelen == 0) + { + /* empty match always works, add NFA_SKIP with zero to + * be used next */ +! addstate_here(thislist, t->state->out, &t->subs, + &listidx); + thislist->t[listidx + 1].count = 0; + } +*************** +*** 4116,4134 **** + { + /* match current character, jump ahead to out of + * NFA_SKIP */ +! addstate(nextlist, t->state->out->out, &t->sub, clen); + #ifdef ENABLE_LOG +! log_subexpr(&nextlist->t[nextlist->n - 1].sub); + #endif + } + else + { + /* skip ofer the matched characters, set character + * count in NFA_SKIP */ +! addstate(nextlist, t->state->out, &t->sub, bytelen); + nextlist->t[nextlist->n - 1].count = bytelen - clen; + #ifdef ENABLE_LOG +! log_subexpr(&nextlist->t[nextlist->n - 1].sub); + #endif + } + +--- 4441,4459 ---- + { + /* match current character, jump ahead to out of + * NFA_SKIP */ +! addstate(nextlist, t->state->out->out, &t->subs, clen); + #ifdef ENABLE_LOG +! log_subsexpr(&nextlist->t[nextlist->n - 1].subs); + #endif + } + else + { + /* skip ofer the matched characters, set character + * count in NFA_SKIP */ +! addstate(nextlist, t->state->out, &t->subs, bytelen); + nextlist->t[nextlist->n - 1].count = bytelen - clen; + #ifdef ENABLE_LOG +! log_subsexpr(&nextlist->t[nextlist->n - 1].subs); + #endif + } + +*************** +*** 4140,4157 **** + if (t->count - clen <= 0) + { + /* end of match, go to what follows */ +! addstate(nextlist, t->state->out, &t->sub, clen); + #ifdef ENABLE_LOG +! log_subexpr(&nextlist->t[nextlist->n - 1].sub); + #endif + } + else + { + /* add state again with decremented count */ +! addstate(nextlist, t->state, &t->sub, 0); + nextlist->t[nextlist->n - 1].count = t->count - clen; + #ifdef ENABLE_LOG +! log_subexpr(&nextlist->t[nextlist->n - 1].sub); + #endif + } + break; +--- 4465,4482 ---- + if (t->count - clen <= 0) + { + /* end of match, go to what follows */ +! addstate(nextlist, t->state->out, &t->subs, clen); + #ifdef ENABLE_LOG +! log_subsexpr(&nextlist->t[nextlist->n - 1].subs); + #endif + } + else + { + /* add state again with decremented count */ +! addstate(nextlist, t->state, &t->subs, 0); + nextlist->t[nextlist->n - 1].count = t->count - clen; + #ifdef ENABLE_LOG +! log_subsexpr(&nextlist->t[nextlist->n - 1].subs); + #endif + } + break; +*************** +*** 4169,4175 **** + nfa_re_num_cmp(t->state->val, t->state->c - NFA_LNUM, + (long_u)(reglnum + reg_firstlnum))); + if (result) +! addstate_here(thislist, t->state->out, &t->sub, &listidx); + break; + + case NFA_COL: +--- 4494,4500 ---- + nfa_re_num_cmp(t->state->val, t->state->c - NFA_LNUM, + (long_u)(reglnum + reg_firstlnum))); + if (result) +! addstate_here(thislist, t->state->out, &t->subs, &listidx); + break; + + case NFA_COL: +*************** +*** 4178,4184 **** + result = nfa_re_num_cmp(t->state->val, t->state->c - NFA_COL, + (long_u)(reginput - regline) + 1); + if (result) +! addstate_here(thislist, t->state->out, &t->sub, &listidx); + break; + + case NFA_VCOL: +--- 4503,4509 ---- + result = nfa_re_num_cmp(t->state->val, t->state->c - NFA_COL, + (long_u)(reginput - regline) + 1); + if (result) +! addstate_here(thislist, t->state->out, &t->subs, &listidx); + break; + + case NFA_VCOL: +*************** +*** 4189,4195 **** + reg_win == NULL ? curwin : reg_win, + regline, (colnr_T)(reginput - regline)) + 1); + if (result) +! addstate_here(thislist, t->state->out, &t->sub, &listidx); + break; + + case NFA_CURSOR: +--- 4514,4520 ---- + reg_win == NULL ? curwin : reg_win, + regline, (colnr_T)(reginput - regline)) + 1); + if (result) +! addstate_here(thislist, t->state->out, &t->subs, &listidx); + break; + + case NFA_CURSOR: +*************** +*** 4198,4204 **** + && ((colnr_T)(reginput - regline) + == reg_win->w_cursor.col)); + if (result) +! addstate_here(thislist, t->state->out, &t->sub, &listidx); + break; + + default: /* regular character */ +--- 4523,4529 ---- + && ((colnr_T)(reginput - regline) + == reg_win->w_cursor.col)); + if (result) +! addstate_here(thislist, t->state->out, &t->subs, &listidx); + break; + + default: /* regular character */ +*************** +*** 4238,4244 **** + * Unless "endp" is not NULL, then we match the end position. + * Also don't start a match past the first line. */ + if (nfa_match == FALSE +! && ((start->c == NFA_MOPEN + 0 + && reglnum == 0 + && clen != 0 + && (ireg_maxcol == 0 +--- 4563,4569 ---- + * Unless "endp" is not NULL, then we match the end position. + * Also don't start a match past the first line. */ + if (nfa_match == FALSE +! && ((start->c == NFA_MOPEN + && reglnum == 0 + && clen != 0 + && (ireg_maxcol == 0 +*************** +*** 4305,4322 **** + * Returns 0 for failure, number of lines contained in the match otherwise. + */ + static long +! nfa_regtry(start, col) +! nfa_state_T *start; +! colnr_T col; + { + int i; +! regsub_T sub, m; + #ifdef ENABLE_LOG + FILE *f; + #endif + + reginput = regline + col; + need_clear_subexpr = TRUE; + + #ifdef ENABLE_LOG + f = fopen(NFA_REGEXP_RUN_LOG, "a"); +--- 4630,4653 ---- + * Returns 0 for failure, number of lines contained in the match otherwise. + */ + static long +! nfa_regtry(prog, col) +! nfa_regprog_T *prog; +! colnr_T col; + { + int i; +! regsubs_T subs, m; +! nfa_state_T *start = prog->start; + #ifdef ENABLE_LOG + FILE *f; + #endif + + reginput = regline + col; + need_clear_subexpr = TRUE; ++ #ifdef FEAT_SYN_HL ++ /* Clear the external match subpointers if necessary. */ ++ if (prog->reghasz == REX_SET) ++ need_clear_zsubexpr = TRUE; ++ #endif + + #ifdef ENABLE_LOG + f = fopen(NFA_REGEXP_RUN_LOG, "a"); +*************** +*** 4337,4366 **** + EMSG(_("Could not open temporary log file for writing ")); + #endif + +! if (REG_MULTI) +! { +! /* Use 0xff to set lnum to -1 */ +! vim_memset(sub.list.multi, 0xff, sizeof(struct multipos) * nfa_nsubexpr); +! vim_memset(m.list.multi, 0xff, sizeof(struct multipos) * nfa_nsubexpr); +! } +! else +! { +! vim_memset(sub.list.line, 0, sizeof(struct linepos) * nfa_nsubexpr); +! vim_memset(m.list.line, 0, sizeof(struct linepos) * nfa_nsubexpr); +! } +! sub.in_use = 0; +! m.in_use = 0; + +! if (nfa_regmatch(start, &sub, &m, NULL) == FALSE) + return 0; + + cleanup_subexpr(); + if (REG_MULTI) + { +! for (i = 0; i < sub.in_use; i++) + { +! reg_startpos[i] = sub.list.multi[i].start; +! reg_endpos[i] = sub.list.multi[i].end; + } + + if (reg_startpos[0].lnum < 0) +--- 4668,4690 ---- + EMSG(_("Could not open temporary log file for writing ")); + #endif + +! clear_sub(&subs.norm); +! clear_sub(&m.norm); +! #ifdef FEAT_SYN_HL +! clear_sub(&subs.synt); +! clear_sub(&m.synt); +! #endif + +! if (nfa_regmatch(start, &subs, &m, NULL) == FALSE) + return 0; + + cleanup_subexpr(); + if (REG_MULTI) + { +! for (i = 0; i < subs.norm.in_use; i++) + { +! reg_startpos[i] = subs.norm.list.multi[i].start; +! reg_endpos[i] = subs.norm.list.multi[i].end; + } + + if (reg_startpos[0].lnum < 0) +*************** +*** 4380,4389 **** + } + else + { +! for (i = 0; i < sub.in_use; i++) + { +! reg_startp[i] = sub.list.line[i].start; +! reg_endp[i] = sub.list.line[i].end; + } + + if (reg_startp[0] == NULL) +--- 4704,4713 ---- + } + else + { +! for (i = 0; i < subs.norm.in_use; i++) + { +! reg_startp[i] = subs.norm.list.line[i].start; +! reg_endp[i] = subs.norm.list.line[i].end; + } + + if (reg_startp[0] == NULL) +*************** +*** 4392,4397 **** +--- 4716,4758 ---- + reg_endp[0] = reginput; + } + ++ #ifdef FEAT_SYN_HL ++ /* Package any found \z(...\) matches for export. Default is none. */ ++ unref_extmatch(re_extmatch_out); ++ re_extmatch_out = NULL; ++ ++ if (prog->reghasz == REX_SET) ++ { ++ int i; ++ ++ cleanup_zsubexpr(); ++ re_extmatch_out = make_extmatch(); ++ for (i = 0; i < subs.synt.in_use; i++) ++ { ++ if (REG_MULTI) ++ { ++ struct multipos *mpos = &subs.synt.list.multi[i]; ++ ++ /* Only accept single line matches. */ ++ if (mpos->start.lnum >= 0 && mpos->start.lnum == mpos->end.lnum) ++ re_extmatch_out->matches[i] = ++ vim_strnsave(reg_getline(mpos->start.lnum) ++ + mpos->start.col, ++ mpos->end.col - mpos->start.col); ++ } ++ else ++ { ++ struct linepos *lpos = &subs.synt.list.line[i]; ++ ++ if (lpos->start != NULL && lpos->end != NULL) ++ re_extmatch_out->matches[i] = ++ vim_strnsave(lpos->start, ++ (int)(lpos->end - lpos->start)); ++ } ++ } ++ } ++ #endif ++ + return 1 + reglnum; + } + +*************** +*** 4461,4467 **** + prog->state[i].lastlist = 0; + } + +! retval = nfa_regtry(prog->start, col); + + theend: + return retval; +--- 4822,4828 ---- + prog->state[i].lastlist = 0; + } + +! retval = nfa_regtry(prog, col); + + theend: + return retval; +*************** +*** 4552,4557 **** +--- 4913,4922 ---- + nfa_postfix_dump(expr, OK); + nfa_dump(prog); + #endif ++ #ifdef FEAT_SYN_HL ++ /* Remember whether this pattern has any \z specials in it. */ ++ prog->reghasz = re_has_z; ++ #endif + + out: + vim_free(post_start); +*** ../vim-7.3.1089/src/version.c 2013-06-01 20:32:09.000000000 +0200 +--- src/version.c 2013-06-01 22:29:51.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1090, + /**/ + +-- +Despite the cost of living, have you noticed how it remains so popular? + + /// 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 /// diff --git a/7.3.1091 b/7.3.1091 new file mode 100644 index 0000000..efd5c5b --- /dev/null +++ b/7.3.1091 @@ -0,0 +1,104 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1091 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1091 +Problem: New regexp engine: no error when using \z1 or \z( where it does + not work. +Solution: Give an error message. +Files: src/regexp.c, src/regexp_nfa.c + + +*** ../vim-7.3.1090/src/regexp.c 2013-06-01 19:54:39.000000000 +0200 +--- src/regexp.c 2013-06-02 14:56:07.000000000 +0200 +*************** +*** 361,366 **** +--- 361,368 ---- + static char_u e_unmatchedpp[] = N_("E53: Unmatched %s%%("); + static char_u e_unmatchedp[] = N_("E54: Unmatched %s("); + static char_u e_unmatchedpar[] = N_("E55: Unmatched %s)"); ++ static char_u e_z_not_allowed[] = N_("E66: \\z( not allowed here"); ++ static char_u e_z1_not_allowed[] = N_("E67: \\z1 et al. not allowed here"); + + #define NOT_MULTI 0 + #define MULTI_ONE 1 +*************** +*** 2120,2126 **** + { + #ifdef FEAT_SYN_HL + case '(': if (reg_do_extmatch != REX_SET) +! EMSG_RET_NULL(_("E66: \\z( not allowed here")); + if (one_exactly) + EMSG_ONE_RET_NULL; + ret = reg(REG_ZPAREN, &flags); +--- 2122,2128 ---- + { + #ifdef FEAT_SYN_HL + case '(': if (reg_do_extmatch != REX_SET) +! EMSG_RET_NULL(_(e_z_not_allowed)); + if (one_exactly) + EMSG_ONE_RET_NULL; + ret = reg(REG_ZPAREN, &flags); +*************** +*** 2139,2145 **** + case '7': + case '8': + case '9': if (reg_do_extmatch != REX_USE) +! EMSG_RET_NULL(_("E67: \\z1 et al. not allowed here")); + ret = regnode(ZREF + c - '0'); + re_has_z = REX_USE; + break; +--- 2141,2147 ---- + case '7': + case '8': + case '9': if (reg_do_extmatch != REX_USE) +! EMSG_RET_NULL(_(e_z1_not_allowed)); + ret = regnode(ZREF + c - '0'); + re_has_z = REX_USE; + break; +*** ../vim-7.3.1090/src/regexp_nfa.c 2013-06-01 23:02:48.000000000 +0200 +--- src/regexp_nfa.c 2013-06-02 14:56:53.000000000 +0200 +*************** +*** 865,870 **** +--- 865,872 ---- + case '8': + case '9': + /* \z1...\z9 */ ++ if (reg_do_extmatch != REX_USE) ++ EMSG_RET_FAIL(_(e_z1_not_allowed)); + EMIT(NFA_ZREF1 + (no_Magic(c) - '1')); + /* No need to set nfa_has_backref, the sub-matches don't + * change when \z1 .. \z9 maches or not. */ +*************** +*** 872,877 **** +--- 874,881 ---- + break; + case '(': + /* \z( */ ++ if (reg_do_extmatch != REX_SET) ++ EMSG_RET_FAIL(_(e_z_not_allowed)); + if (nfa_reg(REG_ZPAREN) == FAIL) + return FAIL; /* cascaded error */ + re_has_z = REX_SET; +*** ../vim-7.3.1090/src/version.c 2013-06-01 23:02:48.000000000 +0200 +--- src/version.c 2013-06-02 14:58:17.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1091, + /**/ + +-- +Don't believe everything you hear or anything you say. + + /// 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 /// diff --git a/7.3.1092 b/7.3.1092 new file mode 100644 index 0000000..5887bf2 --- /dev/null +++ b/7.3.1092 @@ -0,0 +1,189 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1092 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1092 +Problem: Can't build with regexp debugging. NFA debug output shows wrong + pattern. +Solution: Fix debugging code for recent changes. Add the pattern to the + program. +Files: src/regexp_nfa.c, src/regexp.h + + +*** ../vim-7.3.1091/src/regexp_nfa.c 2013-06-02 15:01:51.000000000 +0200 +--- src/regexp_nfa.c 2013-06-02 15:48:57.000000000 +0200 +*************** +*** 3133,3144 **** + { + int col; + +! if (thread->sub.in_use <= 0) + col = -1; + else if (REG_MULTI) +! col = thread->sub.list.multi[0].start.col; + else +! col = (int)(thread->sub.list.line[0].start - regline); + nfa_set_code(state->c); + fprintf(log_fd, "> Adding state %d to list %d. char %d: %s (start col %d)\n", + abs(state->id), l->id, state->c, code, col); +--- 3133,3144 ---- + { + int col; + +! if (thread->subs.norm.in_use <= 0) + col = -1; + else if (REG_MULTI) +! col = thread->subs.norm.list.multi[0].start.col; + else +! col = (int)(thread->subs.norm.list.line[0].start - regline); + nfa_set_code(state->c); + fprintf(log_fd, "> Adding state %d to list %d. char %d: %s (start col %d)\n", + abs(state->id), l->id, state->c, code, col); +*************** +*** 3152,3163 **** + { + int col; + +! if (sub->in_use <= 0) + col = -1; + else if (REG_MULTI) +! col = sub->list.multi[0].start.col; + else +! col = (int)(sub->list.line[0].start - regline); + nfa_set_code(state->c); + fprintf(log_fd, "> Processing state %d for list %d. char %d: %s (start col %d)\n", + abs(state->id), l->id, state->c, code, col); +--- 3152,3163 ---- + { + int col; + +! if (subs->norm.in_use <= 0) + col = -1; + else if (REG_MULTI) +! col = subs->norm.list.multi[0].start.col; + else +! col = (int)(subs->norm.list.line[0].start - regline); + nfa_set_code(state->c); + fprintf(log_fd, "> Processing state %d for list %d. char %d: %s (start col %d)\n", + abs(state->id), l->id, state->c, code, col); +*************** +*** 3836,3847 **** + { + int col; + +! if (t->sub.in_use <= 0) + col = -1; + else if (REG_MULTI) +! col = t->sub.list.multi[0].start.col; + else +! col = (int)(t->sub.list.line[0].start - regline); + nfa_set_code(t->state->c); + fprintf(log_fd, "(%d) char %d %s (start col %d) ... \n", + abs(t->state->id), (int)t->state->c, code, col); +--- 3836,3847 ---- + { + int col; + +! if (t->subs.norm.in_use <= 0) + col = -1; + else if (REG_MULTI) +! col = t->subs.norm.list.multi[0].start.col; + else +! col = (int)(t->subs.norm.list.line[0].start - regline); + nfa_set_code(t->state->c); + fprintf(log_fd, "(%d) char %d %s (start col %d) ... \n", + abs(t->state->id), (int)t->state->c, code, col); +*************** +*** 4818,4823 **** +--- 4818,4826 ---- + nfa_has_zend = prog->has_zend; + nfa_has_backref = prog->has_backref; + nfa_nsubexpr = prog->nsubexp; ++ #ifdef DEBUG ++ nfa_regengine.expr = prog->pattern; ++ #endif + + nstate = prog->nstate; + for (i = 0; i < nstate; ++i) +*************** +*** 4828,4833 **** +--- 4831,4840 ---- + + retval = nfa_regtry(prog, col); + ++ #ifdef DEBUG ++ nfa_regengine.expr = NULL; ++ #endif ++ + theend: + return retval; + } +*************** +*** 4921,4926 **** +--- 4928,4937 ---- + /* Remember whether this pattern has any \z specials in it. */ + prog->reghasz = re_has_z; + #endif ++ #ifdef DEBUG ++ prog->pattern = vim_strsave(expr); /* memory will leak */ ++ nfa_regengine.expr = NULL; ++ #endif + + out: + vim_free(post_start); +*** ../vim-7.3.1091/src/regexp.h 2013-06-01 23:02:48.000000000 +0200 +--- src/regexp.h 2013-06-02 15:42:57.000000000 +0200 +*************** +*** 86,98 **** + regengine_T *engine; + unsigned regflags; + +! regprog_T regprog; +! nfa_state_T *start; + int has_zend; /* pattern contains \ze */ + int has_backref; /* pattern contains \1 .. \9 */ + #ifdef FEAT_SYN_HL + int reghasz; + #endif + int nsubexp; /* number of () */ + int nstate; + nfa_state_T state[0]; /* actually longer.. */ +--- 86,100 ---- + regengine_T *engine; + unsigned regflags; + +! nfa_state_T *start; /* points into state[] */ + int has_zend; /* pattern contains \ze */ + int has_backref; /* pattern contains \1 .. \9 */ + #ifdef FEAT_SYN_HL + int reghasz; + #endif ++ #ifdef DEBUG ++ char_u *pattern; ++ #endif + int nsubexp; /* number of () */ + int nstate; + nfa_state_T state[0]; /* actually longer.. */ +*** ../vim-7.3.1091/src/version.c 2013-06-02 15:01:51.000000000 +0200 +--- src/version.c 2013-06-02 15:53:16.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1092, + /**/ + +-- +I started out with nothing, and I still have most of it. + -- Michael Davis -- "Tonight Show" + + /// 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 /// diff --git a/7.3.1093 b/7.3.1093 new file mode 100644 index 0000000..1c52bf5 --- /dev/null +++ b/7.3.1093 @@ -0,0 +1,87 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1093 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1093 +Problem: New regexp engine: When a sub expression is empty \1 skips a + character. +Solution: Make \1 try the current position when the match is emtpy. +Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok + + +*** ../vim-7.3.1092/src/regexp_nfa.c 2013-06-02 15:55:52.000000000 +0200 +--- src/regexp_nfa.c 2013-06-02 16:03:28.000000000 +0200 +*************** +*** 4435,4445 **** + { + if (bytelen == 0) + { +! /* empty match always works, add NFA_SKIP with zero to +! * be used next */ +! addstate_here(thislist, t->state->out, &t->subs, + &listidx); +- thislist->t[listidx + 1].count = 0; + } + else if (bytelen <= clen) + { +--- 4435,4444 ---- + { + if (bytelen == 0) + { +! /* empty match always works, output of NFA_SKIP to be +! * used next */ +! addstate_here(thislist, t->state->out->out, &t->subs, + &listidx); + } + else if (bytelen <= clen) + { +*** ../vim-7.3.1092/src/testdir/test64.in 2013-06-01 19:54:39.000000000 +0200 +--- src/testdir/test64.in 2013-06-02 16:02:56.000000000 +0200 +*************** +*** 361,366 **** +--- 361,367 ---- + :call add(tl, [2, '\(\i\+\) \1', ' abc abc', 'abc abc', 'abc']) + :call add(tl, [2, '\(\i\+\) \1', 'xgoo goox', 'goo goo', 'goo']) + :call add(tl, [2, '\(a\)\(b\)\(c\)\(dd\)\(e\)\(f\)\(g\)\(h\)\(i\)\1\2\3\4\5\6\7\8\9', 'xabcddefghiabcddefghix', 'abcddefghiabcddefghi', 'a', 'b', 'c', 'dd', 'e', 'f', 'g', 'h', 'i']) ++ :call add(tl, [2, '\(\d*\)a \1b', ' a b ', 'a b', '']) + :" + :"""" Look-behind with limit + :call add(tl, [2, '<\@<=span.', 'xxspanxx +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1094 +Problem: New regexp engine: Attempts to match "^" at every character. +Solution: Only try "^" at the start of a line. +Files: rc/regexp_nfa.c + + +*** ../vim-7.3.1093/src/regexp_nfa.c 2013-06-02 16:07:05.000000000 +0200 +--- src/regexp_nfa.c 2013-06-02 16:24:04.000000000 +0200 +*************** +*** 249,254 **** +--- 249,256 ---- + * executing. */ + static int istate; /* Index in the state vector, used in new_state() */ + ++ /* If not NULL match must end at this position */ ++ static save_se_T *nfa_endp = NULL; + + static int nfa_regcomp_start __ARGS((char_u*expr, int re_flags)); + static int nfa_recognize_char_class __ARGS((char_u *start, char_u *end, int extra_newl)); +*************** +*** 3080,3085 **** +--- 3082,3099 ---- + state->lastlist = l->id; + break; + ++ case NFA_BOL: ++ case NFA_BOF: ++ /* "^" won't match past end-of-line, don't bother trying. ++ * Except when we are going to the next line for a look-behind ++ * match. */ ++ if (reginput > regline ++ && (nfa_endp == NULL ++ || !REG_MULTI ++ || reglnum == nfa_endp->se_u.pos.lnum)) ++ goto skip_add; ++ /* FALLTHROUGH */ ++ + default: + if (state->lastlist == l->id) + { +*************** +*** 3659,3682 **** + return val == pos; + } + +! static int nfa_regmatch __ARGS((nfa_state_T *start, regsubs_T *submatch, regsubs_T *m, save_se_T *endp)); + + /* + * Main matching routine. + * + * Run NFA to determine whether it matches reginput. + * +! * When "endp" is not NULL it is a required end-of-match position. + * + * Return TRUE if there is a match, FALSE otherwise. + * Note: Caller must ensure that: start != NULL. + */ + static int +! nfa_regmatch(start, submatch, m, endp) + nfa_state_T *start; + regsubs_T *submatch; + regsubs_T *m; +- save_se_T *endp; + { + int result; + int size = 0; +--- 3673,3695 ---- + return val == pos; + } + +! static int nfa_regmatch __ARGS((nfa_state_T *start, regsubs_T *submatch, regsubs_T *m)); + + /* + * Main matching routine. + * + * Run NFA to determine whether it matches reginput. + * +! * When "nfa_endp" is not NULL it is a required end-of-match position. + * + * Return TRUE if there is a match, FALSE otherwise. + * Note: Caller must ensure that: start != NULL. + */ + static int +! nfa_regmatch(start, submatch, m) + nfa_state_T *start; + regsubs_T *submatch; + regsubs_T *m; + { + int result; + int size = 0; +*************** +*** 3888,3913 **** + else + { + #ifdef ENABLE_LOG +! if (endp != NULL) + { + if (REG_MULTI) + fprintf(log_fd, "Current lnum: %d, endp lnum: %d; current col: %d, endp col: %d\n", + (int)reglnum, +! (int)endp->se_u.pos.lnum, + (int)(reginput - regline), +! endp->se_u.pos.col); + else + fprintf(log_fd, "Current col: %d, endp col: %d\n", + (int)(reginput - regline), +! (int)(endp->se_u.ptr - reginput)); + } + #endif +! /* It's only a match if it ends at "endp" */ +! if (endp != NULL && (REG_MULTI +! ? (reglnum != endp->se_u.pos.lnum + || (int)(reginput - regline) +! != endp->se_u.pos.col) +! : reginput != endp->se_u.ptr)) + break; + + /* do not set submatches for \@! */ +--- 3901,3926 ---- + else + { + #ifdef ENABLE_LOG +! if (nfa_endp != NULL) + { + if (REG_MULTI) + fprintf(log_fd, "Current lnum: %d, endp lnum: %d; current col: %d, endp col: %d\n", + (int)reglnum, +! (int)nfa_endp->se_u.pos.lnum, + (int)(reginput - regline), +! nfa_endp->se_u.pos.col); + else + fprintf(log_fd, "Current col: %d, endp col: %d\n", + (int)(reginput - regline), +! (int)(nfa_endp->se_u.ptr - reginput)); + } + #endif +! /* It's only a match if it ends at "nfa_endp" */ +! if (nfa_endp != NULL && (REG_MULTI +! ? (reglnum != nfa_endp->se_u.pos.lnum + || (int)(reginput - regline) +! != nfa_endp->se_u.pos.col) +! : reginput != nfa_endp->se_u.ptr)) + break; + + /* do not set submatches for \@! */ +*************** +*** 3929,3934 **** +--- 3942,3948 ---- + char_u *save_regline = regline; + int save_reglnum = reglnum; + int save_nfa_match = nfa_match; ++ save_se_T *save_nfa_endp = nfa_endp; + save_se_T endpos; + save_se_T *endposp = NULL; + +*************** +*** 4012,4018 **** + * recursion. */ + nfa_save_listids(start, listids); + nfa_set_null_listids(start); +! result = nfa_regmatch(t->state->out, submatch, m, endposp); + nfa_set_neg_listids(start); + nfa_restore_listids(start, listids); + +--- 4026,4033 ---- + * recursion. */ + nfa_save_listids(start, listids); + nfa_set_null_listids(start); +! nfa_endp = endposp; +! result = nfa_regmatch(t->state->out, submatch, m); + nfa_set_neg_listids(start); + nfa_restore_listids(start, listids); + +*************** +*** 4021,4026 **** +--- 4036,4042 ---- + regline = save_regline; + reglnum = save_reglnum; + nfa_match = save_nfa_match; ++ nfa_endp = save_nfa_endp; + + #ifdef ENABLE_LOG + log_fd = fopen(NFA_REGEXP_RUN_LOG, "a"); +*************** +*** 4563,4569 **** + * matters! + * Do not add the start state in recursive calls of nfa_regmatch(), + * because recursive calls should only start in the first position. +! * Unless "endp" is not NULL, then we match the end position. + * Also don't start a match past the first line. */ + if (nfa_match == FALSE + && ((start->c == NFA_MOPEN +--- 4579,4585 ---- + * matters! + * Do not add the start state in recursive calls of nfa_regmatch(), + * because recursive calls should only start in the first position. +! * Unless "nfa_endp" is not NULL, then we match the end position. + * Also don't start a match past the first line. */ + if (nfa_match == FALSE + && ((start->c == NFA_MOPEN +*************** +*** 4571,4583 **** + && clen != 0 + && (ireg_maxcol == 0 + || (colnr_T)(reginput - regline) < ireg_maxcol)) +! || (endp != NULL + && (REG_MULTI +! ? (reglnum < endp->se_u.pos.lnum +! || (reglnum == endp->se_u.pos.lnum + && (int)(reginput - regline) +! < endp->se_u.pos.col)) +! : reginput < endp->se_u.ptr)))) + { + #ifdef ENABLE_LOG + fprintf(log_fd, "(---) STARTSTATE\n"); +--- 4587,4599 ---- + && clen != 0 + && (ireg_maxcol == 0 + || (colnr_T)(reginput - regline) < ireg_maxcol)) +! || (nfa_endp != NULL + && (REG_MULTI +! ? (reglnum < nfa_endp->se_u.pos.lnum +! || (reglnum == nfa_endp->se_u.pos.lnum + && (int)(reginput - regline) +! < nfa_endp->se_u.pos.col)) +! : reginput < nfa_endp->se_u.ptr)))) + { + #ifdef ENABLE_LOG + fprintf(log_fd, "(---) STARTSTATE\n"); +*************** +*** 4601,4608 **** + * finish. */ + if (clen != 0) + reginput += clen; +! else if (go_to_nextline || (endp != NULL && REG_MULTI +! && reglnum < endp->se_u.pos.lnum)) + reg_nextline(); + else + break; +--- 4617,4624 ---- + * finish. */ + if (clen != 0) + reginput += clen; +! else if (go_to_nextline || (nfa_endp != NULL && REG_MULTI +! && reglnum < nfa_endp->se_u.pos.lnum)) + reg_nextline(); + else + break; +*************** +*** 4678,4684 **** + clear_sub(&m.synt); + #endif + +! if (nfa_regmatch(start, &subs, &m, NULL) == FALSE) + return 0; + + cleanup_subexpr(); +--- 4694,4700 ---- + clear_sub(&m.synt); + #endif + +! if (nfa_regmatch(start, &subs, &m) == FALSE) + return 0; + + cleanup_subexpr(); +*** ../vim-7.3.1093/src/version.c 2013-06-02 16:07:05.000000000 +0200 +--- src/version.c 2013-06-02 16:25:02.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1094, + /**/ + +-- +The future isn't what it used to be. + + /// 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 /// diff --git a/7.3.1095 b/7.3.1095 new file mode 100644 index 0000000..6b9c2c9 --- /dev/null +++ b/7.3.1095 @@ -0,0 +1,331 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1095 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1095 +Problem: Compiler warnings for shadowed variables. (Christian Brabandt) +Solution: Rename new_state() to alloc_state(). Remove unnecessary + declaration. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1094/src/regexp_nfa.c 2013-06-02 16:34:14.000000000 +0200 +--- src/regexp_nfa.c 2013-06-02 16:38:44.000000000 +0200 +*************** +*** 247,253 **** + + static int nstate; /* Number of states in the NFA. Also used when + * executing. */ +! static int istate; /* Index in the state vector, used in new_state() */ + + /* If not NULL match must end at this position */ + static save_se_T *nfa_endp = NULL; +--- 247,253 ---- + + static int nstate; /* Number of states in the NFA. Also used when + * executing. */ +! static int istate; /* Index in the state vector, used in alloc_state() */ + + /* If not NULL match must end at this position */ + static save_se_T *nfa_endp = NULL; +*************** +*** 268,274 **** + static void nfa_dump __ARGS((nfa_regprog_T *prog)); + #endif + static int *re2post __ARGS((void)); +! static nfa_state_T *new_state __ARGS((int c, nfa_state_T *out, nfa_state_T *out1)); + static nfa_state_T *post2nfa __ARGS((int *postfix, int *end, int nfa_calc_size)); + static int check_char_class __ARGS((int class, int c)); + static void st_error __ARGS((int *postfix, int *end, int *p)); +--- 268,274 ---- + static void nfa_dump __ARGS((nfa_regprog_T *prog)); + #endif + static int *re2post __ARGS((void)); +! static nfa_state_T *alloc_state __ARGS((int c, nfa_state_T *out, nfa_state_T *out1)); + static nfa_state_T *post2nfa __ARGS((int *postfix, int *end, int nfa_calc_size)); + static int check_char_class __ARGS((int class, int c)); + static void st_error __ARGS((int *postfix, int *end, int *p)); +*************** +*** 2134,2140 **** + * Allocate and initialize nfa_state_T. + */ + static nfa_state_T * +! new_state(c, out, out1) + int c; + nfa_state_T *out; + nfa_state_T *out1; +--- 2134,2140 ---- + * Allocate and initialize nfa_state_T. + */ + static nfa_state_T * +! alloc_state(c, out, out1) + int c; + nfa_state_T *out; + nfa_state_T *out1; +*************** +*** 2431,2437 **** + } + e2 = POP(); + e1 = POP(); +! s = new_state(NFA_SPLIT, e1.start, e2.start); + if (s == NULL) + goto theend; + PUSH(frag(s, append(e1.out, e2.out))); +--- 2431,2437 ---- + } + e2 = POP(); + e1 = POP(); +! s = alloc_state(NFA_SPLIT, e1.start, e2.start); + if (s == NULL) + goto theend; + PUSH(frag(s, append(e1.out, e2.out))); +*************** +*** 2445,2451 **** + break; + } + e = POP(); +! s = new_state(NFA_SPLIT, e.start, NULL); + if (s == NULL) + goto theend; + patch(e.out, s); +--- 2445,2451 ---- + break; + } + e = POP(); +! s = alloc_state(NFA_SPLIT, e.start, NULL); + if (s == NULL) + goto theend; + patch(e.out, s); +*************** +*** 2460,2466 **** + break; + } + e = POP(); +! s = new_state(NFA_SPLIT, NULL, e.start); + if (s == NULL) + goto theend; + patch(e.out, s); +--- 2460,2466 ---- + break; + } + e = POP(); +! s = alloc_state(NFA_SPLIT, NULL, e.start); + if (s == NULL) + goto theend; + patch(e.out, s); +*************** +*** 2475,2481 **** + break; + } + e = POP(); +! s = new_state(NFA_SPLIT, e.start, NULL); + if (s == NULL) + goto theend; + PUSH(frag(s, append(e.out, list1(&s->out1)))); +--- 2475,2481 ---- + break; + } + e = POP(); +! s = alloc_state(NFA_SPLIT, e.start, NULL); + if (s == NULL) + goto theend; + PUSH(frag(s, append(e.out, list1(&s->out1)))); +*************** +*** 2489,2495 **** + break; + } + e = POP(); +! s = new_state(NFA_SPLIT, NULL, e.start); + if (s == NULL) + goto theend; + PUSH(frag(s, append(e.out, list1(&s->out)))); +--- 2489,2495 ---- + break; + } + e = POP(); +! s = alloc_state(NFA_SPLIT, NULL, e.start); + if (s == NULL) + goto theend; + PUSH(frag(s, append(e.out, list1(&s->out)))); +*************** +*** 2503,2509 **** + nstate++; + break; + } +! s = new_state(NFA_SKIP_CHAR, NULL, NULL); + if (s == NULL) + goto theend; + PUSH(frag(s, list1(&s->out))); +--- 2503,2509 ---- + nstate++; + break; + } +! s = alloc_state(NFA_SKIP_CHAR, NULL, NULL); + if (s == NULL) + goto theend; + PUSH(frag(s, list1(&s->out))); +*************** +*** 2526,2537 **** + break; + } + e = POP(); +! s1 = new_state(NFA_END_INVISIBLE, NULL, NULL); + if (s1 == NULL) + goto theend; + patch(e.out, s1); + +! s = new_state(NFA_START_INVISIBLE, e.start, s1); + if (s == NULL) + goto theend; + if (*p == NFA_PREV_ATOM_NO_WIDTH_NEG +--- 2526,2537 ---- + break; + } + e = POP(); +! s1 = alloc_state(NFA_END_INVISIBLE, NULL, NULL); + if (s1 == NULL) + goto theend; + patch(e.out, s1); + +! s = alloc_state(NFA_START_INVISIBLE, e.start, s1); + if (s == NULL) + goto theend; + if (*p == NFA_PREV_ATOM_NO_WIDTH_NEG +*************** +*** 2622,2631 **** + * empty groups of parenthesis, and empty mbyte chars */ + if (stackp == stack) + { +! s = new_state(mopen, NULL, NULL); + if (s == NULL) + goto theend; +! s1 = new_state(mclose, NULL, NULL); + if (s1 == NULL) + goto theend; + patch(list1(&s->out), s1); +--- 2622,2631 ---- + * empty groups of parenthesis, and empty mbyte chars */ + if (stackp == stack) + { +! s = alloc_state(mopen, NULL, NULL); + if (s == NULL) + goto theend; +! s1 = alloc_state(mclose, NULL, NULL); + if (s1 == NULL) + goto theend; + patch(list1(&s->out), s1); +*************** +*** 2636,2646 **** + /* At least one node was emitted before NFA_MOPEN, so + * at least one node will be between NFA_MOPEN and NFA_MCLOSE */ + e = POP(); +! s = new_state(mopen, e.start, NULL); /* `(' */ + if (s == NULL) + goto theend; + +! s1 = new_state(mclose, NULL, NULL); /* `)' */ + if (s1 == NULL) + goto theend; + patch(e.out, s1); +--- 2636,2646 ---- + /* At least one node was emitted before NFA_MOPEN, so + * at least one node will be between NFA_MOPEN and NFA_MCLOSE */ + e = POP(); +! s = alloc_state(mopen, e.start, NULL); /* `(' */ + if (s == NULL) + goto theend; + +! s1 = alloc_state(mclose, NULL, NULL); /* `)' */ + if (s1 == NULL) + goto theend; + patch(e.out, s1); +*************** +*** 2679,2688 **** + nstate += 2; + break; + } +! s = new_state(*p, NULL, NULL); + if (s == NULL) + goto theend; +! s1 = new_state(NFA_SKIP, NULL, NULL); + if (s1 == NULL) + goto theend; + patch(list1(&s->out), s1); +--- 2679,2688 ---- + nstate += 2; + break; + } +! s = alloc_state(*p, NULL, NULL); + if (s == NULL) + goto theend; +! s1 = alloc_state(NFA_SKIP, NULL, NULL); + if (s1 == NULL) + goto theend; + patch(list1(&s->out), s1); +*************** +*** 2704,2710 **** + break; + } + e1 = POP(); +! s = new_state(*p, NULL, NULL); + if (s == NULL) + goto theend; + s->val = e1.start->c; +--- 2704,2710 ---- + break; + } + e1 = POP(); +! s = alloc_state(*p, NULL, NULL); + if (s == NULL) + goto theend; + s->val = e1.start->c; +*************** +*** 2720,2726 **** + nstate++; + break; + } +! s = new_state(*p, NULL, NULL); + if (s == NULL) + goto theend; + PUSH(frag(s, list1(&s->out))); +--- 2720,2726 ---- + nstate++; + break; + } +! s = alloc_state(*p, NULL, NULL); + if (s == NULL) + goto theend; + PUSH(frag(s, list1(&s->out))); +*************** +*** 4742,4749 **** + + if (prog->reghasz == REX_SET) + { +- int i; +- + cleanup_zsubexpr(); + re_extmatch_out = make_extmatch(); + for (i = 0; i < subs.synt.in_use; i++) +--- 4742,4747 ---- +*** ../vim-7.3.1094/src/version.c 2013-06-02 16:34:14.000000000 +0200 +--- src/version.c 2013-06-02 16:39:59.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1095, + /**/ + +-- +Microsoft is to software what McDonalds is to gourmet cooking + + /// 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 /// diff --git a/7.3.1096 b/7.3.1096 new file mode 100644 index 0000000..bc64eed --- /dev/null +++ b/7.3.1096 @@ -0,0 +1,333 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1096 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1096 +Problem: Python: popitem() was not defined in a standard way. +Solution: Remove the argument from popitem(). (ZyX) +Files: runtime/doc/if_pyth.txt, src/if_py_both.h, src/testdir/test86.in, + src/testdir/test86.ok, src/testdir/test87.in, + src/testdir/test87.ok + + +*** ../vim-7.3.1095/runtime/doc/if_pyth.txt 2013-05-30 13:32:26.000000000 +0200 +--- runtime/doc/if_pyth.txt 2013-06-02 17:39:35.000000000 +0200 +*************** +*** 174,180 **** + vim.bindeval(str) *python-bindeval* + Like |python-eval|, but returns special objects described in + |python-bindeval-objects|. These python objects let you modify (|List| +! or |Dictionary|) or call (|Funcref|) vim objecs. + + Error object of the "vim" module + +--- 174,180 ---- + vim.bindeval(str) *python-bindeval* + Like |python-eval|, but returns special objects described in + |python-bindeval-objects|. These python objects let you modify (|List| +! or |Dictionary|) or call (|Funcref|) vim objects. + + Error object of the "vim" module + +*************** +*** 208,214 **** + :py w in vim.windows # Membership test + :py n = len(vim.windows) # Number of elements + :py for w in vim.windows: # Sequential access +! < Note: vim.windows object always accesses current tab page,. + |python-tabpage|.windows objects are bound to parent |python-tabpage| + object and always use windows from that tab page (or throw vim.error + in case tab page was deleted). You can keep a reference to both +--- 208,214 ---- + :py w in vim.windows # Membership test + :py n = len(vim.windows) # Number of elements + :py for w in vim.windows: # Sequential access +! < Note: vim.windows object always accesses current tab page. + |python-tabpage|.windows objects are bound to parent |python-tabpage| + object and always use windows from that tab page (or throw vim.error + in case tab page was deleted). You can keep a reference to both +*************** +*** 494,503 **** + Remove specified key from dictionary and return + corresponding value. If key is not found and default is + given returns the default, otherwise raises KeyError. +! popitem(key) +! Remove specified key from dictionary and return a pair +! with it and the corresponding value. Returned key is a new +! object. + has_key(key) + Check whether dictionary contains specified key, similar + to `key in dict`. +--- 494,502 ---- + Remove specified key from dictionary and return + corresponding value. If key is not found and default is + given returns the default, otherwise raises KeyError. +! popitem() +! Remove random key from dictionary and return (key, value) +! pair. + has_key(key) + Check whether dictionary contains specified key, similar + to `key in dict`. +*** ../vim-7.3.1095/src/if_py_both.h 2013-05-31 20:49:27.000000000 +0200 +--- src/if_py_both.h 2013-06-02 17:39:35.000000000 +0200 +*************** +*** 1061,1077 **** + dictitem_free(di); + } + +- if (flags & DICT_FLAG_RETURN_PAIR) +- { +- PyObject *tmp = r; +- +- if (!(r = Py_BuildValue("(" Py_bytes_fmt "O)", hi->hi_key, tmp))) +- { +- Py_DECREF(tmp); +- return NULL; +- } +- } +- + return r; + } + +--- 1061,1066 ---- +*************** +*** 1457,1471 **** + } + + static PyObject * +! DictionaryPopItem(DictionaryObject *self, PyObject *args) + { +! PyObject *keyObject; + +! if (!PyArg_ParseTuple(args, "O", &keyObject)) + return NULL; + +! return _DictionaryItem(self, keyObject, +! DICT_FLAG_POP|DICT_FLAG_RETURN_PAIR); + } + + static PyObject * +--- 1446,1483 ---- + } + + static PyObject * +! DictionaryPopItem(DictionaryObject *self) + { +! hashitem_T *hi; +! PyObject *r; +! PyObject *valObject; +! dictitem_T *di; + +! if (self->dict->dv_hashtab.ht_used == 0) +! { +! PyErr_SetNone(PyExc_KeyError); +! return NULL; +! } +! +! hi = self->dict->dv_hashtab.ht_array; +! while (HASHITEM_EMPTY(hi)) +! ++hi; +! +! di = dict_lookup(hi); +! +! if (!(valObject = ConvertToPyObject(&di->di_tv))) + return NULL; + +! if (!(r = Py_BuildValue("(" Py_bytes_fmt "O)", hi->hi_key, valObject))) +! { +! Py_DECREF(valObject); +! return NULL; +! } +! +! hash_remove(&self->dict->dv_hashtab, hi); +! dictitem_free(di); +! +! return r; + } + + static PyObject * +*************** +*** 1505,1511 **** + {"update", (PyCFunction)DictionaryUpdate, METH_VARARGS|METH_KEYWORDS, ""}, + {"get", (PyCFunction)DictionaryGet, METH_VARARGS, ""}, + {"pop", (PyCFunction)DictionaryPop, METH_VARARGS, ""}, +! {"popitem", (PyCFunction)DictionaryPopItem, METH_VARARGS, ""}, + {"has_key", (PyCFunction)DictionaryHasKey, METH_VARARGS, ""}, + {"__dir__", (PyCFunction)DictionaryDir, METH_NOARGS, ""}, + { NULL, NULL, 0, NULL} +--- 1517,1523 ---- + {"update", (PyCFunction)DictionaryUpdate, METH_VARARGS|METH_KEYWORDS, ""}, + {"get", (PyCFunction)DictionaryGet, METH_VARARGS, ""}, + {"pop", (PyCFunction)DictionaryPop, METH_VARARGS, ""}, +! {"popitem", (PyCFunction)DictionaryPopItem, METH_NOARGS, ""}, + {"has_key", (PyCFunction)DictionaryHasKey, METH_VARARGS, ""}, + {"__dir__", (PyCFunction)DictionaryDir, METH_NOARGS, ""}, + { NULL, NULL, 0, NULL} +*** ../vim-7.3.1095/src/testdir/test86.in 2013-06-01 20:32:09.000000000 +0200 +--- src/testdir/test86.in 2013-06-02 17:39:35.000000000 +0200 +*************** +*** 83,89 **** + :$put =pyeval('repr(''1'' in d)') + :$put =pyeval('repr(list(iter(d)))') + :$put =string(d) +! :$put =pyeval('repr(d.popitem(''0''))') + :$put =pyeval('repr(d.get(''0''))') + :$put =pyeval('repr(list(iter(d)))') + :" +--- 83,89 ---- + :$put =pyeval('repr(''1'' in d)') + :$put =pyeval('repr(list(iter(d)))') + :$put =string(d) +! :$put =pyeval('repr(d.popitem())') + :$put =pyeval('repr(d.get(''0''))') + :$put =pyeval('repr(list(iter(d)))') + :" +*************** +*** 226,232 **** + em('d[u"a\\0b"]=1') + + em('d.pop("abc")') +! em('d.popitem("abc")') + EOF + :$put =messages + :unlet messages +--- 226,232 ---- + em('d[u"a\\0b"]=1') + + em('d.pop("abc")') +! em('d.popitem()') + EOF + :$put =messages + :unlet messages +*** ../vim-7.3.1095/src/testdir/test86.ok 2013-06-01 20:32:09.000000000 +0200 +--- src/testdir/test86.ok 2013-06-02 17:39:35.000000000 +0200 +*************** +*** 26,32 **** + False + ['0'] + {'0': -1} +! ('', -1L) + None + [] + [0, 1, 2, 3] +--- 26,32 ---- + False + ['0'] + {'0': -1} +! ('0', -1L) + None + [] + [0, 1, 2, 3] +*************** +*** 666,672 **** + d.update((("a", FailingMappingKey()),)):(, NotImplementedError()) + <<< Finished + >> DictionaryPopItem +! d.popitem(1, 2):(, TypeError('function takes exactly 1 argument (2 given)',)) + >> DictionaryHasKey + d.has_key():(, TypeError('function takes exactly 1 argument (0 given)',)) + > List +--- 666,672 ---- + d.update((("a", FailingMappingKey()),)):(, NotImplementedError()) + <<< Finished + >> DictionaryPopItem +! d.popitem(1, 2):(, TypeError('popitem() takes no arguments (2 given)',)) + >> DictionaryHasKey + d.has_key():(, TypeError('function takes exactly 1 argument (0 given)',)) + > List +*** ../vim-7.3.1095/src/testdir/test87.in 2013-06-01 20:32:09.000000000 +0200 +--- src/testdir/test87.in 2013-06-02 17:39:35.000000000 +0200 +*************** +*** 77,83 **** + :$put =py3eval('repr(''1'' in d)') + :$put =py3eval('repr(list(iter(d)))') + :$put =string(d) +! :$put =py3eval('repr(d.popitem(''0''))') + :$put =py3eval('repr(d.get(''0''))') + :$put =py3eval('repr(list(iter(d)))') + :" +--- 77,83 ---- + :$put =py3eval('repr(''1'' in d)') + :$put =py3eval('repr(list(iter(d)))') + :$put =string(d) +! :$put =py3eval('repr(d.popitem())') + :$put =py3eval('repr(d.get(''0''))') + :$put =py3eval('repr(list(iter(d)))') + :" +*************** +*** 220,226 **** + em('d[b"a\\0b"]=1') + + em('d.pop("abc")') +! em('d.popitem("abc")') + EOF + :$put =messages + :unlet messages +--- 220,226 ---- + em('d[b"a\\0b"]=1') + + em('d.pop("abc")') +! em('d.popitem()') + EOF + :$put =messages + :unlet messages +*** ../vim-7.3.1095/src/testdir/test87.ok 2013-06-01 20:32:09.000000000 +0200 +--- src/testdir/test87.ok 2013-06-02 17:39:35.000000000 +0200 +*************** +*** 26,32 **** + False + [b'0'] + {'0': -1} +! (b'', -1) + None + [] + [0, 1, 2, 3] +--- 26,32 ---- + False + [b'0'] + {'0': -1} +! (b'0', -1) + None + [] + [0, 1, 2, 3] +*************** +*** 663,669 **** + d.update((("a", FailingMappingKey()),)):(, NotImplementedError()) + <<< Finished + >> DictionaryPopItem +! d.popitem(1, 2):(, TypeError('function takes exactly 1 argument (2 given)',)) + >> DictionaryHasKey + d.has_key():(, TypeError('function takes exactly 1 argument (0 given)',)) + > List +--- 663,669 ---- + d.update((("a", FailingMappingKey()),)):(, NotImplementedError()) + <<< Finished + >> DictionaryPopItem +! d.popitem(1, 2):(, TypeError('popitem() takes no arguments (2 given)',)) + >> DictionaryHasKey + d.has_key():(, TypeError('function takes exactly 1 argument (0 given)',)) + > List +*** ../vim-7.3.1095/src/version.c 2013-06-02 16:40:44.000000000 +0200 +--- src/version.c 2013-06-02 17:40:20.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1096, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +44. Your friends no longer send you e-mail...they just log on to your IRC + channel. + + /// 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 /// diff --git a/7.3.1097 b/7.3.1097 new file mode 100644 index 0000000..5ded419 --- /dev/null +++ b/7.3.1097 @@ -0,0 +1,81 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1097 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1097 +Problem: Python: a few recently added items are not documented. +Solution: Update the documentation. (ZyX) +Files: runtime/doc/if_pyth.txt + + +*** ../vim-7.3.1096/runtime/doc/if_pyth.txt 2013-06-02 17:41:50.000000000 +0200 +--- runtime/doc/if_pyth.txt 2013-06-02 17:44:29.000000000 +0200 +*************** +*** 176,181 **** +--- 176,185 ---- + |python-bindeval-objects|. These python objects let you modify (|List| + or |Dictionary|) or call (|Funcref|) vim objects. + ++ vim.strwidth(str) *python-strwidth* ++ Like |strwidth()|: returns number of display cells str occupies, tab ++ is counted as one cell. ++ + Error object of the "vim" module + + vim.error *python-error* +*************** +*** 329,334 **** +--- 333,340 ---- + |BufFilePost| autocommands are launched. + b.number Buffer number. Can be used as |python-buffers| key. + Read-only. ++ b.valid True or False. Buffer object becames invalid when ++ corresponding buffer is wiped out. + + The buffer object methods are: + b.append(str) Append a line to the buffer +*************** +*** 433,438 **** +--- 439,446 ---- + row, col (read-only) On-screen window position in display cells. + First position is zero. + tabpage (read-only) Window tab page. ++ valid (read-write) True or False. Window object becames invalid ++ when corresponding window is closed. + + The height attribute is writable only if the screen is split horizontally. + The width attribute is writable only if the screen is split vertically. +*************** +*** 456,461 **** +--- 464,471 ---- + windows Like |python-windows|, but for current tab page. + vars The tab page |t:| variables. + window Current tabpage window. ++ valid True or False. Tab page object becames invalid when ++ corresponding tab page is closed. + + TabPage object type is available using "TabPage" attribute of vim module. + +*** ../vim-7.3.1096/src/version.c 2013-06-02 17:41:50.000000000 +0200 +--- src/version.c 2013-06-02 17:44:06.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1097, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +45. You buy a Captain Kirk chair with a built-in keyboard and mouse. + + /// 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 /// diff --git a/7.3.1098 b/7.3.1098 new file mode 100644 index 0000000..f0f4548 --- /dev/null +++ b/7.3.1098 @@ -0,0 +1,103 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1098 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1098 +Problem: Python: Possible memory leaks +Solution: Add Py_XDECREF() calls. (ZyX) +Files: src/if_py_both.h + + +*** ../vim-7.3.1097/src/if_py_both.h 2013-06-02 17:41:50.000000000 +0200 +--- src/if_py_both.h 2013-06-02 18:01:56.000000000 +0200 +*************** +*** 1017,1022 **** +--- 1017,1023 ---- + if (*key == NUL) + { + RAISE_NO_EMPTY_KEYS; ++ Py_XDECREF(todecref); + return NULL; + } + +*************** +*** 1160,1165 **** +--- 1161,1167 ---- + + if (!(key = StringToChars(keyObject, &todecref))) + return -1; ++ + if (*key == NUL) + { + RAISE_NO_EMPTY_KEYS; +*************** +*** 2216,2224 **** +--- 2218,2228 ---- + + if (!(key = StringToChars(keyObject, &todecref))) + return NULL; ++ + if (*key == NUL) + { + RAISE_NO_EMPTY_KEYS; ++ Py_XDECREF(todecref); + return NULL; + } + +*************** +*** 2349,2357 **** +--- 2353,2363 ---- + + if (!(key = StringToChars(keyObject, &todecref))) + return -1; ++ + if (*key == NUL) + { + RAISE_NO_EMPTY_KEYS; ++ Py_XDECREF(todecref); + return -1; + } + +*************** +*** 4568,4573 **** +--- 4574,4580 ---- + dict_unref(dict); + return -1; + } ++ + if (*key == NUL) + { + dict_unref(dict); +*************** +*** 4651,4656 **** +--- 4658,4664 ---- + dict_unref(dict); + return -1; + } ++ + if (*key == NUL) + { + Py_DECREF(keyObject); +*** ../vim-7.3.1097/src/version.c 2013-06-02 17:46:37.000000000 +0200 +--- src/version.c 2013-06-02 18:02:37.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1098, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +47. You are so familiar with the WWW that you find the search engines useless. + + /// 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 /// diff --git a/7.3.1099 b/7.3.1099 new file mode 100644 index 0000000..90e7db3 --- /dev/null +++ b/7.3.1099 @@ -0,0 +1,505 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1099 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1099 +Problem: Python: Changing directory with os.chdir() causes problems for + Vim's notion of directories. +Solution: Add vim.chdir() and vim.fchdir(). (ZyX) +Files: runtime/doc/if_pyth.txt, src/ex_docmd.c, src/if_py_both.h, + src/if_python3.c, src/if_python.c, src/proto/ex_docmd.pro, + src/testdir/test86.in, src/testdir/test86.ok, + src/testdir/test87.in, src/testdir/test87.ok + + +*** ../vim-7.3.1098/runtime/doc/if_pyth.txt 2013-06-02 17:46:37.000000000 +0200 +--- runtime/doc/if_pyth.txt 2013-06-02 18:11:13.000000000 +0200 +*************** +*** 180,185 **** +--- 180,192 ---- + Like |strwidth()|: returns number of display cells str occupies, tab + is counted as one cell. + ++ vim.chdir(*args, **kwargs) *python-chdir* ++ vim.fchdir(*args, **kwargs) *python-fchdir* ++ Run os.chdir or os.fchdir, then all appropriate vim stuff. ++ Note: you should not use these functions directly, use os.chdir and ++ os.fchdir instead. Behavior of vim.fchdir is undefined in case ++ os.fchdir does not exist. ++ + Error object of the "vim" module + + vim.error *python-error* +*** ../vim-7.3.1098/src/ex_docmd.c 2013-05-17 16:39:59.000000000 +0200 +--- src/ex_docmd.c 2013-06-02 18:20:05.000000000 +0200 +*************** +*** 8182,8187 **** +--- 8182,8218 ---- + } + #endif + ++ /* ++ * Deal with the side effects of changing the current directory. ++ * When "local" is TRUE then this was after an ":lcd" command. ++ */ ++ void ++ post_chdir(local) ++ int local; ++ { ++ vim_free(curwin->w_localdir); ++ if (local) ++ { ++ /* If still in global directory, need to remember current ++ * directory as global directory. */ ++ if (globaldir == NULL && prev_dir != NULL) ++ globaldir = vim_strsave(prev_dir); ++ /* Remember this local directory for the window. */ ++ if (mch_dirname(NameBuff, MAXPATHL) == OK) ++ curwin->w_localdir = vim_strsave(NameBuff); ++ } ++ else ++ { ++ /* We are now in the global directory, no need to remember its ++ * name. */ ++ vim_free(globaldir); ++ globaldir = NULL; ++ curwin->w_localdir = NULL; ++ } ++ ++ shorten_fnames(TRUE); ++ } ++ + + /* + * ":cd", ":lcd", ":chdir" and ":lchdir". +*************** +*** 8253,8279 **** + EMSG(_(e_failed)); + else + { +! vim_free(curwin->w_localdir); +! if (eap->cmdidx == CMD_lcd || eap->cmdidx == CMD_lchdir) +! { +! /* If still in global directory, need to remember current +! * directory as global directory. */ +! if (globaldir == NULL && prev_dir != NULL) +! globaldir = vim_strsave(prev_dir); +! /* Remember this local directory for the window. */ +! if (mch_dirname(NameBuff, MAXPATHL) == OK) +! curwin->w_localdir = vim_strsave(NameBuff); +! } +! else +! { +! /* We are now in the global directory, no need to remember its +! * name. */ +! vim_free(globaldir); +! globaldir = NULL; +! curwin->w_localdir = NULL; +! } +! +! shorten_fnames(TRUE); + + /* Echo the new current directory if the command was typed. */ + if (KeyTyped || p_verbose >= 5) +--- 8284,8290 ---- + EMSG(_(e_failed)); + else + { +! post_chdir(eap->cmdidx == CMD_lcd || eap->cmdidx == CMD_lchdir); + + /* Echo the new current directory if the command was typed. */ + if (KeyTyped || p_verbose >= 5) +*** ../vim-7.3.1098/src/if_py_both.h 2013-06-02 18:07:33.000000000 +0200 +--- src/if_py_both.h 2013-06-02 18:11:13.000000000 +0200 +*************** +*** 52,57 **** +--- 52,61 ---- + + static PyObject *globals; + ++ static PyObject *py_chdir; ++ static PyObject *py_fchdir; ++ static PyObject *py_getcwd; ++ + /* + * obtain a lock on the Vim data structures + */ +*************** +*** 706,722 **** + ); + } + + /* + * Vim module - Definitions + */ + + static struct PyMethodDef VimMethods[] = { +! /* name, function, calling, documentation */ +! {"command", VimCommand, METH_VARARGS, "Execute a Vim ex-mode command" }, +! {"eval", VimEval, METH_VARARGS, "Evaluate an expression using Vim evaluator" }, +! {"bindeval", VimEvalPy, METH_VARARGS, "Like eval(), but returns objects attached to vim ones"}, +! {"strwidth", VimStrwidth, METH_VARARGS, "Screen string width, counts as having width 1"}, +! { NULL, NULL, 0, NULL } + }; + + /* +--- 710,793 ---- + ); + } + ++ static PyObject * ++ _VimChdir(PyObject *_chdir, PyObject *args, PyObject *kwargs) ++ { ++ PyObject *r; ++ PyObject *newwd; ++ PyObject *todecref; ++ char_u *new_dir; ++ ++ if (!(r = PyObject_Call(_chdir, args, kwargs))) ++ return NULL; ++ ++ if (!(newwd = PyObject_CallFunctionObjArgs(py_getcwd, NULL))) ++ { ++ Py_DECREF(r); ++ return NULL; ++ } ++ ++ if (!(new_dir = StringToChars(newwd, &todecref))) ++ { ++ Py_DECREF(r); ++ Py_DECREF(newwd); ++ return NULL; ++ } ++ ++ VimTryStart(); ++ ++ if (vim_chdir(new_dir)) ++ { ++ Py_DECREF(r); ++ Py_DECREF(newwd); ++ Py_XDECREF(todecref); ++ ++ if (VimTryEnd()) ++ return NULL; ++ ++ PyErr_SetVim(_("failed to change directory")); ++ return NULL; ++ } ++ ++ Py_DECREF(newwd); ++ Py_XDECREF(todecref); ++ ++ post_chdir(FALSE); ++ ++ if (VimTryEnd()) ++ { ++ Py_DECREF(r); ++ return NULL; ++ } ++ ++ return r; ++ } ++ ++ static PyObject * ++ VimChdir(PyObject *self UNUSED, PyObject *args, PyObject *kwargs) ++ { ++ return _VimChdir(py_chdir, args, kwargs); ++ } ++ ++ static PyObject * ++ VimFchdir(PyObject *self UNUSED, PyObject *args, PyObject *kwargs) ++ { ++ return _VimChdir(py_fchdir, args, kwargs); ++ } ++ + /* + * Vim module - Definitions + */ + + static struct PyMethodDef VimMethods[] = { +! /* name, function, calling, documentation */ +! {"command", VimCommand, METH_VARARGS, "Execute a Vim ex-mode command" }, +! {"eval", VimEval, METH_VARARGS, "Evaluate an expression using Vim evaluator" }, +! {"bindeval", VimEvalPy, METH_VARARGS, "Like eval(), but returns objects attached to vim ones"}, +! {"strwidth", VimStrwidth, METH_VARARGS, "Screen string width, counts as having width 1"}, +! {"chdir", (PyCFunction)VimChdir, METH_VARARGS|METH_KEYWORDS, "Change directory"}, +! {"fchdir", (PyCFunction)VimFchdir, METH_VARARGS|METH_KEYWORDS, "Change directory"}, +! { NULL, NULL, 0, NULL } + }; + + /* +*************** +*** 5274,5279 **** +--- 5345,5351 ---- + }; + + typedef int (*object_adder)(PyObject *, const char *, PyObject *); ++ typedef PyObject *(*attr_getter)(PyObject *, const char *); + + #define ADD_OBJECT(m, name, obj) \ + if (add_object(m, name, obj)) \ +*************** +*** 5288,5296 **** + } + + static int +! populate_module(PyObject *m, object_adder add_object) + { + int i; + + for (i = 0; i < (int)(sizeof(numeric_constants) + / sizeof(struct numeric_constant)); +--- 5360,5369 ---- + } + + static int +! populate_module(PyObject *m, object_adder add_object, attr_getter get_attr) + { + int i; ++ PyObject *os; + + for (i = 0; i < (int)(sizeof(numeric_constants) + / sizeof(struct numeric_constant)); +*************** +*** 5317,5321 **** +--- 5390,5416 ---- + ADD_CHECKED_OBJECT(m, "vvars", NEW_DICTIONARY(&vimvardict)); + ADD_CHECKED_OBJECT(m, "options", + OptionsNew(SREQ_GLOBAL, NULL, dummy_check, NULL)); ++ ++ if (!(os = PyImport_ImportModule("os"))) ++ return -1; ++ ADD_OBJECT(m, "os", os); ++ ++ if (!(py_getcwd = PyObject_GetAttrString(os, "getcwd"))) ++ return -1; ++ ADD_OBJECT(m, "_getcwd", py_getcwd) ++ ++ if (!(py_chdir = PyObject_GetAttrString(os, "chdir"))) ++ return -1; ++ ADD_OBJECT(m, "_chdir", py_chdir); ++ if (PyObject_SetAttrString(os, "chdir", get_attr(m, "chdir"))) ++ return -1; ++ ++ if ((py_fchdir = PyObject_GetAttrString(os, "fchdir"))) ++ { ++ ADD_OBJECT(m, "_fchdir", py_fchdir); ++ if (PyObject_SetAttrString(os, "fchdir", get_attr(m, "fchdir"))) ++ return -1; ++ } ++ + return 0; + } +*** ../vim-7.3.1098/src/if_python3.c 2013-05-30 13:22:07.000000000 +0200 +--- src/if_python3.c 2013-06-02 18:14:51.000000000 +0200 +*************** +*** 174,179 **** +--- 174,180 ---- + # define PyObject_HasAttrString py3_PyObject_HasAttrString + # define PyObject_SetAttrString py3_PyObject_SetAttrString + # define PyObject_CallFunctionObjArgs py3_PyObject_CallFunctionObjArgs ++ # define PyObject_Call py3_PyObject_Call + # define PyEval_GetLocals py3_PyEval_GetLocals + # define PyEval_GetGlobals py3_PyEval_GetGlobals + # define PySys_SetObject py3_PySys_SetObject +*************** +*** 290,295 **** +--- 291,297 ---- + static int (*py3_PyObject_HasAttrString)(PyObject *, const char *); + static PyObject* (*py3_PyObject_SetAttrString)(PyObject *, const char *, PyObject *); + static PyObject* (*py3_PyObject_CallFunctionObjArgs)(PyObject *, ...); ++ static PyObject* (*py3_PyObject_Call)(PyObject *, PyObject *, PyObject *); + static PyObject* (*py3_PyEval_GetGlobals)(); + static PyObject* (*py3_PyEval_GetLocals)(); + static PyObject* (*py3_PyList_GetItem)(PyObject *, Py_ssize_t); +*************** +*** 446,451 **** +--- 448,454 ---- + {"PyObject_HasAttrString", (PYTHON_PROC*)&py3_PyObject_HasAttrString}, + {"PyObject_SetAttrString", (PYTHON_PROC*)&py3_PyObject_SetAttrString}, + {"PyObject_CallFunctionObjArgs", (PYTHON_PROC*)&py3_PyObject_CallFunctionObjArgs}, ++ {"PyObject_Call", (PYTHON_PROC*)&py3_PyObject_Call}, + {"PyEval_GetGlobals", (PYTHON_PROC*)&py3_PyEval_GetGlobals}, + {"PyEval_GetLocals", (PYTHON_PROC*)&py3_PyEval_GetLocals}, + {"PyList_GetItem", (PYTHON_PROC*)&py3_PyList_GetItem}, +*************** +*** 1600,1606 **** + if (mod == NULL) + return NULL; + +! if (populate_module(mod, PyModule_AddObject)) + return NULL; + + return mod; +--- 1603,1609 ---- + if (mod == NULL) + return NULL; + +! if (populate_module(mod, PyModule_AddObject, PyObject_GetAttrString)) + return NULL; + + return mod; +*** ../vim-7.3.1098/src/if_python.c 2013-05-30 15:38:20.000000000 +0200 +--- src/if_python.c 2013-06-02 18:14:46.000000000 +0200 +*************** +*** 213,218 **** +--- 213,219 ---- + # define PyObject_HasAttrString dll_PyObject_HasAttrString + # define PyObject_SetAttrString dll_PyObject_SetAttrString + # define PyObject_CallFunctionObjArgs dll_PyObject_CallFunctionObjArgs ++ # define PyObject_Call dll_PyObject_Call + # define PyString_AsString dll_PyString_AsString + # define PyString_AsStringAndSize dll_PyString_AsStringAndSize + # define PyString_FromString dll_PyString_FromString +*************** +*** 346,351 **** +--- 347,353 ---- + static int (*dll_PyObject_HasAttrString)(PyObject *, const char *); + static PyObject* (*dll_PyObject_SetAttrString)(PyObject *, const char *, PyObject *); + static PyObject* (*dll_PyObject_CallFunctionObjArgs)(PyObject *, ...); ++ static PyObject* (*dll_PyObject_Call)(PyObject *, PyObject *, PyObject *); + static char*(*dll_PyString_AsString)(PyObject *); + static int(*dll_PyString_AsStringAndSize)(PyObject *, char **, int *); + static PyObject*(*dll_PyString_FromString)(const char *); +*************** +*** 510,515 **** +--- 512,518 ---- + {"PyObject_HasAttrString", (PYTHON_PROC*)&dll_PyObject_HasAttrString}, + {"PyObject_SetAttrString", (PYTHON_PROC*)&dll_PyObject_SetAttrString}, + {"PyObject_CallFunctionObjArgs", (PYTHON_PROC*)&dll_PyObject_CallFunctionObjArgs}, ++ {"PyObject_Call", (PYTHON_PROC*)&dll_PyObject_Call}, + {"PyString_AsString", (PYTHON_PROC*)&dll_PyString_AsString}, + {"PyString_AsStringAndSize", (PYTHON_PROC*)&dll_PyString_AsStringAndSize}, + {"PyString_FromString", (PYTHON_PROC*)&dll_PyString_FromString}, +*************** +*** 1374,1383 **** + /* Set sys.argv[] to avoid a crash in warn(). */ + PySys_SetArgv(1, argv); + +! mod = Py_InitModule4("vim", VimMethods, (char *)NULL, (PyObject *)NULL, PYTHON_API_VERSION); + dict = PyModule_GetDict(mod); + +! return populate_module(dict, add_object); + } + + /************************************************************************* +--- 1377,1387 ---- + /* Set sys.argv[] to avoid a crash in warn(). */ + PySys_SetArgv(1, argv); + +! mod = Py_InitModule4("vim", VimMethods, (char *)NULL, (PyObject *)NULL, +! PYTHON_API_VERSION); + dict = PyModule_GetDict(mod); + +! return populate_module(dict, add_object, PyDict_GetItemString); + } + + /************************************************************************* +*** ../vim-7.3.1098/src/proto/ex_docmd.pro 2012-02-04 21:57:44.000000000 +0100 +--- src/proto/ex_docmd.pro 2013-06-02 18:11:13.000000000 +0200 +*************** +*** 53,56 **** +--- 53,57 ---- + int put_line __ARGS((FILE *fd, char *s)); + void dialog_msg __ARGS((char_u *buff, char *format, char_u *fname)); + char_u *get_behave_arg __ARGS((expand_T *xp, int idx)); ++ void post_chdir __ARGS((int local)); + /* vim: set ft=c : */ +*** ../vim-7.3.1098/src/testdir/test86.in 2013-06-02 17:41:50.000000000 +0200 +--- src/testdir/test86.in 2013-06-02 18:11:13.000000000 +0200 +*************** +*** 788,793 **** +--- 788,807 ---- + :$put =string(pyeval('dl2')) + :$put =string(pyeval('df(2)')) + :" ++ :" Test chdir ++ py << EOF ++ import os ++ fnamemodify = vim.Function('fnamemodify') ++ cb.append(fnamemodify('.', ':p:h:t')) ++ cb.append(vim.eval('@%')) ++ os.chdir('..') ++ cb.append(fnamemodify('.', ':p:h:t')) ++ cb.append(vim.eval('@%').replace(os.path.sep, '/')) ++ os.chdir('testdir') ++ cb.append(fnamemodify('.', ':p:h:t')) ++ cb.append(vim.eval('@%')) ++ EOF ++ :" + :" Test errors + :fun F() dict + :endfun +*** ../vim-7.3.1098/src/testdir/test86.ok 2013-06-02 17:41:50.000000000 +0200 +--- src/testdir/test86.ok 2013-06-02 18:11:13.000000000 +0200 +*************** +*** 429,434 **** +--- 429,440 ---- + ['a', 'b', 'c'] + [2, 2] + [2, 2] ++ testdir ++ test86.in ++ src ++ testdir/test86.in ++ testdir ++ test86.in + > Output + >> OutputSetattr + del sys.stdout.softspace:(, AttributeError("can't delete OutputObject attributes",)) +*** ../vim-7.3.1098/src/testdir/test87.in 2013-06-02 17:41:50.000000000 +0200 +--- src/testdir/test87.in 2013-06-02 18:11:13.000000000 +0200 +*************** +*** 748,753 **** +--- 748,767 ---- + :$put =string(py3eval('dl2')) + :$put =string(py3eval('df(2)')) + :" ++ :" Test chdir ++ py3 << EOF ++ import os ++ fnamemodify = vim.Function('fnamemodify') ++ cb.append(str(fnamemodify('.', ':p:h:t'))) ++ cb.append(vim.eval('@%')) ++ os.chdir('..') ++ cb.append(str(fnamemodify('.', ':p:h:t'))) ++ cb.append(vim.eval('@%').replace(os.path.sep, '/')) ++ os.chdir('testdir') ++ cb.append(str(fnamemodify('.', ':p:h:t'))) ++ cb.append(vim.eval('@%')) ++ EOF ++ :" + :" Test errors + :fun F() dict + :endfun +*** ../vim-7.3.1098/src/testdir/test87.ok 2013-06-02 17:41:50.000000000 +0200 +--- src/testdir/test87.ok 2013-06-02 18:11:13.000000000 +0200 +*************** +*** 418,423 **** +--- 418,429 ---- + ['a', 'b', 'c'] + [2, 2] + [2, 2] ++ b'testdir' ++ test87.in ++ b'src' ++ testdir/test87.in ++ b'testdir' ++ test87.in + > Output + >> OutputSetattr + del sys.stdout.softspace:(, AttributeError("can't delete OutputObject attributes",)) +*** ../vim-7.3.1098/src/version.c 2013-06-02 18:07:33.000000000 +0200 +--- src/version.c 2013-06-02 18:12:58.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1099, + /**/ diff --git a/7.3.1100 b/7.3.1100 new file mode 100644 index 0000000..15a556e --- /dev/null +++ b/7.3.1100 @@ -0,0 +1,595 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1100 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1100 +Problem: Python: a few more memory problems. +Solution: Add and remove Py_XDECREF(). (ZyX) +Files: src/if_py_both.h, src/testdir/test86.in, src/testdir/test86.ok, + src/testdir/test87.in, src/testdir/test87.ok + + +*** ../vim-7.3.1099/src/if_py_both.h 2013-06-02 18:20:12.000000000 +0200 +--- src/if_py_both.h 2013-06-02 18:41:12.000000000 +0200 +*************** +*** 1236,1241 **** +--- 1236,1242 ---- + if (*key == NUL) + { + RAISE_NO_EMPTY_KEYS; ++ Py_XDECREF(todecref); + return -1; + } + +*************** +*** 1254,1264 **** +--- 1255,1269 ---- + hi = hash_find(&dict->dv_hashtab, di->di_key); + hash_remove(&dict->dv_hashtab, hi); + dictitem_free(di); ++ Py_XDECREF(todecref); + return 0; + } + + if (ConvertFromPyObject(valObject, &tv) == -1) ++ { ++ Py_XDECREF(todecref); + return -1; ++ } + + if (di == NULL) + { +*************** +*** 2505,2515 **** + PyObject *todecref; + + if ((val = StringToChars(valObject, &todecref))) +- { + r = set_option_value_for(key, 0, val, opt_flags, + self->opt_type, self->from); +- Py_XDECREF(todecref); +- } + else + r = -1; + } +--- 2510,2517 ---- +*** ../vim-7.3.1099/src/testdir/test86.in 2013-06-02 18:20:12.000000000 +0200 +--- src/testdir/test86.in 2013-06-02 18:42:24.000000000 +0200 +*************** +*** 867,872 **** +--- 867,873 ---- + return subexpr_test(expr, 'ConvertFromPyObject', ( + 'None', # Not conversible + '{"": 1}', # Empty key not allowed ++ '{u"": 1}', # Same, but with unicode object + 'FailingMapping()', # + 'FailingMappingKey()', # + )) +*** ../vim-7.3.1099/src/testdir/test86.ok 2013-06-02 18:20:12.000000000 +0200 +--- src/testdir/test86.ok 2013-06-02 18:44:49.000000000 +0200 +*************** +*** 503,508 **** +--- 503,509 ---- + >>> Testing ConvertFromPyObject using d["a"] = {"abc" : %s} + d["a"] = {"abc" : None}:(, TypeError('unable to convert to vim structure',)) + d["a"] = {"abc" : {"": 1}}:(, ValueError('empty keys are not allowed',)) ++ d["a"] = {"abc" : {u"": 1}}:(, ValueError('empty keys are not allowed',)) + d["a"] = {"abc" : FailingMapping()}:(, NotImplementedError()) + d["a"] = {"abc" : FailingMappingKey()}:(, NotImplementedError()) + <<< Finished +*************** +*** 528,533 **** +--- 529,535 ---- + >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abc" : %s}) + d["a"] = Mapping({"abc" : None}):(, TypeError('unable to convert to vim structure',)) + d["a"] = Mapping({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) ++ d["a"] = Mapping({"abc" : {u"": 1}}):(, ValueError('empty keys are not allowed',)) + d["a"] = Mapping({"abc" : FailingMapping()}):(, NotImplementedError()) + d["a"] = Mapping({"abc" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished +*************** +*** 538,543 **** +--- 540,546 ---- + >>> Testing ConvertFromPyObject using d["a"] = %s + d["a"] = None:(, TypeError('unable to convert to vim structure',)) + d["a"] = {"": 1}:(, ValueError('empty keys are not allowed',)) ++ d["a"] = {u"": 1}:(, ValueError('empty keys are not allowed',)) + d["a"] = FailingMapping():(, NotImplementedError()) + d["a"] = FailingMappingKey():(, NotImplementedError()) + <<< Finished +*************** +*** 568,573 **** +--- 571,577 ---- + >>> Testing ConvertFromPyObject using d.update({"abc" : %s}) + d.update({"abc" : None}):(, TypeError('unable to convert to vim structure',)) + d.update({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) ++ d.update({"abc" : {u"": 1}}):(, ValueError('empty keys are not allowed',)) + d.update({"abc" : FailingMapping()}):(, NotImplementedError()) + d.update({"abc" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished +*************** +*** 593,598 **** +--- 597,603 ---- + >>> Testing ConvertFromPyObject using d.update(Mapping({"abc" : %s})) + d.update(Mapping({"abc" : None})):(, TypeError('unable to convert to vim structure',)) + d.update(Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) ++ d.update(Mapping({"abc" : {u"": 1}})):(, ValueError('empty keys are not allowed',)) + d.update(Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) + d.update(Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) + <<< Finished +*************** +*** 603,608 **** +--- 608,614 ---- + >>> Testing ConvertFromPyObject using d.update(%s) + d.update(None):(, TypeError("'NoneType' object is not iterable",)) + d.update({"": 1}):(, ValueError('empty keys are not allowed',)) ++ d.update({u"": 1}):(, ValueError('empty keys are not allowed',)) + d.update(FailingMapping()):(, NotImplementedError()) + d.update(FailingMappingKey()):(, NotImplementedError()) + <<< Finished +*************** +*** 633,638 **** +--- 639,645 ---- + >>> Testing ConvertFromPyObject using d.update((("a", {"abc" : %s}),)) + d.update((("a", {"abc" : None}),)):(, TypeError('unable to convert to vim structure',)) + d.update((("a", {"abc" : {"": 1}}),)):(, ValueError('empty keys are not allowed',)) ++ d.update((("a", {"abc" : {u"": 1}}),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", {"abc" : FailingMapping()}),)):(, NotImplementedError()) + d.update((("a", {"abc" : FailingMappingKey()}),)):(, NotImplementedError()) + <<< Finished +*************** +*** 658,663 **** +--- 665,671 ---- + >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abc" : %s})),)) + d.update((("a", Mapping({"abc" : None})),)):(, TypeError('unable to convert to vim structure',)) + d.update((("a", Mapping({"abc" : {"": 1}})),)):(, ValueError('empty keys are not allowed',)) ++ d.update((("a", Mapping({"abc" : {u"": 1}})),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", Mapping({"abc" : FailingMapping()})),)):(, NotImplementedError()) + d.update((("a", Mapping({"abc" : FailingMappingKey()})),)):(, NotImplementedError()) + <<< Finished +*************** +*** 668,673 **** +--- 676,682 ---- + >>> Testing ConvertFromPyObject using d.update((("a", %s),)) + d.update((("a", None),)):(, TypeError('unable to convert to vim structure',)) + d.update((("a", {"": 1}),)):(, ValueError('empty keys are not allowed',)) ++ d.update((("a", {u"": 1}),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", FailingMapping()),)):(, NotImplementedError()) + d.update((("a", FailingMappingKey()),)):(, NotImplementedError()) + <<< Finished +*************** +*** 701,706 **** +--- 710,716 ---- + >>> Testing ConvertFromPyObject using vim.List([{"abc" : %s}]) + vim.List([{"abc" : None}]):(, TypeError('unable to convert to vim structure',)) + vim.List([{"abc" : {"": 1}}]):(, ValueError('empty keys are not allowed',)) ++ vim.List([{"abc" : {u"": 1}}]):(, ValueError('empty keys are not allowed',)) + vim.List([{"abc" : FailingMapping()}]):(, NotImplementedError()) + vim.List([{"abc" : FailingMappingKey()}]):(, NotImplementedError()) + <<< Finished +*************** +*** 726,731 **** +--- 736,742 ---- + >>> Testing ConvertFromPyObject using vim.List([Mapping({"abc" : %s})]) + vim.List([Mapping({"abc" : None})]):(, TypeError('unable to convert to vim structure',)) + vim.List([Mapping({"abc" : {"": 1}})]):(, ValueError('empty keys are not allowed',)) ++ vim.List([Mapping({"abc" : {u"": 1}})]):(, ValueError('empty keys are not allowed',)) + vim.List([Mapping({"abc" : FailingMapping()})]):(, NotImplementedError()) + vim.List([Mapping({"abc" : FailingMappingKey()})]):(, NotImplementedError()) + <<< Finished +*************** +*** 736,741 **** +--- 747,753 ---- + >>> Testing ConvertFromPyObject using vim.List([%s]) + vim.List([None]):(, TypeError('unable to convert to vim structure',)) + vim.List([{"": 1}]):(, ValueError('empty keys are not allowed',)) ++ vim.List([{u"": 1}]):(, ValueError('empty keys are not allowed',)) + vim.List([FailingMapping()]):(, NotImplementedError()) + vim.List([FailingMappingKey()]):(, NotImplementedError()) + <<< Finished +*************** +*** 768,773 **** +--- 780,786 ---- + >>> Testing ConvertFromPyObject using l[:] = [{"abc" : %s}] + l[:] = [{"abc" : None}]:(, TypeError('unable to convert to vim structure',)) + l[:] = [{"abc" : {"": 1}}]:(, ValueError('empty keys are not allowed',)) ++ l[:] = [{"abc" : {u"": 1}}]:(, ValueError('empty keys are not allowed',)) + l[:] = [{"abc" : FailingMapping()}]:(, NotImplementedError()) + l[:] = [{"abc" : FailingMappingKey()}]:(, NotImplementedError()) + <<< Finished +*************** +*** 793,798 **** +--- 806,812 ---- + >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abc" : %s})] + l[:] = [Mapping({"abc" : None})]:(, TypeError('unable to convert to vim structure',)) + l[:] = [Mapping({"abc" : {"": 1}})]:(, ValueError('empty keys are not allowed',)) ++ l[:] = [Mapping({"abc" : {u"": 1}})]:(, ValueError('empty keys are not allowed',)) + l[:] = [Mapping({"abc" : FailingMapping()})]:(, NotImplementedError()) + l[:] = [Mapping({"abc" : FailingMappingKey()})]:(, NotImplementedError()) + <<< Finished +*************** +*** 803,808 **** +--- 817,823 ---- + >>> Testing ConvertFromPyObject using l[:] = [%s] + l[:] = [None]:(, TypeError('unable to convert to vim structure',)) + l[:] = [{"": 1}]:(, ValueError('empty keys are not allowed',)) ++ l[:] = [{u"": 1}]:(, ValueError('empty keys are not allowed',)) + l[:] = [FailingMapping()]:(, NotImplementedError()) + l[:] = [FailingMappingKey()]:(, NotImplementedError()) + <<< Finished +*************** +*** 829,834 **** +--- 844,850 ---- + >>> Testing ConvertFromPyObject using l.extend([{"abc" : %s}]) + l.extend([{"abc" : None}]):(, TypeError('unable to convert to vim structure',)) + l.extend([{"abc" : {"": 1}}]):(, ValueError('empty keys are not allowed',)) ++ l.extend([{"abc" : {u"": 1}}]):(, ValueError('empty keys are not allowed',)) + l.extend([{"abc" : FailingMapping()}]):(, NotImplementedError()) + l.extend([{"abc" : FailingMappingKey()}]):(, NotImplementedError()) + <<< Finished +*************** +*** 854,859 **** +--- 870,876 ---- + >>> Testing ConvertFromPyObject using l.extend([Mapping({"abc" : %s})]) + l.extend([Mapping({"abc" : None})]):(, TypeError('unable to convert to vim structure',)) + l.extend([Mapping({"abc" : {"": 1}})]):(, ValueError('empty keys are not allowed',)) ++ l.extend([Mapping({"abc" : {u"": 1}})]):(, ValueError('empty keys are not allowed',)) + l.extend([Mapping({"abc" : FailingMapping()})]):(, NotImplementedError()) + l.extend([Mapping({"abc" : FailingMappingKey()})]):(, NotImplementedError()) + <<< Finished +*************** +*** 864,869 **** +--- 881,887 ---- + >>> Testing ConvertFromPyObject using l.extend([%s]) + l.extend([None]):(, TypeError('unable to convert to vim structure',)) + l.extend([{"": 1}]):(, ValueError('empty keys are not allowed',)) ++ l.extend([{u"": 1}]):(, ValueError('empty keys are not allowed',)) + l.extend([FailingMapping()]):(, NotImplementedError()) + l.extend([FailingMappingKey()]):(, NotImplementedError()) + <<< Finished +*************** +*** 899,904 **** +--- 917,923 ---- + >>> Testing ConvertFromPyObject using f({"abc" : %s}) + f({"abc" : None}):(, TypeError('unable to convert to vim structure',)) + f({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) ++ f({"abc" : {u"": 1}}):(, ValueError('empty keys are not allowed',)) + f({"abc" : FailingMapping()}):(, NotImplementedError()) + f({"abc" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished +*************** +*** 924,929 **** +--- 943,949 ---- + >>> Testing ConvertFromPyObject using f(Mapping({"abc" : %s})) + f(Mapping({"abc" : None})):(, TypeError('unable to convert to vim structure',)) + f(Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) ++ f(Mapping({"abc" : {u"": 1}})):(, ValueError('empty keys are not allowed',)) + f(Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) + f(Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) + <<< Finished +*************** +*** 934,939 **** +--- 954,960 ---- + >>> Testing ConvertFromPyObject using f(%s) + f(None):(, TypeError('unable to convert to vim structure',)) + f({"": 1}):(, ValueError('empty keys are not allowed',)) ++ f({u"": 1}):(, ValueError('empty keys are not allowed',)) + f(FailingMapping()):(, NotImplementedError()) + f(FailingMappingKey()):(, NotImplementedError()) + <<< Finished +*************** +*** 959,964 **** +--- 980,986 ---- + >>> Testing ConvertFromPyObject using fd(self={"abc" : %s}) + fd(self={"abc" : None}):(, TypeError('unable to convert to vim structure',)) + fd(self={"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) ++ fd(self={"abc" : {u"": 1}}):(, ValueError('empty keys are not allowed',)) + fd(self={"abc" : FailingMapping()}):(, NotImplementedError()) + fd(self={"abc" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished +*************** +*** 984,989 **** +--- 1006,1012 ---- + >>> Testing ConvertFromPyObject using fd(self=Mapping({"abc" : %s})) + fd(self=Mapping({"abc" : None})):(, TypeError('unable to convert to vim structure',)) + fd(self=Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) ++ fd(self=Mapping({"abc" : {u"": 1}})):(, ValueError('empty keys are not allowed',)) + fd(self=Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) + fd(self=Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) + <<< Finished +*************** +*** 994,999 **** +--- 1017,1023 ---- + >>> Testing ConvertFromPyObject using fd(self=%s) + fd(self=None):(, TypeError('unable to convert object to vim dictionary',)) + fd(self={"": 1}):(, ValueError('empty keys are not allowed',)) ++ fd(self={u"": 1}):(, ValueError('empty keys are not allowed',)) + fd(self=FailingMapping()):(, NotImplementedError()) + fd(self=FailingMappingKey()):(, NotImplementedError()) + <<< Finished +*** ../vim-7.3.1099/src/testdir/test87.in 2013-06-02 18:20:12.000000000 +0200 +--- src/testdir/test87.in 2013-06-02 18:44:49.000000000 +0200 +*************** +*** 833,839 **** + iter_test(expr) + return subexpr_test(expr, 'ConvertFromPyObject', ( + 'None', # Not conversible +! '{"": 1}', # Empty key not allowed + 'FailingMapping()', # + 'FailingMappingKey()', # + )) +--- 833,840 ---- + iter_test(expr) + return subexpr_test(expr, 'ConvertFromPyObject', ( + 'None', # Not conversible +! '{b"": 1}', # Empty key not allowed +! '{"": 1}', # Same, but with unicode object + 'FailingMapping()', # + 'FailingMappingKey()', # + )) +*** ../vim-7.3.1099/src/testdir/test87.ok 2013-06-02 18:20:12.000000000 +0200 +--- src/testdir/test87.ok 2013-06-02 18:44:49.000000000 +0200 +*************** +*** 495,500 **** +--- 495,501 ---- + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = {"abc" : %s} + d["a"] = {"abc" : None}:(, TypeError('unable to convert to vim structure',)) ++ d["a"] = {"abc" : {b"": 1}}:(, ValueError('empty keys are not allowed',)) + d["a"] = {"abc" : {"": 1}}:(, ValueError('empty keys are not allowed',)) + d["a"] = {"abc" : FailingMapping()}:(, NotImplementedError()) + d["a"] = {"abc" : FailingMappingKey()}:(, NotImplementedError()) +*************** +*** 520,525 **** +--- 521,527 ---- + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abc" : %s}) + d["a"] = Mapping({"abc" : None}):(, TypeError('unable to convert to vim structure',)) ++ d["a"] = Mapping({"abc" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) + d["a"] = Mapping({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) + d["a"] = Mapping({"abc" : FailingMapping()}):(, NotImplementedError()) + d["a"] = Mapping({"abc" : FailingMappingKey()}):(, NotImplementedError()) +*************** +*** 530,535 **** +--- 532,538 ---- + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = %s + d["a"] = None:(, TypeError('unable to convert to vim structure',)) ++ d["a"] = {b"": 1}:(, ValueError('empty keys are not allowed',)) + d["a"] = {"": 1}:(, ValueError('empty keys are not allowed',)) + d["a"] = FailingMapping():(, NotImplementedError()) + d["a"] = FailingMappingKey():(, NotImplementedError()) +*************** +*** 564,569 **** +--- 567,573 ---- + <<< Finished + >>> Testing ConvertFromPyObject using d.update({"abc" : %s}) + d.update({"abc" : None}):(, TypeError('unable to convert to vim structure',)) ++ d.update({"abc" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) + d.update({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) + d.update({"abc" : FailingMapping()}):(, NotImplementedError()) + d.update({"abc" : FailingMappingKey()}):(, NotImplementedError()) +*************** +*** 589,594 **** +--- 593,599 ---- + <<< Finished + >>> Testing ConvertFromPyObject using d.update(Mapping({"abc" : %s})) + d.update(Mapping({"abc" : None})):(, TypeError('unable to convert to vim structure',)) ++ d.update(Mapping({"abc" : {b"": 1}})):(, ValueError('empty keys are not allowed',)) + d.update(Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) + d.update(Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) + d.update(Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) +*************** +*** 599,604 **** +--- 604,610 ---- + <<< Finished + >>> Testing ConvertFromPyObject using d.update(%s) + d.update(None):(, TypeError("'NoneType' object is not iterable",)) ++ d.update({b"": 1}):(, ValueError('empty keys are not allowed',)) + d.update({"": 1}):(, ValueError('empty keys are not allowed',)) + d.update(FailingMapping()):(, NotImplementedError()) + d.update(FailingMappingKey()):(, NotImplementedError()) +*************** +*** 629,634 **** +--- 635,641 ---- + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", {"abc" : %s}),)) + d.update((("a", {"abc" : None}),)):(, TypeError('unable to convert to vim structure',)) ++ d.update((("a", {"abc" : {b"": 1}}),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", {"abc" : {"": 1}}),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", {"abc" : FailingMapping()}),)):(, NotImplementedError()) + d.update((("a", {"abc" : FailingMappingKey()}),)):(, NotImplementedError()) +*************** +*** 654,659 **** +--- 661,667 ---- + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abc" : %s})),)) + d.update((("a", Mapping({"abc" : None})),)):(, TypeError('unable to convert to vim structure',)) ++ d.update((("a", Mapping({"abc" : {b"": 1}})),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", Mapping({"abc" : {"": 1}})),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", Mapping({"abc" : FailingMapping()})),)):(, NotImplementedError()) + d.update((("a", Mapping({"abc" : FailingMappingKey()})),)):(, NotImplementedError()) +*************** +*** 664,669 **** +--- 672,678 ---- + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", %s),)) + d.update((("a", None),)):(, TypeError('unable to convert to vim structure',)) ++ d.update((("a", {b"": 1}),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", {"": 1}),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", FailingMapping()),)):(, NotImplementedError()) + d.update((("a", FailingMappingKey()),)):(, NotImplementedError()) +*************** +*** 701,706 **** +--- 710,716 ---- + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([{"abc" : %s}]) + vim.List([{"abc" : None}]):(, TypeError('unable to convert to vim structure',)) ++ vim.List([{"abc" : {b"": 1}}]):(, ValueError('empty keys are not allowed',)) + vim.List([{"abc" : {"": 1}}]):(, ValueError('empty keys are not allowed',)) + vim.List([{"abc" : FailingMapping()}]):(, NotImplementedError()) + vim.List([{"abc" : FailingMappingKey()}]):(, NotImplementedError()) +*************** +*** 726,731 **** +--- 736,742 ---- + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([Mapping({"abc" : %s})]) + vim.List([Mapping({"abc" : None})]):(, TypeError('unable to convert to vim structure',)) ++ vim.List([Mapping({"abc" : {b"": 1}})]):(, ValueError('empty keys are not allowed',)) + vim.List([Mapping({"abc" : {"": 1}})]):(, ValueError('empty keys are not allowed',)) + vim.List([Mapping({"abc" : FailingMapping()})]):(, NotImplementedError()) + vim.List([Mapping({"abc" : FailingMappingKey()})]):(, NotImplementedError()) +*************** +*** 736,741 **** +--- 747,753 ---- + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([%s]) + vim.List([None]):(, TypeError('unable to convert to vim structure',)) ++ vim.List([{b"": 1}]):(, ValueError('empty keys are not allowed',)) + vim.List([{"": 1}]):(, ValueError('empty keys are not allowed',)) + vim.List([FailingMapping()]):(, NotImplementedError()) + vim.List([FailingMappingKey()]):(, NotImplementedError()) +*************** +*** 772,777 **** +--- 784,790 ---- + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [{"abc" : %s}] + l[:] = [{"abc" : None}]:(, TypeError('unable to convert to vim structure',)) ++ l[:] = [{"abc" : {b"": 1}}]:(, ValueError('empty keys are not allowed',)) + l[:] = [{"abc" : {"": 1}}]:(, ValueError('empty keys are not allowed',)) + l[:] = [{"abc" : FailingMapping()}]:(, NotImplementedError()) + l[:] = [{"abc" : FailingMappingKey()}]:(, NotImplementedError()) +*************** +*** 797,802 **** +--- 810,816 ---- + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abc" : %s})] + l[:] = [Mapping({"abc" : None})]:(, TypeError('unable to convert to vim structure',)) ++ l[:] = [Mapping({"abc" : {b"": 1}})]:(, ValueError('empty keys are not allowed',)) + l[:] = [Mapping({"abc" : {"": 1}})]:(, ValueError('empty keys are not allowed',)) + l[:] = [Mapping({"abc" : FailingMapping()})]:(, NotImplementedError()) + l[:] = [Mapping({"abc" : FailingMappingKey()})]:(, NotImplementedError()) +*************** +*** 807,812 **** +--- 821,827 ---- + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [%s] + l[:] = [None]:(, TypeError('unable to convert to vim structure',)) ++ l[:] = [{b"": 1}]:(, ValueError('empty keys are not allowed',)) + l[:] = [{"": 1}]:(, ValueError('empty keys are not allowed',)) + l[:] = [FailingMapping()]:(, NotImplementedError()) + l[:] = [FailingMappingKey()]:(, NotImplementedError()) +*************** +*** 837,842 **** +--- 852,858 ---- + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([{"abc" : %s}]) + l.extend([{"abc" : None}]):(, TypeError('unable to convert to vim structure',)) ++ l.extend([{"abc" : {b"": 1}}]):(, ValueError('empty keys are not allowed',)) + l.extend([{"abc" : {"": 1}}]):(, ValueError('empty keys are not allowed',)) + l.extend([{"abc" : FailingMapping()}]):(, NotImplementedError()) + l.extend([{"abc" : FailingMappingKey()}]):(, NotImplementedError()) +*************** +*** 862,867 **** +--- 878,884 ---- + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([Mapping({"abc" : %s})]) + l.extend([Mapping({"abc" : None})]):(, TypeError('unable to convert to vim structure',)) ++ l.extend([Mapping({"abc" : {b"": 1}})]):(, ValueError('empty keys are not allowed',)) + l.extend([Mapping({"abc" : {"": 1}})]):(, ValueError('empty keys are not allowed',)) + l.extend([Mapping({"abc" : FailingMapping()})]):(, NotImplementedError()) + l.extend([Mapping({"abc" : FailingMappingKey()})]):(, NotImplementedError()) +*************** +*** 872,877 **** +--- 889,895 ---- + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([%s]) + l.extend([None]):(, TypeError('unable to convert to vim structure',)) ++ l.extend([{b"": 1}]):(, ValueError('empty keys are not allowed',)) + l.extend([{"": 1}]):(, ValueError('empty keys are not allowed',)) + l.extend([FailingMapping()]):(, NotImplementedError()) + l.extend([FailingMappingKey()]):(, NotImplementedError()) +*************** +*** 907,912 **** +--- 925,931 ---- + <<< Finished + >>> Testing ConvertFromPyObject using f({"abc" : %s}) + f({"abc" : None}):(, TypeError('unable to convert to vim structure',)) ++ f({"abc" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) + f({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) + f({"abc" : FailingMapping()}):(, NotImplementedError()) + f({"abc" : FailingMappingKey()}):(, NotImplementedError()) +*************** +*** 932,937 **** +--- 951,957 ---- + <<< Finished + >>> Testing ConvertFromPyObject using f(Mapping({"abc" : %s})) + f(Mapping({"abc" : None})):(, TypeError('unable to convert to vim structure',)) ++ f(Mapping({"abc" : {b"": 1}})):(, ValueError('empty keys are not allowed',)) + f(Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) + f(Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) + f(Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) +*************** +*** 942,947 **** +--- 962,968 ---- + <<< Finished + >>> Testing ConvertFromPyObject using f(%s) + f(None):(, TypeError('unable to convert to vim structure',)) ++ f({b"": 1}):(, ValueError('empty keys are not allowed',)) + f({"": 1}):(, ValueError('empty keys are not allowed',)) + f(FailingMapping()):(, NotImplementedError()) + f(FailingMappingKey()):(, NotImplementedError()) +*************** +*** 967,972 **** +--- 988,994 ---- + <<< Finished + >>> Testing ConvertFromPyObject using fd(self={"abc" : %s}) + fd(self={"abc" : None}):(, TypeError('unable to convert to vim structure',)) ++ fd(self={"abc" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) + fd(self={"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) + fd(self={"abc" : FailingMapping()}):(, NotImplementedError()) + fd(self={"abc" : FailingMappingKey()}):(, NotImplementedError()) +*************** +*** 992,997 **** +--- 1014,1020 ---- + <<< Finished + >>> Testing ConvertFromPyObject using fd(self=Mapping({"abc" : %s})) + fd(self=Mapping({"abc" : None})):(, TypeError('unable to convert to vim structure',)) ++ fd(self=Mapping({"abc" : {b"": 1}})):(, ValueError('empty keys are not allowed',)) + fd(self=Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) + fd(self=Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) + fd(self=Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) +*************** +*** 1002,1007 **** +--- 1025,1031 ---- + <<< Finished + >>> Testing ConvertFromPyObject using fd(self=%s) + fd(self=None):(, TypeError('unable to convert object to vim dictionary',)) ++ fd(self={b"": 1}):(, ValueError('empty keys are not allowed',)) + fd(self={"": 1}):(, ValueError('empty keys are not allowed',)) + fd(self=FailingMapping()):(, NotImplementedError()) + fd(self=FailingMappingKey()):(, NotImplementedError()) +*** ../vim-7.3.1099/src/version.c 2013-06-02 18:20:12.000000000 +0200 +--- src/version.c 2013-06-02 18:53:59.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1100, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +48. You get a tatoo that says "This body best viewed with Netscape 3.1 or + higher." + + /// 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 /// diff --git a/7.3.1101 b/7.3.1101 new file mode 100644 index 0000000..b6f0c58 --- /dev/null +++ b/7.3.1101 @@ -0,0 +1,243 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1101 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1101 +Problem: Configure doesn't find Python 3 on Ubuntu 13.04. +Solution: First try distutils.sysconfig. Also fix some indents. (Ken + Takata) +Files: src/configure.in, src/auto/configure + + +*** ../vim-7.3.1100/src/configure.in 2013-05-15 14:51:31.000000000 +0200 +--- src/configure.in 2013-06-02 19:02:31.000000000 +0200 +*************** +*** 899,912 **** + AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python_conf, + [ + vi_cv_path_python_conf= +! for path in "${vi_cv_path_python_pfx}" "${vi_cv_path_python_epfx}"; do +! for subdir in lib64 lib share; do +! d="${path}/${subdir}/python${vi_cv_var_python_version}/config" +! if test -d "$d" && test -f "$d/config.c"; then +! vi_cv_path_python_conf="$d" +! fi + done +! done + ]) + + PYTHON_CONFDIR="${vi_cv_path_python_conf}" +--- 899,917 ---- + AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python_conf, + [ + vi_cv_path_python_conf= +! d=`${vi_cv_path_python} -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBPL')"` +! if test -d "$d" && test -f "$d/config.c"; then +! vi_cv_path_python_conf="$d" +! else +! for path in "${vi_cv_path_python_pfx}" "${vi_cv_path_python_epfx}"; do +! for subdir in lib64 lib share; do +! d="${path}/${subdir}/python${vi_cv_var_python_version}/config" +! if test -d "$d" && test -f "$d/config.c"; then +! vi_cv_path_python_conf="$d" +! fi +! done + done +! fi + ]) + + PYTHON_CONFDIR="${vi_cv_path_python_conf}" +*************** +*** 1097,1110 **** + if test "${vi_cv_var_python3_abiflags}" != ""; then + config_dir="${config_dir}-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" + fi +! for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do +! for subdir in lib64 lib share; do +! d="${path}/${subdir}/python${vi_cv_var_python3_version}/${config_dir}" +! if test -d "$d" && test -f "$d/config.c"; then +! vi_cv_path_python3_conf="$d" +! fi + done +! done + ]) + + PYTHON3_CONFDIR="${vi_cv_path_python3_conf}" +--- 1102,1120 ---- + if test "${vi_cv_var_python3_abiflags}" != ""; then + config_dir="${config_dir}-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" + fi +! d=`${vi_cv_path_python3} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"` +! if test -d "$d" && test -f "$d/config.c"; then +! vi_cv_path_python3_conf="$d" +! else +! for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do +! for subdir in lib64 lib share; do +! d="${path}/${subdir}/python${vi_cv_var_python3_version}/${config_dir}" +! if test -d "$d" && test -f "$d/config.c"; then +! vi_cv_path_python3_conf="$d" +! fi +! done + done +! fi + ]) + + PYTHON3_CONFDIR="${vi_cv_path_python3_conf}" +*************** +*** 1498,1511 **** + fi + librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['LIBRUBYARG']])"` + librubya=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['LIBRUBY_A']])"` +! rubylibdir=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['libdir']])"` + if test -f "$rubylibdir/$librubya"; then + librubyarg="$librubyarg" +! RUBY_LIBS="$RUBY_LIBS -L$rubylibdir" +! elif test "$librubyarg" = "libruby.a"; then +! dnl required on Mac OS 10.3 where libruby.a doesn't exist +! librubyarg="-lruby" +! RUBY_LIBS="$RUBY_LIBS -L$rubylibdir" + fi + + if test "X$librubyarg" != "X"; then +--- 1508,1521 ---- + fi + librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['LIBRUBYARG']])"` + librubya=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['LIBRUBY_A']])"` +! rubylibdir=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG[['libdir']])"` + if test -f "$rubylibdir/$librubya"; then + librubyarg="$librubyarg" +! RUBY_LIBS="$RUBY_LIBS -L$rubylibdir" +! elif test "$librubyarg" = "libruby.a"; then +! dnl required on Mac OS 10.3 where libruby.a doesn't exist +! librubyarg="-lruby" +! RUBY_LIBS="$RUBY_LIBS -L$rubylibdir" + fi + + if test "X$librubyarg" != "X"; then +*** ../vim-7.3.1100/src/auto/configure 2013-05-15 14:51:31.000000000 +0200 +--- src/auto/configure 2013-06-02 19:03:17.000000000 +0200 +*************** +*** 5347,5360 **** + else + + vi_cv_path_python_conf= +! for path in "${vi_cv_path_python_pfx}" "${vi_cv_path_python_epfx}"; do +! for subdir in lib64 lib share; do +! d="${path}/${subdir}/python${vi_cv_var_python_version}/config" +! if test -d "$d" && test -f "$d/config.c"; then +! vi_cv_path_python_conf="$d" +! fi + done +! done + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python_conf" >&5 +--- 5347,5365 ---- + else + + vi_cv_path_python_conf= +! d=`${vi_cv_path_python} -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBPL')"` +! if test -d "$d" && test -f "$d/config.c"; then +! vi_cv_path_python_conf="$d" +! else +! for path in "${vi_cv_path_python_pfx}" "${vi_cv_path_python_epfx}"; do +! for subdir in lib64 lib share; do +! d="${path}/${subdir}/python${vi_cv_var_python_version}/config" +! if test -d "$d" && test -f "$d/config.c"; then +! vi_cv_path_python_conf="$d" +! fi +! done + done +! fi + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python_conf" >&5 +*************** +*** 5660,5673 **** + if test "${vi_cv_var_python3_abiflags}" != ""; then + config_dir="${config_dir}-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" + fi +! for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do +! for subdir in lib64 lib share; do +! d="${path}/${subdir}/python${vi_cv_var_python3_version}/${config_dir}" +! if test -d "$d" && test -f "$d/config.c"; then +! vi_cv_path_python3_conf="$d" +! fi + done +! done + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_conf" >&5 +--- 5665,5683 ---- + if test "${vi_cv_var_python3_abiflags}" != ""; then + config_dir="${config_dir}-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" + fi +! d=`${vi_cv_path_python3} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"` +! if test -d "$d" && test -f "$d/config.c"; then +! vi_cv_path_python3_conf="$d" +! else +! for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do +! for subdir in lib64 lib share; do +! d="${path}/${subdir}/python${vi_cv_var_python3_version}/${config_dir}" +! if test -d "$d" && test -f "$d/config.c"; then +! vi_cv_path_python3_conf="$d" +! fi +! done + done +! fi + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_conf" >&5 +*************** +*** 6408,6420 **** + fi + librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG['LIBRUBYARG'])"` + librubya=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG['LIBRUBY_A'])"` +! rubylibdir=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG['libdir'])"` + if test -f "$rubylibdir/$librubya"; then + librubyarg="$librubyarg" +! RUBY_LIBS="$RUBY_LIBS -L$rubylibdir" +! elif test "$librubyarg" = "libruby.a"; then +! librubyarg="-lruby" +! RUBY_LIBS="$RUBY_LIBS -L$rubylibdir" + fi + + if test "X$librubyarg" != "X"; then +--- 6418,6430 ---- + fi + librubyarg=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG['LIBRUBYARG'])"` + librubya=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG['LIBRUBY_A'])"` +! rubylibdir=`$vi_cv_path_ruby -r rbconfig -e "print $ruby_rbconfig.expand($ruby_rbconfig::CONFIG['libdir'])"` + if test -f "$rubylibdir/$librubya"; then + librubyarg="$librubyarg" +! RUBY_LIBS="$RUBY_LIBS -L$rubylibdir" +! elif test "$librubyarg" = "libruby.a"; then +! librubyarg="-lruby" +! RUBY_LIBS="$RUBY_LIBS -L$rubylibdir" + fi + + if test "X$librubyarg" != "X"; then +*** ../vim-7.3.1100/src/version.c 2013-06-02 18:54:16.000000000 +0200 +--- src/version.c 2013-06-02 19:01:39.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1101, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +49. You never have to deal with busy signals when calling your ISP...because + you never log off. + + /// 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 /// diff --git a/7.3.1102 b/7.3.1102 new file mode 100644 index 0000000..f559ddf --- /dev/null +++ b/7.3.1102 @@ -0,0 +1,46 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1102 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1102 +Problem: Completion of ":py3do" and ":py3file" does not work after ":py3". +Solution: Make completion work. (Taro Muraoka) +Files: src/ex_docmd.c + + +*** ../vim-7.3.1101/src/ex_docmd.c 2013-06-02 18:20:12.000000000 +0200 +--- src/ex_docmd.c 2013-06-02 19:18:08.000000000 +0200 +*************** +*** 3249,3254 **** +--- 3249,3257 ---- + /* check for non-alpha command */ + if (p == cmd && vim_strchr((char_u *)"@*!=><&~#", *p) != NULL) + ++p; ++ /* for python 3.x: ":py3*" commands completion */ ++ if (cmd[0] == 'p' && cmd[1] == 'y' && p == cmd + 2 && *p == '3') ++ ++p; + len = (int)(p - cmd); + + if (len == 0) +*** ../vim-7.3.1101/src/version.c 2013-06-02 19:14:11.000000000 +0200 +--- src/version.c 2013-06-02 19:16:56.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1102, + /**/ + +-- +CVS sux, men don't like commitment + + /// 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 /// diff --git a/7.3.1103 b/7.3.1103 new file mode 100644 index 0000000..8744b36 --- /dev/null +++ b/7.3.1103 @@ -0,0 +1,417 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1103 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1103 +Problem: New regexp engine: overhead in saving and restoring. +Solution: Make saving and restoring list IDs faster. Don't copy or check \z + subexpressions when they are not used. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1102/src/regexp_nfa.c 2013-06-02 16:40:44.000000000 +0200 +--- src/regexp_nfa.c 2013-06-02 21:00:41.000000000 +0200 +*************** +*** 237,242 **** +--- 237,245 ---- + /* NFA regexp \1 .. \9 encountered. */ + static int nfa_has_backref; + ++ /* NFA regexp has \z( ), set zsubexpr. */ ++ static int nfa_has_zsubexpr; ++ + /* Number of sub expressions actually being used during execution. 1 if only + * the whole match (subexpr 0) is used. */ + static int nfa_nsubexpr; +*************** +*** 272,281 **** + static nfa_state_T *post2nfa __ARGS((int *postfix, int *end, int nfa_calc_size)); + static int check_char_class __ARGS((int class, int c)); + static void st_error __ARGS((int *postfix, int *end, int *p)); +! static void nfa_set_neg_listids __ARGS((nfa_state_T *start)); +! static void nfa_set_null_listids __ARGS((nfa_state_T *start)); +! static void nfa_save_listids __ARGS((nfa_state_T *start, int *list)); +! static void nfa_restore_listids __ARGS((nfa_state_T *start, int *list)); + static int nfa_re_num_cmp __ARGS((long_u val, int op, long_u pos)); + static long nfa_regtry __ARGS((nfa_regprog_T *prog, colnr_T col)); + static long nfa_regexec_both __ARGS((char_u *line, colnr_T col)); +--- 275,282 ---- + static nfa_state_T *post2nfa __ARGS((int *postfix, int *end, int nfa_calc_size)); + static int check_char_class __ARGS((int class, int c)); + static void st_error __ARGS((int *postfix, int *end, int *p)); +! static void nfa_save_listids __ARGS((nfa_regprog_T *prog, int *list)); +! static void nfa_restore_listids __ARGS((nfa_regprog_T *prog, int *list)); + static int nfa_re_num_cmp __ARGS((long_u val, int op, long_u pos)); + static long nfa_regtry __ARGS((nfa_regprog_T *prog, colnr_T col)); + static long nfa_regexec_both __ARGS((char_u *line, colnr_T col)); +*************** +*** 3000,3005 **** +--- 3001,3024 ---- + return TRUE; + } + ++ #ifdef ENABLE_LOG ++ static void ++ report_state(char *action, regsub_T *sub, nfa_state_T *state, int lid); ++ { ++ int col; ++ ++ if (sub->in_use <= 0) ++ col = -1; ++ else if (REG_MULTI) ++ col = sub->list.multi[0].start.col; ++ else ++ col = (int)(sub->list.line[0].start - regline); ++ nfa_set_code(state->c); ++ fprintf(log_fd, "> %s state %d to list %d. char %d: %s (start col %d)\n", ++ action, abs(state->id), lid, state->c, code, col); ++ } ++ #endif ++ + static void + addstate(l, state, subs, off) + nfa_list_T *l; /* runtime state list */ +*************** +*** 3118,3124 **** + if (thread->state->id == state->id + && sub_equal(&thread->subs.norm, &subs->norm) + #ifdef FEAT_SYN_HL +! && sub_equal(&thread->subs.synt, &subs->synt) + #endif + ) + goto skip_add; +--- 3137,3144 ---- + if (thread->state->id == state->id + && sub_equal(&thread->subs.norm, &subs->norm) + #ifdef FEAT_SYN_HL +! && (!nfa_has_zsubexpr || +! sub_equal(&thread->subs.synt, &subs->synt)) + #endif + ) + goto skip_add; +*************** +*** 3141,3181 **** + thread->state = state; + copy_sub(&thread->subs.norm, &subs->norm); + #ifdef FEAT_SYN_HL +! copy_sub(&thread->subs.synt, &subs->synt); + #endif + #ifdef ENABLE_LOG +! { +! int col; +! +! if (thread->subs.norm.in_use <= 0) +! col = -1; +! else if (REG_MULTI) +! col = thread->subs.norm.list.multi[0].start.col; +! else +! col = (int)(thread->subs.norm.list.line[0].start - regline); +! nfa_set_code(state->c); +! fprintf(log_fd, "> Adding state %d to list %d. char %d: %s (start col %d)\n", +! abs(state->id), l->id, state->c, code, col); +! did_print = TRUE; +! } + #endif + } + + #ifdef ENABLE_LOG + if (!did_print) +! { +! int col; +! +! if (subs->norm.in_use <= 0) +! col = -1; +! else if (REG_MULTI) +! col = subs->norm.list.multi[0].start.col; +! else +! col = (int)(subs->norm.list.line[0].start - regline); +! nfa_set_code(state->c); +! fprintf(log_fd, "> Processing state %d for list %d. char %d: %s (start col %d)\n", +! abs(state->id), l->id, state->c, code, col); +! } + #endif + switch (state->c) + { +--- 3161,3178 ---- + thread->state = state; + copy_sub(&thread->subs.norm, &subs->norm); + #ifdef FEAT_SYN_HL +! if (nfa_has_zsubexpr) +! copy_sub(&thread->subs.synt, &subs->synt); + #endif + #ifdef ENABLE_LOG +! report_state("Adding", &thread->subs.norm, state, l->id); +! did_print = TRUE; + #endif + } + + #ifdef ENABLE_LOG + if (!did_print) +! report_state("Processing", &subs->norm, state, l->id); + #endif + switch (state->c) + { +*************** +*** 3600,3648 **** + #endif + + /* +! * Set all NFA nodes' list ID equal to -1. + */ + static void +! nfa_set_neg_listids(start) +! nfa_state_T *start; +! { +! if (start != NULL && start->lastlist >= 0) +! { +! start->lastlist = -1; +! nfa_set_neg_listids(start->out); +! nfa_set_neg_listids(start->out1); +! } +! } +! +! /* +! * Set all NFA nodes' list ID equal to 0. +! */ +! static void +! nfa_set_null_listids(start) +! nfa_state_T *start; +! { +! if (start != NULL && start->lastlist == -1) +! { +! start->lastlist = 0; +! nfa_set_null_listids(start->out); +! nfa_set_null_listids(start->out1); +! } +! } +! +! /* +! * Save list IDs for all NFA states in "list". +! */ +! static void +! nfa_save_listids(start, list) +! nfa_state_T *start; + int *list; + { +! if (start != NULL && start->lastlist != -1) +! { +! list[abs(start->id)] = start->lastlist; +! start->lastlist = -1; +! nfa_save_listids(start->out, list); +! nfa_save_listids(start->out1, list); + } + } + +--- 3597,3620 ---- + #endif + + /* +! * Save list IDs for all NFA states of "prog" into "list". +! * Also reset the IDs to zero. + */ + static void +! nfa_save_listids(prog, list) +! nfa_regprog_T *prog; + int *list; + { +! int i; +! nfa_state_T *p; +! +! /* Order in the list is reverse, it's a bit faster that way. */ +! p = &prog->state[0]; +! for (i = prog->nstate; --i >= 0; ) +! { +! list[i] = p->lastlist; +! p->lastlist = 0; +! ++p; + } + } + +*************** +*** 3650,3664 **** + * Restore list IDs from "list" to all NFA states. + */ + static void +! nfa_restore_listids(start, list) +! nfa_state_T *start; + int *list; + { +! if (start != NULL && start->lastlist == -1) + { +! start->lastlist = list[abs(start->id)]; +! nfa_restore_listids(start->out, list); +! nfa_restore_listids(start->out1, list); + } + } + +--- 3622,3639 ---- + * Restore list IDs from "list" to all NFA states. + */ + static void +! nfa_restore_listids(prog, list) +! nfa_regprog_T *prog; + int *list; + { +! int i; +! nfa_state_T *p; +! +! p = &prog->state[0]; +! for (i = prog->nstate; --i >= 0; ) + { +! p->lastlist = list[i]; +! ++p; + } + } + +*************** +*** 3673,3679 **** + return val == pos; + } + +! static int nfa_regmatch __ARGS((nfa_state_T *start, regsubs_T *submatch, regsubs_T *m)); + + /* + * Main matching routine. +--- 3648,3654 ---- + return val == pos; + } + +! static int nfa_regmatch __ARGS((nfa_regprog_T *prog, nfa_state_T *start, regsubs_T *submatch, regsubs_T *m)); + + /* + * Main matching routine. +*************** +*** 3686,3692 **** + * Note: Caller must ensure that: start != NULL. + */ + static int +! nfa_regmatch(start, submatch, m) + nfa_state_T *start; + regsubs_T *submatch; + regsubs_T *m; +--- 3661,3668 ---- + * Note: Caller must ensure that: start != NULL. + */ + static int +! nfa_regmatch(prog, start, submatch, m) +! nfa_regprog_T *prog; + nfa_state_T *start; + regsubs_T *submatch; + regsubs_T *m; +*************** +*** 3872,3878 **** + nfa_match = TRUE; + copy_sub(&submatch->norm, &t->subs.norm); + #ifdef FEAT_SYN_HL +! copy_sub(&submatch->synt, &t->subs.synt); + #endif + #ifdef ENABLE_LOG + log_subsexpr(&t->subs); +--- 3848,3855 ---- + nfa_match = TRUE; + copy_sub(&submatch->norm, &t->subs.norm); + #ifdef FEAT_SYN_HL +! if (nfa_has_zsubexpr) +! copy_sub(&submatch->synt, &t->subs.synt); + #endif + #ifdef ENABLE_LOG + log_subsexpr(&t->subs); +*************** +*** 3928,3934 **** + { + copy_sub(&m->norm, &t->subs.norm); + #ifdef FEAT_SYN_HL +! copy_sub(&m->synt, &t->subs.synt); + #endif + } + nfa_match = TRUE; +--- 3905,3912 ---- + { + copy_sub(&m->norm, &t->subs.norm); + #ifdef FEAT_SYN_HL +! if (nfa_has_zsubexpr) +! copy_sub(&m->synt, &t->subs.synt); + #endif + } + nfa_match = TRUE; +*************** +*** 4024,4035 **** + /* Have to clear the listid field of the NFA nodes, so that + * nfa_regmatch() and addstate() can run properly after + * recursion. */ +! nfa_save_listids(start, listids); +! nfa_set_null_listids(start); + nfa_endp = endposp; +! result = nfa_regmatch(t->state->out, submatch, m); +! nfa_set_neg_listids(start); +! nfa_restore_listids(start, listids); + + /* restore position in input text */ + reginput = save_reginput; +--- 4002,4011 ---- + /* Have to clear the listid field of the NFA nodes, so that + * nfa_regmatch() and addstate() can run properly after + * recursion. */ +! nfa_save_listids(prog, listids); + nfa_endp = endposp; +! result = nfa_regmatch(prog, t->state->out, submatch, m); +! nfa_restore_listids(prog, listids); + + /* restore position in input text */ + reginput = save_reginput; +*************** +*** 4665,4671 **** +--- 4641,4652 ---- + #ifdef FEAT_SYN_HL + /* Clear the external match subpointers if necessary. */ + if (prog->reghasz == REX_SET) ++ { ++ nfa_has_zsubexpr = TRUE; + need_clear_zsubexpr = TRUE; ++ } ++ else ++ nfa_has_zsubexpr = FALSE; + #endif + + #ifdef ENABLE_LOG +*************** +*** 4694,4700 **** + clear_sub(&m.synt); + #endif + +! if (nfa_regmatch(start, &subs, &m) == FALSE) + return 0; + + cleanup_subexpr(); +--- 4675,4681 ---- + clear_sub(&m.synt); + #endif + +! if (nfa_regmatch(prog, start, &subs, &m) == FALSE) + return 0; + + cleanup_subexpr(); +*** ../vim-7.3.1102/src/version.c 2013-06-02 19:22:05.000000000 +0200 +--- src/version.c 2013-06-02 21:24:50.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1103, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +53. To find out what time it is, you send yourself an e-mail and check the + "Date:" field. + + /// 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 /// diff --git a/7.3.1104 b/7.3.1104 new file mode 100644 index 0000000..9367091 --- /dev/null +++ b/7.3.1104 @@ -0,0 +1,111 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1104 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1104 +Problem: New regexp engine does not handle "~". +Solution: Add support for "~". +Files: src/regexp_nfa.c, src/testdir/test24.in, src/testdir/test24.ok + + +*** ../vim-7.3.1103/src/regexp_nfa.c 2013-06-02 21:30:00.000000000 +0200 +--- src/regexp_nfa.c 2013-06-02 22:00:21.000000000 +0200 +*************** +*** 829,837 **** + EMSGN(_(e_misplaced), no_Magic(c)); + return FAIL; + +! case Magic('~'): /* previous substitute pattern */ +! /* TODO: Not supported yet */ +! return FAIL; + + case Magic('1'): + case Magic('2'): +--- 829,854 ---- + EMSGN(_(e_misplaced), no_Magic(c)); + return FAIL; + +! case Magic('~'): +! { +! char_u *lp; +! +! /* Previous substitute pattern. +! * Generated as "\%(pattern\)". */ +! if (reg_prev_sub == NULL) +! { +! EMSG(_(e_nopresub)); +! return FAIL; +! } +! for (lp = reg_prev_sub; *lp != NUL; mb_cptr_adv(lp)) +! { +! EMIT(PTR2CHAR(lp)); +! if (lp != reg_prev_sub) +! EMIT(NFA_CONCAT); +! } +! EMIT(NFA_NOPEN); +! break; +! } + + case Magic('1'): + case Magic('2'): +*** ../vim-7.3.1103/src/testdir/test24.in 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/test24.in 2013-06-02 22:03:23.000000000 +0200 +*************** +*** 44,49 **** +--- 44,56 ---- + :s/^\(\h\w*\%(->\|\.\)\=\)\+=/XX/ + + :s/^\(\h\w*\%(->\|\.\)\=\)\+=/YY/ ++ ++ :s/aaa/xyz/ ++ ++ :s/~/bcd/ ++ ++ :s/~\+/BB/ ++ :" + :?start?,$w! test.out + :qa! + ENDTEST +*************** +*** 77,79 **** +--- 84,89 ---- + xx an file xx + x= 9; + hh= 77; ++ aaa ++ xyz ++ bcdbcdbcd +*** ../vim-7.3.1103/src/testdir/test24.ok 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/test24.ok 2013-06-02 22:03:36.000000000 +0200 +*************** +*** 27,29 **** +--- 27,32 ---- + xx an A xx + XX 9; + YY 77; ++ xyz ++ bcd ++ BB +*** ../vim-7.3.1103/src/version.c 2013-06-02 21:30:00.000000000 +0200 +--- src/version.c 2013-06-02 22:07:20.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1104, + /**/ + +-- +Q: What is a patch 22? +A: A patch you need to include to make it possible to include patches. + + /// 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 /// diff --git a/7.3.1105 b/7.3.1105 new file mode 100644 index 0000000..0fd7a86 --- /dev/null +++ b/7.3.1105 @@ -0,0 +1,433 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1105 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1105 +Problem: New regexp engine: too much code in one function. Dead code. +Solution: Move the recursive nfa_regmatch call to a separate function. + Remove the dead code. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1104/src/regexp_nfa.c 2013-06-02 22:07:57.000000000 +0200 +--- src/regexp_nfa.c 2013-06-02 22:35:43.000000000 +0200 +*************** +*** 3665,3673 **** +--- 3665,3802 ---- + return val == pos; + } + ++ static int recursive_regmatch __ARGS((nfa_state_T *state, nfa_regprog_T *prog, regsubs_T *submatch, regsubs_T *m, int **listids)); + static int nfa_regmatch __ARGS((nfa_regprog_T *prog, nfa_state_T *start, regsubs_T *submatch, regsubs_T *m)); + + /* ++ * Recursively call nfa_regmatch() ++ */ ++ static int ++ recursive_regmatch(state, prog, submatch, m, listids) ++ nfa_state_T *state; ++ nfa_regprog_T *prog; ++ regsubs_T *submatch; ++ regsubs_T *m; ++ int **listids; ++ { ++ char_u *save_reginput = reginput; ++ char_u *save_regline = regline; ++ int save_reglnum = reglnum; ++ int save_nfa_match = nfa_match; ++ save_se_T *save_nfa_endp = nfa_endp; ++ save_se_T endpos; ++ save_se_T *endposp = NULL; ++ int result; ++ ++ if (state->c == NFA_START_INVISIBLE_BEFORE) ++ { ++ /* The recursive match must end at the current position. */ ++ endposp = &endpos; ++ if (REG_MULTI) ++ { ++ endpos.se_u.pos.col = (int)(reginput - regline); ++ endpos.se_u.pos.lnum = reglnum; ++ } ++ else ++ endpos.se_u.ptr = reginput; ++ ++ /* Go back the specified number of bytes, or as far as the ++ * start of the previous line, to try matching "\@<=" or ++ * not matching "\@val <= 0) ++ { ++ if (REG_MULTI) ++ { ++ regline = reg_getline(--reglnum); ++ if (regline == NULL) ++ /* can't go before the first line */ ++ regline = reg_getline(++reglnum); ++ } ++ reginput = regline; ++ } ++ else ++ { ++ if (REG_MULTI && (int)(reginput - regline) < state->val) ++ { ++ /* Not enough bytes in this line, go to end of ++ * previous line. */ ++ regline = reg_getline(--reglnum); ++ if (regline == NULL) ++ { ++ /* can't go before the first line */ ++ regline = reg_getline(++reglnum); ++ reginput = regline; ++ } ++ else ++ reginput = regline + STRLEN(regline); ++ } ++ if ((int)(reginput - regline) >= state->val) ++ { ++ reginput -= state->val; ++ #ifdef FEAT_MBYTE ++ if (has_mbyte) ++ reginput -= mb_head_off(regline, reginput); ++ #endif ++ } ++ else ++ reginput = regline; ++ } ++ } ++ ++ /* Call nfa_regmatch() to check if the current concat matches ++ * at this position. The concat ends with the node ++ * NFA_END_INVISIBLE */ ++ if (*listids == NULL) ++ { ++ *listids = (int *)lalloc(sizeof(int) * nstate, TRUE); ++ if (*listids == NULL) ++ { ++ EMSG(_("E878: (NFA) Could not allocate memory for branch traversal!")); ++ return 0; ++ } ++ } ++ #ifdef ENABLE_LOG ++ if (log_fd != stderr) ++ fclose(log_fd); ++ log_fd = NULL; ++ #endif ++ /* Have to clear the listid field of the NFA nodes, so that ++ * nfa_regmatch() and addstate() can run properly after ++ * recursion. */ ++ nfa_save_listids(prog, *listids); ++ nfa_endp = endposp; ++ result = nfa_regmatch(prog, state->out, submatch, m); ++ nfa_restore_listids(prog, *listids); ++ ++ /* restore position in input text */ ++ reginput = save_reginput; ++ regline = save_regline; ++ reglnum = save_reglnum; ++ nfa_match = save_nfa_match; ++ nfa_endp = save_nfa_endp; ++ ++ #ifdef ENABLE_LOG ++ log_fd = fopen(NFA_REGEXP_RUN_LOG, "a"); ++ if (log_fd != NULL) ++ { ++ fprintf(log_fd, "****************************\n"); ++ fprintf(log_fd, "FINISHED RUNNING nfa_regmatch() recursively\n"); ++ fprintf(log_fd, "MATCH = %s\n", result == TRUE ? "OK" : "FALSE"); ++ fprintf(log_fd, "****************************\n"); ++ } ++ else ++ { ++ EMSG(_("Could not open temporary log file for writing, displaying on stderr ... ")); ++ log_fd = stderr; ++ } ++ #endif ++ ++ return result; ++ } ++ ++ /* + * Main matching routine. + * + * Run NFA to determine whether it matches reginput. +*************** +*** 3881,4051 **** + } + + case NFA_END_INVISIBLE: +! /* This is only encountered after a NFA_START_INVISIBLE or + * NFA_START_INVISIBLE_BEFORE node. + * They surround a zero-width group, used with "\@=", "\&", + * "\@!", "\@<=" and "\@c == NFA_MOPEN) +! /* TODO: do we ever get here? */ +! addstate_here(thislist, t->state->out, &t->subs, &listidx); +! else +! { + #ifdef ENABLE_LOG +! if (nfa_endp != NULL) +! { +! if (REG_MULTI) +! fprintf(log_fd, "Current lnum: %d, endp lnum: %d; current col: %d, endp col: %d\n", +! (int)reglnum, +! (int)nfa_endp->se_u.pos.lnum, +! (int)(reginput - regline), +! nfa_endp->se_u.pos.col); +! else +! fprintf(log_fd, "Current col: %d, endp col: %d\n", +! (int)(reginput - regline), +! (int)(nfa_endp->se_u.ptr - reginput)); +! } +! #endif +! /* It's only a match if it ends at "nfa_endp" */ +! if (nfa_endp != NULL && (REG_MULTI +! ? (reglnum != nfa_endp->se_u.pos.lnum +! || (int)(reginput - regline) +! != nfa_endp->se_u.pos.col) +! : reginput != nfa_endp->se_u.ptr)) +! break; +! +! /* do not set submatches for \@! */ +! if (!t->state->negated) +! { +! copy_sub(&m->norm, &t->subs.norm); +! #ifdef FEAT_SYN_HL +! if (nfa_has_zsubexpr) +! copy_sub(&m->synt, &t->subs.synt); +! #endif +! } +! nfa_match = TRUE; +! } +! break; +! +! case NFA_START_INVISIBLE: +! case NFA_START_INVISIBLE_BEFORE: +! { +! char_u *save_reginput = reginput; +! char_u *save_regline = regline; +! int save_reglnum = reglnum; +! int save_nfa_match = nfa_match; +! save_se_T *save_nfa_endp = nfa_endp; +! save_se_T endpos; +! save_se_T *endposp = NULL; +! +! if (t->state->c == NFA_START_INVISIBLE_BEFORE) + { +- /* The recursive match must end at the current position. */ +- endposp = &endpos; + if (REG_MULTI) +! { +! endpos.se_u.pos.col = (int)(reginput - regline); +! endpos.se_u.pos.lnum = reglnum; +! } + else +! endpos.se_u.ptr = reginput; +! +! /* Go back the specified number of bytes, or as far as the +! * start of the previous line, to try matching "\@<=" or +! * not matching "\@state->val <= 0) +! { +! if (REG_MULTI) +! { +! regline = reg_getline(--reglnum); +! if (regline == NULL) +! /* can't go before the first line */ +! regline = reg_getline(++reglnum); +! } +! reginput = regline; +! } +! else +! { +! if (REG_MULTI +! && (int)(reginput - regline) < t->state->val) +! { +! /* Not enough bytes in this line, go to end of +! * previous line. */ +! regline = reg_getline(--reglnum); +! if (regline == NULL) +! { +! /* can't go before the first line */ +! regline = reg_getline(++reglnum); +! reginput = regline; +! } +! else +! reginput = regline + STRLEN(regline); +! } +! if ((int)(reginput - regline) >= t->state->val) +! { +! reginput -= t->state->val; +! #ifdef FEAT_MBYTE +! if (has_mbyte) +! reginput -= mb_head_off(regline, reginput); +! #endif +! } +! else +! reginput = regline; +! } + } + +! /* Call nfa_regmatch() to check if the current concat matches +! * at this position. The concat ends with the node +! * NFA_END_INVISIBLE */ +! if (listids == NULL) + { +! listids = (int *)lalloc(sizeof(int) * nstate, TRUE); +! if (listids == NULL) +! { +! EMSG(_("E878: (NFA) Could not allocate memory for branch traversal!")); +! return 0; +! } + } +! #ifdef ENABLE_LOG +! if (log_fd != stderr) +! fclose(log_fd); +! log_fd = NULL; +! #endif +! /* Have to clear the listid field of the NFA nodes, so that +! * nfa_regmatch() and addstate() can run properly after +! * recursion. */ +! nfa_save_listids(prog, listids); +! nfa_endp = endposp; +! result = nfa_regmatch(prog, t->state->out, submatch, m); +! nfa_restore_listids(prog, listids); +! +! /* restore position in input text */ +! reginput = save_reginput; +! regline = save_regline; +! reglnum = save_reglnum; +! nfa_match = save_nfa_match; +! nfa_endp = save_nfa_endp; + +- #ifdef ENABLE_LOG +- log_fd = fopen(NFA_REGEXP_RUN_LOG, "a"); +- if (log_fd != NULL) +- { +- fprintf(log_fd, "****************************\n"); +- fprintf(log_fd, "FINISHED RUNNING nfa_regmatch() recursively\n"); +- fprintf(log_fd, "MATCH = %s\n", result == TRUE ? "OK" : "FALSE"); +- fprintf(log_fd, "****************************\n"); +- } +- else +- { +- EMSG(_("Could not open temporary log file for writing, displaying on stderr ... ")); +- log_fd = stderr; +- } +- #endif + /* for \@! it is a match when result is FALSE */ + if (result != t->state->negated) + { +--- 4010,4066 ---- + } + + case NFA_END_INVISIBLE: +! /* +! * This is only encountered after a NFA_START_INVISIBLE or + * NFA_START_INVISIBLE_BEFORE node. + * They surround a zero-width group, used with "\@=", "\&", + * "\@!", "\@<=" and "\@se_u.pos.lnum, +! (int)(reginput - regline), +! nfa_endp->se_u.pos.col); + else +! fprintf(log_fd, "Current col: %d, endp col: %d\n", +! (int)(reginput - regline), +! (int)(nfa_endp->se_u.ptr - reginput)); + } ++ #endif ++ /* It's only a match if it ends at "nfa_endp" */ ++ if (nfa_endp != NULL && (REG_MULTI ++ ? (reglnum != nfa_endp->se_u.pos.lnum ++ || (int)(reginput - regline) ++ != nfa_endp->se_u.pos.col) ++ : reginput != nfa_endp->se_u.ptr)) ++ break; + +! /* do not set submatches for \@! */ +! if (!t->state->negated) + { +! copy_sub(&m->norm, &t->subs.norm); +! #ifdef FEAT_SYN_HL +! if (nfa_has_zsubexpr) +! copy_sub(&m->synt, &t->subs.synt); +! #endif + } +! nfa_match = TRUE; +! break; +! +! case NFA_START_INVISIBLE: +! case NFA_START_INVISIBLE_BEFORE: +! result = recursive_regmatch(t->state, prog, submatch, m, +! &listids); + + /* for \@! it is a match when result is FALSE */ + if (result != t->state->negated) + { +*************** +*** 4056,4067 **** + #endif + + /* t->state->out1 is the corresponding END_INVISIBLE node; +! * Add it to the current list (zero-width match). */ + addstate_here(thislist, t->state->out1->out, &t->subs, + &listidx); + } + break; +- } + + case NFA_BOL: + if (reginput == regline) +--- 4071,4081 ---- + #endif + + /* t->state->out1 is the corresponding END_INVISIBLE node; +! * Add its out to the current list (zero-width match). */ + addstate_here(thislist, t->state->out1->out, &t->subs, + &listidx); + } + break; + + case NFA_BOL: + if (reginput == regline) +*** ../vim-7.3.1104/src/version.c 2013-06-02 22:07:57.000000000 +0200 +--- src/version.c 2013-06-02 22:37:02.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1105, + /**/ + +-- +"I can't complain, but sometimes I still do." (Joe Walsh) + + /// 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 /// diff --git a/7.3.1106 b/7.3.1106 new file mode 100644 index 0000000..801c007 --- /dev/null +++ b/7.3.1106 @@ -0,0 +1,383 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1106 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1106 +Problem: New regexp engine: saving and restoring lastlist in the states + takes a lot of time. +Solution: Use a second lastlist value for the first recursive call. +Files: src/regexp.h, src/regexp_nfa.c + + +*** ../vim-7.3.1105/src/regexp.h 2013-06-02 15:55:52.000000000 +0200 +--- src/regexp.h 2013-06-03 11:29:26.000000000 +0200 +*************** +*** 72,78 **** + nfa_state_T *out; + nfa_state_T *out1; + int id; +! int lastlist; + int negated; + int val; + }; +--- 72,78 ---- + nfa_state_T *out; + nfa_state_T *out1; + int id; +! int lastlist[2]; /* 0: normal, 1: recursive */ + int negated; + int val; + }; +*** ../vim-7.3.1105/src/regexp_nfa.c 2013-06-02 22:37:39.000000000 +0200 +--- src/regexp_nfa.c 2013-06-03 12:15:17.000000000 +0200 +*************** +*** 255,260 **** +--- 255,269 ---- + /* If not NULL match must end at this position */ + static save_se_T *nfa_endp = NULL; + ++ /* listid is global, so that it increases on recursive calls to ++ * nfa_regmatch(), which means we don't have to clear the lastlist field of ++ * all the states. */ ++ static int nfa_listid; ++ static int nfa_alt_listid; ++ ++ /* 0 for first call to nfa_regmatch(), 1 for recursive call. */ ++ static int nfa_ll_index = 0; ++ + static int nfa_regcomp_start __ARGS((char_u*expr, int re_flags)); + static int nfa_recognize_char_class __ARGS((char_u *start, char_u *end, int extra_newl)); + static int nfa_emit_equi_class __ARGS((int c, int neg)); +*************** +*** 2169,2175 **** + s->out1 = out1; + + s->id = istate; +! s->lastlist = 0; + s->negated = FALSE; + + return s; +--- 2178,2185 ---- + s->out1 = out1; + + s->id = istate; +! s->lastlist[0] = 0; +! s->lastlist[1] = 0; + s->negated = FALSE; + + return s; +*************** +*** 3113,3121 **** + #endif + /* These nodes do not need to be added, but we need to bail out + * when it was tried to be added to this list before. */ +! if (state->lastlist == l->id) + goto skip_add; +! state->lastlist = l->id; + break; + + case NFA_BOL: +--- 3123,3131 ---- + #endif + /* These nodes do not need to be added, but we need to bail out + * when it was tried to be added to this list before. */ +! if (state->lastlist[nfa_ll_index] == l->id) + goto skip_add; +! state->lastlist[nfa_ll_index] = l->id; + break; + + case NFA_BOL: +*************** +*** 3131,3137 **** + /* FALLTHROUGH */ + + default: +! if (state->lastlist == l->id) + { + /* This state is already in the list, don't add it again, + * unless it is an MOPEN that is used for a backreference. */ +--- 3141,3147 ---- + /* FALLTHROUGH */ + + default: +! if (state->lastlist[nfa_ll_index] == l->id) + { + /* This state is already in the list, don't add it again, + * unless it is an MOPEN that is used for a backreference. */ +*************** +*** 3173,3179 **** + } + + /* add the state to the list */ +! state->lastlist = l->id; + thread = &l->t[l->n++]; + thread->state = state; + copy_sub(&thread->subs.norm, &subs->norm); +--- 3183,3189 ---- + } + + /* add the state to the list */ +! state->lastlist[nfa_ll_index] = l->id; + thread = &l->t[l->n++]; + thread->state = state; + copy_sub(&thread->subs.norm, &subs->norm); +*************** +*** 3616,3621 **** +--- 3626,3632 ---- + /* + * Save list IDs for all NFA states of "prog" into "list". + * Also reset the IDs to zero. ++ * Only used for the recursive value lastlist[1]. + */ + static void + nfa_save_listids(prog, list) +*************** +*** 3629,3636 **** + p = &prog->state[0]; + for (i = prog->nstate; --i >= 0; ) + { +! list[i] = p->lastlist; +! p->lastlist = 0; + ++p; + } + } +--- 3640,3647 ---- + p = &prog->state[0]; + for (i = prog->nstate; --i >= 0; ) + { +! list[i] = p->lastlist[1]; +! p->lastlist[1] = 0; + ++p; + } + } +*************** +*** 3649,3655 **** + p = &prog->state[0]; + for (i = prog->nstate; --i >= 0; ) + { +! p->lastlist = list[i]; + ++p; + } + } +--- 3660,3666 ---- + p = &prog->state[0]; + for (i = prog->nstate; --i >= 0; ) + { +! p->lastlist[1] = list[i]; + ++p; + } + } +*************** +*** 3683,3692 **** +--- 3694,3705 ---- + char_u *save_regline = regline; + int save_reglnum = reglnum; + int save_nfa_match = nfa_match; ++ int save_nfa_listid = nfa_listid; + save_se_T *save_nfa_endp = nfa_endp; + save_se_T endpos; + save_se_T *endposp = NULL; + int result; ++ int need_restore = FALSE; + + if (state->c == NFA_START_INVISIBLE_BEFORE) + { +*************** +*** 3745,3774 **** + } + } + +- /* Call nfa_regmatch() to check if the current concat matches +- * at this position. The concat ends with the node +- * NFA_END_INVISIBLE */ +- if (*listids == NULL) +- { +- *listids = (int *)lalloc(sizeof(int) * nstate, TRUE); +- if (*listids == NULL) +- { +- EMSG(_("E878: (NFA) Could not allocate memory for branch traversal!")); +- return 0; +- } +- } + #ifdef ENABLE_LOG + if (log_fd != stderr) + fclose(log_fd); + log_fd = NULL; + #endif +! /* Have to clear the listid field of the NFA nodes, so that +! * nfa_regmatch() and addstate() can run properly after +! * recursion. */ +! nfa_save_listids(prog, *listids); + nfa_endp = endposp; + result = nfa_regmatch(prog, state->out, submatch, m); +! nfa_restore_listids(prog, *listids); + + /* restore position in input text */ + reginput = save_reginput; +--- 3758,3809 ---- + } + } + + #ifdef ENABLE_LOG + if (log_fd != stderr) + fclose(log_fd); + log_fd = NULL; + #endif +! /* Have to clear the lastlist field of the NFA nodes, so that +! * nfa_regmatch() and addstate() can run properly after recursion. */ +! if (nfa_ll_index == 1) +! { +! /* Already calling nfa_regmatch() recursively. Save the lastlist[1] +! * values and clear them. */ +! if (*listids == NULL) +! { +! *listids = (int *)lalloc(sizeof(int) * nstate, TRUE); +! if (*listids == NULL) +! { +! EMSG(_("E878: (NFA) Could not allocate memory for branch traversal!")); +! return 0; +! } +! } +! nfa_save_listids(prog, *listids); +! need_restore = TRUE; +! /* any value of nfa_listid will do */ +! } +! else +! { +! /* First recursive nfa_regmatch() call, switch to the second lastlist +! * entry. Make sure nfa_listid is different from a previous recursive +! * call, because some states may still have this ID. */ +! ++nfa_ll_index; +! if (nfa_listid <= nfa_alt_listid) +! nfa_listid = nfa_alt_listid; +! } +! +! /* Call nfa_regmatch() to check if the current concat matches at this +! * position. The concat ends with the node NFA_END_INVISIBLE */ + nfa_endp = endposp; + result = nfa_regmatch(prog, state->out, submatch, m); +! +! if (need_restore) +! nfa_restore_listids(prog, *listids); +! else +! { +! --nfa_ll_index; +! nfa_alt_listid = nfa_listid; +! } + + /* restore position in input text */ + reginput = save_reginput; +*************** +*** 3776,3781 **** +--- 3811,3817 ---- + reglnum = save_reglnum; + nfa_match = save_nfa_match; + nfa_endp = save_nfa_endp; ++ nfa_listid = save_nfa_listid; + + #ifdef ENABLE_LOG + log_fd = fopen(NFA_REGEXP_RUN_LOG, "a"); +*************** +*** 3821,3827 **** + nfa_list_T list[3]; + nfa_list_T *listtbl[2][2]; + nfa_list_T *ll; +- int listid = 1; + int listidx; + nfa_list_T *thislist; + nfa_list_T *nextlist; +--- 3857,3862 ---- +*************** +*** 3875,3881 **** + #ifdef ENABLE_LOG + fprintf(log_fd, "(---) STARTSTATE\n"); + #endif +! thislist->id = listid; + addstate(thislist, start, m, 0); + + /* There are two cases when the NFA advances: 1. input char matches the +--- 3910,3916 ---- + #ifdef ENABLE_LOG + fprintf(log_fd, "(---) STARTSTATE\n"); + #endif +! thislist->id = nfa_listid + 1; + addstate(thislist, start, m, 0); + + /* There are two cases when the NFA advances: 1. input char matches the +*************** +*** 3923,3932 **** + nextlist = &list[flag ^= 1]; + nextlist->n = 0; /* clear nextlist */ + listtbl[1][0] = nextlist; +! ++listid; +! thislist->id = listid; +! nextlist->id = listid + 1; +! neglist->id = listid + 1; + + #ifdef ENABLE_LOG + fprintf(log_fd, "------------------------------------------\n"); +--- 3958,3967 ---- + nextlist = &list[flag ^= 1]; + nextlist->n = 0; /* clear nextlist */ + listtbl[1][0] = nextlist; +! ++nfa_listid; +! thislist->id = nfa_listid; +! nextlist->id = nfa_listid + 1; +! neglist->id = nfa_listid + 1; + + #ifdef ENABLE_LOG + fprintf(log_fd, "------------------------------------------\n"); +*************** +*** 4843,4848 **** +--- 4878,4885 ---- + nfa_has_zend = prog->has_zend; + nfa_has_backref = prog->has_backref; + nfa_nsubexpr = prog->nsubexp; ++ nfa_listid = 1; ++ nfa_alt_listid = 2; + #ifdef DEBUG + nfa_regengine.expr = prog->pattern; + #endif +*************** +*** 4851,4857 **** + for (i = 0; i < nstate; ++i) + { + prog->state[i].id = i; +! prog->state[i].lastlist = 0; + } + + retval = nfa_regtry(prog, col); +--- 4888,4895 ---- + for (i = 0; i < nstate; ++i) + { + prog->state[i].id = i; +! prog->state[i].lastlist[0] = 0; +! prog->state[i].lastlist[1] = 0; + } + + retval = nfa_regtry(prog, col); +*** ../vim-7.3.1105/src/version.c 2013-06-02 22:37:39.000000000 +0200 +--- src/version.c 2013-06-03 12:13:15.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1106, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +59. Your wife says communication is important in a marriage...so you buy + another computer and install a second phone line so the two of you can + chat. + + /// 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 /// diff --git a/7.3.1107 b/7.3.1107 new file mode 100644 index 0000000..23d14b7 --- /dev/null +++ b/7.3.1107 @@ -0,0 +1,80 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1107 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1107 +Problem: Compiler warnings for unused variables. +Solution: Put the variables inside #ifdef. +Files: src/regexp.c, src/regexp_nfa.c + + +*** ../vim-7.3.1106/src/regexp.c 2013-06-02 15:01:51.000000000 +0200 +--- src/regexp.c 2013-06-03 19:38:46.000000000 +0200 +*************** +*** 361,368 **** +--- 361,370 ---- + static char_u e_unmatchedpp[] = N_("E53: Unmatched %s%%("); + static char_u e_unmatchedp[] = N_("E54: Unmatched %s("); + static char_u e_unmatchedpar[] = N_("E55: Unmatched %s)"); ++ #ifdef FEAT_SYN_HL + static char_u e_z_not_allowed[] = N_("E66: \\z( not allowed here"); + static char_u e_z1_not_allowed[] = N_("E67: \\z1 et al. not allowed here"); ++ #endif + + #define NOT_MULTI 0 + #define MULTI_ONE 1 +*** ../vim-7.3.1106/src/regexp_nfa.c 2013-06-03 12:17:00.000000000 +0200 +--- src/regexp_nfa.c 2013-06-03 19:39:55.000000000 +0200 +*************** +*** 237,244 **** +--- 237,246 ---- + /* NFA regexp \1 .. \9 encountered. */ + static int nfa_has_backref; + ++ #ifdef FEAT_SYN_HL + /* NFA regexp has \z( ), set zsubexpr. */ + static int nfa_has_zsubexpr; ++ #endif + + /* Number of sub expressions actually being used during execution. 1 if only + * the whole match (subexpr 0) is used. */ +*************** +*** 420,426 **** + if (*p == '^') + { + not = TRUE; +! p ++; + } + + while (p < end) +--- 422,428 ---- + if (*p == '^') + { + not = TRUE; +! p++; + } + + while (p < end) +*** ../vim-7.3.1106/src/version.c 2013-06-03 12:17:00.000000000 +0200 +--- src/version.c 2013-06-03 19:39:34.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1107, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +70. ISDN lines are added to your house on a hourly basis + + /// 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 /// diff --git a/7.3.1108 b/7.3.1108 new file mode 100644 index 0000000..66b02b2 --- /dev/null +++ b/7.3.1108 @@ -0,0 +1,46 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1108 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1108 +Problem: Error message for os.fchdir() (Charles Peacech) +Solution: Clear the error. (ZyX) +Files: src/if_py_both.h + + +*** ../vim-7.3.1107/src/if_py_both.h 2013-06-02 18:54:16.000000000 +0200 +--- src/if_py_both.h 2013-06-03 20:01:23.000000000 +0200 +*************** +*** 5413,5418 **** +--- 5413,5420 ---- + if (PyObject_SetAttrString(os, "fchdir", get_attr(m, "fchdir"))) + return -1; + } ++ else ++ PyErr_Clear(); + + return 0; + } +*** ../vim-7.3.1107/src/version.c 2013-06-03 19:41:01.000000000 +0200 +--- src/version.c 2013-06-03 20:00:42.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1108, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +71. You wonder how people walk + + /// 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 /// diff --git a/7.3.1109 b/7.3.1109 new file mode 100644 index 0000000..1e0c049 --- /dev/null +++ b/7.3.1109 @@ -0,0 +1,134 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1109 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1109 +Problem: Building on MS-Windows doesn't see changes in if_py_both.h. +Solution: Add a dependency. (Ken Takata) +Files: src/Make_bc5.mak, src/Make_cyg.mak, src/Make_ming.mak, + src/Make_mvc.mak + + +*** ../vim-7.3.1108/src/Make_bc5.mak 2013-02-26 14:56:24.000000000 +0100 +--- src/Make_bc5.mak 2013-06-03 20:09:58.000000000 +0200 +*************** +*** 1006,1015 **** + $(PERL)\bin\perl.exe $(PERL)\lib\ExtUtils\xsubpp -prototypes -typemap \ + $(PERL)\lib\ExtUtils\typemap if_perl.xs > $@ + +! $(OBJDIR)\if_python.obj: if_python.c python.lib + $(CC) -I$(PYTHON)\include $(CCARG) $(CC1) $(CC2)$@ -pc if_python.c + +! $(OBJDIR)\if_python3.obj: if_python3.c python3.lib + $(CC) -I$(PYTHON3)\include $(CCARG) $(CC1) $(CC2)$@ -pc if_python3.c + + $(OBJDIR)\if_ruby.obj: if_ruby.c ruby.lib +--- 1006,1015 ---- + $(PERL)\bin\perl.exe $(PERL)\lib\ExtUtils\xsubpp -prototypes -typemap \ + $(PERL)\lib\ExtUtils\typemap if_perl.xs > $@ + +! $(OBJDIR)\if_python.obj: if_python.c if_py_both.h python.lib + $(CC) -I$(PYTHON)\include $(CCARG) $(CC1) $(CC2)$@ -pc if_python.c + +! $(OBJDIR)\if_python3.obj: if_python3.c if_py_both.h python3.lib + $(CC) -I$(PYTHON3)\include $(CCARG) $(CC1) $(CC2)$@ -pc if_python3.c + + $(OBJDIR)\if_ruby.obj: if_ruby.c ruby.lib +*** ../vim-7.3.1108/src/Make_cyg.mak 2013-05-19 19:16:25.000000000 +0200 +--- src/Make_cyg.mak 2013-06-03 20:09:58.000000000 +0200 +*************** +*** 648,657 **** + $(OUTDIR)/if_ole.o: if_ole.cpp $(INCL) + $(CC) -c $(CFLAGS) if_ole.cpp -o $(OUTDIR)/if_ole.o + +! $(OUTDIR)/if_python.o : if_python.c $(INCL) + $(CC) -c $(CFLAGS) -I$(PYTHON)/include $< -o $@ + +! $(OUTDIR)/if_python3.o : if_python3.c $(INCL) + $(CC) -c $(CFLAGS) -I$(PYTHON3)/include $< -o $@ + + if_perl.c: if_perl.xs typemap +--- 648,657 ---- + $(OUTDIR)/if_ole.o: if_ole.cpp $(INCL) + $(CC) -c $(CFLAGS) if_ole.cpp -o $(OUTDIR)/if_ole.o + +! $(OUTDIR)/if_python.o : if_python.c if_py_both.h $(INCL) + $(CC) -c $(CFLAGS) -I$(PYTHON)/include $< -o $@ + +! $(OUTDIR)/if_python3.o : if_python3.c if_py_both.h $(INCL) + $(CC) -c $(CFLAGS) -I$(PYTHON3)/include $< -o $@ + + if_perl.c: if_perl.xs typemap +*** ../vim-7.3.1108/src/Make_ming.mak 2013-05-19 19:16:25.000000000 +0200 +--- src/Make_ming.mak 2013-06-03 20:09:58.000000000 +0200 +*************** +*** 721,730 **** + structs.h regexp.h option.h ex_cmds.h proto.h globals.h farsi.h \ + gui.h + +! $(OUTDIR)/if_python.o : if_python.c $(INCL) + $(CC) -c $(CFLAGS) $(PYTHONINC) -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\" $< -o $@ + +! $(OUTDIR)/if_python3.o : if_python3.c $(INCL) + $(CC) -c $(CFLAGS) $(PYTHON3INC) -DDYNAMIC_PYTHON3_DLL=\"PYTHON$(PYTHON3_VER).dll\" $< -o $@ + + $(OUTDIR)/%.o : %.c $(INCL) +--- 721,730 ---- + structs.h regexp.h option.h ex_cmds.h proto.h globals.h farsi.h \ + gui.h + +! $(OUTDIR)/if_python.o : if_python.c if_py_both.h $(INCL) + $(CC) -c $(CFLAGS) $(PYTHONINC) -DDYNAMIC_PYTHON_DLL=\"python$(PYTHON_VER).dll\" $< -o $@ + +! $(OUTDIR)/if_python3.o : if_python3.c if_py_both.h $(INCL) + $(CC) -c $(CFLAGS) $(PYTHON3INC) -DDYNAMIC_PYTHON3_DLL=\"PYTHON$(PYTHON3_VER).dll\" $< -o $@ + + $(OUTDIR)/%.o : %.c $(INCL) +*** ../vim-7.3.1108/src/Make_mvc.mak 2013-05-19 21:03:50.000000000 +0200 +--- src/Make_mvc.mak 2013-06-03 20:09:58.000000000 +0200 +*************** +*** 1113,1122 **** + mzscheme_base.c: + $(MZSCHEME)\mzc --c-mods mzscheme_base.c ++lib scheme/base + +! $(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c $(INCL) + $(CC) $(CFLAGS) $(PYTHON_INC) if_python.c + +! $(OUTDIR)/if_python3.obj: $(OUTDIR) if_python3.c $(INCL) + $(CC) $(CFLAGS) $(PYTHON3_INC) if_python3.c + + $(OUTDIR)/if_ole.obj: $(OUTDIR) if_ole.cpp $(INCL) if_ole.h +--- 1113,1122 ---- + mzscheme_base.c: + $(MZSCHEME)\mzc --c-mods mzscheme_base.c ++lib scheme/base + +! $(OUTDIR)/if_python.obj: $(OUTDIR) if_python.c if_py_both.h $(INCL) + $(CC) $(CFLAGS) $(PYTHON_INC) if_python.c + +! $(OUTDIR)/if_python3.obj: $(OUTDIR) if_python3.c if_py_both.h $(INCL) + $(CC) $(CFLAGS) $(PYTHON3_INC) if_python3.c + + $(OUTDIR)/if_ole.obj: $(OUTDIR) if_ole.cpp $(INCL) if_ole.h +*** ../vim-7.3.1108/src/version.c 2013-06-03 20:04:43.000000000 +0200 +--- src/version.c 2013-06-03 20:10:22.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1109, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +74. Your most erotic dreams are about cybersex + + /// 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 /// diff --git a/7.3.1110 b/7.3.1110 new file mode 100644 index 0000000..a8944bf --- /dev/null +++ b/7.3.1110 @@ -0,0 +1,842 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1110 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1110 +Problem: New regexp matching: Using \@= and the like can be slow. +Solution: Decide whether to first try matching the zero-wdith part or what + follows, whatever is more likely to fail. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1109/src/regexp_nfa.c 2013-06-03 19:41:01.000000000 +0200 +--- src/regexp_nfa.c 2013-06-04 14:21:32.000000000 +0200 +*************** +*** 2824,2834 **** +--- 2824,2851 ---- + #endif + } regsubs_T; + ++ /* nfa_pim_T stores a Postponed Invisible Match. */ ++ typedef struct nfa_pim_S nfa_pim_T; ++ struct nfa_pim_S ++ { ++ nfa_state_T *state; ++ int result; /* NFA_PIM_TODO, NFA_PIM_[NO]MATCH */ ++ nfa_pim_T *pim; /* another PIM at the same position */ ++ regsubs_T subs; /* submatch info, only party used */ ++ }; ++ ++ /* Values for done in nfa_pim_T. */ ++ #define NFA_PIM_TODO 0 ++ #define NFA_PIM_MATCH 1 ++ #define NFA_PIM_NOMATCH -1 ++ ++ + /* nfa_thread_T contains execution information of a NFA state */ + typedef struct + { + nfa_state_T *state; + int count; ++ nfa_pim_T *pim; /* if not NULL: postponed invisible match */ + regsubs_T subs; /* submatch info, only party used */ + } nfa_thread_T; + +*************** +*** 2886,2892 **** + static void copy_sub_off __ARGS((regsub_T *to, regsub_T *from)); + static int sub_equal __ARGS((regsub_T *sub1, regsub_T *sub2)); + static void addstate __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs, int off)); +! static void addstate_here __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs, int *ip)); + + static void + clear_sub(sub) +--- 2903,2909 ---- + static void copy_sub_off __ARGS((regsub_T *to, regsub_T *from)); + static int sub_equal __ARGS((regsub_T *sub1, regsub_T *sub2)); + static void addstate __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs, int off)); +! static void addstate_here __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs, nfa_pim_T *pim, int *ip)); + + static void + clear_sub(sub) +*************** +*** 3032,3038 **** + + #ifdef ENABLE_LOG + static void +! report_state(char *action, regsub_T *sub, nfa_state_T *state, int lid); + { + int col; + +--- 3049,3055 ---- + + #ifdef ENABLE_LOG + static void +! report_state(char *action, regsub_T *sub, nfa_state_T *state, int lid) + { + int col; + +*************** +*** 3174,3181 **** + } + } + +! /* when there are backreferences the number of states may be (a +! * lot) bigger */ + if (nfa_has_backref && l->n == l->len) + { + int newlen = l->len * 3 / 2 + 50; +--- 3191,3198 ---- + } + } + +! /* when there are backreferences or look-behind matches the number +! * of states may be (a lot) bigger */ + if (nfa_has_backref && l->n == l->len) + { + int newlen = l->len * 3 / 2 + 50; +*************** +*** 3188,3193 **** +--- 3205,3211 ---- + state->lastlist[nfa_ll_index] = l->id; + thread = &l->t[l->n++]; + thread->state = state; ++ thread->pim = NULL; + copy_sub(&thread->subs.norm, &subs->norm); + #ifdef FEAT_SYN_HL + if (nfa_has_zsubexpr) +*************** +*** 3419,3439 **** + * matters for alternatives. + */ + static void +! addstate_here(l, state, subs, ip) + nfa_list_T *l; /* runtime state list */ + nfa_state_T *state; /* state to update */ + regsubs_T *subs; /* pointers to subexpressions */ + int *ip; + { + int tlen = l->n; + int count; +! int i = *ip; + + /* first add the state(s) at the end, so that we know how many there are */ + addstate(l, state, subs, 0); + + /* when "*ip" was at the end of the list, nothing to do */ +! if (i + 1 == tlen) + return; + + /* re-order to put the new state at the current position */ +--- 3437,3464 ---- + * matters for alternatives. + */ + static void +! addstate_here(l, state, subs, pim, ip) + nfa_list_T *l; /* runtime state list */ + nfa_state_T *state; /* state to update */ + regsubs_T *subs; /* pointers to subexpressions */ ++ nfa_pim_T *pim; /* postponed look-behind match */ + int *ip; + { + int tlen = l->n; + int count; +! int listidx = *ip; +! int i; + + /* first add the state(s) at the end, so that we know how many there are */ + addstate(l, state, subs, 0); + ++ /* fill in the "pim" field in the new states */ ++ if (pim != NULL) ++ for (i = tlen; i < l->n; ++i) ++ l->t[i].pim = pim; ++ + /* when "*ip" was at the end of the list, nothing to do */ +! if (listidx + 1 == tlen) + return; + + /* re-order to put the new state at the current position */ +*************** +*** 3441,3461 **** + if (count == 1) + { + /* overwrite the current state */ +! l->t[i] = l->t[l->n - 1]; + } + else if (count > 1) + { + /* make space for new states, then move them from the + * end to the current position */ +! mch_memmove(&(l->t[i + count]), +! &(l->t[i + 1]), +! sizeof(nfa_thread_T) * (l->n - i - 1)); +! mch_memmove(&(l->t[i]), + &(l->t[l->n - 1]), + sizeof(nfa_thread_T) * count); + } + --l->n; +! *ip = i - 1; + } + + /* +--- 3466,3486 ---- + if (count == 1) + { + /* overwrite the current state */ +! l->t[listidx] = l->t[l->n - 1]; + } + else if (count > 1) + { + /* make space for new states, then move them from the + * end to the current position */ +! mch_memmove(&(l->t[listidx + count]), +! &(l->t[listidx + 1]), +! sizeof(nfa_thread_T) * (l->n - listidx - 1)); +! mch_memmove(&(l->t[listidx]), + &(l->t[l->n - 1]), + sizeof(nfa_thread_T) * count); + } + --l->n; +! *ip = listidx - 1; + } + + /* +*************** +*** 3834,3839 **** +--- 3859,3903 ---- + return result; + } + ++ static int failure_chance __ARGS((nfa_state_T *state, int depth)); ++ ++ /* ++ * Estimate the chance of a match with "state" failing. ++ * NFA_ANY: 1 ++ * specific character: 99 ++ */ ++ static int ++ failure_chance(state, depth) ++ nfa_state_T *state; ++ int depth; ++ { ++ int c = state->c; ++ int l, r; ++ ++ /* detect looping */ ++ if (depth > 4) ++ return 1; ++ ++ if (c == NFA_SPLIT) ++ { ++ if (state->out->c == NFA_SPLIT || state->out1->c == NFA_SPLIT) ++ return 1; ++ l = failure_chance(state->out, depth + 1); ++ r = failure_chance(state->out1, depth + 1); ++ return l < r ? l : r; ++ } ++ if (c == NFA_ANY) ++ return 1; ++ if (c > 0) ++ return 99; ++ if ((c >= NFA_MOPEN && c <= NFA_MOPEN9) ++ || (c >= NFA_ZOPEN && c <= NFA_ZOPEN9) ++ || c == NFA_NOPEN) ++ return failure_chance(state->out, depth + 1); ++ /* something else */ ++ return 50; ++ } ++ + /* + * Main matching routine. + * +*************** +*** 3864,3869 **** +--- 3928,3937 ---- + nfa_list_T *nextlist; + nfa_list_T *neglist; + int *listids = NULL; ++ nfa_state_T *add_state; ++ int add_count; ++ int add_off; ++ garray_T pimlist; + #ifdef NFA_REGEXP_DEBUG_LOG + FILE *debug = fopen(NFA_REGEXP_DEBUG_LOG, "a"); + +*************** +*** 3874,3879 **** +--- 3942,3948 ---- + } + #endif + nfa_match = FALSE; ++ ga_init2(&pimlist, sizeof(nfa_pim_T), 5); + + /* Allocate memory for the lists of nodes. */ + size = (nstate + 1) * sizeof(nfa_thread_T); +*************** +*** 3923,3933 **** + listtbl[0][1] = neglist; + listtbl[1][0] = nextlist; + listtbl[1][1] = NULL; +! #define ADD_POS_NEG_STATE(node) \ +! ll = listtbl[result ? 1 : 0][node->negated]; \ +! if (ll != NULL) \ +! addstate(ll, node->out , &t->subs, clen); +! + + /* + * Run for each character. +--- 3992,4003 ---- + listtbl[0][1] = neglist; + listtbl[1][0] = nextlist; + listtbl[1][1] = NULL; +! #define ADD_POS_NEG_STATE(state) \ +! ll = listtbl[result ? 1 : 0][state->negated]; \ +! if (ll != NULL) { \ +! add_state = state->out; \ +! add_off = clen; \ +! } + + /* + * Run for each character. +*************** +*** 3965,3970 **** +--- 4035,4042 ---- + nextlist->id = nfa_listid + 1; + neglist->id = nfa_listid + 1; + ++ pimlist.ga_len = 0; ++ + #ifdef ENABLE_LOG + fprintf(log_fd, "------------------------------------------\n"); + fprintf(log_fd, ">>> Reginput is \"%s\"\n", reginput); +*************** +*** 4024,4029 **** +--- 4096,4103 ---- + * Handle the possible codes of the current state. + * The most important is NFA_MATCH. + */ ++ add_state = NULL; ++ add_count = 0; + switch (t->state->c) + { + case NFA_MATCH: +*************** +*** 4095,4127 **** + + case NFA_START_INVISIBLE: + case NFA_START_INVISIBLE_BEFORE: +! result = recursive_regmatch(t->state, prog, submatch, m, +! &listids); + +! /* for \@! it is a match when result is FALSE */ +! if (result != t->state->negated) +! { +! /* Copy submatch info from the recursive call */ +! copy_sub_off(&t->subs.norm, &m->norm); + #ifdef FEAT_SYN_HL +! copy_sub_off(&t->subs.synt, &m->synt); + #endif + +! /* t->state->out1 is the corresponding END_INVISIBLE node; +! * Add its out to the current list (zero-width match). */ +! addstate_here(thislist, t->state->out1->out, &t->subs, +! &listidx); + } + break; + + case NFA_BOL: + if (reginput == regline) +! addstate_here(thislist, t->state->out, &t->subs, &listidx); + break; + + case NFA_EOL: + if (curc == NUL) +! addstate_here(thislist, t->state->out, &t->subs, &listidx); + break; + + case NFA_BOW: +--- 4169,4256 ---- + + case NFA_START_INVISIBLE: + case NFA_START_INVISIBLE_BEFORE: +! /* If invisible match has a higher chance to fail, do it +! * right away. Otherwise postpone it until what follows is +! * matching and causes addstate(nextlist, ..) to be called. +! * This is indicated by the "pim" field. */ +! { +! nfa_pim_T *pim; +! int cout = t->state->out1->out->c; +! +! /* Do it directly when what follows is possibly end of +! * match (closing paren). +! * Postpone when it is \@<= or \@pim and check multiple +! * where it's used? +! * Otherwise first do the one that has the highest chance +! * of failing. */ +! if ((cout >= NFA_MCLOSE && cout <= NFA_MCLOSE9) +! || (cout >= NFA_ZCLOSE && cout <= NFA_ZCLOSE9) +! || cout == NFA_NCLOSE +! || t->pim != NULL +! || (t->state->c != NFA_START_INVISIBLE_BEFORE +! && failure_chance(t->state->out1->out, 0) +! < failure_chance(t->state->out, 0))) +! { +! /* +! * First try matching the invisible match, then what +! * follows. +! */ +! result = recursive_regmatch(t->state, prog, +! submatch, m, &listids); + +! /* for \@! it is a match when result is FALSE */ +! if (result != t->state->negated) +! { +! /* Copy submatch info from the recursive call */ +! copy_sub_off(&t->subs.norm, &m->norm); + #ifdef FEAT_SYN_HL +! copy_sub_off(&t->subs.synt, &m->synt); + #endif + +! /* t->state->out1 is the corresponding +! * END_INVISIBLE node; Add its out to the current +! * list (zero-width match). */ +! addstate_here(thislist, t->state->out1->out, +! &t->subs, t->pim, &listidx); +! } +! } +! else +! { +! /* +! * First try matching what follows at the current +! * position. Only if a match is found, addstate() is +! * called, then verify the invisible match matches. +! * Add a nfa_pim_T to the following states, it +! * contains info about the invisible match. +! */ +! if (ga_grow(&pimlist, 1) == FAIL) +! goto theend; +! pim = (nfa_pim_T *)pimlist.ga_data + pimlist.ga_len; +! ++pimlist.ga_len; +! pim->state = t->state; +! pim->pim = NULL; +! pim->result = NFA_PIM_TODO; +! +! /* t->state->out1 is the corresponding END_INVISIBLE +! * node; Add its out to the current list (zero-width +! * match). */ +! addstate_here(thislist, t->state->out1->out, &t->subs, +! pim, &listidx); +! } + } + break; + + case NFA_BOL: + if (reginput == regline) +! addstate_here(thislist, t->state->out, &t->subs, +! t->pim, &listidx); + break; + + case NFA_EOL: + if (curc == NUL) +! addstate_here(thislist, t->state->out, &t->subs, +! t->pim, &listidx); + break; + + case NFA_BOW: +*************** +*** 4148,4154 **** + && vim_iswordc_buf(reginput[-1], reg_buf))) + bow = FALSE; + if (bow) +! addstate_here(thislist, t->state->out, &t->subs, &listidx); + break; + } + +--- 4277,4284 ---- + && vim_iswordc_buf(reginput[-1], reg_buf))) + bow = FALSE; + if (bow) +! addstate_here(thislist, t->state->out, &t->subs, +! t->pim, &listidx); + break; + } + +*************** +*** 4176,4194 **** + && vim_iswordc_buf(curc, reg_buf))) + eow = FALSE; + if (eow) +! addstate_here(thislist, t->state->out, &t->subs, &listidx); + break; + } + + case NFA_BOF: + if (reglnum == 0 && reginput == regline + && (!REG_MULTI || reg_firstlnum == 1)) +! addstate_here(thislist, t->state->out, &t->subs, &listidx); + break; + + case NFA_EOF: + if (reglnum == reg_maxline && curc == NUL) +! addstate_here(thislist, t->state->out, &t->subs, &listidx); + break; + + #ifdef FEAT_MBYTE +--- 4306,4327 ---- + && vim_iswordc_buf(curc, reg_buf))) + eow = FALSE; + if (eow) +! addstate_here(thislist, t->state->out, &t->subs, +! t->pim, &listidx); + break; + } + + case NFA_BOF: + if (reglnum == 0 && reginput == regline + && (!REG_MULTI || reg_firstlnum == 1)) +! addstate_here(thislist, t->state->out, &t->subs, +! t->pim, &listidx); + break; + + case NFA_EOF: + if (reglnum == reg_maxline && curc == NUL) +! addstate_here(thislist, t->state->out, &t->subs, +! t->pim, &listidx); + break; + + #ifdef FEAT_MBYTE +*************** +*** 4277,4288 **** + go_to_nextline = TRUE; + /* Pass -1 for the offset, which means taking the position + * at the start of the next line. */ +! addstate(nextlist, t->state->out, &t->subs, -1); + } + else if (curc == '\n' && reg_line_lbr) + { + /* match \n as if it is an ordinary character */ +! addstate(nextlist, t->state->out, &t->subs, 1); + } + break; + +--- 4410,4425 ---- + go_to_nextline = TRUE; + /* Pass -1 for the offset, which means taking the position + * at the start of the next line. */ +! ll = nextlist; +! add_state = t->state->out; +! add_off = -1; + } + else if (curc == '\n' && reg_line_lbr) + { + /* match \n as if it is an ordinary character */ +! ll = nextlist; +! add_state = t->state->out; +! add_off = 1; + } + break; + +*************** +*** 4310,4322 **** + /* This follows a series of negated nodes, like: + * CHAR(x), NFA_NOT, CHAR(y), NFA_NOT etc. */ + if (curc > 0) +! addstate(nextlist, t->state->out, &t->subs, clen); + break; + + case NFA_ANY: + /* Any char except '\0', (end of input) does not match. */ + if (curc > 0) +! addstate(nextlist, t->state->out, &t->subs, clen); + break; + + /* +--- 4447,4467 ---- + /* This follows a series of negated nodes, like: + * CHAR(x), NFA_NOT, CHAR(y), NFA_NOT etc. */ + if (curc > 0) +! { +! ll = nextlist; +! add_state = t->state->out; +! add_off = clen; +! } + break; + + case NFA_ANY: + /* Any char except '\0', (end of input) does not match. */ + if (curc > 0) +! { +! ll = nextlist; +! add_state = t->state->out; +! add_off = clen; +! } + break; + + /* +*************** +*** 4498,4510 **** + /* empty match always works, output of NFA_SKIP to be + * used next */ + addstate_here(thislist, t->state->out->out, &t->subs, +! &listidx); + } + else if (bytelen <= clen) + { + /* match current character, jump ahead to out of + * NFA_SKIP */ +! addstate(nextlist, t->state->out->out, &t->subs, clen); + #ifdef ENABLE_LOG + log_subsexpr(&nextlist->t[nextlist->n - 1].subs); + #endif +--- 4643,4657 ---- + /* empty match always works, output of NFA_SKIP to be + * used next */ + addstate_here(thislist, t->state->out->out, &t->subs, +! t->pim, &listidx); + } + else if (bytelen <= clen) + { + /* match current character, jump ahead to out of + * NFA_SKIP */ +! ll = nextlist; +! add_state = t->state->out->out; +! add_off = clen; + #ifdef ENABLE_LOG + log_subsexpr(&nextlist->t[nextlist->n - 1].subs); + #endif +*************** +*** 4513,4520 **** + { + /* skip ofer the matched characters, set character + * count in NFA_SKIP */ +! addstate(nextlist, t->state->out, &t->subs, bytelen); +! nextlist->t[nextlist->n - 1].count = bytelen - clen; + #ifdef ENABLE_LOG + log_subsexpr(&nextlist->t[nextlist->n - 1].subs); + #endif +--- 4660,4669 ---- + { + /* skip ofer the matched characters, set character + * count in NFA_SKIP */ +! ll = nextlist; +! add_state = t->state->out; +! add_off = bytelen; +! add_count = bytelen - clen; + #ifdef ENABLE_LOG + log_subsexpr(&nextlist->t[nextlist->n - 1].subs); + #endif +*************** +*** 4528,4534 **** + if (t->count - clen <= 0) + { + /* end of match, go to what follows */ +! addstate(nextlist, t->state->out, &t->subs, clen); + #ifdef ENABLE_LOG + log_subsexpr(&nextlist->t[nextlist->n - 1].subs); + #endif +--- 4677,4685 ---- + if (t->count - clen <= 0) + { + /* end of match, go to what follows */ +! ll = nextlist; +! add_state = t->state->out; +! add_off = clen; + #ifdef ENABLE_LOG + log_subsexpr(&nextlist->t[nextlist->n - 1].subs); + #endif +*************** +*** 4536,4543 **** + else + { + /* add state again with decremented count */ +! addstate(nextlist, t->state, &t->subs, 0); +! nextlist->t[nextlist->n - 1].count = t->count - clen; + #ifdef ENABLE_LOG + log_subsexpr(&nextlist->t[nextlist->n - 1].subs); + #endif +--- 4687,4696 ---- + else + { + /* add state again with decremented count */ +! ll = nextlist; +! add_state = t->state; +! add_off = 0; +! add_count = t->count - clen; + #ifdef ENABLE_LOG + log_subsexpr(&nextlist->t[nextlist->n - 1].subs); + #endif +*************** +*** 4557,4563 **** + nfa_re_num_cmp(t->state->val, t->state->c - NFA_LNUM, + (long_u)(reglnum + reg_firstlnum))); + if (result) +! addstate_here(thislist, t->state->out, &t->subs, &listidx); + break; + + case NFA_COL: +--- 4710,4717 ---- + nfa_re_num_cmp(t->state->val, t->state->c - NFA_LNUM, + (long_u)(reglnum + reg_firstlnum))); + if (result) +! addstate_here(thislist, t->state->out, &t->subs, +! t->pim, &listidx); + break; + + case NFA_COL: +*************** +*** 4566,4572 **** + result = nfa_re_num_cmp(t->state->val, t->state->c - NFA_COL, + (long_u)(reginput - regline) + 1); + if (result) +! addstate_here(thislist, t->state->out, &t->subs, &listidx); + break; + + case NFA_VCOL: +--- 4720,4727 ---- + result = nfa_re_num_cmp(t->state->val, t->state->c - NFA_COL, + (long_u)(reginput - regline) + 1); + if (result) +! addstate_here(thislist, t->state->out, &t->subs, +! t->pim, &listidx); + break; + + case NFA_VCOL: +*************** +*** 4577,4583 **** + reg_win == NULL ? curwin : reg_win, + regline, (colnr_T)(reginput - regline)) + 1); + if (result) +! addstate_here(thislist, t->state->out, &t->subs, &listidx); + break; + + case NFA_CURSOR: +--- 4732,4739 ---- + reg_win == NULL ? curwin : reg_win, + regline, (colnr_T)(reginput - regline)) + 1); + if (result) +! addstate_here(thislist, t->state->out, &t->subs, +! t->pim, &listidx); + break; + + case NFA_CURSOR: +*************** +*** 4586,4592 **** + && ((colnr_T)(reginput - regline) + == reg_win->w_cursor.col)); + if (result) +! addstate_here(thislist, t->state->out, &t->subs, &listidx); + break; + + default: /* regular character */ +--- 4742,4749 ---- + && ((colnr_T)(reginput - regline) + == reg_win->w_cursor.col)); + if (result) +! addstate_here(thislist, t->state->out, &t->subs, +! t->pim, &listidx); + break; + + default: /* regular character */ +*************** +*** 4613,4618 **** +--- 4770,4834 ---- + ADD_POS_NEG_STATE(t->state); + break; + } ++ ++ } /* switch (t->state->c) */ ++ ++ if (add_state != NULL) ++ { ++ if (t->pim != NULL) ++ { ++ /* postponed invisible match */ ++ /* TODO: also do t->pim->pim recursively? */ ++ if (t->pim->result == NFA_PIM_TODO) ++ { ++ #ifdef ENABLE_LOG ++ fprintf(log_fd, "\n"); ++ fprintf(log_fd, "==================================\n"); ++ fprintf(log_fd, "Postponed recursive nfa_regmatch()\n"); ++ fprintf(log_fd, "\n"); ++ #endif ++ result = recursive_regmatch(t->pim->state, ++ prog, submatch, m, &listids); ++ t->pim->result = result ? NFA_PIM_MATCH ++ : NFA_PIM_NOMATCH; ++ /* for \@! it is a match when result is FALSE */ ++ if (result != t->pim->state->negated) ++ { ++ /* Copy submatch info from the recursive call */ ++ copy_sub_off(&t->pim->subs.norm, &m->norm); ++ #ifdef FEAT_SYN_HL ++ copy_sub_off(&t->pim->subs.synt, &m->synt); ++ #endif ++ } ++ } ++ else ++ { ++ result = (t->pim->result == NFA_PIM_MATCH); ++ #ifdef ENABLE_LOG ++ fprintf(log_fd, "\n"); ++ fprintf(log_fd, "Using previous recursive nfa_regmatch() result, result == %d\n", t->pim->result); ++ fprintf(log_fd, "MATCH = %s\n", result == TRUE ? "OK" : "FALSE"); ++ fprintf(log_fd, "\n"); ++ #endif ++ } ++ ++ /* for \@! it is a match when result is FALSE */ ++ if (result != t->pim->state->negated) ++ { ++ /* Copy submatch info from the recursive call */ ++ copy_sub_off(&t->subs.norm, &t->pim->subs.norm); ++ #ifdef FEAT_SYN_HL ++ copy_sub_off(&t->subs.synt, &t->pim->subs.synt); ++ #endif ++ } ++ else ++ /* look-behind match failed, don't add the state */ ++ continue; ++ } ++ ++ addstate(ll, add_state, &t->subs, add_off); ++ if (add_count > 0) ++ nextlist->t[ll->n - 1].count = add_count; + } + + } /* for (thislist = thislist; thislist->state; thislist++) */ +*************** +*** 4680,4685 **** +--- 4896,4902 ---- + vim_free(list[1].t); + vim_free(list[2].t); + vim_free(listids); ++ ga_clear(&pimlist); + #undef ADD_POS_NEG_STATE + #ifdef NFA_REGEXP_DEBUG_LOG + fclose(debug); +*** ../vim-7.3.1109/src/version.c 2013-06-03 20:12:47.000000000 +0200 +--- src/version.c 2013-06-04 13:51:17.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1110, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +80. At parties, you introduce your spouse as your "service provider." + + /// 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 /// diff --git a/7.3.1111.patched b/7.3.1111.patched new file mode 100644 index 0000000..514c47c --- /dev/null +++ b/7.3.1111.patched @@ -0,0 +1,469 @@ +Patch 7.3.1111 +Problem: nfa_recognize_char_class() implementation is inefficient. +Solution: Use bits in an int instead of chars in a string. (Dominique Pelle) +Files: src/regexp_nfa.c, src/testdir/test36.in, src/testdir/test36.ok +Comment: Karsten Hopp: manually redone patch as it didn't apply + + + +diff -up vim73/src/regexp_nfa.c.1111 vim73/src/regexp_nfa.c +--- vim73/src/regexp_nfa.c.1111 2013-07-09 14:56:29.355057017 +0200 ++++ vim73/src/regexp_nfa.c 2013-07-09 15:04:06.283217016 +0200 +@@ -380,38 +380,18 @@ nfa_recognize_char_class(start, end, ext + char_u *end; + int extra_newl; + { +- int i; +- /* Each of these variables takes up a char in "config[]", +- * in the order they are here. */ +- int not = FALSE, af = FALSE, AF = FALSE, az = FALSE, AZ = FALSE, +- o7 = FALSE, o9 = FALSE, underscore = FALSE, newl = FALSE; ++# define CLASS_not 0x80 ++# define CLASS_af 0x40 ++# define CLASS_AF 0x20 ++# define CLASS_az 0x10 ++# define CLASS_AZ 0x08 ++# define CLASS_o7 0x04 ++# define CLASS_o9 0x02 ++# define CLASS_underscore 0x01 ++ ++ int newl = FALSE; + char_u *p; +-#define NCONFIGS 16 +- int classid[NCONFIGS] = { +- NFA_DIGIT, NFA_NDIGIT, NFA_HEX, NFA_NHEX, +- NFA_OCTAL, NFA_NOCTAL, NFA_WORD, NFA_NWORD, +- NFA_HEAD, NFA_NHEAD, NFA_ALPHA, NFA_NALPHA, +- NFA_LOWER, NFA_NLOWER, NFA_UPPER, NFA_NUPPER +- }; +- char_u myconfig[10]; +- char_u config[NCONFIGS][9] = { +- "000000100", /* digit */ +- "100000100", /* non digit */ +- "011000100", /* hex-digit */ +- "111000100", /* non hex-digit */ +- "000001000", /* octal-digit */ +- "100001000", /* [^0-7] */ +- "000110110", /* [0-9A-Za-z_] */ +- "100110110", /* [^0-9A-Za-z_] */ +- "000110010", /* head of word */ +- "100110010", /* not head of word */ +- "000110000", /* alphabetic char a-z */ +- "100110000", /* non alphabetic char */ +- "000100000", /* lowercase letter */ +- "100100000", /* non lowercase */ +- "000010000", /* uppercase */ +- "100010000" /* non uppercase */ +- }; ++ int config = 0; + + if (extra_newl == TRUE) + newl = TRUE; +@@ -421,7 +401,7 @@ nfa_recognize_char_class(start, end, ext + p = start; + if (*p == '^') + { +- not = TRUE; ++ config |= CLASS_not; + p++; + } + +@@ -434,37 +414,37 @@ nfa_recognize_char_class(start, end, ext + case '0': + if (*(p + 2) == '9') + { +- o9 = TRUE; ++ config |= CLASS_o9; + break; + } + else + if (*(p + 2) == '7') + { +- o7 = TRUE; ++ config |= CLASS_o7; + break; + } + case 'a': + if (*(p + 2) == 'z') + { +- az = TRUE; ++ config |= CLASS_az; + break; + } + else + if (*(p + 2) == 'f') + { +- af = TRUE; ++ config |= CLASS_af; + break; + } + case 'A': + if (*(p + 2) == 'Z') + { +- AZ = TRUE; ++ config |= CLASS_AZ; + break; + } + else + if (*(p + 2) == 'F') + { +- AF = TRUE; ++ config |= CLASS_AF; + break; + } + /* FALLTHROUGH */ +@@ -480,7 +460,7 @@ nfa_recognize_char_class(start, end, ext + } + else if (*p == '_') + { +- underscore = TRUE; ++ config |= CLASS_underscore; + p ++; + } + else if (*p == '\n') +@@ -495,38 +475,45 @@ nfa_recognize_char_class(start, end, ext + if (p != end) + return FAIL; + +- /* build the config that represents the ranges we gathered */ +- STRCPY(myconfig, "000000000"); +- if (not == TRUE) +- myconfig[0] = '1'; +- if (af == TRUE) +- myconfig[1] = '1'; +- if (AF == TRUE) +- myconfig[2] = '1'; +- if (az == TRUE) +- myconfig[3] = '1'; +- if (AZ == TRUE) +- myconfig[4] = '1'; +- if (o7 == TRUE) +- myconfig[5] = '1'; +- if (o9 == TRUE) +- myconfig[6] = '1'; +- if (underscore == TRUE) +- myconfig[7] = '1'; + if (newl == TRUE) +- { +- myconfig[8] = '1'; + extra_newl = ADD_NL; +- } +- /* try to recognize character classes */ +- for (i = 0; i < NCONFIGS; i++) +- if (STRNCMP(myconfig, config[i], 8) == 0) +- return classid[i] + extra_newl; + +- /* fallthrough => no success so far */ ++ switch (config) ++ { ++ case CLASS_o9: ++ return extra_newl + NFA_DIGIT; ++ case CLASS_not | CLASS_o9: ++ return extra_newl + NFA_NDIGIT; ++ case CLASS_af | CLASS_AF | CLASS_o9: ++ return extra_newl + NFA_HEX; ++ case CLASS_not | CLASS_af | CLASS_AF | CLASS_o9: ++ return extra_newl + NFA_NHEX; ++ case CLASS_o7: ++ return extra_newl + NFA_OCTAL; ++ case CLASS_not | CLASS_o7: ++ return extra_newl + NFA_NOCTAL; ++ case CLASS_az | CLASS_AZ | CLASS_o9 | CLASS_underscore: ++ return extra_newl + NFA_WORD; ++ case CLASS_not | CLASS_az | CLASS_AZ | CLASS_o9 | CLASS_underscore: ++ return extra_newl + NFA_NWORD; ++ case CLASS_az | CLASS_AZ | CLASS_underscore: ++ return extra_newl + NFA_HEAD; ++ case CLASS_not | CLASS_az | CLASS_AZ | CLASS_underscore: ++ return extra_newl + NFA_NHEAD; ++ case CLASS_az | CLASS_AZ: ++ return extra_newl + NFA_ALPHA; ++ case CLASS_not | CLASS_az | CLASS_AZ: ++ return extra_newl + NFA_NALPHA; ++ case CLASS_az: ++ return extra_newl + NFA_LOWER; ++ case CLASS_not | CLASS_az: ++ return extra_newl + NFA_NLOWER; ++ case CLASS_AZ: ++ return extra_newl + NFA_UPPER; ++ case CLASS_not | CLASS_AZ: ++ return extra_newl + NFA_NUPPER; ++ } + return FAIL; +- +-#undef NCONFIGS + } + + /* +@@ -900,7 +887,7 @@ nfa_regatom() + EMSG_RET_FAIL(_(e_z1_not_allowed)); + EMIT(NFA_ZREF1 + (no_Magic(c) - '1')); + /* No need to set nfa_has_backref, the sub-matches don't +- * change when \z1 .. \z9 maches or not. */ ++ * change when \z1 .. \z9 matches or not. */ + re_has_z = REX_USE; + break; + case '(': +@@ -4658,7 +4645,7 @@ nfa_regmatch(prog, start, submatch, m) + } + else + { +- /* skip ofer the matched characters, set character ++ /* skip over the matched characters, set character + * count in NFA_SKIP */ + ll = nextlist; + add_state = t->state->out; +diff -up vim73/src/testdir/test36.in.1111 vim73/src/testdir/test36.in +--- vim73/src/testdir/test36.in.1111 2013-07-09 15:04:36.243178056 +0200 ++++ vim73/src/testdir/test36.in 2013-07-09 15:06:54.077397744 +0200 +@@ -1,40 +1,105 @@ +-Test character classes in regexp ++Test character classes in regexp using regexpengine 0, 1, 2. + + STARTTEST +-/^start-here +-j:s/\d//g +-j:s/\D//g +-j:s/\o//g +-j:s/\O//g +-j:s/\x//g +-j:s/\X//g +-j:s/\w//g +-j:s/\W//g +-j:s/\h//g +-j:s/\H//g +-j:s/\a//g +-j:s/\A//g +-j:s/\l//g +-j:s/\L//g +-j:s/\u//g +-j:s/\U//g ++/^start-here/+1 ++Y:s/\%#=0\d//g ++p:s/\%#=1\d//g ++p:s/\%#=2\d//g ++p:s/\%#=0[0-9]//g ++p:s/\%#=1[0-9]//g ++p:s/\%#=2[0-9]//g ++p:s/\%#=0\D//g ++p:s/\%#=1\D//g ++p:s/\%#=2\D//g ++p:s/\%#=0[^0-9]//g ++p:s/\%#=1[^0-9]//g ++p:s/\%#=2[^0-9]//g ++p:s/\%#=0\o//g ++p:s/\%#=1\o//g ++p:s/\%#=2\o//g ++p:s/\%#=0[0-7]//g ++p:s/\%#=1[0-7]//g ++p:s/\%#=2[0-7]//g ++p:s/\%#=0\O//g ++p:s/\%#=1\O//g ++p:s/\%#=2\O//g ++p:s/\%#=0[^0-7]//g ++p:s/\%#=1[^0-7]//g ++p:s/\%#=2[^0-7]//g ++p:s/\%#=0\x//g ++p:s/\%#=1\x//g ++p:s/\%#=2\x//g ++p:s/\%#=0[0-9A-Fa-f]//g ++p:s/\%#=1[0-9A-Fa-f]//g ++p:s/\%#=2[0-9A-Fa-f]//g ++p:s/\%#=0\X//g ++p:s/\%#=1\X//g ++p:s/\%#=2\X//g ++p:s/\%#=0[^0-9A-Fa-f]//g ++p:s/\%#=1[^0-9A-Fa-f]//g ++p:s/\%#=2[^0-9A-Fa-f]//g ++p:s/\%#=0\w//g ++p:s/\%#=1\w//g ++p:s/\%#=2\w//g ++p:s/\%#=0[0-9A-Za-z_]//g ++p:s/\%#=1[0-9A-Za-z_]//g ++p:s/\%#=2[0-9A-Za-z_]//g ++p:s/\%#=0\W//g ++p:s/\%#=1\W//g ++p:s/\%#=2\W//g ++p:s/\%#=0[^0-9A-Za-z_]//g ++p:s/\%#=1[^0-9A-Za-z_]//g ++p:s/\%#=2[^0-9A-Za-z_]//g ++p:s/\%#=0\h//g ++p:s/\%#=1\h//g ++p:s/\%#=2\h//g ++p:s/\%#=0[A-Za-z_]//g ++p:s/\%#=1[A-Za-z_]//g ++p:s/\%#=2[A-Za-z_]//g ++p:s/\%#=0\H//g ++p:s/\%#=1\H//g ++p:s/\%#=2\H//g ++p:s/\%#=0[^A-Za-z_]//g ++p:s/\%#=1[^A-Za-z_]//g ++p:s/\%#=2[^A-Za-z_]//g ++p:s/\%#=0\a//g ++p:s/\%#=1\a//g ++p:s/\%#=2\a//g ++p:s/\%#=0[A-Za-z]//g ++p:s/\%#=1[A-Za-z]//g ++p:s/\%#=2[A-Za-z]//g ++p:s/\%#=0\A//g ++p:s/\%#=1\A//g ++p:s/\%#=2\A//g ++p:s/\%#=0[^A-Za-z]//g ++p:s/\%#=1[^A-Za-z]//g ++p:s/\%#=2[^A-Za-z]//g ++p:s/\%#=0\l//g ++p:s/\%#=1\l//g ++p:s/\%#=2\l//g ++p:s/\%#=0[a-z]//g ++p:s/\%#=1[a-z]//g ++p:s/\%#=2[a-z]//g ++p:s/\%#=0\L//g ++p:s/\%#=1\L//g ++p:s/\%#=2\L//g ++p:s/\%#=0[^a-z]//g ++p:s/\%#=1[^a-z]//g ++p:s/\%#=2[^a-z]//g ++p:s/\%#=0\u//g ++p:s/\%#=1\u//g ++p:s/\%#=2\u//g ++p:s/\%#=0[A-Z]//g ++p:s/\%#=1[A-Z]//g ++p:s/\%#=2[A-Z]//g ++p:s/\%#=0\U//g ++p:s/\%#=1\U//g ++p:s/\%#=2\U//g ++p:s/\%#=0[^A-Z]//g ++p:s/\%#=1[^A-Z]//g ++p:s/\%#=2[^A-Z]//g + :/^start-here/+1,$wq! test.out + ENDTEST + + start-here + !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� +- !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� +- !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� +- !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� +- !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� +- !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� +- !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� +- !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� +- !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� +- !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� +- !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� +- !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� +- !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� +- !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� +- !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� +- !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� +diff -up vim73/src/testdir/test36.ok.1111 vim73/src/testdir/test36.ok +--- vim73/src/testdir/test36.ok.1111 2013-07-09 15:07:04.737028021 +0200 ++++ vim73/src/testdir/test36.ok 2013-07-09 15:10:07.822677205 +0200 +@@ -1,16 +1,96 @@ + !"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� ++ !"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� ++ !"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� ++ !"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� ++ !"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� ++ !"#$%&'()#+'-./:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� ++0123456789 ++0123456789 ++0123456789 ++0123456789 ++0123456789 + 0123456789 + !"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� ++ !"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� ++ !"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� ++ !"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� ++ !"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� ++ !"#$%&'()#+'-./89:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~���������� ++01234567 ++01234567 ++01234567 ++01234567 ++01234567 + 01234567 + !"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~���������� ++ !"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~���������� ++ !"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~���������� ++ !"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~���������� ++ !"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~���������� ++ !"#$%&'()#+'-./:;<=>?@GHIXYZ[\]^_`ghiwxyz{|}~���������� ++0123456789ABCDEFabcdef ++0123456789ABCDEFabcdef ++0123456789ABCDEFabcdef ++0123456789ABCDEFabcdef ++0123456789ABCDEFabcdef + 0123456789ABCDEFabcdef + !"#$%&'()#+'-./:;<=>?@[\]^`{|}~���������� ++ !"#$%&'()#+'-./:;<=>?@[\]^`{|}~���������� ++ !"#$%&'()#+'-./:;<=>?@[\]^`{|}~���������� ++ !"#$%&'()#+'-./:;<=>?@[\]^`{|}~���������� ++ !"#$%&'()#+'-./:;<=>?@[\]^`{|}~���������� ++ !"#$%&'()#+'-./:;<=>?@[\]^`{|}~���������� ++0123456789ABCDEFGHIXYZ_abcdefghiwxyz ++0123456789ABCDEFGHIXYZ_abcdefghiwxyz ++0123456789ABCDEFGHIXYZ_abcdefghiwxyz ++0123456789ABCDEFGHIXYZ_abcdefghiwxyz ++0123456789ABCDEFGHIXYZ_abcdefghiwxyz + 0123456789ABCDEFGHIXYZ_abcdefghiwxyz + !"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~���������� ++ !"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~���������� ++ !"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~���������� ++ !"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~���������� ++ !"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~���������� ++ !"#$%&'()#+'-./0123456789:;<=>?@[\]^`{|}~���������� ++ABCDEFGHIXYZ_abcdefghiwxyz ++ABCDEFGHIXYZ_abcdefghiwxyz ++ABCDEFGHIXYZ_abcdefghiwxyz ++ABCDEFGHIXYZ_abcdefghiwxyz ++ABCDEFGHIXYZ_abcdefghiwxyz + ABCDEFGHIXYZ_abcdefghiwxyz + !"#$%&'()#+'-./0123456789:;<=>?@[\]^_`{|}~���������� ++ !"#$%&'()#+'-./0123456789:;<=>?@[\]^_`{|}~���������� ++ !"#$%&'()#+'-./0123456789:;<=>?@[\]^_`{|}~���������� ++ !"#$%&'()#+'-./0123456789:;<=>?@[\]^_`{|}~���������� ++ !"#$%&'()#+'-./0123456789:;<=>?@[\]^_`{|}~���������� ++ !"#$%&'()#+'-./0123456789:;<=>?@[\]^_`{|}~���������� ++ABCDEFGHIXYZabcdefghiwxyz ++ABCDEFGHIXYZabcdefghiwxyz ++ABCDEFGHIXYZabcdefghiwxyz ++ABCDEFGHIXYZabcdefghiwxyz ++ABCDEFGHIXYZabcdefghiwxyz + ABCDEFGHIXYZabcdefghiwxyz + !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`{|}~���������� ++ !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`{|}~���������� ++ !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`{|}~���������� ++ !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`{|}~���������� ++ !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`{|}~���������� ++ !"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`{|}~���������� ++abcdefghiwxyz ++abcdefghiwxyz ++abcdefghiwxyz ++abcdefghiwxyz ++abcdefghiwxyz + abcdefghiwxyz + !"#$%&'()#+'-./0123456789:;<=>?@[\]^_`abcdefghiwxyz{|}~���������� ++ !"#$%&'()#+'-./0123456789:;<=>?@[\]^_`abcdefghiwxyz{|}~���������� ++ !"#$%&'()#+'-./0123456789:;<=>?@[\]^_`abcdefghiwxyz{|}~���������� ++ !"#$%&'()#+'-./0123456789:;<=>?@[\]^_`abcdefghiwxyz{|}~���������� ++ !"#$%&'()#+'-./0123456789:;<=>?@[\]^_`abcdefghiwxyz{|}~���������� ++ !"#$%&'()#+'-./0123456789:;<=>?@[\]^_`abcdefghiwxyz{|}~���������� ++ABCDEFGHIXYZ ++ABCDEFGHIXYZ ++ABCDEFGHIXYZ ++ABCDEFGHIXYZ ++ABCDEFGHIXYZ + ABCDEFGHIXYZ +diff -up vim73/src/version.c.1111 vim73/src/version.c +--- vim73/src/version.c.1111 2013-07-09 15:10:34.038767743 +0200 ++++ vim73/src/version.c 2013-07-09 15:11:04.404714295 +0200 +@@ -729,6 +729,8 @@ static char *(features[]) = + static int included_patches[] = + { /* Add new patch number below this line */ + /**/ ++ 1111, ++/**/ + 1110, + /**/ + 1109, diff --git a/7.3.1112 b/7.3.1112 new file mode 100644 index 0000000..015d3f8 --- /dev/null +++ b/7.3.1112 @@ -0,0 +1,311 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1112 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1112 +Problem: New regexp engine: \%V not supported. +Solution: Implement \%V. Add tests. +Files: src/regexp.c, src/regexp_nfa.c, src/testdir/test64.in, + src/testdir/test64.ok + + +*** ../vim-7.3.1111/src/regexp.c 2013-06-03 19:41:01.000000000 +0200 +--- src/regexp.c 2013-06-04 18:28:12.000000000 +0200 +*************** +*** 4165,4170 **** +--- 4165,4249 ---- + } + + #endif ++ #ifdef FEAT_VISUAL ++ static int reg_match_visual __ARGS((void)); ++ ++ /* ++ * Return TRUE if the current reginput position matches the Visual area. ++ */ ++ static int ++ reg_match_visual() ++ { ++ pos_T top, bot; ++ linenr_T lnum; ++ colnr_T col; ++ win_T *wp = reg_win == NULL ? curwin : reg_win; ++ int mode; ++ colnr_T start, end; ++ colnr_T start2, end2; ++ colnr_T cols; ++ ++ /* Check if the buffer is the current buffer. */ ++ if (reg_buf != curbuf || VIsual.lnum == 0) ++ return FALSE; ++ ++ if (VIsual_active) ++ { ++ if (lt(VIsual, wp->w_cursor)) ++ { ++ top = VIsual; ++ bot = wp->w_cursor; ++ } ++ else ++ { ++ top = wp->w_cursor; ++ bot = VIsual; ++ } ++ mode = VIsual_mode; ++ } ++ else ++ { ++ if (lt(curbuf->b_visual.vi_start, curbuf->b_visual.vi_end)) ++ { ++ top = curbuf->b_visual.vi_start; ++ bot = curbuf->b_visual.vi_end; ++ } ++ else ++ { ++ top = curbuf->b_visual.vi_end; ++ bot = curbuf->b_visual.vi_start; ++ } ++ mode = curbuf->b_visual.vi_mode; ++ } ++ lnum = reglnum + reg_firstlnum; ++ if (lnum < top.lnum || lnum > bot.lnum) ++ return FALSE; ++ ++ if (mode == 'v') ++ { ++ col = (colnr_T)(reginput - regline); ++ if ((lnum == top.lnum && col < top.col) ++ || (lnum == bot.lnum && col >= bot.col + (*p_sel != 'e'))) ++ return FALSE; ++ } ++ else if (mode == Ctrl_V) ++ { ++ getvvcol(wp, &top, &start, NULL, &end); ++ getvvcol(wp, &bot, &start2, NULL, &end2); ++ if (start2 < start) ++ start = start2; ++ if (end2 > end) ++ end = end2; ++ if (top.col == MAXCOL || bot.col == MAXCOL) ++ end = MAXCOL; ++ cols = win_linetabsize(wp, regline, (colnr_T)(reginput - regline)); ++ if (cols < start || cols > end - (*p_sel == 'e')) ++ return FALSE; ++ } ++ return TRUE; ++ } ++ #endif ++ + #define ADVANCE_REGINPUT() mb_ptr_adv(reginput) + + /* +*************** +*** 4347,4426 **** + + case RE_VISUAL: + #ifdef FEAT_VISUAL +! /* Check if the buffer is the current buffer. and whether the +! * position is inside the Visual area. */ +! if (reg_buf != curbuf || VIsual.lnum == 0) +! status = RA_NOMATCH; +! else +! { +! pos_T top, bot; +! linenr_T lnum; +! colnr_T col; +! win_T *wp = reg_win == NULL ? curwin : reg_win; +! int mode; +! +! if (VIsual_active) +! { +! if (lt(VIsual, wp->w_cursor)) +! { +! top = VIsual; +! bot = wp->w_cursor; +! } +! else +! { +! top = wp->w_cursor; +! bot = VIsual; +! } +! mode = VIsual_mode; +! } +! else +! { +! if (lt(curbuf->b_visual.vi_start, curbuf->b_visual.vi_end)) +! { +! top = curbuf->b_visual.vi_start; +! bot = curbuf->b_visual.vi_end; +! } +! else +! { +! top = curbuf->b_visual.vi_end; +! bot = curbuf->b_visual.vi_start; +! } +! mode = curbuf->b_visual.vi_mode; +! } +! lnum = reglnum + reg_firstlnum; +! col = (colnr_T)(reginput - regline); +! if (lnum < top.lnum || lnum > bot.lnum) +! status = RA_NOMATCH; +! else if (mode == 'v') +! { +! if ((lnum == top.lnum && col < top.col) +! || (lnum == bot.lnum +! && col >= bot.col + (*p_sel != 'e'))) +! status = RA_NOMATCH; +! } +! else if (mode == Ctrl_V) +! { +! colnr_T start, end; +! colnr_T start2, end2; +! colnr_T cols; +! +! getvvcol(wp, &top, &start, NULL, &end); +! getvvcol(wp, &bot, &start2, NULL, &end2); +! if (start2 < start) +! start = start2; +! if (end2 > end) +! end = end2; +! if (top.col == MAXCOL || bot.col == MAXCOL) +! end = MAXCOL; +! cols = win_linetabsize(wp, +! regline, (colnr_T)(reginput - regline)); +! if (cols < start || cols > end - (*p_sel == 'e')) +! status = RA_NOMATCH; +! } +! } +! #else +! status = RA_NOMATCH; + #endif + break; + + case RE_LNUM: +--- 4426,4434 ---- + + case RE_VISUAL: + #ifdef FEAT_VISUAL +! if (!reg_match_visual()) + #endif ++ status = RA_NOMATCH; + break; + + case RE_LNUM: +*** ../vim-7.3.1111/src/regexp_nfa.c 2013-06-04 17:47:00.000000000 +0200 +--- src/regexp_nfa.c 2013-06-04 18:22:04.000000000 +0200 +*************** +*** 178,183 **** +--- 178,184 ---- + NFA_VCOL, /* Match cursor virtual column */ + NFA_VCOL_GT, /* Match > cursor virtual column */ + NFA_VCOL_LT, /* Match < cursor virtual column */ ++ NFA_VISUAL, /* Match Visual area */ + + NFA_FIRST_NL = NFA_ANY + ADD_NL, + NFA_LAST_NL = NFA_NUPPER + ADD_NL, +*************** +*** 960,967 **** + break; + + case 'V': +! /* TODO: not supported yet */ +! return FAIL; + break; + + case '[': +--- 961,967 ---- + break; + + case 'V': +! EMIT(NFA_VISUAL); + break; + + case '[': +*************** +*** 4731,4736 **** +--- 4731,4743 ---- + if (result) + addstate_here(thislist, t->state->out, &t->subs, + t->pim, &listidx); ++ break; ++ ++ case NFA_VISUAL: ++ result = reg_match_visual(); ++ if (result) ++ addstate_here(thislist, t->state->out, &t->subs, ++ t->pim, &listidx); + break; + + default: /* regular character */ +*** ../vim-7.3.1111/src/testdir/test64.in 2013-06-02 16:07:05.000000000 +0200 +--- src/testdir/test64.in 2013-06-04 18:07:59.000000000 +0200 +*************** +*** 458,463 **** +--- 458,471 ---- + :.yank + Gop:" + :" ++ :" Check matching Visual area ++ /^Visual: ++ jfxvfx:s/\%Ve/E/g ++ jV:s/\%Va/A/g ++ jfxfxj:s/\%Vo/O/g ++ :/^Visual/+1,/^Visual/+4yank ++ Gop:" ++ :" + :" Check patterns matching cursor position. + :func! Postest() + new +*************** +*** 520,523 **** +--- 528,537 ---- + asdfasd +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1113 +Problem: New regexp engine: \%'m not supported. +Solution: Implement \%'m. Add tests. +Files: src/regexp.c, src/regexp_nfa.c, src/testdir/test64.in, + src/testdir/test64.ok + + +*** ../vim-7.3.1112/src/regexp.c 2013-06-04 18:28:45.000000000 +0200 +--- src/regexp.c 2013-06-04 21:06:13.000000000 +0200 +*************** +*** 4401,4408 **** + break; + + case RE_MARK: +! /* Compare the mark position to the match position. NOTE: Always +! * uses the current buffer. */ + { + int mark = OPERAND(scan)[0]; + int cmp = OPERAND(scan)[1]; +--- 4401,4407 ---- + break; + + case RE_MARK: +! /* Compare the mark position to the match position. */ + { + int mark = OPERAND(scan)[0]; + int cmp = OPERAND(scan)[1]; +*************** +*** 4410,4416 **** + + pos = getmark_buf(reg_buf, mark, FALSE); + if (pos == NULL /* mark doesn't exist */ +! || pos->lnum <= 0 /* mark isn't set (in curbuf) */ + || (pos->lnum == reglnum + reg_firstlnum + ? (pos->col == (colnr_T)(reginput - regline) + ? (cmp == '<' || cmp == '>') +--- 4409,4415 ---- + + pos = getmark_buf(reg_buf, mark, FALSE); + if (pos == NULL /* mark doesn't exist */ +! || pos->lnum <= 0 /* mark isn't set in reg_buf */ + || (pos->lnum == reglnum + reg_firstlnum + ? (pos->col == (colnr_T)(reginput - regline) + ? (cmp == '<' || cmp == '>') +*** ../vim-7.3.1112/src/regexp_nfa.c 2013-06-04 18:28:45.000000000 +0200 +--- src/regexp_nfa.c 2013-06-04 21:19:11.000000000 +0200 +*************** +*** 178,183 **** +--- 178,186 ---- + NFA_VCOL, /* Match cursor virtual column */ + NFA_VCOL_GT, /* Match > cursor virtual column */ + NFA_VCOL_LT, /* Match < cursor virtual column */ ++ NFA_MARK, /* Match mark */ ++ NFA_MARK_GT, /* Match > mark */ ++ NFA_MARK_LT, /* Match < mark */ + NFA_VISUAL, /* Match Visual area */ + + NFA_FIRST_NL = NFA_ANY + ADD_NL, +*************** +*** 984,1002 **** + { + EMIT(n); + if (c == 'l') + EMIT(cmp == '<' ? NFA_LNUM_LT : +! cmp == '>' ? NFA_LNUM_GT : NFA_LNUM); + else if (c == 'c') + EMIT(cmp == '<' ? NFA_COL_LT : +! cmp == '>' ? NFA_COL_GT : NFA_COL); + else + EMIT(cmp == '<' ? NFA_VCOL_LT : +! cmp == '>' ? NFA_VCOL_GT : NFA_VCOL); + break; + } +- else if (c == '\'') +- /* TODO: \%'m not supported yet */ +- return FAIL; + } + syntax_error = TRUE; + EMSGN(_("E867: (NFA) Unknown operator '\\%%%c'"), +--- 987,1013 ---- + { + EMIT(n); + if (c == 'l') ++ /* \%{n}l \%{n}l */ + EMIT(cmp == '<' ? NFA_LNUM_LT : +! cmp == '>' ? NFA_LNUM_GT : NFA_LNUM); + else if (c == 'c') ++ /* \%{n}c \%{n}c */ + EMIT(cmp == '<' ? NFA_COL_LT : +! cmp == '>' ? NFA_COL_GT : NFA_COL); + else ++ /* \%{n}v \%{n}v */ + EMIT(cmp == '<' ? NFA_VCOL_LT : +! cmp == '>' ? NFA_VCOL_GT : NFA_VCOL); +! break; +! } +! else if (c == '\'' && n == 0) +! { +! /* \%'m \%<'m \%>'m */ +! EMIT(getchr()); +! EMIT(cmp == '<' ? NFA_MARK_LT : +! cmp == '>' ? NFA_MARK_GT : NFA_MARK); + break; + } + } + syntax_error = TRUE; + EMSGN(_("E867: (NFA) Unknown operator '\\%%%c'"), +*************** +*** 1931,1936 **** +--- 1942,1962 ---- + case NFA_BOW: STRCPY(code, "NFA_BOW "); break; + case NFA_EOF: STRCPY(code, "NFA_EOF "); break; + case NFA_BOF: STRCPY(code, "NFA_BOF "); break; ++ case NFA_LNUM: STRCPY(code, "NFA_LNUM "); break; ++ case NFA_LNUM_GT: STRCPY(code, "NFA_LNUM_GT "); break; ++ case NFA_LNUM_LT: STRCPY(code, "NFA_LNUM_LT "); break; ++ case NFA_COL: STRCPY(code, "NFA_COL "); break; ++ case NFA_COL_GT: STRCPY(code, "NFA_COL_GT "); break; ++ case NFA_COL_LT: STRCPY(code, "NFA_COL_LT "); break; ++ case NFA_VCOL: STRCPY(code, "NFA_VCOL "); break; ++ case NFA_VCOL_GT: STRCPY(code, "NFA_VCOL_GT "); break; ++ case NFA_VCOL_LT: STRCPY(code, "NFA_VCOL_LT "); break; ++ case NFA_MARK: STRCPY(code, "NFA_MARK "); break; ++ case NFA_MARK_GT: STRCPY(code, "NFA_MARK_GT "); break; ++ case NFA_MARK_LT: STRCPY(code, "NFA_MARK_LT "); break; ++ case NFA_CURSOR: STRCPY(code, "NFA_CURSOR "); break; ++ case NFA_VISUAL: STRCPY(code, "NFA_VISUAL "); break; ++ + case NFA_STAR: STRCPY(code, "NFA_STAR "); break; + case NFA_STAR_NONGREEDY: STRCPY(code, "NFA_STAR_NONGREEDY "); break; + case NFA_QUEST: STRCPY(code, "NFA_QUEST"); break; +*************** +*** 2715,2720 **** +--- 2741,2749 ---- + case NFA_COL: + case NFA_COL_GT: + case NFA_COL_LT: ++ case NFA_MARK: ++ case NFA_MARK_GT: ++ case NFA_MARK_LT: + if (nfa_calc_size == TRUE) + { + nstate += 1; +*************** +*** 2724,2730 **** + s = alloc_state(*p, NULL, NULL); + if (s == NULL) + goto theend; +! s->val = e1.start->c; + PUSH(frag(s, list1(&s->out))); + break; + +--- 2753,2759 ---- + s = alloc_state(*p, NULL, NULL); + if (s == NULL) + goto theend; +! s->val = e1.start->c; /* lnum, col or mark name */ + PUSH(frag(s, list1(&s->out))); + break; + +*************** +*** 4723,4728 **** +--- 4752,4781 ---- + t->pim, &listidx); + break; + ++ case NFA_MARK: ++ case NFA_MARK_GT: ++ case NFA_MARK_LT: ++ { ++ pos_T *pos = getmark_buf(reg_buf, t->state->val, FALSE); ++ ++ /* Compare the mark position to the match position. */ ++ result = (pos != NULL /* mark doesn't exist */ ++ && pos->lnum > 0 /* mark isn't set in reg_buf */ ++ && (pos->lnum == reglnum + reg_firstlnum ++ ? (pos->col == (colnr_T)(reginput - regline) ++ ? t->state->c == NFA_MARK ++ : (pos->col < (colnr_T)(reginput - regline) ++ ? t->state->c == NFA_MARK_GT ++ : t->state->c == NFA_MARK_LT)) ++ : (pos->lnum < reglnum + reg_firstlnum ++ ? t->state->c == NFA_MARK_GT ++ : t->state->c == NFA_MARK_LT))); ++ if (result) ++ addstate_here(thislist, t->state->out, &t->subs, ++ t->pim, &listidx); ++ break; ++ } ++ + case NFA_CURSOR: + result = (reg_win != NULL + && (reglnum + reg_firstlnum == reg_win->w_cursor.lnum) +*** ../vim-7.3.1112/src/testdir/test64.in 2013-06-04 18:28:45.000000000 +0200 +--- src/testdir/test64.in 2013-06-04 21:20:13.000000000 +0200 +*************** +*** 466,471 **** +--- 466,478 ---- + :/^Visual/+1,/^Visual/+4yank + Gop:" + :" ++ :" Check matching marks ++ /^Marks: ++ jfSmsfEme:.-4,.+6s/.\%>'s.*\%<'e../here/ ++ jfSmsj0fEme:.-4,.+6s/.\%>'s\_.*\%<'e../again/ ++ :/^Marks:/+1,/^Marks:/+3yank ++ Gop:" ++ :" + :" Check patterns matching cursor position. + :func! Postest() + new +*************** +*** 534,537 **** +--- 541,549 ---- + oooxofor foroxooo + oooxofor foroxooo + ++ Marks: ++ asdfSasdfsadfEasdf ++ asdfSas ++ dfsadfEasdf ++ + Results of test64: +*** ../vim-7.3.1112/src/testdir/test64.ok 2013-06-04 18:28:45.000000000 +0200 +--- src/testdir/test64.ok 2013-06-04 20:55:08.000000000 +0200 +*************** +*** 862,867 **** +--- 862,871 ---- + AndAxAnd AndAxAnd + oooxOfOr fOrOxooo + oooxOfOr fOrOxooo ++ ++ asdfhereasdf ++ asdfagainasdf ++ + -0- + ffo + bob +*** ../vim-7.3.1112/src/version.c 2013-06-04 18:28:45.000000000 +0200 +--- src/version.c 2013-06-04 21:25:20.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1113, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +89. In addition to your e-mail address being on your business + cards you even have your own domain. + + /// 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 /// diff --git a/7.3.1114 b/7.3.1114 new file mode 100644 index 0000000..a38d57d --- /dev/null +++ b/7.3.1114 @@ -0,0 +1,59 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1114 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1114 (after 7.3.1110) +Problem: Can't build without the syntax feature. +Solution: Add #ifdefs. (Erik Falor) +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1113/src/regexp_nfa.c 2013-06-04 21:27:33.000000000 +0200 +--- src/regexp_nfa.c 2013-06-04 21:39:30.000000000 +0200 +*************** +*** 3907,3913 **** +--- 3907,3915 ---- + if (c > 0) + return 99; + if ((c >= NFA_MOPEN && c <= NFA_MOPEN9) ++ #ifdef FEAT_SYN_HL + || (c >= NFA_ZOPEN && c <= NFA_ZOPEN9) ++ #endif + || c == NFA_NOPEN) + return failure_chance(state->out, depth + 1); + /* something else */ +*************** +*** 4201,4207 **** +--- 4203,4211 ---- + * Otherwise first do the one that has the highest chance + * of failing. */ + if ((cout >= NFA_MCLOSE && cout <= NFA_MCLOSE9) ++ #ifdef FEAT_SYN_HL + || (cout >= NFA_ZCLOSE && cout <= NFA_ZCLOSE9) ++ #endif + || cout == NFA_NCLOSE + || t->pim != NULL + || (t->state->c != NFA_START_INVISIBLE_BEFORE +*** ../vim-7.3.1113/src/version.c 2013-06-04 21:27:33.000000000 +0200 +--- src/version.c 2013-06-04 21:41:41.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1114, + /**/ + +-- +From "know your smileys": + y:-) Bad toupee + + /// 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 /// diff --git a/7.3.1115 b/7.3.1115 new file mode 100644 index 0000000..fa75d99 --- /dev/null +++ b/7.3.1115 @@ -0,0 +1,284 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1115 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1115 +Problem: Many users don't like the cursor line number when 'relativenumber' + is set. +Solution: Have four combinations with 'number' and 'relativenumber'. + (Christian Brabandt) +Files: runtime/doc/options.txt, src/option.c, src/screen.c, + src/testdir/test89.in, src/testdir/test89.ok + + +*** ../vim-7.3.1114/runtime/doc/options.txt 2013-03-19 16:46:59.000000000 +0100 +--- runtime/doc/options.txt 2013-06-04 22:01:35.000000000 +0200 +*************** +*** 5077,5084 **** + number. + When a long, wrapped line doesn't start with the first character, '-' + characters are put before the number. +! See |hl-LineNr| for the highlighting used for the number. +! When setting this option, 'relativenumber' is reset. + + *'numberwidth'* *'nuw'* + 'numberwidth' 'nuw' number (Vim default: 4 Vi default: 8) +--- 5130,5149 ---- + number. + When a long, wrapped line doesn't start with the first character, '-' + characters are put before the number. +! See |hl-LineNr| and |hl-CursorLineNr| for the highlighting used for +! the number. +! *number_relativenumber* +! The 'relativenumber' option changes the displayed number to be +! relative to the cursor. Together with 'number' there are these +! four combinations (cursor in line 3): +! +! 'nonu' 'nu' 'nonu' 'nu' +! 'nornu' 'nornu' 'rnu' 'rnu' +! +! |apple | 1 apple | 2 apple | 2 apple +! |pear | 2 pear | 1 pear | 1 pear +! |nobody | 3 nobody | 0 nobody |3 nobody +! |there | 4 there | 1 there | 1 there + + *'numberwidth'* *'nuw'* + 'numberwidth' 'nuw' number (Vim default: 4 Vi default: 8) +*************** +*** 5484,5491 **** + number. + When a long, wrapped line doesn't start with the first character, '-' + characters are put before the number. +! See |hl-LineNr| for the highlighting used for the number. +! When setting this option, 'number' is reset. + + *'remap'* *'noremap'* + 'remap' boolean (default on) +--- 5556,5567 ---- + number. + When a long, wrapped line doesn't start with the first character, '-' + characters are put before the number. +! See |hl-LineNr| and |hl-CursorLineNr| for the highlighting used for +! the number. +! +! The number in front of the cursor line also depends on the value of +! 'number', see |number_relativenumber| for all combinations of the two +! options. + + *'remap'* *'noremap'* + 'remap' boolean (default on) +*** ../vim-7.3.1114/src/option.c 2013-05-21 22:38:14.000000000 +0200 +--- src/option.c 2013-06-04 21:52:13.000000000 +0200 +*************** +*** 7647,7681 **** + } + #endif + +- /* If 'number' is set, reset 'relativenumber'. */ +- /* If 'relativenumber' is set, reset 'number'. */ +- else if ((int *)varp == &curwin->w_p_nu && curwin->w_p_nu) +- { +- curwin->w_p_rnu = FALSE; +- +- /* Only reset the global value if the own value is set globally. */ +- if (((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0)) +- curwin->w_allbuf_opt.wo_rnu = FALSE; +- } +- else if ((int *)varp == &curwin->w_p_rnu && curwin->w_p_rnu) +- { +- curwin->w_p_nu = FALSE; +- +- /* Only reset the global value if the own value is set globally. */ +- if (((opt_flags & (OPT_LOCAL | OPT_GLOBAL)) == 0)) +- curwin->w_allbuf_opt.wo_nu = FALSE; +- } +- else if ((int *)varp == &curwin->w_allbuf_opt.wo_nu +- && curwin->w_allbuf_opt.wo_nu) +- { +- curwin->w_allbuf_opt.wo_rnu = FALSE; +- } +- else if ((int *)varp == &curwin->w_allbuf_opt.wo_rnu +- && curwin->w_allbuf_opt.wo_rnu) +- { +- curwin->w_allbuf_opt.wo_nu = FALSE; +- } +- + else if ((int *)varp == &curbuf->b_p_ro) + { + /* when 'readonly' is reset globally, also reset readonlymode */ +--- 7647,7652 ---- +*** ../vim-7.3.1114/src/screen.c 2013-05-06 04:21:35.000000000 +0200 +--- src/screen.c 2013-06-04 22:04:39.000000000 +0200 +*************** +*** 2329,2343 **** + if (len > w + 1) + len = w + 1; + +! if (wp->w_p_nu) +! /* 'number' */ + num = (long)lnum; + else + { + /* 'relativenumber', don't use negative numbers */ + num = labs((long)get_cursor_rel_lnum(wp, lnum)); +! if (num == 0) + { + num = lnum; + fmt = "%-*ld "; + } +--- 2329,2345 ---- + if (len > w + 1) + len = w + 1; + +! if (wp->w_p_nu && !wp->w_p_rnu) +! /* 'number' + 'norelativenumber' */ + num = (long)lnum; + else + { + /* 'relativenumber', don't use negative numbers */ + num = labs((long)get_cursor_rel_lnum(wp, lnum)); +! if (num == 0 && wp->w_p_nu && wp->w_p_rnu) + { ++ /* 'number' + 'relativenumber': cursor line shows absolute ++ * line number */ + num = lnum; + fmt = "%-*ld "; + } +*************** +*** 3499,3513 **** + long num; + char *fmt = "%*ld "; + +! if (wp->w_p_nu) +! /* 'number' */ + num = (long)lnum; + else + { + /* 'relativenumber', don't use negative numbers */ + num = labs((long)get_cursor_rel_lnum(wp, lnum)); +! if (num == 0) + { + num = lnum; + fmt = "%-*ld "; + } +--- 3501,3516 ---- + long num; + char *fmt = "%*ld "; + +! if (wp->w_p_nu && !wp->w_p_rnu) +! /* 'number' + 'norelativenumber' */ + num = (long)lnum; + else + { + /* 'relativenumber', don't use negative numbers */ + num = labs((long)get_cursor_rel_lnum(wp, lnum)); +! if (num == 0 && wp->w_p_nu && wp->w_p_rnu) + { ++ /* 'number' + 'relativenumber' */ + num = lnum; + fmt = "%-*ld "; + } +*************** +*** 10260,10266 **** + int n; + linenr_T lnum; + +! lnum = wp->w_buffer->b_ml.ml_line_count; + + if (lnum == wp->w_nrwidth_line_count) + return wp->w_nrwidth_width; +--- 10263,10274 ---- + int n; + linenr_T lnum; + +! if (wp->w_p_rnu && !wp->w_p_nu) +! /* cursor line shows "0" */ +! lnum = wp->w_height; +! else +! /* cursor line shows absolute line number */ +! lnum = wp->w_buffer->b_ml.ml_line_count; + + if (lnum == wp->w_nrwidth_line_count) + return wp->w_nrwidth_width; +*** ../vim-7.3.1114/src/testdir/test89.in 2013-04-24 15:47:11.000000000 +0200 +--- src/testdir/test89.in 2013-06-04 21:59:01.000000000 +0200 +*************** +*** 1,4 **** +--- 1,6 ---- + Some tests for setting 'number' and 'relativenumber' ++ This is not all that useful now that the options are no longer reset when ++ setting the other. + + STARTTEST + :so small.vim +*** ../vim-7.3.1114/src/testdir/test89.ok 2013-03-13 20:42:28.000000000 +0100 +--- src/testdir/test89.ok 2013-06-04 21:58:09.000000000 +0200 +*************** +*** 1,9 **** + results: + +! nonumber + relativenumber + +! nonumber + relativenumber + :setlocal must NOT reset the other global value + +--- 1,9 ---- + results: + +! number + relativenumber + +! number + relativenumber + :setlocal must NOT reset the other global value + +*************** +*** 12,22 **** + relativenumber + :setglobal MUST reset the other global value + +! nonumber + +! norelativenumber + :set MUST reset the other global value + +! nonumber + +! norelativenumber +--- 12,22 ---- + relativenumber + :setglobal MUST reset the other global value + +! number + +! relativenumber + :set MUST reset the other global value + +! number + +! relativenumber +*** ../vim-7.3.1114/src/version.c 2013-06-04 21:42:19.000000000 +0200 +--- src/version.c 2013-06-04 22:11:05.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1115, + /**/ + +-- +From "know your smileys": + :----} You lie like Pinocchio + + /// 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 /// diff --git a/7.3.1116 b/7.3.1116 new file mode 100644 index 0000000..cbc448e --- /dev/null +++ b/7.3.1116 @@ -0,0 +1,91 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1116 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1116 +Problem: Can't build without Visual mode. +Solution: Add #ifdefs. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1115/src/regexp_nfa.c 2013-06-04 21:42:19.000000000 +0200 +--- src/regexp_nfa.c 2013-06-05 11:01:40.000000000 +0200 +*************** +*** 181,187 **** +--- 181,189 ---- + NFA_MARK, /* Match mark */ + NFA_MARK_GT, /* Match > mark */ + NFA_MARK_LT, /* Match < mark */ ++ #ifdef FEAT_VISUAL + NFA_VISUAL, /* Match Visual area */ ++ #endif + + NFA_FIRST_NL = NFA_ANY + ADD_NL, + NFA_LAST_NL = NFA_NUPPER + ADD_NL, +*************** +*** 963,971 **** +--- 965,975 ---- + EMIT(NFA_CURSOR); + break; + ++ #ifdef FEAT_VISUAL + case 'V': + EMIT(NFA_VISUAL); + break; ++ #endif + + case '[': + /* TODO: \%[abc] not supported yet */ +*************** +*** 1955,1961 **** +--- 1959,1967 ---- + case NFA_MARK_GT: STRCPY(code, "NFA_MARK_GT "); break; + case NFA_MARK_LT: STRCPY(code, "NFA_MARK_LT "); break; + case NFA_CURSOR: STRCPY(code, "NFA_CURSOR "); break; ++ #ifdef FEAT_VISUAL + case NFA_VISUAL: STRCPY(code, "NFA_VISUAL "); break; ++ #endif + + case NFA_STAR: STRCPY(code, "NFA_STAR "); break; + case NFA_STAR_NONGREEDY: STRCPY(code, "NFA_STAR_NONGREEDY "); break; +*************** +*** 4790,4801 **** +--- 4796,4809 ---- + t->pim, &listidx); + break; + ++ #ifdef FEAT_VISUAL + case NFA_VISUAL: + result = reg_match_visual(); + if (result) + addstate_here(thislist, t->state->out, &t->subs, + t->pim, &listidx); + break; ++ #endif + + default: /* regular character */ + { +*** ../vim-7.3.1115/src/version.c 2013-06-04 22:13:45.000000000 +0200 +--- src/version.c 2013-06-04 23:42:50.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1116, + /**/ + +-- +From "know your smileys": + ;-0 Can't find shift key + ,-9 Kann Umschalttaste nicht finden + + /// 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 /// diff --git a/7.3.1117 b/7.3.1117 new file mode 100644 index 0000000..524cafe --- /dev/null +++ b/7.3.1117 @@ -0,0 +1,337 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1117 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1117 +Problem: New regexp engine: \%[abc] not supported. +Solution: Implement \%[abc]. Add tests. +Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok + + +*** ../vim-7.3.1116/src/regexp_nfa.c 2013-06-05 11:01:59.000000000 +0200 +--- src/regexp_nfa.c 2013-06-05 11:03:19.000000000 +0200 +*************** +*** 61,66 **** +--- 61,67 ---- + NFA_COMPOSING, /* Next nodes in NFA are part of the + composing multibyte char */ + NFA_END_COMPOSING, /* End of a composing char in the NFA */ ++ NFA_OPT_CHARS, /* \%[abc] */ + + /* The following are used only in the postfix form, not in the NFA */ + NFA_PREV_ATOM_NO_WIDTH, /* Used for \@= */ +*************** +*** 972,979 **** + #endif + + case '[': +! /* TODO: \%[abc] not supported yet */ +! return FAIL; + + default: + { +--- 973,993 ---- + #endif + + case '[': +! { +! int n; +! +! /* \%[abc] */ +! for (n = 0; (c = getchr()) != ']'; ++n) +! { +! if (c == NUL) +! EMSG2_RET_FAIL(_(e_missing_sb), +! reg_magic == MAGIC_ALL); +! EMIT(c); +! } +! EMIT(NFA_OPT_CHARS); +! EMIT(n); +! break; +! } + + default: + { +*************** +*** 989,995 **** + } + if (c == 'l' || c == 'c' || c == 'v') + { +- EMIT(n); + if (c == 'l') + /* \%{n}l \%{n}l */ + EMIT(cmp == '<' ? NFA_LNUM_LT : +--- 1003,1008 ---- +*************** +*** 1002,1015 **** + /* \%{n}v \%{n}v */ + EMIT(cmp == '<' ? NFA_VCOL_LT : + cmp == '>' ? NFA_VCOL_GT : NFA_VCOL); + break; + } + else if (c == '\'' && n == 0) + { + /* \%'m \%<'m \%>'m */ +- EMIT(getchr()); + EMIT(cmp == '<' ? NFA_MARK_LT : + cmp == '>' ? NFA_MARK_GT : NFA_MARK); + break; + } + } +--- 1015,1029 ---- + /* \%{n}v \%{n}v */ + EMIT(cmp == '<' ? NFA_VCOL_LT : + cmp == '>' ? NFA_VCOL_GT : NFA_VCOL); ++ EMIT(n); + break; + } + else if (c == '\'' && n == 0) + { + /* \%'m \%<'m \%>'m */ + EMIT(cmp == '<' ? NFA_MARK_LT : + cmp == '>' ? NFA_MARK_GT : NFA_MARK); ++ EMIT(getchr()); + break; + } + } +*************** +*** 1885,1890 **** +--- 1899,1905 ---- + + case NFA_COMPOSING: STRCPY(code, "NFA_COMPOSING"); break; + case NFA_END_COMPOSING: STRCPY(code, "NFA_END_COMPOSING"); break; ++ case NFA_OPT_CHARS: STRCPY(code, "NFA_OPT_CHARS"); break; + + case NFA_MOPEN: + case NFA_MOPEN1: +*************** +*** 2558,2567 **** +--- 2573,2621 ---- + PUSH(frag(s, list1(&s->out))); + break; + ++ case NFA_OPT_CHARS: ++ { ++ int n; ++ ++ /* \%[abc] */ ++ n = *++p; /* get number of characters */ ++ if (nfa_calc_size == TRUE) ++ { ++ nstate += n; ++ break; ++ } ++ e1.out = NULL; /* stores list with out1's */ ++ s1 = NULL; /* previous NFA_SPLIT to connect to */ ++ while (n-- > 0) ++ { ++ e = POP(); /* get character */ ++ s = alloc_state(NFA_SPLIT, e.start, NULL); ++ if (s == NULL) ++ goto theend; ++ if (e1.out == NULL) ++ e1 = e; ++ patch(e.out, s1); ++ append(e1.out, list1(&s->out1)); ++ s1 = s; ++ } ++ PUSH(frag(s, e1.out)); ++ break; ++ } ++ + case NFA_PREV_ATOM_NO_WIDTH: + case NFA_PREV_ATOM_NO_WIDTH_NEG: + case NFA_PREV_ATOM_JUST_BEFORE: + case NFA_PREV_ATOM_JUST_BEFORE_NEG: ++ { ++ int neg = (*p == NFA_PREV_ATOM_NO_WIDTH_NEG ++ || *p == NFA_PREV_ATOM_JUST_BEFORE_NEG); ++ int before = (*p == NFA_PREV_ATOM_JUST_BEFORE ++ || *p == NFA_PREV_ATOM_JUST_BEFORE_NEG); ++ int n; ++ ++ if (before) ++ n = *++p; /* get the count */ ++ + /* The \@= operator: match the preceding atom with zero width. + * The \@! operator: no match for the preceding atom. + * The \@<= operator: match for the preceding atom. +*************** +*** 2583,2603 **** + s = alloc_state(NFA_START_INVISIBLE, e.start, s1); + if (s == NULL) + goto theend; +! if (*p == NFA_PREV_ATOM_NO_WIDTH_NEG +! || *p == NFA_PREV_ATOM_JUST_BEFORE_NEG) + { + s->negated = TRUE; + s1->negated = TRUE; + } +! if (*p == NFA_PREV_ATOM_JUST_BEFORE +! || *p == NFA_PREV_ATOM_JUST_BEFORE_NEG) + { +! s->val = *++p; /* get the count */ + ++s->c; /* NFA_START_INVISIBLE -> NFA_START_INVISIBLE_BEFORE */ + } + + PUSH(frag(s, list1(&s1->out))); + break; + + #ifdef FEAT_MBYTE + case NFA_COMPOSING: /* char with composing char */ +--- 2637,2656 ---- + s = alloc_state(NFA_START_INVISIBLE, e.start, s1); + if (s == NULL) + goto theend; +! if (neg) + { + s->negated = TRUE; + s1->negated = TRUE; + } +! if (before) + { +! s->val = n; /* store the count */ + ++s->c; /* NFA_START_INVISIBLE -> NFA_START_INVISIBLE_BEFORE */ + } + + PUSH(frag(s, list1(&s1->out))); + break; ++ } + + #ifdef FEAT_MBYTE + case NFA_COMPOSING: /* char with composing char */ +*************** +*** 2750,2767 **** + case NFA_MARK: + case NFA_MARK_GT: + case NFA_MARK_LT: + if (nfa_calc_size == TRUE) + { + nstate += 1; + break; + } +! e1 = POP(); +! s = alloc_state(*p, NULL, NULL); + if (s == NULL) + goto theend; +! s->val = e1.start->c; /* lnum, col or mark name */ + PUSH(frag(s, list1(&s->out))); + break; + + case NFA_ZSTART: + case NFA_ZEND: +--- 2803,2823 ---- + case NFA_MARK: + case NFA_MARK_GT: + case NFA_MARK_LT: ++ { ++ int n = *++p; /* lnum, col or mark name */ ++ + if (nfa_calc_size == TRUE) + { + nstate += 1; + break; + } +! s = alloc_state(p[-1], NULL, NULL); + if (s == NULL) + goto theend; +! s->val = n; + PUSH(frag(s, list1(&s->out))); + break; ++ } + + case NFA_ZSTART: + case NFA_ZEND: +*** ../vim-7.3.1116/src/testdir/test64.in 2013-06-04 21:27:33.000000000 +0200 +--- src/testdir/test64.in 2013-06-04 23:45:44.000000000 +0200 +*************** +*** 352,357 **** +--- 352,370 ---- + :call add(tl, [2, '\%u0020', 'yes no', ' ']) + :call add(tl, [2, '\%U00000020', 'yes no', ' ']) + :" ++ :""""" \%[abc] ++ :call add(tl, [2, 'foo\%[bar]', 'fobar']) ++ :call add(tl, [2, 'foo\%[bar]', 'foobar', 'foobar']) ++ :call add(tl, [2, 'foo\%[bar]', 'fooxx', 'foo']) ++ :call add(tl, [2, 'foo\%[bar]', 'foobxx', 'foob']) ++ :call add(tl, [2, 'foo\%[bar]', 'foobaxx', 'fooba']) ++ :call add(tl, [2, 'foo\%[bar]', 'foobarxx', 'foobar']) ++ :call add(tl, [2, 'foo\%[bar]x', 'foobxx', 'foobx']) ++ :call add(tl, [2, 'foo\%[bar]x', 'foobarxx', 'foobarx']) ++ :call add(tl, [2, '\%[bar]x', 'barxx', 'barx']) ++ :call add(tl, [2, '\%[bar]x', 'bxx', 'bx']) ++ :call add(tl, [2, '\%[bar]x', 'xxx', 'x']) ++ :" + :"""" Alternatives, must use first longest match + :call add(tl, [2, 'goo\|go', 'google', 'goo']) + :call add(tl, [2, '\ +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1118 +Problem: Match failure rate is not very specific. +Solution: Tune the failure rate for match items. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1117/src/regexp_nfa.c 2013-06-05 11:05:12.000000000 +0200 +--- src/regexp_nfa.c 2013-06-05 11:41:09.000000000 +0200 +*************** +*** 3956,3980 **** + if (depth > 4) + return 1; + +! if (c == NFA_SPLIT) + { +! if (state->out->c == NFA_SPLIT || state->out1->c == NFA_SPLIT) + return 1; +! l = failure_chance(state->out, depth + 1); +! r = failure_chance(state->out1, depth + 1); +! return l < r ? l : r; +! } +! if (c == NFA_ANY) +! return 1; +! if (c > 0) +! return 99; +! if ((c >= NFA_MOPEN && c <= NFA_MOPEN9) + #ifdef FEAT_SYN_HL +! || (c >= NFA_ZOPEN && c <= NFA_ZOPEN9) + #endif +! || c == NFA_NOPEN) +! return failure_chance(state->out, depth + 1); +! /* something else */ + return 50; + } + +--- 3956,4093 ---- + if (depth > 4) + return 1; + +! switch (c) + { +! case NFA_SPLIT: +! if (state->out->c == NFA_SPLIT || state->out1->c == NFA_SPLIT) +! /* avoid recursive stuff */ +! return 1; +! /* two alternatives, use the lowest failure chance */ +! l = failure_chance(state->out, depth + 1); +! r = failure_chance(state->out1, depth + 1); +! return l < r ? l : r; +! +! case NFA_ANY: +! /* matches anything, unlikely to fail */ + return 1; +! case NFA_MATCH: +! /* empty match works always */ +! return 0; +! +! case NFA_BOL: +! case NFA_EOL: +! case NFA_BOF: +! case NFA_EOF: +! case NFA_NEWL: +! return 99; +! +! case NFA_BOW: +! case NFA_EOW: +! return 90; +! +! case NFA_MOPEN: +! case NFA_MOPEN1: +! case NFA_MOPEN2: +! case NFA_MOPEN3: +! case NFA_MOPEN4: +! case NFA_MOPEN5: +! case NFA_MOPEN6: +! case NFA_MOPEN7: +! case NFA_MOPEN8: +! case NFA_MOPEN9: +! #ifdef FEAT_SYN_HL +! case NFA_ZOPEN: +! case NFA_ZOPEN1: +! case NFA_ZOPEN2: +! case NFA_ZOPEN3: +! case NFA_ZOPEN4: +! case NFA_ZOPEN5: +! case NFA_ZOPEN6: +! case NFA_ZOPEN7: +! case NFA_ZOPEN8: +! case NFA_ZOPEN9: +! case NFA_ZCLOSE: +! case NFA_ZCLOSE1: +! case NFA_ZCLOSE2: +! case NFA_ZCLOSE3: +! case NFA_ZCLOSE4: +! case NFA_ZCLOSE5: +! case NFA_ZCLOSE6: +! case NFA_ZCLOSE7: +! case NFA_ZCLOSE8: +! case NFA_ZCLOSE9: +! #endif +! case NFA_NOPEN: +! case NFA_MCLOSE: +! case NFA_MCLOSE1: +! case NFA_MCLOSE2: +! case NFA_MCLOSE3: +! case NFA_MCLOSE4: +! case NFA_MCLOSE5: +! case NFA_MCLOSE6: +! case NFA_MCLOSE7: +! case NFA_MCLOSE8: +! case NFA_MCLOSE9: +! case NFA_NCLOSE: +! return failure_chance(state->out, depth + 1); +! +! case NFA_BACKREF1: +! case NFA_BACKREF2: +! case NFA_BACKREF3: +! case NFA_BACKREF4: +! case NFA_BACKREF5: +! case NFA_BACKREF6: +! case NFA_BACKREF7: +! case NFA_BACKREF8: +! case NFA_BACKREF9: + #ifdef FEAT_SYN_HL +! case NFA_ZREF1: +! case NFA_ZREF2: +! case NFA_ZREF3: +! case NFA_ZREF4: +! case NFA_ZREF5: +! case NFA_ZREF6: +! case NFA_ZREF7: +! case NFA_ZREF8: +! case NFA_ZREF9: + #endif +! /* backreferences don't match in many places */ +! return 94; +! +! case NFA_LNUM_GT: +! case NFA_LNUM_LT: +! case NFA_COL_GT: +! case NFA_COL_LT: +! case NFA_VCOL_GT: +! case NFA_VCOL_LT: +! case NFA_MARK_GT: +! case NFA_MARK_LT: +! #ifdef FEAT_VISUAL +! case NFA_VISUAL: +! #endif +! /* before/after positions don't match very often */ +! return 85; +! +! case NFA_LNUM: +! return 90; +! +! case NFA_CURSOR: +! case NFA_COL: +! case NFA_VCOL: +! case NFA_MARK: +! /* specific positions rarely match */ +! return 98; +! +! case NFA_COMPOSING: +! return 95; +! +! default: +! if (c > 0) +! /* character match fails often */ +! return 95; +! } +! +! /* something else, includes character classes */ + return 50; + } + +*** ../vim-7.3.1117/src/version.c 2013-06-05 11:05:12.000000000 +0200 +--- src/version.c 2013-06-05 11:41:58.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1118, + /**/ + +-- +From "know your smileys": + :~) A man with a tape recorder up his nose + + /// 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 /// diff --git a/7.3.1119 b/7.3.1119 new file mode 100644 index 0000000..9bdf4fa --- /dev/null +++ b/7.3.1119 @@ -0,0 +1,237 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1119 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1119 +Problem: Flags in 'cpo' are searched for several times. +Solution: Store the result and re-use the flags. +Files: src/regexp.c, src/regexp_nfa.c + + +*** ../vim-7.3.1118/src/regexp.c 2013-06-04 21:27:33.000000000 +0200 +--- src/regexp.c 2013-06-05 12:37:30.000000000 +0200 +*************** +*** 365,370 **** +--- 365,371 ---- + static char_u e_z_not_allowed[] = N_("E66: \\z( not allowed here"); + static char_u e_z1_not_allowed[] = N_("E67: \\z1 et al. not allowed here"); + #endif ++ static char_u e_missing_sb[] = N_("E69: Missing ] after %s%%["); + + #define NOT_MULTI 0 + #define MULTI_ONE 1 +*************** +*** 1173,1178 **** +--- 1174,1189 ---- + return 0; + } + ++ static void get_cpo_flags __ARGS((void)); ++ static int reg_cpo_lit; /* 'cpoptions' contains 'l' flag */ ++ static int reg_cpo_bsl; /* 'cpoptions' contains '\' flag */ ++ ++ static void ++ get_cpo_flags() ++ { ++ reg_cpo_lit = vim_strchr(p_cpo, CPO_LITERAL) != NULL; ++ reg_cpo_bsl = vim_strchr(p_cpo, CPO_BACKSL) != NULL; ++ } + + /* + * Skip over a "[]" range. +*************** +*** 1183,1197 **** + skip_anyof(p) + char_u *p; + { +- int cpo_lit; /* 'cpoptions' contains 'l' flag */ +- int cpo_bsl; /* 'cpoptions' contains '\' flag */ + #ifdef FEAT_MBYTE + int l; + #endif + +- cpo_lit = vim_strchr(p_cpo, CPO_LITERAL) != NULL; +- cpo_bsl = vim_strchr(p_cpo, CPO_BACKSL) != NULL; +- + if (*p == '^') /* Complement of range. */ + ++p; + if (*p == ']' || *p == '-') +--- 1194,1203 ---- +*************** +*** 1210,1218 **** + mb_ptr_adv(p); + } + else if (*p == '\\' +! && !cpo_bsl + && (vim_strchr(REGEXP_INRANGE, p[1]) != NULL +! || (!cpo_lit && vim_strchr(REGEXP_ABBR, p[1]) != NULL))) + p += 2; + else if (*p == '[') + { +--- 1216,1224 ---- + mb_ptr_adv(p); + } + else if (*p == '\\' +! && !reg_cpo_bsl + && (vim_strchr(REGEXP_INRANGE, p[1]) != NULL +! || (!reg_cpo_lit && vim_strchr(REGEXP_ABBR, p[1]) != NULL))) + p += 2; + else if (*p == '[') + { +*************** +*** 1251,1256 **** +--- 1257,1263 ---- + mymagic = MAGIC_ON; + else + mymagic = MAGIC_OFF; ++ get_cpo_flags(); + + for (; p[0] != NUL; mb_ptr_adv(p)) + { +*************** +*** 1462,1467 **** +--- 1469,1475 ---- + reg_magic = MAGIC_OFF; + reg_string = (re_flags & RE_STRING); + reg_strict = (re_flags & RE_STRICT); ++ get_cpo_flags(); + + num_complex_braces = 0; + regnpar = 1; +*************** +*** 1909,1923 **** + { + char_u *ret; + int flags; +- int cpo_lit; /* 'cpoptions' contains 'l' flag */ +- int cpo_bsl; /* 'cpoptions' contains '\' flag */ + int c; + char_u *p; + int extra = 0; + + *flagp = WORST; /* Tentatively. */ +- cpo_lit = vim_strchr(p_cpo, CPO_LITERAL) != NULL; +- cpo_bsl = vim_strchr(p_cpo, CPO_BACKSL) != NULL; + + c = getchr(); + switch (c) +--- 1917,1927 ---- +*************** +*** 2207,2213 **** + while ((c = getchr()) != ']') + { + if (c == NUL) +! EMSG2_RET_NULL(_("E69: Missing ] after %s%%["), + reg_magic == MAGIC_ALL); + br = regnode(BRANCH); + if (ret == NULL) +--- 2211,2217 ---- + while ((c = getchr()) != ']') + { + if (c == NUL) +! EMSG2_RET_NULL(_(e_missing_sb), + reg_magic == MAGIC_ALL); + br = regnode(BRANCH); + if (ret == NULL) +*************** +*** 2410,2416 **** + } + + /* Handle \o40, \x20 and \u20AC style sequences */ +! if (endc == '\\' && !cpo_lit && !cpo_bsl) + endc = coll_get_char(); + + if (startc > endc) +--- 2414,2420 ---- + } + + /* Handle \o40, \x20 and \u20AC style sequences */ +! if (endc == '\\' && !reg_cpo_lit && !reg_cpo_bsl) + endc = coll_get_char(); + + if (startc > endc) +*************** +*** 2452,2460 **** + * Posix doesn't recognize backslash at all. + */ + else if (*regparse == '\\' +! && !cpo_bsl + && (vim_strchr(REGEXP_INRANGE, regparse[1]) != NULL +! || (!cpo_lit + && vim_strchr(REGEXP_ABBR, + regparse[1]) != NULL))) + { +--- 2456,2464 ---- + * Posix doesn't recognize backslash at all. + */ + else if (*regparse == '\\' +! && !reg_cpo_bsl + && (vim_strchr(REGEXP_INRANGE, regparse[1]) != NULL +! || (!reg_cpo_lit + && vim_strchr(REGEXP_ABBR, + regparse[1]) != NULL))) + { +*** ../vim-7.3.1118/src/regexp_nfa.c 2013-06-05 11:46:22.000000000 +0200 +--- src/regexp_nfa.c 2013-06-05 12:38:03.000000000 +0200 +*************** +*** 686,698 **** + int startc = -1; + int endc = -1; + int oldstartc = -1; +- int cpo_lit; /* 'cpoptions' contains 'l' flag */ +- int cpo_bsl; /* 'cpoptions' contains '\' flag */ + int glue; /* ID that will "glue" nodes together */ + +- cpo_lit = vim_strchr(p_cpo, CPO_LITERAL) != NULL; +- cpo_bsl = vim_strchr(p_cpo, CPO_BACKSL) != NULL; +- + c = getchr(); + switch (c) + { +--- 686,693 ---- +*************** +*** 1224,1233 **** + * Posix doesn't recognize backslash at all. + */ + if (*regparse == '\\' +! && !cpo_bsl + && regparse + 1 <= endp + && (vim_strchr(REGEXP_INRANGE, regparse[1]) != NULL +! || (!cpo_lit + && vim_strchr(REGEXP_ABBR, regparse[1]) + != NULL) + ) +--- 1219,1228 ---- + * Posix doesn't recognize backslash at all. + */ + if (*regparse == '\\' +! && !reg_cpo_bsl + && regparse + 1 <= endp + && (vim_strchr(REGEXP_INRANGE, regparse[1]) != NULL +! || (!reg_cpo_lit + && vim_strchr(REGEXP_ABBR, regparse[1]) + != NULL) + ) +*** ../vim-7.3.1118/src/version.c 2013-06-05 11:46:22.000000000 +0200 +--- src/version.c 2013-06-05 12:40:57.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1119, + /**/ + +-- +From "know your smileys": + :-O>-o Smiley American tourist (note big mouth and camera) + + /// 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 /// diff --git a/7.3.1120 b/7.3.1120 new file mode 100644 index 0000000..29d4781 --- /dev/null +++ b/7.3.1120 @@ -0,0 +1,94 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1120 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1120 +Problem: Crash when regexp logging is enabled. +Solution: Avoid using NULL pointers. Advance over count argument. +Files: src/regexp.c, src/regexp_nfa.c + + +*** ../vim-7.3.1119/src/regexp.c 2013-06-05 12:43:05.000000000 +0200 +--- src/regexp.c 2013-06-05 16:27:25.000000000 +0200 +*************** +*** 6538,6547 **** + end = next; + if (op == BRACE_LIMITS) + { +! /* Two short ints */ + fprintf(f, " minval %ld, maxval %ld", OPERAND_MIN(s), OPERAND_MAX(s)); + s += 8; + } + s += 3; + if (op == ANYOF || op == ANYOF + ADD_NL + || op == ANYBUT || op == ANYBUT + ADD_NL +--- 6538,6553 ---- + end = next; + if (op == BRACE_LIMITS) + { +! /* Two ints */ + fprintf(f, " minval %ld, maxval %ld", OPERAND_MIN(s), OPERAND_MAX(s)); + s += 8; + } ++ else if (op == BEHIND || op == NOBEHIND) ++ { ++ /* one int */ ++ fprintf(f, " count %ld", OPERAND_MIN(s)); ++ s += 4; ++ } + s += 3; + if (op == ANYOF || op == ANYOF + ADD_NL + || op == ANYBUT || op == ANYBUT + ADD_NL +*** ../vim-7.3.1119/src/regexp_nfa.c 2013-06-05 12:43:05.000000000 +0200 +--- src/regexp_nfa.c 2013-06-05 16:13:25.000000000 +0200 +*************** +*** 2960,2969 **** + sub->list.multi[j].end.col, + (int)sub->list.multi[j].end.lnum); + else + fprintf(log_fd, "\n *** group %d, start: \"%s\", end: \"%s\"", + j, +! (char *)sub->list.line[j].start, +! (char *)sub->list.line[j].end); + fprintf(log_fd, "\n"); + } + #endif +--- 2960,2974 ---- + sub->list.multi[j].end.col, + (int)sub->list.multi[j].end.lnum); + else ++ { ++ char *s = (char *)sub->list.line[j].start; ++ char *e = (char *)sub->list.line[j].end; ++ + fprintf(log_fd, "\n *** group %d, start: \"%s\", end: \"%s\"", + j, +! s == NULL ? "NULL" : s, +! e == NULL ? "NULL" : e); +! } + fprintf(log_fd, "\n"); + } + #endif +*** ../vim-7.3.1119/src/version.c 2013-06-05 12:43:05.000000000 +0200 +--- src/version.c 2013-06-05 16:27:14.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1120, + /**/ + +-- +From "know your smileys": + |-P Reaction to unusually ugly C code + + /// 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 /// diff --git a/7.3.1121 b/7.3.1121 new file mode 100644 index 0000000..011e3f9 --- /dev/null +++ b/7.3.1121 @@ -0,0 +1,118 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1121 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1121 +Problem: New regexp engine: adding states that are not used. +Solution: Don't add the states. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1120/src/regexp_nfa.c 2013-06-05 16:33:05.000000000 +0200 +--- src/regexp_nfa.c 2013-06-05 16:47:27.000000000 +0200 +*************** +*** 3169,3174 **** +--- 3176,3182 ---- + case NFA_SPLIT: + case NFA_NOT: + case NFA_NOPEN: ++ case NFA_SKIP_CHAR: + case NFA_NCLOSE: + case NFA_MCLOSE: + case NFA_MCLOSE1: +*************** +*** 3192,3197 **** +--- 3200,3206 ---- + case NFA_ZCLOSE8: + case NFA_ZCLOSE9: + #endif ++ case NFA_ZEND: + /* These nodes are not added themselves but their "out" and/or + * "out1" may be added below. */ + break; +*************** +*** 3218,3223 **** +--- 3227,3233 ---- + case NFA_ZOPEN8: + case NFA_ZOPEN9: + #endif ++ case NFA_ZSTART: + /* These nodes do not need to be added, but we need to bail out + * when it was tried to be added to this list before. */ + if (state->lastlist[nfa_ll_index] == l->id) +*************** +*** 4362,4371 **** + + case NFA_START_INVISIBLE: + case NFA_START_INVISIBLE_BEFORE: +- /* If invisible match has a higher chance to fail, do it +- * right away. Otherwise postpone it until what follows is +- * matching and causes addstate(nextlist, ..) to be called. +- * This is indicated by the "pim" field. */ + { + nfa_pim_T *pim; + int cout = t->state->out1->out->c; +--- 4372,4377 ---- +*************** +*** 4863,4874 **** + log_subsexpr(&nextlist->t[nextlist->n - 1].subs); + #endif + } +- + } + break; + } + case NFA_SKIP: +! /* charater of previous matching \1 .. \9 */ + if (t->count - clen <= 0) + { + /* end of match, go to what follows */ +--- 4869,4879 ---- + log_subsexpr(&nextlist->t[nextlist->n - 1].subs); + #endif + } + } + break; + } + case NFA_SKIP: +! /* character of previous matching \1 .. \9 or \@> */ + if (t->count - clen <= 0) + { + /* end of match, go to what follows */ +*************** +*** 4892,4903 **** + } + break; + +- case NFA_SKIP_CHAR: +- case NFA_ZSTART: +- case NFA_ZEND: +- /* TODO: should not happen? */ +- break; +- + case NFA_LNUM: + case NFA_LNUM_GT: + case NFA_LNUM_LT: +--- 4897,4902 ---- +*** ../vim-7.3.1120/src/version.c 2013-06-05 16:33:05.000000000 +0200 +--- src/version.c 2013-06-05 16:50:39.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1121, + /**/ + +-- +Where do you want to crash today? + + /// 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 /// diff --git a/7.3.1122 b/7.3.1122 new file mode 100644 index 0000000..a60dce4 --- /dev/null +++ b/7.3.1122 @@ -0,0 +1,478 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1122 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1122 +Problem: New regexp engine: \@> not supported. +Solution: Implement \@>. +Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok + + +*** ../vim-7.3.1121/src/regexp_nfa.c 2013-06-05 16:51:53.000000000 +0200 +--- src/regexp_nfa.c 2013-06-05 18:45:57.000000000 +0200 +*************** +*** 57,63 **** +--- 57,65 ---- + NFA_NCLOSE, /* End of subexpr. marked with \%( ... \) */ + NFA_START_INVISIBLE, + NFA_START_INVISIBLE_BEFORE, ++ NFA_START_PATTERN, + NFA_END_INVISIBLE, ++ NFA_END_PATTERN, + NFA_COMPOSING, /* Next nodes in NFA are part of the + composing multibyte char */ + NFA_END_COMPOSING, /* End of a composing char in the NFA */ +*************** +*** 1505,1513 **** + i = NFA_PREV_ATOM_JUST_BEFORE_NEG; + break; + case '>': +! /* \@> Not supported yet */ +! /* i = NFA_PREV_ATOM_LIKE_PATTERN; */ +! return FAIL; + } + if (i == 0) + { +--- 1507,1515 ---- + i = NFA_PREV_ATOM_JUST_BEFORE_NEG; + break; + case '>': +! /* \@> */ +! i = NFA_PREV_ATOM_LIKE_PATTERN; +! break; + } + if (i == 0) + { +*************** +*** 1885,1896 **** +--- 1887,1903 ---- + STRCPY(code, "NFA_PREV_ATOM_JUST_BEFORE"); break; + case NFA_PREV_ATOM_JUST_BEFORE_NEG: + STRCPY(code, "NFA_PREV_ATOM_JUST_BEFORE_NEG"); break; ++ case NFA_PREV_ATOM_LIKE_PATTERN: ++ STRCPY(code, "NFA_PREV_ATOM_LIKE_PATTERN"); break; ++ + case NFA_NOPEN: STRCPY(code, "NFA_NOPEN"); break; + case NFA_NCLOSE: STRCPY(code, "NFA_NCLOSE"); break; + case NFA_START_INVISIBLE: STRCPY(code, "NFA_START_INVISIBLE"); break; + case NFA_START_INVISIBLE_BEFORE: + STRCPY(code, "NFA_START_INVISIBLE_BEFORE"); break; ++ case NFA_START_PATTERN: STRCPY(code, "NFA_START_PATTERN"); break; + case NFA_END_INVISIBLE: STRCPY(code, "NFA_END_INVISIBLE"); break; ++ case NFA_END_PATTERN: STRCPY(code, "NFA_END_PATTERN"); break; + + case NFA_COMPOSING: STRCPY(code, "NFA_COMPOSING"); break; + case NFA_END_COMPOSING: STRCPY(code, "NFA_END_COMPOSING"); break; +*************** +*** 2601,2612 **** + case NFA_PREV_ATOM_NO_WIDTH_NEG: + case NFA_PREV_ATOM_JUST_BEFORE: + case NFA_PREV_ATOM_JUST_BEFORE_NEG: + { + int neg = (*p == NFA_PREV_ATOM_NO_WIDTH_NEG + || *p == NFA_PREV_ATOM_JUST_BEFORE_NEG); + int before = (*p == NFA_PREV_ATOM_JUST_BEFORE + || *p == NFA_PREV_ATOM_JUST_BEFORE_NEG); +! int n; + + if (before) + n = *++p; /* get the count */ +--- 2608,2633 ---- + case NFA_PREV_ATOM_NO_WIDTH_NEG: + case NFA_PREV_ATOM_JUST_BEFORE: + case NFA_PREV_ATOM_JUST_BEFORE_NEG: ++ case NFA_PREV_ATOM_LIKE_PATTERN: + { + int neg = (*p == NFA_PREV_ATOM_NO_WIDTH_NEG + || *p == NFA_PREV_ATOM_JUST_BEFORE_NEG); + int before = (*p == NFA_PREV_ATOM_JUST_BEFORE + || *p == NFA_PREV_ATOM_JUST_BEFORE_NEG); +! int pattern = (*p == NFA_PREV_ATOM_LIKE_PATTERN); +! int start_state = NFA_START_INVISIBLE; +! int end_state = NFA_END_INVISIBLE; +! int n = 0; +! nfa_state_T *zend; +! nfa_state_T *skip; +! +! if (before) +! start_state = NFA_START_INVISIBLE_BEFORE; +! else if (pattern) +! { +! start_state = NFA_START_PATTERN; +! end_state = NFA_END_PATTERN; +! } + + if (before) + n = *++p; /* get the count */ +*************** +*** 2620,2635 **** + + if (nfa_calc_size == TRUE) + { +! nstate += 2; + break; + } + e = POP(); +! s1 = alloc_state(NFA_END_INVISIBLE, NULL, NULL); + if (s1 == NULL) + goto theend; +- patch(e.out, s1); + +! s = alloc_state(NFA_START_INVISIBLE, e.start, s1); + if (s == NULL) + goto theend; + if (neg) +--- 2641,2655 ---- + + if (nfa_calc_size == TRUE) + { +! nstate += pattern ? 4 : 2; + break; + } + e = POP(); +! s1 = alloc_state(end_state, NULL, NULL); + if (s1 == NULL) + goto theend; + +! s = alloc_state(start_state, e.start, s1); + if (s == NULL) + goto theend; + if (neg) +*************** +*** 2638,2649 **** + s1->negated = TRUE; + } + if (before) +- { + s->val = n; /* store the count */ +! ++s->c; /* NFA_START_INVISIBLE -> NFA_START_INVISIBLE_BEFORE */ + } +- +- PUSH(frag(s, list1(&s1->out))); + break; + } + +--- 2658,2678 ---- + s1->negated = TRUE; + } + if (before) + s->val = n; /* store the count */ +! if (pattern) +! { +! /* NFA_ZEND -> NFA_END_PATTERN -> NFA_SKIP -> what follows. */ +! skip = alloc_state(NFA_SKIP, NULL, NULL); +! zend = alloc_state(NFA_ZEND, s1, NULL); +! s1->out= skip; +! patch(e.out, zend); +! PUSH(frag(s, list1(&skip->out))); +! } +! else +! { +! patch(e.out, s1); +! PUSH(frag(s, list1(&s1->out))); + } + break; + } + +*************** +*** 2953,2959 **** + + for (j = 0; j < sub->in_use; j++) + if (REG_MULTI) +! fprintf(log_fd, "\n *** group %d, start: c=%d, l=%d, end: c=%d, l=%d", + j, + sub->list.multi[j].start.col, + (int)sub->list.multi[j].start.lnum, +--- 2982,2988 ---- + + for (j = 0; j < sub->in_use; j++) + if (REG_MULTI) +! fprintf(log_fd, "*** group %d, start: c=%d, l=%d, end: c=%d, l=%d\n", + j, + sub->list.multi[j].start.col, + (int)sub->list.multi[j].start.lnum, +*************** +*** 2964,2975 **** + char *s = (char *)sub->list.line[j].start; + char *e = (char *)sub->list.line[j].end; + +! fprintf(log_fd, "\n *** group %d, start: \"%s\", end: \"%s\"", + j, + s == NULL ? "NULL" : s, + e == NULL ? "NULL" : e); + } +- fprintf(log_fd, "\n"); + } + #endif + +--- 2993,3003 ---- + char *s = (char *)sub->list.line[j].start; + char *e = (char *)sub->list.line[j].end; + +! fprintf(log_fd, "*** group %d, start: \"%s\", end: \"%s\"\n", + j, + s == NULL ? "NULL" : s, + e == NULL ? "NULL" : e); + } + } + #endif + +*************** +*** 4317,4322 **** +--- 4345,4351 ---- + } + + case NFA_END_INVISIBLE: ++ case NFA_END_PATTERN: + /* + * This is only encountered after a NFA_START_INVISIBLE or + * NFA_START_INVISIBLE_BEFORE node. +*************** +*** 4343,4349 **** + (int)(nfa_endp->se_u.ptr - reginput)); + } + #endif +! /* It's only a match if it ends at "nfa_endp" */ + if (nfa_endp != NULL && (REG_MULTI + ? (reglnum != nfa_endp->se_u.pos.lnum + || (int)(reginput - regline) +--- 4372,4379 ---- + (int)(nfa_endp->se_u.ptr - reginput)); + } + #endif +! /* If "nfa_endp" is set it's only a match if it ends at +! * "nfa_endp" */ + if (nfa_endp != NULL && (REG_MULTI + ? (reglnum != nfa_endp->se_u.pos.lnum + || (int)(reginput - regline) +*************** +*** 4360,4365 **** +--- 4390,4399 ---- + copy_sub(&m->synt, &t->subs.synt); + #endif + } ++ #ifdef ENABLE_LOG ++ fprintf(log_fd, "Match found:\n"); ++ log_subsexpr(m); ++ #endif + nfa_match = TRUE; + break; + +*************** +*** 4435,4440 **** +--- 4469,4531 ---- + } + break; + ++ case NFA_START_PATTERN: ++ /* First try matching the pattern. */ ++ result = recursive_regmatch(t->state, prog, ++ submatch, m, &listids); ++ if (result) ++ { ++ int bytelen; ++ ++ #ifdef ENABLE_LOG ++ fprintf(log_fd, "NFA_START_PATTERN matches:\n"); ++ log_subsexpr(m); ++ #endif ++ /* Copy submatch info from the recursive call */ ++ copy_sub_off(&t->subs.norm, &m->norm); ++ #ifdef FEAT_SYN_HL ++ copy_sub_off(&t->subs.synt, &m->synt); ++ #endif ++ /* Now we need to skip over the matched text and then ++ * continue with what follows. */ ++ if (REG_MULTI) ++ /* TODO: multi-line match */ ++ bytelen = m->norm.list.multi[0].end.col ++ - (int)(reginput - regline); ++ else ++ bytelen = (int)(m->norm.list.line[0].end - reginput); ++ ++ #ifdef ENABLE_LOG ++ fprintf(log_fd, "NFA_START_PATTERN length: %d\n", bytelen); ++ #endif ++ if (bytelen == 0) ++ { ++ /* empty match, output of corresponding ++ * NFA_END_PATTERN/NFA_SKIP to be used at current ++ * position */ ++ addstate_here(thislist, t->state->out1->out->out, ++ &t->subs, t->pim, &listidx); ++ } ++ else if (bytelen <= clen) ++ { ++ /* match current character, output of corresponding ++ * NFA_END_PATTERN to be used at next position. */ ++ ll = nextlist; ++ add_state = t->state->out1->out->out; ++ add_off = clen; ++ } ++ else ++ { ++ /* skip over the matched characters, set character ++ * count in NFA_SKIP */ ++ ll = nextlist; ++ add_state = t->state->out1->out; ++ add_off = bytelen; ++ add_count = bytelen - clen; ++ } ++ } ++ break; ++ + case NFA_BOL: + if (reginput == regline) + addstate_here(thislist, t->state->out, &t->subs, +*************** +*** 4846,4854 **** + ll = nextlist; + add_state = t->state->out->out; + add_off = clen; +- #ifdef ENABLE_LOG +- log_subsexpr(&nextlist->t[nextlist->n - 1].subs); +- #endif + } + else + { +--- 4937,4942 ---- +*************** +*** 4858,4866 **** + add_state = t->state->out; + add_off = bytelen; + add_count = bytelen - clen; +- #ifdef ENABLE_LOG +- log_subsexpr(&nextlist->t[nextlist->n - 1].subs); +- #endif + } + } + break; +--- 4946,4951 ---- +*************** +*** 4873,4881 **** + ll = nextlist; + add_state = t->state->out; + add_off = clen; +- #ifdef ENABLE_LOG +- log_subsexpr(&nextlist->t[nextlist->n - 1].subs); +- #endif + } + else + { +--- 4958,4963 ---- +*************** +*** 4884,4892 **** + add_state = t->state; + add_off = 0; + add_count = t->count - clen; +- #ifdef ENABLE_LOG +- log_subsexpr(&nextlist->t[nextlist->n - 1].subs); +- #endif + } + break; + +--- 4966,4971 ---- +*************** +*** 5158,5170 **** + f = fopen(NFA_REGEXP_RUN_LOG, "a"); + if (f != NULL) + { +! fprintf(f, "\n\n\n\n\n\n\t\t=======================================================\n"); +! fprintf(f, " =======================================================\n"); + #ifdef DEBUG + fprintf(f, "\tRegexp is \"%s\"\n", nfa_regengine.expr); + #endif + fprintf(f, "\tInput text is \"%s\" \n", reginput); +! fprintf(f, " =======================================================\n\n"); + nfa_print_state(f, start); + fprintf(f, "\n\n"); + fclose(f); +--- 5237,5248 ---- + f = fopen(NFA_REGEXP_RUN_LOG, "a"); + if (f != NULL) + { +! fprintf(f, "\n\n\t=======================================================\n"); + #ifdef DEBUG + fprintf(f, "\tRegexp is \"%s\"\n", nfa_regengine.expr); + #endif + fprintf(f, "\tInput text is \"%s\" \n", reginput); +! fprintf(f, "\t=======================================================\n\n"); + nfa_print_state(f, start); + fprintf(f, "\n\n"); + fclose(f); +*** ../vim-7.3.1121/src/testdir/test64.in 2013-06-05 11:05:12.000000000 +0200 +--- src/testdir/test64.in 2013-06-05 18:45:28.000000000 +0200 +*************** +*** 385,390 **** +--- 385,396 ---- + :call add(tl, [2, '\(<<\)\@2<=span.', 'xxspanxxxx ++ :call add(tl, [2, '\(a*\)\@>a', 'aaaa']) ++ :call add(tl, [2, '\(a*\)\@>b', 'aaab', 'aaab', 'aaa']) ++ :" TODO: BT engine does not restore submatch after failure ++ :call add(tl, [1, '\(a*\)\@>a\|a\+', 'aaaa', 'aaaa']) ++ :" + :"""" "\_" prepended negated collection matches EOL + :call add(tl, [2, '\_[^8-9]\+', "asfi\n9888", "asfi\n"]) + :call add(tl, [2, '\_[^a]\+', "asfi\n9888", "sfi\n9888"]) +*************** +*** 401,407 **** + : let text = t[2] + : let matchidx = 3 + : for engine in [0, 1, 2] +! : if engine == 2 && !re + : continue + : endif + : let ®expengine = engine +--- 407,413 ---- + : let text = t[2] + : let matchidx = 3 + : for engine in [0, 1, 2] +! : if engine == 2 && re == 0 || engine == 1 && re ==1 + : continue + : endif + : let ®expengine = engine +*** ../vim-7.3.1121/src/testdir/test64.ok 2013-06-05 11:05:12.000000000 +0200 +--- src/testdir/test64.ok 2013-06-05 18:47:54.000000000 +0200 +*************** +*** 872,877 **** +--- 872,885 ---- + OK 0 - \(foo\)\@a ++ OK 1 - \(a*\)\@>a ++ OK 2 - \(a*\)\@>a ++ OK 0 - \(a*\)\@>b ++ OK 1 - \(a*\)\@>b ++ OK 2 - \(a*\)\@>b ++ OK 0 - \(a*\)\@>a\|a\+ ++ OK 2 - \(a*\)\@>a\|a\+ + OK 0 - \_[^8-9]\+ + OK 1 - \_[^8-9]\+ + OK 2 - \_[^8-9]\+ +*** ../vim-7.3.1121/src/version.c 2013-06-05 16:51:53.000000000 +0200 +--- src/version.c 2013-06-05 18:51:35.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1122, + /**/ + +-- +From "know your smileys": + :q vi user saying, "How do I get out of this damn emacs editor?" + + /// 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 /// diff --git a/7.3.1123 b/7.3.1123 new file mode 100644 index 0000000..5b6d87a --- /dev/null +++ b/7.3.1123 @@ -0,0 +1,52 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1123 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1123 +Problem: Can't build tiny Vim on MS-Windows. +Solution: Adjust #ifdef around using modif_fname(). (Mike Williams) +Files: src/misc1.c + + +*** ../vim-7.3.1122/src/misc1.c 2013-05-06 04:21:35.000000000 +0200 +--- src/misc1.c 2013-06-05 19:33:30.000000000 +0200 +*************** +*** 4607,4613 **** + if (homedir_env != NULL && *homedir_env == NUL) + homedir_env = NULL; + +! #if defined(FEAT_MODIFY_FNAME) || defined(WIN3264) + if (homedir_env != NULL && vim_strchr(homedir_env, '~') != NULL) + { + int usedlen = 0; +--- 4607,4613 ---- + if (homedir_env != NULL && *homedir_env == NUL) + homedir_env = NULL; + +! #if defined(FEAT_MODIFY_FNAME) || defined(FEAT_EVAL) + if (homedir_env != NULL && vim_strchr(homedir_env, '~') != NULL) + { + int usedlen = 0; +*** ../vim-7.3.1122/src/version.c 2013-06-05 18:52:36.000000000 +0200 +--- src/version.c 2013-06-05 19:34:17.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1123, + /**/ + +-- +From "know your smileys": + ...---... SOS + + /// 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 /// diff --git a/7.3.1124 b/7.3.1124 new file mode 100644 index 0000000..0304bee --- /dev/null +++ b/7.3.1124 @@ -0,0 +1,46 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1124 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1124 +Problem: Python: Crash on MS-Windows when os.fchdir() is not available. +Solution: Check for _chdir to be NULL. (Ken Takata) +Files: src/if_py_both.h + + +*** ../vim-7.3.1123/src/if_py_both.h 2013-06-03 20:04:43.000000000 +0200 +--- src/if_py_both.h 2013-06-05 20:33:48.000000000 +0200 +*************** +*** 718,723 **** +--- 718,725 ---- + PyObject *todecref; + char_u *new_dir; + ++ if (_chdir == NULL) ++ return NULL; + if (!(r = PyObject_Call(_chdir, args, kwargs))) + return NULL; + +*** ../vim-7.3.1123/src/version.c 2013-06-05 19:35:31.000000000 +0200 +--- src/version.c 2013-06-05 20:09:04.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1124, + /**/ + +-- +From "know your smileys": + =):-) Uncle Sam + + /// 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 /// diff --git a/7.3.1125 b/7.3.1125 new file mode 100644 index 0000000..6e02695 --- /dev/null +++ b/7.3.1125 @@ -0,0 +1,116 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1125 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1125 +Problem: Error for using \%V in a pattern in tiny Vim. +Solution: Allow using \%V but never match. (Dominique Pelle) +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1124/src/regexp_nfa.c 2013-06-05 18:52:36.000000000 +0200 +--- src/regexp_nfa.c 2013-06-05 21:05:09.000000000 +0200 +*************** +*** 184,192 **** + NFA_MARK, /* Match mark */ + NFA_MARK_GT, /* Match > mark */ + NFA_MARK_LT, /* Match < mark */ +- #ifdef FEAT_VISUAL + NFA_VISUAL, /* Match Visual area */ +- #endif + + NFA_FIRST_NL = NFA_ANY + ADD_NL, + NFA_LAST_NL = NFA_NUPPER + ADD_NL, +--- 184,190 ---- +*************** +*** 963,973 **** + EMIT(NFA_CURSOR); + break; + +- #ifdef FEAT_VISUAL + case 'V': + EMIT(NFA_VISUAL); + break; +- #endif + + case '[': + { +--- 961,969 ---- +*************** +*** 1976,1984 **** + case NFA_MARK_GT: STRCPY(code, "NFA_MARK_GT "); break; + case NFA_MARK_LT: STRCPY(code, "NFA_MARK_LT "); break; + case NFA_CURSOR: STRCPY(code, "NFA_CURSOR "); break; +- #ifdef FEAT_VISUAL + case NFA_VISUAL: STRCPY(code, "NFA_VISUAL "); break; +- #endif + + case NFA_STAR: STRCPY(code, "NFA_STAR "); break; + case NFA_STAR_NONGREEDY: STRCPY(code, "NFA_STAR_NONGREEDY "); break; +--- 1972,1978 ---- +*************** +*** 4093,4101 **** + case NFA_VCOL_LT: + case NFA_MARK_GT: + case NFA_MARK_LT: +- #ifdef FEAT_VISUAL + case NFA_VISUAL: +- #endif + /* before/after positions don't match very often */ + return 85; + +--- 4087,4093 ---- +*************** +*** 5036,5049 **** + t->pim, &listidx); + break; + +- #ifdef FEAT_VISUAL + case NFA_VISUAL: + result = reg_match_visual(); + if (result) + addstate_here(thislist, t->state->out, &t->subs, + t->pim, &listidx); +- break; + #endif + + default: /* regular character */ + { +--- 5028,5041 ---- + t->pim, &listidx); + break; + + case NFA_VISUAL: ++ #ifdef FEAT_VISUAL + result = reg_match_visual(); + if (result) + addstate_here(thislist, t->state->out, &t->subs, + t->pim, &listidx); + #endif ++ break; + + default: /* regular character */ + { +*** ../vim-7.3.1124/src/version.c 2013-06-05 20:34:07.000000000 +0200 +--- src/version.c 2013-06-05 21:06:18.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1125, + /**/ + +-- +From "know your smileys": + (X0||) Double hamburger with lettuce and tomato + + /// 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 /// diff --git a/7.3.1126 b/7.3.1126 new file mode 100644 index 0000000..6c4a963 --- /dev/null +++ b/7.3.1126 @@ -0,0 +1,45 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1126 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1126 +Problem: Compiler warning for unitialized variable. (Tony Mechelynck) +Solution: Assign something to the variable. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1125/src/regexp_nfa.c 2013-06-05 21:10:55.000000000 +0200 +--- src/regexp_nfa.c 2013-06-05 21:21:48.000000000 +0200 +*************** +*** 2580,2585 **** +--- 2580,2586 ---- + nstate += n; + break; + } ++ s = NULL; /* avoid compiler warning */ + e1.out = NULL; /* stores list with out1's */ + s1 = NULL; /* previous NFA_SPLIT to connect to */ + while (n-- > 0) +*** ../vim-7.3.1125/src/version.c 2013-06-05 21:10:55.000000000 +0200 +--- src/version.c 2013-06-05 21:22:52.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1126, + /**/ + +-- +From "know your smileys": + 8<}} Glasses, big nose, beard + + /// 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 /// diff --git a/7.3.1127 b/7.3.1127 new file mode 100644 index 0000000..bf97a0c --- /dev/null +++ b/7.3.1127 @@ -0,0 +1,83 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1127 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1127 +Problem: No error for using empty \%[]. +Solution: Give error message. +Files: src/regexp.c, src/regexp_nfa.c + + +*** ../vim-7.3.1126/src/regexp.c 2013-06-05 16:33:05.000000000 +0200 +--- src/regexp.c 2013-06-05 21:26:46.000000000 +0200 +*************** +*** 366,372 **** + static char_u e_z1_not_allowed[] = N_("E67: \\z1 et al. not allowed here"); + #endif + static char_u e_missing_sb[] = N_("E69: Missing ] after %s%%["); +! + #define NOT_MULTI 0 + #define MULTI_ONE 1 + #define MULTI_MULT 2 +--- 366,372 ---- + static char_u e_z1_not_allowed[] = N_("E67: \\z1 et al. not allowed here"); + #endif + static char_u e_missing_sb[] = N_("E69: Missing ] after %s%%["); +! static char_u e_empty_sb[] = N_("E70: Empty %s%%[]"); + #define NOT_MULTI 0 + #define MULTI_ONE 1 + #define MULTI_MULT 2 +*************** +*** 2227,2233 **** + return NULL; + } + if (ret == NULL) +! EMSG2_RET_NULL(_("E70: Empty %s%%[]"), + reg_magic == MAGIC_ALL); + lastbranch = regnode(BRANCH); + br = regnode(NOTHING); +--- 2227,2233 ---- + return NULL; + } + if (ret == NULL) +! EMSG2_RET_NULL(_(e_empty_sb), + reg_magic == MAGIC_ALL); + lastbranch = regnode(BRANCH); + br = regnode(NOTHING); +*** ../vim-7.3.1126/src/regexp_nfa.c 2013-06-05 21:23:33.000000000 +0200 +--- src/regexp_nfa.c 2013-06-05 21:29:07.000000000 +0200 +*************** +*** 977,982 **** +--- 977,985 ---- + reg_magic == MAGIC_ALL); + EMIT(c); + } ++ if (n == 0) ++ EMSG2_RET_FAIL(_(e_empty_sb), ++ reg_magic == MAGIC_ALL); + EMIT(NFA_OPT_CHARS); + EMIT(n); + break; +*** ../vim-7.3.1126/src/version.c 2013-06-05 21:23:33.000000000 +0200 +--- src/version.c 2013-06-05 21:29:48.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1127, + /**/ + +-- +From "know your smileys": + 8-O "Omigod!!" (done "rm -rf *" ?) + + /// 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 /// diff --git a/7.3.1128 b/7.3.1128 new file mode 100644 index 0000000..6b8e05a --- /dev/null +++ b/7.3.1128 @@ -0,0 +1,284 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1128 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1128 +Problem: Now that the NFA engine handles everything every failure is a + syntax error. +Solution: Remove the syntax_error flag. +Files: src/regexp.c, src/regexp_nfa.c + + +*** ../vim-7.3.1127/src/regexp.c 2013-06-05 21:30:34.000000000 +0200 +--- src/regexp.c 2013-06-05 21:36:37.000000000 +0200 +*************** +*** 7924,7930 **** + regprog_T *prog = NULL; + char_u *expr = expr_arg; + +- syntax_error = FALSE; + regexp_engine = p_re; + + /* Check for prefix "\%#=", that sets the regexp engine */ +--- 7924,7929 ---- +*************** +*** 7971,7989 **** + f = fopen(BT_REGEXP_DEBUG_LOG_NAME, "a"); + if (f) + { +! if (!syntax_error) +! fprintf(f, "NFA engine could not handle \"%s\"\n", expr); +! else +! fprintf(f, "Syntax error in \"%s\"\n", expr); + fclose(f); + } + else + EMSG2("(NFA) Could not open \"%s\" to write !!!", + BT_REGEXP_DEBUG_LOG_NAME); +- /* +- if (syntax_error) +- EMSG("NFA Regexp: Syntax Error !"); +- */ + } + #endif + /* +--- 7970,7981 ---- + f = fopen(BT_REGEXP_DEBUG_LOG_NAME, "a"); + if (f) + { +! fprintf(f, "Syntax error in \"%s\"\n", expr); + fclose(f); + } + else + EMSG2("(NFA) Could not open \"%s\" to write !!!", + BT_REGEXP_DEBUG_LOG_NAME); + } + #endif + /* +*************** +*** 7992,8002 **** + * NFA engine. + */ + if (regexp_engine == AUTOMATIC_ENGINE) +! if (!syntax_error) +! prog = bt_regengine.regcomp(expr, re_flags); +! +! } /* endif prog==NULL */ +! + + return prog; + } +--- 7984,7991 ---- + * NFA engine. + */ + if (regexp_engine == AUTOMATIC_ENGINE) +! prog = bt_regengine.regcomp(expr, re_flags); +! } + + return prog; + } +*** ../vim-7.3.1127/src/regexp_nfa.c 2013-06-05 21:30:34.000000000 +0200 +--- src/regexp_nfa.c 2013-06-05 21:35:29.000000000 +0200 +*************** +*** 221,243 **** + + static char_u e_misplaced[] = N_("E866: (NFA regexp) Misplaced %c"); + +- /* +- * NFA errors can be of 3 types: +- * *** NFA runtime errors, when something unknown goes wrong. The NFA fails +- * silently and revert the to backtracking engine. +- * syntax_error = FALSE; +- * *** Regexp syntax errors, when the input regexp is not syntactically correct. +- * The NFA engine displays an error message, and nothing else happens. +- * syntax_error = TRUE +- * *** Unsupported features, when the input regexp uses an operator that is not +- * implemented in the NFA. The NFA engine fails silently, and reverts to the +- * old backtracking engine. +- * syntax_error = FALSE +- * "The NFA fails" means that "compiling the regexp with the NFA fails": +- * nfa_regcomp() returns FAIL. +- */ +- static int syntax_error = FALSE; +- + /* NFA regexp \ze operator encountered. */ + static int nfa_has_zend; + +--- 221,226 ---- +*************** +*** 692,698 **** + switch (c) + { + case NUL: +- syntax_error = TRUE; + EMSG_RET_FAIL(_("E865: (NFA) Regexp end encountered prematurely")); + + case Magic('^'): +--- 675,680 ---- +*************** +*** 814,820 **** + case Magic('|'): + case Magic('&'): + case Magic(')'): +- syntax_error = TRUE; + EMSGN(_(e_misplaced), no_Magic(c)); + return FAIL; + +--- 796,801 ---- +*************** +*** 825,831 **** + case Magic('*'): + case Magic('{'): + /* these should follow an atom, not form an atom */ +- syntax_error = TRUE; + EMSGN(_(e_misplaced), no_Magic(c)); + return FAIL; + +--- 806,811 ---- +*************** +*** 902,908 **** + break; + #endif + default: +- syntax_error = TRUE; + EMSGN(_("E867: (NFA) Unknown operator '\\z%c'"), + no_Magic(c)); + return FAIL; +--- 882,887 ---- +*************** +*** 1023,1029 **** + break; + } + } +- syntax_error = TRUE; + EMSGN(_("E867: (NFA) Unknown operator '\\%%%c'"), + no_Magic(c)); + return FAIL; +--- 1002,1007 ---- +*************** +*** 1359,1368 **** + } /* if exists closing ] */ + + if (reg_strict) +- { +- syntax_error = TRUE; + EMSG_RET_FAIL(_(e_missingbracket)); +- } + /* FALLTHROUGH */ + + default: +--- 1337,1343 ---- +*************** +*** 1512,1518 **** + } + if (i == 0) + { +- syntax_error = TRUE; + EMSGN(_("E869: (NFA) Unknown operator '\\@%c'"), op); + return FAIL; + } +--- 1487,1492 ---- +*************** +*** 1543,1552 **** + greedy = FALSE; + } + if (!read_limits(&minval, &maxval)) +- { +- syntax_error = TRUE; + EMSG_RET_FAIL(_("E870: (NFA regexp) Error reading repetition limits")); +! } + /* {0,inf}, {0,} and {} are equivalent to + * * */ + if (minval == 0 && maxval == MAX_LIMIT) +--- 1517,1524 ---- + greedy = FALSE; + } + if (!read_limits(&minval, &maxval)) + EMSG_RET_FAIL(_("E870: (NFA regexp) Error reading repetition limits")); +! + /* {0,inf}, {0,} and {} are equivalent to + * * */ + if (minval == 0 && maxval == MAX_LIMIT) +*************** +*** 1614,1624 **** + } /* end switch */ + + if (re_multi_type(peekchr()) != NOT_MULTI) +- { + /* Can't have a multi follow a multi. */ +- syntax_error = TRUE; + EMSG_RET_FAIL(_("E871: (NFA regexp) Can't have a multi follow a multi !")); +- } + + return OK; + } +--- 1586,1593 ---- +*************** +*** 1767,1776 **** + if (paren == REG_PAREN) + { + if (regnpar >= NSUBEXP) /* Too many `(' */ +- { +- syntax_error = TRUE; + EMSG_RET_FAIL(_("E872: (NFA regexp) Too many '('")); +- } + parno = regnpar++; + } + #ifdef FEAT_SYN_HL +--- 1736,1742 ---- +*************** +*** 1778,1787 **** + { + /* Make a ZOPEN node. */ + if (regnzpar >= NSUBEXP) +- { +- syntax_error = TRUE; + EMSG_RET_FAIL(_("E879: (NFA regexp) Too many \\z(")); +- } + parno = regnzpar++; + } + #endif +--- 1744,1750 ---- +*************** +*** 1800,1806 **** + /* Check for proper termination. */ + if (paren != REG_NOPAREN && getchr() != Magic(')')) + { +- syntax_error = TRUE; + if (paren == REG_NPAREN) + EMSG2_RET_FAIL(_(e_unmatchedpp), reg_magic == MAGIC_ALL); + else +--- 1763,1768 ---- +*************** +*** 1808,1814 **** + } + else if (paren == REG_NOPAREN && peekchr() != NUL) + { +- syntax_error = TRUE; + if (peekchr() == Magic(')')) + EMSG2_RET_FAIL(_(e_unmatchedpar), reg_magic == MAGIC_ALL); + else +--- 1770,1775 ---- +*** ../vim-7.3.1127/src/version.c 2013-06-05 21:30:34.000000000 +0200 +--- src/version.c 2013-06-05 21:42:28.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1128, + /**/ + +-- +From "know your smileys": + +<(:-) The Pope + + /// 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 /// diff --git a/7.3.1129 b/7.3.1129 new file mode 100644 index 0000000..00e2d1f --- /dev/null +++ b/7.3.1129 @@ -0,0 +1,699 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1129 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1129 +Problem: Can't see what pattern in syntax highlighting is slow. +Solution: Add the ":syntime" command. +Files: src/structs.h, src/syntax.c, src/ex_cmds.h, src/ex_docmd.c, + src/proto/syntax.pro, src/ex_cmds2.c, src/proto/ex_cmds2.pro, + runtime/doc/syntax.txt + + +*** ../vim-7.3.1128/src/structs.h 2013-05-19 19:16:25.000000000 +0200 +--- src/structs.h 2013-06-06 12:24:08.000000000 +0200 +*************** +*** 1206,1211 **** +--- 1206,1223 ---- + typedef struct qf_info_S qf_info_T; + #endif + ++ #ifdef FEAT_RELTIME ++ /* ++ * Used for :syntime: timing of executing a syntax pattern. ++ */ ++ typedef struct { ++ proftime_T total; /* total time used */ ++ proftime_T slowest; /* time of slowest call */ ++ long count; /* nr of times used */ ++ long match; /* nr of times matched */ ++ } syn_time_T; ++ #endif ++ + /* + * These are items normally related to a buffer. But when using ":ownsyntax" + * a window may have its own instance. +*************** +*** 1230,1235 **** +--- 1242,1250 ---- + long b_syn_sync_linebreaks; /* offset for multi-line pattern */ + char_u *b_syn_linecont_pat; /* line continuation pattern */ + regprog_T *b_syn_linecont_prog; /* line continuation program */ ++ #ifdef FEAT_RELTIME ++ syn_time_T b_syn_linecont_time; ++ #endif + int b_syn_linecont_ic; /* ignore-case flag for above */ + int b_syn_topgrp; /* for ":syntax include" */ + # ifdef FEAT_CONCEAL +*** ../vim-7.3.1128/src/syntax.c 2013-05-06 04:21:35.000000000 +0200 +--- src/syntax.c 2013-06-06 12:37:55.000000000 +0200 +*************** +*** 153,158 **** +--- 153,161 ---- + short sp_syn_match_id; /* highlight group ID of pattern */ + char_u *sp_pattern; /* regexp to match, pattern */ + regprog_T *sp_prog; /* regexp to match, program */ ++ #ifdef FEAT_RELTIME ++ syn_time_T sp_time; ++ #endif + int sp_ic; /* ignore-case flag for sp_prog */ + short sp_off_flags; /* see below */ + int sp_offsets[SPO_COUNT]; /* offsets */ +*************** +*** 269,274 **** +--- 272,279 ---- + */ + static int keepend_level = -1; + ++ static char msg_no_items[] = N_("No Syntax items defined for this buffer"); ++ + /* + * For the current state we need to remember more than just the idx. + * When si_m_endpos.lnum is 0, the items other than si_idx are unknown. +*************** +*** 395,400 **** +--- 400,420 ---- + static int in_id_list __ARGS((stateitem_T *item, short *cont_list, struct sp_syn *ssp, int contained)); + static int push_current_state __ARGS((int idx)); + static void pop_current_state __ARGS((void)); ++ #ifdef FEAT_RELTIME ++ static void syn_clear_time __ARGS((syn_time_T *tt)); ++ static void syntime_clear __ARGS((void)); ++ #ifdef __BORLANDC__ ++ static int _RTLENTRYF syn_compare_syntime __ARGS((const void *v1, const void *v2)); ++ #else ++ static int syn_compare_syntime __ARGS((const void *v1, const void *v2)); ++ #endif ++ static void syntime_report __ARGS((void)); ++ static int syn_time_on = FALSE; ++ # define IF_SYN_TIME(p) (p) ++ #else ++ # define IF_SYN_TIME(p) NULL ++ typedef int syn_time_T; ++ #endif + + static void syn_stack_apply_changes_block __ARGS((synblock_T *block, buf_T *buf)); + static void find_endpos __ARGS((int idx, lpos_T *startpos, lpos_T *m_endpos, lpos_T *hl_endpos, long *flagsp, lpos_T *end_endpos, int *end_idx, reg_extmatch_T *start_ext)); +*************** +*** 406,412 **** + static void syn_add_end_off __ARGS((lpos_T *result, regmmatch_T *regmatch, synpat_T *spp, int idx, int extra)); + static void syn_add_start_off __ARGS((lpos_T *result, regmmatch_T *regmatch, synpat_T *spp, int idx, int extra)); + static char_u *syn_getcurline __ARGS((void)); +! static int syn_regexec __ARGS((regmmatch_T *rmp, linenr_T lnum, colnr_T col)); + static int check_keyword_id __ARGS((char_u *line, int startcol, int *endcol, long *flags, short **next_list, stateitem_T *cur_si, int *ccharp)); + static void syn_cmd_case __ARGS((exarg_T *eap, int syncing)); + static void syn_cmd_spell __ARGS((exarg_T *eap, int syncing)); +--- 426,432 ---- + static void syn_add_end_off __ARGS((lpos_T *result, regmmatch_T *regmatch, synpat_T *spp, int idx, int extra)); + static void syn_add_start_off __ARGS((lpos_T *result, regmmatch_T *regmatch, synpat_T *spp, int idx, int extra)); + static char_u *syn_getcurline __ARGS((void)); +! static int syn_regexec __ARGS((regmmatch_T *rmp, linenr_T lnum, colnr_T col, syn_time_T *st)); + static int check_keyword_id __ARGS((char_u *line, int startcol, int *endcol, long *flags, short **next_list, stateitem_T *cur_si, int *ccharp)); + static void syn_cmd_case __ARGS((exarg_T *eap, int syncing)); + static void syn_cmd_spell __ARGS((exarg_T *eap, int syncing)); +*************** +*** 977,983 **** + { + regmatch.rmm_ic = syn_block->b_syn_linecont_ic; + regmatch.regprog = syn_block->b_syn_linecont_prog; +! return syn_regexec(®match, lnum, (colnr_T)0); + } + return FALSE; + } +--- 997,1004 ---- + { + regmatch.rmm_ic = syn_block->b_syn_linecont_ic; + regmatch.regprog = syn_block->b_syn_linecont_prog; +! return syn_regexec(®match, lnum, (colnr_T)0, +! IF_SYN_TIME(&syn_block->b_syn_linecont_time)); + } + return FALSE; + } +*************** +*** 2068,2075 **** + + regmatch.rmm_ic = spp->sp_ic; + regmatch.regprog = spp->sp_prog; +! if (!syn_regexec(®match, current_lnum, +! (colnr_T)lc_col)) + { + /* no match in this line, try another one */ + spp->sp_startcol = MAXCOL; +--- 2089,2098 ---- + + regmatch.rmm_ic = spp->sp_ic; + regmatch.regprog = spp->sp_prog; +! if (!syn_regexec(®match, +! current_lnum, +! (colnr_T)lc_col, +! IF_SYN_TIME(&spp->sp_time))) + { + /* no match in this line, try another one */ + spp->sp_startcol = MAXCOL; +*************** +*** 2950,2956 **** + + regmatch.rmm_ic = spp->sp_ic; + regmatch.regprog = spp->sp_prog; +! if (syn_regexec(®match, startpos->lnum, lc_col)) + { + if (best_idx == -1 || regmatch.startpos[0].col + < best_regmatch.startpos[0].col) +--- 2973,2980 ---- + + regmatch.rmm_ic = spp->sp_ic; + regmatch.regprog = spp->sp_prog; +! if (syn_regexec(®match, startpos->lnum, lc_col, +! IF_SYN_TIME(&spp->sp_time))) + { + if (best_idx == -1 || regmatch.startpos[0].col + < best_regmatch.startpos[0].col) +*************** +*** 2981,2987 **** + lc_col = 0; + regmatch.rmm_ic = spp_skip->sp_ic; + regmatch.regprog = spp_skip->sp_prog; +! if (syn_regexec(®match, startpos->lnum, lc_col) + && regmatch.startpos[0].col + <= best_regmatch.startpos[0].col) + { +--- 3005,3012 ---- + lc_col = 0; + regmatch.rmm_ic = spp_skip->sp_ic; + regmatch.regprog = spp_skip->sp_prog; +! if (syn_regexec(®match, startpos->lnum, lc_col, +! IF_SYN_TIME(&spp_skip->sp_time)) + && regmatch.startpos[0].col + <= best_regmatch.startpos[0].col) + { +*************** +*** 3229,3241 **** + * Returns TRUE when there is a match. + */ + static int +! syn_regexec(rmp, lnum, col) + regmmatch_T *rmp; + linenr_T lnum; + colnr_T col; + { + rmp->rmm_maxcol = syn_buf->b_p_smc; +! if (vim_regexec_multi(rmp, syn_win, syn_buf, lnum, col, NULL) > 0) + { + rmp->startpos[0].lnum += lnum; + rmp->endpos[0].lnum += lnum; +--- 3254,3290 ---- + * Returns TRUE when there is a match. + */ + static int +! syn_regexec(rmp, lnum, col, st) + regmmatch_T *rmp; + linenr_T lnum; + colnr_T col; ++ syn_time_T *st; + { ++ int r; ++ #ifdef FEAT_RELTIME ++ proftime_T pt; ++ ++ if (syn_time_on) ++ profile_start(&pt); ++ #endif ++ + rmp->rmm_maxcol = syn_buf->b_p_smc; +! r = vim_regexec_multi(rmp, syn_win, syn_buf, lnum, col, NULL); +! +! #ifdef FEAT_RELTIME +! if (syn_time_on) +! { +! profile_end(&pt); +! profile_add(&st->total, &pt); +! if (profile_cmp(&pt, &st->slowest) < 0) +! st->slowest = pt; +! ++st->count; +! if (r > 0) +! ++st->match; +! } +! #endif +! +! if (r > 0) + { + rmp->startpos[0].lnum += lnum; + rmp->endpos[0].lnum += lnum; +*************** +*** 3769,3775 **** + + if (!syntax_present(curwin)) + { +! MSG(_("No Syntax items defined for this buffer")); + return; + } + +--- 3818,3824 ---- + + if (!syntax_present(curwin)) + { +! MSG(_(msg_no_items)); + return; + } + +*************** +*** 5609,5614 **** +--- 5658,5666 ---- + if (ci->sp_prog == NULL) + return NULL; + ci->sp_ic = curwin->w_s->b_syn_ic; ++ #ifdef FEAT_RELTIME ++ syn_clear_time(&ci->sp_time); ++ #endif + + /* + * Check for a match, highlight or region offset. +*************** +*** 5783,5790 **** + cpo_save = p_cpo; + p_cpo = (char_u *)""; + curwin->w_s->b_syn_linecont_prog = +! vim_regcomp(curwin->w_s->b_syn_linecont_pat, RE_MAGIC); + p_cpo = cpo_save; + + if (curwin->w_s->b_syn_linecont_prog == NULL) + { +--- 5835,5845 ---- + cpo_save = p_cpo; + p_cpo = (char_u *)""; + curwin->w_s->b_syn_linecont_prog = +! vim_regcomp(curwin->w_s->b_syn_linecont_pat, RE_MAGIC); + p_cpo = cpo_save; ++ #ifdef FEAT_RELTIME ++ syn_clear_time(&curwin->w_s->b_syn_linecont_time); ++ #endif + + if (curwin->w_s->b_syn_linecont_prog == NULL) + { +*************** +*** 6471,6476 **** +--- 6526,6704 ---- + } + #endif + ++ #ifdef FEAT_RELTIME ++ /* ++ * ":syntime". ++ */ ++ void ++ ex_syntime(eap) ++ exarg_T *eap; ++ { ++ if (STRCMP(eap->arg, "on") == 0) ++ syn_time_on = TRUE; ++ else if (STRCMP(eap->arg, "off") == 0) ++ syn_time_on = FALSE; ++ else if (STRCMP(eap->arg, "clear") == 0) ++ syntime_clear(); ++ else if (STRCMP(eap->arg, "report") == 0) ++ syntime_report(); ++ else ++ EMSG2(_(e_invarg2), eap->arg); ++ } ++ ++ static void ++ syn_clear_time(st) ++ syn_time_T *st; ++ { ++ profile_zero(&st->total); ++ profile_zero(&st->slowest); ++ st->count = 0; ++ st->match = 0; ++ } ++ ++ /* ++ * Clear the syntax timing for the current buffer. ++ */ ++ static void ++ syntime_clear() ++ { ++ int idx; ++ synpat_T *spp; ++ ++ if (!syntax_present(curwin)) ++ { ++ MSG(_(msg_no_items)); ++ return; ++ } ++ for (idx = 0; idx < curwin->w_s->b_syn_patterns.ga_len; ++idx) ++ { ++ spp = &(SYN_ITEMS(curwin->w_s)[idx]); ++ syn_clear_time(&spp->sp_time); ++ } ++ } ++ ++ typedef struct ++ { ++ proftime_T total; ++ int count; ++ int match; ++ proftime_T slowest; ++ proftime_T average; ++ int id; ++ char_u *pattern; ++ } time_entry_T; ++ ++ static int ++ #ifdef __BORLANDC__ ++ _RTLENTRYF ++ #endif ++ syn_compare_syntime(v1, v2) ++ const void *v1; ++ const void *v2; ++ { ++ const time_entry_T *s1 = v1; ++ const time_entry_T *s2 = v2; ++ ++ return profile_cmp(&s1->total, &s2->total); ++ } ++ ++ /* ++ * Clear the syntax timing for the current buffer. ++ */ ++ static void ++ syntime_report() ++ { ++ int idx; ++ synpat_T *spp; ++ proftime_T tm; ++ int len; ++ proftime_T total_total; ++ int total_count = 0; ++ garray_T ga; ++ time_entry_T *p; ++ ++ if (!syntax_present(curwin)) ++ { ++ MSG(_(msg_no_items)); ++ return; ++ } ++ ++ ga_init2(&ga, sizeof(time_entry_T), 50); ++ profile_zero(&total_total); ++ for (idx = 0; idx < curwin->w_s->b_syn_patterns.ga_len; ++idx) ++ { ++ spp = &(SYN_ITEMS(curwin->w_s)[idx]); ++ if (spp->sp_time.count > 0) ++ { ++ ga_grow(&ga, 1); ++ p = ((time_entry_T *)ga.ga_data) + ga.ga_len; ++ p->total = spp->sp_time.total; ++ profile_add(&total_total, &spp->sp_time.total); ++ p->count = spp->sp_time.count; ++ p->match = spp->sp_time.match; ++ total_count += spp->sp_time.count; ++ p->slowest = spp->sp_time.slowest; ++ # ifdef FEAT_FLOAT ++ profile_divide(&spp->sp_time.total, spp->sp_time.count, &tm); ++ p->average = tm; ++ # endif ++ p->id = spp->sp_syn.id; ++ p->pattern = spp->sp_pattern; ++ ++ga.ga_len; ++ } ++ } ++ ++ /* sort on total time */ ++ qsort(ga.ga_data, (size_t)ga.ga_len, sizeof(time_entry_T), syn_compare_syntime); ++ ++ MSG_PUTS_TITLE(_(" TOTAL COUNT MATCH SLOWEST AVERAGE NAME PATTERN")); ++ MSG_PUTS("\n"); ++ for (idx = 0; idx < ga.ga_len && !got_int; ++idx) ++ { ++ spp = &(SYN_ITEMS(curwin->w_s)[idx]); ++ p = ((time_entry_T *)ga.ga_data) + idx; ++ ++ MSG_PUTS(profile_msg(&p->total)); ++ MSG_PUTS(" "); /* make sure there is always a separating space */ ++ msg_advance(13); ++ msg_outnum(p->count); ++ MSG_PUTS(" "); ++ msg_advance(20); ++ msg_outnum(p->match); ++ MSG_PUTS(" "); ++ msg_advance(26); ++ MSG_PUTS(profile_msg(&p->slowest)); ++ MSG_PUTS(" "); ++ msg_advance(38); ++ # ifdef FEAT_FLOAT ++ MSG_PUTS(profile_msg(&p->average)); ++ MSG_PUTS(" "); ++ # endif ++ msg_advance(50); ++ msg_outtrans(HL_TABLE()[p->id - 1].sg_name); ++ MSG_PUTS(" "); ++ ++ msg_advance(69); ++ if (Columns < 80) ++ len = 20; /* will wrap anyway */ ++ else ++ len = Columns - 70; ++ if (len > (int)STRLEN(p->pattern)) ++ len = (int)STRLEN(p->pattern); ++ msg_outtrans_len(p->pattern, len); ++ MSG_PUTS("\n"); ++ } ++ if (!got_int) ++ { ++ MSG_PUTS("\n"); ++ MSG_PUTS(profile_msg(&total_total)); ++ msg_advance(13); ++ msg_outnum(total_count); ++ MSG_PUTS("\n"); ++ } ++ } ++ #endif ++ + #endif /* FEAT_SYN_HL */ + + /************************************** +*** ../vim-7.3.1128/src/ex_cmds.h 2013-05-17 16:39:59.000000000 +0200 +--- src/ex_cmds.h 2013-06-05 22:20:35.000000000 +0200 +*************** +*** 925,930 **** +--- 925,932 ---- + TRLBAR|CMDWIN), + EX(CMD_syntax, "syntax", ex_syntax, + EXTRA|NOTRLCOM|CMDWIN), ++ EX(CMD_syntime, "syntime", ex_syntime, ++ WORD1|TRLBAR|CMDWIN), + EX(CMD_syncbind, "syncbind", ex_syncbind, + TRLBAR), + EX(CMD_t, "t", ex_copymove, +*** ../vim-7.3.1128/src/ex_docmd.c 2013-06-02 19:22:05.000000000 +0200 +--- src/ex_docmd.c 2013-06-05 22:21:30.000000000 +0200 +*************** +*** 242,247 **** +--- 242,250 ---- + # define ex_syntax ex_ni + # define ex_ownsyntax ex_ni + #endif ++ #if !defined(FEAT_SYN_HL) || !defined(FEAT_RELTIME) ++ # define ex_syntime ex_ni ++ #endif + #ifndef FEAT_SPELL + # define ex_spell ex_ni + # define ex_mkspell ex_ni +*** ../vim-7.3.1128/src/proto/syntax.pro 2010-08-15 21:57:28.000000000 +0200 +--- src/proto/syntax.pro 2013-06-05 22:59:09.000000000 +0200 +*************** +*** 19,24 **** +--- 19,25 ---- + int syn_get_sub_char __ARGS((void)); + int syn_get_stack_item __ARGS((int i)); + int syn_get_foldlevel __ARGS((win_T *wp, long lnum)); ++ void ex_syntime __ARGS((exarg_T *eap)); + void init_highlight __ARGS((int both, int reset)); + int load_colors __ARGS((char_u *name)); + void do_highlight __ARGS((char_u *line, int forceit, int init)); +*** ../vim-7.3.1128/src/ex_cmds2.c 2013-05-06 04:50:26.000000000 +0200 +--- src/ex_cmds2.c 2013-06-06 12:14:52.000000000 +0200 +*************** +*** 958,963 **** +--- 958,993 ---- + + # endif /* FEAT_PROFILE || FEAT_RELTIME */ + ++ #if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME) && defined(FEAT_FLOAT) ++ # if defined(HAVE_MATH_H) ++ # include ++ # endif ++ ++ /* ++ * Divide the time "tm" by "count" and store in "tm2". ++ */ ++ void ++ profile_divide(tm, count, tm2) ++ proftime_T *tm; ++ proftime_T *tm2; ++ int count; ++ { ++ if (count == 0) ++ profile_zero(tm2); ++ else ++ { ++ # ifdef WIN3264 ++ tm2->QuadPart = tm->QuadPart / count; ++ # else ++ double usec = (tm->tv_sec * 1000000.0 + tm->tv_usec) / count; ++ ++ tm2->tv_sec = floor(usec / 1000000.0); ++ tm2->tv_usec = round(usec - (tm2->tv_sec * 1000000.0)); ++ # endif ++ } ++ } ++ #endif ++ + # if defined(FEAT_PROFILE) || defined(PROTO) + /* + * Functions for profiling. +*************** +*** 1050,1056 **** + */ + int + profile_cmp(tm1, tm2) +! proftime_T *tm1, *tm2; + { + # ifdef WIN3264 + return (int)(tm2->QuadPart - tm1->QuadPart); +--- 1080,1086 ---- + */ + int + profile_cmp(tm1, tm2) +! const proftime_T *tm1, *tm2; + { + # ifdef WIN3264 + return (int)(tm2->QuadPart - tm1->QuadPart); +*** ../vim-7.3.1128/src/proto/ex_cmds2.pro 2012-06-29 12:57:03.000000000 +0200 +--- src/proto/ex_cmds2.pro 2013-06-06 12:14:57.000000000 +0200 +*************** +*** 17,28 **** + void profile_setlimit __ARGS((long msec, proftime_T *tm)); + int profile_passed_limit __ARGS((proftime_T *tm)); + void profile_zero __ARGS((proftime_T *tm)); + void profile_add __ARGS((proftime_T *tm, proftime_T *tm2)); + void profile_self __ARGS((proftime_T *self, proftime_T *total, proftime_T *children)); + void profile_get_wait __ARGS((proftime_T *tm)); + void profile_sub_wait __ARGS((proftime_T *tm, proftime_T *tma)); + int profile_equal __ARGS((proftime_T *tm1, proftime_T *tm2)); +! int profile_cmp __ARGS((proftime_T *tm1, proftime_T *tm2)); + void ex_profile __ARGS((exarg_T *eap)); + char_u *get_profile_name __ARGS((expand_T *xp, int idx)); + void set_context_in_profile_cmd __ARGS((expand_T *xp, char_u *arg)); +--- 17,29 ---- + void profile_setlimit __ARGS((long msec, proftime_T *tm)); + int profile_passed_limit __ARGS((proftime_T *tm)); + void profile_zero __ARGS((proftime_T *tm)); ++ void profile_divide __ARGS((proftime_T *tm, int count, proftime_T *tm2)); + void profile_add __ARGS((proftime_T *tm, proftime_T *tm2)); + void profile_self __ARGS((proftime_T *self, proftime_T *total, proftime_T *children)); + void profile_get_wait __ARGS((proftime_T *tm)); + void profile_sub_wait __ARGS((proftime_T *tm, proftime_T *tma)); + int profile_equal __ARGS((proftime_T *tm1, proftime_T *tm2)); +! int profile_cmp __ARGS((const proftime_T *tm1, const proftime_T *tm2)); + void ex_profile __ARGS((exarg_T *eap)); + char_u *get_profile_name __ARGS((expand_T *xp, int idx)); + void set_context_in_profile_cmd __ARGS((expand_T *xp, char_u *arg)); +*** ../vim-7.3.1128/runtime/doc/syntax.txt 2010-08-15 21:57:12.000000000 +0200 +--- runtime/doc/syntax.txt 2013-06-06 13:00:36.000000000 +0200 +*************** +*** 37,42 **** +--- 37,43 ---- + 15. Highlighting tags |tag-highlight| + 16. Window-local syntax |:ownsyntax| + 17. Color xterms |xterm-color| ++ 18. When syntax is slow |:syntime| + + {Vi does not have any of these commands} + +*************** +*** 4754,4757 **** +--- 5087,5146 ---- + that Setup / Font / Enable Bold is NOT enabled. + (info provided by John Love-Jensen ) + ++ ++ ============================================================================== ++ 18. When syntax is slow *:syntime* ++ ++ This is aimed at authors of a syntax file. ++ ++ If your syntax causes redrawing to be slow, here are a few hints on making it ++ faster. To see slowness switch on some features that usually interfere, such ++ as 'relativenumber' and |folding|. ++ ++ To find out what patterns are consuming most time, get an overview with this ++ sequence: > ++ :syntime on ++ [ redraw the text at least once with CTRL-L ] ++ :syntime report ++ ++ This will display a list of syntax patterns that were used, sorted by the time ++ it took to match them against the text. ++ ++ :syntime on Start measuring syntax times. This will add some ++ overhead to compute the time spent on syntax pattern ++ matching. ++ ++ :syntime off Stop measuring syntax times. ++ ++ :syntime clear Set all the counters to zero, restart measuring. ++ ++ :syntime report Show the syntax items used since ":syntime on" in the ++ current window. Use a wider display to see more of ++ the output. ++ ++ The list is sorted by total time. The columns are: ++ TOTAL Total time in seconds spent on ++ matching this pattern. ++ COUNT Number of times the pattern was used. ++ MATCH Number of times the pattern actually ++ matched ++ SLOWEST The longest time for one try. ++ AVERAGE The average time for one try. ++ NAME Name of the syntax item. Note that ++ this is not unique. ++ PATTERN The pattern being used. ++ ++ Pattern matching gets slow when it has to try many alternatives. Try to ++ include as much literal text as possible to reduce the number of ways a ++ pattern does NOT match. ++ ++ When using the "\@<=" and "\@ +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1130 (after 7.3.1129) +Problem: Can't build with anything but huge features. +Solution: Check for FEAT_PROFILE. (Yasuhiro Matsumoto) +Files: src/ex_docmd.c, src/structs.h, src/syntax.c + + +*** ../vim-7.3.1129/src/ex_docmd.c 2013-06-06 14:01:35.000000000 +0200 +--- src/ex_docmd.c 2013-06-06 14:49:26.000000000 +0200 +*************** +*** 242,248 **** + # define ex_syntax ex_ni + # define ex_ownsyntax ex_ni + #endif +! #if !defined(FEAT_SYN_HL) || !defined(FEAT_RELTIME) + # define ex_syntime ex_ni + #endif + #ifndef FEAT_SPELL +--- 242,248 ---- + # define ex_syntax ex_ni + # define ex_ownsyntax ex_ni + #endif +! #if !defined(FEAT_SYN_HL) || !defined(FEAT_PROFILE) + # define ex_syntime ex_ni + #endif + #ifndef FEAT_SPELL +*** ../vim-7.3.1129/src/structs.h 2013-06-06 14:01:35.000000000 +0200 +--- src/structs.h 2013-06-06 14:49:26.000000000 +0200 +*************** +*** 1206,1212 **** + typedef struct qf_info_S qf_info_T; + #endif + +! #ifdef FEAT_RELTIME + /* + * Used for :syntime: timing of executing a syntax pattern. + */ +--- 1206,1212 ---- + typedef struct qf_info_S qf_info_T; + #endif + +! #ifdef FEAT_PROFILE + /* + * Used for :syntime: timing of executing a syntax pattern. + */ +*************** +*** 1242,1248 **** + long b_syn_sync_linebreaks; /* offset for multi-line pattern */ + char_u *b_syn_linecont_pat; /* line continuation pattern */ + regprog_T *b_syn_linecont_prog; /* line continuation program */ +! #ifdef FEAT_RELTIME + syn_time_T b_syn_linecont_time; + #endif + int b_syn_linecont_ic; /* ignore-case flag for above */ +--- 1242,1248 ---- + long b_syn_sync_linebreaks; /* offset for multi-line pattern */ + char_u *b_syn_linecont_pat; /* line continuation pattern */ + regprog_T *b_syn_linecont_prog; /* line continuation program */ +! #ifdef FEAT_PROFILE + syn_time_T b_syn_linecont_time; + #endif + int b_syn_linecont_ic; /* ignore-case flag for above */ +*** ../vim-7.3.1129/src/syntax.c 2013-06-06 14:01:35.000000000 +0200 +--- src/syntax.c 2013-06-06 14:49:26.000000000 +0200 +*************** +*** 153,159 **** + short sp_syn_match_id; /* highlight group ID of pattern */ + char_u *sp_pattern; /* regexp to match, pattern */ + regprog_T *sp_prog; /* regexp to match, program */ +! #ifdef FEAT_RELTIME + syn_time_T sp_time; + #endif + int sp_ic; /* ignore-case flag for sp_prog */ +--- 153,159 ---- + short sp_syn_match_id; /* highlight group ID of pattern */ + char_u *sp_pattern; /* regexp to match, pattern */ + regprog_T *sp_prog; /* regexp to match, program */ +! #ifdef FEAT_PROFILE + syn_time_T sp_time; + #endif + int sp_ic; /* ignore-case flag for sp_prog */ +*************** +*** 400,406 **** + static int in_id_list __ARGS((stateitem_T *item, short *cont_list, struct sp_syn *ssp, int contained)); + static int push_current_state __ARGS((int idx)); + static void pop_current_state __ARGS((void)); +! #ifdef FEAT_RELTIME + static void syn_clear_time __ARGS((syn_time_T *tt)); + static void syntime_clear __ARGS((void)); + #ifdef __BORLANDC__ +--- 400,406 ---- + static int in_id_list __ARGS((stateitem_T *item, short *cont_list, struct sp_syn *ssp, int contained)); + static int push_current_state __ARGS((int idx)); + static void pop_current_state __ARGS((void)); +! #ifdef FEAT_PROFILE + static void syn_clear_time __ARGS((syn_time_T *tt)); + static void syntime_clear __ARGS((void)); + #ifdef __BORLANDC__ +*************** +*** 3261,3267 **** + syn_time_T *st; + { + int r; +! #ifdef FEAT_RELTIME + proftime_T pt; + + if (syn_time_on) +--- 3261,3267 ---- + syn_time_T *st; + { + int r; +! #ifdef FEAT_PROFILE + proftime_T pt; + + if (syn_time_on) +*************** +*** 3271,3277 **** + rmp->rmm_maxcol = syn_buf->b_p_smc; + r = vim_regexec_multi(rmp, syn_win, syn_buf, lnum, col, NULL); + +! #ifdef FEAT_RELTIME + if (syn_time_on) + { + profile_end(&pt); +--- 3271,3277 ---- + rmp->rmm_maxcol = syn_buf->b_p_smc; + r = vim_regexec_multi(rmp, syn_win, syn_buf, lnum, col, NULL); + +! #ifdef FEAT_PROFILE + if (syn_time_on) + { + profile_end(&pt); +*************** +*** 5658,5664 **** + if (ci->sp_prog == NULL) + return NULL; + ci->sp_ic = curwin->w_s->b_syn_ic; +! #ifdef FEAT_RELTIME + syn_clear_time(&ci->sp_time); + #endif + +--- 5658,5664 ---- + if (ci->sp_prog == NULL) + return NULL; + ci->sp_ic = curwin->w_s->b_syn_ic; +! #ifdef FEAT_PROFILE + syn_clear_time(&ci->sp_time); + #endif + +*************** +*** 5837,5843 **** + curwin->w_s->b_syn_linecont_prog = + vim_regcomp(curwin->w_s->b_syn_linecont_pat, RE_MAGIC); + p_cpo = cpo_save; +! #ifdef FEAT_RELTIME + syn_clear_time(&curwin->w_s->b_syn_linecont_time); + #endif + +--- 5837,5843 ---- + curwin->w_s->b_syn_linecont_prog = + vim_regcomp(curwin->w_s->b_syn_linecont_pat, RE_MAGIC); + p_cpo = cpo_save; +! #ifdef FEAT_PROFILE + syn_clear_time(&curwin->w_s->b_syn_linecont_time); + #endif + +*************** +*** 6526,6532 **** + } + #endif + +! #ifdef FEAT_RELTIME + /* + * ":syntime". + */ +--- 6526,6532 ---- + } + #endif + +! #ifdef FEAT_PROFILE + /* + * ":syntime". + */ +*** ../vim-7.3.1129/src/version.c 2013-06-06 14:01:36.000000000 +0200 +--- src/version.c 2013-06-06 14:54:31.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1130, + /**/ + +-- +From "know your smileys": + @:-() Elvis Presley + + /// 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 /// diff --git a/7.3.1131 b/7.3.1131 new file mode 100644 index 0000000..1c51072 --- /dev/null +++ b/7.3.1131 @@ -0,0 +1,162 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1131 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1131 +Problem: New regexp engine is a bit slow. +Solution: Do not clear the state list. Don't copy syntax submatches when + not used. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1130/src/regexp_nfa.c 2013-06-05 21:42:49.000000000 +0200 +--- src/regexp_nfa.c 2013-06-06 15:57:14.000000000 +0200 +*************** +*** 319,325 **** + post_start = (int *)lalloc(postfix_size, TRUE); + if (post_start == NULL) + return FAIL; +- vim_memset(post_start, 0, postfix_size); + post_ptr = post_start; + post_end = post_start + nstate_max; + nfa_has_zend = FALSE; +--- 319,324 ---- +*************** +*** 347,353 **** + if (new_start == NULL) + return FAIL; + mch_memmove(new_start, post_start, nstate_max * sizeof(int)); +- vim_memset(new_start + nstate_max, 0, 1000 * sizeof(int)); + old_start = post_start; + post_start = new_start; + post_ptr = new_start + (post_ptr - old_start); +--- 346,351 ---- +*************** +*** 4127,4137 **** + + /* Allocate memory for the lists of nodes. */ + size = (nstate + 1) * sizeof(nfa_thread_T); +! list[0].t = (nfa_thread_T *)lalloc_clear(size, TRUE); + list[0].len = nstate + 1; +! list[1].t = (nfa_thread_T *)lalloc_clear(size, TRUE); + list[1].len = nstate + 1; +! list[2].t = (nfa_thread_T *)lalloc_clear(size, TRUE); + list[2].len = nstate + 1; + if (list[0].t == NULL || list[1].t == NULL || list[2].t == NULL) + goto theend; +--- 4125,4135 ---- + + /* Allocate memory for the lists of nodes. */ + size = (nstate + 1) * sizeof(nfa_thread_T); +! list[0].t = (nfa_thread_T *)lalloc(size, TRUE); + list[0].len = nstate + 1; +! list[1].t = (nfa_thread_T *)lalloc(size, TRUE); + list[1].len = nstate + 1; +! list[2].t = (nfa_thread_T *)lalloc(size, TRUE); + list[2].len = nstate + 1; + if (list[0].t == NULL || list[1].t == NULL || list[2].t == NULL) + goto theend; +*************** +*** 4390,4396 **** + /* Copy submatch info from the recursive call */ + copy_sub_off(&t->subs.norm, &m->norm); + #ifdef FEAT_SYN_HL +! copy_sub_off(&t->subs.synt, &m->synt); + #endif + + /* t->state->out1 is the corresponding +--- 4388,4395 ---- + /* Copy submatch info from the recursive call */ + copy_sub_off(&t->subs.norm, &m->norm); + #ifdef FEAT_SYN_HL +! if (nfa_has_zsubexpr) +! copy_sub_off(&t->subs.synt, &m->synt); + #endif + + /* t->state->out1 is the corresponding +*************** +*** 4441,4447 **** + /* Copy submatch info from the recursive call */ + copy_sub_off(&t->subs.norm, &m->norm); + #ifdef FEAT_SYN_HL +! copy_sub_off(&t->subs.synt, &m->synt); + #endif + /* Now we need to skip over the matched text and then + * continue with what follows. */ +--- 4440,4447 ---- + /* Copy submatch info from the recursive call */ + copy_sub_off(&t->subs.norm, &m->norm); + #ifdef FEAT_SYN_HL +! if (nfa_has_zsubexpr) +! copy_sub_off(&t->subs.synt, &m->synt); + #endif + /* Now we need to skip over the matched text and then + * continue with what follows. */ +*************** +*** 5053,5059 **** + /* Copy submatch info from the recursive call */ + copy_sub_off(&t->pim->subs.norm, &m->norm); + #ifdef FEAT_SYN_HL +! copy_sub_off(&t->pim->subs.synt, &m->synt); + #endif + } + } +--- 5053,5060 ---- + /* Copy submatch info from the recursive call */ + copy_sub_off(&t->pim->subs.norm, &m->norm); + #ifdef FEAT_SYN_HL +! if (nfa_has_zsubexpr) +! copy_sub_off(&t->pim->subs.synt, &m->synt); + #endif + } + } +*************** +*** 5074,5080 **** + /* Copy submatch info from the recursive call */ + copy_sub_off(&t->subs.norm, &t->pim->subs.norm); + #ifdef FEAT_SYN_HL +! copy_sub_off(&t->subs.synt, &t->pim->subs.synt); + #endif + } + else +--- 5075,5082 ---- + /* Copy submatch info from the recursive call */ + copy_sub_off(&t->subs.norm, &t->pim->subs.norm); + #ifdef FEAT_SYN_HL +! if (nfa_has_zsubexpr) +! copy_sub_off(&t->subs.synt, &t->pim->subs.synt); + #endif + } + else +*************** +*** 5440,5446 **** + prog = (nfa_regprog_T *)lalloc(prog_size, TRUE); + if (prog == NULL) + goto fail; +- vim_memset(prog, 0, prog_size); + state_ptr = prog->state; + + /* +--- 5442,5447 ---- +*** ../vim-7.3.1130/src/version.c 2013-06-06 14:55:16.000000000 +0200 +--- src/version.c 2013-06-06 16:21:32.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1131, + /**/ + +-- +There's no place like $(HOME)! + + /// 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 /// diff --git a/7.3.1132 b/7.3.1132 new file mode 100644 index 0000000..d7ac4a3 --- /dev/null +++ b/7.3.1132 @@ -0,0 +1,87 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1132 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1132 +Problem: Crash when debugging regexp. +Solution: Do not try to dump subexpr that were not set. Skip over count of + \% items. +Files: src/regexp.c, src/regexp_nfa.c + + +*** ../vim-7.3.1131/src/regexp.c 2013-06-05 21:42:49.000000000 +0200 +--- src/regexp.c 2013-06-06 18:04:09.000000000 +0200 +*************** +*** 6548,6553 **** +--- 6548,6559 ---- + fprintf(f, " count %ld", OPERAND_MIN(s)); + s += 4; + } ++ else if (op == RE_LNUM || op == RE_COL || op == RE_VCOL) ++ { ++ /* one int plus comperator */ ++ fprintf(f, " count %ld", OPERAND_MIN(s)); ++ s += 5; ++ } + s += 3; + if (op == ANYOF || op == ANYOF + ADD_NL + || op == ANYBUT || op == ANYBUT + ADD_NL +*** ../vim-7.3.1131/src/regexp_nfa.c 2013-06-06 16:22:01.000000000 +0200 +--- src/regexp_nfa.c 2013-06-06 18:03:27.000000000 +0200 +*************** +*** 256,262 **** + /* 0 for first call to nfa_regmatch(), 1 for recursive call. */ + static int nfa_ll_index = 0; + +! static int nfa_regcomp_start __ARGS((char_u*expr, int re_flags)); + static int nfa_recognize_char_class __ARGS((char_u *start, char_u *end, int extra_newl)); + static int nfa_emit_equi_class __ARGS((int c, int neg)); + static int nfa_regatom __ARGS((void)); +--- 256,262 ---- + /* 0 for first call to nfa_regmatch(), 1 for recursive call. */ + static int nfa_ll_index = 0; + +! static int nfa_regcomp_start __ARGS((char_u *expr, int re_flags)); + static int nfa_recognize_char_class __ARGS((char_u *start, char_u *end, int extra_newl)); + static int nfa_emit_equi_class __ARGS((int c, int neg)); + static int nfa_regatom __ARGS((void)); +*************** +*** 2927,2933 **** + { + log_subexpr(&subs->norm); + # ifdef FEAT_SYN_HL +! log_subexpr(&subs->synt); + # endif + } + +--- 2927,2934 ---- + { + log_subexpr(&subs->norm); + # ifdef FEAT_SYN_HL +! if (nfa_has_zsubexpr) +! log_subexpr(&subs->synt); + # endif + } + +*** ../vim-7.3.1131/src/version.c 2013-06-06 16:22:01.000000000 +0200 +--- src/version.c 2013-06-06 17:58:00.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1132, + /**/ + +-- +Momento mori, ergo carpe diem + + /// 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 /// diff --git a/7.3.1133 b/7.3.1133 new file mode 100644 index 0000000..5882b75 --- /dev/null +++ b/7.3.1133 @@ -0,0 +1,358 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1133 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1133 +Problem: New regexp engine is a bit slow. +Solution: Skip ahead to a character that must match. Don't try matching a + "^" patter past the start of line. +Files: src/regexp_nfa.c, src/regexp.h + + +*** ../vim-7.3.1132/src/regexp_nfa.c 2013-06-06 18:04:47.000000000 +0200 +--- src/regexp_nfa.c 2013-06-06 18:37:23.000000000 +0200 +*************** +*** 257,262 **** +--- 257,264 ---- + static int nfa_ll_index = 0; + + static int nfa_regcomp_start __ARGS((char_u *expr, int re_flags)); ++ static int nfa_get_reganch __ARGS((nfa_state_T *start, int depth)); ++ static int nfa_get_regstart __ARGS((nfa_state_T *start, int depth)); + static int nfa_recognize_char_class __ARGS((char_u *start, char_u *end, int extra_newl)); + static int nfa_emit_equi_class __ARGS((int c, int neg)); + static int nfa_regatom __ARGS((void)); +*************** +*** 331,336 **** +--- 333,487 ---- + } + + /* ++ * Figure out if the NFA state list starts with an anchor, must match at start ++ * of the line. ++ */ ++ static int ++ nfa_get_reganch(start, depth) ++ nfa_state_T *start; ++ int depth; ++ { ++ nfa_state_T *p = start; ++ ++ if (depth > 4) ++ return 0; ++ ++ while (p != NULL) ++ { ++ switch (p->c) ++ { ++ case NFA_BOL: ++ case NFA_BOF: ++ return 1; /* yes! */ ++ ++ case NFA_ZSTART: ++ case NFA_ZEND: ++ case NFA_CURSOR: ++ case NFA_VISUAL: ++ ++ case NFA_MOPEN: ++ case NFA_MOPEN1: ++ case NFA_MOPEN2: ++ case NFA_MOPEN3: ++ case NFA_MOPEN4: ++ case NFA_MOPEN5: ++ case NFA_MOPEN6: ++ case NFA_MOPEN7: ++ case NFA_MOPEN8: ++ case NFA_MOPEN9: ++ case NFA_NOPEN: ++ #ifdef FEAT_SYN_HL ++ case NFA_ZOPEN: ++ case NFA_ZOPEN1: ++ case NFA_ZOPEN2: ++ case NFA_ZOPEN3: ++ case NFA_ZOPEN4: ++ case NFA_ZOPEN5: ++ case NFA_ZOPEN6: ++ case NFA_ZOPEN7: ++ case NFA_ZOPEN8: ++ case NFA_ZOPEN9: ++ #endif ++ p = p->out; ++ break; ++ ++ case NFA_SPLIT: ++ return nfa_get_reganch(p->out, depth + 1) ++ && nfa_get_reganch(p->out1, depth + 1); ++ ++ default: ++ return 0; /* noooo */ ++ } ++ } ++ return 0; ++ } ++ ++ /* ++ * Figure out if the NFA state list starts with a character which must match ++ * at start of the match. ++ */ ++ static int ++ nfa_get_regstart(start, depth) ++ nfa_state_T *start; ++ int depth; ++ { ++ nfa_state_T *p = start; ++ ++ if (depth > 4) ++ return 0; ++ ++ while (p != NULL) ++ { ++ switch (p->c) ++ { ++ /* all kinds of zero-width matches */ ++ case NFA_BOL: ++ case NFA_BOF: ++ case NFA_BOW: ++ case NFA_EOW: ++ case NFA_ZSTART: ++ case NFA_ZEND: ++ case NFA_CURSOR: ++ case NFA_VISUAL: ++ case NFA_LNUM: ++ case NFA_LNUM_GT: ++ case NFA_LNUM_LT: ++ case NFA_COL: ++ case NFA_COL_GT: ++ case NFA_COL_LT: ++ case NFA_VCOL: ++ case NFA_VCOL_GT: ++ case NFA_VCOL_LT: ++ case NFA_MARK: ++ case NFA_MARK_GT: ++ case NFA_MARK_LT: ++ ++ case NFA_MOPEN: ++ case NFA_MOPEN1: ++ case NFA_MOPEN2: ++ case NFA_MOPEN3: ++ case NFA_MOPEN4: ++ case NFA_MOPEN5: ++ case NFA_MOPEN6: ++ case NFA_MOPEN7: ++ case NFA_MOPEN8: ++ case NFA_MOPEN9: ++ case NFA_NOPEN: ++ #ifdef FEAT_SYN_HL ++ case NFA_ZOPEN: ++ case NFA_ZOPEN1: ++ case NFA_ZOPEN2: ++ case NFA_ZOPEN3: ++ case NFA_ZOPEN4: ++ case NFA_ZOPEN5: ++ case NFA_ZOPEN6: ++ case NFA_ZOPEN7: ++ case NFA_ZOPEN8: ++ case NFA_ZOPEN9: ++ #endif ++ p = p->out; ++ break; ++ ++ case NFA_SPLIT: ++ { ++ int c1 = nfa_get_regstart(p->out, depth + 1); ++ int c2 = nfa_get_regstart(p->out1, depth + 1); ++ ++ if (c1 == c2) ++ return c1; /* yes! */ ++ return 0; ++ } ++ ++ default: ++ if (p->c > 0 && !p->negated) ++ return p->c; /* yes! */ ++ return 0; ++ } ++ } ++ return 0; ++ } ++ ++ /* + * Allocate more space for post_start. Called when + * running above the estimated number of states. + */ +*************** +*** 2121,2126 **** +--- 2272,2281 ---- + if (debugf != NULL) + { + nfa_print_state(debugf, prog->start); ++ ++ fprintf(debugf, "reganch: %d\n", prog->reganch); ++ fprintf(debugf, "regstart: %d\n", prog->regstart); ++ + fclose(debugf); + } + } +*************** +*** 4248,4253 **** +--- 4403,4412 ---- + t = &neglist->t[0]; + neglist->n--; + listidx--; ++ #ifdef ENABLE_LOG ++ fprintf(log_fd, " using neglist entry, %d remaining\n", ++ neglist->n); ++ #endif + } + else + t = &thislist->t[listidx]; +*************** +*** 4688,4694 **** + + case NFA_END_NEG_RANGE: + /* This follows a series of negated nodes, like: +! * CHAR(x), NFA_NOT, CHAR(y), NFA_NOT etc. */ + if (curc > 0) + { + ll = nextlist; +--- 4847,4853 ---- + + case NFA_END_NEG_RANGE: + /* This follows a series of negated nodes, like: +! * NOT CHAR(x), NOT CHAR(y), etc. */ + if (curc > 0) + { + ll = nextlist; +*************** +*** 5304,5316 **** + * Returns 0 for failure, number of lines contained in the match otherwise. + */ + static long +! nfa_regexec_both(line, col) + char_u *line; +! colnr_T col; /* column to start looking for match */ + { + nfa_regprog_T *prog; + long retval = 0L; + int i; + + if (REG_MULTI) + { +--- 5463,5476 ---- + * Returns 0 for failure, number of lines contained in the match otherwise. + */ + static long +! nfa_regexec_both(line, startcol) + char_u *line; +! colnr_T startcol; /* column to start looking for match */ + { + nfa_regprog_T *prog; + long retval = 0L; + int i; ++ colnr_T col = startcol; + + if (REG_MULTI) + { +*************** +*** 5333,5342 **** + goto theend; + } + +- /* If the start column is past the maximum column: no need to try. */ +- if (ireg_maxcol > 0 && col >= ireg_maxcol) +- goto theend; +- + /* If pattern contains "\c" or "\C": overrule value of ireg_ic */ + if (prog->regflags & RF_ICASE) + ireg_ic = TRUE; +--- 5493,5498 ---- +*************** +*** 5361,5366 **** +--- 5517,5548 ---- + nfa_regengine.expr = prog->pattern; + #endif + ++ if (prog->reganch && col > 0) ++ return 0L; ++ ++ if (prog->regstart != NUL) ++ { ++ char_u *s; ++ ++ /* Skip until the char we know it must start with. ++ * Used often, do some work to avoid call overhead. */ ++ if (!ireg_ic ++ #ifdef FEAT_MBYTE ++ && !has_mbyte ++ #endif ++ ) ++ s = vim_strbyte(regline + col, prog->regstart); ++ else ++ s = cstrchr(regline + col, prog->regstart); ++ if (s == NULL) ++ return 0L; ++ col = (int)(s - regline); ++ } ++ ++ /* If the start column is past the maximum column: no need to try. */ ++ if (ireg_maxcol > 0 && col >= ireg_maxcol) ++ goto theend; ++ + nstate = prog->nstate; + for (i = 0; i < nstate; ++i) + { +*************** +*** 5459,5464 **** +--- 5641,5650 ---- + prog->has_zend = nfa_has_zend; + prog->has_backref = nfa_has_backref; + prog->nsubexp = regnpar; ++ ++ prog->reganch = nfa_get_reganch(prog->start, 0); ++ prog->regstart = nfa_get_regstart(prog->start, 0); ++ + #ifdef ENABLE_LOG + nfa_postfix_dump(expr, OK); + nfa_dump(prog); +*** ../vim-7.3.1132/src/regexp.h 2013-06-03 12:17:00.000000000 +0200 +--- src/regexp.h 2013-06-06 17:19:23.000000000 +0200 +*************** +*** 87,92 **** +--- 87,96 ---- + unsigned regflags; + + nfa_state_T *start; /* points into state[] */ ++ ++ int reganch; /* pattern starts with ^ */ ++ int regstart; /* char at start of pattern */ ++ + int has_zend; /* pattern contains \ze */ + int has_backref; /* pattern contains \1 .. \9 */ + #ifdef FEAT_SYN_HL +*** ../vim-7.3.1132/src/version.c 2013-06-06 18:04:47.000000000 +0200 +--- src/version.c 2013-06-06 18:43:55.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1133, + /**/ + +-- +From "know your smileys": + % Bike accident. A bit far-fetched, I suppose; although... + o _ _ _ + _o /\_ _ \\o (_)\__/o (_) + _< \_ _>(_) (_)/<_ \_| \ _|/' \/ + (_)>(_) (_) (_) (_) (_)' _\o_ + + /// 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 /// diff --git a/7.3.1134 b/7.3.1134 new file mode 100644 index 0000000..65b7d00 --- /dev/null +++ b/7.3.1134 @@ -0,0 +1,67 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1134 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1134 +Problem: Running test 49 takes a long time. +Solution: Don't have it grep all files. +Files: src/testdir/test49.vim + + +*** ../vim-7.3.1133/src/testdir/test49.vim 2013-02-26 22:54:06.000000000 +0100 +--- src/testdir/test49.vim 2013-06-06 18:13:46.000000000 +0200 +*************** +*** 1,6 **** + " Vim script language tests + " Author: Servatius Brandt +! " Last Change: 2012 Nov 23 + + "------------------------------------------------------------------------------- + " Test environment {{{1 +--- 1,6 ---- + " Vim script language tests + " Author: Servatius Brandt +! " Last Change: 2013 Jun 06 + + "------------------------------------------------------------------------------- + " Test environment {{{1 +*************** +*** 9612,9618 **** + func F + au BufUnload * :call setloclist(0, [{'bufnr':1, 'lnum':1, 'col':1, 'text': 'tango down'}]) + +! :lvimgrep /.*/ * + endfunc + + XpathINIT +--- 9612,9618 ---- + func F + au BufUnload * :call setloclist(0, [{'bufnr':1, 'lnum':1, 'col':1, 'text': 'tango down'}]) + +! :lvimgrep /.*/ *.mak + endfunc + + XpathINIT +*** ../vim-7.3.1133/src/version.c 2013-06-06 18:46:00.000000000 +0200 +--- src/version.c 2013-06-06 18:55:21.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1134, + /**/ + +-- +I AM THANKFUL... +...for the taxes that I pay because it means that I am employed. + + /// 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 /// diff --git a/7.3.1135 b/7.3.1135 new file mode 100644 index 0000000..a208648 --- /dev/null +++ b/7.3.1135 @@ -0,0 +1,71 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1135 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1135 +Problem: Compiler warning for unused argument. +Solution: Add UNUSED. +Files: src/syntax.c + + +*** ../vim-7.3.1134/src/syntax.c 2013-06-06 14:55:16.000000000 +0200 +--- src/syntax.c 2013-06-06 21:18:20.000000000 +0200 +*************** +*** 3258,3264 **** + regmmatch_T *rmp; + linenr_T lnum; + colnr_T col; +! syn_time_T *st; + { + int r; + #ifdef FEAT_PROFILE +--- 3258,3264 ---- + regmmatch_T *rmp; + linenr_T lnum; + colnr_T col; +! syn_time_T *st UNUSED; + { + int r; + #ifdef FEAT_PROFILE +*************** +*** 6649,6655 **** + } + + /* sort on total time */ +! qsort(ga.ga_data, (size_t)ga.ga_len, sizeof(time_entry_T), syn_compare_syntime); + + MSG_PUTS_TITLE(_(" TOTAL COUNT MATCH SLOWEST AVERAGE NAME PATTERN")); + MSG_PUTS("\n"); +--- 6649,6656 ---- + } + + /* sort on total time */ +! qsort(ga.ga_data, (size_t)ga.ga_len, sizeof(time_entry_T), +! syn_compare_syntime); + + MSG_PUTS_TITLE(_(" TOTAL COUNT MATCH SLOWEST AVERAGE NAME PATTERN")); + MSG_PUTS("\n"); +*** ../vim-7.3.1134/src/version.c 2013-06-06 18:55:45.000000000 +0200 +--- src/version.c 2013-06-06 21:19:01.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1135, + /**/ + +-- +I AM THANKFUL... +...for all the complaining I hear about the government +because it means we have freedom of speech. + + /// 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 /// diff --git a/7.3.1136 b/7.3.1136 new file mode 100644 index 0000000..5d06cb1 --- /dev/null +++ b/7.3.1136 @@ -0,0 +1,50 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1136 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1136 +Problem: ":func Foo" does not show attributes. +Solution: Add "abort", "dict" and "range". (Yasuhiro Matsumoto) +Files: src/eval.c + + +*** ../vim-7.3.1135/src/eval.c 2013-05-30 13:37:23.000000000 +0200 +--- src/eval.c 2013-06-06 21:29:06.000000000 +0200 +*************** +*** 21891,21896 **** +--- 21891,21902 ---- + MSG_PUTS("..."); + } + msg_putchar(')'); ++ if (fp->uf_flags & FC_ABORT) ++ MSG_PUTS(" abort"); ++ if (fp->uf_flags & FC_RANGE) ++ MSG_PUTS(" range"); ++ if (fp->uf_flags & FC_DICT) ++ MSG_PUTS(" dict"); + msg_clr_eos(); + if (p_verbose > 0) + last_set_msg(fp->uf_script_ID); +*** ../vim-7.3.1135/src/version.c 2013-06-06 21:19:40.000000000 +0200 +--- src/version.c 2013-06-06 21:30:05.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1136, + /**/ + +-- +From "know your smileys": + :-E Has major dental problems + + /// 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 /// diff --git a/7.3.1137 b/7.3.1137 new file mode 100644 index 0000000..fb26417 --- /dev/null +++ b/7.3.1137 @@ -0,0 +1,966 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1137 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1137 +Problem: New regexp engine: collections are slow. +Solution: Handle all characters in one go. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1136/src/regexp_nfa.c 2013-06-06 18:46:00.000000000 +0200 +--- src/regexp_nfa.c 2013-06-07 13:40:58.000000000 +0200 +*************** +*** 34,48 **** + NFA_SPLIT = -1024, + NFA_MATCH, + NFA_SKIP_CHAR, /* matches a 0-length char */ +- NFA_END_NEG_RANGE, /* Used when expanding [^ab] */ + +! NFA_CONCAT, + NFA_OR, + NFA_STAR, /* greedy * */ + NFA_STAR_NONGREEDY, /* non-greedy * */ + NFA_QUEST, /* greedy \? */ + NFA_QUEST_NONGREEDY, /* non-greedy \? */ +- NFA_NOT, /* used for [^ab] negated char ranges */ + + NFA_BOL, /* ^ Begin line */ + NFA_EOL, /* $ End line */ +--- 34,56 ---- + NFA_SPLIT = -1024, + NFA_MATCH, + NFA_SKIP_CHAR, /* matches a 0-length char */ + +! NFA_START_COLL, /* [abc] start */ +! NFA_END_COLL, /* [abc] end */ +! NFA_START_NEG_COLL, /* [^abc] start */ +! NFA_END_NEG_COLL, /* [^abc] end (only used in postfix) */ +! NFA_RANGE, /* range of the two previous items (only +! * used in postfix) */ +! NFA_RANGE_MIN, /* low end of a range */ +! NFA_RANGE_MAX, /* high end of a range */ +! +! NFA_CONCAT, /* concatenate two previous items (only +! * used in postfix) */ + NFA_OR, + NFA_STAR, /* greedy * */ + NFA_STAR_NONGREEDY, /* non-greedy * */ + NFA_QUEST, /* greedy \? */ + NFA_QUEST_NONGREEDY, /* non-greedy \? */ + + NFA_BOL, /* ^ Begin line */ + NFA_EOL, /* $ End line */ +*************** +*** 260,266 **** + static int nfa_get_reganch __ARGS((nfa_state_T *start, int depth)); + static int nfa_get_regstart __ARGS((nfa_state_T *start, int depth)); + static int nfa_recognize_char_class __ARGS((char_u *start, char_u *end, int extra_newl)); +! static int nfa_emit_equi_class __ARGS((int c, int neg)); + static int nfa_regatom __ARGS((void)); + static int nfa_regpiece __ARGS((void)); + static int nfa_regconcat __ARGS((void)); +--- 268,274 ---- + static int nfa_get_reganch __ARGS((nfa_state_T *start, int depth)); + static int nfa_get_regstart __ARGS((nfa_state_T *start, int depth)); + static int nfa_recognize_char_class __ARGS((char_u *start, char_u *end, int extra_newl)); +! static int nfa_emit_equi_class __ARGS((int c)); + static int nfa_regatom __ARGS((void)); + static int nfa_regpiece __ARGS((void)); + static int nfa_regconcat __ARGS((void)); +*************** +*** 664,684 **** + * NOTE! When changing this function, also update reg_equi_class() + */ + static int +! nfa_emit_equi_class(c, neg) + int c; +- int neg; + { +! int first = TRUE; +! int glue = neg == TRUE ? NFA_CONCAT : NFA_OR; +! #define EMIT2(c) \ +! EMIT(c); \ +! if (neg == TRUE) { \ +! EMIT(NFA_NOT); \ +! } \ +! if (first == FALSE) \ +! EMIT(glue); \ +! else \ +! first = FALSE; \ + + #ifdef FEAT_MBYTE + if (enc_utf8 || STRCMP(p_enc, "latin1") == 0 +--- 672,681 ---- + * NOTE! When changing this function, also update reg_equi_class() + */ + static int +! nfa_emit_equi_class(c) + int c; + { +! #define EMIT2(c) EMIT(c); EMIT(NFA_CONCAT); + + #ifdef FEAT_MBYTE + if (enc_utf8 || STRCMP(p_enc, "latin1") == 0 +*************** +*** 687,770 **** + { + switch (c) + { +! case 'A': case '\300': case '\301': case '\302': +! case '\303': case '\304': case '\305': +! EMIT2('A'); EMIT2('\300'); EMIT2('\301'); +! EMIT2('\302'); EMIT2('\303'); EMIT2('\304'); +! EMIT2('\305'); + return OK; + +! case 'C': case '\307': +! EMIT2('C'); EMIT2('\307'); + return OK; + +! case 'E': case '\310': case '\311': case '\312': case '\313': +! EMIT2('E'); EMIT2('\310'); EMIT2('\311'); +! EMIT2('\312'); EMIT2('\313'); + return OK; + +! case 'I': case '\314': case '\315': case '\316': case '\317': +! EMIT2('I'); EMIT2('\314'); EMIT2('\315'); +! EMIT2('\316'); EMIT2('\317'); + return OK; + +! case 'N': case '\321': +! EMIT2('N'); EMIT2('\321'); + return OK; + +! case 'O': case '\322': case '\323': case '\324': case '\325': +! case '\326': +! EMIT2('O'); EMIT2('\322'); EMIT2('\323'); +! EMIT2('\324'); EMIT2('\325'); EMIT2('\326'); + return OK; + +! case 'U': case '\331': case '\332': case '\333': case '\334': +! EMIT2('U'); EMIT2('\331'); EMIT2('\332'); +! EMIT2('\333'); EMIT2('\334'); + return OK; + +! case 'Y': case '\335': +! EMIT2('Y'); EMIT2('\335'); + return OK; + +! case 'a': case '\340': case '\341': case '\342': +! case '\343': case '\344': case '\345': +! EMIT2('a'); EMIT2('\340'); EMIT2('\341'); +! EMIT2('\342'); EMIT2('\343'); EMIT2('\344'); +! EMIT2('\345'); + return OK; + +! case 'c': case '\347': +! EMIT2('c'); EMIT2('\347'); + return OK; + +! case 'e': case '\350': case '\351': case '\352': case '\353': +! EMIT2('e'); EMIT2('\350'); EMIT2('\351'); +! EMIT2('\352'); EMIT2('\353'); + return OK; + +! case 'i': case '\354': case '\355': case '\356': case '\357': +! EMIT2('i'); EMIT2('\354'); EMIT2('\355'); +! EMIT2('\356'); EMIT2('\357'); + return OK; + +! case 'n': case '\361': +! EMIT2('n'); EMIT2('\361'); + return OK; + +! case 'o': case '\362': case '\363': case '\364': case '\365': +! case '\366': +! EMIT2('o'); EMIT2('\362'); EMIT2('\363'); +! EMIT2('\364'); EMIT2('\365'); EMIT2('\366'); + return OK; + +! case 'u': case '\371': case '\372': case '\373': case '\374': +! EMIT2('u'); EMIT2('\371'); EMIT2('\372'); +! EMIT2('\373'); EMIT2('\374'); + return OK; + +! case 'y': case '\375': case '\377': +! EMIT2('y'); EMIT2('\375'); EMIT2('\377'); + return OK; + + default: +--- 684,767 ---- + { + switch (c) + { +! case 'A': case 0300: case 0301: case 0302: +! case 0303: case 0304: case 0305: +! EMIT2('A'); EMIT2(0300); EMIT2(0301); +! EMIT2(0302); EMIT2(0303); EMIT2(0304); +! EMIT2(0305); + return OK; + +! case 'C': case 0307: +! EMIT2('C'); EMIT2(0307); + return OK; + +! case 'E': case 0310: case 0311: case 0312: case 0313: +! EMIT2('E'); EMIT2(0310); EMIT2(0311); +! EMIT2(0312); EMIT2(0313); + return OK; + +! case 'I': case 0314: case 0315: case 0316: case 0317: +! EMIT2('I'); EMIT2(0314); EMIT2(0315); +! EMIT2(0316); EMIT2(0317); + return OK; + +! case 'N': case 0321: +! EMIT2('N'); EMIT2(0321); + return OK; + +! case 'O': case 0322: case 0323: case 0324: case 0325: +! case 0326: +! EMIT2('O'); EMIT2(0322); EMIT2(0323); +! EMIT2(0324); EMIT2(0325); EMIT2(0326); + return OK; + +! case 'U': case 0331: case 0332: case 0333: case 0334: +! EMIT2('U'); EMIT2(0331); EMIT2(0332); +! EMIT2(0333); EMIT2(0334); + return OK; + +! case 'Y': case 0335: +! EMIT2('Y'); EMIT2(0335); + return OK; + +! case 'a': case 0340: case 0341: case 0342: +! case 0343: case 0344: case 0345: +! EMIT2('a'); EMIT2(0340); EMIT2(0341); +! EMIT2(0342); EMIT2(0343); EMIT2(0344); +! EMIT2(0345); + return OK; + +! case 'c': case 0347: +! EMIT2('c'); EMIT2(0347); + return OK; + +! case 'e': case 0350: case 0351: case 0352: case 0353: +! EMIT2('e'); EMIT2(0350); EMIT2(0351); +! EMIT2(0352); EMIT2(0353); + return OK; + +! case 'i': case 0354: case 0355: case 0356: case 0357: +! EMIT2('i'); EMIT2(0354); EMIT2(0355); +! EMIT2(0356); EMIT2(0357); + return OK; + +! case 'n': case 0361: +! EMIT2('n'); EMIT2(0361); + return OK; + +! case 'o': case 0362: case 0363: case 0364: case 0365: +! case 0366: +! EMIT2('o'); EMIT2(0362); EMIT2(0363); +! EMIT2(0364); EMIT2(0365); EMIT2(0366); + return OK; + +! case 'u': case 0371: case 0372: case 0373: case 0374: +! EMIT2('u'); EMIT2(0371); EMIT2(0372); +! EMIT2(0373); EMIT2(0374); + return OK; + +! case 'y': case 0375: case 0377: +! EMIT2('y'); EMIT2(0375); EMIT2(0377); + return OK; + + default: +*************** +*** 811,824 **** + char_u *old_regparse = regparse; + #endif + int extra = 0; +- int first; + int emit_range; + int negated; + int result; + int startc = -1; + int endc = -1; + int oldstartc = -1; +- int glue; /* ID that will "glue" nodes together */ + + c = getchr(); + switch (c) +--- 808,819 ---- +*************** +*** 927,934 **** + + case Magic('n'): + if (reg_string) +! /* In a string "\n" matches a newline character. */ +! EMIT(NL); + else + { + /* In buffer text "\n" matches the end of a line. */ +--- 922,929 ---- + + case Magic('n'): + if (reg_string) +! /* In a string "\n" matches a newline character. */ +! EMIT(NL); + else + { + /* In buffer text "\n" matches the end of a line. */ +*************** +*** 1160,1191 **** + case Magic('['): + collection: + /* +! * Glue is emitted between several atoms from the []. +! * It is either NFA_OR, or NFA_CONCAT. +! * +! * [abc] expands to 'a b NFA_OR c NFA_OR' (in postfix notation) +! * [^abc] expands to 'a NFA_NOT b NFA_NOT NFA_CONCAT c NFA_NOT +! * NFA_CONCAT NFA_END_NEG_RANGE NFA_CONCAT' (in postfix +! * notation) +! * + */ + +- +- /* Emit negation atoms, if needed. +- * The CONCAT below merges the NOT with the previous node. */ +- #define TRY_NEG() \ +- if (negated == TRUE) \ +- { \ +- EMIT(NFA_NOT); \ +- } +- +- /* Emit glue between important nodes : CONCAT or OR. */ +- #define EMIT_GLUE() \ +- if (first == FALSE) \ +- EMIT(glue); \ +- else \ +- first = FALSE; +- + p = regparse; + endp = skip_anyof(p); + if (*endp == ']') +--- 1155,1169 ---- + case Magic('['): + collection: + /* +! * [abc] uses NFA_START_COLL - NFA_END_COLL +! * [^abc] uses NFA_START_NEG_COLL - NFA_END_NEG_COLL +! * Each character is produced as a regular state, using +! * NFA_CONCAT to bind them together. +! * Besides normal characters there can be: +! * - character classes NFA_CLASS_* +! * - ranges, two characters followed by NFA_RANGE. + */ + + p = regparse; + endp = skip_anyof(p); + if (*endp == ']') +*************** +*** 1216,1236 **** + * version that turns [abc] into 'a' OR 'b' OR 'c' + */ + startc = endc = oldstartc = -1; +- first = TRUE; /* Emitting first atom in this sequence? */ + negated = FALSE; +- glue = NFA_OR; + if (*regparse == '^') /* negated range */ + { + negated = TRUE; +- glue = NFA_CONCAT; + mb_ptr_adv(regparse); + } + if (*regparse == '-') + { + startc = '-'; + EMIT(startc); +! TRY_NEG(); +! EMIT_GLUE(); + mb_ptr_adv(regparse); + } + /* Emit the OR branches for each character in the [] */ +--- 1194,1213 ---- + * version that turns [abc] into 'a' OR 'b' OR 'c' + */ + startc = endc = oldstartc = -1; + negated = FALSE; + if (*regparse == '^') /* negated range */ + { + negated = TRUE; + mb_ptr_adv(regparse); ++ EMIT(NFA_START_NEG_COLL); + } ++ else ++ EMIT(NFA_START_COLL); + if (*regparse == '-') + { + startc = '-'; + EMIT(startc); +! EMIT(NFA_CONCAT); + mb_ptr_adv(regparse); + } + /* Emit the OR branches for each character in the [] */ +*************** +*** 1306,1325 **** + EMIT(NFA_CLASS_ESCAPE); + break; + } +! TRY_NEG(); +! EMIT_GLUE(); + continue; + } + /* Try equivalence class [=a=] and the like */ + if (equiclass != 0) + { +! result = nfa_emit_equi_class(equiclass, negated); + if (result == FAIL) + { + /* should never happen */ + EMSG_RET_FAIL(_("E868: Error building NFA with equivalence class!")); + } +- EMIT_GLUE(); + continue; + } + /* Try collating class like [. .] */ +--- 1283,1300 ---- + EMIT(NFA_CLASS_ESCAPE); + break; + } +! EMIT(NFA_CONCAT); + continue; + } + /* Try equivalence class [=a=] and the like */ + if (equiclass != 0) + { +! result = nfa_emit_equi_class(equiclass); + if (result == FAIL) + { + /* should never happen */ + EMSG_RET_FAIL(_("E868: Error building NFA with equivalence class!")); + } + continue; + } + /* Try collating class like [. .] */ +*************** +*** 1391,1409 **** + startc = oldstartc; + if (startc > endc) + EMSG_RET_FAIL(_(e_invrange)); + #ifdef FEAT_MBYTE +! if (has_mbyte && ((*mb_char2len)(startc) > 1 + || (*mb_char2len)(endc) > 1)) + { +! if (endc > startc + 256) +! EMSG_RET_FAIL(_(e_invrange)); +! /* Emit the range. "startc" was already emitted, so +! * skip it. */ + for (c = startc + 1; c <= endc; c++) + { + EMIT(c); +! TRY_NEG(); +! EMIT_GLUE(); + } + } + else +--- 1366,1397 ---- + startc = oldstartc; + if (startc > endc) + EMSG_RET_FAIL(_(e_invrange)); ++ ++ if (endc > startc + 2) ++ { ++ /* Emit a range instead of the sequence of ++ * individual characters. */ ++ if (startc == 0) ++ /* \x00 is translated to \x0a, start at \x01. */ ++ EMIT(1); ++ else ++ --post_ptr; /* remove NFA_CONCAT */ ++ EMIT(endc); ++ EMIT(NFA_RANGE); ++ EMIT(NFA_CONCAT); ++ } ++ else + #ifdef FEAT_MBYTE +! if (has_mbyte && ((*mb_char2len)(startc) > 1 + || (*mb_char2len)(endc) > 1)) + { +! /* Emit the characters in the range. +! * "startc" was already emitted, so skip it. +! * */ + for (c = startc + 1; c <= endc; c++) + { + EMIT(c); +! EMIT(NFA_CONCAT); + } + } + else +*************** +*** 1425,1432 **** + #endif + { + EMIT(c); +! TRY_NEG(); +! EMIT_GLUE(); + } + } + emit_range = FALSE; +--- 1413,1419 ---- + #endif + { + EMIT(c); +! EMIT(NFA_CONCAT); + } + } + emit_range = FALSE; +*************** +*** 1434,1456 **** + } + else + { +! /* +! * This char (startc) is not part of a range. Just + * emit it. +- * + * Normally, simply emit startc. But if we get char + * code=0 from a collating char, then replace it with + * 0x0a. +- * + * This is needed to completely mimic the behaviour of +! * the backtracking engine. +! */ +! if (got_coll_char == TRUE && startc == 0) +! EMIT(0x0a); + else +! EMIT(startc); +! TRY_NEG(); +! EMIT_GLUE(); + } + + mb_ptr_adv(regparse); +--- 1421,1449 ---- + } + else + { +! /* This char (startc) is not part of a range. Just + * emit it. + * Normally, simply emit startc. But if we get char + * code=0 from a collating char, then replace it with + * 0x0a. + * This is needed to completely mimic the behaviour of +! * the backtracking engine. */ +! if (startc == NFA_NEWL) +! { +! /* Line break can't be matched as part of the +! * collection, add an OR below. But not for negated +! * range. */ +! if (!negated) +! extra = ADD_NL; +! } + else +! { +! if (got_coll_char == TRUE && startc == 0) +! EMIT(0x0a); +! else +! EMIT(startc); +! EMIT(NFA_CONCAT); +! } + } + + mb_ptr_adv(regparse); +*************** +*** 1460,1479 **** + if (*regparse == '-') /* if last, '-' is just a char */ + { + EMIT('-'); +! TRY_NEG(); +! EMIT_GLUE(); + } + mb_ptr_adv(regparse); + + /* skip the trailing ] */ + regparse = endp; + mb_ptr_adv(regparse); + if (negated == TRUE) +! { +! /* Mark end of negated char range */ +! EMIT(NFA_END_NEG_RANGE); +! EMIT(NFA_CONCAT); +! } + + /* \_[] also matches \n but it's not negated */ + if (extra == ADD_NL) +--- 1453,1471 ---- + if (*regparse == '-') /* if last, '-' is just a char */ + { + EMIT('-'); +! EMIT(NFA_CONCAT); + } + mb_ptr_adv(regparse); + + /* skip the trailing ] */ + regparse = endp; + mb_ptr_adv(regparse); ++ ++ /* Mark end of the collection. */ + if (negated == TRUE) +! EMIT(NFA_END_NEG_COLL); +! else +! EMIT(NFA_END_COLL); + + /* \_[] also matches \n but it's not negated */ + if (extra == ADD_NL) +*************** +*** 1532,1540 **** + } + } + +- #undef TRY_NEG +- #undef EMIT_GLUE +- + return OK; + } + +--- 1524,1529 ---- +*************** +*** 2091,2100 **** + case NFA_STAR_NONGREEDY: STRCPY(code, "NFA_STAR_NONGREEDY "); break; + case NFA_QUEST: STRCPY(code, "NFA_QUEST"); break; + case NFA_QUEST_NONGREEDY: STRCPY(code, "NFA_QUEST_NON_GREEDY"); break; +- case NFA_NOT: STRCPY(code, "NFA_NOT "); break; + case NFA_SKIP_CHAR: STRCPY(code, "NFA_SKIP_CHAR"); break; + case NFA_OR: STRCPY(code, "NFA_OR"); break; +! case NFA_END_NEG_RANGE: STRCPY(code, "NFA_END_NEG_RANGE"); break; + case NFA_CLASS_ALNUM: STRCPY(code, "NFA_CLASS_ALNUM"); break; + case NFA_CLASS_ALPHA: STRCPY(code, "NFA_CLASS_ALPHA"); break; + case NFA_CLASS_BLANK: STRCPY(code, "NFA_CLASS_BLANK"); break; +--- 2080,2096 ---- + case NFA_STAR_NONGREEDY: STRCPY(code, "NFA_STAR_NONGREEDY "); break; + case NFA_QUEST: STRCPY(code, "NFA_QUEST"); break; + case NFA_QUEST_NONGREEDY: STRCPY(code, "NFA_QUEST_NON_GREEDY"); break; + case NFA_SKIP_CHAR: STRCPY(code, "NFA_SKIP_CHAR"); break; + case NFA_OR: STRCPY(code, "NFA_OR"); break; +! +! case NFA_START_COLL: STRCPY(code, "NFA_START_COLL"); break; +! case NFA_END_COLL: STRCPY(code, "NFA_END_COLL"); break; +! case NFA_START_NEG_COLL: STRCPY(code, "NFA_START_NEG_COLL"); break; +! case NFA_END_NEG_COLL: STRCPY(code, "NFA_END_NEG_COLL"); break; +! case NFA_RANGE: STRCPY(code, "NFA_RANGE"); break; +! case NFA_RANGE_MIN: STRCPY(code, "NFA_RANGE_MIN"); break; +! case NFA_RANGE_MAX: STRCPY(code, "NFA_RANGE_MAX"); break; +! + case NFA_CLASS_ALNUM: STRCPY(code, "NFA_CLASS_ALNUM"); break; + case NFA_CLASS_ALPHA: STRCPY(code, "NFA_CLASS_ALPHA"); break; + case NFA_CLASS_BLANK: STRCPY(code, "NFA_CLASS_BLANK"); break; +*************** +*** 2231,2238 **** + fprintf(debugf, " %s", p); + + nfa_set_code(state->c); +! fprintf(debugf, "%s%s (%d) (id=%d)\n", +! state->negated ? "NOT " : "", code, state->c, abs(state->id)); + if (state->id < 0) + return; + +--- 2227,2238 ---- + fprintf(debugf, " %s", p); + + nfa_set_code(state->c); +! fprintf(debugf, "%s%s (%d) (id=%d) val=%d\n", +! state->negated ? "NOT " : "", +! code, +! state->c, +! abs(state->id), +! state->val); + if (state->id < 0) + return; + +*************** +*** 2325,2330 **** +--- 2325,2331 ---- + s->c = c; + s->out = out; + s->out1 = out1; ++ s->val = 0; + + s->id = istate; + s->lastlist[0] = 0; +*************** +*** 2565,2577 **** + switch (*p) + { + case NFA_CONCAT: +! /* Catenation. +! * Pay attention: this operator does not exist +! * in the r.e. itself (it is implicit, really). +! * It is added when r.e. is translated to postfix +! * form in re2post(). +! * +! * No new state added here. */ + if (nfa_calc_size == TRUE) + { + /* nstate += 0; */ +--- 2566,2575 ---- + switch (*p) + { + case NFA_CONCAT: +! /* Concatenation. +! * Pay attention: this operator does not exist in the r.e. itself +! * (it is implicit, really). It is added when r.e. is translated +! * to postfix form in re2post(). */ + if (nfa_calc_size == TRUE) + { + /* nstate += 0; */ +*************** +*** 2583,2604 **** + PUSH(frag(e1.start, e2.out)); + break; + +- case NFA_NOT: +- /* Negation of a character */ +- if (nfa_calc_size == TRUE) +- { +- /* nstate += 0; */ +- break; +- } +- e1 = POP(); +- e1.start->negated = TRUE; +- #ifdef FEAT_MBYTE +- if (e1.start->c == NFA_COMPOSING) +- e1.start->out1->negated = TRUE; +- #endif +- PUSH(e1); +- break; +- + case NFA_OR: + /* Alternation */ + if (nfa_calc_size == TRUE) +--- 2581,2586 ---- +*************** +*** 2672,2677 **** +--- 2654,2696 ---- + PUSH(frag(s, append(e.out, list1(&s->out)))); + break; + ++ case NFA_END_COLL: ++ case NFA_END_NEG_COLL: ++ /* On the stack is the sequence starting with NFA_START_COLL or ++ * NFA_START_NEG_COLL and all possible characters. Patch it to ++ * add the output to the start. */ ++ if (nfa_calc_size == TRUE) ++ { ++ nstate++; ++ break; ++ } ++ e = POP(); ++ s = alloc_state(NFA_END_COLL, NULL, NULL); ++ if (s == NULL) ++ goto theend; ++ patch(e.out, s); ++ e.start->out1 = s; ++ PUSH(frag(e.start, list1(&s->out))); ++ break; ++ ++ case NFA_RANGE: ++ /* Before this are two characters, the low and high end of a ++ * range. Turn them into two states with MIN and MAX. */ ++ if (nfa_calc_size == TRUE) ++ { ++ /* nstate += 0; */ ++ break; ++ } ++ e2 = POP(); ++ e1 = POP(); ++ e2.start->val = e2.start->c; ++ e2.start->c = NFA_RANGE_MAX; ++ e1.start->val = e1.start->c; ++ e1.start->c = NFA_RANGE_MIN; ++ patch(e1.out, e2.start); ++ PUSH(frag(e1.start, e2.out)); ++ break; ++ + case NFA_SKIP_CHAR: + /* Symbol of 0-length, Used in a repetition + * with max/min count of 0 */ +*************** +*** 2990,2995 **** +--- 3009,3016 ---- + matchstate = &state_ptr[istate++]; /* the match state */ + matchstate->c = NFA_MATCH; + matchstate->out = matchstate->out1 = NULL; ++ matchstate->negated = FALSE; ++ matchstate->id = 0; + + patch(e.out, matchstate); + ret = e.start; +*************** +*** 3308,3314 **** + switch (state->c) + { + case NFA_SPLIT: +- case NFA_NOT: + case NFA_NOPEN: + case NFA_SKIP_CHAR: + case NFA_NCLOSE: +--- 3329,3334 ---- +*************** +*** 3782,3788 **** + + default: + /* should not be here :P */ +! EMSG_RET_FAIL(_("E877: (NFA regexp) Invalid character class ")); + } + return FAIL; + } +--- 3802,3809 ---- + + default: + /* should not be here :P */ +! EMSGN("E877: (NFA regexp) Invalid character class: %ld", class); +! return FAIL; + } + return FAIL; + } +*************** +*** 4320,4327 **** + addstate(thislist, start, m, 0); + + /* There are two cases when the NFA advances: 1. input char matches the +! * NFA node and 2. input char does not match the NFA node, but the next +! * node is NFA_NOT. The following macro calls addstate() according to + * these rules. It is used A LOT, so use the "listtbl" table for speed */ + listtbl[0][0] = NULL; + listtbl[0][1] = neglist; +--- 4341,4348 ---- + addstate(thislist, start, m, 0); + + /* There are two cases when the NFA advances: 1. input char matches the +! * NFA node and 2. input char does not match the NFA node and the state +! * has the negated flag. The following macro calls addstate() according to + * these rules. It is used A LOT, so use the "listtbl" table for speed */ + listtbl[0][0] = NULL; + listtbl[0][1] = neglist; +*************** +*** 4845,4860 **** + ADD_POS_NEG_STATE(t->state); + break; + +! case NFA_END_NEG_RANGE: +! /* This follows a series of negated nodes, like: +! * NOT CHAR(x), NOT CHAR(y), etc. */ +! if (curc > 0) + { + ll = nextlist; +! add_state = t->state->out; + add_off = clen; + } + break; + + case NFA_ANY: + /* Any char except '\0', (end of input) does not match. */ +--- 4866,4944 ---- + ADD_POS_NEG_STATE(t->state); + break; + +! case NFA_START_COLL: +! case NFA_START_NEG_COLL: +! { +! /* What follows is a list of characters, until NFA_END_COLL. +! * One of them must match or none of them must match. */ +! nfa_state_T *state; +! int result_if_matched; +! int c1, c2; +! +! /* Never match EOL. If it's part of the collection it is added +! * as a separate state with an OR. */ +! if (curc == NUL) +! break; +! +! state = t->state->out; +! result_if_matched = (t->state->c == NFA_START_COLL); +! for (;;) + { ++ if (state->c == NFA_END_COLL) ++ { ++ result = !result_if_matched; ++ break; ++ } ++ if (state->c == NFA_RANGE_MIN) ++ { ++ c1 = state->val; ++ state = state->out; /* advance to NFA_RANGE_MAX */ ++ c2 = state->val; ++ #ifdef ENABLE_LOG ++ fprintf(log_fd, "NFA_RANGE_MIN curc=%d c1=%d c2=%d\n", ++ curc, c1, c2); ++ #endif ++ if (curc >= c1 && curc <= c2) ++ { ++ result = result_if_matched; ++ break; ++ } ++ if (ireg_ic) ++ { ++ int curc_low = MB_TOLOWER(curc); ++ int done = FALSE; ++ ++ for ( ; c1 <= c2; ++c1) ++ if (MB_TOLOWER(c1) == curc_low) ++ { ++ result = result_if_matched; ++ done = TRUE; ++ break; ++ } ++ if (done) ++ break; ++ } ++ } ++ else if (state->c < 0 ? check_char_class(state->c, curc) ++ : (curc == state->c ++ || (ireg_ic && MB_TOLOWER(curc) ++ == MB_TOLOWER(state->c)))) ++ { ++ result = result_if_matched; ++ break; ++ } ++ state = state->out; ++ } ++ if (result) ++ { ++ /* next state is in out of the NFA_END_COLL, out1 of ++ * START points to the END state */ + ll = nextlist; +! add_state = t->state->out1->out; + add_off = clen; + } + break; ++ } + + case NFA_ANY: + /* Any char except '\0', (end of input) does not match. */ +*** ../vim-7.3.1136/src/version.c 2013-06-06 21:31:02.000000000 +0200 +--- src/version.c 2013-06-07 13:21:57.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1137, + /**/ + +-- +From "know your smileys": + :.-( Crying + + /// 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 /// diff --git a/7.3.1138 b/7.3.1138 new file mode 100644 index 0000000..25d2d0d --- /dev/null +++ b/7.3.1138 @@ -0,0 +1,651 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1138 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1138 +Problem: New regexp engine: neglist no longer used. +Solution: Remove the now unused neglist. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1137/src/regexp_nfa.c 2013-06-07 14:08:24.000000000 +0200 +--- src/regexp_nfa.c 2013-06-07 14:43:12.000000000 +0200 +*************** +*** 4276,4288 **** + int flag = 0; + int go_to_nextline = FALSE; + nfa_thread_T *t; +! nfa_list_T list[3]; +! nfa_list_T *listtbl[2][2]; +! nfa_list_T *ll; + int listidx; + nfa_list_T *thislist; + nfa_list_T *nextlist; +- nfa_list_T *neglist; + int *listids = NULL; + nfa_state_T *add_state; + int add_count; +--- 4276,4285 ---- + int flag = 0; + int go_to_nextline = FALSE; + nfa_thread_T *t; +! nfa_list_T list[2]; + int listidx; + nfa_list_T *thislist; + nfa_list_T *nextlist; + int *listids = NULL; + nfa_state_T *add_state; + int add_count; +*************** +*** 4306,4314 **** + list[0].len = nstate + 1; + list[1].t = (nfa_thread_T *)lalloc(size, TRUE); + list[1].len = nstate + 1; +! list[2].t = (nfa_thread_T *)lalloc(size, TRUE); +! list[2].len = nstate + 1; +! if (list[0].t == NULL || list[1].t == NULL || list[2].t == NULL) + goto theend; + + #ifdef ENABLE_LOG +--- 4303,4309 ---- + list[0].len = nstate + 1; + list[1].t = (nfa_thread_T *)lalloc(size, TRUE); + list[1].len = nstate + 1; +! if (list[0].t == NULL || list[1].t == NULL) + goto theend; + + #ifdef ENABLE_LOG +*************** +*** 4332,4356 **** + thislist->n = 0; + nextlist = &list[1]; + nextlist->n = 0; +- neglist = &list[2]; +- neglist->n = 0; + #ifdef ENABLE_LOG + fprintf(log_fd, "(---) STARTSTATE\n"); + #endif + thislist->id = nfa_listid + 1; + addstate(thislist, start, m, 0); + +! /* There are two cases when the NFA advances: 1. input char matches the +! * NFA node and 2. input char does not match the NFA node and the state +! * has the negated flag. The following macro calls addstate() according to +! * these rules. It is used A LOT, so use the "listtbl" table for speed */ +! listtbl[0][0] = NULL; +! listtbl[0][1] = neglist; +! listtbl[1][0] = nextlist; +! listtbl[1][1] = NULL; +! #define ADD_POS_NEG_STATE(state) \ +! ll = listtbl[result ? 1 : 0][state->negated]; \ +! if (ll != NULL) { \ + add_state = state->out; \ + add_off = clen; \ + } +--- 4327,4340 ---- + thislist->n = 0; + nextlist = &list[1]; + nextlist->n = 0; + #ifdef ENABLE_LOG + fprintf(log_fd, "(---) STARTSTATE\n"); + #endif + thislist->id = nfa_listid + 1; + addstate(thislist, start, m, 0); + +! #define ADD_STATE_IF_MATCH(state) \ +! if (result) { \ + add_state = state->out; \ + add_off = clen; \ + } +*************** +*** 4385,4395 **** + thislist = &list[flag]; + nextlist = &list[flag ^= 1]; + nextlist->n = 0; /* clear nextlist */ +- listtbl[1][0] = nextlist; + ++nfa_listid; + thislist->id = nfa_listid; + nextlist->id = nfa_listid + 1; +- neglist->id = nfa_listid + 1; + + pimlist.ga_len = 0; + +--- 4369,4377 ---- +*************** +*** 4413,4436 **** + /* + * If the state lists are empty we can stop. + */ +! if (thislist->n == 0 && neglist->n == 0) + break; + + /* compute nextlist */ +! for (listidx = 0; listidx < thislist->n || neglist->n > 0; ++listidx) + { +! if (neglist->n > 0) +! { +! t = &neglist->t[0]; +! neglist->n--; +! listidx--; +! #ifdef ENABLE_LOG +! fprintf(log_fd, " using neglist entry, %d remaining\n", +! neglist->n); +! #endif +! } +! else +! t = &thislist->t[listidx]; + + #ifdef NFA_REGEXP_DEBUG_LOG + nfa_set_code(t->state->c); +--- 4395,4407 ---- + /* + * If the state lists are empty we can stop. + */ +! if (thislist->n == 0) + break; + + /* compute nextlist */ +! for (listidx = 0; listidx < thislist->n; ++listidx) + { +! t = &thislist->t[listidx]; + + #ifdef NFA_REGEXP_DEBUG_LOG + nfa_set_code(t->state->c); +*************** +*** 4475,4481 **** + * states at this position. When the list of states is going + * to be empty quit without advancing, so that "reginput" is + * correct. */ +! if (nextlist->n == 0 && neglist->n == 0) + clen = 0; + goto nextchar; + } +--- 4446,4452 ---- + * states at this position. When the list of states is going + * to be empty quit without advancing, so that "reginput" is + * correct. */ +! if (nextlist->n == 0) + clen = 0; + goto nextchar; + } +*************** +*** 4648,4654 **** + { + /* match current character, output of corresponding + * NFA_END_PATTERN to be used at next position. */ +- ll = nextlist; + add_state = t->state->out1->out->out; + add_off = clen; + } +--- 4619,4624 ---- +*************** +*** 4656,4662 **** + { + /* skip over the matched characters, set character + * count in NFA_SKIP */ +- ll = nextlist; + add_state = t->state->out1->out; + add_off = bytelen; + add_count = bytelen - clen; +--- 4626,4631 ---- +*************** +*** 4821,4827 **** + result = FAIL; + + end = t->state->out1; /* NFA_END_COMPOSING */ +! ADD_POS_NEG_STATE(end); + break; + } + #endif +--- 4790,4796 ---- + result = FAIL; + + end = t->state->out1; /* NFA_END_COMPOSING */ +! ADD_STATE_IF_MATCH(end); + break; + } + #endif +*************** +*** 4833,4846 **** + go_to_nextline = TRUE; + /* Pass -1 for the offset, which means taking the position + * at the start of the next line. */ +- ll = nextlist; + add_state = t->state->out; + add_off = -1; + } + else if (curc == '\n' && reg_line_lbr) + { + /* match \n as if it is an ordinary character */ +- ll = nextlist; + add_state = t->state->out; + add_off = 1; + } +--- 4802,4813 ---- +*************** +*** 4863,4869 **** + case NFA_CLASS_BACKSPACE: + case NFA_CLASS_ESCAPE: + result = check_char_class(t->state->c, curc); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_START_COLL: +--- 4830,4836 ---- + case NFA_CLASS_BACKSPACE: + case NFA_CLASS_ESCAPE: + result = check_char_class(t->state->c, curc); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_START_COLL: +*************** +*** 4933,4939 **** + { + /* next state is in out of the NFA_END_COLL, out1 of + * START points to the END state */ +- ll = nextlist; + add_state = t->state->out1->out; + add_off = clen; + } +--- 4900,4905 ---- +*************** +*** 4944,4950 **** + /* Any char except '\0', (end of input) does not match. */ + if (curc > 0) + { +- ll = nextlist; + add_state = t->state->out; + add_off = clen; + } +--- 4910,4915 ---- +*************** +*** 4955,5087 **** + */ + case NFA_IDENT: /* \i */ + result = vim_isIDc(curc); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_SIDENT: /* \I */ + result = !VIM_ISDIGIT(curc) && vim_isIDc(curc); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_KWORD: /* \k */ + result = vim_iswordp_buf(reginput, reg_buf); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_SKWORD: /* \K */ + result = !VIM_ISDIGIT(curc) + && vim_iswordp_buf(reginput, reg_buf); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_FNAME: /* \f */ + result = vim_isfilec(curc); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_SFNAME: /* \F */ + result = !VIM_ISDIGIT(curc) && vim_isfilec(curc); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_PRINT: /* \p */ + result = ptr2cells(reginput) == 1; +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_SPRINT: /* \P */ + result = !VIM_ISDIGIT(curc) && ptr2cells(reginput) == 1; +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_WHITE: /* \s */ + result = vim_iswhite(curc); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NWHITE: /* \S */ + result = curc != NUL && !vim_iswhite(curc); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_DIGIT: /* \d */ + result = ri_digit(curc); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NDIGIT: /* \D */ + result = curc != NUL && !ri_digit(curc); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_HEX: /* \x */ + result = ri_hex(curc); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NHEX: /* \X */ + result = curc != NUL && !ri_hex(curc); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_OCTAL: /* \o */ + result = ri_octal(curc); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NOCTAL: /* \O */ + result = curc != NUL && !ri_octal(curc); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_WORD: /* \w */ + result = ri_word(curc); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NWORD: /* \W */ + result = curc != NUL && !ri_word(curc); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_HEAD: /* \h */ + result = ri_head(curc); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NHEAD: /* \H */ + result = curc != NUL && !ri_head(curc); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_ALPHA: /* \a */ + result = ri_alpha(curc); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NALPHA: /* \A */ + result = curc != NUL && !ri_alpha(curc); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_LOWER: /* \l */ + result = ri_lower(curc); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NLOWER: /* \L */ + result = curc != NUL && !ri_lower(curc); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_UPPER: /* \u */ + result = ri_upper(curc); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_NUPPER: /* \U */ + result = curc != NUL && !ri_upper(curc); +! ADD_POS_NEG_STATE(t->state); + break; + + case NFA_BACKREF1: +--- 4920,5052 ---- + */ + case NFA_IDENT: /* \i */ + result = vim_isIDc(curc); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_SIDENT: /* \I */ + result = !VIM_ISDIGIT(curc) && vim_isIDc(curc); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_KWORD: /* \k */ + result = vim_iswordp_buf(reginput, reg_buf); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_SKWORD: /* \K */ + result = !VIM_ISDIGIT(curc) + && vim_iswordp_buf(reginput, reg_buf); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_FNAME: /* \f */ + result = vim_isfilec(curc); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_SFNAME: /* \F */ + result = !VIM_ISDIGIT(curc) && vim_isfilec(curc); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_PRINT: /* \p */ + result = ptr2cells(reginput) == 1; +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_SPRINT: /* \P */ + result = !VIM_ISDIGIT(curc) && ptr2cells(reginput) == 1; +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_WHITE: /* \s */ + result = vim_iswhite(curc); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_NWHITE: /* \S */ + result = curc != NUL && !vim_iswhite(curc); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_DIGIT: /* \d */ + result = ri_digit(curc); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_NDIGIT: /* \D */ + result = curc != NUL && !ri_digit(curc); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_HEX: /* \x */ + result = ri_hex(curc); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_NHEX: /* \X */ + result = curc != NUL && !ri_hex(curc); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_OCTAL: /* \o */ + result = ri_octal(curc); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_NOCTAL: /* \O */ + result = curc != NUL && !ri_octal(curc); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_WORD: /* \w */ + result = ri_word(curc); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_NWORD: /* \W */ + result = curc != NUL && !ri_word(curc); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_HEAD: /* \h */ + result = ri_head(curc); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_NHEAD: /* \H */ + result = curc != NUL && !ri_head(curc); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_ALPHA: /* \a */ + result = ri_alpha(curc); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_NALPHA: /* \A */ + result = curc != NUL && !ri_alpha(curc); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_LOWER: /* \l */ + result = ri_lower(curc); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_NLOWER: /* \L */ + result = curc != NUL && !ri_lower(curc); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_UPPER: /* \u */ + result = ri_upper(curc); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_NUPPER: /* \U */ + result = curc != NUL && !ri_upper(curc); +! ADD_STATE_IF_MATCH(t->state); + break; + + case NFA_BACKREF1: +*************** +*** 5135,5141 **** + { + /* match current character, jump ahead to out of + * NFA_SKIP */ +- ll = nextlist; + add_state = t->state->out->out; + add_off = clen; + } +--- 5100,5105 ---- +*************** +*** 5143,5149 **** + { + /* skip over the matched characters, set character + * count in NFA_SKIP */ +- ll = nextlist; + add_state = t->state->out; + add_off = bytelen; + add_count = bytelen - clen; +--- 5107,5112 ---- +*************** +*** 5156,5169 **** + if (t->count - clen <= 0) + { + /* end of match, go to what follows */ +- ll = nextlist; + add_state = t->state->out; + add_off = clen; + } + else + { + /* add state again with decremented count */ +- ll = nextlist; + add_state = t->state; + add_off = 0; + add_count = t->count - clen; +--- 5119,5130 ---- +*************** +*** 5267,5273 **** + && clen != utf_char2len(curc)) + result = FALSE; + #endif +! ADD_POS_NEG_STATE(t->state); + break; + } + +--- 5228,5234 ---- + && clen != utf_char2len(curc)) + result = FALSE; + #endif +! ADD_STATE_IF_MATCH(t->state); + break; + } + +*************** +*** 5328,5336 **** + continue; + } + +! addstate(ll, add_state, &t->subs, add_off); + if (add_count > 0) +! nextlist->t[ll->n - 1].count = add_count; + } + + } /* for (thislist = thislist; thislist->state; thislist++) */ +--- 5289,5297 ---- + continue; + } + +! addstate(nextlist, add_state, &t->subs, add_off); + if (add_count > 0) +! nextlist->t[nextlist->n - 1].count = add_count; + } + + } /* for (thislist = thislist; thislist->state; thislist++) */ +*************** +*** 5396,5405 **** + /* Free memory */ + vim_free(list[0].t); + vim_free(list[1].t); +- vim_free(list[2].t); + vim_free(listids); + ga_clear(&pimlist); +! #undef ADD_POS_NEG_STATE + #ifdef NFA_REGEXP_DEBUG_LOG + fclose(debug); + #endif +--- 5357,5365 ---- + /* Free memory */ + vim_free(list[0].t); + vim_free(list[1].t); + vim_free(listids); + ga_clear(&pimlist); +! #undef ADD_STATE_IF_MATCH + #ifdef NFA_REGEXP_DEBUG_LOG + fclose(debug); + #endif +*** ../vim-7.3.1137/src/version.c 2013-06-07 14:08:24.000000000 +0200 +--- src/version.c 2013-06-07 14:57:46.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1138, + /**/ + +-- +From "know your smileys": + <|-) Chinese + <|-( Chinese and doesn't like these kind of jokes + + /// 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 /// diff --git a/7.3.1139 b/7.3.1139 new file mode 100644 index 0000000..4dbeaa9 --- /dev/null +++ b/7.3.1139 @@ -0,0 +1,537 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1139 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1139 +Problem: New regexp engine: negated flag is hardly used. +Solution: Add separate _NEG states, remove negated flag. +Files: src/regexp_nfa.c, src/regexp.h + + +*** ../vim-7.3.1138/src/regexp_nfa.c 2013-06-07 14:59:14.000000000 +0200 +--- src/regexp_nfa.c 2013-06-07 16:31:29.000000000 +0200 +*************** +*** 64,72 **** +--- 64,75 ---- + NFA_NOPEN, /* Start of subexpression marked with \%( */ + NFA_NCLOSE, /* End of subexpr. marked with \%( ... \) */ + NFA_START_INVISIBLE, ++ NFA_START_INVISIBLE_NEG, + NFA_START_INVISIBLE_BEFORE, ++ NFA_START_INVISIBLE_BEFORE_NEG, + NFA_START_PATTERN, + NFA_END_INVISIBLE, ++ NFA_END_INVISIBLE_NEG, + NFA_END_PATTERN, + NFA_COMPOSING, /* Next nodes in NFA are part of the + composing multibyte char */ +*************** +*** 481,487 **** + } + + default: +! if (p->c > 0 && !p->negated) + return p->c; /* yes! */ + return 0; + } +--- 484,490 ---- + } + + default: +! if (p->c > 0) + return p->c; /* yes! */ + return 0; + } +*************** +*** 1991,2000 **** +--- 1994,2008 ---- + case NFA_NOPEN: STRCPY(code, "NFA_NOPEN"); break; + case NFA_NCLOSE: STRCPY(code, "NFA_NCLOSE"); break; + case NFA_START_INVISIBLE: STRCPY(code, "NFA_START_INVISIBLE"); break; ++ case NFA_START_INVISIBLE_NEG: ++ STRCPY(code, "NFA_START_INVISIBLE_NEG"); break; + case NFA_START_INVISIBLE_BEFORE: + STRCPY(code, "NFA_START_INVISIBLE_BEFORE"); break; ++ case NFA_START_INVISIBLE_BEFORE_NEG: ++ STRCPY(code, "NFA_START_INVISIBLE_BEFORE_NEG"); break; + case NFA_START_PATTERN: STRCPY(code, "NFA_START_PATTERN"); break; + case NFA_END_INVISIBLE: STRCPY(code, "NFA_END_INVISIBLE"); break; ++ case NFA_END_INVISIBLE_NEG: STRCPY(code, "NFA_END_INVISIBLE_NEG"); break; + case NFA_END_PATTERN: STRCPY(code, "NFA_END_PATTERN"); break; + + case NFA_COMPOSING: STRCPY(code, "NFA_COMPOSING"); break; +*************** +*** 2227,2234 **** + fprintf(debugf, " %s", p); + + nfa_set_code(state->c); +! fprintf(debugf, "%s%s (%d) (id=%d) val=%d\n", +! state->negated ? "NOT " : "", + code, + state->c, + abs(state->id), +--- 2235,2241 ---- + fprintf(debugf, " %s", p); + + nfa_set_code(state->c); +! fprintf(debugf, "%s (%d) (id=%d) val=%d\n", + code, + state->c, + abs(state->id), +*************** +*** 2330,2336 **** + s->id = istate; + s->lastlist[0] = 0; + s->lastlist[1] = 0; +- s->negated = FALSE; + + return s; + } +--- 2337,2342 ---- +*************** +*** 2741,2763 **** + case NFA_PREV_ATOM_JUST_BEFORE_NEG: + case NFA_PREV_ATOM_LIKE_PATTERN: + { +- int neg = (*p == NFA_PREV_ATOM_NO_WIDTH_NEG +- || *p == NFA_PREV_ATOM_JUST_BEFORE_NEG); + int before = (*p == NFA_PREV_ATOM_JUST_BEFORE + || *p == NFA_PREV_ATOM_JUST_BEFORE_NEG); + int pattern = (*p == NFA_PREV_ATOM_LIKE_PATTERN); +! int start_state = NFA_START_INVISIBLE; +! int end_state = NFA_END_INVISIBLE; + int n = 0; + nfa_state_T *zend; + nfa_state_T *skip; + +! if (before) +! start_state = NFA_START_INVISIBLE_BEFORE; +! else if (pattern) + { +! start_state = NFA_START_PATTERN; +! end_state = NFA_END_PATTERN; + } + + if (before) +--- 2747,2783 ---- + case NFA_PREV_ATOM_JUST_BEFORE_NEG: + case NFA_PREV_ATOM_LIKE_PATTERN: + { + int before = (*p == NFA_PREV_ATOM_JUST_BEFORE + || *p == NFA_PREV_ATOM_JUST_BEFORE_NEG); + int pattern = (*p == NFA_PREV_ATOM_LIKE_PATTERN); +! int start_state; +! int end_state; + int n = 0; + nfa_state_T *zend; + nfa_state_T *skip; + +! switch (*p) + { +! case NFA_PREV_ATOM_NO_WIDTH: +! start_state = NFA_START_INVISIBLE; +! end_state = NFA_END_INVISIBLE; +! break; +! case NFA_PREV_ATOM_NO_WIDTH_NEG: +! start_state = NFA_START_INVISIBLE_NEG; +! end_state = NFA_END_INVISIBLE_NEG; +! break; +! case NFA_PREV_ATOM_JUST_BEFORE: +! start_state = NFA_START_INVISIBLE_BEFORE; +! end_state = NFA_END_INVISIBLE; +! break; +! case NFA_PREV_ATOM_JUST_BEFORE_NEG: +! start_state = NFA_START_INVISIBLE_BEFORE_NEG; +! end_state = NFA_END_INVISIBLE_NEG; +! break; +! case NFA_PREV_ATOM_LIKE_PATTERN: +! start_state = NFA_START_PATTERN; +! end_state = NFA_END_PATTERN; +! break; + } + + if (before) +*************** +*** 2783,2793 **** + s = alloc_state(start_state, e.start, s1); + if (s == NULL) + goto theend; +- if (neg) +- { +- s->negated = TRUE; +- s1->negated = TRUE; +- } + if (before) + s->val = n; /* store the count */ + if (pattern) +--- 2803,2808 ---- +*************** +*** 3009,3015 **** + matchstate = &state_ptr[istate++]; /* the match state */ + matchstate->c = NFA_MATCH; + matchstate->out = matchstate->out1 = NULL; +- matchstate->negated = FALSE; + matchstate->id = 0; + + patch(e.out, matchstate); +--- 3024,3029 ---- +*************** +*** 3772,3778 **** + return OK; + break; + case NFA_CLASS_SPACE: +! if ((c >=9 && c <= 13) || (c == ' ')) + return OK; + break; + case NFA_CLASS_UPPER: +--- 3786,3792 ---- + return OK; + break; + case NFA_CLASS_SPACE: +! if ((c >= 9 && c <= 13) || (c == ' ')) + return OK; + break; + case NFA_CLASS_UPPER: +*************** +*** 3971,3977 **** + int result; + int need_restore = FALSE; + +! if (state->c == NFA_START_INVISIBLE_BEFORE) + { + /* The recursive match must end at the current position. */ + endposp = &endpos; +--- 3985,3992 ---- + int result; + int need_restore = FALSE; + +! if (state->c == NFA_START_INVISIBLE_BEFORE +! || state->c == NFA_START_INVISIBLE_BEFORE_NEG) + { + /* The recursive match must end at the current position. */ + endposp = &endpos; +*************** +*** 4452,4457 **** +--- 4467,4473 ---- + } + + case NFA_END_INVISIBLE: ++ case NFA_END_INVISIBLE_NEG: + case NFA_END_PATTERN: + /* + * This is only encountered after a NFA_START_INVISIBLE or +*************** +*** 4489,4495 **** + break; + + /* do not set submatches for \@! */ +! if (!t->state->negated) + { + copy_sub(&m->norm, &t->subs.norm); + #ifdef FEAT_SYN_HL +--- 4505,4511 ---- + break; + + /* do not set submatches for \@! */ +! if (t->state->c != NFA_END_INVISIBLE_NEG) + { + copy_sub(&m->norm, &t->subs.norm); + #ifdef FEAT_SYN_HL +*************** +*** 4505,4511 **** +--- 4521,4529 ---- + break; + + case NFA_START_INVISIBLE: ++ case NFA_START_INVISIBLE_NEG: + case NFA_START_INVISIBLE_BEFORE: ++ case NFA_START_INVISIBLE_BEFORE_NEG: + { + nfa_pim_T *pim; + int cout = t->state->out1->out->c; +*************** +*** 4524,4529 **** +--- 4542,4548 ---- + || cout == NFA_NCLOSE + || t->pim != NULL + || (t->state->c != NFA_START_INVISIBLE_BEFORE ++ && t->state->c != NFA_START_INVISIBLE_BEFORE_NEG + && failure_chance(t->state->out1->out, 0) + < failure_chance(t->state->out, 0))) + { +*************** +*** 4534,4541 **** + result = recursive_regmatch(t->state, prog, + submatch, m, &listids); + +! /* for \@! it is a match when result is FALSE */ +! if (result != t->state->negated) + { + /* Copy submatch info from the recursive call */ + copy_sub_off(&t->subs.norm, &m->norm); +--- 4553,4563 ---- + result = recursive_regmatch(t->state, prog, + submatch, m, &listids); + +! /* for \@! and \@state->c == NFA_START_INVISIBLE_NEG +! || t->state->c +! == NFA_START_INVISIBLE_BEFORE_NEG)) + { + /* Copy submatch info from the recursive call */ + copy_sub_off(&t->subs.norm, &m->norm); +*************** +*** 4646,4656 **** + break; + + case NFA_BOW: +! { +! int bow = TRUE; + + if (curc == NUL) +! bow = FALSE; + #ifdef FEAT_MBYTE + else if (has_mbyte) + { +--- 4668,4677 ---- + break; + + case NFA_BOW: +! result = TRUE; + + if (curc == NUL) +! result = FALSE; + #ifdef FEAT_MBYTE + else if (has_mbyte) + { +*************** +*** 4659,4685 **** + /* Get class of current and previous char (if it exists). */ + this_class = mb_get_class_buf(reginput, reg_buf); + if (this_class <= 1) +! bow = FALSE; + else if (reg_prev_class() == this_class) +! bow = FALSE; + } + #endif + else if (!vim_iswordc_buf(curc, reg_buf) + || (reginput > regline + && vim_iswordc_buf(reginput[-1], reg_buf))) +! bow = FALSE; +! if (bow) + addstate_here(thislist, t->state->out, &t->subs, + t->pim, &listidx); + break; +- } + + case NFA_EOW: +! { +! int eow = TRUE; +! + if (reginput == regline) +! eow = FALSE; + #ifdef FEAT_MBYTE + else if (has_mbyte) + { +--- 4680,4703 ---- + /* Get class of current and previous char (if it exists). */ + this_class = mb_get_class_buf(reginput, reg_buf); + if (this_class <= 1) +! result = FALSE; + else if (reg_prev_class() == this_class) +! result = FALSE; + } + #endif + else if (!vim_iswordc_buf(curc, reg_buf) + || (reginput > regline + && vim_iswordc_buf(reginput[-1], reg_buf))) +! result = FALSE; +! if (result) + addstate_here(thislist, t->state->out, &t->subs, + t->pim, &listidx); + break; + + case NFA_EOW: +! result = TRUE; + if (reginput == regline) +! result = FALSE; + #ifdef FEAT_MBYTE + else if (has_mbyte) + { +*************** +*** 4690,4707 **** + prev_class = reg_prev_class(); + if (this_class == prev_class + || prev_class == 0 || prev_class == 1) +! eow = FALSE; + } + #endif + else if (!vim_iswordc_buf(reginput[-1], reg_buf) + || (reginput[0] != NUL + && vim_iswordc_buf(curc, reg_buf))) +! eow = FALSE; +! if (eow) + addstate_here(thislist, t->state->out, &t->subs, + t->pim, &listidx); + break; +- } + + case NFA_BOF: + if (reglnum == 0 && reginput == regline +--- 4708,4724 ---- + prev_class = reg_prev_class(); + if (this_class == prev_class + || prev_class == 0 || prev_class == 1) +! result = FALSE; + } + #endif + else if (!vim_iswordc_buf(reginput[-1], reg_buf) + || (reginput[0] != NUL + && vim_iswordc_buf(curc, reg_buf))) +! result = FALSE; +! if (result) + addstate_here(thislist, t->state->out, &t->subs, + t->pim, &listidx); + break; + + case NFA_BOF: + if (reglnum == 0 && reginput == regline +*************** +*** 4740,4746 **** + { + /* If \Z was present, then ignore composing characters. + * When ignoring the base character this always matches. */ +- /* TODO: How about negated? */ + if (len == 0 && sta->c != curc) + result = FAIL; + else +--- 4757,4762 ---- +*************** +*** 4813,4838 **** + } + break; + +- case NFA_CLASS_ALNUM: +- case NFA_CLASS_ALPHA: +- case NFA_CLASS_BLANK: +- case NFA_CLASS_CNTRL: +- case NFA_CLASS_DIGIT: +- case NFA_CLASS_GRAPH: +- case NFA_CLASS_LOWER: +- case NFA_CLASS_PRINT: +- case NFA_CLASS_PUNCT: +- case NFA_CLASS_SPACE: +- case NFA_CLASS_UPPER: +- case NFA_CLASS_XDIGIT: +- case NFA_CLASS_TAB: +- case NFA_CLASS_RETURN: +- case NFA_CLASS_BACKSPACE: +- case NFA_CLASS_ESCAPE: +- result = check_char_class(t->state->c, curc); +- ADD_STATE_IF_MATCH(t->state); +- break; +- + case NFA_START_COLL: + case NFA_START_NEG_COLL: + { +--- 4829,4834 ---- +*************** +*** 5212,5221 **** + int c = t->state->c; + + /* TODO: put this in #ifdef later */ +! if (c < -256) + EMSGN("INTERNAL: Negative state char: %ld", c); +- if (is_Magic(c)) +- c = un_Magic(c); + result = (c == curc); + + if (!result && ireg_ic) +--- 5208,5215 ---- + int c = t->state->c; + + /* TODO: put this in #ifdef later */ +! if (c < 0) + EMSGN("INTERNAL: Negative state char: %ld", c); + result = (c == curc); + + if (!result && ireg_ic) +*************** +*** 5252,5259 **** + prog, submatch, m, &listids); + t->pim->result = result ? NFA_PIM_MATCH + : NFA_PIM_NOMATCH; +! /* for \@! it is a match when result is FALSE */ +! if (result != t->pim->state->negated) + { + /* Copy submatch info from the recursive call */ + copy_sub_off(&t->pim->subs.norm, &m->norm); +--- 5246,5257 ---- + prog, submatch, m, &listids); + t->pim->result = result ? NFA_PIM_MATCH + : NFA_PIM_NOMATCH; +! /* for \@! and \@pim->state->c +! == NFA_START_INVISIBLE_NEG +! || t->pim->state->c +! == NFA_START_INVISIBLE_BEFORE_NEG)) + { + /* Copy submatch info from the recursive call */ + copy_sub_off(&t->pim->subs.norm, &m->norm); +*************** +*** 5274,5281 **** + #endif + } + +! /* for \@! it is a match when result is FALSE */ +! if (result != t->pim->state->negated) + { + /* Copy submatch info from the recursive call */ + copy_sub_off(&t->subs.norm, &t->pim->subs.norm); +--- 5272,5281 ---- + #endif + } + +! /* for \@! and \@pim->state->c == NFA_START_INVISIBLE_NEG +! || t->pim->state->c +! == NFA_START_INVISIBLE_BEFORE_NEG)) + { + /* Copy submatch info from the recursive call */ + copy_sub_off(&t->subs.norm, &t->pim->subs.norm); +*** ../vim-7.3.1138/src/regexp.h 2013-06-06 18:46:00.000000000 +0200 +--- src/regexp.h 2013-06-07 16:11:12.000000000 +0200 +*************** +*** 73,79 **** + nfa_state_T *out1; + int id; + int lastlist[2]; /* 0: normal, 1: recursive */ +- int negated; + int val; + }; + +--- 73,78 ---- +*** ../vim-7.3.1138/src/version.c 2013-06-07 14:59:14.000000000 +0200 +--- src/version.c 2013-06-07 16:11:59.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1139, + /**/ + +-- +Common sense is what tells you that the world is flat. + + /// 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 /// diff --git a/7.3.1140 b/7.3.1140 new file mode 100644 index 0000000..08def01 --- /dev/null +++ b/7.3.1140 @@ -0,0 +1,192 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1140 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1140 +Problem: New regexp engine: trying expensive match while the result is not + going to be used. +Solution: Check for output state already being in the state list. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1139/src/regexp_nfa.c 2013-06-07 16:31:44.000000000 +0200 +--- src/regexp_nfa.c 2013-06-07 17:16:31.000000000 +0200 +*************** +*** 3156,3161 **** +--- 3156,3163 ---- + static void copy_sub __ARGS((regsub_T *to, regsub_T *from)); + static void copy_sub_off __ARGS((regsub_T *to, regsub_T *from)); + static int sub_equal __ARGS((regsub_T *sub1, regsub_T *sub2)); ++ static int has_state_with_pos __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs)); ++ static int state_in_list __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs)); + static void addstate __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs, int off)); + static void addstate_here __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs, nfa_pim_T *pim, int *ip)); + +*************** +*** 3319,3324 **** +--- 3321,3371 ---- + } + #endif + ++ /* ++ * Return TRUE if the same state is already in list "l" with the same ++ * positions as "subs". ++ */ ++ static int ++ has_state_with_pos(l, state, subs) ++ nfa_list_T *l; /* runtime state list */ ++ nfa_state_T *state; /* state to update */ ++ regsubs_T *subs; /* pointers to subexpressions */ ++ { ++ nfa_thread_T *thread; ++ int i; ++ ++ for (i = 0; i < l->n; ++i) ++ { ++ thread = &l->t[i]; ++ if (thread->state->id == state->id ++ && sub_equal(&thread->subs.norm, &subs->norm) ++ #ifdef FEAT_SYN_HL ++ && (!nfa_has_zsubexpr || ++ sub_equal(&thread->subs.synt, &subs->synt)) ++ #endif ++ ) ++ return TRUE; ++ } ++ return FALSE; ++ } ++ ++ /* ++ * Return TRUE if "state" is already in list "l". ++ */ ++ static int ++ state_in_list(l, state, subs) ++ nfa_list_T *l; /* runtime state list */ ++ nfa_state_T *state; /* state to update */ ++ regsubs_T *subs; /* pointers to subexpressions */ ++ { ++ if (state->lastlist[nfa_ll_index] == l->id) ++ { ++ if (!nfa_has_backref || has_state_with_pos(l, state, subs)) ++ return TRUE; ++ } ++ return FALSE; ++ } ++ + static void + addstate(l, state, subs, off) + nfa_list_T *l; /* runtime state list */ +*************** +*** 3431,3450 **** + return; + } + +! /* See if the same state is already in the list with the same +! * positions. */ +! for (i = 0; i < l->n; ++i) +! { +! thread = &l->t[i]; +! if (thread->state->id == state->id +! && sub_equal(&thread->subs.norm, &subs->norm) +! #ifdef FEAT_SYN_HL +! && (!nfa_has_zsubexpr || +! sub_equal(&thread->subs.synt, &subs->synt)) +! #endif +! ) +! goto skip_add; +! } + } + + /* when there are backreferences or look-behind matches the number +--- 3478,3485 ---- + return; + } + +! if (has_state_with_pos(l, state, subs)) +! goto skip_add; + } + + /* when there are backreferences or look-behind matches the number +*************** +*** 4600,4605 **** +--- 4635,4681 ---- + break; + + case NFA_START_PATTERN: ++ { ++ nfa_state_T *skip = NULL; ++ #ifdef ENABLE_LOG ++ int skip_lid = 0; ++ #endif ++ ++ /* There is no point in trying to match the pattern if the ++ * output state is not going to be added to the list. */ ++ if (state_in_list(nextlist, t->state->out1->out, &t->subs)) ++ { ++ skip = t->state->out1->out; ++ #ifdef ENABLE_LOG ++ skip_lid = nextlist->id; ++ #endif ++ } ++ else if (state_in_list(nextlist, ++ t->state->out1->out->out, &t->subs)) ++ { ++ skip = t->state->out1->out->out; ++ #ifdef ENABLE_LOG ++ skip_lid = nextlist->id; ++ #endif ++ } ++ else if(state_in_list(thislist, ++ t->state->out1->out->out, &t->subs)) ++ { ++ skip = t->state->out1->out->out; ++ #ifdef ENABLE_LOG ++ skip_lid = thislist->id; ++ #endif ++ } ++ if (skip != NULL) ++ { ++ #ifdef ENABLE_LOG ++ nfa_set_code(skip->c); ++ fprintf(log_fd, "> Not trying to match pattern, output state %d is already in list %d. char %d: %s\n", ++ abs(skip->id), skip_lid, skip->c, code); ++ #endif ++ break; ++ } ++ + /* First try matching the pattern. */ + result = recursive_regmatch(t->state, prog, + submatch, m, &listids); +*************** +*** 4654,4659 **** +--- 4730,4736 ---- + } + } + break; ++ } + + case NFA_BOL: + if (reginput == regline) +*** ../vim-7.3.1139/src/version.c 2013-06-07 16:31:45.000000000 +0200 +--- src/version.c 2013-06-07 17:30:12.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1140, + /**/ + +-- +From "know your smileys": + :-* A big kiss! + + /// 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 /// diff --git a/7.3.1141 b/7.3.1141 new file mode 100644 index 0000000..75894b1 --- /dev/null +++ b/7.3.1141 @@ -0,0 +1,88 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1141 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1141 +Problem: Win32: Check for available memory is not reliable and adds + overhead. +Solution: Remove mch_avail_mem(). (Mike Williams) +Files: src/os_win32.c, src/os_win32.h + + +*** ../vim-7.3.1140/src/os_win32.c 2013-05-06 04:21:35.000000000 +0200 +--- src/os_win32.c 2013-06-07 19:12:53.000000000 +0200 +*************** +*** 5048,5084 **** + } + + +- /* +- * How much memory is available in Kbyte? +- * Return sum of available physical and page file memory. +- */ +- /*ARGSUSED*/ +- long_u +- mch_avail_mem(int special) +- { +- #ifdef MEMORYSTATUSEX +- PlatformId(); +- if (g_PlatformId == VER_PLATFORM_WIN32_NT) +- { +- MEMORYSTATUSEX ms; +- +- /* Need to use GlobalMemoryStatusEx() when there is more memory than +- * what fits in 32 bits. But it's not always available. */ +- ms.dwLength = sizeof(MEMORYSTATUSEX); +- GlobalMemoryStatusEx(&ms); +- return (long_u)((ms.ullAvailPhys + ms.ullAvailPageFile) >> 10); +- } +- else +- #endif +- { +- MEMORYSTATUS ms; +- +- ms.dwLength = sizeof(MEMORYSTATUS); +- GlobalMemoryStatus(&ms); +- return (long_u)((ms.dwAvailPhys + ms.dwAvailPageFile) >> 10); +- } +- } +- + #ifdef FEAT_MBYTE + /* + * Same code as below, but with wide functions and no comments. +--- 5048,5053 ---- +*** ../vim-7.3.1140/src/os_win32.h 2013-05-06 04:21:35.000000000 +0200 +--- src/os_win32.h 2013-06-07 19:14:42.000000000 +0200 +*************** +*** 80,86 **** + #ifndef FEAT_GUI_W32 /* GUI works different */ + # define BREAKCHECK_SKIP 1 /* call mch_breakcheck() each time, it's fast */ + #endif +- #define HAVE_AVAIL_MEM + + #define HAVE_PUTENV /* at least Bcc 5.2 and MSC have it */ + +--- 80,85 ---- +*** ../vim-7.3.1140/src/version.c 2013-06-07 17:31:25.000000000 +0200 +--- src/version.c 2013-06-07 19:13:48.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1141, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +95. Only communication in your household is through email. + + /// 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 /// diff --git a/7.3.1142 b/7.3.1142 new file mode 100644 index 0000000..63c9cda --- /dev/null +++ b/7.3.1142 @@ -0,0 +1,45 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1142 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1142 +Problem: Memory leak in ":syntime report". +Solution: Clear the grow array. (Dominique Pelle) +Files: src/syntax.c + + +*** ../vim-7.3.1141/src/syntax.c 2013-06-06 21:19:40.000000000 +0200 +--- src/syntax.c 2013-06-07 19:35:24.000000000 +0200 +*************** +*** 6689,6694 **** +--- 6689,6695 ---- + msg_outtrans_len(p->pattern, len); + MSG_PUTS("\n"); + } ++ ga_clear(&ga); + if (!got_int) + { + MSG_PUTS("\n"); +*** ../vim-7.3.1141/src/version.c 2013-06-07 19:17:12.000000000 +0200 +--- src/version.c 2013-06-07 19:36:10.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1142, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +99. The hum of a cooling fan and the click of keys is comforting to you. + + /// 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 /// diff --git a/7.3.1143 b/7.3.1143 new file mode 100644 index 0000000..5bd6e1a --- /dev/null +++ b/7.3.1143 @@ -0,0 +1,53 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1143 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1143 +Problem: When mapping NUL it is displayed as an X. +Solution: Check for KS_ZERO instead of K_ZERO. (Yasuhiro Matsumoto) +Files: src/message.c + + +*** ../vim-7.3.1142/src/message.c 2013-04-24 15:12:27.000000000 +0200 +--- src/message.c 2013-06-07 19:47:23.000000000 +0200 +*************** +*** 1577,1583 **** + { + c = TO_SPECIAL(str[1], str[2]); + str += 2; +! if (c == K_ZERO) /* display as ^@ */ + c = NUL; + } + if (IS_SPECIAL(c) || modifiers) /* special key */ +--- 1577,1583 ---- + { + c = TO_SPECIAL(str[1], str[2]); + str += 2; +! if (c == KS_ZERO) /* display as ^@ or */ + c = NUL; + } + if (IS_SPECIAL(c) || modifiers) /* special key */ +*** ../vim-7.3.1142/src/version.c 2013-06-07 19:48:29.000000000 +0200 +--- src/version.c 2013-06-07 19:50:32.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1143, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +100. The most exciting sporting events you noticed during summer 1996 + was Netscape vs. Microsoft. + + /// 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 /// diff --git a/7.3.1144 b/7.3.1144 new file mode 100644 index 0000000..aa5d574 --- /dev/null +++ b/7.3.1144 @@ -0,0 +1,87 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1144 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1144 +Problem: "RO" is not translated everywhere. +Solution: Put inside _(). (Sergey Alyoshin) +Files: src/buffer.c, src/screen.c + + +*** ../vim-7.3.1143/src/buffer.c 2013-05-06 04:50:26.000000000 +0200 +--- src/buffer.c 2013-06-07 20:15:03.000000000 +0200 +*************** +*** 3139,3145 **** + #endif + ? _("[New file]") : "", + (curbuf->b_flags & BF_READERR) ? _("[Read errors]") : "", +! curbuf->b_p_ro ? (shortmess(SHM_RO) ? "[RO]" + : _("[readonly]")) : "", + (curbufIsChanged() || (curbuf->b_flags & BF_WRITE_MASK) + || curbuf->b_p_ro) ? +--- 3139,3145 ---- + #endif + ? _("[New file]") : "", + (curbuf->b_flags & BF_READERR) ? _("[Read errors]") : "", +! curbuf->b_p_ro ? (shortmess(SHM_RO) ? _("[RO]") + : _("[readonly]")) : "", + (curbufIsChanged() || (curbuf->b_flags & BF_WRITE_MASK) + || curbuf->b_p_ro) ? +*************** +*** 3976,3982 **** + case STL_ROFLAG_ALT: + itemisflag = TRUE; + if (wp->w_buffer->b_p_ro) +! str = (char_u *)((opt == STL_ROFLAG_ALT) ? ",RO" : "[RO]"); + break; + + case STL_HELPFLAG: +--- 3976,3982 ---- + case STL_ROFLAG_ALT: + itemisflag = TRUE; + if (wp->w_buffer->b_p_ro) +! str = (char_u *)((opt == STL_ROFLAG_ALT) ? ",RO" : _("[RO]")); + break; + + case STL_HELPFLAG: +*** ../vim-7.3.1143/src/screen.c 2013-06-04 22:13:45.000000000 +0200 +--- src/screen.c 2013-06-07 20:15:06.000000000 +0200 +*************** +*** 6281,6287 **** + } + if (wp->w_buffer->b_p_ro) + { +! STRCPY(p + len, "[RO]"); + len += 4; + } + +--- 6281,6287 ---- + } + if (wp->w_buffer->b_p_ro) + { +! STRCPY(p + len, _("[RO]")); + len += 4; + } + +*** ../vim-7.3.1143/src/version.c 2013-06-07 19:53:04.000000000 +0200 +--- src/version.c 2013-06-07 20:16:03.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1144, + /**/ + +-- +A meeting is an event at which the minutes are kept and the hours are lost. + + /// 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 /// diff --git a/7.3.1145 b/7.3.1145 new file mode 100644 index 0000000..bab42f3 --- /dev/null +++ b/7.3.1145 @@ -0,0 +1,142 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1145 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1145 +Problem: New regexp engine: addstate() is called very often. +Solution: Optimize adding the start state. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1144/src/regexp_nfa.c 2013-06-07 17:31:25.000000000 +0200 +--- src/regexp_nfa.c 2013-06-07 22:03:12.000000000 +0200 +*************** +*** 4332,4340 **** + nfa_list_T *nextlist; + int *listids = NULL; + nfa_state_T *add_state; +! int add_count; +! int add_off; + garray_T pimlist; + #ifdef NFA_REGEXP_DEBUG_LOG + FILE *debug = fopen(NFA_REGEXP_DEBUG_LOG, "a"); + +--- 4332,4341 ---- + nfa_list_T *nextlist; + int *listids = NULL; + nfa_state_T *add_state; +! int add_count; +! int add_off; + garray_T pimlist; ++ int toplevel = start->c == NFA_MOPEN; + #ifdef NFA_REGEXP_DEBUG_LOG + FILE *debug = fopen(NFA_REGEXP_DEBUG_LOG, "a"); + +*************** +*** 4378,4387 **** + nextlist = &list[1]; + nextlist->n = 0; + #ifdef ENABLE_LOG +! fprintf(log_fd, "(---) STARTSTATE\n"); + #endif + thislist->id = nfa_listid + 1; +! addstate(thislist, start, m, 0); + + #define ADD_STATE_IF_MATCH(state) \ + if (result) { \ +--- 4379,4404 ---- + nextlist = &list[1]; + nextlist->n = 0; + #ifdef ENABLE_LOG +! fprintf(log_fd, "(---) STARTSTATE first\n"); + #endif + thislist->id = nfa_listid + 1; +! +! /* Inline optimized code for addstate(thislist, start, m, 0) if we know +! * it's the first MOPEN. */ +! if (toplevel) +! { +! if (REG_MULTI) +! { +! m->norm.list.multi[0].start.lnum = reglnum; +! m->norm.list.multi[0].start.col = (colnr_T)(reginput - regline); +! } +! else +! m->norm.list.line[0].start = reginput; +! m->norm.in_use = 1; +! addstate(thislist, start->out, m, 0); +! } +! else +! addstate(thislist, start, m, 0); + + #define ADD_STATE_IF_MATCH(state) \ + if (result) { \ +*************** +*** 5382,5388 **** + * Unless "nfa_endp" is not NULL, then we match the end position. + * Also don't start a match past the first line. */ + if (nfa_match == FALSE +! && ((start->c == NFA_MOPEN + && reglnum == 0 + && clen != 0 + && (ireg_maxcol == 0 +--- 5399,5405 ---- + * Unless "nfa_endp" is not NULL, then we match the end position. + * Also don't start a match past the first line. */ + if (nfa_match == FALSE +! && ((toplevel + && reglnum == 0 + && clen != 0 + && (ireg_maxcol == 0 +*************** +*** 5398,5404 **** + #ifdef ENABLE_LOG + fprintf(log_fd, "(---) STARTSTATE\n"); + #endif +! addstate(nextlist, start, m, clen); + } + + #ifdef ENABLE_LOG +--- 5415,5433 ---- + #ifdef ENABLE_LOG + fprintf(log_fd, "(---) STARTSTATE\n"); + #endif +! /* Inline optimized code for addstate() if we know the state is +! * the first MOPEN. */ +! if (toplevel) +! { +! if (REG_MULTI) +! m->norm.list.multi[0].start.col = +! (colnr_T)(reginput - regline) + clen; +! else +! m->norm.list.line[0].start = reginput + clen; +! addstate(nextlist, start->out, m, clen); +! } +! else +! addstate(nextlist, start, m, clen); + } + + #ifdef ENABLE_LOG +*** ../vim-7.3.1144/src/version.c 2013-06-07 20:17:06.000000000 +0200 +--- src/version.c 2013-06-07 22:37:03.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1145, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +104. When people ask about the Presidential Election you ask "Which country?" + + /// 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 /// diff --git a/7.3.1146 b/7.3.1146 new file mode 100644 index 0000000..86b83dc --- /dev/null +++ b/7.3.1146 @@ -0,0 +1,400 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1146 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1146 +Problem: New regexp engine: look-behind match not checked when followed by + zero-width match. +Solution: Do the look-behind match before adding the zero-width state. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1145/src/regexp_nfa.c 2013-06-07 22:39:35.000000000 +0200 +--- src/regexp_nfa.c 2013-06-08 13:16:52.000000000 +0200 +*************** +*** 4332,4337 **** +--- 4332,4338 ---- + nfa_list_T *nextlist; + int *listids = NULL; + nfa_state_T *add_state; ++ int add_here; + int add_count; + int add_off; + garray_T pimlist; +*************** +*** 4495,4500 **** +--- 4496,4502 ---- + * The most important is NFA_MATCH. + */ + add_state = NULL; ++ add_here = FALSE; + add_count = 0; + switch (t->state->c) + { +*************** +*** 4621,4638 **** + /* t->state->out1 is the corresponding + * END_INVISIBLE node; Add its out to the current + * list (zero-width match). */ +! addstate_here(thislist, t->state->out1->out, +! &t->subs, t->pim, &listidx); + } + } + else + { + /* + * First try matching what follows at the current +! * position. Only if a match is found, addstate() is +! * called, then verify the invisible match matches. +! * Add a nfa_pim_T to the following states, it +! * contains info about the invisible match. + */ + if (ga_grow(&pimlist, 1) == FAIL) + goto theend; +--- 4623,4640 ---- + /* t->state->out1 is the corresponding + * END_INVISIBLE node; Add its out to the current + * list (zero-width match). */ +! add_here = TRUE; +! add_state = t->state->out1->out; + } + } + else + { + /* + * First try matching what follows at the current +! * position. Only if a match is found, before +! * addstate() is called, then verify the invisible +! * match matches. Add a nfa_pim_T to the following +! * states, it contains info about the invisible match. + */ + if (ga_grow(&pimlist, 1) == FAIL) + goto theend; +*************** +*** 4727,4734 **** + /* empty match, output of corresponding + * NFA_END_PATTERN/NFA_SKIP to be used at current + * position */ +! addstate_here(thislist, t->state->out1->out->out, +! &t->subs, t->pim, &listidx); + } + else if (bytelen <= clen) + { +--- 4729,4736 ---- + /* empty match, output of corresponding + * NFA_END_PATTERN/NFA_SKIP to be used at current + * position */ +! add_here = TRUE; +! add_state = t->state->out1->out->out; + } + else if (bytelen <= clen) + { +*************** +*** 4751,4764 **** + + case NFA_BOL: + if (reginput == regline) +! addstate_here(thislist, t->state->out, &t->subs, +! t->pim, &listidx); + break; + + case NFA_EOL: + if (curc == NUL) +! addstate_here(thislist, t->state->out, &t->subs, +! t->pim, &listidx); + break; + + case NFA_BOW: +--- 4753,4770 ---- + + case NFA_BOL: + if (reginput == regline) +! { +! add_here = TRUE; +! add_state = t->state->out; +! } + break; + + case NFA_EOL: + if (curc == NUL) +! { +! add_here = TRUE; +! add_state = t->state->out; +! } + break; + + case NFA_BOW: +*************** +*** 4784,4791 **** + && vim_iswordc_buf(reginput[-1], reg_buf))) + result = FALSE; + if (result) +! addstate_here(thislist, t->state->out, &t->subs, +! t->pim, &listidx); + break; + + case NFA_EOW: +--- 4790,4799 ---- + && vim_iswordc_buf(reginput[-1], reg_buf))) + result = FALSE; + if (result) +! { +! add_here = TRUE; +! add_state = t->state->out; +! } + break; + + case NFA_EOW: +*************** +*** 4810,4830 **** + && vim_iswordc_buf(curc, reg_buf))) + result = FALSE; + if (result) +! addstate_here(thislist, t->state->out, &t->subs, +! t->pim, &listidx); + break; + + case NFA_BOF: + if (reglnum == 0 && reginput == regline + && (!REG_MULTI || reg_firstlnum == 1)) +! addstate_here(thislist, t->state->out, &t->subs, +! t->pim, &listidx); + break; + + case NFA_EOF: + if (reglnum == reg_maxline && curc == NUL) +! addstate_here(thislist, t->state->out, &t->subs, +! t->pim, &listidx); + break; + + #ifdef FEAT_MBYTE +--- 4818,4844 ---- + && vim_iswordc_buf(curc, reg_buf))) + result = FALSE; + if (result) +! { +! add_here = TRUE; +! add_state = t->state->out; +! } + break; + + case NFA_BOF: + if (reglnum == 0 && reginput == regline + && (!REG_MULTI || reg_firstlnum == 1)) +! { +! add_here = TRUE; +! add_state = t->state->out; +! } + break; + + case NFA_EOF: + if (reglnum == reg_maxline && curc == NUL) +! { +! add_here = TRUE; +! add_state = t->state->out; +! } + break; + + #ifdef FEAT_MBYTE +*************** +*** 5183,5190 **** + { + /* empty match always works, output of NFA_SKIP to be + * used next */ +! addstate_here(thislist, t->state->out->out, &t->subs, +! t->pim, &listidx); + } + else if (bytelen <= clen) + { +--- 5197,5204 ---- + { + /* empty match always works, output of NFA_SKIP to be + * used next */ +! add_here = TRUE; +! add_state = t->state->out->out; + } + else if (bytelen <= clen) + { +*************** +*** 5228,5235 **** + nfa_re_num_cmp(t->state->val, t->state->c - NFA_LNUM, + (long_u)(reglnum + reg_firstlnum))); + if (result) +! addstate_here(thislist, t->state->out, &t->subs, +! t->pim, &listidx); + break; + + case NFA_COL: +--- 5242,5251 ---- + nfa_re_num_cmp(t->state->val, t->state->c - NFA_LNUM, + (long_u)(reglnum + reg_firstlnum))); + if (result) +! { +! add_here = TRUE; +! add_state = t->state->out; +! } + break; + + case NFA_COL: +*************** +*** 5238,5245 **** + result = nfa_re_num_cmp(t->state->val, t->state->c - NFA_COL, + (long_u)(reginput - regline) + 1); + if (result) +! addstate_here(thislist, t->state->out, &t->subs, +! t->pim, &listidx); + break; + + case NFA_VCOL: +--- 5254,5263 ---- + result = nfa_re_num_cmp(t->state->val, t->state->c - NFA_COL, + (long_u)(reginput - regline) + 1); + if (result) +! { +! add_here = TRUE; +! add_state = t->state->out; +! } + break; + + case NFA_VCOL: +*************** +*** 5250,5257 **** + reg_win == NULL ? curwin : reg_win, + regline, (colnr_T)(reginput - regline)) + 1); + if (result) +! addstate_here(thislist, t->state->out, &t->subs, +! t->pim, &listidx); + break; + + case NFA_MARK: +--- 5268,5277 ---- + reg_win == NULL ? curwin : reg_win, + regline, (colnr_T)(reginput - regline)) + 1); + if (result) +! { +! add_here = TRUE; +! add_state = t->state->out; +! } + break; + + case NFA_MARK: +*************** +*** 5273,5280 **** + ? t->state->c == NFA_MARK_GT + : t->state->c == NFA_MARK_LT))); + if (result) +! addstate_here(thislist, t->state->out, &t->subs, +! t->pim, &listidx); + break; + } + +--- 5293,5302 ---- + ? t->state->c == NFA_MARK_GT + : t->state->c == NFA_MARK_LT))); + if (result) +! { +! add_here = TRUE; +! add_state = t->state->out; +! } + break; + } + +*************** +*** 5284,5299 **** + && ((colnr_T)(reginput - regline) + == reg_win->w_cursor.col)); + if (result) +! addstate_here(thislist, t->state->out, &t->subs, +! t->pim, &listidx); + break; + + case NFA_VISUAL: + #ifdef FEAT_VISUAL + result = reg_match_visual(); + if (result) +! addstate_here(thislist, t->state->out, &t->subs, +! t->pim, &listidx); + #endif + break; + +--- 5306,5325 ---- + && ((colnr_T)(reginput - regline) + == reg_win->w_cursor.col)); + if (result) +! { +! add_here = TRUE; +! add_state = t->state->out; +! } + break; + + case NFA_VISUAL: + #ifdef FEAT_VISUAL + result = reg_match_visual(); + if (result) +! { +! add_here = TRUE; +! add_state = t->state->out; +! } + #endif + break; + +*************** +*** 5327,5333 **** + if (t->pim != NULL) + { + /* postponed invisible match */ +- /* TODO: also do t->pim->pim recursively? */ + if (t->pim->result == NFA_PIM_TODO) + { + #ifdef ENABLE_LOG +--- 5353,5358 ---- +*************** +*** 5383,5391 **** + continue; + } + +! addstate(nextlist, add_state, &t->subs, add_off); +! if (add_count > 0) +! nextlist->t[nextlist->n - 1].count = add_count; + } + + } /* for (thislist = thislist; thislist->state; thislist++) */ +--- 5408,5421 ---- + continue; + } + +! if (add_here) +! addstate_here(thislist, add_state, &t->subs, NULL, &listidx); +! else +! { +! addstate(nextlist, add_state, &t->subs, add_off); +! if (add_count > 0) +! nextlist->t[nextlist->n - 1].count = add_count; +! } + } + + } /* for (thislist = thislist; thislist->state; thislist++) */ +*** ../vim-7.3.1145/src/version.c 2013-06-07 22:39:35.000000000 +0200 +--- src/version.c 2013-06-08 13:30:41.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1146, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +111. You and your friends get together regularly on IRC, even though + all of you live in the same city. + + /// 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 /// diff --git a/7.3.1147 b/7.3.1147 new file mode 100644 index 0000000..de33af3 --- /dev/null +++ b/7.3.1147 @@ -0,0 +1,183 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1147 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1147 +Problem: New regexp engine: regstart is only used to find the first match. +Solution: Use regstart whenever adding the start state. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1146/src/regexp_nfa.c 2013-06-08 13:33:32.000000000 +0200 +--- src/regexp_nfa.c 2013-06-08 14:37:36.000000000 +0200 +*************** +*** 4153,4158 **** +--- 4153,4159 ---- + } + + static int failure_chance __ARGS((nfa_state_T *state, int depth)); ++ static int skip_to_start __ARGS((int c, colnr_T *colp)); + + /* + * Estimate the chance of a match with "state" failing. +*************** +*** 4305,4310 **** +--- 4306,4336 ---- + } + + /* ++ * Skip until the char "c" we know a match must start with. ++ */ ++ static int ++ skip_to_start(c, colp) ++ int c; ++ colnr_T *colp; ++ { ++ char_u *s; ++ ++ /* Used often, do some work to avoid call overhead. */ ++ if (!ireg_ic ++ #ifdef FEAT_MBYTE ++ && !has_mbyte ++ #endif ++ ) ++ s = vim_strbyte(regline + *colp, c); ++ else ++ s = cstrchr(regline + *colp, c); ++ if (s == NULL) ++ return FAIL; ++ *colp = (int)(s - regline); ++ return OK; ++ } ++ ++ /* + * Main matching routine. + * + * Run NFA to determine whether it matches reginput. +*************** +*** 5449,5460 **** + * the first MOPEN. */ + if (toplevel) + { +! if (REG_MULTI) +! m->norm.list.multi[0].start.col = + (colnr_T)(reginput - regline) + clen; +! else +! m->norm.list.line[0].start = reginput + clen; +! addstate(nextlist, start->out, m, clen); + } + else + addstate(nextlist, start, m, clen); +--- 5475,5524 ---- + * the first MOPEN. */ + if (toplevel) + { +! int add = TRUE; +! int c; +! +! if (prog->regstart != NUL && clen != 0) +! { +! if (nextlist->n == 0) +! { +! colnr_T col = (colnr_T)(reginput - regline) + clen; +! +! /* Nextlist is empty, we can skip ahead to the +! * character that must appear at the start. */ +! if (skip_to_start(prog->regstart, &col) == FAIL) +! break; +! #ifdef ENABLE_LOG +! fprintf(log_fd, " Skipping ahead %d bytes to regstart\n", +! col - ((colnr_T)(reginput - regline) + clen)); +! #endif +! reginput = regline + col - clen; +! } +! else +! { +! /* Checking if the required start character matches is +! * cheaper than adding a state that won't match. */ +! c = PTR2CHAR(reginput + clen); +! if (c != prog->regstart && (!ireg_ic || MB_TOLOWER(c) +! != MB_TOLOWER(prog->regstart))) +! { +! #ifdef ENABLE_LOG +! fprintf(log_fd, " Skipping start state, regstart does not match\n"); +! #endif +! add = FALSE; +! } +! } +! } +! +! if (add) +! { +! if (REG_MULTI) +! m->norm.list.multi[0].start.col = + (colnr_T)(reginput - regline) + clen; +! else +! m->norm.list.line[0].start = reginput + clen; +! addstate(nextlist, start->out, m, clen); +! } + } + else + addstate(nextlist, start, m, clen); +*************** +*** 5701,5723 **** + return 0L; + + if (prog->regstart != NUL) +! { +! char_u *s; +! +! /* Skip until the char we know it must start with. +! * Used often, do some work to avoid call overhead. */ +! if (!ireg_ic +! #ifdef FEAT_MBYTE +! && !has_mbyte +! #endif +! ) +! s = vim_strbyte(regline + col, prog->regstart); +! else +! s = cstrchr(regline + col, prog->regstart); +! if (s == NULL) + return 0L; +- col = (int)(s - regline); +- } + + /* If the start column is past the maximum column: no need to try. */ + if (ireg_maxcol > 0 && col >= ireg_maxcol) +--- 5765,5774 ---- + return 0L; + + if (prog->regstart != NUL) +! /* Skip ahead until a character we know the match must start with. +! * When there is none there is no match. */ +! if (skip_to_start(prog->regstart, &col) == FAIL) + return 0L; + + /* If the start column is past the maximum column: no need to try. */ + if (ireg_maxcol > 0 && col >= ireg_maxcol) +*** ../vim-7.3.1146/src/version.c 2013-06-08 13:33:32.000000000 +0200 +--- src/version.c 2013-06-08 14:35:54.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1147, + /**/ + +-- +Nobody will ever need more than 640 kB RAM. + -- Bill Gates, 1983 +Windows 98 requires 16 MB RAM. + -- Bill Gates, 1999 +Logical conclusion: Nobody will ever need Windows 98. + + /// 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 /// diff --git a/7.3.1148 b/7.3.1148 new file mode 100644 index 0000000..33f4196 --- /dev/null +++ b/7.3.1148 @@ -0,0 +1,176 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1148 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1148 +Problem: No command line completion for ":syntime". +Solution: Implement the completion. (Dominique Pelle) +Files: runtime/doc/map.txt, src/ex_cmds.h, src/ex_docmd.c, + src/ex_getln.c, src/proto/syntax.pro, src/syntax.c, src/vim.h + + +*** ../vim-7.3.1147/runtime/doc/map.txt 2012-08-15 14:04:50.000000000 +0200 +--- runtime/doc/map.txt 2013-06-08 15:08:20.000000000 +0200 +*************** +*** 1225,1230 **** +--- 1242,1248 ---- + -complete=shellcmd Shell command + -complete=sign |:sign| suboptions + -complete=syntax syntax file names |'syntax'| ++ -complete=syntime |:syntime| suboptions + -complete=tag tags + -complete=tag_listfiles tags, file names are shown when CTRL-D is hit + -complete=user user names +*** ../vim-7.3.1147/src/ex_cmds.h 2013-06-06 14:01:35.000000000 +0200 +--- src/ex_cmds.h 2013-06-08 15:08:20.000000000 +0200 +*************** +*** 926,932 **** + EX(CMD_syntax, "syntax", ex_syntax, + EXTRA|NOTRLCOM|CMDWIN), + EX(CMD_syntime, "syntime", ex_syntime, +! WORD1|TRLBAR|CMDWIN), + EX(CMD_syncbind, "syncbind", ex_syncbind, + TRLBAR), + EX(CMD_t, "t", ex_copymove, +--- 926,932 ---- + EX(CMD_syntax, "syntax", ex_syntax, + EXTRA|NOTRLCOM|CMDWIN), + EX(CMD_syntime, "syntime", ex_syntime, +! NEEDARG|WORD1|TRLBAR|CMDWIN), + EX(CMD_syncbind, "syncbind", ex_syncbind, + TRLBAR), + EX(CMD_t, "t", ex_copymove, +*** ../vim-7.3.1147/src/ex_docmd.c 2013-06-06 14:55:16.000000000 +0200 +--- src/ex_docmd.c 2013-06-08 15:08:20.000000000 +0200 +*************** +*** 3994,3999 **** +--- 3994,4005 ---- + xp->xp_pattern = arg; + break; + #endif ++ #if defined(FEAT_PROFILE) ++ case CMD_syntime: ++ xp->xp_context = EXPAND_SYNTIME; ++ xp->xp_pattern = arg; ++ break; ++ #endif + + #endif /* FEAT_CMDL_COMPL */ + +*************** +*** 5436,5441 **** +--- 5442,5450 ---- + {EXPAND_MAPPINGS, "mapping"}, + {EXPAND_MENUS, "menu"}, + {EXPAND_OWNSYNTAX, "syntax"}, ++ #if defined(FEAT_PROFILE) ++ {EXPAND_SYNTIME, "syntime"}, ++ #endif + {EXPAND_SETTINGS, "option"}, + {EXPAND_SHELLCMD, "shellcmd"}, + #if defined(FEAT_SIGNS) +*** ../vim-7.3.1147/src/ex_getln.c 2013-04-24 15:39:06.000000000 +0200 +--- src/ex_getln.c 2013-06-08 15:08:20.000000000 +0200 +*************** +*** 4674,4679 **** +--- 4674,4682 ---- + #ifdef FEAT_SYN_HL + {EXPAND_SYNTAX, get_syntax_name, TRUE, TRUE}, + #endif ++ #ifdef FEAT_PROFILE ++ {EXPAND_SYNTIME, get_syntime_arg, TRUE, TRUE}, ++ #endif + {EXPAND_HIGHLIGHT, get_highlight_name, TRUE, TRUE}, + #ifdef FEAT_AUTOCMD + {EXPAND_EVENTS, get_event_name, TRUE, TRUE}, +*** ../vim-7.3.1147/src/proto/syntax.pro 2013-06-06 14:01:35.000000000 +0200 +--- src/proto/syntax.pro 2013-06-08 15:08:20.000000000 +0200 +*************** +*** 20,25 **** +--- 20,26 ---- + int syn_get_stack_item __ARGS((int i)); + int syn_get_foldlevel __ARGS((win_T *wp, long lnum)); + void ex_syntime __ARGS((exarg_T *eap)); ++ char_u *get_syntime_arg __ARGS((expand_T *xp, int idx)); + void init_highlight __ARGS((int both, int reset)); + int load_colors __ARGS((char_u *name)); + void do_highlight __ARGS((char_u *line, int forceit, int init)); +*** ../vim-7.3.1147/src/syntax.c 2013-06-07 19:48:29.000000000 +0200 +--- src/syntax.c 2013-06-08 15:12:43.000000000 +0200 +*************** +*** 6577,6582 **** +--- 6577,6603 ---- + } + } + ++ #if defined(FEAT_CMDL_COMPL) || defined(PROTO) ++ /* ++ * Function given to ExpandGeneric() to obtain the possible arguments of the ++ * ":syntime {on,off,clear,report}" command. ++ */ ++ char_u * ++ get_syntime_arg(xp, idx) ++ expand_T *xp UNUSED; ++ int idx; ++ { ++ switch (idx) ++ { ++ case 0: return (char_u *)"on"; ++ case 1: return (char_u *)"off"; ++ case 2: return (char_u *)"clear"; ++ case 3: return (char_u *)"report"; ++ } ++ return NULL; ++ } ++ #endif ++ + typedef struct + { + proftime_T total; +*************** +*** 6610,6616 **** +--- 6631,6639 ---- + { + int idx; + synpat_T *spp; ++ # ifdef FEAT_FLOAT + proftime_T tm; ++ # endif + int len; + proftime_T total_total; + int total_count = 0; +*** ../vim-7.3.1147/src/vim.h 2013-05-30 13:37:23.000000000 +0200 +--- src/vim.h 2013-06-08 15:08:20.000000000 +0200 +*************** +*** 783,788 **** +--- 783,789 ---- + #define EXPAND_LOCALES 40 + #define EXPAND_HISTORY 41 + #define EXPAND_USER 42 ++ #define EXPAND_SYNTIME 43 + + /* Values for exmode_active (0 is no exmode) */ + #define EXMODE_NORMAL 1 +*** ../vim-7.3.1147/src/version.c 2013-06-08 14:38:23.000000000 +0200 +--- src/version.c 2013-06-08 15:23:00.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1148, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +113. You are asked about a bus schedule, you wonder if it is 16 or 32 bits. + + /// 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 /// diff --git a/7.3.1149 b/7.3.1149 new file mode 100644 index 0000000..1523406 --- /dev/null +++ b/7.3.1149 @@ -0,0 +1,1542 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1149 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1149 +Problem: New regexp engine: Matching plain text could be faster. +Solution: Detect a plain text match and handle it specifically. Add + vim_regfree(). +Files: src/regexp.c, src/regexp.h, src/regexp_nfa.c, + src/proto/regexp.pro, src/buffer.c, src/edit.c, src/eval.c, + src/ex_cmds.c, src/ex_cmds2.c, src/ex_docmd.c, src/ex_eval.c, + src/ex_getln.c, src/fileio.c, src/gui.c, src/misc1.c, src/misc2.c, + src/option.c, src/syntax.c, src/quickfix.c, src/search.c, + src/spell.c, src/tag.c, src/window.c, src/screen.c, src/macros.h, + src/testdir/test64.in, src/testdir/test64.ok + + +*** ../vim-7.3.1148/src/regexp.c 2013-06-06 18:04:47.000000000 +0200 +--- src/regexp.c 2013-06-08 17:13:06.000000000 +0200 +*************** +*** 1297,1303 **** + return p; + } + +! static regprog_T *bt_regcomp __ARGS((char_u *expr, int re_flags)); + + /* + * bt_regcomp() - compile a regular expression into internal code for the +--- 1297,1304 ---- + return p; + } + +! static regprog_T *bt_regcomp __ARGS((char_u *expr, int re_flags)); +! static void bt_regfree __ARGS((regprog_T *prog)); + + /* + * bt_regcomp() - compile a regular expression into internal code for the +*************** +*** 1455,1460 **** +--- 1456,1471 ---- + } + + /* ++ * Free a compiled regexp program, returned by bt_regcomp(). ++ */ ++ static void ++ bt_regfree(prog) ++ regprog_T *prog; ++ { ++ vim_free(prog); ++ } ++ ++ /* + * Setup to parse the regexp. Used once to get the length and once to do it. + */ + static void +*************** +*** 7876,7881 **** +--- 7887,7893 ---- + static regengine_T bt_regengine = + { + bt_regcomp, ++ bt_regfree, + bt_regexec, + #if defined(FEAT_MODIFY_FNAME) || defined(FEAT_EVAL) \ + || defined(FIND_REPLACE_DIALOG) || defined(PROTO) +*************** +*** 7893,7898 **** +--- 7905,7911 ---- + static regengine_T nfa_regengine = + { + nfa_regcomp, ++ nfa_regfree, + nfa_regexec, + #if defined(FEAT_MODIFY_FNAME) || defined(FEAT_EVAL) \ + || defined(FIND_REPLACE_DIALOG) || defined(PROTO) +*************** +*** 7920,7926 **** + + /* + * Compile a regular expression into internal code. +! * Returns the program in allocated memory. Returns NULL for an error. + */ + regprog_T * + vim_regcomp(expr_arg, re_flags) +--- 7933,7941 ---- + + /* + * Compile a regular expression into internal code. +! * Returns the program in allocated memory. +! * Use vim_regfree() to free the memory. +! * Returns NULL for an error. + */ + regprog_T * + vim_regcomp(expr_arg, re_flags) +*************** +*** 7997,8002 **** +--- 8012,8028 ---- + } + + /* ++ * Free a compiled regexp program, returned by vim_regcomp(). ++ */ ++ void ++ vim_regfree(prog) ++ regprog_T *prog; ++ { ++ if (prog != NULL) ++ prog->engine->regfree(prog); ++ } ++ ++ /* + * Match a regexp against a string. + * "rmp->regprog" is a compiled regexp as returned by vim_regcomp(). + * Uses curbuf for line count and 'iskeyword'. +*** ../vim-7.3.1148/src/regexp.h 2013-06-07 16:31:45.000000000 +0200 +--- src/regexp.h 2013-06-08 15:43:33.000000000 +0200 +*************** +*** 89,94 **** +--- 89,95 ---- + + int reganch; /* pattern starts with ^ */ + int regstart; /* char at start of pattern */ ++ char_u *match_text; /* plain text to match with */ + + int has_zend; /* pattern contains \ze */ + int has_backref; /* pattern contains \1 .. \9 */ +*************** +*** 147,152 **** +--- 148,154 ---- + struct regengine + { + regprog_T *(*regcomp)(char_u*, int); ++ void (*regfree)(regprog_T *); + int (*regexec)(regmatch_T*, char_u*, colnr_T); + #if defined(FEAT_MODIFY_FNAME) || defined(FEAT_EVAL) \ + || defined(FIND_REPLACE_DIALOG) || defined(PROTO) +*** ../vim-7.3.1148/src/regexp_nfa.c 2013-06-08 14:38:23.000000000 +0200 +--- src/regexp_nfa.c 2013-06-08 18:04:40.000000000 +0200 +*************** +*** 270,275 **** +--- 270,276 ---- + static int nfa_regcomp_start __ARGS((char_u *expr, int re_flags)); + static int nfa_get_reganch __ARGS((nfa_state_T *start, int depth)); + static int nfa_get_regstart __ARGS((nfa_state_T *start, int depth)); ++ static char_u *nfa_get_match_text __ARGS((nfa_state_T *start)); + static int nfa_recognize_char_class __ARGS((char_u *start, char_u *end, int extra_newl)); + static int nfa_emit_equi_class __ARGS((int c)); + static int nfa_regatom __ARGS((void)); +*************** +*** 295,300 **** +--- 296,302 ---- + static long nfa_regtry __ARGS((nfa_regprog_T *prog, colnr_T col)); + static long nfa_regexec_both __ARGS((char_u *line, colnr_T col)); + static regprog_T *nfa_regcomp __ARGS((char_u *expr, int re_flags)); ++ static void nfa_regfree __ARGS((regprog_T *prog)); + static int nfa_regexec __ARGS((regmatch_T *rmp, char_u *line, colnr_T col)); + static long nfa_regexec_multi __ARGS((regmmatch_T *rmp, win_T *win, buf_T *buf, linenr_T lnum, colnr_T col, proftime_T *tm)); + +*************** +*** 493,498 **** +--- 495,546 ---- + } + + /* ++ * Figure out if the NFA state list contains just literal text and nothing ++ * else. If so return a string with what must match after regstart. ++ * Otherwise return NULL. ++ */ ++ static char_u * ++ nfa_get_match_text(start) ++ nfa_state_T *start; ++ { ++ nfa_state_T *p = start; ++ int len = 0; ++ char_u *ret; ++ char_u *s; ++ ++ if (p->c != NFA_MOPEN) ++ return NULL; /* just in case */ ++ p = p->out; ++ while (p->c > 0) ++ { ++ len += MB_CHAR2LEN(p->c); ++ p = p->out; ++ } ++ if (p->c != NFA_MCLOSE || p->out->c != NFA_MATCH) ++ return NULL; ++ ++ ret = alloc(len); ++ if (ret != NULL) ++ { ++ len = 0; ++ p = start->out->out; /* skip first char, it goes into regstart */ ++ s = ret; ++ while (p->c > 0) ++ { ++ #ifdef FEAT_MBYTE ++ if (has_mbyte) ++ s += (*mb_char2bytes)(p->c, s); ++ else ++ #endif ++ *s++ = p->c; ++ p = p->out; ++ } ++ *s = NUL; ++ } ++ return ret; ++ } ++ ++ /* + * Allocate more space for post_start. Called when + * running above the estimated number of states. + */ +*************** +*** 2280,2287 **** + { + nfa_print_state(debugf, prog->start); + +! fprintf(debugf, "reganch: %d\n", prog->reganch); +! fprintf(debugf, "regstart: %d\n", prog->regstart); + + fclose(debugf); + } +--- 2328,2340 ---- + { + nfa_print_state(debugf, prog->start); + +! if (prog->reganch) +! fprintf(debugf, "reganch: %d\n", prog->reganch); +! if (prog->regstart != NUL) +! fprintf(debugf, "regstart: %c (decimal: %d)\n", +! prog->regstart, prog->regstart); +! if (prog->match_text != NULL) +! fprintf(debugf, "match_text: \"%s\"\n", prog->match_text); + + fclose(debugf); + } +*************** +*** 4154,4159 **** +--- 4207,4213 ---- + + static int failure_chance __ARGS((nfa_state_T *state, int depth)); + static int skip_to_start __ARGS((int c, colnr_T *colp)); ++ static long find_match_text __ARGS((colnr_T startcol, int regstart, char_u *match_text)); + + /* + * Estimate the chance of a match with "state" failing. +*************** +*** 4331,4336 **** +--- 4385,4453 ---- + } + + /* ++ * Check for a match with match_text. ++ * Called after skip_to_start() has find regstart. ++ * Returns zero for no match, 1 for a match. ++ */ ++ static long ++ find_match_text(startcol, regstart, match_text) ++ colnr_T startcol; ++ int regstart; ++ char_u *match_text; ++ { ++ colnr_T col = startcol; ++ int c1, c2; ++ int len1, len2; ++ int match; ++ ++ for (;;) ++ { ++ match = TRUE; ++ len2 = MB_CHAR2LEN(regstart); /* skip regstart */ ++ for (len1 = 0; match_text[len1] != NUL; len1 += MB_CHAR2LEN(c1)) ++ { ++ c1 = PTR2CHAR(match_text + len1); ++ c2 = PTR2CHAR(regline + col + len2); ++ if (c1 != c2 && (!ireg_ic || MB_TOLOWER(c1) != MB_TOLOWER(c2))) ++ { ++ match = FALSE; ++ break; ++ } ++ len2 += MB_CHAR2LEN(c2); ++ } ++ if (match ++ #ifdef FEAT_MBYTE ++ /* check that no composing char follows */ ++ && !(enc_utf8 ++ && utf_iscomposing(PTR2CHAR(regline + col + len2))) ++ #endif ++ ) ++ { ++ cleanup_subexpr(); ++ if (REG_MULTI) ++ { ++ reg_startpos[0].lnum = reglnum; ++ reg_startpos[0].col = col; ++ reg_endpos[0].lnum = reglnum; ++ reg_endpos[0].col = col + len2; ++ } ++ else ++ { ++ reg_startp[0] = regline + col; ++ reg_endp[0] = regline + col + len2; ++ } ++ return 1L; ++ } ++ ++ /* Try finding regstart after the current match. */ ++ col += MB_CHAR2LEN(regstart); /* skip regstart */ ++ if (skip_to_start(regstart, &col) == FAIL) ++ break; ++ } ++ return 0L; ++ } ++ ++ /* + * Main matching routine. + * + * Run NFA to determine whether it matches reginput. +*************** +*** 5584,5600 **** + #endif + + reginput = regline + col; +- need_clear_subexpr = TRUE; +- #ifdef FEAT_SYN_HL +- /* Clear the external match subpointers if necessary. */ +- if (prog->reghasz == REX_SET) +- { +- nfa_has_zsubexpr = TRUE; +- need_clear_zsubexpr = TRUE; +- } +- else +- nfa_has_zsubexpr = FALSE; +- #endif + + #ifdef ENABLE_LOG + f = fopen(NFA_REGEXP_RUN_LOG, "a"); +--- 5701,5706 ---- +*************** +*** 5764,5775 **** +--- 5870,5900 ---- + if (prog->reganch && col > 0) + return 0L; + ++ need_clear_subexpr = TRUE; ++ #ifdef FEAT_SYN_HL ++ /* Clear the external match subpointers if necessary. */ ++ if (prog->reghasz == REX_SET) ++ { ++ nfa_has_zsubexpr = TRUE; ++ need_clear_zsubexpr = TRUE; ++ } ++ else ++ nfa_has_zsubexpr = FALSE; ++ #endif ++ + if (prog->regstart != NUL) ++ { + /* Skip ahead until a character we know the match must start with. + * When there is none there is no match. */ + if (skip_to_start(prog->regstart, &col) == FAIL) + return 0L; + ++ /* If match_text is set it contains the full text that must match. ++ * Nothing else to try. Doesn't handle combining chars well. */ ++ if (prog->match_text != NULL && !ireg_icombine) ++ return find_match_text(col, prog->regstart, prog->match_text); ++ } ++ + /* If the start column is past the maximum column: no need to try. */ + if (ireg_maxcol > 0 && col >= ireg_maxcol) + goto theend; +*************** +*** 5876,5881 **** +--- 6001,6008 ---- + prog->reganch = nfa_get_reganch(prog->start, 0); + prog->regstart = nfa_get_regstart(prog->start, 0); + ++ prog->match_text = nfa_get_match_text(prog->start); ++ + #ifdef ENABLE_LOG + nfa_postfix_dump(expr, OK); + nfa_dump(prog); +*************** +*** 5885,5891 **** + prog->reghasz = re_has_z; + #endif + #ifdef DEBUG +! prog->pattern = vim_strsave(expr); /* memory will leak */ + nfa_regengine.expr = NULL; + #endif + +--- 6012,6018 ---- + prog->reghasz = re_has_z; + #endif + #ifdef DEBUG +! prog->pattern = vim_strsave(expr); + nfa_regengine.expr = NULL; + #endif + +*************** +*** 5907,5912 **** +--- 6034,6055 ---- + goto out; + } + ++ /* ++ * Free a compiled regexp program, returned by nfa_regcomp(). ++ */ ++ static void ++ nfa_regfree(prog) ++ regprog_T *prog; ++ { ++ if (prog != NULL) ++ { ++ vim_free(((nfa_regprog_T *)prog)->match_text); ++ #ifdef DEBUG ++ vim_free(((nfa_regprog_T *)prog)->pattern); ++ #endif ++ vim_free(prog); ++ } ++ } + + /* + * Match a regexp against a string. +*** ../vim-7.3.1148/src/proto/regexp.pro 2010-08-15 21:57:28.000000000 +0200 +--- src/proto/regexp.pro 2013-06-08 15:41:49.000000000 +0200 +*************** +*** 2,17 **** + int re_multiline __ARGS((regprog_T *prog)); + int re_lookbehind __ARGS((regprog_T *prog)); + char_u *skip_regexp __ARGS((char_u *startp, int dirc, int magic, char_u **newp)); +- regprog_T *vim_regcomp __ARGS((char_u *expr, int re_flags)); + int vim_regcomp_had_eol __ARGS((void)); + void free_regexp_stuff __ARGS((void)); +- int vim_regexec __ARGS((regmatch_T *rmp, char_u *line, colnr_T col)); +- int vim_regexec_nl __ARGS((regmatch_T *rmp, char_u *line, colnr_T col)); +- long vim_regexec_multi __ARGS((regmmatch_T *rmp, win_T *win, buf_T *buf, linenr_T lnum, colnr_T col, proftime_T *tm)); + reg_extmatch_T *ref_extmatch __ARGS((reg_extmatch_T *em)); + void unref_extmatch __ARGS((reg_extmatch_T *em)); + char_u *regtilde __ARGS((char_u *source, int magic)); + int vim_regsub __ARGS((regmatch_T *rmp, char_u *source, char_u *dest, int copy, int magic, int backslash)); + int vim_regsub_multi __ARGS((regmmatch_T *rmp, linenr_T lnum, char_u *source, char_u *dest, int copy, int magic, int backslash)); + char_u *reg_submatch __ARGS((int no)); + /* vim: set ft=c : */ +--- 2,18 ---- + int re_multiline __ARGS((regprog_T *prog)); + int re_lookbehind __ARGS((regprog_T *prog)); + char_u *skip_regexp __ARGS((char_u *startp, int dirc, int magic, char_u **newp)); + int vim_regcomp_had_eol __ARGS((void)); + void free_regexp_stuff __ARGS((void)); + reg_extmatch_T *ref_extmatch __ARGS((reg_extmatch_T *em)); + void unref_extmatch __ARGS((reg_extmatch_T *em)); + char_u *regtilde __ARGS((char_u *source, int magic)); + int vim_regsub __ARGS((regmatch_T *rmp, char_u *source, char_u *dest, int copy, int magic, int backslash)); + int vim_regsub_multi __ARGS((regmmatch_T *rmp, linenr_T lnum, char_u *source, char_u *dest, int copy, int magic, int backslash)); + char_u *reg_submatch __ARGS((int no)); ++ regprog_T *vim_regcomp __ARGS((char_u *expr_arg, int re_flags)); ++ void vim_regfree __ARGS((regprog_T *prog)); ++ int vim_regexec __ARGS((regmatch_T *rmp, char_u *line, colnr_T col)); ++ int vim_regexec_nl __ARGS((regmatch_T *rmp, char_u *line, colnr_T col)); ++ long vim_regexec_multi __ARGS((regmmatch_T *rmp, win_T *win, buf_T *buf, linenr_T lnum, colnr_T col, proftime_T *tm)); + /* vim: set ft=c : */ +*** ../vim-7.3.1148/src/buffer.c 2013-06-07 20:17:06.000000000 +0200 +--- src/buffer.c 2013-06-08 16:06:38.000000000 +0200 +*************** +*** 1898,1904 **** + #ifdef FEAT_SPELL + clear_string_option(&buf->b_s.b_p_spc); + clear_string_option(&buf->b_s.b_p_spf); +! vim_free(buf->b_s.b_cap_prog); + buf->b_s.b_cap_prog = NULL; + clear_string_option(&buf->b_s.b_p_spl); + #endif +--- 1898,1904 ---- + #ifdef FEAT_SPELL + clear_string_option(&buf->b_s.b_p_spc); + clear_string_option(&buf->b_s.b_p_spf); +! vim_regfree(buf->b_s.b_cap_prog); + buf->b_s.b_cap_prog = NULL; + clear_string_option(&buf->b_s.b_p_spl); + #endif +*************** +*** 2246,2252 **** + match = buf->b_fnum; /* remember first match */ + } + +! vim_free(prog); + if (match >= 0) /* found one match */ + break; + } +--- 2246,2252 ---- + match = buf->b_fnum; /* remember first match */ + } + +! vim_regfree(prog); + if (match >= 0) /* found one match */ + break; + } +*************** +*** 2355,2368 **** + *file = (char_u **)alloc((unsigned)(count * sizeof(char_u *))); + if (*file == NULL) + { +! vim_free(prog); + if (patc != pat) + vim_free(patc); + return FAIL; + } + } + } +! vim_free(prog); + if (count) /* match(es) found, break here */ + break; + } +--- 2355,2368 ---- + *file = (char_u **)alloc((unsigned)(count * sizeof(char_u *))); + if (*file == NULL) + { +! vim_regfree(prog); + if (patc != pat) + vim_free(patc); + return FAIL; + } + } + } +! vim_regfree(prog); + if (count) /* match(es) found, break here */ + break; + } +*** ../vim-7.3.1148/src/edit.c 2013-05-19 21:15:08.000000000 +0200 +--- src/edit.c 2013-06-08 15:46:43.000000000 +0200 +*************** +*** 3134,3140 **** + + theend: + p_scs = save_p_scs; +! vim_free(regmatch.regprog); + vim_free(buf); + } + +--- 3134,3140 ---- + + theend: + p_scs = save_p_scs; +! vim_regfree(regmatch.regprog); + vim_free(buf); + } + +*** ../vim-7.3.1148/src/eval.c 2013-06-06 21:31:02.000000000 +0200 +--- src/eval.c 2013-06-08 15:48:23.000000000 +0200 +*************** +*** 4560,4566 **** + if (regmatch.regprog != NULL) + { + n1 = vim_regexec_nl(®match, s1, (colnr_T)0); +! vim_free(regmatch.regprog); + if (type == TYPE_NOMATCH) + n1 = !n1; + } +--- 4560,4566 ---- + if (regmatch.regprog != NULL) + { + n1 = vim_regexec_nl(®match, s1, (colnr_T)0); +! vim_regfree(regmatch.regprog); + if (type == TYPE_NOMATCH) + n1 = !n1; + } +*************** +*** 13981,13987 **** + rettv->vval.v_number += (varnumber_T)(str - expr); + } + } +! vim_free(regmatch.regprog); + } + + theend: +--- 13981,13987 ---- + rettv->vval.v_number += (varnumber_T)(str - expr); + } + } +! vim_regfree(regmatch.regprog); + } + + theend: +*************** +*** 17214,17220 **** + str = regmatch.endp[0]; + } + +! vim_free(regmatch.regprog); + } + + p_cpo = save_cpo; +--- 17214,17220 ---- + str = regmatch.endp[0]; + } + +! vim_regfree(regmatch.regprog); + } + + p_cpo = save_cpo; +*************** +*** 21066,21072 **** + list_func_head(fp, FALSE); + } + } +! vim_free(regmatch.regprog); + } + } + if (*p == '/') +--- 21066,21072 ---- + list_func_head(fp, FALSE); + } + } +! vim_regfree(regmatch.regprog); + } + } + if (*p == '/') +*************** +*** 24220,24226 **** + if (ga.ga_data != NULL) + STRCPY((char *)ga.ga_data + ga.ga_len, tail); + +! vim_free(regmatch.regprog); + } + + ret = vim_strsave(ga.ga_data == NULL ? str : (char_u *)ga.ga_data); +--- 24220,24226 ---- + if (ga.ga_data != NULL) + STRCPY((char *)ga.ga_data + ga.ga_len, tail); + +! vim_regfree(regmatch.regprog); + } + + ret = vim_strsave(ga.ga_data == NULL ? str : (char_u *)ga.ga_data); +*** ../vim-7.3.1148/src/ex_cmds.c 2013-05-30 11:43:11.000000000 +0200 +--- src/ex_cmds.c 2013-06-08 16:07:02.000000000 +0200 +*************** +*** 571,577 **** + vim_free(nrs); + vim_free(sortbuf1); + vim_free(sortbuf2); +! vim_free(regmatch.regprog); + if (got_int) + EMSG(_(e_interr)); + } +--- 571,577 ---- + vim_free(nrs); + vim_free(sortbuf1); + vim_free(sortbuf2); +! vim_regfree(regmatch.regprog); + if (got_int) + EMSG(_(e_interr)); + } +*************** +*** 5261,5267 **** + changed_window_setting(); + #endif + +! vim_free(regmatch.regprog); + } + + /* +--- 5261,5267 ---- + changed_window_setting(); + #endif + +! vim_regfree(regmatch.regprog); + } + + /* +*************** +*** 5436,5442 **** + global_exe(cmd); + + ml_clearmarked(); /* clear rest of the marks */ +! vim_free(regmatch.regprog); + } + + /* +--- 5436,5442 ---- + global_exe(cmd); + + ml_clearmarked(); /* clear rest of the marks */ +! vim_regfree(regmatch.regprog); + } + + /* +*** ../vim-7.3.1148/src/ex_cmds2.c 2013-06-06 14:01:35.000000000 +0200 +--- src/ex_cmds2.c 2013-06-08 15:49:57.000000000 +0200 +*************** +*** 652,658 **** + while (gap->ga_len > 0) + { + vim_free(DEBUGGY(gap, todel).dbg_name); +! vim_free(DEBUGGY(gap, todel).dbg_prog); + --gap->ga_len; + if (todel < gap->ga_len) + mch_memmove(&DEBUGGY(gap, todel), &DEBUGGY(gap, todel + 1), +--- 652,658 ---- + while (gap->ga_len > 0) + { + vim_free(DEBUGGY(gap, todel).dbg_name); +! vim_regfree(DEBUGGY(gap, todel).dbg_prog); + --gap->ga_len; + if (todel < gap->ga_len) + mch_memmove(&DEBUGGY(gap, todel), &DEBUGGY(gap, todel + 1), +*************** +*** 1985,1991 **** + --match; + } + +! vim_free(regmatch.regprog); + vim_free(p); + if (!didone) + EMSG2(_(e_nomatch2), ((char_u **)new_ga.ga_data)[i]); +--- 1985,1991 ---- + --match; + } + +! vim_regfree(regmatch.regprog); + vim_free(p); + if (!didone) + EMSG2(_(e_nomatch2), ((char_u **)new_ga.ga_data)[i]); +*** ../vim-7.3.1148/src/ex_docmd.c 2013-06-08 15:24:41.000000000 +0200 +--- src/ex_docmd.c 2013-06-08 15:50:07.000000000 +0200 +*************** +*** 7779,7785 **** + curwin->w_cursor.col = (colnr_T)(regmatch.startp[0] - p); + else + EMSG(_(e_nomatch)); +! vim_free(regmatch.regprog); + } + /* Move to the NUL, ignore any other arguments. */ + eap->arg += STRLEN(eap->arg); +--- 7779,7785 ---- + curwin->w_cursor.col = (colnr_T)(regmatch.startp[0] - p); + else + EMSG(_(e_nomatch)); +! vim_regfree(regmatch.regprog); + } + /* Move to the NUL, ignore any other arguments. */ + eap->arg += STRLEN(eap->arg); +*** ../vim-7.3.1148/src/ex_eval.c 2013-05-06 04:21:35.000000000 +0200 +--- src/ex_eval.c 2013-06-08 15:50:28.000000000 +0200 +*************** +*** 1576,1582 **** + caught = vim_regexec_nl(®match, current_exception->value, + (colnr_T)0); + got_int |= prev_got_int; +! vim_free(regmatch.regprog); + } + } + } +--- 1576,1582 ---- + caught = vim_regexec_nl(®match, current_exception->value, + (colnr_T)0); + got_int |= prev_got_int; +! vim_regfree(regmatch.regprog); + } + } + } +*** ../vim-7.3.1148/src/ex_getln.c 2013-06-08 15:24:41.000000000 +0200 +--- src/ex_getln.c 2013-06-08 15:51:13.000000000 +0200 +*************** +*** 4717,4723 **** + } + } + +! vim_free(regmatch.regprog); + + return ret; + #endif /* FEAT_CMDL_COMPL */ +--- 4717,4723 ---- + } + } + +! vim_regfree(regmatch.regprog); + + return ret; + #endif /* FEAT_CMDL_COMPL */ +*************** +*** 5785,5791 **** + if (history[histype][idx].hisstr == NULL) + hisidx[histype] = -1; + } +! vim_free(regmatch.regprog); + return found; + } + +--- 5785,5791 ---- + if (history[histype][idx].hisstr == NULL) + hisidx[histype] = -1; + } +! vim_regfree(regmatch.regprog); + return found; + } + +*** ../vim-7.3.1148/src/fileio.c 2013-05-06 04:50:26.000000000 +0200 +--- src/fileio.c 2013-06-08 15:52:10.000000000 +0200 +*************** +*** 7921,7927 **** + if (ap->pat == NULL) + { + *prev_ap = ap->next; +! vim_free(ap->reg_prog); + vim_free(ap); + } + else +--- 7921,7927 ---- + if (ap->pat == NULL) + { + *prev_ap = ap->next; +! vim_regfree(ap->reg_prog); + vim_free(ap); + } + else +*************** +*** 10070,10076 **** + result = TRUE; + + if (prog == NULL) +! vim_free(regmatch.regprog); + return result; + } + #endif +--- 10070,10076 ---- + result = TRUE; + + if (prog == NULL) +! vim_regfree(regmatch.regprog); + return result; + } + #endif +*** ../vim-7.3.1148/src/gui.c 2013-05-06 04:21:35.000000000 +0200 +--- src/gui.c 2013-06-08 15:52:24.000000000 +0200 +*************** +*** 5319,5325 **** + } + else + MSG(_("No match at cursor, finding next")); +! vim_free(regmatch.regprog); + } + } + +--- 5319,5325 ---- + } + else + MSG(_("No match at cursor, finding next")); +! vim_regfree(regmatch.regprog); + } + } + +*** ../vim-7.3.1148/src/misc1.c 2013-06-05 19:35:31.000000000 +0200 +--- src/misc1.c 2013-06-08 15:53:36.000000000 +0200 +*************** +*** 456,463 **** + pos.coladd = 0; + #endif + } + } +- vim_free(regmatch.regprog); + + if (pos.lnum == 0 || *ml_get_pos(&pos) == NUL) + return -1; +--- 456,463 ---- + pos.coladd = 0; + #endif + } ++ vim_regfree(regmatch.regprog); + } + + if (pos.lnum == 0 || *ml_get_pos(&pos) == NUL) + return -1; +*************** +*** 9751,9757 **** + # endif + #endif + vim_free(buf); +! vim_free(regmatch.regprog); + vim_free(matchname); + + matches = gap->ga_len - start_len; +--- 9751,9757 ---- + # endif + #endif + vim_free(buf); +! vim_regfree(regmatch.regprog); + vim_free(matchname); + + matches = gap->ga_len - start_len; +*************** +*** 9993,9999 **** + } + + vim_free(buf); +! vim_free(regmatch.regprog); + + matches = gap->ga_len - start_len; + if (matches > 0) +--- 9993,9999 ---- + } + + vim_free(buf); +! vim_regfree(regmatch.regprog); + + matches = gap->ga_len - start_len; + if (matches > 0) +*************** +*** 10358,10364 **** + vim_free(in_curdir); + } + ga_clear_strings(&path_ga); +! vim_free(regmatch.regprog); + + if (sort_again) + remove_duplicates(gap); +--- 10358,10364 ---- + vim_free(in_curdir); + } + ga_clear_strings(&path_ga); +! vim_regfree(regmatch.regprog); + + if (sort_again) + remove_duplicates(gap); +*** ../vim-7.3.1148/src/misc2.c 2013-05-06 04:21:35.000000000 +0200 +--- src/misc2.c 2013-06-08 16:07:33.000000000 +0200 +*************** +*** 1134,1140 **** + /* Free some global vars. */ + vim_free(username); + # ifdef FEAT_CLIPBOARD +! vim_free(clip_exclude_prog); + # endif + vim_free(last_cmdline); + # ifdef FEAT_CMDHIST +--- 1134,1140 ---- + /* Free some global vars. */ + vim_free(username); + # ifdef FEAT_CLIPBOARD +! vim_regfree(clip_exclude_prog); + # endif + vim_free(last_cmdline); + # ifdef FEAT_CMDHIST +*************** +*** 5008,5015 **** + #endif + { + /* +! * we don't have further wildcards to expand, so we have to +! * check for the final file now + */ + for (i = stackp->ffs_filearray_cur; + i < stackp->ffs_filearray_size; ++i) +--- 5008,5015 ---- + #endif + { + /* +! * We don't have further wildcards to expand, so we have to +! * check for the final file now. + */ + for (i = stackp->ffs_filearray_cur; + i < stackp->ffs_filearray_size; ++i) +*** ../vim-7.3.1148/src/option.c 2013-06-04 22:13:45.000000000 +0200 +--- src/option.c 2013-06-08 16:30:58.000000000 +0200 +*************** +*** 7491,7497 **** + clip_autoselect_plus = new_autoselect_plus; + clip_autoselectml = new_autoselectml; + clip_html = new_html; +! vim_free(clip_exclude_prog); + clip_exclude_prog = new_exclude_prog; + #ifdef FEAT_GUI_GTK + if (gui.in_use) +--- 7491,7497 ---- + clip_autoselect_plus = new_autoselect_plus; + clip_autoselectml = new_autoselectml; + clip_html = new_html; +! vim_regfree(clip_exclude_prog); + clip_exclude_prog = new_exclude_prog; + #ifdef FEAT_GUI_GTK + if (gui.in_use) +*************** +*** 7502,7508 **** + #endif + } + else +! vim_free(new_exclude_prog); + + return errmsg; + } +--- 7502,7508 ---- + #endif + } + else +! vim_regfree(new_exclude_prog); + + return errmsg; + } +*************** +*** 7529,7544 **** + if (re != NULL) + { + synblock->b_cap_prog = vim_regcomp(re, RE_MAGIC); + if (synblock->b_cap_prog == NULL) + { + synblock->b_cap_prog = rp; /* restore the previous program */ + return e_invarg; + } +- vim_free(re); + } + } + +! vim_free(rp); + return NULL; + } + #endif +--- 7529,7544 ---- + if (re != NULL) + { + synblock->b_cap_prog = vim_regcomp(re, RE_MAGIC); ++ vim_free(re); + if (synblock->b_cap_prog == NULL) + { + synblock->b_cap_prog = rp; /* restore the previous program */ + return e_invarg; + } + } + } + +! vim_regfree(rp); + return NULL; + } + #endif +*** ../vim-7.3.1148/src/syntax.c 2013-06-08 15:24:41.000000000 +0200 +--- src/syntax.c 2013-06-08 16:10:08.000000000 +0200 +*************** +*** 3495,3501 **** + block->b_syn_sync_maxlines = 0; + block->b_syn_sync_linebreaks = 0; + +! vim_free(block->b_syn_linecont_prog); + block->b_syn_linecont_prog = NULL; + vim_free(block->b_syn_linecont_pat); + block->b_syn_linecont_pat = NULL; +--- 3495,3501 ---- + block->b_syn_sync_maxlines = 0; + block->b_syn_sync_linebreaks = 0; + +! vim_regfree(block->b_syn_linecont_prog); + block->b_syn_linecont_prog = NULL; + vim_free(block->b_syn_linecont_pat); + block->b_syn_linecont_pat = NULL; +*************** +*** 3544,3550 **** + curwin->w_s->b_syn_sync_maxlines = 0; + curwin->w_s->b_syn_sync_linebreaks = 0; + +! vim_free(curwin->w_s->b_syn_linecont_prog); + curwin->w_s->b_syn_linecont_prog = NULL; + vim_free(curwin->w_s->b_syn_linecont_pat); + curwin->w_s->b_syn_linecont_pat = NULL; +--- 3544,3550 ---- + curwin->w_s->b_syn_sync_maxlines = 0; + curwin->w_s->b_syn_sync_linebreaks = 0; + +! vim_regfree(curwin->w_s->b_syn_linecont_prog); + curwin->w_s->b_syn_linecont_prog = NULL; + vim_free(curwin->w_s->b_syn_linecont_pat); + curwin->w_s->b_syn_linecont_pat = NULL; +*************** +*** 3583,3589 **** + int i; + { + vim_free(SYN_ITEMS(block)[i].sp_pattern); +! vim_free(SYN_ITEMS(block)[i].sp_prog); + /* Only free sp_cont_list and sp_next_list of first start pattern */ + if (i == 0 || SYN_ITEMS(block)[i - 1].sp_type != SPTYPE_START) + { +--- 3583,3589 ---- + int i; + { + vim_free(SYN_ITEMS(block)[i].sp_pattern); +! vim_regfree(SYN_ITEMS(block)[i].sp_prog); + /* Only free sp_cont_list and sp_next_list of first start pattern */ + if (i == 0 || SYN_ITEMS(block)[i - 1].sp_type != SPTYPE_START) + { +*************** +*** 4991,4997 **** + /* + * Something failed, free the allocated memory. + */ +! vim_free(item.sp_prog); + vim_free(item.sp_pattern); + vim_free(syn_opt_arg.cont_list); + vim_free(syn_opt_arg.cont_in_list); +--- 4991,4997 ---- + /* + * Something failed, free the allocated memory. + */ +! vim_regfree(item.sp_prog); + vim_free(item.sp_pattern); + vim_free(syn_opt_arg.cont_list); + vim_free(syn_opt_arg.cont_in_list); +*************** +*** 5248,5254 **** + { + if (!success) + { +! vim_free(ppp->pp_synp->sp_prog); + vim_free(ppp->pp_synp->sp_pattern); + } + vim_free(ppp->pp_synp); +--- 5248,5254 ---- + { + if (!success) + { +! vim_regfree(ppp->pp_synp->sp_prog); + vim_free(ppp->pp_synp->sp_pattern); + } + vim_free(ppp->pp_synp); +*************** +*** 6022,6028 **** + id = -1; /* remember that we found one */ + } + } +! vim_free(regmatch.regprog); + } + } + vim_free(name); +--- 6022,6028 ---- + id = -1; /* remember that we found one */ + } + } +! vim_regfree(regmatch.regprog); + } + } + vim_free(name); +*************** +*** 6295,6301 **** + curwin->w_p_spell = FALSE; /* No spell checking */ + clear_string_option(&curwin->w_s->b_p_spc); + clear_string_option(&curwin->w_s->b_p_spf); +! vim_free(curwin->w_s->b_cap_prog); + curwin->w_s->b_cap_prog = NULL; + clear_string_option(&curwin->w_s->b_p_spl); + #endif +--- 6295,6301 ---- + curwin->w_p_spell = FALSE; /* No spell checking */ + clear_string_option(&curwin->w_s->b_p_spc); + clear_string_option(&curwin->w_s->b_p_spf); +! vim_regfree(curwin->w_s->b_cap_prog); + curwin->w_s->b_cap_prog = NULL; + clear_string_option(&curwin->w_s->b_p_spl); + #endif +*** ../vim-7.3.1148/src/quickfix.c 2013-05-11 15:50:02.000000000 +0200 +--- src/quickfix.c 2013-06-08 15:57:08.000000000 +0200 +*************** +*** 863,869 **** + for (fmt_ptr = fmt_first; fmt_ptr != NULL; fmt_ptr = fmt_first) + { + fmt_first = fmt_ptr->next; +! vim_free(fmt_ptr->prog); + vim_free(fmt_ptr); + } + qf_clean_dir_stack(&dir_stack); +--- 863,869 ---- + for (fmt_ptr = fmt_first; fmt_ptr != NULL; fmt_ptr = fmt_first) + { + fmt_first = fmt_ptr->next; +! vim_regfree(fmt_ptr->prog); + vim_free(fmt_ptr); + } + qf_clean_dir_stack(&dir_stack); +*************** +*** 3487,3493 **** + vim_free(dirname_now); + vim_free(dirname_start); + vim_free(target_dir); +! vim_free(regmatch.regprog); + } + + /* +--- 3487,3493 ---- + vim_free(dirname_now); + vim_free(dirname_start); + vim_free(target_dir); +! vim_regfree(regmatch.regprog); + } + + /* +*************** +*** 4178,4184 **** + } + } + +! vim_free(regmatch.regprog); + #ifdef FEAT_MBYTE + if (vc.vc_type != CONV_NONE) + convert_setup(&vc, NULL, NULL); +--- 4178,4184 ---- + } + } + +! vim_regfree(regmatch.regprog); + #ifdef FEAT_MBYTE + if (vc.vc_type != CONV_NONE) + convert_setup(&vc, NULL, NULL); +*** ../vim-7.3.1148/src/search.c 2013-05-06 04:21:35.000000000 +0200 +--- src/search.c 2013-06-08 15:59:38.000000000 +0200 +*************** +*** 972,978 **** + } + while (--count > 0 && found); /* stop after count matches or no match */ + +! vim_free(regmatch.regprog); + + called_emsg |= save_called_emsg; + +--- 972,978 ---- + } + while (--count > 0 && found); /* stop after count matches or no match */ + +! vim_regfree(regmatch.regprog); + + called_emsg |= save_called_emsg; + +*************** +*** 4680,4686 **** + } + + called_emsg |= save_called_emsg; +! vim_free(regmatch.regprog); + return result; + } + #endif /* FEAT_VISUAL */ +--- 4680,4686 ---- + } + + called_emsg |= save_called_emsg; +! vim_regfree(regmatch.regprog); + return result; + } + #endif /* FEAT_VISUAL */ +*************** +*** 5402,5410 **** + + fpip_end: + vim_free(file_line); +! vim_free(regmatch.regprog); +! vim_free(incl_regmatch.regprog); +! vim_free(def_regmatch.regprog); + } + + static void +--- 5402,5410 ---- + + fpip_end: + vim_free(file_line); +! vim_regfree(regmatch.regprog); +! vim_regfree(incl_regmatch.regprog); +! vim_regfree(def_regmatch.regprog); + } + + static void +*** ../vim-7.3.1148/src/spell.c 2013-05-06 04:21:35.000000000 +0200 +--- src/spell.c 2013-06-08 16:10:52.000000000 +0200 +*************** +*** 2658,2664 **** + ga_clear(gap); + + for (i = 0; i < lp->sl_prefixcnt; ++i) +! vim_free(lp->sl_prefprog[i]); + lp->sl_prefixcnt = 0; + vim_free(lp->sl_prefprog); + lp->sl_prefprog = NULL; +--- 2658,2664 ---- + ga_clear(gap); + + for (i = 0; i < lp->sl_prefixcnt; ++i) +! vim_regfree(lp->sl_prefprog[i]); + lp->sl_prefixcnt = 0; + vim_free(lp->sl_prefprog); + lp->sl_prefprog = NULL; +*************** +*** 2669,2675 **** + vim_free(lp->sl_midword); + lp->sl_midword = NULL; + +! vim_free(lp->sl_compprog); + vim_free(lp->sl_comprules); + vim_free(lp->sl_compstartflags); + vim_free(lp->sl_compallflags); +--- 2669,2675 ---- + vim_free(lp->sl_midword); + lp->sl_midword = NULL; + +! vim_regfree(lp->sl_compprog); + vim_free(lp->sl_comprules); + vim_free(lp->sl_compstartflags); + vim_free(lp->sl_compallflags); +*************** +*** 5802,5808 **** + { + sprintf((char *)buf, "^%s", + aff_entry->ae_cond); +! vim_free(aff_entry->ae_prog); + aff_entry->ae_prog = vim_regcomp( + buf, RE_MAGIC + RE_STRING); + } +--- 5802,5808 ---- + { + sprintf((char *)buf, "^%s", + aff_entry->ae_cond); +! vim_regfree(aff_entry->ae_prog); + aff_entry->ae_prog = vim_regcomp( + buf, RE_MAGIC + RE_STRING); + } +*************** +*** 6507,6513 **** + --todo; + ah = HI2AH(hi); + for (ae = ah->ah_first; ae != NULL; ae = ae->ae_next) +! vim_free(ae->ae_prog); + } + } + if (ht == &aff->af_suff) +--- 6507,6513 ---- + --todo; + ah = HI2AH(hi); + for (ae = ah->ah_first; ae != NULL; ae = ae->ae_next) +! vim_regfree(ae->ae_prog); + } + } + if (ht == &aff->af_suff) +*** ../vim-7.3.1148/src/tag.c 2012-09-12 18:19:39.000000000 +0200 +--- src/tag.c 2013-06-08 16:03:31.000000000 +0200 +*************** +*** 2491,2497 **** + + findtag_end: + vim_free(lbuf); +! vim_free(orgpat.regmatch.regprog); + vim_free(tag_fname); + #ifdef FEAT_EMACS_TAGS + vim_free(ebuf); +--- 2491,2497 ---- + + findtag_end: + vim_free(lbuf); +! vim_regfree(orgpat.regmatch.regprog); + vim_free(tag_fname); + #ifdef FEAT_EMACS_TAGS + vim_free(ebuf); +*** ../vim-7.3.1148/src/window.c 2013-05-18 20:55:31.000000000 +0200 +--- src/window.c 2013-06-08 16:03:54.000000000 +0200 +*************** +*** 6818,6824 **** + wp->w_match_head = cur->next; + else + prev->next = cur->next; +! vim_free(cur->match.regprog); + vim_free(cur->pattern); + vim_free(cur); + redraw_later(SOME_VALID); +--- 6818,6824 ---- + wp->w_match_head = cur->next; + else + prev->next = cur->next; +! vim_regfree(cur->match.regprog); + vim_free(cur->pattern); + vim_free(cur); + redraw_later(SOME_VALID); +*************** +*** 6837,6843 **** + while (wp->w_match_head != NULL) + { + m = wp->w_match_head->next; +! vim_free(wp->w_match_head->match.regprog); + vim_free(wp->w_match_head->pattern); + vim_free(wp->w_match_head); + wp->w_match_head = m; +--- 6837,6843 ---- + while (wp->w_match_head != NULL) + { + m = wp->w_match_head->next; +! vim_regfree(wp->w_match_head->match.regprog); + vim_free(wp->w_match_head->pattern); + vim_free(wp->w_match_head); + wp->w_match_head = m; +*** ../vim-7.3.1148/src/screen.c 2013-06-07 20:17:06.000000000 +0200 +--- src/screen.c 2013-06-08 16:09:18.000000000 +0200 +*************** +*** 7082,7088 **** + { + if (search_hl.rm.regprog != NULL) + { +! vim_free(search_hl.rm.regprog); + search_hl.rm.regprog = NULL; + } + } +--- 7082,7088 ---- + { + if (search_hl.rm.regprog != NULL) + { +! vim_regfree(search_hl.rm.regprog); + search_hl.rm.regprog = NULL; + } + } +*************** +*** 7284,7290 **** + if (shl == &search_hl) + { + /* don't free regprog in the match list, it's a copy */ +! vim_free(shl->rm.regprog); + no_hlsearch = TRUE; + } + shl->rm.regprog = NULL; +--- 7284,7290 ---- + if (shl == &search_hl) + { + /* don't free regprog in the match list, it's a copy */ +! vim_regfree(shl->rm.regprog); + no_hlsearch = TRUE; + } + shl->rm.regprog = NULL; +*** ../vim-7.3.1148/src/macros.h 2012-07-19 17:18:21.000000000 +0200 +--- src/macros.h 2013-06-08 16:53:34.000000000 +0200 +*************** +*** 272,277 **** +--- 272,278 ---- + + # define MB_COPY_CHAR(f, t) if (has_mbyte) mb_copy_char(&f, &t); else *t++ = *f++ + # define MB_CHARLEN(p) (has_mbyte ? mb_charlen(p) : (int)STRLEN(p)) ++ # define MB_CHAR2LEN(c) (has_mbyte ? mb_char2len(c) : 1) + # define PTR2CHAR(p) (has_mbyte ? mb_ptr2char(p) : (int)*(p)) + #else + # define MB_PTR2LEN(p) 1 +*************** +*** 280,285 **** +--- 281,287 ---- + # define mb_ptr_back(s, p) --p + # define MB_COPY_CHAR(f, t) *t++ = *f++ + # define MB_CHARLEN(p) STRLEN(p) ++ # define MB_CHAR2LEN(c) 1 + # define PTR2CHAR(p) ((int)*(p)) + #endif + +*** ../vim-7.3.1148/src/testdir/test64.in 2013-06-05 18:52:36.000000000 +0200 +--- src/testdir/test64.in 2013-06-08 13:05:08.000000000 +0200 +*************** +*** 260,265 **** +--- 260,267 ---- + :call add(tl, [2, '[^[:alpha:]]\+','abcccadfoij7787ysf287yrnccdu','7787']) + :call add(tl, [2, '[-a]', '-', '-']) + :call add(tl, [2, '[a-]', '-', '-']) ++ :call add(tl, [2, '[a-f]*\c','ABCDEFGH','ABCDEF']) ++ :call add(tl, [2, '[abc][xyz]\c','-af-AF-BY--','BY']) + :" filename regexp + :call add(tl, [2, '[-./[:alnum:]_~]\+', 'log13.file', 'log13.file']) + :" special chars +*************** +*** 385,390 **** +--- 387,398 ---- + :call add(tl, [2, '\(<<\)\@2<=span.', 'xxspanxxxx', 'foobar']) ++ :call add(tl, [2, '\(foo\)\@<=\>', 'barfoo', '', 'foo']) ++ :" + :""""" \@> + :call add(tl, [2, '\(a*\)\@>a', 'aaaa']) + :call add(tl, [2, '\(a*\)\@>b', 'aaab', 'aaab', 'aaa']) +*** ../vim-7.3.1148/src/testdir/test64.ok 2013-06-05 18:52:36.000000000 +0200 +--- src/testdir/test64.ok 2013-06-08 13:16:59.000000000 +0200 +*************** +*** 584,589 **** +--- 584,595 ---- + OK 0 - [a-] + OK 1 - [a-] + OK 2 - [a-] ++ OK 0 - [a-f]*\c ++ OK 1 - [a-f]*\c ++ OK 2 - [a-f]*\c ++ OK 0 - [abc][xyz]\c ++ OK 1 - [abc][xyz]\c ++ OK 2 - [abc][xyz]\c + OK 0 - [-./[:alnum:]_~]\+ + OK 1 - [-./[:alnum:]_~]\+ + OK 2 - [-./[:alnum:]_~]\+ +*************** +*** 872,877 **** +--- 878,895 ---- + OK 0 - \(foo\)\@ ++ OK 1 - \(foo\)\@<=\> ++ OK 2 - \(foo\)\@<=\> ++ OK 0 - \(foo\)\@<=\> ++ OK 1 - \(foo\)\@<=\> ++ OK 2 - \(foo\)\@<=\> + OK 0 - \(a*\)\@>a + OK 1 - \(a*\)\@>a + OK 2 - \(a*\)\@>a +*** ../vim-7.3.1148/src/version.c 2013-06-08 15:24:41.000000000 +0200 +--- src/version.c 2013-06-08 18:09:41.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1149, + /**/ + +-- +FIXME and XXX are two common keywords used to mark broken or incomplete code +not only since XXX as a sex reference would grab everybody's attention but +simply due to the fact that Vim would highlight these words. + -- Hendrik Scholz + + /// 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 /// diff --git a/7.3.1150 b/7.3.1150 new file mode 100644 index 0000000..210b083 --- /dev/null +++ b/7.3.1150 @@ -0,0 +1,409 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1150 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1150 +Problem: New regexpengine: Slow when a look-behind match does not have a + width specified. +Solution: Try to compute the maximum width. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1149/src/regexp_nfa.c 2013-06-08 18:19:39.000000000 +0200 +--- src/regexp_nfa.c 2013-06-08 22:29:25.000000000 +0200 +*************** +*** 38,56 **** + NFA_START_COLL, /* [abc] start */ + NFA_END_COLL, /* [abc] end */ + NFA_START_NEG_COLL, /* [^abc] start */ +! NFA_END_NEG_COLL, /* [^abc] end (only used in postfix) */ +! NFA_RANGE, /* range of the two previous items (only +! * used in postfix) */ + NFA_RANGE_MIN, /* low end of a range */ + NFA_RANGE_MAX, /* high end of a range */ + +! NFA_CONCAT, /* concatenate two previous items (only +! * used in postfix) */ +! NFA_OR, +! NFA_STAR, /* greedy * */ +! NFA_STAR_NONGREEDY, /* non-greedy * */ +! NFA_QUEST, /* greedy \? */ +! NFA_QUEST_NONGREEDY, /* non-greedy \? */ + + NFA_BOL, /* ^ Begin line */ + NFA_EOL, /* $ End line */ +--- 38,56 ---- + NFA_START_COLL, /* [abc] start */ + NFA_END_COLL, /* [abc] end */ + NFA_START_NEG_COLL, /* [^abc] start */ +! NFA_END_NEG_COLL, /* [^abc] end (postfix only) */ +! NFA_RANGE, /* range of the two previous items +! * (postfix only) */ + NFA_RANGE_MIN, /* low end of a range */ + NFA_RANGE_MAX, /* high end of a range */ + +! NFA_CONCAT, /* concatenate two previous items (postfix +! * only) */ +! NFA_OR, /* \| (postfix only) */ +! NFA_STAR, /* greedy * (posfix only) */ +! NFA_STAR_NONGREEDY, /* non-greedy * (postfix only) */ +! NFA_QUEST, /* greedy \? (postfix only) */ +! NFA_QUEST_NONGREEDY, /* non-greedy \? (postfix only) */ + + NFA_BOL, /* ^ Begin line */ + NFA_EOL, /* $ End line */ +*************** +*** 153,160 **** + + /* NFA_FIRST_NL */ + NFA_ANY, /* Match any one character. */ +- NFA_ANYOF, /* Match any character in this string. */ +- NFA_ANYBUT, /* Match any character not in this string. */ + NFA_IDENT, /* Match identifier char */ + NFA_SIDENT, /* Match identifier char but no digit */ + NFA_KWORD, /* Match keyword char */ +--- 153,158 ---- +*************** +*** 496,503 **** + + /* + * Figure out if the NFA state list contains just literal text and nothing +! * else. If so return a string with what must match after regstart. +! * Otherwise return NULL. + */ + static char_u * + nfa_get_match_text(start) +--- 494,501 ---- + + /* + * Figure out if the NFA state list contains just literal text and nothing +! * else. If so return a string in allocated memory with what must match after +! * regstart. Otherwise return NULL. + */ + static char_u * + nfa_get_match_text(start) +*************** +*** 2578,2583 **** +--- 2576,2800 ---- + } + + /* ++ * Estimate the maximum byte length of anything matching "state". ++ * When unknown or unlimited return -1. ++ */ ++ static int ++ nfa_max_width(startstate, depth) ++ nfa_state_T *startstate; ++ int depth; ++ { ++ int l, r; ++ nfa_state_T *state = startstate; ++ int len = 0; ++ ++ /* detect looping in a NFA_SPLIT */ ++ if (depth > 4) ++ return -1; ++ ++ for (;;) ++ { ++ switch (state->c) ++ { ++ case NFA_END_INVISIBLE: ++ case NFA_END_INVISIBLE_NEG: ++ /* the end, return what we have */ ++ return len; ++ ++ case NFA_SPLIT: ++ /* two alternatives, use the maximum */ ++ l = nfa_max_width(state->out, depth + 1); ++ r = nfa_max_width(state->out1, depth + 1); ++ if (l < 0 || r < 0) ++ return -1; ++ return len + (l > r ? l : r); ++ ++ case NFA_ANY: ++ case NFA_START_COLL: ++ case NFA_START_NEG_COLL: ++ /* matches some character, including composing chars */ ++ #ifdef FEAT_MBYTE ++ if (enc_utf8) ++ len += MB_MAXBYTES; ++ else if (has_mbyte) ++ len += 2; ++ else ++ #endif ++ ++len; ++ if (state->c != NFA_ANY) ++ { ++ /* skip over the characters */ ++ state = state->out1->out; ++ continue; ++ } ++ break; ++ ++ case NFA_DIGIT: ++ case NFA_WHITE: ++ case NFA_HEX: ++ case NFA_OCTAL: ++ /* ascii */ ++ ++len; ++ break; ++ ++ case NFA_IDENT: ++ case NFA_SIDENT: ++ case NFA_KWORD: ++ case NFA_SKWORD: ++ case NFA_FNAME: ++ case NFA_SFNAME: ++ case NFA_PRINT: ++ case NFA_SPRINT: ++ case NFA_NWHITE: ++ case NFA_NDIGIT: ++ case NFA_NHEX: ++ case NFA_NOCTAL: ++ case NFA_WORD: ++ case NFA_NWORD: ++ case NFA_HEAD: ++ case NFA_NHEAD: ++ case NFA_ALPHA: ++ case NFA_NALPHA: ++ case NFA_LOWER: ++ case NFA_NLOWER: ++ case NFA_UPPER: ++ case NFA_NUPPER: ++ /* possibly non-ascii */ ++ #ifdef FEAT_MBYTE ++ if (has_mbyte) ++ len += 3; ++ else ++ #endif ++ ++len; ++ break; ++ ++ case NFA_START_INVISIBLE: ++ case NFA_START_INVISIBLE_NEG: ++ case NFA_START_INVISIBLE_BEFORE: ++ case NFA_START_INVISIBLE_BEFORE_NEG: ++ /* zero-width, out1 points to the END state */ ++ state = state->out1->out; ++ continue; ++ ++ case NFA_BACKREF1: ++ case NFA_BACKREF2: ++ case NFA_BACKREF3: ++ case NFA_BACKREF4: ++ case NFA_BACKREF5: ++ case NFA_BACKREF6: ++ case NFA_BACKREF7: ++ case NFA_BACKREF8: ++ case NFA_BACKREF9: ++ #ifdef FEAT_SYN_HL ++ case NFA_ZREF1: ++ case NFA_ZREF2: ++ case NFA_ZREF3: ++ case NFA_ZREF4: ++ case NFA_ZREF5: ++ case NFA_ZREF6: ++ case NFA_ZREF7: ++ case NFA_ZREF8: ++ case NFA_ZREF9: ++ #endif ++ case NFA_NEWL: ++ case NFA_SKIP: ++ /* unknown width */ ++ return -1; ++ ++ case NFA_BOL: ++ case NFA_EOL: ++ case NFA_BOF: ++ case NFA_EOF: ++ case NFA_BOW: ++ case NFA_EOW: ++ case NFA_MOPEN: ++ case NFA_MOPEN1: ++ case NFA_MOPEN2: ++ case NFA_MOPEN3: ++ case NFA_MOPEN4: ++ case NFA_MOPEN5: ++ case NFA_MOPEN6: ++ case NFA_MOPEN7: ++ case NFA_MOPEN8: ++ case NFA_MOPEN9: ++ #ifdef FEAT_SYN_HL ++ case NFA_ZOPEN: ++ case NFA_ZOPEN1: ++ case NFA_ZOPEN2: ++ case NFA_ZOPEN3: ++ case NFA_ZOPEN4: ++ case NFA_ZOPEN5: ++ case NFA_ZOPEN6: ++ case NFA_ZOPEN7: ++ case NFA_ZOPEN8: ++ case NFA_ZOPEN9: ++ case NFA_ZCLOSE: ++ case NFA_ZCLOSE1: ++ case NFA_ZCLOSE2: ++ case NFA_ZCLOSE3: ++ case NFA_ZCLOSE4: ++ case NFA_ZCLOSE5: ++ case NFA_ZCLOSE6: ++ case NFA_ZCLOSE7: ++ case NFA_ZCLOSE8: ++ case NFA_ZCLOSE9: ++ #endif ++ case NFA_MCLOSE: ++ case NFA_MCLOSE1: ++ case NFA_MCLOSE2: ++ case NFA_MCLOSE3: ++ case NFA_MCLOSE4: ++ case NFA_MCLOSE5: ++ case NFA_MCLOSE6: ++ case NFA_MCLOSE7: ++ case NFA_MCLOSE8: ++ case NFA_MCLOSE9: ++ case NFA_NOPEN: ++ case NFA_NCLOSE: ++ ++ case NFA_LNUM_GT: ++ case NFA_LNUM_LT: ++ case NFA_COL_GT: ++ case NFA_COL_LT: ++ case NFA_VCOL_GT: ++ case NFA_VCOL_LT: ++ case NFA_MARK_GT: ++ case NFA_MARK_LT: ++ case NFA_VISUAL: ++ case NFA_LNUM: ++ case NFA_CURSOR: ++ case NFA_COL: ++ case NFA_VCOL: ++ case NFA_MARK: ++ ++ case NFA_ZSTART: ++ case NFA_ZEND: ++ case NFA_OPT_CHARS: ++ case NFA_SKIP_CHAR: ++ case NFA_START_PATTERN: ++ case NFA_END_PATTERN: ++ case NFA_COMPOSING: ++ case NFA_END_COMPOSING: ++ /* zero-width */ ++ break; ++ ++ default: ++ if (state->c < 0) ++ /* don't know what this is */ ++ return -1; ++ /* normal character */ ++ len += MB_CHAR2LEN(state->c); ++ break; ++ } ++ ++ /* normal way to continue */ ++ state = state->out; ++ } ++ ++ /* unrecognized */ ++ return -1; ++ } ++ /* + * Convert a postfix form into its equivalent NFA. + * Return the NFA start state on success, NULL otherwise. + */ +*************** +*** 2856,2863 **** + s = alloc_state(start_state, e.start, s1); + if (s == NULL) + goto theend; +- if (before) +- s->val = n; /* store the count */ + if (pattern) + { + /* NFA_ZEND -> NFA_END_PATTERN -> NFA_SKIP -> what follows. */ +--- 3073,3078 ---- +*************** +*** 2871,2876 **** +--- 3086,3099 ---- + { + patch(e.out, s1); + PUSH(frag(s, list1(&s1->out))); ++ if (before) ++ { ++ if (n <= 0) ++ /* See if we can guess the maximum width, it avoids a ++ * lot of pointless tries. */ ++ n = nfa_max_width(e.start, 0); ++ s->val = n; /* store the count */ ++ } + } + break; + } +*************** +*** 4088,4096 **** + + /* Go back the specified number of bytes, or as far as the + * start of the previous line, to try matching "\@<=" or +! * not matching "\@val <= 0) + { + if (REG_MULTI) +--- 4311,4318 ---- + + /* Go back the specified number of bytes, or as far as the + * start of the previous line, to try matching "\@<=" or +! * not matching "\@val <= 0) + { + if (REG_MULTI) +*************** +*** 4386,4392 **** + + /* + * Check for a match with match_text. +! * Called after skip_to_start() has find regstart. + * Returns zero for no match, 1 for a match. + */ + static long +--- 4608,4614 ---- + + /* + * Check for a match with match_text. +! * Called after skip_to_start() has found regstart. + * Returns zero for no match, 1 for a match. + */ + static long +*************** +*** 4736,4742 **** + #ifdef FEAT_SYN_HL + || (cout >= NFA_ZCLOSE && cout <= NFA_ZCLOSE9) + #endif +- || cout == NFA_NCLOSE + || t->pim != NULL + || (t->state->c != NFA_START_INVISIBLE_BEFORE + && t->state->c != NFA_START_INVISIBLE_BEFORE_NEG +--- 4958,4963 ---- +*** ../vim-7.3.1149/src/version.c 2013-06-08 18:19:40.000000000 +0200 +--- src/version.c 2013-06-08 22:15:27.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1150, + /**/ + +-- +Amnesia is one of my favorite words, but I forgot what it means. + + /// 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 /// diff --git a/7.3.1151 b/7.3.1151 new file mode 100644 index 0000000..14298c7 --- /dev/null +++ b/7.3.1151 @@ -0,0 +1,187 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1151 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1151 +Problem: New regexp engine: Slow when a look-behind match is followed by a + zero-width match. +Solution: Postpone the look-behind match more often. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1150/src/regexp_nfa.c 2013-06-08 22:29:59.000000000 +0200 +--- src/regexp_nfa.c 2013-06-08 23:11:19.000000000 +0200 +*************** +*** 2794,2799 **** +--- 2794,2800 ---- + /* unrecognized */ + return -1; + } ++ + /* + * Convert a postfix form into its equivalent NFA. + * Return the NFA start state on success, NULL otherwise. +*************** +*** 3433,3438 **** +--- 3434,3440 ---- + static void copy_sub_off __ARGS((regsub_T *to, regsub_T *from)); + static int sub_equal __ARGS((regsub_T *sub1, regsub_T *sub2)); + static int has_state_with_pos __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs)); ++ static int match_follows __ARGS((nfa_state_T *startstate, int depth)); + static int state_in_list __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs)); + static void addstate __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs, int off)); + static void addstate_here __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs, nfa_pim_T *pim, int *ip)); +*************** +*** 3626,3631 **** +--- 3628,3715 ---- + } + + /* ++ * Return TRUE if "state" leads to a NFA_MATCH without advancing the input. ++ */ ++ static int ++ match_follows(startstate, depth) ++ nfa_state_T *startstate; ++ int depth; ++ { ++ nfa_state_T *state = startstate; ++ ++ /* avoid too much recursion */ ++ if (depth > 10) ++ return FALSE; ++ ++ for (;;) ++ { ++ switch (state->c) ++ { ++ case NFA_MATCH: ++ return TRUE; ++ ++ case NFA_SPLIT: ++ return match_follows(state->out, depth + 1) ++ || match_follows(state->out1, depth + 1); ++ ++ case NFA_START_INVISIBLE: ++ case NFA_START_INVISIBLE_BEFORE: ++ case NFA_START_INVISIBLE_NEG: ++ case NFA_START_INVISIBLE_BEFORE_NEG: ++ case NFA_COMPOSING: ++ /* skip ahead to next state */ ++ state = state->out1->out; ++ break; ++ ++ case NFA_ANY: ++ case NFA_IDENT: ++ case NFA_SIDENT: ++ case NFA_KWORD: ++ case NFA_SKWORD: ++ case NFA_FNAME: ++ case NFA_SFNAME: ++ case NFA_PRINT: ++ case NFA_SPRINT: ++ case NFA_WHITE: ++ case NFA_NWHITE: ++ case NFA_DIGIT: ++ case NFA_NDIGIT: ++ case NFA_HEX: ++ case NFA_NHEX: ++ case NFA_OCTAL: ++ case NFA_NOCTAL: ++ case NFA_WORD: ++ case NFA_NWORD: ++ case NFA_HEAD: ++ case NFA_NHEAD: ++ case NFA_ALPHA: ++ case NFA_NALPHA: ++ case NFA_LOWER: ++ case NFA_NLOWER: ++ case NFA_UPPER: ++ case NFA_NUPPER: ++ case NFA_START_COLL: ++ case NFA_START_NEG_COLL: ++ case NFA_NEWL: ++ /* state will advance input */ ++ return FALSE; ++ ++ default: ++ if (state->c > 0) ++ /* state will advance input */ ++ return FALSE; ++ ++ /* Others: zero-width or possibly zero-width, might still find ++ * a match at the same position, keep looking. */ ++ break; ++ } ++ state = state->out; ++ } ++ return FALSE; ++ } ++ ++ ++ /* + * Return TRUE if "state" is already in list "l". + */ + static int +*************** +*** 5714,5722 **** + + if (add_state != NULL) + { +! if (t->pim != NULL) + { +- /* postponed invisible match */ + if (t->pim->result == NFA_PIM_TODO) + { + #ifdef ENABLE_LOG +--- 5798,5808 ---- + + if (add_state != NULL) + { +! /* Handle the postponed invisible match before advancing to +! * the next character and for a zero-width match if the match +! * might end without advancing. */ +! if (t->pim != NULL && (!add_here || match_follows(add_state, 0))) + { + if (t->pim->result == NFA_PIM_TODO) + { + #ifdef ENABLE_LOG +*************** +*** 5773,5779 **** + } + + if (add_here) +! addstate_here(thislist, add_state, &t->subs, NULL, &listidx); + else + { + addstate(nextlist, add_state, &t->subs, add_off); +--- 5859,5865 ---- + } + + if (add_here) +! addstate_here(thislist, add_state, &t->subs, t->pim, &listidx); + else + { + addstate(nextlist, add_state, &t->subs, add_off); +*** ../vim-7.3.1150/src/version.c 2013-06-08 22:29:59.000000000 +0200 +--- src/version.c 2013-06-08 23:23:53.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1151, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +117. You are more comfortable typing in html. + + /// 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 /// diff --git a/7.3.1152 b/7.3.1152 new file mode 100644 index 0000000..4d18bc8 --- /dev/null +++ b/7.3.1152 @@ -0,0 +1,56 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1152 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1152 +Problem: In tiny build ireg_icombine is undefined. (Tony Mechelynck) +Solution: Add #ifdef. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1151/src/regexp_nfa.c 2013-06-08 23:26:10.000000000 +0200 +--- src/regexp_nfa.c 2013-06-08 23:29:22.000000000 +0200 +*************** +*** 6198,6204 **** + + /* If match_text is set it contains the full text that must match. + * Nothing else to try. Doesn't handle combining chars well. */ +! if (prog->match_text != NULL && !ireg_icombine) + return find_match_text(col, prog->regstart, prog->match_text); + } + +--- 6198,6208 ---- + + /* If match_text is set it contains the full text that must match. + * Nothing else to try. Doesn't handle combining chars well. */ +! if (prog->match_text != NULL +! #ifdef FEAT_MBYTE +! && !ireg_icombine +! #endif +! ) + return find_match_text(col, prog->regstart, prog->match_text); + } + +*** ../vim-7.3.1151/src/version.c 2013-06-08 23:26:10.000000000 +0200 +--- src/version.c 2013-06-08 23:28:06.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1152, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +118. You are on a first-name basis with your ISP's staff. + + /// 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 /// diff --git a/7.3.1153 b/7.3.1153 new file mode 100644 index 0000000..d8b488b --- /dev/null +++ b/7.3.1153 @@ -0,0 +1,895 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1153 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1153 +Problem: New regexp engine: Some look-behind matches are very expensive. +Solution: Pospone invisible matches further, until a match is almost found. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1152/src/regexp_nfa.c 2013-06-08 23:30:00.000000000 +0200 +--- src/regexp_nfa.c 2013-06-09 16:11:41.000000000 +0200 +*************** +*** 3354,3369 **** + typedef struct nfa_pim_S nfa_pim_T; + struct nfa_pim_S + { +! nfa_state_T *state; +! int result; /* NFA_PIM_TODO, NFA_PIM_[NO]MATCH */ +! nfa_pim_T *pim; /* another PIM at the same position */ + regsubs_T subs; /* submatch info, only party used */ + }; + + /* Values for done in nfa_pim_T. */ +! #define NFA_PIM_TODO 0 +! #define NFA_PIM_MATCH 1 +! #define NFA_PIM_NOMATCH -1 + + + /* nfa_thread_T contains execution information of a NFA state */ +--- 3354,3374 ---- + typedef struct nfa_pim_S nfa_pim_T; + struct nfa_pim_S + { +! int result; /* NFA_PIM_*, see below */ +! nfa_state_T *state; /* the invisible match start state */ + regsubs_T subs; /* submatch info, only party used */ ++ union ++ { ++ lpos_T pos; ++ char_u *ptr; ++ } end; /* where the match must end */ + }; + + /* Values for done in nfa_pim_T. */ +! #define NFA_PIM_UNUSED 0 /* pim not used */ +! #define NFA_PIM_TODO 1 /* pim not done yet */ +! #define NFA_PIM_MATCH 2 /* pim executed, matches */ +! #define NFA_PIM_NOMATCH 3 /* pim executed, no match */ + + + /* nfa_thread_T contains execution information of a NFA state */ +*************** +*** 3371,3377 **** + { + nfa_state_T *state; + int count; +! nfa_pim_T *pim; /* if not NULL: postponed invisible match */ + regsubs_T subs; /* submatch info, only party used */ + } nfa_thread_T; + +--- 3376,3383 ---- + { + nfa_state_T *state; + int count; +! nfa_pim_T pim; /* if pim.result != NFA_PIM_UNUSED: postponed +! * invisible match */ + regsubs_T subs; /* submatch info, only party used */ + } nfa_thread_T; + +*************** +*** 3424,3434 **** +--- 3430,3457 ---- + e == NULL ? "NULL" : e); + } + } ++ ++ static char * ++ pim_info(nfa_pim_T *pim) ++ { ++ static char buf[30]; ++ ++ if (pim == NULL || pim->result == NFA_PIM_UNUSED) ++ buf[0] = NUL; ++ else ++ { ++ sprintf(buf, " PIM col %d", REG_MULTI ? (int)pim->end.pos.col ++ : (int)(pim->end.ptr - reginput)); ++ } ++ return buf; ++ } ++ + #endif + + /* Used during execution: whether a match has been found. */ + static int nfa_match; + ++ static void copy_pim __ARGS((nfa_pim_T *to, nfa_pim_T *from)); + static void clear_sub __ARGS((regsub_T *sub)); + static void copy_sub __ARGS((regsub_T *to, regsub_T *from)); + static void copy_sub_off __ARGS((regsub_T *to, regsub_T *from)); +*************** +*** 3436,3444 **** + static int has_state_with_pos __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs)); + static int match_follows __ARGS((nfa_state_T *startstate, int depth)); + static int state_in_list __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs)); +! static void addstate __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs, int off)); + static void addstate_here __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs, nfa_pim_T *pim, int *ip)); + + static void + clear_sub(sub) + regsub_T *sub; +--- 3459,3485 ---- + static int has_state_with_pos __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs)); + static int match_follows __ARGS((nfa_state_T *startstate, int depth)); + static int state_in_list __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs)); +! static void addstate __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs, nfa_pim_T *pim, int off)); + static void addstate_here __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs, nfa_pim_T *pim, int *ip)); + ++ /* ++ * Copy postponed invisible match info from "from" to "to". ++ */ ++ static void ++ copy_pim(to, from) ++ nfa_pim_T *to; ++ nfa_pim_T *from; ++ { ++ to->result = from->result; ++ to->state = from->state; ++ copy_sub(&to->subs.norm, &from->subs.norm); ++ #ifdef FEAT_SYN_HL ++ if (nfa_has_zsubexpr) ++ copy_sub(&to->subs.synt, &from->subs.synt); ++ #endif ++ to->end = from->end; ++ } ++ + static void + clear_sub(sub) + regsub_T *sub; +*************** +*** 3583,3589 **** + + #ifdef ENABLE_LOG + static void +! report_state(char *action, regsub_T *sub, nfa_state_T *state, int lid) + { + int col; + +--- 3624,3634 ---- + + #ifdef ENABLE_LOG + static void +! report_state(char *action, +! regsub_T *sub, +! nfa_state_T *state, +! int lid, +! nfa_pim_T *pim) + { + int col; + +*************** +*** 3594,3601 **** + else + col = (int)(sub->list.line[0].start - regline); + nfa_set_code(state->c); +! fprintf(log_fd, "> %s state %d to list %d. char %d: %s (start col %d)\n", +! action, abs(state->id), lid, state->c, code, col); + } + #endif + +--- 3639,3647 ---- + else + col = (int)(sub->list.line[0].start - regline); + nfa_set_code(state->c); +! fprintf(log_fd, "> %s state %d to list %d. char %d: %s (start col %d)%s\n", +! action, abs(state->id), lid, state->c, code, col, +! pim_info(pim)); + } + #endif + +*************** +*** 3646,3651 **** +--- 3692,3701 ---- + switch (state->c) + { + case NFA_MATCH: ++ case NFA_MCLOSE: ++ case NFA_END_INVISIBLE: ++ case NFA_END_INVISIBLE_NEG: ++ case NFA_END_PATTERN: + return TRUE; + + case NFA_SPLIT: +*************** +*** 3727,3736 **** + } + + static void +! addstate(l, state, subs, off) + nfa_list_T *l; /* runtime state list */ + nfa_state_T *state; /* state to update */ + regsubs_T *subs; /* pointers to subexpressions */ + int off; /* byte offset, when -1 go to next line */ + { + int subidx; +--- 3777,3787 ---- + } + + static void +! addstate(l, state, subs, pim, off) + nfa_list_T *l; /* runtime state list */ + nfa_state_T *state; /* state to update */ + regsubs_T *subs; /* pointers to subexpressions */ ++ nfa_pim_T *pim; /* postponed look-behind match */ + int off; /* byte offset, when -1 go to next line */ + { + int subidx; +*************** +*** 3856,3876 **** + state->lastlist[nfa_ll_index] = l->id; + thread = &l->t[l->n++]; + thread->state = state; +! thread->pim = NULL; + copy_sub(&thread->subs.norm, &subs->norm); + #ifdef FEAT_SYN_HL + if (nfa_has_zsubexpr) + copy_sub(&thread->subs.synt, &subs->synt); + #endif + #ifdef ENABLE_LOG +! report_state("Adding", &thread->subs.norm, state, l->id); + did_print = TRUE; + #endif + } + + #ifdef ENABLE_LOG + if (!did_print) +! report_state("Processing", &subs->norm, state, l->id); + #endif + switch (state->c) + { +--- 3907,3930 ---- + state->lastlist[nfa_ll_index] = l->id; + thread = &l->t[l->n++]; + thread->state = state; +! if (pim == NULL) +! thread->pim.result = NFA_PIM_UNUSED; +! else +! copy_pim(&thread->pim, pim); + copy_sub(&thread->subs.norm, &subs->norm); + #ifdef FEAT_SYN_HL + if (nfa_has_zsubexpr) + copy_sub(&thread->subs.synt, &subs->synt); + #endif + #ifdef ENABLE_LOG +! report_state("Adding", &thread->subs.norm, state, l->id, pim); + did_print = TRUE; + #endif + } + + #ifdef ENABLE_LOG + if (!did_print) +! report_state("Processing", &subs->norm, state, l->id, pim); + #endif + switch (state->c) + { +*************** +*** 3880,3893 **** + + case NFA_SPLIT: + /* order matters here */ +! addstate(l, state->out, subs, off); +! addstate(l, state->out1, subs, off); + break; + + case NFA_SKIP_CHAR: + case NFA_NOPEN: + case NFA_NCLOSE: +! addstate(l, state->out, subs, off); + break; + + case NFA_MOPEN: +--- 3934,3947 ---- + + case NFA_SPLIT: + /* order matters here */ +! addstate(l, state->out, subs, pim, off); +! addstate(l, state->out1, subs, pim, off); + break; + + case NFA_SKIP_CHAR: + case NFA_NOPEN: + case NFA_NCLOSE: +! addstate(l, state->out, subs, pim, off); + break; + + case NFA_MOPEN: +*************** +*** 3983,3989 **** + sub->list.line[subidx].start = reginput + off; + } + +! addstate(l, state->out, subs, off); + + if (save_in_use == -1) + { +--- 4037,4043 ---- + sub->list.line[subidx].start = reginput + off; + } + +! addstate(l, state->out, subs, pim, off); + + if (save_in_use == -1) + { +*************** +*** 4001,4007 **** + { + /* Do not overwrite the position set by \ze. If no \ze + * encountered end will be set in nfa_regtry(). */ +! addstate(l, state->out, subs, off); + break; + } + case NFA_MCLOSE1: +--- 4055,4061 ---- + { + /* Do not overwrite the position set by \ze. If no \ze + * encountered end will be set in nfa_regtry(). */ +! addstate(l, state->out, subs, pim, off); + break; + } + case NFA_MCLOSE1: +*************** +*** 4070,4076 **** + sub->list.line[subidx].end = reginput + off; + } + +! addstate(l, state->out, subs, off); + + if (REG_MULTI) + sub->list.multi[subidx].end = save_lpos; +--- 4124,4130 ---- + sub->list.line[subidx].end = reginput + off; + } + +! addstate(l, state->out, subs, pim, off); + + if (REG_MULTI) + sub->list.multi[subidx].end = save_lpos; +*************** +*** 4098,4112 **** + int tlen = l->n; + int count; + int listidx = *ip; +- int i; + + /* first add the state(s) at the end, so that we know how many there are */ +! addstate(l, state, subs, 0); +! +! /* fill in the "pim" field in the new states */ +! if (pim != NULL) +! for (i = tlen; i < l->n; ++i) +! l->t[i].pim = pim; + + /* when "*ip" was at the end of the list, nothing to do */ + if (listidx + 1 == tlen) +--- 4152,4160 ---- + int tlen = l->n; + int count; + int listidx = *ip; + + /* first add the state(s) at the end, so that we know how many there are */ +! addstate(l, state, subs, pim, 0); + + /* when "*ip" was at the end of the list, nothing to do */ + if (listidx + 1 == tlen) +*************** +*** 4355,4369 **** + return val == pos; + } + +! static int recursive_regmatch __ARGS((nfa_state_T *state, nfa_regprog_T *prog, regsubs_T *submatch, regsubs_T *m, int **listids)); + static int nfa_regmatch __ARGS((nfa_regprog_T *prog, nfa_state_T *start, regsubs_T *submatch, regsubs_T *m)); + + /* + * Recursively call nfa_regmatch() + */ + static int +! recursive_regmatch(state, prog, submatch, m, listids) + nfa_state_T *state; + nfa_regprog_T *prog; + regsubs_T *submatch; + regsubs_T *m; +--- 4403,4420 ---- + return val == pos; + } + +! static int recursive_regmatch __ARGS((nfa_state_T *state, nfa_pim_T *pim, nfa_regprog_T *prog, regsubs_T *submatch, regsubs_T *m, int **listids)); + static int nfa_regmatch __ARGS((nfa_regprog_T *prog, nfa_state_T *start, regsubs_T *submatch, regsubs_T *m)); + + /* + * Recursively call nfa_regmatch() ++ * "pim" is NULL or contains info about a Postponed Invisible Match (start ++ * position). + */ + static int +! recursive_regmatch(state, pim, prog, submatch, m, listids) + nfa_state_T *state; ++ nfa_pim_T *pim; + nfa_regprog_T *prog; + regsubs_T *submatch; + regsubs_T *m; +*************** +*** 4380,4397 **** + int result; + int need_restore = FALSE; + + if (state->c == NFA_START_INVISIBLE_BEFORE + || state->c == NFA_START_INVISIBLE_BEFORE_NEG) + { +! /* The recursive match must end at the current position. */ + endposp = &endpos; + if (REG_MULTI) + { +! endpos.se_u.pos.col = (int)(reginput - regline); +! endpos.se_u.pos.lnum = reglnum; + } + else +! endpos.se_u.ptr = reginput; + + /* Go back the specified number of bytes, or as far as the + * start of the previous line, to try matching "\@<=" or +--- 4431,4468 ---- + int result; + int need_restore = FALSE; + ++ if (pim != NULL) ++ { ++ /* start at the position where the postponed match was */ ++ if (REG_MULTI) ++ reginput = regline + pim->end.pos.col; ++ else ++ reginput = pim->end.ptr; ++ } ++ + if (state->c == NFA_START_INVISIBLE_BEFORE + || state->c == NFA_START_INVISIBLE_BEFORE_NEG) + { +! /* The recursive match must end at the current position. When "pim" is +! * not NULL it specifies the current position. */ + endposp = &endpos; + if (REG_MULTI) + { +! if (pim == NULL) +! { +! endpos.se_u.pos.col = (int)(reginput - regline); +! endpos.se_u.pos.lnum = reglnum; +! } +! else +! endpos.se_u.pos = pim->end.pos; + } + else +! { +! if (pim == NULL) +! endpos.se_u.ptr = reginput; +! else +! endpos.se_u.ptr = pim->end.ptr; +! } + + /* Go back the specified number of bytes, or as far as the + * start of the previous line, to try matching "\@<=" or +*************** +*** 4784,4790 **** + int add_here; + int add_count; + int add_off; +- garray_T pimlist; + int toplevel = start->c == NFA_MOPEN; + #ifdef NFA_REGEXP_DEBUG_LOG + FILE *debug = fopen(NFA_REGEXP_DEBUG_LOG, "a"); +--- 4855,4860 ---- +*************** +*** 4796,4802 **** + } + #endif + nfa_match = FALSE; +- ga_init2(&pimlist, sizeof(nfa_pim_T), 5); + + /* Allocate memory for the lists of nodes. */ + size = (nstate + 1) * sizeof(nfa_thread_T); +--- 4866,4871 ---- +*************** +*** 4845,4854 **** + else + m->norm.list.line[0].start = reginput; + m->norm.in_use = 1; +! addstate(thislist, start->out, m, 0); + } + else +! addstate(thislist, start, m, 0); + + #define ADD_STATE_IF_MATCH(state) \ + if (result) { \ +--- 4914,4923 ---- + else + m->norm.list.line[0].start = reginput; + m->norm.in_use = 1; +! addstate(thislist, start->out, m, NULL, 0); + } + else +! addstate(thislist, start, m, NULL, 0); + + #define ADD_STATE_IF_MATCH(state) \ + if (result) { \ +*************** +*** 4890,4897 **** + thislist->id = nfa_listid; + nextlist->id = nfa_listid + 1; + +- pimlist.ga_len = 0; +- + #ifdef ENABLE_LOG + fprintf(log_fd, "------------------------------------------\n"); + fprintf(log_fd, ">>> Reginput is \"%s\"\n", reginput); +--- 4959,4964 ---- +*************** +*** 4935,4942 **** + else + col = (int)(t->subs.norm.list.line[0].start - regline); + nfa_set_code(t->state->c); +! fprintf(log_fd, "(%d) char %d %s (start col %d) ... \n", +! abs(t->state->id), (int)t->state->c, code, col); + } + #endif + +--- 5002,5010 ---- + else + col = (int)(t->subs.norm.list.line[0].start - regline); + nfa_set_code(t->state->c); +! fprintf(log_fd, "(%d) char %d %s (start col %d)%s ... \n", +! abs(t->state->id), (int)t->state->c, code, col, +! pim_info(&t->pim)); + } + #endif + +*************** +*** 5028,5048 **** + case NFA_START_INVISIBLE_BEFORE: + case NFA_START_INVISIBLE_BEFORE_NEG: + { +- nfa_pim_T *pim; + int cout = t->state->out1->out->c; + + /* Do it directly when what follows is possibly end of + * match (closing paren). + * Postpone when it is \@<= or \@pim and check multiple +- * where it's used? + * Otherwise first do the one that has the highest chance + * of failing. */ + if ((cout >= NFA_MCLOSE && cout <= NFA_MCLOSE9) + #ifdef FEAT_SYN_HL + || (cout >= NFA_ZCLOSE && cout <= NFA_ZCLOSE9) + #endif +! || t->pim != NULL + || (t->state->c != NFA_START_INVISIBLE_BEFORE + && t->state->c != NFA_START_INVISIBLE_BEFORE_NEG + && failure_chance(t->state->out1->out, 0) +--- 5096,5114 ---- + case NFA_START_INVISIBLE_BEFORE: + case NFA_START_INVISIBLE_BEFORE_NEG: + { + int cout = t->state->out1->out->c; + + /* Do it directly when what follows is possibly end of + * match (closing paren). ++ * Do it directly if there already is a PIM. + * Postpone when it is \@<= or \@= NFA_MCLOSE && cout <= NFA_MCLOSE9) + #ifdef FEAT_SYN_HL + || (cout >= NFA_ZCLOSE && cout <= NFA_ZCLOSE9) + #endif +! || t->pim.result != NFA_PIM_UNUSED + || (t->state->c != NFA_START_INVISIBLE_BEFORE + && t->state->c != NFA_START_INVISIBLE_BEFORE_NEG + && failure_chance(t->state->out1->out, 0) +*************** +*** 5052,5058 **** + * First try matching the invisible match, then what + * follows. + */ +! result = recursive_regmatch(t->state, prog, + submatch, m, &listids); + + /* for \@! and \@state, NULL, prog, + submatch, m, &listids); + + /* for \@! and \@state = t->state; +! pim->pim = NULL; +! pim->result = NFA_PIM_TODO; + + /* t->state->out1 is the corresponding END_INVISIBLE + * node; Add its out to the current list (zero-width + * match). */ + addstate_here(thislist, t->state->out1->out, &t->subs, +! pim, &listidx); + } + } + break; +--- 5143,5175 ---- + } + else + { ++ nfa_pim_T pim; ++ + /* +! * First try matching what follows. Only if a match +! * is found verify the invisible match matches. Add a +! * nfa_pim_T to the following states, it contains info +! * about the invisible match. + */ +! pim.state = t->state; +! pim.result = NFA_PIM_TODO; +! pim.subs.norm.in_use = 0; +! #ifdef FEAT_SYN_HL +! pim.subs.synt.in_use = 0; +! #endif +! if (REG_MULTI) +! { +! pim.end.pos.col = (int)(reginput - regline); +! pim.end.pos.lnum = reglnum; +! } +! else +! pim.end.ptr = reginput; + + /* t->state->out1 is the corresponding END_INVISIBLE + * node; Add its out to the current list (zero-width + * match). */ + addstate_here(thislist, t->state->out1->out, &t->subs, +! &pim, &listidx); + } + } + break; +*************** +*** 5144,5150 **** + } + + /* First try matching the pattern. */ +! result = recursive_regmatch(t->state, prog, + submatch, m, &listids); + if (result) + { +--- 5217,5223 ---- + } + + /* First try matching the pattern. */ +! result = recursive_regmatch(t->state, NULL, prog, + submatch, m, &listids); + if (result) + { +*************** +*** 5798,5809 **** + + if (add_state != NULL) + { +! /* Handle the postponed invisible match before advancing to +! * the next character and for a zero-width match if the match +! * might end without advancing. */ +! if (t->pim != NULL && (!add_here || match_follows(add_state, 0))) + { +! if (t->pim->result == NFA_PIM_TODO) + { + #ifdef ENABLE_LOG + fprintf(log_fd, "\n"); +--- 5871,5888 ---- + + if (add_state != NULL) + { +! nfa_pim_T *pim; +! +! if (t->pim.result == NFA_PIM_UNUSED) +! pim = NULL; +! else +! pim = &t->pim; +! +! /* Handle the postponed invisible match if the match might end +! * without advancing and before the end of the line. */ +! if (pim != NULL && (clen == 0 || match_follows(add_state, 0))) + { +! if (pim->result == NFA_PIM_TODO) + { + #ifdef ENABLE_LOG + fprintf(log_fd, "\n"); +*************** +*** 5811,5868 **** + fprintf(log_fd, "Postponed recursive nfa_regmatch()\n"); + fprintf(log_fd, "\n"); + #endif +! result = recursive_regmatch(t->pim->state, + prog, submatch, m, &listids); +! t->pim->result = result ? NFA_PIM_MATCH +! : NFA_PIM_NOMATCH; + /* for \@! and \@pim->state->c +! == NFA_START_INVISIBLE_NEG +! || t->pim->state->c + == NFA_START_INVISIBLE_BEFORE_NEG)) + { + /* Copy submatch info from the recursive call */ +! copy_sub_off(&t->pim->subs.norm, &m->norm); + #ifdef FEAT_SYN_HL + if (nfa_has_zsubexpr) +! copy_sub_off(&t->pim->subs.synt, &m->synt); + #endif + } + } + else + { +! result = (t->pim->result == NFA_PIM_MATCH); + #ifdef ENABLE_LOG + fprintf(log_fd, "\n"); +! fprintf(log_fd, "Using previous recursive nfa_regmatch() result, result == %d\n", t->pim->result); + fprintf(log_fd, "MATCH = %s\n", result == TRUE ? "OK" : "FALSE"); + fprintf(log_fd, "\n"); + #endif + } + + /* for \@! and \@pim->state->c == NFA_START_INVISIBLE_NEG +! || t->pim->state->c + == NFA_START_INVISIBLE_BEFORE_NEG)) + { + /* Copy submatch info from the recursive call */ +! copy_sub_off(&t->subs.norm, &t->pim->subs.norm); + #ifdef FEAT_SYN_HL + if (nfa_has_zsubexpr) +! copy_sub_off(&t->subs.synt, &t->pim->subs.synt); + #endif + } + else + /* look-behind match failed, don't add the state */ + continue; + } + + if (add_here) +! addstate_here(thislist, add_state, &t->subs, t->pim, &listidx); + else + { +! addstate(nextlist, add_state, &t->subs, add_off); + if (add_count > 0) + nextlist->t[nextlist->n - 1].count = add_count; + } +--- 5890,5949 ---- + fprintf(log_fd, "Postponed recursive nfa_regmatch()\n"); + fprintf(log_fd, "\n"); + #endif +! result = recursive_regmatch(pim->state, pim, + prog, submatch, m, &listids); +! pim->result = result ? NFA_PIM_MATCH : NFA_PIM_NOMATCH; + /* for \@! and \@state->c == NFA_START_INVISIBLE_NEG +! || pim->state->c + == NFA_START_INVISIBLE_BEFORE_NEG)) + { + /* Copy submatch info from the recursive call */ +! copy_sub_off(&pim->subs.norm, &m->norm); + #ifdef FEAT_SYN_HL + if (nfa_has_zsubexpr) +! copy_sub_off(&pim->subs.synt, &m->synt); + #endif + } + } + else + { +! result = (pim->result == NFA_PIM_MATCH); + #ifdef ENABLE_LOG + fprintf(log_fd, "\n"); +! fprintf(log_fd, "Using previous recursive nfa_regmatch() result, result == %d\n", pim->result); + fprintf(log_fd, "MATCH = %s\n", result == TRUE ? "OK" : "FALSE"); + fprintf(log_fd, "\n"); + #endif + } + + /* for \@! and \@state->c == NFA_START_INVISIBLE_NEG +! || pim->state->c + == NFA_START_INVISIBLE_BEFORE_NEG)) + { + /* Copy submatch info from the recursive call */ +! copy_sub_off(&t->subs.norm, &pim->subs.norm); + #ifdef FEAT_SYN_HL + if (nfa_has_zsubexpr) +! copy_sub_off(&t->subs.synt, &pim->subs.synt); + #endif + } + else + /* look-behind match failed, don't add the state */ + continue; ++ ++ /* Postponed invisible match was handled, don't add it to ++ * following states. */ ++ pim = NULL; + } + + if (add_here) +! addstate_here(thislist, add_state, &t->subs, pim, &listidx); + else + { +! addstate(nextlist, add_state, &t->subs, pim, add_off); + if (add_count > 0) + nextlist->t[nextlist->n - 1].count = add_count; + } +*************** +*** 5941,5951 **** + (colnr_T)(reginput - regline) + clen; + else + m->norm.list.line[0].start = reginput + clen; +! addstate(nextlist, start->out, m, clen); + } + } + else +! addstate(nextlist, start, m, clen); + } + + #ifdef ENABLE_LOG +--- 6022,6032 ---- + (colnr_T)(reginput - regline) + clen; + else + m->norm.list.line[0].start = reginput + clen; +! addstate(nextlist, start->out, m, NULL, clen); + } + } + else +! addstate(nextlist, start, m, NULL, clen); + } + + #ifdef ENABLE_LOG +*************** +*** 5982,5988 **** + vim_free(list[0].t); + vim_free(list[1].t); + vim_free(listids); +- ga_clear(&pimlist); + #undef ADD_STATE_IF_MATCH + #ifdef NFA_REGEXP_DEBUG_LOG + fclose(debug); +--- 6063,6068 ---- +*** ../vim-7.3.1152/src/version.c 2013-06-08 23:30:00.000000000 +0200 +--- src/version.c 2013-06-09 15:21:03.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1153, + /**/ + +-- +"Computers in the future may weigh no more than 1.5 tons." + Popular Mechanics, 1949 + + /// 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 /// diff --git a/7.3.1154 b/7.3.1154 new file mode 100644 index 0000000..2e4b54e --- /dev/null +++ b/7.3.1154 @@ -0,0 +1,115 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1154 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1154 +Problem: New regexp_nfa engine: Uneccessary code. +Solution: Remove uneccessary code. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1153/src/regexp_nfa.c 2013-06-09 16:24:40.000000000 +0200 +--- src/regexp_nfa.c 2013-06-09 17:02:03.000000000 +0200 +*************** +*** 3795,3808 **** + int did_print = FALSE; + #endif + +- if (l == NULL || state == NULL) +- return; +- + switch (state->c) + { +- case NFA_SPLIT: +- case NFA_NOPEN: +- case NFA_SKIP_CHAR: + case NFA_NCLOSE: + case NFA_MCLOSE: + case NFA_MCLOSE1: +--- 3795,3802 ---- +*************** +*** 3827,3832 **** +--- 3821,3829 ---- + case NFA_ZCLOSE9: + #endif + case NFA_ZEND: ++ case NFA_SPLIT: ++ case NFA_NOPEN: ++ case NFA_SKIP_CHAR: + /* These nodes are not added themselves but their "out" and/or + * "out1" may be added below. */ + break; +*************** +*** 3889,3900 **** + return; + } + + if (has_state_with_pos(l, state, subs)) + goto skip_add; + } + +! /* when there are backreferences or look-behind matches the number +! * of states may be (a lot) bigger */ + if (nfa_has_backref && l->n == l->len) + { + int newlen = l->len * 3 / 2 + 50; +--- 3886,3899 ---- + return; + } + ++ /* Do not add the state again when it exists with the same ++ * positions. */ + if (has_state_with_pos(l, state, subs)) + goto skip_add; + } + +! /* When there are backreferences the number of states may be (a +! * lot) bigger than anticipated. */ + if (nfa_has_backref && l->n == l->len) + { + int newlen = l->len * 3 / 2 + 50; +*************** +*** 3985,3992 **** + sub = &subs->norm; + } + +! /* Set the position (with "off") in the subexpression. Save and +! * restore it when it was in use. Otherwise fill any gap. */ + save_ptr = NULL; + if (REG_MULTI) + { +--- 3984,3991 ---- + sub = &subs->norm; + } + +! /* Set the position (with "off" added) in the subexpression. Save +! * and restore it when it was in use. Otherwise fill any gap. */ + save_ptr = NULL; + if (REG_MULTI) + { +*** ../vim-7.3.1153/src/version.c 2013-06-09 16:24:40.000000000 +0200 +--- src/version.c 2013-06-09 17:24:42.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1154, + /**/ + + +-- +~ +~ +~ +".signature" 4 lines, 50 characters written + + /// 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 /// diff --git a/7.3.1155 b/7.3.1155 new file mode 100644 index 0000000..622258c --- /dev/null +++ b/7.3.1155 @@ -0,0 +1,48 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1155 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1155 +Problem: MS-DOS: "make test" uses external rmdir command. +Solution: Rename "rmdir" to "rd". (Taro Muraoka) +Files: src/testdir/Make_dos.mak + + +*** ../vim-7.3.1154/src/testdir/Make_dos.mak 2013-05-19 19:16:25.000000000 +0200 +--- src/testdir/Make_dos.mak 2013-06-09 17:49:47.000000000 +0200 +*************** +*** 77,81 **** + -del X* + -del X*.* + -del test.ok +! -rmdir /s /q Xfind + -if exist viminfo del viminfo +--- 77,81 ---- + -del X* + -del X*.* + -del test.ok +! -rd /s /q Xfind + -if exist viminfo del viminfo +*** ../vim-7.3.1154/src/version.c 2013-06-09 17:25:29.000000000 +0200 +--- src/version.c 2013-06-09 17:50:49.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1155, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +124. You begin conversations with, "Who is your internet service provider?" + + /// 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 /// diff --git a/7.3.1156 b/7.3.1156 new file mode 100644 index 0000000..899480a --- /dev/null +++ b/7.3.1156 @@ -0,0 +1,85 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1156 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1156 +Problem: Compiler warnings. (dv1445) +Solution: Initialize variables, even when the value isn't really used. +Files: src/regexp_nfa.c, src/eval.c + + +*** ../vim-7.3.1155/src/regexp_nfa.c 2013-06-09 17:25:29.000000000 +0200 +--- src/regexp_nfa.c 2013-06-09 20:35:42.000000000 +0200 +*************** +*** 3045,3051 **** + start_state = NFA_START_INVISIBLE_BEFORE_NEG; + end_state = NFA_END_INVISIBLE_NEG; + break; +! case NFA_PREV_ATOM_LIKE_PATTERN: + start_state = NFA_START_PATTERN; + end_state = NFA_END_PATTERN; + break; +--- 3045,3051 ---- + start_state = NFA_START_INVISIBLE_BEFORE_NEG; + end_state = NFA_END_INVISIBLE_NEG; + break; +! default: /* NFA_PREV_ATOM_LIKE_PATTERN: */ + start_state = NFA_START_PATTERN; + end_state = NFA_END_PATTERN; + break; +*************** +*** 4853,4859 **** + nfa_state_T *add_state; + int add_here; + int add_count; +! int add_off; + int toplevel = start->c == NFA_MOPEN; + #ifdef NFA_REGEXP_DEBUG_LOG + FILE *debug = fopen(NFA_REGEXP_DEBUG_LOG, "a"); +--- 4853,4859 ---- + nfa_state_T *add_state; + int add_here; + int add_count; +! int add_off = 0; + int toplevel = start->c == NFA_MOPEN; + #ifdef NFA_REGEXP_DEBUG_LOG + FILE *debug = fopen(NFA_REGEXP_DEBUG_LOG, "a"); +*** ../vim-7.3.1155/src/eval.c 2013-06-08 18:19:39.000000000 +0200 +--- src/eval.c 2013-06-09 20:38:06.000000000 +0200 +*************** +*** 2734,2739 **** +--- 2734,2741 ---- + prevval = key[len]; + key[len] = NUL; + } ++ else ++ prevval = 0; /* avoid compiler warning */ + wrong = (lp->ll_dict->dv_scope == VAR_DEF_SCOPE + && rettv->v_type == VAR_FUNC + && var_check_func_name(key, lp->ll_di == NULL)) +*** ../vim-7.3.1155/src/version.c 2013-06-09 17:52:42.000000000 +0200 +--- src/version.c 2013-06-09 20:50:05.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1156, + /**/ + +-- +"Microsoft is like Coke. It's a secret formula, all the money is from +distribution, and their goal is to get Coke everywhere. Open source is like +selling water. There are water companies like Perrier and Poland Spring, but +you're competing with something that's free." -- Carl Howe + + + /// 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 /// diff --git a/7.3.1157 b/7.3.1157 new file mode 100644 index 0000000..6d34261 --- /dev/null +++ b/7.3.1157 @@ -0,0 +1,165 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1157 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1157 +Problem: New regexp engine fails on "\(\state->out1->out->c; + +! /* Do it directly when what follows is possibly end of +! * match (closing paren). +! * Do it directly if there already is a PIM. +! * Postpone when it is \@<= or \@= NFA_MCLOSE && cout <= NFA_MCLOSE9) +! #ifdef FEAT_SYN_HL +! || (cout >= NFA_ZCLOSE && cout <= NFA_ZCLOSE9) + #endif +! || t->pim.result != NFA_PIM_UNUSED +! || (t->state->c != NFA_START_INVISIBLE_BEFORE +! && t->state->c != NFA_START_INVISIBLE_BEFORE_NEG +! && failure_chance(t->state->out1->out, 0) +! < failure_chance(t->state->out, 0))) + { + /* + * First try matching the invisible match, then what +--- 5097,5142 ---- + case NFA_START_INVISIBLE_BEFORE: + case NFA_START_INVISIBLE_BEFORE_NEG: + { +! int directly = FALSE; + +! #ifdef ENABLE_LOG +! fprintf(log_fd, "Failure chance invisible: %d, what follows: %d\n", +! failure_chance(t->state->out, 0), +! failure_chance(t->state->out1->out, 0)); + #endif +! /* Do it directly when what follows is possibly the end of +! * the match. +! * Do it directly if there already is a PIM. +! * Postpone when the invisible match is expensive or has a +! * lower chance of failing. */ +! if (match_follows(t->state->out1->out, 0) +! || t->pim.result != NFA_PIM_UNUSED) +! directly = TRUE; +! else +! { +! int ch_invisible = failure_chance(t->state->out, 0); +! int ch_follows = failure_chance(t->state->out1->out, 0); +! +! if (t->state->c == NFA_START_INVISIBLE_BEFORE +! || t->state->c == NFA_START_INVISIBLE_BEFORE_NEG) +! { +! /* "before" matches are very expensive when +! * unbounded, always prefer what follows then, +! * unless what follows will always match. +! * Otherwise strongly prefer what follows. */ +! if (t->state->val <= 0 && ch_follows > 0) +! directly = FALSE; +! else +! directly = ch_follows * 10 < ch_invisible; +! } +! else +! { +! /* normal invisible, first do the one with the +! * highest failure chance */ +! directly = ch_follows < ch_invisible; +! } +! } +! if (directly) + { + /* + * First try matching the invisible match, then what +*** ../vim-7.3.1156/src/testdir/test64.in 2013-06-08 18:19:40.000000000 +0200 +--- src/testdir/test64.in 2013-06-10 16:19:49.000000000 +0200 +*************** +*** 392,397 **** +--- 392,398 ---- + :call add(tl, [2, '\v\C%(', 'foobar']) + :call add(tl, [2, '\(foo\)\@<=\>', 'barfoo', '', 'foo']) ++ :call add(tl, [2, '\(foo\)\@<=.*', 'foobar', 'bar', 'foo']) + :" + :""""" \@> + :call add(tl, [2, '\(a*\)\@>a', 'aaaa']) +*** ../vim-7.3.1156/src/testdir/test64.ok 2013-06-08 18:19:40.000000000 +0200 +--- src/testdir/test64.ok 2013-06-10 16:21:07.000000000 +0200 +*************** +*** 890,895 **** +--- 890,898 ---- + OK 0 - \(foo\)\@<=\> + OK 1 - \(foo\)\@<=\> + OK 2 - \(foo\)\@<=\> ++ OK 0 - \(foo\)\@<=.* ++ OK 1 - \(foo\)\@<=.* ++ OK 2 - \(foo\)\@<=.* + OK 0 - \(a*\)\@>a + OK 1 - \(a*\)\@>a + OK 2 - \(a*\)\@>a +*** ../vim-7.3.1156/src/version.c 2013-06-09 20:50:56.000000000 +0200 +--- src/version.c 2013-06-10 16:23:57.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1157, + /**/ + +-- +In a world without fences, who needs Gates and Windows? + + /// 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 /// diff --git a/7.3.1158 b/7.3.1158 new file mode 100644 index 0000000..f4de874 --- /dev/null +++ b/7.3.1158 @@ -0,0 +1,113 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1158 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1158 +Problem: Crash when running test 86. (Jun Takimoto) +Solution: Define PY_SSIZE_T_CLEAN early. (Elimar Riesebieter) +Files: src/if_python.c, src/if_python3.c + + +*** ../vim-7.3.1157/src/if_python.c 2013-06-02 18:20:12.000000000 +0200 +--- src/if_python.c 2013-06-10 18:19:52.000000000 +0200 +*************** +*** 53,59 **** +--- 53,66 ---- + # undef _XOPEN_SOURCE /* pyconfig.h defines it as well. */ + #endif + ++ #define PY_SSIZE_T_CLEAN ++ + #include ++ ++ #if !defined(PY_VERSION_HEX) || PY_VERSION_HEX < 0x02050000 ++ # undef PY_SSIZE_T_CLEAN ++ #endif ++ + #if defined(MACOS) && !defined(MACOS_X_UNIX) + # include "macglue.h" + # include +*************** +*** 61,70 **** + #undef main /* Defined in python.h - aargh */ + #undef HAVE_FCNTL_H /* Clash with os_win32.h */ + +- #if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000 +- # define PY_SSIZE_T_CLEAN +- #endif +- + #define PyBytes_FromString PyString_FromString + #define PyBytes_Check PyString_Check + +--- 68,73 ---- +*** ../vim-7.3.1157/src/if_python3.c 2013-06-02 18:20:12.000000000 +0200 +--- src/if_python3.c 2013-06-10 18:24:36.000000000 +0200 +*************** +*** 24,32 **** + + /* uncomment this if used with the debug version of python */ + /* #define Py_DEBUG */ +! /* Note: most of time you can add -DPy_DEBUG to CFLAGS in place of uncommenting + */ +! /* uncomment this if used with the debug version of python, but without its + * allocator */ + /* #define Py_DEBUG_NO_PYMALLOC */ + +--- 24,32 ---- + + /* uncomment this if used with the debug version of python */ + /* #define Py_DEBUG */ +! /* Note: most of time you can add -DPy_DEBUG to CFLAGS in place of uncommenting + */ +! /* uncomment this if used with the debug version of python, but without its + * allocator */ + /* #define Py_DEBUG_NO_PYMALLOC */ + +*************** +*** 61,67 **** +--- 61,70 ---- + # undef _XOPEN_SOURCE /* pyconfig.h defines it as well. */ + #endif + ++ #define PY_SSIZE_T_CLEAN ++ + #include ++ + #if defined(MACOS) && !defined(MACOS_X_UNIX) + # include "macglue.h" + # include +*************** +*** 69,78 **** + #undef main /* Defined in python.h - aargh */ + #undef HAVE_FCNTL_H /* Clash with os_win32.h */ + +- #if defined(PY_VERSION_HEX) && PY_VERSION_HEX >= 0x02050000 +- # define PY_SSIZE_T_CLEAN +- #endif +- + /* The "surrogateescape" error handler is new in Python 3.1 */ + #if PY_VERSION_HEX >= 0x030100f0 + # define CODEC_ERROR_HANDLER "surrogateescape" +--- 72,77 ---- +*** ../vim-7.3.1157/src/version.c 2013-06-10 16:35:11.000000000 +0200 +--- src/version.c 2013-06-10 18:25:01.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1158, + /**/ + +-- +Never eat yellow snow. + + /// 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 /// diff --git a/7.3.1159 b/7.3.1159 new file mode 100644 index 0000000..ab88051 --- /dev/null +++ b/7.3.1159 @@ -0,0 +1,134 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1159 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1159 +Problem: The round() function is not always available. (Christ van + Willegen) +Solution: Use the solution from f_round(). +Files: src/ex_cmds2.c, src/eval.c, src/proto/eval.pro + + +*** ../vim-7.3.1158/src/ex_cmds2.c 2013-06-08 18:19:39.000000000 +0200 +--- src/ex_cmds2.c 2013-06-10 20:06:00.000000000 +0200 +*************** +*** 982,988 **** + double usec = (tm->tv_sec * 1000000.0 + tm->tv_usec) / count; + + tm2->tv_sec = floor(usec / 1000000.0); +! tm2->tv_usec = round(usec - (tm2->tv_sec * 1000000.0)); + # endif + } + } +--- 982,988 ---- + double usec = (tm->tv_sec * 1000000.0 + tm->tv_usec) / count; + + tm2->tv_sec = floor(usec / 1000000.0); +! tm2->tv_usec = vim_round(usec - (tm2->tv_sec * 1000000.0)); + # endif + } + } +*** ../vim-7.3.1158/src/eval.c 2013-06-09 20:50:56.000000000 +0200 +--- src/eval.c 2013-06-10 20:05:59.000000000 +0200 +*************** +*** 15774,15779 **** +--- 15774,15790 ---- + } + + #ifdef FEAT_FLOAT ++ ++ /* ++ * round() is not in C90, use ceil() or floor() instead. ++ */ ++ float_T ++ vim_round(f) ++ float_T f; ++ { ++ return f > 0 ? floor(f + 0.5) : ceil(f - 0.5); ++ } ++ + /* + * "round({float})" function + */ +*************** +*** 15786,15793 **** + + rettv->v_type = VAR_FLOAT; + if (get_float_arg(argvars, &f) == OK) +! /* round() is not in C90, use ceil() or floor() instead. */ +! rettv->vval.v_float = f > 0 ? floor(f + 0.5) : ceil(f - 0.5); + else + rettv->vval.v_float = 0.0; + } +--- 15797,15803 ---- + + rettv->v_type = VAR_FLOAT; + if (get_float_arg(argvars, &f) == OK) +! rettv->vval.v_float = vim_round(f); + else + rettv->vval.v_float = 0.0; + } +*** ../vim-7.3.1158/src/proto/eval.pro 2013-05-30 13:37:23.000000000 +0200 +--- src/proto/eval.pro 2013-06-10 20:05:57.000000000 +0200 +*************** +*** 75,87 **** + dictitem_T *dict_find __ARGS((dict_T *d, char_u *key, int len)); + char_u *get_dict_string __ARGS((dict_T *d, char_u *key, int save)); + long get_dict_number __ARGS((dict_T *d, char_u *key)); +- void dict_extend __ARGS((dict_T *d1, dict_T *d2, char_u *action)); + char_u *get_function_name __ARGS((expand_T *xp, int idx)); + char_u *get_expr_name __ARGS((expand_T *xp, int idx)); +- char_u *get_expanded_name __ARGS((char_u *name, int check)); +- int translated_function_exists __ARGS((char_u *name)); + int func_call __ARGS((char_u *name, typval_T *args, dict_T *selfdict, typval_T *rettv)); + void mzscheme_call_vim __ARGS((char_u *name, typval_T *args, typval_T *rettv)); + long do_searchpair __ARGS((char_u *spat, char_u *mpat, char_u *epat, int dir, char_u *skip, int flags, pos_T *match_pos, linenr_T lnum_stop, long time_limit)); + void set_vim_var_nr __ARGS((int idx, long val)); + long get_vim_var_nr __ARGS((int idx)); +--- 75,86 ---- + dictitem_T *dict_find __ARGS((dict_T *d, char_u *key, int len)); + char_u *get_dict_string __ARGS((dict_T *d, char_u *key, int save)); + long get_dict_number __ARGS((dict_T *d, char_u *key)); + char_u *get_function_name __ARGS((expand_T *xp, int idx)); + char_u *get_expr_name __ARGS((expand_T *xp, int idx)); + int func_call __ARGS((char_u *name, typval_T *args, dict_T *selfdict, typval_T *rettv)); ++ void dict_extend __ARGS((dict_T *d1, dict_T *d2, char_u *action)); + void mzscheme_call_vim __ARGS((char_u *name, typval_T *args, typval_T *rettv)); ++ float_T vim_round __ARGS((float_T f)); + long do_searchpair __ARGS((char_u *spat, char_u *mpat, char_u *epat, int dir, char_u *skip, int flags, pos_T *match_pos, linenr_T lnum_stop, long time_limit)); + void set_vim_var_nr __ARGS((int idx, long val)); + long get_vim_var_nr __ARGS((int idx)); +*************** +*** 110,115 **** +--- 109,116 ---- + void ex_execute __ARGS((exarg_T *eap)); + void ex_function __ARGS((exarg_T *eap)); + void free_all_functions __ARGS((void)); ++ int translated_function_exists __ARGS((char_u *name)); ++ char_u *get_expanded_name __ARGS((char_u *name, int check)); + void func_dump_profile __ARGS((FILE *fd)); + char_u *get_user_func_name __ARGS((expand_T *xp, int idx)); + void ex_delfunction __ARGS((exarg_T *eap)); +*** ../vim-7.3.1158/src/version.c 2013-06-10 18:36:20.000000000 +0200 +--- src/version.c 2013-06-10 20:02:01.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1159, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +134. You consider bandwidth to be more important than carats. + + /// 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 /// diff --git a/7.3.1160 b/7.3.1160 new file mode 100644 index 0000000..143a9d2 --- /dev/null +++ b/7.3.1160 @@ -0,0 +1,56 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1160 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1160 +Problem: Mixing long and pointer doesn't always work. +Solution: Avoid cast to pointer. +Files: src/undo.c + + +*** ../vim-7.3.1159/src/undo.c 2013-04-15 15:47:07.000000000 +0200 +--- src/undo.c 2013-06-10 20:13:37.000000000 +0200 +*************** +*** 1514,1521 **** + write_ok = TRUE; + #ifdef U_DEBUG + if (headers_written != buf->b_u_numhead) +! EMSG3("Written %ld headers, but numhead is %ld", +! headers_written, buf->b_u_numhead); + #endif + + write_error: +--- 1514,1523 ---- + write_ok = TRUE; + #ifdef U_DEBUG + if (headers_written != buf->b_u_numhead) +! { +! EMSGN("Written %ld headers, ...", headers_written); +! EMSGN("... but numhead is %ld", buf->b_u_numhead); +! } + #endif + + write_error: +*** ../vim-7.3.1159/src/version.c 2013-06-10 20:10:40.000000000 +0200 +--- src/version.c 2013-06-10 20:14:58.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1160, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +135. You cut classes or miss work so you can stay home and browse the web. + + /// 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 /// diff --git a/7.3.1161 b/7.3.1161 new file mode 100644 index 0000000..7f9558e --- /dev/null +++ b/7.3.1161 @@ -0,0 +1,194 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1161 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1161 +Problem: Python: PyList_SetItem() is inefficient. +Solution: Use PyList_SET_ITEM() (ZyX) +Files: src/if_py_both.h + + +*** ../vim-7.3.1160/src/if_py_both.h 2013-06-05 20:34:07.000000000 +0200 +--- src/if_py_both.h 2013-06-10 20:37:50.000000000 +0200 +*************** +*** 375,382 **** + static int + PythonIO_Init_io(void) + { +! PySys_SetObject("stdout", (PyObject *)(void *)&Output); +! PySys_SetObject("stderr", (PyObject *)(void *)&Error); + + if (PyErr_Occurred()) + { +--- 375,384 ---- + static int + PythonIO_Init_io(void) + { +! if (PySys_SetObject("stdout", (PyObject *)(void *)&Output)) +! return -1; +! if (PySys_SetObject("stderr", (PyObject *)(void *)&Error)) +! return -1; + + if (PyErr_Occurred()) + { +*************** +*** 1319,1330 **** + Py_DECREF(r); + return NULL; + } +! if (PyList_SetItem(r, i, newObj)) +! { +! Py_DECREF(r); +! Py_DECREF(newObj); +! return NULL; +! } + --todo; + ++i; + } +--- 1321,1327 ---- + Py_DECREF(r); + return NULL; + } +! PyList_SET_ITEM(r, i, newObj); + --todo; + ++i; + } +*************** +*** 1808,1819 **** + return NULL; + } + +! if ((PyList_SetItem(list, ((reversed)?(n-i-1):(i)), item))) +! { +! Py_DECREF(item); +! Py_DECREF(list); +! return NULL; +! } + } + + return list; +--- 1805,1811 ---- + return NULL; + } + +! PyList_SET_ITEM(list, ((reversed)?(n-i-1):(i)), item); + } + + return list; +*************** +*** 3164,3176 **** + return NULL; + } + +! /* Set the list item */ +! if (PyList_SetItem(list, i, str)) +! { +! Py_DECREF(str); +! Py_DECREF(list); +! return NULL; +! } + } + + /* The ownership of the Python list is passed to the caller (ie, +--- 3156,3162 ---- + return NULL; + } + +! PyList_SET_ITEM(list, i, str); + } + + /* The ownership of the Python list is passed to the caller (ie, +*************** +*** 5366,5373 **** + static int + populate_module(PyObject *m, object_adder add_object, attr_getter get_attr) + { +! int i; +! PyObject *os; + + for (i = 0; i < (int)(sizeof(numeric_constants) + / sizeof(struct numeric_constant)); +--- 5352,5359 ---- + static int + populate_module(PyObject *m, object_adder add_object, attr_getter get_attr) + { +! int i; +! PyObject *other_module; + + for (i = 0; i < (int)(sizeof(numeric_constants) + / sizeof(struct numeric_constant)); +*************** +*** 5395,5418 **** + ADD_CHECKED_OBJECT(m, "options", + OptionsNew(SREQ_GLOBAL, NULL, dummy_check, NULL)); + +! if (!(os = PyImport_ImportModule("os"))) + return -1; +! ADD_OBJECT(m, "os", os); + +! if (!(py_getcwd = PyObject_GetAttrString(os, "getcwd"))) + return -1; + ADD_OBJECT(m, "_getcwd", py_getcwd) + +! if (!(py_chdir = PyObject_GetAttrString(os, "chdir"))) + return -1; + ADD_OBJECT(m, "_chdir", py_chdir); +! if (PyObject_SetAttrString(os, "chdir", get_attr(m, "chdir"))) + return -1; + +! if ((py_fchdir = PyObject_GetAttrString(os, "fchdir"))) + { + ADD_OBJECT(m, "_fchdir", py_fchdir); +! if (PyObject_SetAttrString(os, "fchdir", get_attr(m, "fchdir"))) + return -1; + } + else +--- 5381,5404 ---- + ADD_CHECKED_OBJECT(m, "options", + OptionsNew(SREQ_GLOBAL, NULL, dummy_check, NULL)); + +! if (!(other_module = PyImport_ImportModule("os"))) + return -1; +! ADD_OBJECT(m, "os", other_module); + +! if (!(py_getcwd = PyObject_GetAttrString(other_module, "getcwd"))) + return -1; + ADD_OBJECT(m, "_getcwd", py_getcwd) + +! if (!(py_chdir = PyObject_GetAttrString(other_module, "chdir"))) + return -1; + ADD_OBJECT(m, "_chdir", py_chdir); +! if (PyObject_SetAttrString(other_module, "chdir", get_attr(m, "chdir"))) + return -1; + +! if ((py_fchdir = PyObject_GetAttrString(other_module, "fchdir"))) + { + ADD_OBJECT(m, "_fchdir", py_fchdir); +! if (PyObject_SetAttrString(other_module,"fchdir",get_attr(m,"fchdir"))) + return -1; + } + else +*** ../vim-7.3.1160/src/version.c 2013-06-10 20:25:05.000000000 +0200 +--- src/version.c 2013-06-10 20:37:02.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1161, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +136. You decide to stay in a low-paying job teaching just for the + free Internet access. + + /// 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 /// diff --git a/7.3.1162 b/7.3.1162 new file mode 100644 index 0000000..547f965 --- /dev/null +++ b/7.3.1162 @@ -0,0 +1,163 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1162 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1162 +Problem: Python: Memory leaks +Solution: Add more Py_DECREF(). (ZyX) +Files: src/if_py_both.h, src/if_python.c + + +*** ../vim-7.3.1161/src/if_py_both.h 2013-06-10 20:38:58.000000000 +0200 +--- src/if_py_both.h 2013-06-10 20:43:01.000000000 +0200 +*************** +*** 5354,5359 **** +--- 5354,5360 ---- + { + int i; + PyObject *other_module; ++ PyObject *attr; + + for (i = 0; i < (int)(sizeof(numeric_constants) + / sizeof(struct numeric_constant)); +*************** +*** 5392,5405 **** + if (!(py_chdir = PyObject_GetAttrString(other_module, "chdir"))) + return -1; + ADD_OBJECT(m, "_chdir", py_chdir); +! if (PyObject_SetAttrString(other_module, "chdir", get_attr(m, "chdir"))) + return -1; + + if ((py_fchdir = PyObject_GetAttrString(other_module, "fchdir"))) + { + ADD_OBJECT(m, "_fchdir", py_fchdir); +! if (PyObject_SetAttrString(other_module,"fchdir",get_attr(m,"fchdir"))) + return -1; + } + else + PyErr_Clear(); +--- 5393,5418 ---- + if (!(py_chdir = PyObject_GetAttrString(other_module, "chdir"))) + return -1; + ADD_OBJECT(m, "_chdir", py_chdir); +! if (!(attr = get_attr(m, "chdir"))) + return -1; ++ if (PyObject_SetAttrString(other_module, "chdir", attr)) ++ { ++ Py_DECREF(attr); ++ return -1; ++ } ++ Py_DECREF(attr); + + if ((py_fchdir = PyObject_GetAttrString(other_module, "fchdir"))) + { + ADD_OBJECT(m, "_fchdir", py_fchdir); +! if (!(attr = get_attr(m, "fchdir"))) +! return -1; +! if (PyObject_SetAttrString(other_module, "fchdir", attr)) +! { +! Py_DECREF(attr); + return -1; ++ } ++ Py_DECREF(attr); + } + else + PyErr_Clear(); +*** ../vim-7.3.1161/src/if_python.c 2013-06-10 18:36:20.000000000 +0200 +--- src/if_python.c 2013-06-10 20:42:44.000000000 +0200 +*************** +*** 210,215 **** +--- 210,216 ---- + # define PyMapping_Check dll_PyMapping_Check + # define PyIter_Next dll_PyIter_Next + # define PyModule_GetDict dll_PyModule_GetDict ++ # define PyModule_AddObject dll_PyModule_AddObject + # define PyRun_SimpleString dll_PyRun_SimpleString + # define PyRun_String dll_PyRun_String + # define PyObject_GetAttrString dll_PyObject_GetAttrString +*************** +*** 344,349 **** +--- 345,351 ---- + static int (*dll_PyMapping_Check)(PyObject *); + static PyObject* (*dll_PyIter_Next)(PyObject *); + static PyObject*(*dll_PyModule_GetDict)(PyObject *); ++ static int(*dll_PyModule_AddObject)(PyObject *, const char *, PyObject *); + static int(*dll_PyRun_SimpleString)(char *); + static PyObject *(*dll_PyRun_String)(char *, int, PyObject *, PyObject *); + static PyObject* (*dll_PyObject_GetAttrString)(PyObject *, const char *); +*************** +*** 509,514 **** +--- 511,517 ---- + {"PyMapping_Check", (PYTHON_PROC*)&dll_PyMapping_Check}, + {"PyIter_Next", (PYTHON_PROC*)&dll_PyIter_Next}, + {"PyModule_GetDict", (PYTHON_PROC*)&dll_PyModule_GetDict}, ++ {"PyModule_AddObject", (PYTHON_PROC*)&dll_PyModule_AddObject}, + {"PyRun_SimpleString", (PYTHON_PROC*)&dll_PyRun_SimpleString}, + {"PyRun_String", (PYTHON_PROC*)&dll_PyRun_String}, + {"PyObject_GetAttrString", (PYTHON_PROC*)&dll_PyObject_GetAttrString}, +*************** +*** 1357,1375 **** + #endif + + static int +- add_object(PyObject *dict, const char *name, PyObject *object) +- { +- if (PyDict_SetItemString(dict, (char *) name, object)) +- return -1; +- Py_DECREF(object); +- return 0; +- } +- +- static int + PythonMod_Init(void) + { + PyObject *mod; +- PyObject *dict; + + /* The special value is removed from sys.path in Python_Init(). */ + static char *(argv[2]) = {"/must>not&exist/foo", NULL}; +--- 1360,1368 ---- +*************** +*** 1382,1390 **** + + mod = Py_InitModule4("vim", VimMethods, (char *)NULL, (PyObject *)NULL, + PYTHON_API_VERSION); +- dict = PyModule_GetDict(mod); + +! return populate_module(dict, add_object, PyDict_GetItemString); + } + + /************************************************************************* +--- 1375,1382 ---- + + mod = Py_InitModule4("vim", VimMethods, (char *)NULL, (PyObject *)NULL, + PYTHON_API_VERSION); + +! return populate_module(mod, PyModule_AddObject, PyObject_GetAttrString); + } + + /************************************************************************* +*** ../vim-7.3.1161/src/version.c 2013-06-10 20:38:58.000000000 +0200 +--- src/version.c 2013-06-10 20:40:25.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1162, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +137. You decide to stay in college for an additional year or two, + just so you can have the free Internet access. + + /// 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 /// diff --git a/7.3.1163 b/7.3.1163 new file mode 100644 index 0000000..35d9270 --- /dev/null +++ b/7.3.1163 @@ -0,0 +1,1313 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1163 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1163 +Problem: Not easy to load Python modules. +Solution: Search "python2", "python3" and "pythonx" directories in + 'runtimepath' for Python modules. (ZyX) +Files: runtime/doc/if_pyth.txt, src/configure.in, src/ex_cmds2.c, + src/if_py_both.h, src/if_python.c, src/if_python3.c, + src/testdir/test86.in, src/testdir/test87.in, src/auto/configure + + +*** ../vim-7.3.1162/runtime/doc/if_pyth.txt 2013-06-02 18:20:12.000000000 +0200 +--- runtime/doc/if_pyth.txt 2013-06-10 20:51:21.000000000 +0200 +*************** +*** 180,185 **** +--- 180,191 ---- + Like |strwidth()|: returns number of display cells str occupies, tab + is counted as one cell. + ++ vim.foreach_rtp(callable) *python-foreach_rtp* ++ Call the given callable for each path in 'runtimepath' until either ++ callable returns something but None, the exception is raised or there ++ are no longer paths. If stopped in case callable returned non-None, ++ vim.foreach_rtp function returns the value returned by callable. ++ + vim.chdir(*args, **kwargs) *python-chdir* + vim.fchdir(*args, **kwargs) *python-fchdir* + Run os.chdir or os.fchdir, then all appropriate vim stuff. +*************** +*** 300,305 **** +--- 306,418 ---- + supported, and may cause the program to crash. This should probably be + fixed. + ++ *python2-directory* *python3-directory* *pythonx-directory* ++ Python 'runtimepath' handling *python-special-path* ++ ++ In python vim.VIM_SPECIAL_PATH special directory is used as a replacement for ++ the list of paths found in 'runtimepath': with this directory in sys.path and ++ vim.path_hooks in sys.path_hooks python will try to load module from ++ {rtp}/python2 (or python3) and {rtp}/pythonx (for both python versions) for ++ each {rtp} found in 'runtimepath'. ++ ++ Implementation for python 2 is the following: usual importing code with empty ++ lists in place of sys.path_hooks and sys.meta_path. Code is similar to the ++ below, but written in C: > ++ ++ # Assuming vim variable is already accessible and is set to the current ++ # module ++ import sys ++ ++ def find_module(fullname): ++ return vim ++ ++ def load_module(fullname): ++ # see vim._get_paths below ++ new_path = _get_paths() ++ ++ try: old_path = sys.path ++ except: pass ++ try: old_meta_path = sys.meta_path ++ except: pass ++ try: old_path_hooks = sys.path_hooks ++ except: pass ++ ++ sys.meta_path = [] ++ sys.path_hooks = sys.meta_path ++ sys.path = new_path ++ ++ try: ++ exec ('import ' + fullname + ' as m') # No actual exec in C code ++ return m ++ finally: ++ e = None ++ try: sys.path = old_path ++ except Exception as e: pass ++ try: sys.meta_path = old_meta_path ++ except Exception as e: pass ++ try: sys.path_hooks = old_path_hooks ++ except Exception as e: pass ++ if e: ++ raise e ++ ++ def path_hook(d): ++ if d == VIM_SPECIAL_PATH: ++ return vim ++ raise ImportError ++ ++ sys.path_hooks.append(path_hook) ++ ++ Implementation for python 3 is cleaner: code is similar to the following, but, ++ again, written in C: > ++ ++ from importlib.machinery import PathFinder ++ import sys ++ ++ class Finder(PathFinder): ++ @classmethod ++ def find_module(cls, fullname): ++ # see vim._get_paths below ++ new_path = _get_paths() ++ ++ # super().find_module is also a class method ++ # super() is not used because this variant is easier to implement ++ # in C ++ return PathFinder.find_module(fullname, new_path) ++ ++ def path_hook(path): ++ if path == VIM_SPECIAL_PATH: ++ return Finder ++ raise ImportError ++ ++ sys.path_hooks.append(path_hook) ++ ++ vim.VIM_SPECIAL_PATH *python-VIM_SPECIAL_PATH* ++ String constant used in conjunction with vim path hook. If path hook ++ installed by vim is requested to handle anything but path equal to ++ vim.VIM_SPECIAL_PATH constant it raises ImportError. In the only other ++ case it uses special loader. ++ ++ Note: you must not use value of this constant directly, always use ++ vim.VIM_SPECIAL_PATH object. ++ ++ vim.load_module(name) *python-load_module* ++ vim.find_module(...) *python-find_module* ++ vim.path_hook(path) *python-path_hook* ++ Methods or objects used to implement path loading as described above. ++ You should not be using any of these directly except for vim.path_hook ++ in case you need to do something with sys.meta_path. It is not ++ guaranteed that any of the objects will exist in the future vim ++ versions. In fact, load_module and find_module methods do not exists ++ in python3. ++ ++ vim._get_paths *python-_get_paths* ++ Methods returning a list of paths which will be searched for by path ++ hook. You should not rely on this method being present in future ++ versions, but can use it for debugging. ++ ++ It returns a list of {rtp}/python2 (or {rtp}/python3) and ++ {rtp}/pythonx directories for each {rtp} in 'runtimepath'. ++ + ============================================================================== + 3. Buffer objects *python-buffer* + +*************** +*** 340,346 **** + |BufFilePost| autocommands are launched. + b.number Buffer number. Can be used as |python-buffers| key. + Read-only. +! b.valid True or False. Buffer object becames invalid when + corresponding buffer is wiped out. + + The buffer object methods are: +--- 453,459 ---- + |BufFilePost| autocommands are launched. + b.number Buffer number. Can be used as |python-buffers| key. + Read-only. +! b.valid True or False. Buffer object becomes invalid when + corresponding buffer is wiped out. + + The buffer object methods are: +*************** +*** 446,452 **** + row, col (read-only) On-screen window position in display cells. + First position is zero. + tabpage (read-only) Window tab page. +! valid (read-write) True or False. Window object becames invalid + when corresponding window is closed. + + The height attribute is writable only if the screen is split horizontally. +--- 559,565 ---- + row, col (read-only) On-screen window position in display cells. + First position is zero. + tabpage (read-only) Window tab page. +! valid (read-write) True or False. Window object becomes invalid + when corresponding window is closed. + + The height attribute is writable only if the screen is split horizontally. +*************** +*** 471,477 **** + windows Like |python-windows|, but for current tab page. + vars The tab page |t:| variables. + window Current tabpage window. +! valid True or False. Tab page object becames invalid when + corresponding tab page is closed. + + TabPage object type is available using "TabPage" attribute of vim module. +--- 584,590 ---- + windows Like |python-windows|, but for current tab page. + vars The tab page |t:| variables. + window Current tabpage window. +! valid True or False. Tab page object becomes invalid when + corresponding tab page is closed. + + TabPage object type is available using "TabPage" attribute of vim module. +*** ../vim-7.3.1162/src/configure.in 2013-06-02 19:14:11.000000000 +0200 +--- src/configure.in 2013-06-10 20:51:21.000000000 +0200 +*************** +*** 863,872 **** + ${vi_cv_path_python} -c 'import sys; print sys.version[:3]'` + ]]) + +! dnl -- it must be at least version 2.2 +! AC_MSG_CHECKING(Python is 2.2 or better) + if ${vi_cv_path_python} -c \ +! "import sys; sys.exit(${vi_cv_var_python_version} < 2.2)" + then + AC_MSG_RESULT(yep) + +--- 863,872 ---- + ${vi_cv_path_python} -c 'import sys; print sys.version[:3]'` + ]]) + +! dnl -- it must be at least version 2.3 +! AC_MSG_CHECKING(Python is 2.3 or better) + if ${vi_cv_path_python} -c \ +! "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)" + then + AC_MSG_RESULT(yep) + +*** ../vim-7.3.1162/src/ex_cmds2.c 2013-06-10 20:10:40.000000000 +0200 +--- src/ex_cmds2.c 2013-06-10 20:51:21.000000000 +0200 +*************** +*** 2737,2742 **** +--- 2737,2746 ---- + * When "all" is TRUE repeat for all matches, otherwise only the first one is + * used. + * Returns OK when at least one match found, FAIL otherwise. ++ * ++ * If "name" is NULL calls callback for each entry in runtimepath. Cookie is ++ * passed by reference in this case, setting it to NULL indicates that callback ++ * has done its job. + */ + int + do_in_runtimepath(name, all, callback, cookie) +*************** +*** 2768,2774 **** + buf = alloc(MAXPATHL); + if (buf != NULL && rtp_copy != NULL) + { +! if (p_verbose > 1) + { + verbose_enter(); + smsg((char_u *)_("Searching for \"%s\" in \"%s\""), +--- 2772,2778 ---- + buf = alloc(MAXPATHL); + if (buf != NULL && rtp_copy != NULL) + { +! if (p_verbose > 1 && name != NULL) + { + verbose_enter(); + smsg((char_u *)_("Searching for \"%s\" in \"%s\""), +*************** +*** 2782,2788 **** + { + /* Copy the path from 'runtimepath' to buf[]. */ + copy_option_part(&rtp, buf, MAXPATHL, ","); +! if (STRLEN(buf) + STRLEN(name) + 2 < MAXPATHL) + { + add_pathsep(buf); + tail = buf + STRLEN(buf); +--- 2786,2798 ---- + { + /* Copy the path from 'runtimepath' to buf[]. */ + copy_option_part(&rtp, buf, MAXPATHL, ","); +! if (name == NULL) +! { +! (*callback)(buf, (void *) &cookie); +! if (!did_one) +! did_one = (cookie == NULL); +! } +! else if (STRLEN(buf) + STRLEN(name) + 2 < MAXPATHL) + { + add_pathsep(buf); + tail = buf + STRLEN(buf); +*************** +*** 2821,2827 **** + } + vim_free(buf); + vim_free(rtp_copy); +! if (p_verbose > 0 && !did_one) + { + verbose_enter(); + smsg((char_u *)_("not found in 'runtimepath': \"%s\""), name); +--- 2831,2837 ---- + } + vim_free(buf); + vim_free(rtp_copy); +! if (p_verbose > 0 && !did_one && name != NULL) + { + verbose_enter(); + smsg((char_u *)_("not found in 'runtimepath': \"%s\""), name); +*** ../vim-7.3.1162/src/if_py_both.h 2013-06-10 20:47:33.000000000 +0200 +--- src/if_py_both.h 2013-06-10 20:55:17.000000000 +0200 +*************** +*** 24,29 **** +--- 24,31 ---- + #endif + #define DOPY_FUNC "_vim_pydo" + ++ static const char *vim_special_path = "_vim_path_"; ++ + #define PyErr_SetVim(str) PyErr_SetString(VimError, str) + + #define RAISE_NO_EMPTY_KEYS PyErr_SetString(PyExc_ValueError, \ +*************** +*** 55,60 **** +--- 57,64 ---- + static PyObject *py_chdir; + static PyObject *py_fchdir; + static PyObject *py_getcwd; ++ static PyObject *vim_module; ++ static PyObject *vim_special_path_object; + + /* + * obtain a lock on the Vim data structures +*************** +*** 779,797 **** + return _VimChdir(py_fchdir, args, kwargs); + } + + /* + * Vim module - Definitions + */ + + static struct PyMethodDef VimMethods[] = { +! /* name, function, calling, documentation */ +! {"command", VimCommand, METH_VARARGS, "Execute a Vim ex-mode command" }, +! {"eval", VimEval, METH_VARARGS, "Evaluate an expression using Vim evaluator" }, +! {"bindeval", VimEvalPy, METH_VARARGS, "Like eval(), but returns objects attached to vim ones"}, +! {"strwidth", VimStrwidth, METH_VARARGS, "Screen string width, counts as having width 1"}, +! {"chdir", (PyCFunction)VimChdir, METH_VARARGS|METH_KEYWORDS, "Change directory"}, +! {"fchdir", (PyCFunction)VimFchdir, METH_VARARGS|METH_KEYWORDS, "Change directory"}, +! { NULL, NULL, 0, NULL } + }; + + /* +--- 783,950 ---- + return _VimChdir(py_fchdir, args, kwargs); + } + ++ typedef struct { ++ PyObject *callable; ++ PyObject *result; ++ } map_rtp_data; ++ ++ static void ++ map_rtp_callback(char_u *path, void *_data) ++ { ++ void **data = (void **) _data; ++ PyObject *pathObject; ++ map_rtp_data *mr_data = *((map_rtp_data **) data); ++ ++ if (!(pathObject = PyString_FromString((char *) path))) ++ { ++ *data = NULL; ++ return; ++ } ++ ++ mr_data->result = PyObject_CallFunctionObjArgs(mr_data->callable, ++ pathObject, NULL); ++ ++ Py_DECREF(pathObject); ++ ++ if (!mr_data->result || mr_data->result != Py_None) ++ *data = NULL; ++ else ++ { ++ Py_DECREF(mr_data->result); ++ mr_data->result = NULL; ++ } ++ } ++ ++ static PyObject * ++ VimForeachRTP(PyObject *self UNUSED, PyObject *args) ++ { ++ map_rtp_data data; ++ ++ if (!PyArg_ParseTuple(args, "O", &data.callable)) ++ return NULL; ++ ++ data.result = NULL; ++ ++ do_in_runtimepath(NULL, FALSE, &map_rtp_callback, &data); ++ ++ if (data.result == NULL) ++ { ++ if (PyErr_Occurred()) ++ return NULL; ++ else ++ { ++ Py_INCREF(Py_None); ++ return Py_None; ++ } ++ } ++ return data.result; ++ } ++ ++ /* ++ * _vim_runtimepath_ special path implementation. ++ */ ++ ++ static void ++ map_finder_callback(char_u *path, void *_data) ++ { ++ void **data = (void **) _data; ++ PyObject *list = *((PyObject **) data); ++ PyObject *pathObject1, *pathObject2; ++ char *pathbuf; ++ size_t pathlen; ++ ++ pathlen = STRLEN(path); ++ ++ #if PY_MAJOR_VERSION < 3 ++ # define PY_MAIN_DIR_STRING "python2" ++ #else ++ # define PY_MAIN_DIR_STRING "python3" ++ #endif ++ #define PY_ALTERNATE_DIR_STRING "pythonx" ++ ++ #define PYTHONX_STRING_LENGTH 7 /* STRLEN("pythonx") */ ++ if (!(pathbuf = PyMem_New(char, ++ pathlen + STRLEN(PATHSEPSTR) + PYTHONX_STRING_LENGTH + 1))) ++ { ++ PyErr_NoMemory(); ++ *data = NULL; ++ return; ++ } ++ ++ mch_memmove(pathbuf, path, pathlen + 1); ++ add_pathsep((char_u *) pathbuf); ++ ++ pathlen = STRLEN(pathbuf); ++ mch_memmove(pathbuf + pathlen, PY_MAIN_DIR_STRING, ++ PYTHONX_STRING_LENGTH + 1); ++ ++ if (!(pathObject1 = PyString_FromString(pathbuf))) ++ { ++ *data = NULL; ++ PyMem_Free(pathbuf); ++ return; ++ } ++ ++ mch_memmove(pathbuf + pathlen, PY_ALTERNATE_DIR_STRING, ++ PYTHONX_STRING_LENGTH + 1); ++ ++ if (!(pathObject2 = PyString_FromString(pathbuf))) ++ { ++ Py_DECREF(pathObject1); ++ PyMem_Free(pathbuf); ++ *data = NULL; ++ return; ++ } ++ ++ PyMem_Free(pathbuf); ++ ++ if (PyList_Append(list, pathObject1) ++ || PyList_Append(list, pathObject2)) ++ *data = NULL; ++ ++ Py_DECREF(pathObject1); ++ Py_DECREF(pathObject2); ++ } ++ ++ static PyObject * ++ Vim_GetPaths(PyObject *self UNUSED) ++ { ++ PyObject *r; ++ ++ if (!(r = PyList_New(0))) ++ return NULL; ++ ++ do_in_runtimepath(NULL, FALSE, &map_finder_callback, r); ++ ++ if (PyErr_Occurred()) ++ { ++ Py_DECREF(r); ++ return NULL; ++ } ++ ++ return r; ++ } ++ + /* + * Vim module - Definitions + */ + + static struct PyMethodDef VimMethods[] = { +! /* name, function, calling, documentation */ +! {"command", VimCommand, METH_VARARGS, "Execute a Vim ex-mode command" }, +! {"eval", VimEval, METH_VARARGS, "Evaluate an expression using Vim evaluator" }, +! {"bindeval", VimEvalPy, METH_VARARGS, "Like eval(), but returns objects attached to vim ones"}, +! {"strwidth", VimStrwidth, METH_VARARGS, "Screen string width, counts as having width 1"}, +! {"chdir", (PyCFunction)VimChdir, METH_VARARGS|METH_KEYWORDS, "Change directory"}, +! {"fchdir", (PyCFunction)VimFchdir, METH_VARARGS|METH_KEYWORDS, "Change directory"}, +! {"foreach_rtp", VimForeachRTP, METH_VARARGS, "Call given callable for each path in &rtp"}, +! #if PY_MAJOR_VERSION < 3 +! {"find_module", FinderFindModule, METH_VARARGS, "Internal use only, returns loader object for any input it receives"}, +! {"load_module", LoaderLoadModule, METH_VARARGS, "Internal use only, tries importing the given module from &rtp by temporary mocking sys.path (to an rtp-based one) and unsetting sys.meta_path and sys.path_hooks"}, +! #endif +! {"path_hook", VimPathHook, METH_VARARGS, "Hook function to install in sys.path_hooks"}, +! {"_get_paths", (PyCFunction)Vim_GetPaths, METH_NOARGS, "Get &rtp-based additions to sys.path"}, +! { NULL, NULL, 0, NULL} + }; + + /* +*************** +*** 5036,5041 **** +--- 5189,5202 ---- + } CurrentObject; + static PyTypeObject CurrentType; + ++ #if PY_MAJOR_VERSION >= 3 ++ typedef struct ++ { ++ PyObject_HEAD ++ } FinderObject; ++ static PyTypeObject FinderType; ++ #endif ++ + static void + init_structs(void) + { +*************** +*** 5281,5286 **** +--- 5442,5522 ---- + PYTYPE_READY(FunctionType); + PYTYPE_READY(OptionsType); + PYTYPE_READY(OutputType); ++ #if PY_MAJOR_VERSION >= 3 ++ PYTYPE_READY(FinderType); ++ #endif ++ return 0; ++ } ++ ++ static int ++ init_sys_path() ++ { ++ PyObject *path; ++ PyObject *path_hook; ++ PyObject *path_hooks; ++ ++ if (!(path_hook = PyObject_GetAttrString(vim_module, "path_hook"))) ++ return -1; ++ ++ if (!(path_hooks = PySys_GetObject("path_hooks"))) ++ { ++ PyErr_Clear(); ++ path_hooks = PyList_New(1); ++ PyList_SET_ITEM(path_hooks, 0, path_hook); ++ if (PySys_SetObject("path_hooks", path_hooks)) ++ { ++ Py_DECREF(path_hooks); ++ return -1; ++ } ++ Py_DECREF(path_hooks); ++ } ++ else if (PyList_Check(path_hooks)) ++ { ++ if (PyList_Append(path_hooks, path_hook)) ++ { ++ Py_DECREF(path_hook); ++ return -1; ++ } ++ Py_DECREF(path_hook); ++ } ++ else ++ { ++ VimTryStart(); ++ EMSG(_("Failed to set path hook: sys.path_hooks is not a list\n" ++ "You should now do the following:\n" ++ "- append vim.path_hook to sys.path_hooks\n" ++ "- append vim.VIM_SPECIAL_PATH to sys.path\n")); ++ VimTryEnd(); /* Discard the error */ ++ Py_DECREF(path_hook); ++ return 0; ++ } ++ ++ if (!(path = PySys_GetObject("path"))) ++ { ++ PyErr_Clear(); ++ path = PyList_New(1); ++ Py_INCREF(vim_special_path_object); ++ PyList_SET_ITEM(path, 0, vim_special_path_object); ++ if (PySys_SetObject("path", path)) ++ { ++ Py_DECREF(path); ++ return -1; ++ } ++ Py_DECREF(path); ++ } ++ else if (PyList_Check(path)) ++ { ++ if (PyList_Append(path, vim_special_path_object)) ++ return -1; ++ } ++ else ++ { ++ VimTryStart(); ++ EMSG(_("Failed to set path: sys.path is not a list\n" ++ "You should now append vim.VIM_SPECIAL_PATH to sys.path")); ++ VimTryEnd(); /* Discard the error */ ++ } ++ + return 0; + } + +*************** +*** 5332,5337 **** +--- 5568,5576 ---- + {"List", (PyObject *)&ListType}, + {"Function", (PyObject *)&FunctionType}, + {"Options", (PyObject *)&OptionsType}, ++ #if PY_MAJOR_VERSION >= 3 ++ {"Finder", (PyObject *)&FinderType}, ++ #endif + }; + + typedef int (*object_adder)(PyObject *, const char *, PyObject *); +*************** +*** 5417,5421 **** +--- 5656,5672 ---- + else + PyErr_Clear(); + ++ if (!(vim_special_path_object = PyString_FromString(vim_special_path))) ++ return -1; ++ ++ ADD_OBJECT(m, "VIM_SPECIAL_PATH", vim_special_path_object); ++ ++ #if PY_MAJOR_VERSION >= 3 ++ ADD_OBJECT(m, "_PathFinder", path_finder); ++ ADD_CHECKED_OBJECT(m, "_find_module", ++ (py_find_module = PyObject_GetAttrString(path_finder, ++ "find_module"))); ++ #endif ++ + return 0; + } +*** ../vim-7.3.1162/src/if_python.c 2013-06-10 20:47:33.000000000 +0200 +--- src/if_python.c 2013-06-10 20:55:04.000000000 +0200 +*************** +*** 24,32 **** + /* uncomment this if used with the debug version of python. + * Checked on 2.7.4. */ + /* #define Py_DEBUG */ +! /* Note: most of time you can add -DPy_DEBUG to CFLAGS in place of uncommenting + */ +! /* uncomment this if used with the debug version of python, but without its + * allocator */ + /* #define Py_DEBUG_NO_PYMALLOC */ + +--- 24,32 ---- + /* uncomment this if used with the debug version of python. + * Checked on 2.7.4. */ + /* #define Py_DEBUG */ +! /* Note: most of time you can add -DPy_DEBUG to CFLAGS in place of uncommenting + */ +! /* uncomment this if used with the debug version of python, but without its + * allocator */ + /* #define Py_DEBUG_NO_PYMALLOC */ + +*************** +*** 168,173 **** +--- 168,174 ---- + # define PyErr_SetNone dll_PyErr_SetNone + # define PyErr_SetString dll_PyErr_SetString + # define PyErr_SetObject dll_PyErr_SetObject ++ # define PyErr_ExceptionMatches dll_PyErr_ExceptionMatches + # define PyEval_InitThreads dll_PyEval_InitThreads + # define PyEval_RestoreThread dll_PyEval_RestoreThread + # define PyEval_SaveThread dll_PyEval_SaveThread +*************** +*** 184,189 **** +--- 185,191 ---- + # define PyLong_Type (*dll_PyLong_Type) + # define PyList_GetItem dll_PyList_GetItem + # define PyList_Append dll_PyList_Append ++ # define PyList_Insert dll_PyList_Insert + # define PyList_New dll_PyList_New + # define PyList_SetItem dll_PyList_SetItem + # define PyList_Size dll_PyList_Size +*************** +*** 233,238 **** +--- 235,241 ---- + # define PyFloat_Type (*dll_PyFloat_Type) + # define PyImport_AddModule (*dll_PyImport_AddModule) + # define PySys_SetObject dll_PySys_SetObject ++ # define PySys_GetObject dll_PySys_GetObject + # define PySys_SetArgv dll_PySys_SetArgv + # define PyType_Type (*dll_PyType_Type) + # define PyType_Ready (*dll_PyType_Ready) +*************** +*** 305,310 **** +--- 308,314 ---- + static void(*dll_PyErr_SetNone)(PyObject *); + static void(*dll_PyErr_SetString)(PyObject *, const char *); + static void(*dll_PyErr_SetObject)(PyObject *, PyObject *); ++ static int(*dll_PyErr_ExceptionMatches)(PyObject *); + static void(*dll_PyEval_InitThreads)(void); + static void(*dll_PyEval_RestoreThread)(PyThreadState *); + static PyThreadState*(*dll_PyEval_SaveThread)(void); +*************** +*** 320,326 **** + static PyTypeObject* dll_PyInt_Type; + static PyTypeObject* dll_PyLong_Type; + static PyObject*(*dll_PyList_GetItem)(PyObject *, PyInt); +! static PyObject*(*dll_PyList_Append)(PyObject *, PyObject *); + static PyObject*(*dll_PyList_New)(PyInt size); + static int(*dll_PyList_SetItem)(PyObject *, PyInt, PyObject *); + static PyInt(*dll_PyList_Size)(PyObject *); +--- 324,331 ---- + static PyTypeObject* dll_PyInt_Type; + static PyTypeObject* dll_PyLong_Type; + static PyObject*(*dll_PyList_GetItem)(PyObject *, PyInt); +! static int(*dll_PyList_Append)(PyObject *, PyObject *); +! static int(*dll_PyList_Insert)(PyObject *, int, PyObject *); + static PyObject*(*dll_PyList_New)(PyInt size); + static int(*dll_PyList_SetItem)(PyObject *, PyInt, PyObject *); + static PyInt(*dll_PyList_Size)(PyObject *); +*************** +*** 366,371 **** +--- 371,377 ---- + static PyObject*(*dll_PyFloat_FromDouble)(double); + static PyTypeObject* dll_PyFloat_Type; + static int(*dll_PySys_SetObject)(char *, PyObject *); ++ static PyObject *(*dll_PySys_GetObject)(char *); + static int(*dll_PySys_SetArgv)(int, char **); + static PyTypeObject* dll_PyType_Type; + static int (*dll_PyType_Ready)(PyTypeObject *type); +*************** +*** 431,436 **** +--- 437,443 ---- + static PyObject *imp_PyExc_TypeError; + static PyObject *imp_PyExc_ValueError; + static PyObject *imp_PyExc_RuntimeError; ++ static PyObject *imp_PyExc_ImportError; + + # define PyExc_AttributeError imp_PyExc_AttributeError + # define PyExc_IndexError imp_PyExc_IndexError +*************** +*** 439,444 **** +--- 446,452 ---- + # define PyExc_TypeError imp_PyExc_TypeError + # define PyExc_ValueError imp_PyExc_ValueError + # define PyExc_RuntimeError imp_PyExc_RuntimeError ++ # define PyExc_ImportError imp_PyExc_ImportError + + /* + * Table of name to function pointer of python. +*************** +*** 471,476 **** +--- 479,485 ---- + {"PyErr_SetNone", (PYTHON_PROC*)&dll_PyErr_SetNone}, + {"PyErr_SetString", (PYTHON_PROC*)&dll_PyErr_SetString}, + {"PyErr_SetObject", (PYTHON_PROC*)&dll_PyErr_SetObject}, ++ {"PyErr_ExceptionMatches", (PYTHON_PROC*)&dll_PyErr_ExceptionMatches}, + {"PyEval_InitThreads", (PYTHON_PROC*)&dll_PyEval_InitThreads}, + {"PyEval_RestoreThread", (PYTHON_PROC*)&dll_PyEval_RestoreThread}, + {"PyEval_SaveThread", (PYTHON_PROC*)&dll_PyEval_SaveThread}, +*************** +*** 487,492 **** +--- 496,502 ---- + {"PyLong_Type", (PYTHON_PROC*)&dll_PyLong_Type}, + {"PyList_GetItem", (PYTHON_PROC*)&dll_PyList_GetItem}, + {"PyList_Append", (PYTHON_PROC*)&dll_PyList_Append}, ++ {"PyList_Insert", (PYTHON_PROC*)&dll_PyList_Insert}, + {"PyList_New", (PYTHON_PROC*)&dll_PyList_New}, + {"PyList_SetItem", (PYTHON_PROC*)&dll_PyList_SetItem}, + {"PyList_Size", (PYTHON_PROC*)&dll_PyList_Size}, +*************** +*** 532,537 **** +--- 542,548 ---- + {"PyFloat_FromDouble", (PYTHON_PROC*)&dll_PyFloat_FromDouble}, + {"PyImport_AddModule", (PYTHON_PROC*)&dll_PyImport_AddModule}, + {"PySys_SetObject", (PYTHON_PROC*)&dll_PySys_SetObject}, ++ {"PySys_GetObject", (PYTHON_PROC*)&dll_PySys_GetObject}, + {"PySys_SetArgv", (PYTHON_PROC*)&dll_PySys_SetArgv}, + {"PyType_Type", (PYTHON_PROC*)&dll_PyType_Type}, + {"PyType_Ready", (PYTHON_PROC*)&dll_PyType_Ready}, +*************** +*** 706,711 **** +--- 717,723 ---- + imp_PyExc_TypeError = PyDict_GetItemString(exdict, "TypeError"); + imp_PyExc_ValueError = PyDict_GetItemString(exdict, "ValueError"); + imp_PyExc_RuntimeError = PyDict_GetItemString(exdict, "RuntimeError"); ++ imp_PyExc_ImportError = PyDict_GetItemString(exdict, "ImportError"); + Py_XINCREF(imp_PyExc_AttributeError); + Py_XINCREF(imp_PyExc_IndexError); + Py_XINCREF(imp_PyExc_KeyError); +*************** +*** 713,718 **** +--- 725,731 ---- + Py_XINCREF(imp_PyExc_TypeError); + Py_XINCREF(imp_PyExc_ValueError); + Py_XINCREF(imp_PyExc_RuntimeError); ++ Py_XINCREF(imp_PyExc_ImportError); + Py_XDECREF(exmod); + } + #endif /* DYNAMIC_PYTHON */ +*************** +*** 735,740 **** +--- 748,757 ---- + static PyObject *ListGetattr(PyObject *, char *); + static PyObject *FunctionGetattr(PyObject *, char *); + ++ static PyObject *LoaderLoadModule(PyObject *, PyObject *); ++ static PyObject *FinderFindModule(PyObject *, PyObject *); ++ static PyObject *VimPathHook(PyObject *, PyObject *); ++ + #ifndef Py_VISIT + # define Py_VISIT(obj) visit(obj, arg) + #endif +*************** +*** 1359,1369 **** + } + #endif + + static int + PythonMod_Init(void) + { +- PyObject *mod; +- + /* The special value is removed from sys.path in Python_Init(). */ + static char *(argv[2]) = {"/must>not&exist/foo", NULL}; + +--- 1376,1487 ---- + } + #endif + ++ static PyObject * ++ LoaderLoadModule(PyObject *self, PyObject *args) ++ { ++ char *fullname; ++ PyObject *path; ++ PyObject *meta_path; ++ PyObject *path_hooks; ++ PyObject *new_path; ++ PyObject *r; ++ PyObject *new_list; ++ ++ if (!PyArg_ParseTuple(args, "s", &fullname)) ++ return NULL; ++ ++ if (!(new_path = Vim_GetPaths(self))) ++ return NULL; ++ ++ if (!(new_list = PyList_New(0))) ++ return NULL; ++ ++ #define GET_SYS_OBJECT(objstr, obj) \ ++ obj = PySys_GetObject(objstr); \ ++ PyErr_Clear(); \ ++ Py_XINCREF(obj); ++ ++ GET_SYS_OBJECT("meta_path", meta_path); ++ if (PySys_SetObject("meta_path", new_list)) ++ { ++ Py_XDECREF(meta_path); ++ Py_DECREF(new_list); ++ return NULL; ++ } ++ Py_DECREF(new_list); /* Now it becomes a reference borrowed from ++ sys.meta_path */ ++ ++ #define RESTORE_SYS_OBJECT(objstr, obj) \ ++ if (obj) \ ++ { \ ++ PySys_SetObject(objstr, obj); \ ++ Py_DECREF(obj); \ ++ } ++ ++ GET_SYS_OBJECT("path_hooks", path_hooks); ++ if (PySys_SetObject("path_hooks", new_list)) ++ { ++ RESTORE_SYS_OBJECT("meta_path", meta_path); ++ Py_XDECREF(path_hooks); ++ return NULL; ++ } ++ ++ GET_SYS_OBJECT("path", path); ++ if (PySys_SetObject("path", new_path)) ++ { ++ RESTORE_SYS_OBJECT("meta_path", meta_path); ++ RESTORE_SYS_OBJECT("path_hooks", path_hooks); ++ Py_XDECREF(path); ++ return NULL; ++ } ++ Py_DECREF(new_path); ++ ++ r = PyImport_ImportModule(fullname); ++ ++ RESTORE_SYS_OBJECT("meta_path", meta_path); ++ RESTORE_SYS_OBJECT("path_hooks", path_hooks); ++ RESTORE_SYS_OBJECT("path", path); ++ ++ if (PyErr_Occurred()) ++ { ++ Py_XDECREF(r); ++ return NULL; ++ } ++ ++ return r; ++ } ++ ++ static PyObject * ++ FinderFindModule(PyObject *self UNUSED, PyObject *args UNUSED) ++ { ++ /* ++ * Don't bother actually finding the module, it is delegated to the "loader" ++ * object (which is basically the same object: vim module). ++ */ ++ Py_INCREF(vim_module); ++ return vim_module; ++ } ++ ++ static PyObject * ++ VimPathHook(PyObject *self UNUSED, PyObject *args) ++ { ++ char *path; ++ ++ if (PyArg_ParseTuple(args, "s", &path) ++ && STRCMP(path, vim_special_path) == 0) ++ { ++ Py_INCREF(vim_module); ++ return vim_module; ++ } ++ ++ PyErr_Clear(); ++ PyErr_SetNone(PyExc_ImportError); ++ return NULL; ++ } ++ + static int + PythonMod_Init(void) + { + /* The special value is removed from sys.path in Python_Init(). */ + static char *(argv[2]) = {"/must>not&exist/foo", NULL}; + +*************** +*** 1373,1382 **** + /* Set sys.argv[] to avoid a crash in warn(). */ + PySys_SetArgv(1, argv); + +! mod = Py_InitModule4("vim", VimMethods, (char *)NULL, (PyObject *)NULL, +! PYTHON_API_VERSION); + +! return populate_module(mod, PyModule_AddObject, PyObject_GetAttrString); + } + + /************************************************************************* +--- 1491,1507 ---- + /* Set sys.argv[] to avoid a crash in warn(). */ + PySys_SetArgv(1, argv); + +! vim_module = Py_InitModule4("vim", VimMethods, (char *)NULL, +! (PyObject *)NULL, PYTHON_API_VERSION); +! +! if (populate_module(vim_module, PyModule_AddObject, +! PyObject_GetAttrString)) +! return -1; +! +! if (init_sys_path()) +! return -1; + +! return 0; + } + + /************************************************************************* +*** ../vim-7.3.1162/src/if_python3.c 2013-06-10 18:36:20.000000000 +0200 +--- src/if_python3.c 2013-06-10 20:55:44.000000000 +0200 +*************** +*** 134,139 **** +--- 134,140 ---- + # define PyErr_SetNone py3_PyErr_SetNone + # define PyErr_SetString py3_PyErr_SetString + # define PyErr_SetObject py3_PyErr_SetObject ++ # define PyErr_ExceptionMatches py3_PyErr_ExceptionMatches + # define PyEval_InitThreads py3_PyEval_InitThreads + # define PyEval_RestoreThread py3_PyEval_RestoreThread + # define PyEval_SaveThread py3_PyEval_SaveThread +*************** +*** 143,148 **** +--- 144,150 ---- + # define PyLong_FromLong py3_PyLong_FromLong + # define PyList_GetItem py3_PyList_GetItem + # define PyList_Append py3_PyList_Append ++ # define PyList_Insert py3_PyList_Insert + # define PyList_New py3_PyList_New + # define PyList_SetItem py3_PyList_SetItem + # define PyList_Size py3_PyList_Size +*************** +*** 177,182 **** +--- 179,185 ---- + # define PyEval_GetLocals py3_PyEval_GetLocals + # define PyEval_GetGlobals py3_PyEval_GetGlobals + # define PySys_SetObject py3_PySys_SetObject ++ # define PySys_GetObject py3_PySys_GetObject + # define PySys_SetArgv py3_PySys_SetArgv + # define PyType_Ready py3_PyType_Ready + #undef Py_BuildValue +*************** +*** 268,274 **** + static PyGILState_STATE (*py3_PyGILState_Ensure)(void); + static void (*py3_PyGILState_Release)(PyGILState_STATE); + static int (*py3_PySys_SetObject)(char *, PyObject *); +! static PyObject* (*py3_PyList_Append)(PyObject *, PyObject *); + static Py_ssize_t (*py3_PyList_Size)(PyObject *); + static int (*py3_PySequence_Check)(PyObject *); + static Py_ssize_t (*py3_PySequence_Size)(PyObject *); +--- 271,279 ---- + static PyGILState_STATE (*py3_PyGILState_Ensure)(void); + static void (*py3_PyGILState_Release)(PyGILState_STATE); + static int (*py3_PySys_SetObject)(char *, PyObject *); +! static PyObject* (*py3_PySys_GetObject)(char *); +! static int (*py3_PyList_Append)(PyObject *, PyObject *); +! static int (*py3_PyList_Insert)(PyObject *, int, PyObject *); + static Py_ssize_t (*py3_PyList_Size)(PyObject *); + static int (*py3_PySequence_Check)(PyObject *); + static Py_ssize_t (*py3_PySequence_Size)(PyObject *); +*************** +*** 284,289 **** +--- 289,295 ---- + static void (*py3_Py_Finalize)(void); + static void (*py3_PyErr_SetString)(PyObject *, const char *); + static void (*py3_PyErr_SetObject)(PyObject *, PyObject *); ++ static int (*py3_PyErr_ExceptionMatches)(PyObject *); + static int (*py3_PyRun_SimpleString)(char *); + static PyObject* (*py3_PyRun_String)(char *, int, PyObject *, PyObject *); + static PyObject* (*py3_PyObject_GetAttrString)(PyObject *, const char *); +*************** +*** 393,398 **** +--- 399,405 ---- + static PyObject *p3imp_PyExc_TypeError; + static PyObject *p3imp_PyExc_ValueError; + static PyObject *p3imp_PyExc_RuntimeError; ++ static PyObject *p3imp_PyExc_ImportError; + + # define PyExc_AttributeError p3imp_PyExc_AttributeError + # define PyExc_IndexError p3imp_PyExc_IndexError +*************** +*** 401,406 **** +--- 408,414 ---- + # define PyExc_TypeError p3imp_PyExc_TypeError + # define PyExc_ValueError p3imp_PyExc_ValueError + # define PyExc_RuntimeError p3imp_PyExc_RuntimeError ++ # define PyExc_ImportError p3imp_PyExc_ImportError + + /* + * Table of name to function pointer of python. +*************** +*** 428,434 **** +--- 436,444 ---- + {"PyGILState_Ensure", (PYTHON_PROC*)&py3_PyGILState_Ensure}, + {"PyGILState_Release", (PYTHON_PROC*)&py3_PyGILState_Release}, + {"PySys_SetObject", (PYTHON_PROC*)&py3_PySys_SetObject}, ++ {"PySys_GetObject", (PYTHON_PROC*)&py3_PySys_GetObject}, + {"PyList_Append", (PYTHON_PROC*)&py3_PyList_Append}, ++ {"PyList_Insert", (PYTHON_PROC*)&py3_PyList_Insert}, + {"PyList_Size", (PYTHON_PROC*)&py3_PyList_Size}, + {"PySequence_Check", (PYTHON_PROC*)&py3_PySequence_Check}, + {"PySequence_Size", (PYTHON_PROC*)&py3_PySequence_Size}, +*************** +*** 441,446 **** +--- 451,457 ---- + {"Py_Finalize", (PYTHON_PROC*)&py3_Py_Finalize}, + {"PyErr_SetString", (PYTHON_PROC*)&py3_PyErr_SetString}, + {"PyErr_SetObject", (PYTHON_PROC*)&py3_PyErr_SetObject}, ++ {"PyErr_ExceptionMatches", (PYTHON_PROC*)&py3_PyErr_ExceptionMatches}, + {"PyRun_SimpleString", (PYTHON_PROC*)&py3_PyRun_SimpleString}, + {"PyRun_String", (PYTHON_PROC*)&py3_PyRun_String}, + {"PyObject_GetAttrString", (PYTHON_PROC*)&py3_PyObject_GetAttrString}, +*************** +*** 664,669 **** +--- 675,681 ---- + p3imp_PyExc_TypeError = PyDict_GetItemString(exdict, "TypeError"); + p3imp_PyExc_ValueError = PyDict_GetItemString(exdict, "ValueError"); + p3imp_PyExc_RuntimeError = PyDict_GetItemString(exdict, "RuntimeError"); ++ p3imp_PyExc_ImportError = PyDict_GetItemString(exdict, "ImportError"); + Py_XINCREF(p3imp_PyExc_AttributeError); + Py_XINCREF(p3imp_PyExc_IndexError); + Py_XINCREF(p3imp_PyExc_KeyError); +*************** +*** 671,676 **** +--- 683,689 ---- + Py_XINCREF(p3imp_PyExc_TypeError); + Py_XINCREF(p3imp_PyExc_ValueError); + Py_XINCREF(p3imp_PyExc_RuntimeError); ++ Py_XINCREF(p3imp_PyExc_ImportError); + Py_XDECREF(exmod); + } + #endif /* DYNAMIC_PYTHON3 */ +*************** +*** 723,730 **** +--- 736,748 ---- + static int ListSetattro(PyObject *, PyObject *, PyObject *); + static PyObject *FunctionGetattro(PyObject *, PyObject *); + ++ static PyObject *VimPathHook(PyObject *, PyObject *); ++ + static struct PyModuleDef vimmodule; + ++ static PyObject *path_finder; ++ static PyObject *py_find_module = NULL; ++ + #define PY_CAN_RECURSE + + /* +*************** +*** 1585,1596 **** + #endif + + static PyObject * +! Py3Init_vim(void) + { +! PyObject *mod; + + /* The special value is removed from sys.path in Python3_Init(). */ + static wchar_t *(argv[2]) = {L"/must>not&exist/foo", NULL}; + + if (init_types()) + return NULL; +--- 1603,1672 ---- + #endif + + static PyObject * +! VimPathHook(PyObject *self UNUSED, PyObject *args) + { +! char *path; +! +! if (PyArg_ParseTuple(args, "s", &path) +! && STRCMP(path, vim_special_path) == 0) +! { +! Py_INCREF(&FinderType); +! return (PyObject *) &FinderType; +! } +! +! PyErr_Clear(); +! PyErr_SetNone(PyExc_ImportError); +! return NULL; +! } +! +! static PyObject * +! FinderFindModule(PyObject *cls UNUSED, PyObject *fullname) +! { +! PyObject *new_path; +! PyObject *r; +! +! if (!(new_path = Vim_GetPaths(NULL))) +! return NULL; +! +! /* call find_module of the super() class */ +! r = PyObject_CallFunctionObjArgs(py_find_module, fullname, new_path, NULL); +! +! Py_DECREF(new_path); +! +! return r; +! } + ++ static struct PyMethodDef FinderMethods[] = { ++ {"find_module", FinderFindModule, METH_CLASS|METH_O, ""}, ++ {NULL, NULL, 0, NULL} ++ }; ++ ++ static PyObject * ++ Py3Init_vim(void) ++ { + /* The special value is removed from sys.path in Python3_Init(). */ + static wchar_t *(argv[2]) = {L"/must>not&exist/foo", NULL}; ++ PyObject *importlib_machinery; ++ ++ if (!(importlib_machinery = PyImport_ImportModule("importlib.machinery"))) ++ return NULL; ++ ++ if (!(path_finder = PyObject_GetAttrString(importlib_machinery, ++ "PathFinder"))) ++ { ++ Py_DECREF(importlib_machinery); ++ return NULL; ++ } ++ ++ Py_DECREF(importlib_machinery); ++ ++ vim_memset(&FinderType, 0, sizeof(FinderObject)); ++ FinderType.tp_name = "vim.Finder"; ++ FinderType.tp_basicsize = sizeof(FinderObject); ++ FinderType.tp_base = (PyTypeObject *) path_finder; ++ FinderType.tp_flags = Py_TPFLAGS_DEFAULT; ++ FinderType.tp_doc = "Vim finder class, for use with path hook"; ++ FinderType.tp_methods = FinderMethods; + + if (init_types()) + return NULL; +*************** +*** 1598,1611 **** + /* Set sys.argv[] to avoid a crash in warn(). */ + PySys_SetArgv(1, argv); + +! mod = PyModule_Create(&vimmodule); +! if (mod == NULL) + return NULL; + +! if (populate_module(mod, PyModule_AddObject, PyObject_GetAttrString)) + return NULL; + +! return mod; + } + + /************************************************************************* +--- 1674,1689 ---- + /* Set sys.argv[] to avoid a crash in warn(). */ + PySys_SetArgv(1, argv); + +! if ((vim_module = PyModule_Create(&vimmodule)) == NULL) +! return NULL; +! +! if (populate_module(vim_module, PyModule_AddObject, PyObject_GetAttrString)) + return NULL; + +! if (init_sys_path()) + return NULL; + +! return vim_module; + } + + /************************************************************************* +*** ../vim-7.3.1162/src/testdir/test86.in 2013-06-02 18:54:16.000000000 +0200 +--- src/testdir/test86.in 2013-06-10 21:05:44.000000000 +0200 +*************** +*** 1069,1074 **** +--- 1069,1082 ---- + ee('vim.current.xxx = True') + EOF + :" ++ :" Test import TODO: BROKEN ++ :"py << EOF ++ :"vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\') ++ :"from module import dir as d ++ :"from modulex import ddir ++ :"cb.append(d + ',' + ddir) ++ :"EOF ++ :" + :" Test exceptions + :fun Exe(e) + : execute a:e +*** ../vim-7.3.1162/src/testdir/test87.in 2013-06-02 18:54:16.000000000 +0200 +--- src/testdir/test87.in 2013-06-10 21:06:37.000000000 +0200 +*************** +*** 1036,1041 **** +--- 1036,1049 ---- + ee('vim.current.xxx = True') + EOF + :" ++ :" Test import TODO: BROKEN ++ :"py3 << EOF ++ :"vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\') ++ :"from module import dir as d ++ :"from modulex import ddir ++ :"cb.append(d + ',' + ddir) ++ :"EOF ++ :" + :" Test exceptions + :fun Exe(e) + : execute a:e +*** ../vim-7.3.1162/src/auto/configure 2013-06-02 19:14:11.000000000 +0200 +--- src/auto/configure 2013-06-10 21:22:52.000000000 +0200 +*************** +*** 5289,5298 **** + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python_version" >&5 + $as_echo "$vi_cv_var_python_version" >&6; } + +! { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python is 2.2 or better" >&5 +! $as_echo_n "checking Python is 2.2 or better... " >&6; } + if ${vi_cv_path_python} -c \ +! "import sys; sys.exit(${vi_cv_var_python_version} < 2.2)" + then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yep" >&5 + $as_echo "yep" >&6; } +--- 5289,5298 ---- + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python_version" >&5 + $as_echo "$vi_cv_var_python_version" >&6; } + +! { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python is 2.3 or better" >&5 +! $as_echo_n "checking Python is 2.3 or better... " >&6; } + if ${vi_cv_path_python} -c \ +! "import sys; sys.exit(${vi_cv_var_python_version} < 2.3)" + then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yep" >&5 + $as_echo "yep" >&6; } +*** ../vim-7.3.1162/src/version.c 2013-06-10 20:47:33.000000000 +0200 +--- src/version.c 2013-06-10 20:53:23.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1163, + /**/ + +-- +The coffee just wasn't strong enough to defend itself -- Tom Waits + + /// 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 /// diff --git a/7.3.1164 b/7.3.1164 new file mode 100644 index 0000000..0f48983 --- /dev/null +++ b/7.3.1164 @@ -0,0 +1,155 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1164 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1164 +Problem: Can't test what is actually displayed on screen. +Solution: Add the screenchar() and screenattr() functions. +Files: src/eval.c, runtime/doc/eval.txt + + +*** ../vim-7.3.1163/src/eval.c 2013-06-10 20:10:40.000000000 +0200 +--- src/eval.c 2013-06-10 23:15:38.000000000 +0200 +*************** +*** 654,659 **** +--- 654,661 ---- + #ifdef FEAT_FLOAT + static void f_round __ARGS((typval_T *argvars, typval_T *rettv)); + #endif ++ static void f_screenattr __ARGS((typval_T *argvars, typval_T *rettv)); ++ static void f_screenchar __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_screencol __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_screenrow __ARGS((typval_T *argvars, typval_T *rettv)); + static void f_search __ARGS((typval_T *argvars, typval_T *rettv)); +*************** +*** 8037,8042 **** +--- 8039,8046 ---- + #ifdef FEAT_FLOAT + {"round", 1, 1, f_round}, + #endif ++ {"screenattr", 2, 2, f_screenattr}, ++ {"screenchar", 2, 2, f_screenchar}, + {"screencol", 0, 0, f_screencol}, + {"screenrow", 0, 0, f_screenrow}, + {"search", 1, 4, f_search}, +*************** +*** 15804,15809 **** +--- 15808,15866 ---- + #endif + + /* ++ * "screenattr()" function ++ */ ++ static void ++ f_screenattr(argvars, rettv) ++ typval_T *argvars UNUSED; ++ typval_T *rettv; ++ { ++ int row; ++ int col; ++ int c; ++ ++ row = get_tv_number_chk(&argvars[0], NULL) - 1; ++ col = get_tv_number_chk(&argvars[1], NULL) - 1; ++ if (row < 0 || row >= screen_Rows ++ || col < 0 || col >= screen_Columns) ++ c = -1; ++ else ++ c = ScreenAttrs[LineOffset[row] + col]; ++ rettv->vval.v_number = c; ++ } ++ ++ /* ++ * "screenchar()" function ++ */ ++ static void ++ f_screenchar(argvars, rettv) ++ typval_T *argvars UNUSED; ++ typval_T *rettv; ++ { ++ int row; ++ int col; ++ int off; ++ int c; ++ ++ row = get_tv_number_chk(&argvars[0], NULL) - 1; ++ col = get_tv_number_chk(&argvars[1], NULL) - 1; ++ if (row < 0 || row >= screen_Rows ++ || col < 0 || col >= screen_Columns) ++ c = -1; ++ else ++ { ++ off = LineOffset[row] + col; ++ #ifdef FEAT_MBYTE ++ if (enc_utf8 && ScreenLinesUC[off] != 0) ++ c = ScreenLinesUC[off]; ++ else ++ #endif ++ c = ScreenLines[off]; ++ } ++ rettv->vval.v_number = c; ++ } ++ ++ /* + * "screencol()" function + * + * First column is 1 to be consistent with virtcol(). +*** ../vim-7.3.1163/runtime/doc/eval.txt 2013-05-06 04:50:26.000000000 +0200 +--- runtime/doc/eval.txt 2013-06-11 18:39:17.000000000 +0200 +*************** +*** 1895,1900 **** +--- 1906,1913 ---- + resolve( {filename}) String get filename a shortcut points to + reverse( {list}) List reverse {list} in-place + round( {expr}) Float round off {expr} ++ screenattr( {row}, {col}) Number attribute at screen position ++ screenchar( {row}, {col}) Number character at screen position + screencol() Number current cursor column + screenrow() Number current cursor row + search( {pattern} [, {flags} [, {stopline} [, {timeout}]]]) +*************** +*** 4863,4868 **** +--- 4893,4913 ---- + < -5.0 + {only available when compiled with the |+float| feature} + ++ screenattr(row, col) *screenattr()* ++ Like screenchar(), but return the attribute. This is a rather ++ arbitrary number that can only be used to compare to the ++ attribute at other positions. ++ ++ screenchar(row, col) *screenchar()* ++ The result is a Number, which is the character at position ++ [row, col] on the screen. This works for every possible ++ screen position, also status lines, window separators and the ++ command line. The top left position is row one, column one ++ The character excludes composing characters. For double-byte ++ encodings it may only be the first byte. ++ This is mainly to be used for testing. ++ Returns -1 when row or col is out of range. ++ + screencol() *screencol()* + The result is a Number, which is the current screen column of + the cursor. The leftmost column has number 1. +*** ../vim-7.3.1163/src/version.c 2013-06-10 21:27:18.000000000 +0200 +--- src/version.c 2013-06-11 18:36:46.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1164, + /**/ + +-- +Fingers not found - Pound head on keyboard to continue. + + /// 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 /// diff --git a/7.3.1165 b/7.3.1165 new file mode 100644 index 0000000..b1d0357 --- /dev/null +++ b/7.3.1165 @@ -0,0 +1,73 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1165 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1165 +Problem: HP-UX compiler can't handle zero size array. (Charles Cooper) +Solution: Make the array one item big. +Files: src/regexp.h, src/regexp_nfa.c + + +*** ../vim-7.3.1164/src/regexp.h 2013-06-08 18:19:39.000000000 +0200 +--- src/regexp.h 2013-06-11 10:53:14.000000000 +0200 +*************** +*** 101,107 **** + #endif + int nsubexp; /* number of () */ + int nstate; +! nfa_state_T state[0]; /* actually longer.. */ + } nfa_regprog_T; + + /* +--- 101,107 ---- + #endif + int nsubexp; /* number of () */ + int nstate; +! nfa_state_T state[1]; /* actually longer.. */ + } nfa_regprog_T; + + /* +*** ../vim-7.3.1164/src/regexp_nfa.c 2013-06-10 16:35:11.000000000 +0200 +--- src/regexp_nfa.c 2013-06-11 11:19:17.000000000 +0200 +*************** +*** 6391,6398 **** + */ + post2nfa(postfix, post_ptr, TRUE); + +! /* Space for compiled regexp */ +! prog_size = sizeof(nfa_regprog_T) + sizeof(nfa_state_T) * nstate; + prog = (nfa_regprog_T *)lalloc(prog_size, TRUE); + if (prog == NULL) + goto fail; +--- 6391,6398 ---- + */ + post2nfa(postfix, post_ptr, TRUE); + +! /* allocate the regprog with space for the compiled regexp */ +! prog_size = sizeof(nfa_regprog_T) + sizeof(nfa_state_T) * (nstate - 1); + prog = (nfa_regprog_T *)lalloc(prog_size, TRUE); + if (prog == NULL) + goto fail; +*** ../vim-7.3.1164/src/version.c 2013-06-11 18:40:06.000000000 +0200 +--- src/version.c 2013-06-11 18:41:47.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1165, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +145. You e-mail your boss, informing him you'll be late. + + /// 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 /// diff --git a/7.3.1166 b/7.3.1166 new file mode 100644 index 0000000..e71a035 --- /dev/null +++ b/7.3.1166 @@ -0,0 +1,162 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1166 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1166 +Problem: Loading Python modules is not tested. +Solution: Enable commented-out tests, add missing files. (ZyX) +Files: src/testdir/test86.in, src/testdir/test86.ok, + src/testdir/test87.in, src/testdir/test87.ok, + src/testdir/python2/module.py, src/testdir/python3/module.py, + src/testdir/pythonx/module.py, src/testdir/pythonx/modulex.py, + Filelist + + +*** ../vim-7.3.1165/src/testdir/test86.in 2013-06-10 21:27:18.000000000 +0200 +--- src/testdir/test86.in 2013-06-11 17:42:17.000000000 +0200 +*************** +*** 1069,1081 **** + ee('vim.current.xxx = True') + EOF + :" +! :" Test import TODO: BROKEN +! :"py << EOF +! :"vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\') +! :"from module import dir as d +! :"from modulex import ddir +! :"cb.append(d + ',' + ddir) +! :"EOF + :" + :" Test exceptions + :fun Exe(e) +--- 1069,1081 ---- + ee('vim.current.xxx = True') + EOF + :" +! :" Test import +! py << EOF +! vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\') +! from module import dir as d +! from modulex import ddir +! cb.append(d + ',' + ddir) +! EOF + :" + :" Test exceptions + :fun Exe(e) +*** ../vim-7.3.1165/src/testdir/test86.ok 2013-06-02 18:54:16.000000000 +0200 +--- src/testdir/test86.ok 2013-06-11 17:42:26.000000000 +0200 +*************** +*** 1083,1088 **** +--- 1083,1089 ---- + vim.current.window = True:(, TypeError('expected vim.Window object',)) + vim.current.tabpage = True:(, TypeError('expected vim.TabPage object',)) + vim.current.xxx = True:(, AttributeError('xxx',)) ++ 2,xx + vim.command("throw 'abc'"):(, error('abc',)) + Exe("throw 'def'"):(, error('def',)) + vim.eval("Exe('throw ''ghi''')"):(, error('ghi',)) +*** ../vim-7.3.1165/src/testdir/test87.in 2013-06-10 21:27:18.000000000 +0200 +--- src/testdir/test87.in 2013-06-11 17:42:38.000000000 +0200 +*************** +*** 1036,1048 **** + ee('vim.current.xxx = True') + EOF + :" +! :" Test import TODO: BROKEN +! :"py3 << EOF +! :"vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\') +! :"from module import dir as d +! :"from modulex import ddir +! :"cb.append(d + ',' + ddir) +! :"EOF + :" + :" Test exceptions + :fun Exe(e) +--- 1036,1048 ---- + ee('vim.current.xxx = True') + EOF + :" +! :" Test import +! py3 << EOF +! vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\') +! from module import dir as d +! from modulex import ddir +! cb.append(d + ',' + ddir) +! EOF + :" + :" Test exceptions + :fun Exe(e) +*** ../vim-7.3.1165/src/testdir/test87.ok 2013-06-02 18:54:16.000000000 +0200 +--- src/testdir/test87.ok 2013-06-11 17:42:55.000000000 +0200 +*************** +*** 1092,1097 **** +--- 1092,1098 ---- + vim.current.window = True:(, TypeError('expected vim.Window object',)) + vim.current.tabpage = True:(, TypeError('expected vim.TabPage object',)) + vim.current.xxx = True:(, AttributeError('xxx',)) ++ 3,xx + vim.command("throw 'abc'"):(, error('abc',)) + Exe("throw 'def'"):(, error('def',)) + vim.eval("Exe('throw ''ghi''')"):(, error('ghi',)) +*** ../vim-7.3.1165/src/testdir/python2/module.py 1970-01-01 01:00:00.000000000 +0100 +--- src/testdir/python2/module.py 2013-06-11 17:39:40.000000000 +0200 +*************** +*** 0 **** +--- 1 ---- ++ dir = '2' +*** ../vim-7.3.1165/src/testdir/python3/module.py 1970-01-01 01:00:00.000000000 +0100 +--- src/testdir/python3/module.py 2013-06-11 17:39:40.000000000 +0200 +*************** +*** 0 **** +--- 1 ---- ++ dir = '3' +*** ../vim-7.3.1165/src/testdir/pythonx/module.py 1970-01-01 01:00:00.000000000 +0100 +--- src/testdir/pythonx/module.py 2013-06-11 17:39:40.000000000 +0200 +*************** +*** 0 **** +--- 1 ---- ++ dir = 'x' +*** ../vim-7.3.1165/src/testdir/pythonx/modulex.py 1970-01-01 01:00:00.000000000 +0100 +--- src/testdir/pythonx/modulex.py 2013-06-11 17:39:40.000000000 +0200 +*************** +*** 0 **** +--- 1 ---- ++ ddir = 'xx' +*** ../vim-7.3.1165/Filelist 2013-05-19 19:16:25.000000000 +0200 +--- Filelist 2013-06-11 18:45:13.000000000 +0200 +*************** +*** 84,89 **** +--- 84,92 ---- + src/testdir/test49.vim \ + src/testdir/test60.vim \ + src/testdir/test83-tags? \ ++ src/testdir/python2/*.py \ ++ src/testdir/python3/*.py \ ++ src/testdir/pythonx/*.py \ + src/proto.h \ + src/proto/blowfish.pro \ + src/proto/buffer.pro \ +*** ../vim-7.3.1165/src/version.c 2013-06-11 18:42:28.000000000 +0200 +--- src/version.c 2013-06-11 18:44:06.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1166, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +146. You experience ACTUAL physical withdrawal symptoms when away + from your 'puter and the net. + + /// 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 /// diff --git a/7.3.1167 b/7.3.1167 new file mode 100644 index 0000000..6deb0a0 --- /dev/null +++ b/7.3.1167 @@ -0,0 +1,889 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1167 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1167 +Problem: Python configure check doesn't reject Python 2 when requesting + Python 3. Some systems need -pthreads instead of -pthread. +Solution: Adjust configure accordingly. (Andrei Olsen) +Files: src/configure.in, src/auto/configure + + +*** ../vim-7.3.1166/src/configure.in 2013-06-10 21:27:18.000000000 +0200 +--- src/configure.in 2013-06-11 19:49:52.000000000 +0200 +*************** +*** 986,991 **** +--- 986,994 ---- + threadsafe_flag="-D_THREAD_SAFE" + thread_lib="-pthread" + fi ++ if test "`(uname) 2>/dev/null`" = SunOS; then ++ threadsafe_flag="-pthreads" ++ fi + fi + libs_save_old=$LIBS + if test -n "$threadsafe_flag"; then +*************** +*** 1022,1028 **** + PYTHON_LIBS= + PYTHON_CFLAGS= + fi +- + fi + else + AC_MSG_RESULT(too old) +--- 1025,1030 ---- +*************** +*** 1058,1135 **** + ${vi_cv_path_python3} -c 'import sys; print(sys.version[:3])'` + ]]) + +! dnl -- get abiflags for python 3.2 or higher (PEP 3149) +! AC_CACHE_CHECK(Python's abiflags,vi_cv_var_python3_abiflags, +! [ +! vi_cv_var_python3_abiflags= +! if ${vi_cv_path_python3} -c \ +! "import sys; sys.exit(${vi_cv_var_python3_version} < 3.2)" +! then +! vi_cv_var_python3_abiflags=`${vi_cv_path_python3} -c \ +! "import sys; print(sys.abiflags)"` +! fi ]) +! +! dnl -- find where python3 thinks it was installed +! AC_CACHE_CHECK(Python's install prefix,vi_cv_path_python3_pfx, +! [ vi_cv_path_python3_pfx=` +! ${vi_cv_path_python3} -c \ +! "import sys; print(sys.prefix)"` ]) +! +! dnl -- and where it thinks it runs +! AC_CACHE_CHECK(Python's execution prefix,vi_cv_path_python3_epfx, +! [ vi_cv_path_python3_epfx=` +! ${vi_cv_path_python3} -c \ +! "import sys; print(sys.exec_prefix)"` ]) +! +! dnl -- python3's internal library path +! +! AC_CACHE_VAL(vi_cv_path_python3path, +! [ vi_cv_path_python3path=` +! unset PYTHONPATH; +! ${vi_cv_path_python3} -c \ +! "import sys, string; print(':'.join(sys.path))"` ]) +! +! dnl -- where the Python implementation library archives are +! +! AC_ARG_WITH(python3-config-dir, +! [ --with-python3-config-dir=PATH Python's config directory], +! [ vi_cv_path_python3_conf="${withval}" ] ) +! +! AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python3_conf, +! [ +! vi_cv_path_python3_conf= +! config_dir="config" +! if test "${vi_cv_var_python3_abiflags}" != ""; then +! config_dir="${config_dir}-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" +! fi +! d=`${vi_cv_path_python3} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"` +! if test -d "$d" && test -f "$d/config.c"; then +! vi_cv_path_python3_conf="$d" +! else +! for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do +! for subdir in lib64 lib share; do +! d="${path}/${subdir}/python${vi_cv_var_python3_version}/${config_dir}" +! if test -d "$d" && test -f "$d/config.c"; then +! vi_cv_path_python3_conf="$d" +! fi +! done +! done +! fi +! ]) + +! PYTHON3_CONFDIR="${vi_cv_path_python3_conf}" +! +! if test "X$PYTHON3_CONFDIR" = "X"; then +! AC_MSG_RESULT([can't find it!]) +! else +! +! dnl -- we need to examine Python's config/Makefile too +! dnl see what the interpreter is built from +! AC_CACHE_VAL(vi_cv_path_python3_plibs, + [ +! pwd=`pwd` +! tmp_mkf="$pwd/config-PyMake$$" +! cat -- "${PYTHON3_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}" + __: + @echo "python3_BASEMODLIBS='$(BASEMODLIBS)'" + @echo "python3_LIBS='$(LIBS)'" +--- 1060,1144 ---- + ${vi_cv_path_python3} -c 'import sys; print(sys.version[:3])'` + ]]) + +! dnl -- it must be at least version 3 +! AC_MSG_CHECKING(Python is 3.0 or better) +! if ${vi_cv_path_python3} -c \ +! "import sys; sys.exit(${vi_cv_var_python3_version} < 3.0)" +! then +! AC_MSG_RESULT(yep) + +! dnl -- get abiflags for python 3.2 or higher (PEP 3149) +! AC_CACHE_CHECK(Python's abiflags,vi_cv_var_python3_abiflags, + [ +! vi_cv_var_python3_abiflags= +! if ${vi_cv_path_python3} -c \ +! "import sys; sys.exit(${vi_cv_var_python3_version} < 3.2)" +! then +! vi_cv_var_python3_abiflags=`${vi_cv_path_python3} -c \ +! "import sys; print(sys.abiflags)"` +! fi ]) +! +! dnl -- find where python3 thinks it was installed +! AC_CACHE_CHECK(Python's install prefix,vi_cv_path_python3_pfx, +! [ vi_cv_path_python3_pfx=` +! ${vi_cv_path_python3} -c \ +! "import sys; print(sys.prefix)"` ]) +! +! dnl -- and where it thinks it runs +! AC_CACHE_CHECK(Python's execution prefix,vi_cv_path_python3_epfx, +! [ vi_cv_path_python3_epfx=` +! ${vi_cv_path_python3} -c \ +! "import sys; print(sys.exec_prefix)"` ]) +! +! dnl -- python3's internal library path +! +! AC_CACHE_VAL(vi_cv_path_python3path, +! [ vi_cv_path_python3path=` +! unset PYTHONPATH; +! ${vi_cv_path_python3} -c \ +! "import sys, string; print(':'.join(sys.path))"` ]) +! +! dnl -- where the Python implementation library archives are +! +! AC_ARG_WITH(python3-config-dir, +! [ --with-python3-config-dir=PATH Python's config directory], +! [ vi_cv_path_python3_conf="${withval}" ] ) +! +! AC_CACHE_CHECK(Python's configuration directory,vi_cv_path_python3_conf, +! [ +! vi_cv_path_python3_conf= +! config_dir="config" +! if test "${vi_cv_var_python3_abiflags}" != ""; then +! config_dir="${config_dir}-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" +! fi +! d=`${vi_cv_path_python3} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"` +! if test -d "$d" && test -f "$d/config.c"; then +! vi_cv_path_python3_conf="$d" +! else +! for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do +! for subdir in lib64 lib share; do +! d="${path}/${subdir}/python${vi_cv_var_python3_version}/${config_dir}" +! if test -d "$d" && test -f "$d/config.c"; then +! vi_cv_path_python3_conf="$d" +! fi +! done +! done +! fi +! ]) +! +! PYTHON3_CONFDIR="${vi_cv_path_python3_conf}" +! +! if test "X$PYTHON3_CONFDIR" = "X"; then +! AC_MSG_RESULT([can't find it!]) +! else +! +! dnl -- we need to examine Python's config/Makefile too +! dnl see what the interpreter is built from +! AC_CACHE_VAL(vi_cv_path_python3_plibs, +! [ +! pwd=`pwd` +! tmp_mkf="$pwd/config-PyMake$$" +! cat -- "${PYTHON3_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}" + __: + @echo "python3_BASEMODLIBS='$(BASEMODLIBS)'" + @echo "python3_LIBS='$(LIBS)'" +*************** +*** 1137,1217 **** + @echo "python3_DLLLIBRARY='$(DLLLIBRARY)'" + @echo "python3_INSTSONAME='$(INSTSONAME)'" + eof +! dnl -- delete the lines from make about Entering/Leaving directory +! eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`" +! rm -f -- "${tmp_mkf}" +! vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" +! vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS}" +! dnl remove -ltermcap, it can conflict with an earlier -lncurses +! vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//` +! vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//` +! ]) +! +! if test "X$python3_DLLLIBRARY" != "X"; then +! python3_INSTSONAME="$python3_DLLLIBRARY" +! fi +! PYTHON3_LIBS="${vi_cv_path_python3_plibs}" +! if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then +! PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\"" +! else +! PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\"" +! fi +! PYTHON3_SRC="if_python3.c" +! PYTHON3_OBJ="objects/if_python3.o" +! +! dnl On FreeBSD linking with "-pthread" is required to use threads. +! dnl _THREAD_SAFE must be used for compiling then. +! dnl The "-pthread" is added to $LIBS, so that the following check for +! dnl sigaltstack() will look in libc_r (it's there in libc!). +! dnl Otherwise, when using GCC, try adding -pthread to $CFLAGS. GCC +! dnl will then define target-specific defines, e.g., -D_REENTRANT. +! dnl Don't do this for Mac OSX, -pthread will generate a warning. +! AC_MSG_CHECKING([if -pthread should be used]) +! threadsafe_flag= +! thread_lib= +! dnl if test "x$MACOSX" != "xyes"; then +! if test "`(uname) 2>/dev/null`" != Darwin; then +! test "$GCC" = yes && threadsafe_flag="-pthread" +! if test "`(uname) 2>/dev/null`" = FreeBSD; then +! threadsafe_flag="-D_THREAD_SAFE" +! thread_lib="-pthread" + fi +! fi +! libs_save_old=$LIBS +! if test -n "$threadsafe_flag"; then + cflags_save=$CFLAGS +! CFLAGS="$CFLAGS $threadsafe_flag" +! LIBS="$LIBS $thread_lib" + AC_TRY_LINK(,[ ], +! AC_MSG_RESULT(yes); PYTHON3_CFLAGS="$PYTHON3_CFLAGS $threadsafe_flag", +! AC_MSG_RESULT(no); LIBS=$libs_save_old +! ) + CFLAGS=$cflags_save +! else +! AC_MSG_RESULT(no) +! fi +! +! dnl check that compiling a simple program still works with the flags +! dnl added for Python. +! AC_MSG_CHECKING([if compile and link flags for Python 3 are sane]) +! cflags_save=$CFLAGS +! libs_save=$LIBS +! CFLAGS="$CFLAGS $PYTHON3_CFLAGS" +! LIBS="$LIBS $PYTHON3_LIBS" +! AC_TRY_LINK(,[ ], +! AC_MSG_RESULT(yes); python3_ok=yes, +! AC_MSG_RESULT(no: PYTHON3 DISABLED); python3_ok=no) +! CFLAGS=$cflags_save +! LIBS=$libs_save +! if test "$python3_ok" = yes; then +! AC_DEFINE(FEAT_PYTHON3) +! else +! LIBS=$libs_save_old +! PYTHON3_SRC= +! PYTHON3_OBJ= +! PYTHON3_LIBS= +! PYTHON3_CFLAGS= + fi + fi + fi + fi +--- 1146,1232 ---- + @echo "python3_DLLLIBRARY='$(DLLLIBRARY)'" + @echo "python3_INSTSONAME='$(INSTSONAME)'" + eof +! dnl -- delete the lines from make about Entering/Leaving directory +! eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`" +! rm -f -- "${tmp_mkf}" +! vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" +! vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS}" +! dnl remove -ltermcap, it can conflict with an earlier -lncurses +! vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//` +! vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//` +! ]) +! +! if test "X$python3_DLLLIBRARY" != "X"; then +! python3_INSTSONAME="$python3_DLLLIBRARY" + fi +! PYTHON3_LIBS="${vi_cv_path_python3_plibs}" +! if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then +! PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\"" +! else +! PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\"" +! fi +! PYTHON3_SRC="if_python3.c" +! PYTHON3_OBJ="objects/if_python3.o" +! +! dnl On FreeBSD linking with "-pthread" is required to use threads. +! dnl _THREAD_SAFE must be used for compiling then. +! dnl The "-pthread" is added to $LIBS, so that the following check for +! dnl sigaltstack() will look in libc_r (it's there in libc!). +! dnl Otherwise, when using GCC, try adding -pthread to $CFLAGS. GCC +! dnl will then define target-specific defines, e.g., -D_REENTRANT. +! dnl Don't do this for Mac OSX, -pthread will generate a warning. +! AC_MSG_CHECKING([if -pthread should be used]) +! threadsafe_flag= +! thread_lib= +! dnl if test "x$MACOSX" != "xyes"; then +! if test "`(uname) 2>/dev/null`" != Darwin; then +! test "$GCC" = yes && threadsafe_flag="-pthread" +! if test "`(uname) 2>/dev/null`" = FreeBSD; then +! threadsafe_flag="-D_THREAD_SAFE" +! thread_lib="-pthread" +! fi +! if test "`(uname) 2>/dev/null`" = SunOS; then +! threadsafe_flag="-pthreads" +! fi +! fi +! libs_save_old=$LIBS +! if test -n "$threadsafe_flag"; then +! cflags_save=$CFLAGS +! CFLAGS="$CFLAGS $threadsafe_flag" +! LIBS="$LIBS $thread_lib" +! AC_TRY_LINK(,[ ], +! AC_MSG_RESULT(yes); PYTHON3_CFLAGS="$PYTHON3_CFLAGS $threadsafe_flag", +! AC_MSG_RESULT(no); LIBS=$libs_save_old +! ) +! CFLAGS=$cflags_save +! else +! AC_MSG_RESULT(no) +! fi +! +! dnl check that compiling a simple program still works with the flags +! dnl added for Python. +! AC_MSG_CHECKING([if compile and link flags for Python 3 are sane]) + cflags_save=$CFLAGS +! libs_save=$LIBS +! CFLAGS="$CFLAGS $PYTHON3_CFLAGS" +! LIBS="$LIBS $PYTHON3_LIBS" + AC_TRY_LINK(,[ ], +! AC_MSG_RESULT(yes); python3_ok=yes, +! AC_MSG_RESULT(no: PYTHON3 DISABLED); python3_ok=no) + CFLAGS=$cflags_save +! LIBS=$libs_save +! if test "$python3_ok" = yes; then +! AC_DEFINE(FEAT_PYTHON3) +! else +! LIBS=$libs_save_old +! PYTHON3_SRC= +! PYTHON3_OBJ= +! PYTHON3_LIBS= +! PYTHON3_CFLAGS= +! fi + fi ++ else ++ AC_MSG_RESULT(too old) + fi + fi + fi +*************** +*** 2442,2448 **** + xmheader="Xm/Xm.h" + else + xmheader="Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h +! Xm/UnhighlightT.h Xm/Notebook.h" + fi + AC_CHECK_HEADERS($xmheader) + +--- 2457,2463 ---- + xmheader="Xm/Xm.h" + else + xmheader="Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h +! Xm/UnhighlightT.h Xm/Notebook.h" + fi + AC_CHECK_HEADERS($xmheader) + +*************** +*** 3356,3362 **** + [#include + #include ], + [ struct sysinfo sinfo; +! sinfo.mem_unit = 1; + ], + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO_MEM_UNIT), + AC_MSG_RESULT(no)) +--- 3371,3377 ---- + [#include + #include ], + [ struct sysinfo sinfo; +! sinfo.mem_unit = 1; + ], + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SYSINFO_MEM_UNIT), + AC_MSG_RESULT(no)) +*** ../vim-7.3.1166/src/auto/configure 2013-06-10 21:27:18.000000000 +0200 +--- src/auto/configure 2013-06-11 19:50:08.000000000 +0200 +*************** +*** 5431,5436 **** +--- 5431,5439 ---- + threadsafe_flag="-D_THREAD_SAFE" + thread_lib="-pthread" + fi ++ if test "`(uname) 2>/dev/null`" = SunOS; then ++ threadsafe_flag="-pthreads" ++ fi + fi + libs_save_old=$LIBS + if test -n "$threadsafe_flag"; then +*************** +*** 5502,5508 **** + PYTHON_LIBS= + PYTHON_CFLAGS= + fi +- + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: too old" >&5 +--- 5505,5510 ---- +*************** +*** 5594,5648 **** + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python3_version" >&5 + $as_echo "$vi_cv_var_python3_version" >&6; } + +! { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's abiflags" >&5 + $as_echo_n "checking Python's abiflags... " >&6; } + if test "${vi_cv_var_python3_abiflags+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + +! vi_cv_var_python3_abiflags= +! if ${vi_cv_path_python3} -c \ +! "import sys; sys.exit(${vi_cv_var_python3_version} < 3.2)" +! then +! vi_cv_var_python3_abiflags=`${vi_cv_path_python3} -c \ +! "import sys; print(sys.abiflags)"` +! fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python3_abiflags" >&5 + $as_echo "$vi_cv_var_python3_abiflags" >&6; } + +! { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's install prefix" >&5 + $as_echo_n "checking Python's install prefix... " >&6; } + if test "${vi_cv_path_python3_pfx+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + vi_cv_path_python3_pfx=` +! ${vi_cv_path_python3} -c \ +! "import sys; print(sys.prefix)"` + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_pfx" >&5 + $as_echo "$vi_cv_path_python3_pfx" >&6; } + +! { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's execution prefix" >&5 + $as_echo_n "checking Python's execution prefix... " >&6; } + if test "${vi_cv_path_python3_epfx+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + vi_cv_path_python3_epfx=` +! ${vi_cv_path_python3} -c \ +! "import sys; print(sys.exec_prefix)"` + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_epfx" >&5 + $as_echo "$vi_cv_path_python3_epfx" >&6; } + + +! if test "${vi_cv_path_python3path+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + vi_cv_path_python3path=` +! unset PYTHONPATH; +! ${vi_cv_path_python3} -c \ +! "import sys, string; print(':'.join(sys.path))"` + fi + + +--- 5596,5658 ---- + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python3_version" >&5 + $as_echo "$vi_cv_var_python3_version" >&6; } + +! { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python is 3.0 or better" >&5 +! $as_echo_n "checking Python is 3.0 or better... " >&6; } +! if ${vi_cv_path_python3} -c \ +! "import sys; sys.exit(${vi_cv_var_python3_version} < 3.0)" +! then +! { $as_echo "$as_me:${as_lineno-$LINENO}: result: yep" >&5 +! $as_echo "yep" >&6; } +! +! { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's abiflags" >&5 + $as_echo_n "checking Python's abiflags... " >&6; } + if test "${vi_cv_var_python3_abiflags+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + +! vi_cv_var_python3_abiflags= +! if ${vi_cv_path_python3} -c \ +! "import sys; sys.exit(${vi_cv_var_python3_version} < 3.2)" +! then +! vi_cv_var_python3_abiflags=`${vi_cv_path_python3} -c \ +! "import sys; print(sys.abiflags)"` +! fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python3_abiflags" >&5 + $as_echo "$vi_cv_var_python3_abiflags" >&6; } + +! { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's install prefix" >&5 + $as_echo_n "checking Python's install prefix... " >&6; } + if test "${vi_cv_path_python3_pfx+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + vi_cv_path_python3_pfx=` +! ${vi_cv_path_python3} -c \ +! "import sys; print(sys.prefix)"` + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_pfx" >&5 + $as_echo "$vi_cv_path_python3_pfx" >&6; } + +! { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's execution prefix" >&5 + $as_echo_n "checking Python's execution prefix... " >&6; } + if test "${vi_cv_path_python3_epfx+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + vi_cv_path_python3_epfx=` +! ${vi_cv_path_python3} -c \ +! "import sys; print(sys.exec_prefix)"` + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_epfx" >&5 + $as_echo "$vi_cv_path_python3_epfx" >&6; } + + +! if test "${vi_cv_path_python3path+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + vi_cv_path_python3path=` +! unset PYTHONPATH; +! ${vi_cv_path_python3} -c \ +! "import sys, string; print(':'.join(sys.path))"` + fi + + +*************** +*** 5654,5702 **** + fi + + +! { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's configuration directory" >&5 + $as_echo_n "checking Python's configuration directory... " >&6; } + if test "${vi_cv_path_python3_conf+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + +! vi_cv_path_python3_conf= +! config_dir="config" +! if test "${vi_cv_var_python3_abiflags}" != ""; then +! config_dir="${config_dir}-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" +! fi +! d=`${vi_cv_path_python3} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"` +! if test -d "$d" && test -f "$d/config.c"; then +! vi_cv_path_python3_conf="$d" +! else +! for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do +! for subdir in lib64 lib share; do +! d="${path}/${subdir}/python${vi_cv_var_python3_version}/${config_dir}" +! if test -d "$d" && test -f "$d/config.c"; then +! vi_cv_path_python3_conf="$d" +! fi +! done +! done +! fi + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_conf" >&5 + $as_echo "$vi_cv_path_python3_conf" >&6; } + +! PYTHON3_CONFDIR="${vi_cv_path_python3_conf}" + +! if test "X$PYTHON3_CONFDIR" = "X"; then +! { $as_echo "$as_me:${as_lineno-$LINENO}: result: can't find it!" >&5 + $as_echo "can't find it!" >&6; } +! else + +! if test "${vi_cv_path_python3_plibs+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + +! pwd=`pwd` +! tmp_mkf="$pwd/config-PyMake$$" +! cat -- "${PYTHON3_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}" + __: + @echo "python3_BASEMODLIBS='$(BASEMODLIBS)'" + @echo "python3_LIBS='$(LIBS)'" +--- 5664,5712 ---- + fi + + +! { $as_echo "$as_me:${as_lineno-$LINENO}: checking Python's configuration directory" >&5 + $as_echo_n "checking Python's configuration directory... " >&6; } + if test "${vi_cv_path_python3_conf+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + +! vi_cv_path_python3_conf= +! config_dir="config" +! if test "${vi_cv_var_python3_abiflags}" != ""; then +! config_dir="${config_dir}-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" +! fi +! d=`${vi_cv_path_python3} -c "import distutils.sysconfig; print(distutils.sysconfig.get_config_var('LIBPL'))"` +! if test -d "$d" && test -f "$d/config.c"; then +! vi_cv_path_python3_conf="$d" +! else +! for path in "${vi_cv_path_python3_pfx}" "${vi_cv_path_python3_epfx}"; do +! for subdir in lib64 lib share; do +! d="${path}/${subdir}/python${vi_cv_var_python3_version}/${config_dir}" +! if test -d "$d" && test -f "$d/config.c"; then +! vi_cv_path_python3_conf="$d" +! fi +! done +! done +! fi + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_conf" >&5 + $as_echo "$vi_cv_path_python3_conf" >&6; } + +! PYTHON3_CONFDIR="${vi_cv_path_python3_conf}" + +! if test "X$PYTHON3_CONFDIR" = "X"; then +! { $as_echo "$as_me:${as_lineno-$LINENO}: result: can't find it!" >&5 + $as_echo "can't find it!" >&6; } +! else + +! if test "${vi_cv_path_python3_plibs+set}" = set; then : + $as_echo_n "(cached) " >&6 + else + +! pwd=`pwd` +! tmp_mkf="$pwd/config-PyMake$$" +! cat -- "${PYTHON3_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}" + __: + @echo "python3_BASEMODLIBS='$(BASEMODLIBS)'" + @echo "python3_LIBS='$(LIBS)'" +*************** +*** 5704,5748 **** + @echo "python3_DLLLIBRARY='$(DLLLIBRARY)'" + @echo "python3_INSTSONAME='$(INSTSONAME)'" + eof +! eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`" +! rm -f -- "${tmp_mkf}" +! vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" +! vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS}" +! vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//` +! vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//` + + fi + + +! if test "X$python3_DLLLIBRARY" != "X"; then +! python3_INSTSONAME="$python3_DLLLIBRARY" +! fi +! PYTHON3_LIBS="${vi_cv_path_python3_plibs}" +! if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then +! PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\"" +! else +! PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\"" +! fi +! PYTHON3_SRC="if_python3.c" +! PYTHON3_OBJ="objects/if_python3.o" + +! { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -pthread should be used" >&5 + $as_echo_n "checking if -pthread should be used... " >&6; } +! threadsafe_flag= +! thread_lib= +! if test "`(uname) 2>/dev/null`" != Darwin; then +! test "$GCC" = yes && threadsafe_flag="-pthread" +! if test "`(uname) 2>/dev/null`" = FreeBSD; then +! threadsafe_flag="-D_THREAD_SAFE" +! thread_lib="-pthread" + fi +! fi +! libs_save_old=$LIBS +! if test -n "$threadsafe_flag"; then +! cflags_save=$CFLAGS +! CFLAGS="$CFLAGS $threadsafe_flag" +! LIBS="$LIBS $thread_lib" +! cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +--- 5714,5761 ---- + @echo "python3_DLLLIBRARY='$(DLLLIBRARY)'" + @echo "python3_INSTSONAME='$(INSTSONAME)'" + eof +! eval "`cd ${PYTHON3_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`" +! rm -f -- "${tmp_mkf}" +! vi_cv_path_python3_plibs="-L${PYTHON3_CONFDIR} -lpython${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" +! vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS}" +! vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//` +! vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//` + + fi + + +! if test "X$python3_DLLLIBRARY" != "X"; then +! python3_INSTSONAME="$python3_DLLLIBRARY" +! fi +! PYTHON3_LIBS="${vi_cv_path_python3_plibs}" +! if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then +! PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\"" +! else +! PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\"" +! fi +! PYTHON3_SRC="if_python3.c" +! PYTHON3_OBJ="objects/if_python3.o" + +! { $as_echo "$as_me:${as_lineno-$LINENO}: checking if -pthread should be used" >&5 + $as_echo_n "checking if -pthread should be used... " >&6; } +! threadsafe_flag= +! thread_lib= +! if test "`(uname) 2>/dev/null`" != Darwin; then +! test "$GCC" = yes && threadsafe_flag="-pthread" +! if test "`(uname) 2>/dev/null`" = FreeBSD; then +! threadsafe_flag="-D_THREAD_SAFE" +! thread_lib="-pthread" +! fi +! if test "`(uname) 2>/dev/null`" = SunOS; then +! threadsafe_flag="-pthreads" +! fi + fi +! libs_save_old=$LIBS +! if test -n "$threadsafe_flag"; then +! cflags_save=$CFLAGS +! CFLAGS="$CFLAGS $threadsafe_flag" +! LIBS="$LIBS $thread_lib" +! cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +*************** +*** 5763,5781 **** + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +! CFLAGS=$cflags_save +! else +! { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + $as_echo "no" >&6; } +! fi + +! { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compile and link flags for Python 3 are sane" >&5 + $as_echo_n "checking if compile and link flags for Python 3 are sane... " >&6; } +! cflags_save=$CFLAGS +! libs_save=$LIBS +! CFLAGS="$CFLAGS $PYTHON3_CFLAGS" +! LIBS="$LIBS $PYTHON3_LIBS" +! cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +--- 5776,5794 ---- + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +! CFLAGS=$cflags_save +! else +! { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 + $as_echo "no" >&6; } +! fi + +! { $as_echo "$as_me:${as_lineno-$LINENO}: checking if compile and link flags for Python 3 are sane" >&5 + $as_echo_n "checking if compile and link flags for Python 3 are sane... " >&6; } +! cflags_save=$CFLAGS +! libs_save=$LIBS +! CFLAGS="$CFLAGS $PYTHON3_CFLAGS" +! LIBS="$LIBS $PYTHON3_LIBS" +! cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + + int +*************** +*** 5795,5812 **** + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +! CFLAGS=$cflags_save +! LIBS=$libs_save +! if test "$python3_ok" = yes; then +! $as_echo "#define FEAT_PYTHON3 1" >>confdefs.h +! +! else +! LIBS=$libs_save_old +! PYTHON3_SRC= +! PYTHON3_OBJ= +! PYTHON3_LIBS= +! PYTHON3_CFLAGS= + fi + fi + fi + fi +--- 5808,5829 ---- + fi + rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +! CFLAGS=$cflags_save +! LIBS=$libs_save +! if test "$python3_ok" = yes; then +! $as_echo "#define FEAT_PYTHON3 1" >>confdefs.h +! +! else +! LIBS=$libs_save_old +! PYTHON3_SRC= +! PYTHON3_OBJ= +! PYTHON3_LIBS= +! PYTHON3_CFLAGS= +! fi + fi ++ else ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: too old" >&5 ++ $as_echo "too old" >&6; } + fi + fi + fi +*************** +*** 8780,8786 **** + xmheader="Xm/Xm.h" + else + xmheader="Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h +! Xm/UnhighlightT.h Xm/Notebook.h" + fi + for ac_header in $xmheader + do : +--- 8797,8803 ---- + xmheader="Xm/Xm.h" + else + xmheader="Xm/Xm.h Xm/XpmP.h Xm/JoinSideT.h Xm/TraitP.h Xm/Manager.h +! Xm/UnhighlightT.h Xm/Notebook.h" + fi + for ac_header in $xmheader + do : +*************** +*** 11777,11783 **** + main () + { + struct sysinfo sinfo; +! sinfo.mem_unit = 1; + + ; + return 0; +--- 11794,11800 ---- + main () + { + struct sysinfo sinfo; +! sinfo.mem_unit = 1; + + ; + return 0; +*** ../vim-7.3.1166/src/version.c 2013-06-11 18:47:37.000000000 +0200 +--- src/version.c 2013-06-11 19:51:50.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1167, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +147. You finally give up smoking...because it made the monitor dirty. + + /// 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 /// diff --git a/7.3.1168 b/7.3.1168 new file mode 100644 index 0000000..ec1a7a0 --- /dev/null +++ b/7.3.1168 @@ -0,0 +1,123 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1168 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1168 +Problem: Python "sane" configure checks give a warning message. +Solution: Use single quotes intead of escaped double quotes. (Ben Fritz) +Files: src/configure.in, src/auto/configure + + +*** ../vim-7.3.1167/src/configure.in 2013-06-11 19:53:34.000000000 +0200 +--- src/configure.in 2013-06-11 20:15:21.000000000 +0200 +*************** +*** 958,966 **** + fi + PYTHON_LIBS="${vi_cv_path_python_plibs}" + if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then +! PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME=\\\"${vi_cv_path_python_pfx}\\\"" + else +! PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -I${vi_cv_path_python_epfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME=\\\"${vi_cv_path_python_pfx}\\\"" + fi + PYTHON_SRC="if_python.c" + PYTHON_OBJ="objects/if_python.o" +--- 958,966 ---- + fi + PYTHON_LIBS="${vi_cv_path_python_plibs}" + if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then +! PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME='\"${vi_cv_path_python_pfx}\"'" + else +! PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -I${vi_cv_path_python_epfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME='\"${vi_cv_path_python_pfx}\"'" + fi + PYTHON_SRC="if_python.c" + PYTHON_OBJ="objects/if_python.o" +*************** +*** 1161,1169 **** + fi + PYTHON3_LIBS="${vi_cv_path_python3_plibs}" + if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then +! PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\"" + else +! PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\"" + fi + PYTHON3_SRC="if_python3.c" + PYTHON3_OBJ="objects/if_python3.o" +--- 1161,1169 ---- + fi + PYTHON3_LIBS="${vi_cv_path_python3_plibs}" + if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then +! PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME='L\"${vi_cv_path_python3_pfx}\"'" + else +! PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME='L\"${vi_cv_path_python3_pfx}\"'" + fi + PYTHON3_SRC="if_python3.c" + PYTHON3_OBJ="objects/if_python3.o" +*** ../vim-7.3.1167/src/auto/configure 2013-06-11 19:53:34.000000000 +0200 +--- src/auto/configure 2013-06-11 20:15:24.000000000 +0200 +*************** +*** 5410,5418 **** + fi + PYTHON_LIBS="${vi_cv_path_python_plibs}" + if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then +! PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME=\\\"${vi_cv_path_python_pfx}\\\"" + else +! PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -I${vi_cv_path_python_epfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME=\\\"${vi_cv_path_python_pfx}\\\"" + fi + PYTHON_SRC="if_python.c" + PYTHON_OBJ="objects/if_python.o" +--- 5410,5418 ---- + fi + PYTHON_LIBS="${vi_cv_path_python_plibs}" + if test "${vi_cv_path_python_pfx}" = "${vi_cv_path_python_epfx}"; then +! PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME='\"${vi_cv_path_python_pfx}\"'" + else +! PYTHON_CFLAGS="-I${vi_cv_path_python_pfx}/include/python${vi_cv_var_python_version} -I${vi_cv_path_python_epfx}/include/python${vi_cv_var_python_version} -DPYTHON_HOME='\"${vi_cv_path_python_pfx}\"'" + fi + PYTHON_SRC="if_python.c" + PYTHON_OBJ="objects/if_python.o" +*************** +*** 5729,5737 **** + fi + PYTHON3_LIBS="${vi_cv_path_python3_plibs}" + if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then +! PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\"" + else +! PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME=L\\\"${vi_cv_path_python3_pfx}\\\"" + fi + PYTHON3_SRC="if_python3.c" + PYTHON3_OBJ="objects/if_python3.o" +--- 5729,5737 ---- + fi + PYTHON3_LIBS="${vi_cv_path_python3_plibs}" + if test "${vi_cv_path_python3_pfx}" = "${vi_cv_path_python3_epfx}"; then +! PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME='L\"${vi_cv_path_python3_pfx}\"'" + else +! PYTHON3_CFLAGS="-I${vi_cv_path_python3_pfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -I${vi_cv_path_python3_epfx}/include/python${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags} -DPYTHON3_HOME='L\"${vi_cv_path_python3_pfx}\"'" + fi + PYTHON3_SRC="if_python3.c" + PYTHON3_OBJ="objects/if_python3.o" +*** ../vim-7.3.1167/src/version.c 2013-06-11 19:53:34.000000000 +0200 +--- src/version.c 2013-06-11 20:17:21.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1168, + /**/ + +-- +Although the scythe isn't pre-eminent among the weapons of war, anyone who +has been on the wrong end of, say, a peasants' revolt will know that in +skilled hands it is fearsome. + -- (Terry Pratchett, Mort) + + /// 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 /// diff --git a/7.3.1169 b/7.3.1169 new file mode 100644 index 0000000..aa804b6 --- /dev/null +++ b/7.3.1169 @@ -0,0 +1,384 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1169 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1169 +Problem: New regexp engine: some work is done while executing a pattern, + even though the result is predictable. +Solution: Do the work while compiling the pattern. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1168/src/regexp_nfa.c 2013-06-11 18:42:28.000000000 +0200 +--- src/regexp_nfa.c 2013-06-11 22:40:12.000000000 +0200 +*************** +*** 64,72 **** +--- 64,76 ---- + NFA_NOPEN, /* Start of subexpression marked with \%( */ + NFA_NCLOSE, /* End of subexpr. marked with \%( ... \) */ + NFA_START_INVISIBLE, ++ NFA_START_INVISIBLE_FIRST, + NFA_START_INVISIBLE_NEG, ++ NFA_START_INVISIBLE_NEG_FIRST, + NFA_START_INVISIBLE_BEFORE, ++ NFA_START_INVISIBLE_BEFORE_FIRST, + NFA_START_INVISIBLE_BEFORE_NEG, ++ NFA_START_INVISIBLE_BEFORE_NEG_FIRST, + NFA_START_PATTERN, + NFA_END_INVISIBLE, + NFA_END_INVISIBLE_NEG, +*************** +*** 286,291 **** +--- 290,296 ---- + static int *re2post __ARGS((void)); + static nfa_state_T *alloc_state __ARGS((int c, nfa_state_T *out, nfa_state_T *out1)); + static nfa_state_T *post2nfa __ARGS((int *postfix, int *end, int nfa_calc_size)); ++ static void nfa_postprocess __ARGS((nfa_regprog_T *prog)); + static int check_char_class __ARGS((int class, int c)); + static void st_error __ARGS((int *postfix, int *end, int *p)); + static void nfa_save_listids __ARGS((nfa_regprog_T *prog, int *list)); +*************** +*** 297,302 **** +--- 302,309 ---- + static void nfa_regfree __ARGS((regprog_T *prog)); + static int nfa_regexec __ARGS((regmatch_T *rmp, char_u *line, colnr_T col)); + static long nfa_regexec_multi __ARGS((regmmatch_T *rmp, win_T *win, buf_T *buf, linenr_T lnum, colnr_T col, proftime_T *tm)); ++ static int match_follows __ARGS((nfa_state_T *startstate, int depth)); ++ static int failure_chance __ARGS((nfa_state_T *state, int depth)); + + /* helper functions used when doing re2post() ... regatom() parsing */ + #define EMIT(c) do { \ +*************** +*** 2040,2051 **** +--- 2047,2066 ---- + case NFA_NOPEN: STRCPY(code, "NFA_NOPEN"); break; + case NFA_NCLOSE: STRCPY(code, "NFA_NCLOSE"); break; + case NFA_START_INVISIBLE: STRCPY(code, "NFA_START_INVISIBLE"); break; ++ case NFA_START_INVISIBLE_FIRST: ++ STRCPY(code, "NFA_START_INVISIBLE_FIRST"); break; + case NFA_START_INVISIBLE_NEG: + STRCPY(code, "NFA_START_INVISIBLE_NEG"); break; ++ case NFA_START_INVISIBLE_NEG_FIRST: ++ STRCPY(code, "NFA_START_INVISIBLE_NEG_FIRST"); break; + case NFA_START_INVISIBLE_BEFORE: + STRCPY(code, "NFA_START_INVISIBLE_BEFORE"); break; ++ case NFA_START_INVISIBLE_BEFORE_FIRST: ++ STRCPY(code, "NFA_START_INVISIBLE_BEFORE_FIRST"); break; + case NFA_START_INVISIBLE_BEFORE_NEG: + STRCPY(code, "NFA_START_INVISIBLE_BEFORE_NEG"); break; ++ case NFA_START_INVISIBLE_BEFORE_NEG_FIRST: ++ STRCPY(code, "NFA_START_INVISIBLE_BEFORE_NEG_FIRST"); break; + case NFA_START_PATTERN: STRCPY(code, "NFA_START_PATTERN"); break; + case NFA_END_INVISIBLE: STRCPY(code, "NFA_END_INVISIBLE"); break; + case NFA_END_INVISIBLE_NEG: STRCPY(code, "NFA_END_INVISIBLE_NEG"); break; +*************** +*** 3318,3323 **** +--- 3333,3395 ---- + #undef PUSH + } + ++ /* ++ * After building the NFA program, inspect it to add optimization hints. ++ */ ++ static void ++ nfa_postprocess(prog) ++ nfa_regprog_T *prog; ++ { ++ int i; ++ int c; ++ ++ for (i = 0; i < prog->nstate; ++i) ++ { ++ c = prog->state[i].c; ++ if (c == NFA_START_INVISIBLE ++ || c == NFA_START_INVISIBLE_NEG ++ || c == NFA_START_INVISIBLE_BEFORE ++ || c == NFA_START_INVISIBLE_BEFORE_NEG) ++ { ++ int directly; ++ ++ /* Do it directly when what follows is possibly the end of the ++ * match. */ ++ if (match_follows(prog->state[i].out1->out, 0)) ++ directly = TRUE; ++ else ++ { ++ int ch_invisible = failure_chance(prog->state[i].out, 0); ++ int ch_follows = failure_chance(prog->state[i].out1->out, 0); ++ ++ /* Postpone when the invisible match is expensive or has a ++ * lower chance of failing. */ ++ if (c == NFA_START_INVISIBLE_BEFORE ++ || c == NFA_START_INVISIBLE_BEFORE_NEG) ++ { ++ /* "before" matches are very expensive when ++ * unbounded, always prefer what follows then, ++ * unless what follows will always match. ++ * Otherwise strongly prefer what follows. */ ++ if (prog->state[i].val <= 0 && ch_follows > 0) ++ directly = FALSE; ++ else ++ directly = ch_follows * 10 < ch_invisible; ++ } ++ else ++ { ++ /* normal invisible, first do the one with the ++ * highest failure chance */ ++ directly = ch_follows < ch_invisible; ++ } ++ } ++ if (directly) ++ /* switch to the _FIRST state */ ++ ++prog->state[i].c; ++ } ++ } ++ } ++ + /**************************************************************** + * NFA execution code. + ****************************************************************/ +*************** +*** 3457,3463 **** + static void copy_sub_off __ARGS((regsub_T *to, regsub_T *from)); + static int sub_equal __ARGS((regsub_T *sub1, regsub_T *sub2)); + static int has_state_with_pos __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs)); +- static int match_follows __ARGS((nfa_state_T *startstate, int depth)); + static int state_in_list __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs)); + static void addstate __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs, nfa_pim_T *pim, int off)); + static void addstate_here __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs, nfa_pim_T *pim, int *ip)); +--- 3529,3534 ---- +*************** +*** 3703,3711 **** +--- 3774,3786 ---- + || match_follows(state->out1, depth + 1); + + case NFA_START_INVISIBLE: ++ case NFA_START_INVISIBLE_FIRST: + case NFA_START_INVISIBLE_BEFORE: ++ case NFA_START_INVISIBLE_BEFORE_FIRST: + case NFA_START_INVISIBLE_NEG: ++ case NFA_START_INVISIBLE_NEG_FIRST: + case NFA_START_INVISIBLE_BEFORE_NEG: ++ case NFA_START_INVISIBLE_BEFORE_NEG_FIRST: + case NFA_COMPOSING: + /* skip ahead to next state */ + state = state->out1->out; +*************** +*** 4440,4446 **** + } + + if (state->c == NFA_START_INVISIBLE_BEFORE +! || state->c == NFA_START_INVISIBLE_BEFORE_NEG) + { + /* The recursive match must end at the current position. When "pim" is + * not NULL it specifies the current position. */ +--- 4515,4523 ---- + } + + if (state->c == NFA_START_INVISIBLE_BEFORE +! || state->c == NFA_START_INVISIBLE_BEFORE_FIRST +! || state->c == NFA_START_INVISIBLE_BEFORE_NEG +! || state->c == NFA_START_INVISIBLE_BEFORE_NEG_FIRST) + { + /* The recursive match must end at the current position. When "pim" is + * not NULL it specifies the current position. */ +*************** +*** 4581,4587 **** + return result; + } + +- static int failure_chance __ARGS((nfa_state_T *state, int depth)); + static int skip_to_start __ARGS((int c, colnr_T *colp)); + static long find_match_text __ARGS((colnr_T startcol, int regstart, char_u *match_text)); + +--- 4658,4663 ---- +*************** +*** 5093,5142 **** + break; + + case NFA_START_INVISIBLE: + case NFA_START_INVISIBLE_NEG: + case NFA_START_INVISIBLE_BEFORE: + case NFA_START_INVISIBLE_BEFORE_NEG: + { +- int directly = FALSE; +- + #ifdef ENABLE_LOG + fprintf(log_fd, "Failure chance invisible: %d, what follows: %d\n", + failure_chance(t->state->out, 0), + failure_chance(t->state->out1->out, 0)); + #endif +! /* Do it directly when what follows is possibly the end of +! * the match. +! * Do it directly if there already is a PIM. +! * Postpone when the invisible match is expensive or has a +! * lower chance of failing. */ +! if (match_follows(t->state->out1->out, 0) +! || t->pim.result != NFA_PIM_UNUSED) +! directly = TRUE; +! else +! { +! int ch_invisible = failure_chance(t->state->out, 0); +! int ch_follows = failure_chance(t->state->out1->out, 0); +! +! if (t->state->c == NFA_START_INVISIBLE_BEFORE +! || t->state->c == NFA_START_INVISIBLE_BEFORE_NEG) +! { +! /* "before" matches are very expensive when +! * unbounded, always prefer what follows then, +! * unless what follows will always match. +! * Otherwise strongly prefer what follows. */ +! if (t->state->val <= 0 && ch_follows > 0) +! directly = FALSE; +! else +! directly = ch_follows * 10 < ch_invisible; +! } +! else +! { +! /* normal invisible, first do the one with the +! * highest failure chance */ +! directly = ch_follows < ch_invisible; +! } +! } +! if (directly) + { + /* + * First try matching the invisible match, then what +--- 5169,5194 ---- + break; + + case NFA_START_INVISIBLE: ++ case NFA_START_INVISIBLE_FIRST: + case NFA_START_INVISIBLE_NEG: ++ case NFA_START_INVISIBLE_NEG_FIRST: + case NFA_START_INVISIBLE_BEFORE: ++ case NFA_START_INVISIBLE_BEFORE_FIRST: + case NFA_START_INVISIBLE_BEFORE_NEG: ++ case NFA_START_INVISIBLE_BEFORE_NEG_FIRST: + { + #ifdef ENABLE_LOG + fprintf(log_fd, "Failure chance invisible: %d, what follows: %d\n", + failure_chance(t->state->out, 0), + failure_chance(t->state->out1->out, 0)); + #endif +! /* Do it directly if there already is a PIM or when +! * nfa_postprocess() detected it will work better. */ +! if (t->pim.result != NFA_PIM_UNUSED +! || t->state->c == NFA_START_INVISIBLE_FIRST +! || t->state->c == NFA_START_INVISIBLE_NEG_FIRST +! || t->state->c == NFA_START_INVISIBLE_BEFORE_FIRST +! || t->state->c == NFA_START_INVISIBLE_BEFORE_NEG_FIRST) + { + /* + * First try matching the invisible match, then what +*************** +*** 5148,5155 **** + /* for \@! and \@state->c == NFA_START_INVISIBLE_NEG +! || t->state->c +! == NFA_START_INVISIBLE_BEFORE_NEG)) + { + /* Copy submatch info from the recursive call */ + copy_sub_off(&t->subs.norm, &m->norm); +--- 5200,5210 ---- + /* for \@! and \@state->c == NFA_START_INVISIBLE_NEG +! || t->state->c == NFA_START_INVISIBLE_NEG_FIRST +! || t->state->c +! == NFA_START_INVISIBLE_BEFORE_NEG +! || t->state->c +! == NFA_START_INVISIBLE_BEFORE_NEG_FIRST)) + { + /* Copy submatch info from the recursive call */ + copy_sub_off(&t->subs.norm, &m->norm); +*************** +*** 5920,5927 **** + /* for \@! and \@state->c == NFA_START_INVISIBLE_NEG +! || pim->state->c +! == NFA_START_INVISIBLE_BEFORE_NEG)) + { + /* Copy submatch info from the recursive call */ + copy_sub_off(&pim->subs.norm, &m->norm); +--- 5975,5985 ---- + /* for \@! and \@state->c == NFA_START_INVISIBLE_NEG +! || pim->state->c == NFA_START_INVISIBLE_NEG_FIRST +! || pim->state->c +! == NFA_START_INVISIBLE_BEFORE_NEG +! || pim->state->c +! == NFA_START_INVISIBLE_BEFORE_NEG_FIRST)) + { + /* Copy submatch info from the recursive call */ + copy_sub_off(&pim->subs.norm, &m->norm); +*************** +*** 5944,5951 **** + + /* for \@! and \@state->c == NFA_START_INVISIBLE_NEG +! || pim->state->c +! == NFA_START_INVISIBLE_BEFORE_NEG)) + { + /* Copy submatch info from the recursive call */ + copy_sub_off(&t->subs.norm, &pim->subs.norm); +--- 6002,6012 ---- + + /* for \@! and \@state->c == NFA_START_INVISIBLE_NEG +! || pim->state->c == NFA_START_INVISIBLE_NEG_FIRST +! || pim->state->c +! == NFA_START_INVISIBLE_BEFORE_NEG +! || pim->state->c +! == NFA_START_INVISIBLE_BEFORE_NEG_FIRST)) + { + /* Copy submatch info from the recursive call */ + copy_sub_off(&t->subs.norm, &pim->subs.norm); +*************** +*** 6413,6421 **** + prog->has_backref = nfa_has_backref; + prog->nsubexp = regnpar; + + prog->reganch = nfa_get_reganch(prog->start, 0); + prog->regstart = nfa_get_regstart(prog->start, 0); +- + prog->match_text = nfa_get_match_text(prog->start); + + #ifdef ENABLE_LOG +--- 6474,6483 ---- + prog->has_backref = nfa_has_backref; + prog->nsubexp = regnpar; + ++ nfa_postprocess(prog); ++ + prog->reganch = nfa_get_reganch(prog->start, 0); + prog->regstart = nfa_get_regstart(prog->start, 0); + prog->match_text = nfa_get_match_text(prog->start); + + #ifdef ENABLE_LOG +*** ../vim-7.3.1168/src/version.c 2013-06-11 20:53:24.000000000 +0200 +--- src/version.c 2013-06-11 22:43:27.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1169, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +156. You forget your friend's name but not her e-mail address. + + /// 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 /// diff --git a/7.3.1170 b/7.3.1170 new file mode 100644 index 0000000..b94f5ff --- /dev/null +++ b/7.3.1170 @@ -0,0 +1,97 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1170 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1170 +Problem: Patch 7.3.1058 breaks backwards compatibility, not possible to use + a function reference as a string. (lilydjwg) +Solution: Instead of translating the function name only translate "s:". +Files: src/eval.c + + +*** ../vim-7.3.1169/src/eval.c 2013-06-11 18:40:06.000000000 +0200 +--- src/eval.c 2013-06-12 13:31:26.000000000 +0200 +*************** +*** 10962,10986 **** + typval_T *rettv; + { + char_u *s; +- char_u *name = NULL; + + s = get_tv_string(&argvars[0]); + if (s == NULL || *s == NUL || VIM_ISDIGIT(*s)) + EMSG2(_(e_invarg2), s); +! /* Don't check an autoload name for existence here, but still expand it +! * checking for validity */ +! else if ((name = get_expanded_name(s, vim_strchr(s, AUTOLOAD_CHAR) == NULL)) +! == NULL) + EMSG2(_("E700: Unknown function: %s"), s); + else + { +! if (name == NULL) +! /* Autoload function, need to copy string */ +! rettv->vval.v_string = vim_strsave(s); + else +! /* Function found by get_expanded_name, string allocated by +! * trans_function_name: no need to copy */ +! rettv->vval.v_string = name; + rettv->v_type = VAR_FUNC; + } + } +--- 10962,10994 ---- + typval_T *rettv; + { + char_u *s; + + s = get_tv_string(&argvars[0]); + if (s == NULL || *s == NUL || VIM_ISDIGIT(*s)) + EMSG2(_(e_invarg2), s); +! /* Don't check an autoload name for existence here. */ +! else if (vim_strchr(s, AUTOLOAD_CHAR) == NULL && !function_exists(s)) + EMSG2(_("E700: Unknown function: %s"), s); + else + { +! if (STRNCMP(s, "s:", 2) == 0) +! { +! char sid_buf[25]; +! +! /* Expand s: into nr_, so that the function can also be +! * called from another script. Using trans_function_name() would +! * also work, but some plugins depend on the name being printable +! * text. */ +! sprintf(sid_buf, "%ld_", (long)current_SID); +! rettv->vval.v_string = alloc(STRLEN(sid_buf) + STRLEN(s + 2) + 1); +! if (rettv->vval.v_string != NULL) +! { +! STRCPY(rettv->vval.v_string, sid_buf); +! STRCAT(rettv->vval.v_string, s + 2); +! } +! } + else +! rettv->vval.v_string = vim_strsave(s); + rettv->v_type = VAR_FUNC; + } + } +*** ../vim-7.3.1169/src/version.c 2013-06-11 22:44:03.000000000 +0200 +--- src/version.c 2013-06-12 13:36:11.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1170, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +165. You have a web page burned into your glasses + + /// 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 /// diff --git a/7.3.1171 b/7.3.1171 new file mode 100644 index 0000000..b22f972 --- /dev/null +++ b/7.3.1171 @@ -0,0 +1,67 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1171 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1171 +Problem: Check for digits and ascii letters can be faster. +Solution: Use a trick with one comparison. (Dominique Pelle) +Files: src/macros.h + + +*** ../vim-7.3.1170/src/macros.h 2013-06-08 18:19:40.000000000 +0200 +--- src/macros.h 2013-06-12 14:03:00.000000000 +0200 +*************** +*** 109,123 **** + #else + # define ASCII_ISALPHA(c) ((c) < 0x7f && isalpha(c)) + # define ASCII_ISALNUM(c) ((c) < 0x7f && isalnum(c)) +! # define ASCII_ISLOWER(c) ((c) < 0x7f && islower(c)) +! # define ASCII_ISUPPER(c) ((c) < 0x7f && isupper(c)) + #endif + + /* Use our own isdigit() replacement, because on MS-Windows isdigit() returns + * non-zero for superscript 1. Also avoids that isdigit() crashes for numbers +! * below 0 and above 255. For complicated arguments and in/decrement use +! * vim_isdigit() instead. */ +! #define VIM_ISDIGIT(c) ((c) >= '0' && (c) <= '9') + + /* macro version of chartab(). + * Only works with values 0-255! +--- 109,122 ---- + #else + # define ASCII_ISALPHA(c) ((c) < 0x7f && isalpha(c)) + # define ASCII_ISALNUM(c) ((c) < 0x7f && isalnum(c)) +! # define ASCII_ISLOWER(c) ((unsigned)(c) - 'a' < 26) +! # define ASCII_ISUPPER(c) ((unsigned)(c) - 'A' < 26) + #endif + + /* Use our own isdigit() replacement, because on MS-Windows isdigit() returns + * non-zero for superscript 1. Also avoids that isdigit() crashes for numbers +! * below 0 and above 255. */ +! #define VIM_ISDIGIT(c) ((unsigned)(c) - '0' < 10) + + /* macro version of chartab(). + * Only works with values 0-255! +*** ../vim-7.3.1170/src/version.c 2013-06-12 13:37:36.000000000 +0200 +--- src/version.c 2013-06-12 14:09:00.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1171, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +167. You have more than 200 websites bookmarked. + + /// 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 /// diff --git a/7.3.1172 b/7.3.1172 new file mode 100644 index 0000000..9dc3a78 --- /dev/null +++ b/7.3.1172 @@ -0,0 +1,726 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1172 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1172 +Problem: Python 2: loading modules doesn't work well. +Solution: Fix the code. Add more tests. (ZyX) +Files: runtime/doc/if_pyth.txt, src/if_py_both.h, src/if_python.c, + src/testdir/python2/module.py, src/testdir/python3/module.py, + src/testdir/python_after/after.py, + src/testdir/python_before/before.py, src/testdir/test86.in, + src/testdir/test86.ok, src/testdir/test87.in, + src/testdir/test87.ok, Filelist + + +*** ../vim-7.3.1171/runtime/doc/if_pyth.txt 2013-06-10 21:27:18.000000000 +0200 +--- runtime/doc/if_pyth.txt 2013-06-12 14:12:13.000000000 +0200 +*************** +*** 315,366 **** + {rtp}/python2 (or python3) and {rtp}/pythonx (for both python versions) for + each {rtp} found in 'runtimepath'. + +! Implementation for python 2 is the following: usual importing code with empty +! lists in place of sys.path_hooks and sys.meta_path. Code is similar to the +! below, but written in C: > + +! # Assuming vim variable is already accessible and is set to the current +! # module + import sys + +! def find_module(fullname): +! return vim + +! def load_module(fullname): +! # see vim._get_paths below +! new_path = _get_paths() +! +! try: old_path = sys.path +! except: pass +! try: old_meta_path = sys.meta_path +! except: pass +! try: old_path_hooks = sys.path_hooks +! except: pass +! +! sys.meta_path = [] +! sys.path_hooks = sys.meta_path +! sys.path = new_path +! +! try: +! exec ('import ' + fullname + ' as m') # No actual exec in C code +! return m +! finally: +! e = None +! try: sys.path = old_path +! except Exception as e: pass +! try: sys.meta_path = old_meta_path +! except Exception as e: pass +! try: sys.path_hooks = old_path_hooks +! except Exception as e: pass +! if e: +! raise e +! +! def path_hook(d): +! if d == VIM_SPECIAL_PATH: +! return vim +! raise ImportError +! +! sys.path_hooks.append(path_hook) + + Implementation for python 3 is cleaner: code is similar to the following, but, + again, written in C: > +--- 315,367 ---- + {rtp}/python2 (or python3) and {rtp}/pythonx (for both python versions) for + each {rtp} found in 'runtimepath'. + +! Implementation for python 2 is similar to the following, but written in C: > + +! from imp import find_module, load_module +! import vim + import sys + +! class VimModuleLoader(object): +! def __init__(self, module): +! self.module = module +! +! def load_module(self, fullname, path=None): +! return self.module +! +! def _find_module(fullname, oldtail, path): +! idx = oldtail.find('.') +! if idx > 0: +! name = oldtail[:idx] +! tail = oldtail[idx+1:] +! fmr = find_module(name, path) +! module = load_module(fullname[:-len(oldtail)] + name, *fmr) +! return _find_module(fullname, tail, module.__path__) +! else: +! fmr = find_module(fullname, path) +! return load_module(fullname, *fmr) +! +! # It uses vim module itself in place of VimPathFinder class: it does not +! # matter for python which object has find_module function attached to as +! # an attribute. +! class VimPathFinder(object): +! def find_module(cls, fullname, path=None): +! try: +! return VimModuleLoader(_find_module(fullname, fullname, path or vim._get_paths())) +! except ImportError: +! return None +! find_module = classmethod(find_module) +! +! def load_module(cls, fullname, path=None): +! return _find_module(fullname, fullname, path or vim._get_paths()) +! load_module = classmethod(load_module) +! +! def hook(path): +! if path == vim.VIM_SPECIAL_PATH: +! return VimPathFinder +! else: +! raise ImportError + +! sys.path_hooks.append(hook) + + Implementation for python 3 is cleaner: code is similar to the following, but, + again, written in C: > +*************** +*** 395,408 **** + Note: you must not use value of this constant directly, always use + vim.VIM_SPECIAL_PATH object. + +- vim.load_module(name) *python-load_module* + vim.find_module(...) *python-find_module* + vim.path_hook(path) *python-path_hook* + Methods or objects used to implement path loading as described above. + You should not be using any of these directly except for vim.path_hook + in case you need to do something with sys.meta_path. It is not + guaranteed that any of the objects will exist in the future vim +! versions. In fact, load_module and find_module methods do not exists + in python3. + + vim._get_paths *python-_get_paths* +--- 396,408 ---- + Note: you must not use value of this constant directly, always use + vim.VIM_SPECIAL_PATH object. + + vim.find_module(...) *python-find_module* + vim.path_hook(path) *python-path_hook* + Methods or objects used to implement path loading as described above. + You should not be using any of these directly except for vim.path_hook + in case you need to do something with sys.meta_path. It is not + guaranteed that any of the objects will exist in the future vim +! versions. In fact, find_module methods do not exists + in python3. + + vim._get_paths *python-_get_paths* +*** ../vim-7.3.1171/src/if_py_both.h 2013-06-10 21:27:18.000000000 +0200 +--- src/if_py_both.h 2013-06-12 14:12:13.000000000 +0200 +*************** +*** 940,946 **** + {"foreach_rtp", VimForeachRTP, METH_VARARGS, "Call given callable for each path in &rtp"}, + #if PY_MAJOR_VERSION < 3 + {"find_module", FinderFindModule, METH_VARARGS, "Internal use only, returns loader object for any input it receives"}, +- {"load_module", LoaderLoadModule, METH_VARARGS, "Internal use only, tries importing the given module from &rtp by temporary mocking sys.path (to an rtp-based one) and unsetting sys.meta_path and sys.path_hooks"}, + #endif + {"path_hook", VimPathHook, METH_VARARGS, "Hook function to install in sys.path_hooks"}, + {"_get_paths", (PyCFunction)Vim_GetPaths, METH_NOARGS, "Get &rtp-based additions to sys.path"}, +--- 940,945 ---- +*************** +*** 5195,5200 **** +--- 5194,5206 ---- + PyObject_HEAD + } FinderObject; + static PyTypeObject FinderType; ++ #else ++ typedef struct ++ { ++ PyObject_HEAD ++ PyObject *module; ++ } LoaderObject; ++ static PyTypeObject LoaderType; + #endif + + static void +*************** +*** 5444,5449 **** +--- 5450,5457 ---- + PYTYPE_READY(OutputType); + #if PY_MAJOR_VERSION >= 3 + PYTYPE_READY(FinderType); ++ #else ++ PYTYPE_READY(LoaderType); + #endif + return 0; + } +*************** +*** 5570,5575 **** +--- 5578,5585 ---- + {"Options", (PyObject *)&OptionsType}, + #if PY_MAJOR_VERSION >= 3 + {"Finder", (PyObject *)&FinderType}, ++ #else ++ {"Loader", (PyObject *)&LoaderType}, + #endif + }; + +*************** +*** 5666,5671 **** +--- 5676,5684 ---- + ADD_CHECKED_OBJECT(m, "_find_module", + (py_find_module = PyObject_GetAttrString(path_finder, + "find_module"))); ++ #else ++ ADD_OBJECT(m, "_find_module", py_find_module); ++ ADD_OBJECT(m, "_load_module", py_load_module); + #endif + + return 0; +*** ../vim-7.3.1171/src/if_python.c 2013-06-10 21:27:18.000000000 +0200 +--- src/if_python.c 2013-06-12 14:14:27.000000000 +0200 +*************** +*** 150,155 **** +--- 150,156 ---- + # undef Py_InitModule4 + # undef Py_InitModule4_64 + # undef PyObject_CallMethod ++ # undef PyObject_CallFunction + + /* + * Wrapper defines +*************** +*** 219,224 **** +--- 220,226 ---- + # define PyObject_HasAttrString dll_PyObject_HasAttrString + # define PyObject_SetAttrString dll_PyObject_SetAttrString + # define PyObject_CallFunctionObjArgs dll_PyObject_CallFunctionObjArgs ++ # define PyObject_CallFunction dll_PyObject_CallFunction + # define PyObject_Call dll_PyObject_Call + # define PyString_AsString dll_PyString_AsString + # define PyString_AsStringAndSize dll_PyString_AsStringAndSize +*************** +*** 357,362 **** +--- 359,365 ---- + static int (*dll_PyObject_HasAttrString)(PyObject *, const char *); + static PyObject* (*dll_PyObject_SetAttrString)(PyObject *, const char *, PyObject *); + static PyObject* (*dll_PyObject_CallFunctionObjArgs)(PyObject *, ...); ++ static PyObject* (*dll_PyObject_CallFunction)(PyObject *, char *, ...); + static PyObject* (*dll_PyObject_Call)(PyObject *, PyObject *, PyObject *); + static char*(*dll_PyString_AsString)(PyObject *); + static int(*dll_PyString_AsStringAndSize)(PyObject *, char **, int *); +*************** +*** 528,533 **** +--- 531,537 ---- + {"PyObject_HasAttrString", (PYTHON_PROC*)&dll_PyObject_HasAttrString}, + {"PyObject_SetAttrString", (PYTHON_PROC*)&dll_PyObject_SetAttrString}, + {"PyObject_CallFunctionObjArgs", (PYTHON_PROC*)&dll_PyObject_CallFunctionObjArgs}, ++ {"PyObject_CallFunction", (PYTHON_PROC*)&dll_PyObject_CallFunction}, + {"PyObject_Call", (PYTHON_PROC*)&dll_PyObject_Call}, + {"PyString_AsString", (PYTHON_PROC*)&dll_PyString_AsString}, + {"PyString_AsStringAndSize", (PYTHON_PROC*)&dll_PyString_AsStringAndSize}, +*************** +*** 748,757 **** + static PyObject *ListGetattr(PyObject *, char *); + static PyObject *FunctionGetattr(PyObject *, char *); + +- static PyObject *LoaderLoadModule(PyObject *, PyObject *); + static PyObject *FinderFindModule(PyObject *, PyObject *); + static PyObject *VimPathHook(PyObject *, PyObject *); + + #ifndef Py_VISIT + # define Py_VISIT(obj) visit(obj, arg) + #endif +--- 752,763 ---- + static PyObject *ListGetattr(PyObject *, char *); + static PyObject *FunctionGetattr(PyObject *, char *); + + static PyObject *FinderFindModule(PyObject *, PyObject *); + static PyObject *VimPathHook(PyObject *, PyObject *); + ++ static PyObject *py_find_module; ++ static PyObject *py_load_module; ++ + #ifndef Py_VISIT + # define Py_VISIT(obj) visit(obj, arg) + #endif +*************** +*** 1376,1465 **** + } + #endif + + static PyObject * +! LoaderLoadModule(PyObject *self, PyObject *args) + { +! char *fullname; +! PyObject *path; +! PyObject *meta_path; +! PyObject *path_hooks; +! PyObject *new_path; +! PyObject *r; +! PyObject *new_list; + +! if (!PyArg_ParseTuple(args, "s", &fullname)) +! return NULL; + +! if (!(new_path = Vim_GetPaths(self))) + return NULL; + +! if (!(new_list = PyList_New(0))) + return NULL; + +! #define GET_SYS_OBJECT(objstr, obj) \ +! obj = PySys_GetObject(objstr); \ +! PyErr_Clear(); \ +! Py_XINCREF(obj); + +! GET_SYS_OBJECT("meta_path", meta_path); +! if (PySys_SetObject("meta_path", new_list)) + { +! Py_XDECREF(meta_path); +! Py_DECREF(new_list); +! return NULL; + } +! Py_DECREF(new_list); /* Now it becomes a reference borrowed from +! sys.meta_path */ + +! #define RESTORE_SYS_OBJECT(objstr, obj) \ +! if (obj) \ +! { \ +! PySys_SetObject(objstr, obj); \ +! Py_DECREF(obj); \ + } + +! GET_SYS_OBJECT("path_hooks", path_hooks); +! if (PySys_SetObject("path_hooks", new_list)) +! { +! RESTORE_SYS_OBJECT("meta_path", meta_path); +! Py_XDECREF(path_hooks); + return NULL; +- } + +! GET_SYS_OBJECT("path", path); +! if (PySys_SetObject("path", new_path)) +! { +! RESTORE_SYS_OBJECT("meta_path", meta_path); +! RESTORE_SYS_OBJECT("path_hooks", path_hooks); +! Py_XDECREF(path); + return NULL; +- } +- Py_DECREF(new_path); + +! r = PyImport_ImportModule(fullname); + +! RESTORE_SYS_OBJECT("meta_path", meta_path); +! RESTORE_SYS_OBJECT("path_hooks", path_hooks); +! RESTORE_SYS_OBJECT("path", path); + +! if (PyErr_Occurred()) + { +! Py_XDECREF(r); + return NULL; + } + +! return r; +! } + +! static PyObject * +! FinderFindModule(PyObject *self UNUSED, PyObject *args UNUSED) +! { +! /* +! * Don't bother actually finding the module, it is delegated to the "loader" +! * object (which is basically the same object: vim module). +! */ +! Py_INCREF(vim_module); +! return vim_module; + } + + static PyObject * +--- 1382,1534 ---- + } + #endif + ++ static void ++ LoaderDestructor(LoaderObject *self) ++ { ++ Py_DECREF(self->module); ++ DESTRUCTOR_FINISH(self); ++ } ++ + static PyObject * +! LoaderLoadModule(LoaderObject *self, PyObject *args UNUSED) + { +! PyObject *r = self->module; + +! Py_INCREF(r); +! return r; +! } + +! static struct PyMethodDef LoaderMethods[] = { +! /* name, function, calling, doc */ +! {"load_module", (PyCFunction)LoaderLoadModule, METH_VARARGS, ""}, +! { NULL, NULL, 0, NULL} +! }; +! +! static PyObject * +! call_load_module(char *name, int len, PyObject *find_module_result) +! { +! PyObject *fd, *pathname, *description; +! +! if (!PyTuple_Check(find_module_result) +! || PyTuple_GET_SIZE(find_module_result) != 3) +! { +! PyErr_SetString(PyExc_TypeError, +! _("expected 3-tuple as imp.find_module() result")); + return NULL; ++ } + +! if (!(fd = PyTuple_GET_ITEM(find_module_result, 0)) +! || !(pathname = PyTuple_GET_ITEM(find_module_result, 1)) +! || !(description = PyTuple_GET_ITEM(find_module_result, 2))) +! { +! PyErr_SetString(PyExc_RuntimeError, +! _("internal error: imp.find_module returned tuple with NULL")); + return NULL; ++ } ++ ++ return PyObject_CallFunction(py_load_module, ++ "s#OOO", name, len, fd, pathname, description); ++ } + +! static PyObject * +! find_module(char *fullname, char *tail, PyObject *new_path) +! { +! PyObject *find_module_result; +! PyObject *module; +! char *dot; + +! if ((dot = (char *) vim_strchr((char_u *) tail, '.'))) + { +! /* +! * There is a dot in the name: call find_module recursively without the +! * first component +! */ +! PyObject *newest_path; +! int partlen = (int) (dot - 1 - tail); +! +! if (!(find_module_result = PyObject_CallFunction(py_find_module, +! "s#O", tail, partlen, new_path))) +! return NULL; +! +! if (!(module = call_load_module( +! fullname, +! ((int) (tail - fullname)) + partlen, +! find_module_result))) +! { +! Py_DECREF(find_module_result); +! return NULL; +! } +! +! Py_DECREF(find_module_result); +! +! if (!(newest_path = PyObject_GetAttrString(module, "__path__"))) +! { +! Py_DECREF(module); +! return NULL; +! } +! +! Py_DECREF(module); +! +! module = find_module(fullname, dot + 1, newest_path); +! +! Py_DECREF(newest_path); +! +! return module; + } +! else +! { +! if (!(find_module_result = PyObject_CallFunction(py_find_module, +! "sO", tail, new_path))) +! return NULL; +! +! if (!(module = call_load_module( +! fullname, +! STRLEN(fullname), +! find_module_result))) +! { +! Py_DECREF(find_module_result); +! return NULL; +! } + +! Py_DECREF(find_module_result); +! +! return module; + } ++ } + +! static PyObject * +! FinderFindModule(PyObject *self, PyObject *args) +! { +! char *fullname; +! PyObject *module; +! PyObject *new_path; +! LoaderObject *loader; +! +! if (!PyArg_ParseTuple(args, "s", &fullname)) + return NULL; + +! if (!(new_path = Vim_GetPaths(self))) + return NULL; + +! module = find_module(fullname, fullname, new_path); + +! Py_DECREF(new_path); + +! if (!module) + { +! Py_INCREF(Py_None); +! return Py_None; +! } +! +! if (!(loader = PyObject_NEW(LoaderObject, &LoaderType))) +! { +! Py_DECREF(module); + return NULL; + } + +! loader->module = module; + +! return (PyObject *) loader; + } + + static PyObject * +*************** +*** 1483,1489 **** + PythonMod_Init(void) + { + /* The special value is removed from sys.path in Python_Init(). */ +! static char *(argv[2]) = {"/must>not&exist/foo", NULL}; + + if (init_types()) + return -1; +--- 1552,1585 ---- + PythonMod_Init(void) + { + /* The special value is removed from sys.path in Python_Init(). */ +! static char *(argv[2]) = {"/must>not&exist/foo", NULL}; +! PyObject *imp; +! +! if (!(imp = PyImport_ImportModule("imp"))) +! return -1; +! +! if (!(py_find_module = PyObject_GetAttrString(imp, "find_module"))) +! { +! Py_DECREF(imp); +! return -1; +! } +! +! if (!(py_load_module = PyObject_GetAttrString(imp, "load_module"))) +! { +! Py_DECREF(py_find_module); +! Py_DECREF(imp); +! return -1; +! } +! +! Py_DECREF(imp); +! +! vim_memset(&LoaderType, 0, sizeof(LoaderType)); +! LoaderType.tp_name = "vim.Loader"; +! LoaderType.tp_basicsize = sizeof(LoaderObject); +! LoaderType.tp_flags = Py_TPFLAGS_DEFAULT; +! LoaderType.tp_doc = "vim message object"; +! LoaderType.tp_methods = LoaderMethods; +! LoaderType.tp_dealloc = (destructor)LoaderDestructor; + + if (init_types()) + return -1; +*** ../vim-7.3.1171/src/testdir/python2/module.py 2013-06-11 18:47:37.000000000 +0200 +--- src/testdir/python2/module.py 2013-06-12 14:12:13.000000000 +0200 +*************** +*** 1 **** +--- 1,2 ---- ++ import before_1 + dir = '2' +*** ../vim-7.3.1171/src/testdir/python3/module.py 2013-06-11 18:47:37.000000000 +0200 +--- src/testdir/python3/module.py 2013-06-12 14:12:13.000000000 +0200 +*************** +*** 1 **** +--- 1,2 ---- ++ import before_1 + dir = '3' +*** ../vim-7.3.1171/src/testdir/python_after/after.py 1970-01-01 01:00:00.000000000 +0100 +--- src/testdir/python_after/after.py 2013-06-12 14:12:13.000000000 +0200 +*************** +*** 0 **** +--- 1,2 ---- ++ import before_2 ++ dir = "after" +*** ../vim-7.3.1171/src/testdir/python_before/before.py 1970-01-01 01:00:00.000000000 +0100 +--- src/testdir/python_before/before.py 2013-06-12 14:12:13.000000000 +0200 +*************** +*** 0 **** +--- 1 ---- ++ dir = "before" +*** ../vim-7.3.1171/src/testdir/test86.in 2013-06-11 18:47:37.000000000 +0200 +--- src/testdir/test86.in 2013-06-12 14:12:13.000000000 +0200 +*************** +*** 8,13 **** +--- 8,14 ---- + STARTTEST + :so small.vim + :set encoding=latin1 ++ :set noswapfile + :if !has('python') | e! test.ok | wq! test.out | endif + :lang C + :py import vim +*************** +*** 1071,1080 **** +--- 1072,1087 ---- + :" + :" Test import + py << EOF ++ sys.path.insert(0, os.path.join(os.getcwd(), 'python_before')) ++ sys.path.append(os.path.join(os.getcwd(), 'python_after')) + vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\') + from module import dir as d + from modulex import ddir + cb.append(d + ',' + ddir) ++ import before ++ cb.append(before.dir) ++ import after ++ cb.append(after.dir) + EOF + :" + :" Test exceptions +*** ../vim-7.3.1171/src/testdir/test86.ok 2013-06-11 18:47:37.000000000 +0200 +--- src/testdir/test86.ok 2013-06-12 14:12:13.000000000 +0200 +*************** +*** 1084,1089 **** +--- 1084,1091 ---- + vim.current.tabpage = True:(, TypeError('expected vim.TabPage object',)) + vim.current.xxx = True:(, AttributeError('xxx',)) + 2,xx ++ before ++ after + vim.command("throw 'abc'"):(, error('abc',)) + Exe("throw 'def'"):(, error('def',)) + vim.eval("Exe('throw ''ghi''')"):(, error('ghi',)) +*** ../vim-7.3.1171/src/testdir/test87.in 2013-06-11 18:47:37.000000000 +0200 +--- src/testdir/test87.in 2013-06-12 14:12:13.000000000 +0200 +*************** +*** 2,7 **** +--- 2,8 ---- + + STARTTEST + :so small.vim ++ :set noswapfile + :if !has('python3') | e! test.ok | wq! test.out | endif + :lang C + :py3 import vim +*************** +*** 1038,1047 **** +--- 1039,1054 ---- + :" + :" Test import + py3 << EOF ++ sys.path.insert(0, os.path.join(os.getcwd(), 'python_before')) ++ sys.path.append(os.path.join(os.getcwd(), 'python_after')) + vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\') + from module import dir as d + from modulex import ddir + cb.append(d + ',' + ddir) ++ import before ++ cb.append(before.dir) ++ import after ++ cb.append(after.dir) + EOF + :" + :" Test exceptions +*** ../vim-7.3.1171/src/testdir/test87.ok 2013-06-11 18:47:37.000000000 +0200 +--- src/testdir/test87.ok 2013-06-12 14:12:13.000000000 +0200 +*************** +*** 1093,1098 **** +--- 1093,1100 ---- + vim.current.tabpage = True:(, TypeError('expected vim.TabPage object',)) + vim.current.xxx = True:(, AttributeError('xxx',)) + 3,xx ++ before ++ after + vim.command("throw 'abc'"):(, error('abc',)) + Exe("throw 'def'"):(, error('def',)) + vim.eval("Exe('throw ''ghi''')"):(, error('ghi',)) +*** ../vim-7.3.1171/Filelist 2013-06-11 18:47:37.000000000 +0200 +--- Filelist 2013-06-12 14:13:57.000000000 +0200 +*************** +*** 87,92 **** +--- 87,94 ---- + src/testdir/python2/*.py \ + src/testdir/python3/*.py \ + src/testdir/pythonx/*.py \ ++ src/testdir/python_after/*.py \ ++ src/testdir/python_before/*.py \ + src/proto.h \ + src/proto/blowfish.pro \ + src/proto/buffer.pro \ +*** ../vim-7.3.1171/src/version.c 2013-06-12 14:10:23.000000000 +0200 +--- src/version.c 2013-06-12 14:14:12.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1172, + /**/ + +-- +Microsoft says that MS-Windows is much better for you than Linux. +That's like the Pope saying that catholicism is much better for +you than protestantism. + + /// 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 /// diff --git a/7.3.1173 b/7.3.1173 new file mode 100644 index 0000000..fce4e87 --- /dev/null +++ b/7.3.1173 @@ -0,0 +1,1405 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1173 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1173 +Problem: Python 2 tests don't have the same output everywhere. +Solution: Make the Python 2 tests more portable. (ZyX) +Files: src/testdir/test86.in, src/testdir/test86.ok + + +*** ../vim-7.3.1172/src/testdir/test86.in 2013-06-12 14:20:15.000000000 +0200 +--- src/testdir/test86.in 2013-06-12 14:21:28.000000000 +0200 +*************** +*** 45,53 **** + dk = d.keys() + dv = d.values() + di = d.items() +! dk.sort(key=repr) +! dv.sort(key=repr) +! di.sort(key=repr) + EOF + :$put =pyeval('d[''f''](self={})') + :$put =pyeval('repr(dk)') +--- 45,54 ---- + dk = d.keys() + dv = d.values() + di = d.items() +! cmpfun = lambda a, b: cmp(repr(a), repr(b)) +! dk.sort(cmpfun) +! dv.sort(cmpfun) +! di.sort(cmpfun) + EOF + :$put =pyeval('d[''f''](self={})') + :$put =pyeval('repr(dk)') +*************** +*** 813,819 **** + try: + exec(expr, g, l) + except: +! cb.append(expr + ':' + repr(sys.exc_info()[:2])) + else: + cb.append(expr + ':NOT FAILED') + d = vim.Dictionary() +--- 814,830 ---- + try: + exec(expr, g, l) + except: +! ei = sys.exc_info() +! msg = sys.exc_info()[0].__name__ + ':' + repr(sys.exc_info()[1].args) +! msg = msg.replace('TypeError:(\'argument 1 ', 'TypeError:(\'') +! if expr.find('None') > -1: +! msg = msg.replace('TypeError:(\'iteration over non-sequence\',)', +! 'TypeError:("\'NoneType\' object is not iterable",)') +! if expr == 'fd(self=[])': +! # HACK: PyMapping_Check changed meaning +! msg = msg.replace('AttributeError:(\'keys\',)', +! 'TypeError:(\'unable to convert object to vim dictionary\',)') +! cb.append(expr + ':' + msg) + else: + cb.append(expr + ':NOT FAILED') + d = vim.Dictionary() +*** ../vim-7.3.1172/src/testdir/test86.ok 2013-06-12 14:20:15.000000000 +0200 +--- src/testdir/test86.ok 2013-06-12 14:21:28.000000000 +0200 +*************** +*** 437,1094 **** + test86.in + > Output + >> OutputSetattr +! del sys.stdout.softspace:(, AttributeError("can't delete OutputObject attributes",)) +! sys.stdout.softspace = []:(, TypeError('softspace must be an integer',)) +! sys.stdout.attr = None:(, AttributeError('invalid attribute',)) + >> OutputWrite +! sys.stdout.write(None):(, TypeError('coercing to Unicode: need string or buffer, NoneType found',)) + >> OutputWriteLines +! sys.stdout.writelines(None):(, TypeError("'NoneType' object is not iterable",)) +! sys.stdout.writelines([1]):(, TypeError('writelines() requires list of strings',)) + > VimCommand +! vim.command(1):(, TypeError('must be string, not int',)) + > VimToPython + > VimEval +! vim.eval(1):(, TypeError('must be string, not int',)) + > VimEvalPy +! vim.bindeval(1):(, TypeError('must be string, not int',)) + > VimStrwidth +! vim.strwidth(1):(, TypeError('must be string, not int',)) + > Dictionary + >> DictionaryConstructor +! vim.Dictionary("abc"):(, ValueError('expected sequence element of size 2',)) + >> DictionarySetattr +! del d.locked:(, AttributeError('cannot delete vim.Dictionary attributes',)) +! d.locked = FailingTrue():(, NotImplementedError()) +! vim.vvars.locked = False:(, TypeError('cannot modify fixed dictionary',)) +! d.scope = True:(, AttributeError('cannot set this attribute',)) +! d.xxx = True:(, AttributeError('cannot set this attribute',)) + >> _DictionaryItem +! d.get("a", 2, 3):(, TypeError('function takes at most 2 arguments (3 given)',)) + >>> Testing StringToChars using d.get(%s) +! d.get(1):(, TypeError('object must be string',)) +! d.get(u"\0"):(, TypeError('expected string without null bytes',)) +! d.get("\0"):(, TypeError('expected string without null bytes',)) + <<< Finished +! d.pop("a"):(, KeyError('a',)) +! dl.pop("a"):(, error('dict is locked',)) + >> DictionaryIterNext +! for i in ned: ned["a"] = 1:(, RuntimeError('hashtab changed during iteration',)) + >> DictionaryAssItem +! dl["b"] = 1:(, error('dict is locked',)) + >>> Testing StringToChars using d[%s] = 1 +! d[1] = 1:(, TypeError('object must be string',)) +! d[u"\0"] = 1:(, TypeError('expected string without null bytes',)) +! d["\0"] = 1:(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using d["a"] = {%s : 1} +! d["a"] = {1 : 1}:(, TypeError('object must be string',)) +! d["a"] = {u"\0" : 1}:(, TypeError('expected string without null bytes',)) +! d["a"] = {"\0" : 1}:(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using d["a"] = {"abc" : {%s : 1}} +! d["a"] = {"abc" : {1 : 1}}:(, TypeError('object must be string',)) +! d["a"] = {"abc" : {u"\0" : 1}}:(, TypeError('expected string without null bytes',)) +! d["a"] = {"abc" : {"\0" : 1}}:(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using d["a"] = {"abc" : Mapping({%s : 1})} +! d["a"] = {"abc" : Mapping({1 : 1})}:(, TypeError('object must be string',)) +! d["a"] = {"abc" : Mapping({u"\0" : 1})}:(, TypeError('expected string without null bytes',)) +! d["a"] = {"abc" : Mapping({"\0" : 1})}:(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing *Iter* using d["a"] = {"abc" : %s} +! d["a"] = {"abc" : FailingIter()}:(, TypeError('unable to convert to vim structure',)) +! d["a"] = {"abc" : FailingIterNext()}:(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = {"abc" : %s} +! d["a"] = {"abc" : None}:(, TypeError('unable to convert to vim structure',)) +! d["a"] = {"abc" : {"": 1}}:(, ValueError('empty keys are not allowed',)) +! d["a"] = {"abc" : {u"": 1}}:(, ValueError('empty keys are not allowed',)) +! d["a"] = {"abc" : FailingMapping()}:(, NotImplementedError()) +! d["a"] = {"abc" : FailingMappingKey()}:(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({%s : 1}) +! d["a"] = Mapping({1 : 1}):(, TypeError('object must be string',)) +! d["a"] = Mapping({u"\0" : 1}):(, TypeError('expected string without null bytes',)) +! d["a"] = Mapping({"\0" : 1}):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({"abc" : {%s : 1}}) +! d["a"] = Mapping({"abc" : {1 : 1}}):(, TypeError('object must be string',)) +! d["a"] = Mapping({"abc" : {u"\0" : 1}}):(, TypeError('expected string without null bytes',)) +! d["a"] = Mapping({"abc" : {"\0" : 1}}):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({"abc" : Mapping({%s : 1})}) +! d["a"] = Mapping({"abc" : Mapping({1 : 1})}):(, TypeError('object must be string',)) +! d["a"] = Mapping({"abc" : Mapping({u"\0" : 1})}):(, TypeError('expected string without null bytes',)) +! d["a"] = Mapping({"abc" : Mapping({"\0" : 1})}):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing *Iter* using d["a"] = Mapping({"abc" : %s}) +! d["a"] = Mapping({"abc" : FailingIter()}):(, TypeError('unable to convert to vim structure',)) +! d["a"] = Mapping({"abc" : FailingIterNext()}):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abc" : %s}) +! d["a"] = Mapping({"abc" : None}):(, TypeError('unable to convert to vim structure',)) +! d["a"] = Mapping({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! d["a"] = Mapping({"abc" : {u"": 1}}):(, ValueError('empty keys are not allowed',)) +! d["a"] = Mapping({"abc" : FailingMapping()}):(, NotImplementedError()) +! d["a"] = Mapping({"abc" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using d["a"] = %s +! d["a"] = FailingIter():(, TypeError('unable to convert to vim structure',)) +! d["a"] = FailingIterNext():(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = %s +! d["a"] = None:(, TypeError('unable to convert to vim structure',)) +! d["a"] = {"": 1}:(, ValueError('empty keys are not allowed',)) +! d["a"] = {u"": 1}:(, ValueError('empty keys are not allowed',)) +! d["a"] = FailingMapping():(, NotImplementedError()) +! d["a"] = FailingMappingKey():(, NotImplementedError()) + <<< Finished + >> DictionaryUpdate + >>> kwargs + >>> iter +! d.update(FailingMapping()):(, NotImplementedError()) +! d.update([FailingIterNext()]):(, NotImplementedError()) + >>> Testing StringToChars using d.update({%s : 1}) +! d.update({1 : 1}):(, TypeError('object must be string',)) +! d.update({u"\0" : 1}):(, TypeError('expected string without null bytes',)) +! d.update({"\0" : 1}):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using d.update({"abc" : {%s : 1}}) +! d.update({"abc" : {1 : 1}}):(, TypeError('object must be string',)) +! d.update({"abc" : {u"\0" : 1}}):(, TypeError('expected string without null bytes',)) +! d.update({"abc" : {"\0" : 1}}):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using d.update({"abc" : Mapping({%s : 1})}) +! d.update({"abc" : Mapping({1 : 1})}):(, TypeError('object must be string',)) +! d.update({"abc" : Mapping({u"\0" : 1})}):(, TypeError('expected string without null bytes',)) +! d.update({"abc" : Mapping({"\0" : 1})}):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing *Iter* using d.update({"abc" : %s}) +! d.update({"abc" : FailingIter()}):(, TypeError('unable to convert to vim structure',)) +! d.update({"abc" : FailingIterNext()}):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d.update({"abc" : %s}) +! d.update({"abc" : None}):(, TypeError('unable to convert to vim structure',)) +! d.update({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! d.update({"abc" : {u"": 1}}):(, ValueError('empty keys are not allowed',)) +! d.update({"abc" : FailingMapping()}):(, NotImplementedError()) +! d.update({"abc" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d.update(Mapping({%s : 1})) +! d.update(Mapping({1 : 1})):(, TypeError('object must be string',)) +! d.update(Mapping({u"\0" : 1})):(, TypeError('expected string without null bytes',)) +! d.update(Mapping({"\0" : 1})):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using d.update(Mapping({"abc" : {%s : 1}})) +! d.update(Mapping({"abc" : {1 : 1}})):(, TypeError('object must be string',)) +! d.update(Mapping({"abc" : {u"\0" : 1}})):(, TypeError('expected string without null bytes',)) +! d.update(Mapping({"abc" : {"\0" : 1}})):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using d.update(Mapping({"abc" : Mapping({%s : 1})})) +! d.update(Mapping({"abc" : Mapping({1 : 1})})):(, TypeError('object must be string',)) +! d.update(Mapping({"abc" : Mapping({u"\0" : 1})})):(, TypeError('expected string without null bytes',)) +! d.update(Mapping({"abc" : Mapping({"\0" : 1})})):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing *Iter* using d.update(Mapping({"abc" : %s})) +! d.update(Mapping({"abc" : FailingIter()})):(, TypeError('unable to convert to vim structure',)) +! d.update(Mapping({"abc" : FailingIterNext()})):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d.update(Mapping({"abc" : %s})) +! d.update(Mapping({"abc" : None})):(, TypeError('unable to convert to vim structure',)) +! d.update(Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) +! d.update(Mapping({"abc" : {u"": 1}})):(, ValueError('empty keys are not allowed',)) +! d.update(Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) +! d.update(Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using d.update(%s) +! d.update(FailingIter()):(, NotImplementedError()) +! d.update(FailingIterNext()):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d.update(%s) +! d.update(None):(, TypeError("'NoneType' object is not iterable",)) +! d.update({"": 1}):(, ValueError('empty keys are not allowed',)) +! d.update({u"": 1}):(, ValueError('empty keys are not allowed',)) +! d.update(FailingMapping()):(, NotImplementedError()) +! d.update(FailingMappingKey()):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d.update(((%s, 0),)) +! d.update(((1, 0),)):(, TypeError('object must be string',)) +! d.update(((u"\0", 0),)):(, TypeError('expected string without null bytes',)) +! d.update((("\0", 0),)):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", {%s : 1}),)) +! d.update((("a", {1 : 1}),)):(, TypeError('object must be string',)) +! d.update((("a", {u"\0" : 1}),)):(, TypeError('expected string without null bytes',)) +! d.update((("a", {"\0" : 1}),)):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", {"abc" : {%s : 1}}),)) +! d.update((("a", {"abc" : {1 : 1}}),)):(, TypeError('object must be string',)) +! d.update((("a", {"abc" : {u"\0" : 1}}),)):(, TypeError('expected string without null bytes',)) +! d.update((("a", {"abc" : {"\0" : 1}}),)):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", {"abc" : Mapping({%s : 1})}),)) +! d.update((("a", {"abc" : Mapping({1 : 1})}),)):(, TypeError('object must be string',)) +! d.update((("a", {"abc" : Mapping({u"\0" : 1})}),)):(, TypeError('expected string without null bytes',)) +! d.update((("a", {"abc" : Mapping({"\0" : 1})}),)):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing *Iter* using d.update((("a", {"abc" : %s}),)) +! d.update((("a", {"abc" : FailingIter()}),)):(, TypeError('unable to convert to vim structure',)) +! d.update((("a", {"abc" : FailingIterNext()}),)):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", {"abc" : %s}),)) +! d.update((("a", {"abc" : None}),)):(, TypeError('unable to convert to vim structure',)) +! d.update((("a", {"abc" : {"": 1}}),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", {"abc" : {u"": 1}}),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", {"abc" : FailingMapping()}),)):(, NotImplementedError()) +! d.update((("a", {"abc" : FailingMappingKey()}),)):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),)) +! d.update((("a", Mapping({1 : 1})),)):(, TypeError('object must be string',)) +! d.update((("a", Mapping({u"\0" : 1})),)):(, TypeError('expected string without null bytes',)) +! d.update((("a", Mapping({"\0" : 1})),)):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({"abc" : {%s : 1}})),)) +! d.update((("a", Mapping({"abc" : {1 : 1}})),)):(, TypeError('object must be string',)) +! d.update((("a", Mapping({"abc" : {u"\0" : 1}})),)):(, TypeError('expected string without null bytes',)) +! d.update((("a", Mapping({"abc" : {"\0" : 1}})),)):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({"abc" : Mapping({%s : 1})})),)) +! d.update((("a", Mapping({"abc" : Mapping({1 : 1})})),)):(, TypeError('object must be string',)) +! d.update((("a", Mapping({"abc" : Mapping({u"\0" : 1})})),)):(, TypeError('expected string without null bytes',)) +! d.update((("a", Mapping({"abc" : Mapping({"\0" : 1})})),)):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing *Iter* using d.update((("a", Mapping({"abc" : %s})),)) +! d.update((("a", Mapping({"abc" : FailingIter()})),)):(, TypeError('unable to convert to vim structure',)) +! d.update((("a", Mapping({"abc" : FailingIterNext()})),)):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abc" : %s})),)) +! d.update((("a", Mapping({"abc" : None})),)):(, TypeError('unable to convert to vim structure',)) +! d.update((("a", Mapping({"abc" : {"": 1}})),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", Mapping({"abc" : {u"": 1}})),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", Mapping({"abc" : FailingMapping()})),)):(, NotImplementedError()) +! d.update((("a", Mapping({"abc" : FailingMappingKey()})),)):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using d.update((("a", %s),)) +! d.update((("a", FailingIter()),)):(, TypeError('unable to convert to vim structure',)) +! d.update((("a", FailingIterNext()),)):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", %s),)) +! d.update((("a", None),)):(, TypeError('unable to convert to vim structure',)) +! d.update((("a", {"": 1}),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", {u"": 1}),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", FailingMapping()),)):(, NotImplementedError()) +! d.update((("a", FailingMappingKey()),)):(, NotImplementedError()) + <<< Finished + >> DictionaryPopItem +! d.popitem(1, 2):(, TypeError('popitem() takes no arguments (2 given)',)) + >> DictionaryHasKey +! d.has_key():(, TypeError('function takes exactly 1 argument (0 given)',)) + > List + >> ListConstructor +! vim.List(1, 2):(, TypeError('function takes at most 1 argument (2 given)',)) +! vim.List(a=1):(, TypeError('list constructor does not accept keyword arguments',)) + >>> Testing StringToChars using vim.List([{%s : 1}]) +! vim.List([{1 : 1}]):(, TypeError('object must be string',)) +! vim.List([{u"\0" : 1}]):(, TypeError('expected string without null bytes',)) +! vim.List([{"\0" : 1}]):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using vim.List([{"abc" : {%s : 1}}]) +! vim.List([{"abc" : {1 : 1}}]):(, TypeError('object must be string',)) +! vim.List([{"abc" : {u"\0" : 1}}]):(, TypeError('expected string without null bytes',)) +! vim.List([{"abc" : {"\0" : 1}}]):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using vim.List([{"abc" : Mapping({%s : 1})}]) +! vim.List([{"abc" : Mapping({1 : 1})}]):(, TypeError('object must be string',)) +! vim.List([{"abc" : Mapping({u"\0" : 1})}]):(, TypeError('expected string without null bytes',)) +! vim.List([{"abc" : Mapping({"\0" : 1})}]):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing *Iter* using vim.List([{"abc" : %s}]) +! vim.List([{"abc" : FailingIter()}]):(, TypeError('unable to convert to vim structure',)) +! vim.List([{"abc" : FailingIterNext()}]):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([{"abc" : %s}]) +! vim.List([{"abc" : None}]):(, TypeError('unable to convert to vim structure',)) +! vim.List([{"abc" : {"": 1}}]):(, ValueError('empty keys are not allowed',)) +! vim.List([{"abc" : {u"": 1}}]):(, ValueError('empty keys are not allowed',)) +! vim.List([{"abc" : FailingMapping()}]):(, NotImplementedError()) +! vim.List([{"abc" : FailingMappingKey()}]):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({%s : 1})]) +! vim.List([Mapping({1 : 1})]):(, TypeError('object must be string',)) +! vim.List([Mapping({u"\0" : 1})]):(, TypeError('expected string without null bytes',)) +! vim.List([Mapping({"\0" : 1})]):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({"abc" : {%s : 1}})]) +! vim.List([Mapping({"abc" : {1 : 1}})]):(, TypeError('object must be string',)) +! vim.List([Mapping({"abc" : {u"\0" : 1}})]):(, TypeError('expected string without null bytes',)) +! vim.List([Mapping({"abc" : {"\0" : 1}})]):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({"abc" : Mapping({%s : 1})})]) +! vim.List([Mapping({"abc" : Mapping({1 : 1})})]):(, TypeError('object must be string',)) +! vim.List([Mapping({"abc" : Mapping({u"\0" : 1})})]):(, TypeError('expected string without null bytes',)) +! vim.List([Mapping({"abc" : Mapping({"\0" : 1})})]):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing *Iter* using vim.List([Mapping({"abc" : %s})]) +! vim.List([Mapping({"abc" : FailingIter()})]):(, TypeError('unable to convert to vim structure',)) +! vim.List([Mapping({"abc" : FailingIterNext()})]):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([Mapping({"abc" : %s})]) +! vim.List([Mapping({"abc" : None})]):(, TypeError('unable to convert to vim structure',)) +! vim.List([Mapping({"abc" : {"": 1}})]):(, ValueError('empty keys are not allowed',)) +! vim.List([Mapping({"abc" : {u"": 1}})]):(, ValueError('empty keys are not allowed',)) +! vim.List([Mapping({"abc" : FailingMapping()})]):(, NotImplementedError()) +! vim.List([Mapping({"abc" : FailingMappingKey()})]):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using vim.List([%s]) +! vim.List([FailingIter()]):(, TypeError('unable to convert to vim structure',)) +! vim.List([FailingIterNext()]):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([%s]) +! vim.List([None]):(, TypeError('unable to convert to vim structure',)) +! vim.List([{"": 1}]):(, ValueError('empty keys are not allowed',)) +! vim.List([{u"": 1}]):(, ValueError('empty keys are not allowed',)) +! vim.List([FailingMapping()]):(, NotImplementedError()) +! vim.List([FailingMappingKey()]):(, NotImplementedError()) + <<< Finished + >> ListItem +! l[1000]:(, IndexError('list index out of range',)) + >> ListAssItem +! ll[1] = 2:(, error('list is locked',)) +! l[1000] = 3:(, IndexError('list index out of range',)) + >> ListAssSlice +! ll[1:100] = "abc":(, error('list is locked',)) + >>> Testing StringToChars using l[:] = [{%s : 1}] +! l[:] = [{1 : 1}]:(, TypeError('object must be string',)) +! l[:] = [{u"\0" : 1}]:(, TypeError('expected string without null bytes',)) +! l[:] = [{"\0" : 1}]:(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using l[:] = [{"abc" : {%s : 1}}] +! l[:] = [{"abc" : {1 : 1}}]:(, TypeError('object must be string',)) +! l[:] = [{"abc" : {u"\0" : 1}}]:(, TypeError('expected string without null bytes',)) +! l[:] = [{"abc" : {"\0" : 1}}]:(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using l[:] = [{"abc" : Mapping({%s : 1})}] +! l[:] = [{"abc" : Mapping({1 : 1})}]:(, TypeError('object must be string',)) +! l[:] = [{"abc" : Mapping({u"\0" : 1})}]:(, TypeError('expected string without null bytes',)) +! l[:] = [{"abc" : Mapping({"\0" : 1})}]:(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing *Iter* using l[:] = [{"abc" : %s}] +! l[:] = [{"abc" : FailingIter()}]:(, TypeError('unable to convert to vim structure',)) +! l[:] = [{"abc" : FailingIterNext()}]:(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [{"abc" : %s}] +! l[:] = [{"abc" : None}]:(, TypeError('unable to convert to vim structure',)) +! l[:] = [{"abc" : {"": 1}}]:(, ValueError('empty keys are not allowed',)) +! l[:] = [{"abc" : {u"": 1}}]:(, ValueError('empty keys are not allowed',)) +! l[:] = [{"abc" : FailingMapping()}]:(, NotImplementedError()) +! l[:] = [{"abc" : FailingMappingKey()}]:(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({%s : 1})] +! l[:] = [Mapping({1 : 1})]:(, TypeError('object must be string',)) +! l[:] = [Mapping({u"\0" : 1})]:(, TypeError('expected string without null bytes',)) +! l[:] = [Mapping({"\0" : 1})]:(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({"abc" : {%s : 1}})] +! l[:] = [Mapping({"abc" : {1 : 1}})]:(, TypeError('object must be string',)) +! l[:] = [Mapping({"abc" : {u"\0" : 1}})]:(, TypeError('expected string without null bytes',)) +! l[:] = [Mapping({"abc" : {"\0" : 1}})]:(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({"abc" : Mapping({%s : 1})})] +! l[:] = [Mapping({"abc" : Mapping({1 : 1})})]:(, TypeError('object must be string',)) +! l[:] = [Mapping({"abc" : Mapping({u"\0" : 1})})]:(, TypeError('expected string without null bytes',)) +! l[:] = [Mapping({"abc" : Mapping({"\0" : 1})})]:(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing *Iter* using l[:] = [Mapping({"abc" : %s})] +! l[:] = [Mapping({"abc" : FailingIter()})]:(, TypeError('unable to convert to vim structure',)) +! l[:] = [Mapping({"abc" : FailingIterNext()})]:(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abc" : %s})] +! l[:] = [Mapping({"abc" : None})]:(, TypeError('unable to convert to vim structure',)) +! l[:] = [Mapping({"abc" : {"": 1}})]:(, ValueError('empty keys are not allowed',)) +! l[:] = [Mapping({"abc" : {u"": 1}})]:(, ValueError('empty keys are not allowed',)) +! l[:] = [Mapping({"abc" : FailingMapping()})]:(, NotImplementedError()) +! l[:] = [Mapping({"abc" : FailingMappingKey()})]:(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using l[:] = [%s] +! l[:] = [FailingIter()]:(, TypeError('unable to convert to vim structure',)) +! l[:] = [FailingIterNext()]:(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [%s] +! l[:] = [None]:(, TypeError('unable to convert to vim structure',)) +! l[:] = [{"": 1}]:(, ValueError('empty keys are not allowed',)) +! l[:] = [{u"": 1}]:(, ValueError('empty keys are not allowed',)) +! l[:] = [FailingMapping()]:(, NotImplementedError()) +! l[:] = [FailingMappingKey()]:(, NotImplementedError()) + <<< Finished + >> ListConcatInPlace + >>> Testing StringToChars using l.extend([{%s : 1}]) +! l.extend([{1 : 1}]):(, TypeError('object must be string',)) +! l.extend([{u"\0" : 1}]):(, TypeError('expected string without null bytes',)) +! l.extend([{"\0" : 1}]):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using l.extend([{"abc" : {%s : 1}}]) +! l.extend([{"abc" : {1 : 1}}]):(, TypeError('object must be string',)) +! l.extend([{"abc" : {u"\0" : 1}}]):(, TypeError('expected string without null bytes',)) +! l.extend([{"abc" : {"\0" : 1}}]):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using l.extend([{"abc" : Mapping({%s : 1})}]) +! l.extend([{"abc" : Mapping({1 : 1})}]):(, TypeError('object must be string',)) +! l.extend([{"abc" : Mapping({u"\0" : 1})}]):(, TypeError('expected string without null bytes',)) +! l.extend([{"abc" : Mapping({"\0" : 1})}]):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing *Iter* using l.extend([{"abc" : %s}]) +! l.extend([{"abc" : FailingIter()}]):(, TypeError('unable to convert to vim structure',)) +! l.extend([{"abc" : FailingIterNext()}]):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([{"abc" : %s}]) +! l.extend([{"abc" : None}]):(, TypeError('unable to convert to vim structure',)) +! l.extend([{"abc" : {"": 1}}]):(, ValueError('empty keys are not allowed',)) +! l.extend([{"abc" : {u"": 1}}]):(, ValueError('empty keys are not allowed',)) +! l.extend([{"abc" : FailingMapping()}]):(, NotImplementedError()) +! l.extend([{"abc" : FailingMappingKey()}]):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({%s : 1})]) +! l.extend([Mapping({1 : 1})]):(, TypeError('object must be string',)) +! l.extend([Mapping({u"\0" : 1})]):(, TypeError('expected string without null bytes',)) +! l.extend([Mapping({"\0" : 1})]):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({"abc" : {%s : 1}})]) +! l.extend([Mapping({"abc" : {1 : 1}})]):(, TypeError('object must be string',)) +! l.extend([Mapping({"abc" : {u"\0" : 1}})]):(, TypeError('expected string without null bytes',)) +! l.extend([Mapping({"abc" : {"\0" : 1}})]):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({"abc" : Mapping({%s : 1})})]) +! l.extend([Mapping({"abc" : Mapping({1 : 1})})]):(, TypeError('object must be string',)) +! l.extend([Mapping({"abc" : Mapping({u"\0" : 1})})]):(, TypeError('expected string without null bytes',)) +! l.extend([Mapping({"abc" : Mapping({"\0" : 1})})]):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing *Iter* using l.extend([Mapping({"abc" : %s})]) +! l.extend([Mapping({"abc" : FailingIter()})]):(, TypeError('unable to convert to vim structure',)) +! l.extend([Mapping({"abc" : FailingIterNext()})]):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([Mapping({"abc" : %s})]) +! l.extend([Mapping({"abc" : None})]):(, TypeError('unable to convert to vim structure',)) +! l.extend([Mapping({"abc" : {"": 1}})]):(, ValueError('empty keys are not allowed',)) +! l.extend([Mapping({"abc" : {u"": 1}})]):(, ValueError('empty keys are not allowed',)) +! l.extend([Mapping({"abc" : FailingMapping()})]):(, NotImplementedError()) +! l.extend([Mapping({"abc" : FailingMappingKey()})]):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using l.extend([%s]) +! l.extend([FailingIter()]):(, TypeError('unable to convert to vim structure',)) +! l.extend([FailingIterNext()]):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([%s]) +! l.extend([None]):(, TypeError('unable to convert to vim structure',)) +! l.extend([{"": 1}]):(, ValueError('empty keys are not allowed',)) +! l.extend([{u"": 1}]):(, ValueError('empty keys are not allowed',)) +! l.extend([FailingMapping()]):(, NotImplementedError()) +! l.extend([FailingMappingKey()]):(, NotImplementedError()) + <<< Finished + >> ListSetattr +! del l.locked:(, AttributeError('cannot delete vim.List attributes',)) +! l.locked = FailingTrue():(, NotImplementedError()) +! l.xxx = True:(, AttributeError('cannot set this attribute',)) + > Function + >> FunctionConstructor +! vim.Function("123"):(, ValueError('unnamed function does not exist',)) +! vim.Function("xxx_non_existent_function_xxx"):(, ValueError('function does not exist',)) + vim.Function("xxx#non#existent#function#xxx"):NOT FAILED + >> FunctionCall + >>> Testing StringToChars using f({%s : 1}) +! f({1 : 1}):(, TypeError('object must be string',)) +! f({u"\0" : 1}):(, TypeError('expected string without null bytes',)) +! f({"\0" : 1}):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using f({"abc" : {%s : 1}}) +! f({"abc" : {1 : 1}}):(, TypeError('object must be string',)) +! f({"abc" : {u"\0" : 1}}):(, TypeError('expected string without null bytes',)) +! f({"abc" : {"\0" : 1}}):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using f({"abc" : Mapping({%s : 1})}) +! f({"abc" : Mapping({1 : 1})}):(, TypeError('object must be string',)) +! f({"abc" : Mapping({u"\0" : 1})}):(, TypeError('expected string without null bytes',)) +! f({"abc" : Mapping({"\0" : 1})}):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing *Iter* using f({"abc" : %s}) +! f({"abc" : FailingIter()}):(, TypeError('unable to convert to vim structure',)) +! f({"abc" : FailingIterNext()}):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using f({"abc" : %s}) +! f({"abc" : None}):(, TypeError('unable to convert to vim structure',)) +! f({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! f({"abc" : {u"": 1}}):(, ValueError('empty keys are not allowed',)) +! f({"abc" : FailingMapping()}):(, NotImplementedError()) +! f({"abc" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using f(Mapping({%s : 1})) +! f(Mapping({1 : 1})):(, TypeError('object must be string',)) +! f(Mapping({u"\0" : 1})):(, TypeError('expected string without null bytes',)) +! f(Mapping({"\0" : 1})):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using f(Mapping({"abc" : {%s : 1}})) +! f(Mapping({"abc" : {1 : 1}})):(, TypeError('object must be string',)) +! f(Mapping({"abc" : {u"\0" : 1}})):(, TypeError('expected string without null bytes',)) +! f(Mapping({"abc" : {"\0" : 1}})):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using f(Mapping({"abc" : Mapping({%s : 1})})) +! f(Mapping({"abc" : Mapping({1 : 1})})):(, TypeError('object must be string',)) +! f(Mapping({"abc" : Mapping({u"\0" : 1})})):(, TypeError('expected string without null bytes',)) +! f(Mapping({"abc" : Mapping({"\0" : 1})})):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing *Iter* using f(Mapping({"abc" : %s})) +! f(Mapping({"abc" : FailingIter()})):(, TypeError('unable to convert to vim structure',)) +! f(Mapping({"abc" : FailingIterNext()})):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using f(Mapping({"abc" : %s})) +! f(Mapping({"abc" : None})):(, TypeError('unable to convert to vim structure',)) +! f(Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) +! f(Mapping({"abc" : {u"": 1}})):(, ValueError('empty keys are not allowed',)) +! f(Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) +! f(Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using f(%s) +! f(FailingIter()):(, TypeError('unable to convert to vim structure',)) +! f(FailingIterNext()):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using f(%s) +! f(None):(, TypeError('unable to convert to vim structure',)) +! f({"": 1}):(, ValueError('empty keys are not allowed',)) +! f({u"": 1}):(, ValueError('empty keys are not allowed',)) +! f(FailingMapping()):(, NotImplementedError()) +! f(FailingMappingKey()):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using fd(self={%s : 1}) +! fd(self={1 : 1}):(, TypeError('object must be string',)) +! fd(self={u"\0" : 1}):(, TypeError('expected string without null bytes',)) +! fd(self={"\0" : 1}):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using fd(self={"abc" : {%s : 1}}) +! fd(self={"abc" : {1 : 1}}):(, TypeError('object must be string',)) +! fd(self={"abc" : {u"\0" : 1}}):(, TypeError('expected string without null bytes',)) +! fd(self={"abc" : {"\0" : 1}}):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using fd(self={"abc" : Mapping({%s : 1})}) +! fd(self={"abc" : Mapping({1 : 1})}):(, TypeError('object must be string',)) +! fd(self={"abc" : Mapping({u"\0" : 1})}):(, TypeError('expected string without null bytes',)) +! fd(self={"abc" : Mapping({"\0" : 1})}):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing *Iter* using fd(self={"abc" : %s}) +! fd(self={"abc" : FailingIter()}):(, TypeError('unable to convert to vim structure',)) +! fd(self={"abc" : FailingIterNext()}):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using fd(self={"abc" : %s}) +! fd(self={"abc" : None}):(, TypeError('unable to convert to vim structure',)) +! fd(self={"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! fd(self={"abc" : {u"": 1}}):(, ValueError('empty keys are not allowed',)) +! fd(self={"abc" : FailingMapping()}):(, NotImplementedError()) +! fd(self={"abc" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({%s : 1})) +! fd(self=Mapping({1 : 1})):(, TypeError('object must be string',)) +! fd(self=Mapping({u"\0" : 1})):(, TypeError('expected string without null bytes',)) +! fd(self=Mapping({"\0" : 1})):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({"abc" : {%s : 1}})) +! fd(self=Mapping({"abc" : {1 : 1}})):(, TypeError('object must be string',)) +! fd(self=Mapping({"abc" : {u"\0" : 1}})):(, TypeError('expected string without null bytes',)) +! fd(self=Mapping({"abc" : {"\0" : 1}})):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({"abc" : Mapping({%s : 1})})) +! fd(self=Mapping({"abc" : Mapping({1 : 1})})):(, TypeError('object must be string',)) +! fd(self=Mapping({"abc" : Mapping({u"\0" : 1})})):(, TypeError('expected string without null bytes',)) +! fd(self=Mapping({"abc" : Mapping({"\0" : 1})})):(, TypeError('expected string without null bytes',)) + <<< Finished + >>> Testing *Iter* using fd(self=Mapping({"abc" : %s})) +! fd(self=Mapping({"abc" : FailingIter()})):(, TypeError('unable to convert to vim structure',)) +! fd(self=Mapping({"abc" : FailingIterNext()})):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using fd(self=Mapping({"abc" : %s})) +! fd(self=Mapping({"abc" : None})):(, TypeError('unable to convert to vim structure',)) +! fd(self=Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) +! fd(self=Mapping({"abc" : {u"": 1}})):(, ValueError('empty keys are not allowed',)) +! fd(self=Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) +! fd(self=Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using fd(self=%s) +! fd(self=FailingIter()):(, TypeError('unable to convert object to vim dictionary',)) +! fd(self=FailingIterNext()):(, TypeError('unable to convert object to vim dictionary',)) + <<< Finished + >>> Testing ConvertFromPyObject using fd(self=%s) +! fd(self=None):(, TypeError('unable to convert object to vim dictionary',)) +! fd(self={"": 1}):(, ValueError('empty keys are not allowed',)) +! fd(self={u"": 1}):(, ValueError('empty keys are not allowed',)) +! fd(self=FailingMapping()):(, NotImplementedError()) +! fd(self=FailingMappingKey()):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyMapping using fd(self=%s) +! fd(self=[]):(, TypeError('unable to convert object to vim dictionary',)) + <<< Finished + > TabPage + >> TabPageAttr +! vim.current.tabpage.xxx:(, AttributeError('xxx',)) + > TabList + >> TabListItem +! vim.tabpages[1000]:(, IndexError('no such tab page',)) + > Window + >> WindowAttr +! vim.current.window.xxx:(, AttributeError('xxx',)) + >> WindowSetattr +! vim.current.window.buffer = 0:(, TypeError('readonly attribute',)) +! vim.current.window.cursor = (100000000, 100000000):(, error('cursor position outside buffer',)) +! vim.current.window.cursor = True:(, TypeError('argument must be 2-item sequence, not bool',)) +! vim.current.window.height = "abc":(, TypeError('an integer is required',)) +! vim.current.window.width = "abc":(, TypeError('an integer is required',)) +! vim.current.window.xxxxxx = True:(, AttributeError('xxxxxx',)) + > WinList + >> WinListItem +! vim.windows[1000]:(, IndexError('no such window',)) + > Buffer + >> StringToLine (indirect) +! vim.current.buffer[0] = "\na":(, error('string cannot contain newlines',)) + >> SetBufferLine (indirect) +! vim.current.buffer[0] = True:(, TypeError('bad argument type for built-in operation',)) + >> SetBufferLines (indirect) +! vim.current.buffer[:] = True:(, TypeError('bad argument type for built-in operation',)) +! vim.current.buffer[:] = ["\na", "bc"]:(, error('string cannot contain newlines',)) + >> InsertBufferLines (indirect) +! vim.current.buffer.append(None):(, TypeError('bad argument type for built-in operation',)) +! vim.current.buffer.append(["\na", "bc"]):(, error('string cannot contain newlines',)) +! vim.current.buffer.append("\nbc"):(, error('string cannot contain newlines',)) + >> RBItem +! vim.current.buffer[100000000]:(, IndexError('line number out of range',)) + >> RBAsItem +! vim.current.buffer[100000000] = "":(, IndexError('line number out of range',)) + >> BufferAttr +! vim.current.buffer.xxx:(, AttributeError('xxx',)) + >> BufferSetattr +! vim.current.buffer.name = True:(, TypeError('object must be string',)) +! vim.current.buffer.xxx = True:(, AttributeError('xxx',)) + >> BufferMark +! vim.current.buffer.mark(0):(, TypeError('must be string, not int',)) +! vim.current.buffer.mark("abc"):(, ValueError('mark name must be a single character',)) +! vim.current.buffer.mark("!"):(, error('invalid mark name',)) + >> BufferRange +! vim.current.buffer.range(1, 2, 3):(, TypeError('function takes exactly 2 arguments (3 given)',)) + > BufMap + >> BufMapItem +! vim.buffers[None]:(, TypeError('key must be integer',)) +! vim.buffers[100000000]:(, KeyError(100000000,)) + > Current + >> CurrentGetattr +! vim.current.xxx:(, AttributeError('xxx',)) + >> CurrentSetattr +! vim.current.line = True:(, TypeError('bad argument type for built-in operation',)) +! vim.current.buffer = True:(, TypeError('expected vim.Buffer object',)) +! vim.current.window = True:(, TypeError('expected vim.Window object',)) +! vim.current.tabpage = True:(, TypeError('expected vim.TabPage object',)) +! vim.current.xxx = True:(, AttributeError('xxx',)) + 2,xx + before + after +! vim.command("throw 'abc'"):(, error('abc',)) +! Exe("throw 'def'"):(, error('def',)) +! vim.eval("Exe('throw ''ghi''')"):(, error('ghi',)) +! vim.eval("Exe('echoerr ''jkl''')"):(, error('Vim(echoerr):jkl',)) +! vim.eval("Exe('xxx_non_existent_command_xxx')"):(, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',)) +! vim.bindeval("Exe('xxx_non_existent_command_xxx')"):(, error('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',)) +--- 437,1094 ---- + test86.in + > Output + >> OutputSetattr +! del sys.stdout.softspace:AttributeError:("can't delete OutputObject attributes",) +! sys.stdout.softspace = []:TypeError:('softspace must be an integer',) +! sys.stdout.attr = None:AttributeError:('invalid attribute',) + >> OutputWrite +! sys.stdout.write(None):TypeError:('coercing to Unicode: need string or buffer, NoneType found',) + >> OutputWriteLines +! sys.stdout.writelines(None):TypeError:("'NoneType' object is not iterable",) +! sys.stdout.writelines([1]):TypeError:('writelines() requires list of strings',) + > VimCommand +! vim.command(1):TypeError:('must be string, not int',) + > VimToPython + > VimEval +! vim.eval(1):TypeError:('must be string, not int',) + > VimEvalPy +! vim.bindeval(1):TypeError:('must be string, not int',) + > VimStrwidth +! vim.strwidth(1):TypeError:('must be string, not int',) + > Dictionary + >> DictionaryConstructor +! vim.Dictionary("abc"):ValueError:('expected sequence element of size 2',) + >> DictionarySetattr +! del d.locked:AttributeError:('cannot delete vim.Dictionary attributes',) +! d.locked = FailingTrue():NotImplementedError:() +! vim.vvars.locked = False:TypeError:('cannot modify fixed dictionary',) +! d.scope = True:AttributeError:('cannot set this attribute',) +! d.xxx = True:AttributeError:('cannot set this attribute',) + >> _DictionaryItem +! d.get("a", 2, 3):TypeError:('function takes at most 2 arguments (3 given)',) + >>> Testing StringToChars using d.get(%s) +! d.get(1):TypeError:('object must be string',) +! d.get(u"\0"):TypeError:('expected string without null bytes',) +! d.get("\0"):TypeError:('expected string without null bytes',) + <<< Finished +! d.pop("a"):KeyError:('a',) +! dl.pop("a"):error:('dict is locked',) + >> DictionaryIterNext +! for i in ned: ned["a"] = 1:RuntimeError:('hashtab changed during iteration',) + >> DictionaryAssItem +! dl["b"] = 1:error:('dict is locked',) + >>> Testing StringToChars using d[%s] = 1 +! d[1] = 1:TypeError:('object must be string',) +! d[u"\0"] = 1:TypeError:('expected string without null bytes',) +! d["\0"] = 1:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d["a"] = {%s : 1} +! d["a"] = {1 : 1}:TypeError:('object must be string',) +! d["a"] = {u"\0" : 1}:TypeError:('expected string without null bytes',) +! d["a"] = {"\0" : 1}:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d["a"] = {"abc" : {%s : 1}} +! d["a"] = {"abc" : {1 : 1}}:TypeError:('object must be string',) +! d["a"] = {"abc" : {u"\0" : 1}}:TypeError:('expected string without null bytes',) +! d["a"] = {"abc" : {"\0" : 1}}:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d["a"] = {"abc" : Mapping({%s : 1})} +! d["a"] = {"abc" : Mapping({1 : 1})}:TypeError:('object must be string',) +! d["a"] = {"abc" : Mapping({u"\0" : 1})}:TypeError:('expected string without null bytes',) +! d["a"] = {"abc" : Mapping({"\0" : 1})}:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using d["a"] = {"abc" : %s} +! d["a"] = {"abc" : FailingIter()}:TypeError:('unable to convert to vim structure',) +! d["a"] = {"abc" : FailingIterNext()}:NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = {"abc" : %s} +! d["a"] = {"abc" : None}:TypeError:('unable to convert to vim structure',) +! d["a"] = {"abc" : {"": 1}}:ValueError:('empty keys are not allowed',) +! d["a"] = {"abc" : {u"": 1}}:ValueError:('empty keys are not allowed',) +! d["a"] = {"abc" : FailingMapping()}:NotImplementedError:() +! d["a"] = {"abc" : FailingMappingKey()}:NotImplementedError:() + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({%s : 1}) +! d["a"] = Mapping({1 : 1}):TypeError:('object must be string',) +! d["a"] = Mapping({u"\0" : 1}):TypeError:('expected string without null bytes',) +! d["a"] = Mapping({"\0" : 1}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({"abc" : {%s : 1}}) +! d["a"] = Mapping({"abc" : {1 : 1}}):TypeError:('object must be string',) +! d["a"] = Mapping({"abc" : {u"\0" : 1}}):TypeError:('expected string without null bytes',) +! d["a"] = Mapping({"abc" : {"\0" : 1}}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({"abc" : Mapping({%s : 1})}) +! d["a"] = Mapping({"abc" : Mapping({1 : 1})}):TypeError:('object must be string',) +! d["a"] = Mapping({"abc" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',) +! d["a"] = Mapping({"abc" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using d["a"] = Mapping({"abc" : %s}) +! d["a"] = Mapping({"abc" : FailingIter()}):TypeError:('unable to convert to vim structure',) +! d["a"] = Mapping({"abc" : FailingIterNext()}):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abc" : %s}) +! d["a"] = Mapping({"abc" : None}):TypeError:('unable to convert to vim structure',) +! d["a"] = Mapping({"abc" : {"": 1}}):ValueError:('empty keys are not allowed',) +! d["a"] = Mapping({"abc" : {u"": 1}}):ValueError:('empty keys are not allowed',) +! d["a"] = Mapping({"abc" : FailingMapping()}):NotImplementedError:() +! d["a"] = Mapping({"abc" : FailingMappingKey()}):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using d["a"] = %s +! d["a"] = FailingIter():TypeError:('unable to convert to vim structure',) +! d["a"] = FailingIterNext():NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = %s +! d["a"] = None:TypeError:('unable to convert to vim structure',) +! d["a"] = {"": 1}:ValueError:('empty keys are not allowed',) +! d["a"] = {u"": 1}:ValueError:('empty keys are not allowed',) +! d["a"] = FailingMapping():NotImplementedError:() +! d["a"] = FailingMappingKey():NotImplementedError:() + <<< Finished + >> DictionaryUpdate + >>> kwargs + >>> iter +! d.update(FailingMapping()):NotImplementedError:() +! d.update([FailingIterNext()]):NotImplementedError:() + >>> Testing StringToChars using d.update({%s : 1}) +! d.update({1 : 1}):TypeError:('object must be string',) +! d.update({u"\0" : 1}):TypeError:('expected string without null bytes',) +! d.update({"\0" : 1}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update({"abc" : {%s : 1}}) +! d.update({"abc" : {1 : 1}}):TypeError:('object must be string',) +! d.update({"abc" : {u"\0" : 1}}):TypeError:('expected string without null bytes',) +! d.update({"abc" : {"\0" : 1}}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update({"abc" : Mapping({%s : 1})}) +! d.update({"abc" : Mapping({1 : 1})}):TypeError:('object must be string',) +! d.update({"abc" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',) +! d.update({"abc" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using d.update({"abc" : %s}) +! d.update({"abc" : FailingIter()}):TypeError:('unable to convert to vim structure',) +! d.update({"abc" : FailingIterNext()}):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d.update({"abc" : %s}) +! d.update({"abc" : None}):TypeError:('unable to convert to vim structure',) +! d.update({"abc" : {"": 1}}):ValueError:('empty keys are not allowed',) +! d.update({"abc" : {u"": 1}}):ValueError:('empty keys are not allowed',) +! d.update({"abc" : FailingMapping()}):NotImplementedError:() +! d.update({"abc" : FailingMappingKey()}):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using d.update(Mapping({%s : 1})) +! d.update(Mapping({1 : 1})):TypeError:('object must be string',) +! d.update(Mapping({u"\0" : 1})):TypeError:('expected string without null bytes',) +! d.update(Mapping({"\0" : 1})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update(Mapping({"abc" : {%s : 1}})) +! d.update(Mapping({"abc" : {1 : 1}})):TypeError:('object must be string',) +! d.update(Mapping({"abc" : {u"\0" : 1}})):TypeError:('expected string without null bytes',) +! d.update(Mapping({"abc" : {"\0" : 1}})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update(Mapping({"abc" : Mapping({%s : 1})})) +! d.update(Mapping({"abc" : Mapping({1 : 1})})):TypeError:('object must be string',) +! d.update(Mapping({"abc" : Mapping({u"\0" : 1})})):TypeError:('expected string without null bytes',) +! d.update(Mapping({"abc" : Mapping({"\0" : 1})})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using d.update(Mapping({"abc" : %s})) +! d.update(Mapping({"abc" : FailingIter()})):TypeError:('unable to convert to vim structure',) +! d.update(Mapping({"abc" : FailingIterNext()})):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d.update(Mapping({"abc" : %s})) +! d.update(Mapping({"abc" : None})):TypeError:('unable to convert to vim structure',) +! d.update(Mapping({"abc" : {"": 1}})):ValueError:('empty keys are not allowed',) +! d.update(Mapping({"abc" : {u"": 1}})):ValueError:('empty keys are not allowed',) +! d.update(Mapping({"abc" : FailingMapping()})):NotImplementedError:() +! d.update(Mapping({"abc" : FailingMappingKey()})):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using d.update(%s) +! d.update(FailingIter()):NotImplementedError:() +! d.update(FailingIterNext()):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d.update(%s) +! d.update(None):TypeError:("'NoneType' object is not iterable",) +! d.update({"": 1}):ValueError:('empty keys are not allowed',) +! d.update({u"": 1}):ValueError:('empty keys are not allowed',) +! d.update(FailingMapping()):NotImplementedError:() +! d.update(FailingMappingKey()):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using d.update(((%s, 0),)) +! d.update(((1, 0),)):TypeError:('object must be string',) +! d.update(((u"\0", 0),)):TypeError:('expected string without null bytes',) +! d.update((("\0", 0),)):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update((("a", {%s : 1}),)) +! d.update((("a", {1 : 1}),)):TypeError:('object must be string',) +! d.update((("a", {u"\0" : 1}),)):TypeError:('expected string without null bytes',) +! d.update((("a", {"\0" : 1}),)):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update((("a", {"abc" : {%s : 1}}),)) +! d.update((("a", {"abc" : {1 : 1}}),)):TypeError:('object must be string',) +! d.update((("a", {"abc" : {u"\0" : 1}}),)):TypeError:('expected string without null bytes',) +! d.update((("a", {"abc" : {"\0" : 1}}),)):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update((("a", {"abc" : Mapping({%s : 1})}),)) +! d.update((("a", {"abc" : Mapping({1 : 1})}),)):TypeError:('object must be string',) +! d.update((("a", {"abc" : Mapping({u"\0" : 1})}),)):TypeError:('expected string without null bytes',) +! d.update((("a", {"abc" : Mapping({"\0" : 1})}),)):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using d.update((("a", {"abc" : %s}),)) +! d.update((("a", {"abc" : FailingIter()}),)):TypeError:('unable to convert to vim structure',) +! d.update((("a", {"abc" : FailingIterNext()}),)):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", {"abc" : %s}),)) +! d.update((("a", {"abc" : None}),)):TypeError:('unable to convert to vim structure',) +! d.update((("a", {"abc" : {"": 1}}),)):ValueError:('empty keys are not allowed',) +! d.update((("a", {"abc" : {u"": 1}}),)):ValueError:('empty keys are not allowed',) +! d.update((("a", {"abc" : FailingMapping()}),)):NotImplementedError:() +! d.update((("a", {"abc" : FailingMappingKey()}),)):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),)) +! d.update((("a", Mapping({1 : 1})),)):TypeError:('object must be string',) +! d.update((("a", Mapping({u"\0" : 1})),)):TypeError:('expected string without null bytes',) +! d.update((("a", Mapping({"\0" : 1})),)):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({"abc" : {%s : 1}})),)) +! d.update((("a", Mapping({"abc" : {1 : 1}})),)):TypeError:('object must be string',) +! d.update((("a", Mapping({"abc" : {u"\0" : 1}})),)):TypeError:('expected string without null bytes',) +! d.update((("a", Mapping({"abc" : {"\0" : 1}})),)):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({"abc" : Mapping({%s : 1})})),)) +! d.update((("a", Mapping({"abc" : Mapping({1 : 1})})),)):TypeError:('object must be string',) +! d.update((("a", Mapping({"abc" : Mapping({u"\0" : 1})})),)):TypeError:('expected string without null bytes',) +! d.update((("a", Mapping({"abc" : Mapping({"\0" : 1})})),)):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using d.update((("a", Mapping({"abc" : %s})),)) +! d.update((("a", Mapping({"abc" : FailingIter()})),)):TypeError:('unable to convert to vim structure',) +! d.update((("a", Mapping({"abc" : FailingIterNext()})),)):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abc" : %s})),)) +! d.update((("a", Mapping({"abc" : None})),)):TypeError:('unable to convert to vim structure',) +! d.update((("a", Mapping({"abc" : {"": 1}})),)):ValueError:('empty keys are not allowed',) +! d.update((("a", Mapping({"abc" : {u"": 1}})),)):ValueError:('empty keys are not allowed',) +! d.update((("a", Mapping({"abc" : FailingMapping()})),)):NotImplementedError:() +! d.update((("a", Mapping({"abc" : FailingMappingKey()})),)):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using d.update((("a", %s),)) +! d.update((("a", FailingIter()),)):TypeError:('unable to convert to vim structure',) +! d.update((("a", FailingIterNext()),)):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", %s),)) +! d.update((("a", None),)):TypeError:('unable to convert to vim structure',) +! d.update((("a", {"": 1}),)):ValueError:('empty keys are not allowed',) +! d.update((("a", {u"": 1}),)):ValueError:('empty keys are not allowed',) +! d.update((("a", FailingMapping()),)):NotImplementedError:() +! d.update((("a", FailingMappingKey()),)):NotImplementedError:() + <<< Finished + >> DictionaryPopItem +! d.popitem(1, 2):TypeError:('popitem() takes no arguments (2 given)',) + >> DictionaryHasKey +! d.has_key():TypeError:('function takes exactly 1 argument (0 given)',) + > List + >> ListConstructor +! vim.List(1, 2):TypeError:('function takes at most 1 argument (2 given)',) +! vim.List(a=1):TypeError:('list constructor does not accept keyword arguments',) + >>> Testing StringToChars using vim.List([{%s : 1}]) +! vim.List([{1 : 1}]):TypeError:('object must be string',) +! vim.List([{u"\0" : 1}]):TypeError:('expected string without null bytes',) +! vim.List([{"\0" : 1}]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using vim.List([{"abc" : {%s : 1}}]) +! vim.List([{"abc" : {1 : 1}}]):TypeError:('object must be string',) +! vim.List([{"abc" : {u"\0" : 1}}]):TypeError:('expected string without null bytes',) +! vim.List([{"abc" : {"\0" : 1}}]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using vim.List([{"abc" : Mapping({%s : 1})}]) +! vim.List([{"abc" : Mapping({1 : 1})}]):TypeError:('object must be string',) +! vim.List([{"abc" : Mapping({u"\0" : 1})}]):TypeError:('expected string without null bytes',) +! vim.List([{"abc" : Mapping({"\0" : 1})}]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using vim.List([{"abc" : %s}]) +! vim.List([{"abc" : FailingIter()}]):TypeError:('unable to convert to vim structure',) +! vim.List([{"abc" : FailingIterNext()}]):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([{"abc" : %s}]) +! vim.List([{"abc" : None}]):TypeError:('unable to convert to vim structure',) +! vim.List([{"abc" : {"": 1}}]):ValueError:('empty keys are not allowed',) +! vim.List([{"abc" : {u"": 1}}]):ValueError:('empty keys are not allowed',) +! vim.List([{"abc" : FailingMapping()}]):NotImplementedError:() +! vim.List([{"abc" : FailingMappingKey()}]):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({%s : 1})]) +! vim.List([Mapping({1 : 1})]):TypeError:('object must be string',) +! vim.List([Mapping({u"\0" : 1})]):TypeError:('expected string without null bytes',) +! vim.List([Mapping({"\0" : 1})]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({"abc" : {%s : 1}})]) +! vim.List([Mapping({"abc" : {1 : 1}})]):TypeError:('object must be string',) +! vim.List([Mapping({"abc" : {u"\0" : 1}})]):TypeError:('expected string without null bytes',) +! vim.List([Mapping({"abc" : {"\0" : 1}})]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({"abc" : Mapping({%s : 1})})]) +! vim.List([Mapping({"abc" : Mapping({1 : 1})})]):TypeError:('object must be string',) +! vim.List([Mapping({"abc" : Mapping({u"\0" : 1})})]):TypeError:('expected string without null bytes',) +! vim.List([Mapping({"abc" : Mapping({"\0" : 1})})]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using vim.List([Mapping({"abc" : %s})]) +! vim.List([Mapping({"abc" : FailingIter()})]):TypeError:('unable to convert to vim structure',) +! vim.List([Mapping({"abc" : FailingIterNext()})]):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([Mapping({"abc" : %s})]) +! vim.List([Mapping({"abc" : None})]):TypeError:('unable to convert to vim structure',) +! vim.List([Mapping({"abc" : {"": 1}})]):ValueError:('empty keys are not allowed',) +! vim.List([Mapping({"abc" : {u"": 1}})]):ValueError:('empty keys are not allowed',) +! vim.List([Mapping({"abc" : FailingMapping()})]):NotImplementedError:() +! vim.List([Mapping({"abc" : FailingMappingKey()})]):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using vim.List([%s]) +! vim.List([FailingIter()]):TypeError:('unable to convert to vim structure',) +! vim.List([FailingIterNext()]):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([%s]) +! vim.List([None]):TypeError:('unable to convert to vim structure',) +! vim.List([{"": 1}]):ValueError:('empty keys are not allowed',) +! vim.List([{u"": 1}]):ValueError:('empty keys are not allowed',) +! vim.List([FailingMapping()]):NotImplementedError:() +! vim.List([FailingMappingKey()]):NotImplementedError:() + <<< Finished + >> ListItem +! l[1000]:IndexError:('list index out of range',) + >> ListAssItem +! ll[1] = 2:error:('list is locked',) +! l[1000] = 3:IndexError:('list index out of range',) + >> ListAssSlice +! ll[1:100] = "abc":error:('list is locked',) + >>> Testing StringToChars using l[:] = [{%s : 1}] +! l[:] = [{1 : 1}]:TypeError:('object must be string',) +! l[:] = [{u"\0" : 1}]:TypeError:('expected string without null bytes',) +! l[:] = [{"\0" : 1}]:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using l[:] = [{"abc" : {%s : 1}}] +! l[:] = [{"abc" : {1 : 1}}]:TypeError:('object must be string',) +! l[:] = [{"abc" : {u"\0" : 1}}]:TypeError:('expected string without null bytes',) +! l[:] = [{"abc" : {"\0" : 1}}]:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using l[:] = [{"abc" : Mapping({%s : 1})}] +! l[:] = [{"abc" : Mapping({1 : 1})}]:TypeError:('object must be string',) +! l[:] = [{"abc" : Mapping({u"\0" : 1})}]:TypeError:('expected string without null bytes',) +! l[:] = [{"abc" : Mapping({"\0" : 1})}]:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using l[:] = [{"abc" : %s}] +! l[:] = [{"abc" : FailingIter()}]:TypeError:('unable to convert to vim structure',) +! l[:] = [{"abc" : FailingIterNext()}]:NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [{"abc" : %s}] +! l[:] = [{"abc" : None}]:TypeError:('unable to convert to vim structure',) +! l[:] = [{"abc" : {"": 1}}]:ValueError:('empty keys are not allowed',) +! l[:] = [{"abc" : {u"": 1}}]:ValueError:('empty keys are not allowed',) +! l[:] = [{"abc" : FailingMapping()}]:NotImplementedError:() +! l[:] = [{"abc" : FailingMappingKey()}]:NotImplementedError:() + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({%s : 1})] +! l[:] = [Mapping({1 : 1})]:TypeError:('object must be string',) +! l[:] = [Mapping({u"\0" : 1})]:TypeError:('expected string without null bytes',) +! l[:] = [Mapping({"\0" : 1})]:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({"abc" : {%s : 1}})] +! l[:] = [Mapping({"abc" : {1 : 1}})]:TypeError:('object must be string',) +! l[:] = [Mapping({"abc" : {u"\0" : 1}})]:TypeError:('expected string without null bytes',) +! l[:] = [Mapping({"abc" : {"\0" : 1}})]:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({"abc" : Mapping({%s : 1})})] +! l[:] = [Mapping({"abc" : Mapping({1 : 1})})]:TypeError:('object must be string',) +! l[:] = [Mapping({"abc" : Mapping({u"\0" : 1})})]:TypeError:('expected string without null bytes',) +! l[:] = [Mapping({"abc" : Mapping({"\0" : 1})})]:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using l[:] = [Mapping({"abc" : %s})] +! l[:] = [Mapping({"abc" : FailingIter()})]:TypeError:('unable to convert to vim structure',) +! l[:] = [Mapping({"abc" : FailingIterNext()})]:NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abc" : %s})] +! l[:] = [Mapping({"abc" : None})]:TypeError:('unable to convert to vim structure',) +! l[:] = [Mapping({"abc" : {"": 1}})]:ValueError:('empty keys are not allowed',) +! l[:] = [Mapping({"abc" : {u"": 1}})]:ValueError:('empty keys are not allowed',) +! l[:] = [Mapping({"abc" : FailingMapping()})]:NotImplementedError:() +! l[:] = [Mapping({"abc" : FailingMappingKey()})]:NotImplementedError:() + <<< Finished + >>> Testing *Iter* using l[:] = [%s] +! l[:] = [FailingIter()]:TypeError:('unable to convert to vim structure',) +! l[:] = [FailingIterNext()]:NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [%s] +! l[:] = [None]:TypeError:('unable to convert to vim structure',) +! l[:] = [{"": 1}]:ValueError:('empty keys are not allowed',) +! l[:] = [{u"": 1}]:ValueError:('empty keys are not allowed',) +! l[:] = [FailingMapping()]:NotImplementedError:() +! l[:] = [FailingMappingKey()]:NotImplementedError:() + <<< Finished + >> ListConcatInPlace + >>> Testing StringToChars using l.extend([{%s : 1}]) +! l.extend([{1 : 1}]):TypeError:('object must be string',) +! l.extend([{u"\0" : 1}]):TypeError:('expected string without null bytes',) +! l.extend([{"\0" : 1}]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using l.extend([{"abc" : {%s : 1}}]) +! l.extend([{"abc" : {1 : 1}}]):TypeError:('object must be string',) +! l.extend([{"abc" : {u"\0" : 1}}]):TypeError:('expected string without null bytes',) +! l.extend([{"abc" : {"\0" : 1}}]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using l.extend([{"abc" : Mapping({%s : 1})}]) +! l.extend([{"abc" : Mapping({1 : 1})}]):TypeError:('object must be string',) +! l.extend([{"abc" : Mapping({u"\0" : 1})}]):TypeError:('expected string without null bytes',) +! l.extend([{"abc" : Mapping({"\0" : 1})}]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using l.extend([{"abc" : %s}]) +! l.extend([{"abc" : FailingIter()}]):TypeError:('unable to convert to vim structure',) +! l.extend([{"abc" : FailingIterNext()}]):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([{"abc" : %s}]) +! l.extend([{"abc" : None}]):TypeError:('unable to convert to vim structure',) +! l.extend([{"abc" : {"": 1}}]):ValueError:('empty keys are not allowed',) +! l.extend([{"abc" : {u"": 1}}]):ValueError:('empty keys are not allowed',) +! l.extend([{"abc" : FailingMapping()}]):NotImplementedError:() +! l.extend([{"abc" : FailingMappingKey()}]):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({%s : 1})]) +! l.extend([Mapping({1 : 1})]):TypeError:('object must be string',) +! l.extend([Mapping({u"\0" : 1})]):TypeError:('expected string without null bytes',) +! l.extend([Mapping({"\0" : 1})]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({"abc" : {%s : 1}})]) +! l.extend([Mapping({"abc" : {1 : 1}})]):TypeError:('object must be string',) +! l.extend([Mapping({"abc" : {u"\0" : 1}})]):TypeError:('expected string without null bytes',) +! l.extend([Mapping({"abc" : {"\0" : 1}})]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({"abc" : Mapping({%s : 1})})]) +! l.extend([Mapping({"abc" : Mapping({1 : 1})})]):TypeError:('object must be string',) +! l.extend([Mapping({"abc" : Mapping({u"\0" : 1})})]):TypeError:('expected string without null bytes',) +! l.extend([Mapping({"abc" : Mapping({"\0" : 1})})]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using l.extend([Mapping({"abc" : %s})]) +! l.extend([Mapping({"abc" : FailingIter()})]):TypeError:('unable to convert to vim structure',) +! l.extend([Mapping({"abc" : FailingIterNext()})]):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([Mapping({"abc" : %s})]) +! l.extend([Mapping({"abc" : None})]):TypeError:('unable to convert to vim structure',) +! l.extend([Mapping({"abc" : {"": 1}})]):ValueError:('empty keys are not allowed',) +! l.extend([Mapping({"abc" : {u"": 1}})]):ValueError:('empty keys are not allowed',) +! l.extend([Mapping({"abc" : FailingMapping()})]):NotImplementedError:() +! l.extend([Mapping({"abc" : FailingMappingKey()})]):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using l.extend([%s]) +! l.extend([FailingIter()]):TypeError:('unable to convert to vim structure',) +! l.extend([FailingIterNext()]):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([%s]) +! l.extend([None]):TypeError:('unable to convert to vim structure',) +! l.extend([{"": 1}]):ValueError:('empty keys are not allowed',) +! l.extend([{u"": 1}]):ValueError:('empty keys are not allowed',) +! l.extend([FailingMapping()]):NotImplementedError:() +! l.extend([FailingMappingKey()]):NotImplementedError:() + <<< Finished + >> ListSetattr +! del l.locked:AttributeError:('cannot delete vim.List attributes',) +! l.locked = FailingTrue():NotImplementedError:() +! l.xxx = True:AttributeError:('cannot set this attribute',) + > Function + >> FunctionConstructor +! vim.Function("123"):ValueError:('unnamed function does not exist',) +! vim.Function("xxx_non_existent_function_xxx"):ValueError:('function does not exist',) + vim.Function("xxx#non#existent#function#xxx"):NOT FAILED + >> FunctionCall + >>> Testing StringToChars using f({%s : 1}) +! f({1 : 1}):TypeError:('object must be string',) +! f({u"\0" : 1}):TypeError:('expected string without null bytes',) +! f({"\0" : 1}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using f({"abc" : {%s : 1}}) +! f({"abc" : {1 : 1}}):TypeError:('object must be string',) +! f({"abc" : {u"\0" : 1}}):TypeError:('expected string without null bytes',) +! f({"abc" : {"\0" : 1}}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using f({"abc" : Mapping({%s : 1})}) +! f({"abc" : Mapping({1 : 1})}):TypeError:('object must be string',) +! f({"abc" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',) +! f({"abc" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using f({"abc" : %s}) +! f({"abc" : FailingIter()}):TypeError:('unable to convert to vim structure',) +! f({"abc" : FailingIterNext()}):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using f({"abc" : %s}) +! f({"abc" : None}):TypeError:('unable to convert to vim structure',) +! f({"abc" : {"": 1}}):ValueError:('empty keys are not allowed',) +! f({"abc" : {u"": 1}}):ValueError:('empty keys are not allowed',) +! f({"abc" : FailingMapping()}):NotImplementedError:() +! f({"abc" : FailingMappingKey()}):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using f(Mapping({%s : 1})) +! f(Mapping({1 : 1})):TypeError:('object must be string',) +! f(Mapping({u"\0" : 1})):TypeError:('expected string without null bytes',) +! f(Mapping({"\0" : 1})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using f(Mapping({"abc" : {%s : 1}})) +! f(Mapping({"abc" : {1 : 1}})):TypeError:('object must be string',) +! f(Mapping({"abc" : {u"\0" : 1}})):TypeError:('expected string without null bytes',) +! f(Mapping({"abc" : {"\0" : 1}})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using f(Mapping({"abc" : Mapping({%s : 1})})) +! f(Mapping({"abc" : Mapping({1 : 1})})):TypeError:('object must be string',) +! f(Mapping({"abc" : Mapping({u"\0" : 1})})):TypeError:('expected string without null bytes',) +! f(Mapping({"abc" : Mapping({"\0" : 1})})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using f(Mapping({"abc" : %s})) +! f(Mapping({"abc" : FailingIter()})):TypeError:('unable to convert to vim structure',) +! f(Mapping({"abc" : FailingIterNext()})):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using f(Mapping({"abc" : %s})) +! f(Mapping({"abc" : None})):TypeError:('unable to convert to vim structure',) +! f(Mapping({"abc" : {"": 1}})):ValueError:('empty keys are not allowed',) +! f(Mapping({"abc" : {u"": 1}})):ValueError:('empty keys are not allowed',) +! f(Mapping({"abc" : FailingMapping()})):NotImplementedError:() +! f(Mapping({"abc" : FailingMappingKey()})):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using f(%s) +! f(FailingIter()):TypeError:('unable to convert to vim structure',) +! f(FailingIterNext()):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using f(%s) +! f(None):TypeError:('unable to convert to vim structure',) +! f({"": 1}):ValueError:('empty keys are not allowed',) +! f({u"": 1}):ValueError:('empty keys are not allowed',) +! f(FailingMapping()):NotImplementedError:() +! f(FailingMappingKey()):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using fd(self={%s : 1}) +! fd(self={1 : 1}):TypeError:('object must be string',) +! fd(self={u"\0" : 1}):TypeError:('expected string without null bytes',) +! fd(self={"\0" : 1}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using fd(self={"abc" : {%s : 1}}) +! fd(self={"abc" : {1 : 1}}):TypeError:('object must be string',) +! fd(self={"abc" : {u"\0" : 1}}):TypeError:('expected string without null bytes',) +! fd(self={"abc" : {"\0" : 1}}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using fd(self={"abc" : Mapping({%s : 1})}) +! fd(self={"abc" : Mapping({1 : 1})}):TypeError:('object must be string',) +! fd(self={"abc" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',) +! fd(self={"abc" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using fd(self={"abc" : %s}) +! fd(self={"abc" : FailingIter()}):TypeError:('unable to convert to vim structure',) +! fd(self={"abc" : FailingIterNext()}):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using fd(self={"abc" : %s}) +! fd(self={"abc" : None}):TypeError:('unable to convert to vim structure',) +! fd(self={"abc" : {"": 1}}):ValueError:('empty keys are not allowed',) +! fd(self={"abc" : {u"": 1}}):ValueError:('empty keys are not allowed',) +! fd(self={"abc" : FailingMapping()}):NotImplementedError:() +! fd(self={"abc" : FailingMappingKey()}):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({%s : 1})) +! fd(self=Mapping({1 : 1})):TypeError:('object must be string',) +! fd(self=Mapping({u"\0" : 1})):TypeError:('expected string without null bytes',) +! fd(self=Mapping({"\0" : 1})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({"abc" : {%s : 1}})) +! fd(self=Mapping({"abc" : {1 : 1}})):TypeError:('object must be string',) +! fd(self=Mapping({"abc" : {u"\0" : 1}})):TypeError:('expected string without null bytes',) +! fd(self=Mapping({"abc" : {"\0" : 1}})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({"abc" : Mapping({%s : 1})})) +! fd(self=Mapping({"abc" : Mapping({1 : 1})})):TypeError:('object must be string',) +! fd(self=Mapping({"abc" : Mapping({u"\0" : 1})})):TypeError:('expected string without null bytes',) +! fd(self=Mapping({"abc" : Mapping({"\0" : 1})})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using fd(self=Mapping({"abc" : %s})) +! fd(self=Mapping({"abc" : FailingIter()})):TypeError:('unable to convert to vim structure',) +! fd(self=Mapping({"abc" : FailingIterNext()})):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using fd(self=Mapping({"abc" : %s})) +! fd(self=Mapping({"abc" : None})):TypeError:('unable to convert to vim structure',) +! fd(self=Mapping({"abc" : {"": 1}})):ValueError:('empty keys are not allowed',) +! fd(self=Mapping({"abc" : {u"": 1}})):ValueError:('empty keys are not allowed',) +! fd(self=Mapping({"abc" : FailingMapping()})):NotImplementedError:() +! fd(self=Mapping({"abc" : FailingMappingKey()})):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using fd(self=%s) +! fd(self=FailingIter()):TypeError:('unable to convert object to vim dictionary',) +! fd(self=FailingIterNext()):TypeError:('unable to convert object to vim dictionary',) + <<< Finished + >>> Testing ConvertFromPyObject using fd(self=%s) +! fd(self=None):TypeError:('unable to convert object to vim dictionary',) +! fd(self={"": 1}):ValueError:('empty keys are not allowed',) +! fd(self={u"": 1}):ValueError:('empty keys are not allowed',) +! fd(self=FailingMapping()):NotImplementedError:() +! fd(self=FailingMappingKey()):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyMapping using fd(self=%s) +! fd(self=[]):TypeError:('unable to convert object to vim dictionary',) + <<< Finished + > TabPage + >> TabPageAttr +! vim.current.tabpage.xxx:AttributeError:('xxx',) + > TabList + >> TabListItem +! vim.tabpages[1000]:IndexError:('no such tab page',) + > Window + >> WindowAttr +! vim.current.window.xxx:AttributeError:('xxx',) + >> WindowSetattr +! vim.current.window.buffer = 0:TypeError:('readonly attribute',) +! vim.current.window.cursor = (100000000, 100000000):error:('cursor position outside buffer',) +! vim.current.window.cursor = True:TypeError:('argument must be 2-item sequence, not bool',) +! vim.current.window.height = "abc":TypeError:('an integer is required',) +! vim.current.window.width = "abc":TypeError:('an integer is required',) +! vim.current.window.xxxxxx = True:AttributeError:('xxxxxx',) + > WinList + >> WinListItem +! vim.windows[1000]:IndexError:('no such window',) + > Buffer + >> StringToLine (indirect) +! vim.current.buffer[0] = "\na":error:('string cannot contain newlines',) + >> SetBufferLine (indirect) +! vim.current.buffer[0] = True:TypeError:('bad argument type for built-in operation',) + >> SetBufferLines (indirect) +! vim.current.buffer[:] = True:TypeError:('bad argument type for built-in operation',) +! vim.current.buffer[:] = ["\na", "bc"]:error:('string cannot contain newlines',) + >> InsertBufferLines (indirect) +! vim.current.buffer.append(None):TypeError:('bad argument type for built-in operation',) +! vim.current.buffer.append(["\na", "bc"]):error:('string cannot contain newlines',) +! vim.current.buffer.append("\nbc"):error:('string cannot contain newlines',) + >> RBItem +! vim.current.buffer[100000000]:IndexError:('line number out of range',) + >> RBAsItem +! vim.current.buffer[100000000] = "":IndexError:('line number out of range',) + >> BufferAttr +! vim.current.buffer.xxx:AttributeError:('xxx',) + >> BufferSetattr +! vim.current.buffer.name = True:TypeError:('object must be string',) +! vim.current.buffer.xxx = True:AttributeError:('xxx',) + >> BufferMark +! vim.current.buffer.mark(0):TypeError:('must be string, not int',) +! vim.current.buffer.mark("abc"):ValueError:('mark name must be a single character',) +! vim.current.buffer.mark("!"):error:('invalid mark name',) + >> BufferRange +! vim.current.buffer.range(1, 2, 3):TypeError:('function takes exactly 2 arguments (3 given)',) + > BufMap + >> BufMapItem +! vim.buffers[None]:TypeError:('key must be integer',) +! vim.buffers[100000000]:KeyError:(100000000,) + > Current + >> CurrentGetattr +! vim.current.xxx:AttributeError:('xxx',) + >> CurrentSetattr +! vim.current.line = True:TypeError:('bad argument type for built-in operation',) +! vim.current.buffer = True:TypeError:('expected vim.Buffer object',) +! vim.current.window = True:TypeError:('expected vim.Window object',) +! vim.current.tabpage = True:TypeError:('expected vim.TabPage object',) +! vim.current.xxx = True:AttributeError:('xxx',) + 2,xx + before + after +! vim.command("throw 'abc'"):error:('abc',) +! Exe("throw 'def'"):error:('def',) +! vim.eval("Exe('throw ''ghi''')"):error:('ghi',) +! vim.eval("Exe('echoerr ''jkl''')"):error:('Vim(echoerr):jkl',) +! vim.eval("Exe('xxx_non_existent_command_xxx')"):error:('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',) +! vim.bindeval("Exe('xxx_non_existent_command_xxx')"):error:('Vim:E492: Not an editor command: xxx_non_existent_command_xxx',) +*** ../vim-7.3.1172/src/version.c 2013-06-12 14:20:15.000000000 +0200 +--- src/version.c 2013-06-12 14:22:25.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1173, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +168. You have your own domain name. + + /// 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 /// diff --git a/7.3.1174 b/7.3.1174 new file mode 100644 index 0000000..c7a0156 --- /dev/null +++ b/7.3.1174 @@ -0,0 +1,835 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1174 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1174 +Problem: Python 2 and 3 use different ways to load modules. +Solution: Use the same method. (ZyX) +Files: runtime/doc/if_pyth.txt, src/if_py_both.h, src/if_python3.c, + src/if_python.c + + +*** ../vim-7.3.1173/runtime/doc/if_pyth.txt 2013-06-12 14:20:15.000000000 +0200 +--- runtime/doc/if_pyth.txt 2013-06-12 14:33:12.000000000 +0200 +*************** +*** 315,321 **** + {rtp}/python2 (or python3) and {rtp}/pythonx (for both python versions) for + each {rtp} found in 'runtimepath'. + +! Implementation for python 2 is similar to the following, but written in C: > + + from imp import find_module, load_module + import vim +--- 315,321 ---- + {rtp}/python2 (or python3) and {rtp}/pythonx (for both python versions) for + each {rtp} found in 'runtimepath'. + +! Implementation is similar to the following, but written in C: > + + from imp import find_module, load_module + import vim +*************** +*** 344,359 **** + # matter for python which object has find_module function attached to as + # an attribute. + class VimPathFinder(object): + def find_module(cls, fullname, path=None): + try: + return VimModuleLoader(_find_module(fullname, fullname, path or vim._get_paths())) + except ImportError: + return None +- find_module = classmethod(find_module) + + def load_module(cls, fullname, path=None): + return _find_module(fullname, fullname, path or vim._get_paths()) +- load_module = classmethod(load_module) + + def hook(path): + if path == vim.VIM_SPECIAL_PATH: +--- 344,359 ---- + # matter for python which object has find_module function attached to as + # an attribute. + class VimPathFinder(object): ++ @classmethod + def find_module(cls, fullname, path=None): + try: + return VimModuleLoader(_find_module(fullname, fullname, path or vim._get_paths())) + except ImportError: + return None + ++ @classmethod + def load_module(cls, fullname, path=None): + return _find_module(fullname, fullname, path or vim._get_paths()) + + def hook(path): + if path == vim.VIM_SPECIAL_PATH: +*************** +*** 363,392 **** + + sys.path_hooks.append(hook) + +- Implementation for python 3 is cleaner: code is similar to the following, but, +- again, written in C: > +- +- from importlib.machinery import PathFinder +- import sys +- +- class Finder(PathFinder): +- @classmethod +- def find_module(cls, fullname): +- # see vim._get_paths below +- new_path = _get_paths() +- +- # super().find_module is also a class method +- # super() is not used because this variant is easier to implement +- # in C +- return PathFinder.find_module(fullname, new_path) +- +- def path_hook(path): +- if path == VIM_SPECIAL_PATH: +- return Finder +- raise ImportError +- +- sys.path_hooks.append(path_hook) +- + vim.VIM_SPECIAL_PATH *python-VIM_SPECIAL_PATH* + String constant used in conjunction with vim path hook. If path hook + installed by vim is requested to handle anything but path equal to +--- 363,368 ---- +*************** +*** 402,409 **** + You should not be using any of these directly except for vim.path_hook + in case you need to do something with sys.meta_path. It is not + guaranteed that any of the objects will exist in the future vim +! versions. In fact, find_module methods do not exists +! in python3. + + vim._get_paths *python-_get_paths* + Methods returning a list of paths which will be searched for by path +--- 378,384 ---- + You should not be using any of these directly except for vim.path_hook + in case you need to do something with sys.meta_path. It is not + guaranteed that any of the objects will exist in the future vim +! versions. + + vim._get_paths *python-_get_paths* + Methods returning a list of paths which will be searched for by path +*** ../vim-7.3.1173/src/if_py_both.h 2013-06-12 14:20:15.000000000 +0200 +--- src/if_py_both.h 2013-06-12 14:35:42.000000000 +0200 +*************** +*** 60,65 **** +--- 60,70 ---- + static PyObject *vim_module; + static PyObject *vim_special_path_object; + ++ static PyObject *py_find_module; ++ static PyObject *py_load_module; ++ ++ static PyObject *VimError; ++ + /* + * obtain a lock on the Vim data structures + */ +*************** +*** 393,400 **** + return 0; + } + + +! static PyObject *VimError; + + /* Check to see whether a Vim error has been reported, or a keyboard + * interrupt has been detected. +--- 398,431 ---- + return 0; + } + ++ typedef struct ++ { ++ PyObject_HEAD ++ PyObject *module; ++ } LoaderObject; ++ static PyTypeObject LoaderType; ++ ++ static void ++ LoaderDestructor(LoaderObject *self) ++ { ++ Py_DECREF(self->module); ++ DESTRUCTOR_FINISH(self); ++ } ++ ++ static PyObject * ++ LoaderLoadModule(LoaderObject *self, PyObject *args UNUSED) ++ { ++ PyObject *r = self->module; + +! Py_INCREF(r); +! return r; +! } +! +! static struct PyMethodDef LoaderMethods[] = { +! /* name, function, calling, doc */ +! {"load_module", (PyCFunction)LoaderLoadModule, METH_VARARGS, ""}, +! { NULL, NULL, 0, NULL} +! }; + + /* Check to see whether a Vim error has been reported, or a keyboard + * interrupt has been detected. +*************** +*** 925,930 **** +--- 956,1105 ---- + return r; + } + ++ static PyObject * ++ call_load_module(char *name, int len, PyObject *find_module_result) ++ { ++ PyObject *fd, *pathname, *description; ++ ++ if (!PyTuple_Check(find_module_result) ++ || PyTuple_GET_SIZE(find_module_result) != 3) ++ { ++ PyErr_SetString(PyExc_TypeError, ++ _("expected 3-tuple as imp.find_module() result")); ++ return NULL; ++ } ++ ++ if (!(fd = PyTuple_GET_ITEM(find_module_result, 0)) ++ || !(pathname = PyTuple_GET_ITEM(find_module_result, 1)) ++ || !(description = PyTuple_GET_ITEM(find_module_result, 2))) ++ { ++ PyErr_SetString(PyExc_RuntimeError, ++ _("internal error: imp.find_module returned tuple with NULL")); ++ return NULL; ++ } ++ ++ return PyObject_CallFunction(py_load_module, ++ "s#OOO", name, len, fd, pathname, description); ++ } ++ ++ static PyObject * ++ find_module(char *fullname, char *tail, PyObject *new_path) ++ { ++ PyObject *find_module_result; ++ PyObject *module; ++ char *dot; ++ ++ if ((dot = (char *) vim_strchr((char_u *) tail, '.'))) ++ { ++ /* ++ * There is a dot in the name: call find_module recursively without the ++ * first component ++ */ ++ PyObject *newest_path; ++ int partlen = (int) (dot - 1 - tail); ++ ++ if (!(find_module_result = PyObject_CallFunction(py_find_module, ++ "s#O", tail, partlen, new_path))) ++ return NULL; ++ ++ if (!(module = call_load_module( ++ fullname, ++ ((int) (tail - fullname)) + partlen, ++ find_module_result))) ++ { ++ Py_DECREF(find_module_result); ++ return NULL; ++ } ++ ++ Py_DECREF(find_module_result); ++ ++ if (!(newest_path = PyObject_GetAttrString(module, "__path__"))) ++ { ++ Py_DECREF(module); ++ return NULL; ++ } ++ ++ Py_DECREF(module); ++ ++ module = find_module(fullname, dot + 1, newest_path); ++ ++ Py_DECREF(newest_path); ++ ++ return module; ++ } ++ else ++ { ++ if (!(find_module_result = PyObject_CallFunction(py_find_module, ++ "sO", tail, new_path))) ++ return NULL; ++ ++ if (!(module = call_load_module( ++ fullname, ++ STRLEN(fullname), ++ find_module_result))) ++ { ++ Py_DECREF(find_module_result); ++ return NULL; ++ } ++ ++ Py_DECREF(find_module_result); ++ ++ return module; ++ } ++ } ++ ++ static PyObject * ++ FinderFindModule(PyObject *self, PyObject *args) ++ { ++ char *fullname; ++ PyObject *module; ++ PyObject *new_path; ++ LoaderObject *loader; ++ ++ if (!PyArg_ParseTuple(args, "s", &fullname)) ++ return NULL; ++ ++ if (!(new_path = Vim_GetPaths(self))) ++ return NULL; ++ ++ module = find_module(fullname, fullname, new_path); ++ ++ Py_DECREF(new_path); ++ ++ if (!module) ++ { ++ Py_INCREF(Py_None); ++ return Py_None; ++ } ++ ++ if (!(loader = PyObject_NEW(LoaderObject, &LoaderType))) ++ { ++ Py_DECREF(module); ++ return NULL; ++ } ++ ++ loader->module = module; ++ ++ return (PyObject *) loader; ++ } ++ ++ static PyObject * ++ VimPathHook(PyObject *self UNUSED, PyObject *args) ++ { ++ char *path; ++ ++ if (PyArg_ParseTuple(args, "s", &path) ++ && STRCMP(path, vim_special_path) == 0) ++ { ++ Py_INCREF(vim_module); ++ return vim_module; ++ } ++ ++ PyErr_Clear(); ++ PyErr_SetNone(PyExc_ImportError); ++ return NULL; ++ } ++ + /* + * Vim module - Definitions + */ +*************** +*** 938,946 **** + {"chdir", (PyCFunction)VimChdir, METH_VARARGS|METH_KEYWORDS, "Change directory"}, + {"fchdir", (PyCFunction)VimFchdir, METH_VARARGS|METH_KEYWORDS, "Change directory"}, + {"foreach_rtp", VimForeachRTP, METH_VARARGS, "Call given callable for each path in &rtp"}, +- #if PY_MAJOR_VERSION < 3 + {"find_module", FinderFindModule, METH_VARARGS, "Internal use only, returns loader object for any input it receives"}, +- #endif + {"path_hook", VimPathHook, METH_VARARGS, "Hook function to install in sys.path_hooks"}, + {"_get_paths", (PyCFunction)Vim_GetPaths, METH_NOARGS, "Get &rtp-based additions to sys.path"}, + { NULL, NULL, 0, NULL} +--- 1113,1119 ---- +*************** +*** 5188,5208 **** + } CurrentObject; + static PyTypeObject CurrentType; + +- #if PY_MAJOR_VERSION >= 3 +- typedef struct +- { +- PyObject_HEAD +- } FinderObject; +- static PyTypeObject FinderType; +- #else +- typedef struct +- { +- PyObject_HEAD +- PyObject *module; +- } LoaderObject; +- static PyTypeObject LoaderType; +- #endif +- + static void + init_structs(void) + { +--- 5361,5366 ---- +*************** +*** 5418,5423 **** +--- 5576,5589 ---- + OptionsType.tp_traverse = (traverseproc)OptionsTraverse; + OptionsType.tp_clear = (inquiry)OptionsClear; + ++ vim_memset(&LoaderType, 0, sizeof(LoaderType)); ++ LoaderType.tp_name = "vim.Loader"; ++ LoaderType.tp_basicsize = sizeof(LoaderObject); ++ LoaderType.tp_flags = Py_TPFLAGS_DEFAULT; ++ LoaderType.tp_doc = "vim message object"; ++ LoaderType.tp_methods = LoaderMethods; ++ LoaderType.tp_dealloc = (destructor)LoaderDestructor; ++ + #if PY_MAJOR_VERSION >= 3 + vim_memset(&vimmodule, 0, sizeof(vimmodule)); + vimmodule.m_name = "vim"; +*************** +*** 5448,5458 **** + PYTYPE_READY(FunctionType); + PYTYPE_READY(OptionsType); + PYTYPE_READY(OutputType); +- #if PY_MAJOR_VERSION >= 3 +- PYTYPE_READY(FinderType); +- #else + PYTYPE_READY(LoaderType); +- #endif + return 0; + } + +--- 5614,5620 ---- +*************** +*** 5576,5586 **** + {"List", (PyObject *)&ListType}, + {"Function", (PyObject *)&FunctionType}, + {"Options", (PyObject *)&OptionsType}, +! #if PY_MAJOR_VERSION >= 3 +! {"Finder", (PyObject *)&FinderType}, +! #else +! {"Loader", (PyObject *)&LoaderType}, +! #endif + }; + + typedef int (*object_adder)(PyObject *, const char *, PyObject *); +--- 5738,5744 ---- + {"List", (PyObject *)&ListType}, + {"Function", (PyObject *)&FunctionType}, + {"Options", (PyObject *)&OptionsType}, +! {"_Loader", (PyObject *)&LoaderType}, + }; + + typedef int (*object_adder)(PyObject *, const char *, PyObject *); +*************** +*** 5604,5609 **** +--- 5762,5768 ---- + int i; + PyObject *other_module; + PyObject *attr; ++ PyObject *imp; + + for (i = 0; i < (int)(sizeof(numeric_constants) + / sizeof(struct numeric_constant)); +*************** +*** 5671,5685 **** + + ADD_OBJECT(m, "VIM_SPECIAL_PATH", vim_special_path_object); + +! #if PY_MAJOR_VERSION >= 3 +! ADD_OBJECT(m, "_PathFinder", path_finder); +! ADD_CHECKED_OBJECT(m, "_find_module", +! (py_find_module = PyObject_GetAttrString(path_finder, +! "find_module"))); +! #else + ADD_OBJECT(m, "_find_module", py_find_module); + ADD_OBJECT(m, "_load_module", py_load_module); +- #endif + + return 0; + } +--- 5830,5855 ---- + + ADD_OBJECT(m, "VIM_SPECIAL_PATH", vim_special_path_object); + +! if (!(imp = PyImport_ImportModule("imp"))) +! return -1; +! +! if (!(py_find_module = PyObject_GetAttrString(imp, "find_module"))) +! { +! Py_DECREF(imp); +! return -1; +! } +! +! if (!(py_load_module = PyObject_GetAttrString(imp, "load_module"))) +! { +! Py_DECREF(py_find_module); +! Py_DECREF(imp); +! return -1; +! } +! +! Py_DECREF(imp); +! + ADD_OBJECT(m, "_find_module", py_find_module); + ADD_OBJECT(m, "_load_module", py_load_module); + + return 0; + } +*** ../vim-7.3.1173/src/if_python3.c 2013-06-10 21:27:18.000000000 +0200 +--- src/if_python3.c 2013-06-12 14:36:00.000000000 +0200 +*************** +*** 175,180 **** +--- 175,181 ---- + # define PyObject_HasAttrString py3_PyObject_HasAttrString + # define PyObject_SetAttrString py3_PyObject_SetAttrString + # define PyObject_CallFunctionObjArgs py3_PyObject_CallFunctionObjArgs ++ # define _PyObject_CallFunction_SizeT py3__PyObject_CallFunction_SizeT + # define PyObject_Call py3_PyObject_Call + # define PyEval_GetLocals py3_PyEval_GetLocals + # define PyEval_GetGlobals py3_PyEval_GetGlobals +*************** +*** 296,301 **** +--- 297,303 ---- + static int (*py3_PyObject_HasAttrString)(PyObject *, const char *); + static PyObject* (*py3_PyObject_SetAttrString)(PyObject *, const char *, PyObject *); + static PyObject* (*py3_PyObject_CallFunctionObjArgs)(PyObject *, ...); ++ static PyObject* (*py3__PyObject_CallFunction_SizeT)(PyObject *, char *, ...); + static PyObject* (*py3_PyObject_Call)(PyObject *, PyObject *, PyObject *); + static PyObject* (*py3_PyEval_GetGlobals)(); + static PyObject* (*py3_PyEval_GetLocals)(); +*************** +*** 458,463 **** +--- 460,466 ---- + {"PyObject_HasAttrString", (PYTHON_PROC*)&py3_PyObject_HasAttrString}, + {"PyObject_SetAttrString", (PYTHON_PROC*)&py3_PyObject_SetAttrString}, + {"PyObject_CallFunctionObjArgs", (PYTHON_PROC*)&py3_PyObject_CallFunctionObjArgs}, ++ {"_PyObject_CallFunction_SizeT", (PYTHON_PROC*)&py3__PyObject_CallFunction_SizeT}, + {"PyObject_Call", (PYTHON_PROC*)&py3_PyObject_Call}, + {"PyEval_GetGlobals", (PYTHON_PROC*)&py3_PyEval_GetGlobals}, + {"PyEval_GetLocals", (PYTHON_PROC*)&py3_PyEval_GetLocals}, +*************** +*** 740,748 **** + + static struct PyModuleDef vimmodule; + +- static PyObject *path_finder; +- static PyObject *py_find_module = NULL; +- + #define PY_CAN_RECURSE + + /* +--- 743,748 ---- +*************** +*** 1603,1672 **** + #endif + + static PyObject * +- VimPathHook(PyObject *self UNUSED, PyObject *args) +- { +- char *path; +- +- if (PyArg_ParseTuple(args, "s", &path) +- && STRCMP(path, vim_special_path) == 0) +- { +- Py_INCREF(&FinderType); +- return (PyObject *) &FinderType; +- } +- +- PyErr_Clear(); +- PyErr_SetNone(PyExc_ImportError); +- return NULL; +- } +- +- static PyObject * +- FinderFindModule(PyObject *cls UNUSED, PyObject *fullname) +- { +- PyObject *new_path; +- PyObject *r; +- +- if (!(new_path = Vim_GetPaths(NULL))) +- return NULL; +- +- /* call find_module of the super() class */ +- r = PyObject_CallFunctionObjArgs(py_find_module, fullname, new_path, NULL); +- +- Py_DECREF(new_path); +- +- return r; +- } +- +- static struct PyMethodDef FinderMethods[] = { +- {"find_module", FinderFindModule, METH_CLASS|METH_O, ""}, +- {NULL, NULL, 0, NULL} +- }; +- +- static PyObject * + Py3Init_vim(void) + { + /* The special value is removed from sys.path in Python3_Init(). */ + static wchar_t *(argv[2]) = {L"/must>not&exist/foo", NULL}; +- PyObject *importlib_machinery; +- +- if (!(importlib_machinery = PyImport_ImportModule("importlib.machinery"))) +- return NULL; +- +- if (!(path_finder = PyObject_GetAttrString(importlib_machinery, +- "PathFinder"))) +- { +- Py_DECREF(importlib_machinery); +- return NULL; +- } +- +- Py_DECREF(importlib_machinery); +- +- vim_memset(&FinderType, 0, sizeof(FinderObject)); +- FinderType.tp_name = "vim.Finder"; +- FinderType.tp_basicsize = sizeof(FinderObject); +- FinderType.tp_base = (PyTypeObject *) path_finder; +- FinderType.tp_flags = Py_TPFLAGS_DEFAULT; +- FinderType.tp_doc = "Vim finder class, for use with path hook"; +- FinderType.tp_methods = FinderMethods; + + if (init_types()) + return NULL; +--- 1603,1612 ---- +*** ../vim-7.3.1173/src/if_python.c 2013-06-12 14:20:15.000000000 +0200 +--- src/if_python.c 2013-06-12 14:35:49.000000000 +0200 +*************** +*** 752,763 **** + static PyObject *ListGetattr(PyObject *, char *); + static PyObject *FunctionGetattr(PyObject *, char *); + +- static PyObject *FinderFindModule(PyObject *, PyObject *); +- static PyObject *VimPathHook(PyObject *, PyObject *); +- +- static PyObject *py_find_module; +- static PyObject *py_load_module; +- + #ifndef Py_VISIT + # define Py_VISIT(obj) visit(obj, arg) + #endif +--- 752,757 ---- +*************** +*** 1382,1585 **** + } + #endif + +- static void +- LoaderDestructor(LoaderObject *self) +- { +- Py_DECREF(self->module); +- DESTRUCTOR_FINISH(self); +- } +- +- static PyObject * +- LoaderLoadModule(LoaderObject *self, PyObject *args UNUSED) +- { +- PyObject *r = self->module; +- +- Py_INCREF(r); +- return r; +- } +- +- static struct PyMethodDef LoaderMethods[] = { +- /* name, function, calling, doc */ +- {"load_module", (PyCFunction)LoaderLoadModule, METH_VARARGS, ""}, +- { NULL, NULL, 0, NULL} +- }; +- +- static PyObject * +- call_load_module(char *name, int len, PyObject *find_module_result) +- { +- PyObject *fd, *pathname, *description; +- +- if (!PyTuple_Check(find_module_result) +- || PyTuple_GET_SIZE(find_module_result) != 3) +- { +- PyErr_SetString(PyExc_TypeError, +- _("expected 3-tuple as imp.find_module() result")); +- return NULL; +- } +- +- if (!(fd = PyTuple_GET_ITEM(find_module_result, 0)) +- || !(pathname = PyTuple_GET_ITEM(find_module_result, 1)) +- || !(description = PyTuple_GET_ITEM(find_module_result, 2))) +- { +- PyErr_SetString(PyExc_RuntimeError, +- _("internal error: imp.find_module returned tuple with NULL")); +- return NULL; +- } +- +- return PyObject_CallFunction(py_load_module, +- "s#OOO", name, len, fd, pathname, description); +- } +- +- static PyObject * +- find_module(char *fullname, char *tail, PyObject *new_path) +- { +- PyObject *find_module_result; +- PyObject *module; +- char *dot; +- +- if ((dot = (char *) vim_strchr((char_u *) tail, '.'))) +- { +- /* +- * There is a dot in the name: call find_module recursively without the +- * first component +- */ +- PyObject *newest_path; +- int partlen = (int) (dot - 1 - tail); +- +- if (!(find_module_result = PyObject_CallFunction(py_find_module, +- "s#O", tail, partlen, new_path))) +- return NULL; +- +- if (!(module = call_load_module( +- fullname, +- ((int) (tail - fullname)) + partlen, +- find_module_result))) +- { +- Py_DECREF(find_module_result); +- return NULL; +- } +- +- Py_DECREF(find_module_result); +- +- if (!(newest_path = PyObject_GetAttrString(module, "__path__"))) +- { +- Py_DECREF(module); +- return NULL; +- } +- +- Py_DECREF(module); +- +- module = find_module(fullname, dot + 1, newest_path); +- +- Py_DECREF(newest_path); +- +- return module; +- } +- else +- { +- if (!(find_module_result = PyObject_CallFunction(py_find_module, +- "sO", tail, new_path))) +- return NULL; +- +- if (!(module = call_load_module( +- fullname, +- STRLEN(fullname), +- find_module_result))) +- { +- Py_DECREF(find_module_result); +- return NULL; +- } +- +- Py_DECREF(find_module_result); +- +- return module; +- } +- } +- +- static PyObject * +- FinderFindModule(PyObject *self, PyObject *args) +- { +- char *fullname; +- PyObject *module; +- PyObject *new_path; +- LoaderObject *loader; +- +- if (!PyArg_ParseTuple(args, "s", &fullname)) +- return NULL; +- +- if (!(new_path = Vim_GetPaths(self))) +- return NULL; +- +- module = find_module(fullname, fullname, new_path); +- +- Py_DECREF(new_path); +- +- if (!module) +- { +- Py_INCREF(Py_None); +- return Py_None; +- } +- +- if (!(loader = PyObject_NEW(LoaderObject, &LoaderType))) +- { +- Py_DECREF(module); +- return NULL; +- } +- +- loader->module = module; +- +- return (PyObject *) loader; +- } +- +- static PyObject * +- VimPathHook(PyObject *self UNUSED, PyObject *args) +- { +- char *path; +- +- if (PyArg_ParseTuple(args, "s", &path) +- && STRCMP(path, vim_special_path) == 0) +- { +- Py_INCREF(vim_module); +- return vim_module; +- } +- +- PyErr_Clear(); +- PyErr_SetNone(PyExc_ImportError); +- return NULL; +- } +- + static int + PythonMod_Init(void) + { + /* The special value is removed from sys.path in Python_Init(). */ + static char *(argv[2]) = {"/must>not&exist/foo", NULL}; +- PyObject *imp; +- +- if (!(imp = PyImport_ImportModule("imp"))) +- return -1; +- +- if (!(py_find_module = PyObject_GetAttrString(imp, "find_module"))) +- { +- Py_DECREF(imp); +- return -1; +- } +- +- if (!(py_load_module = PyObject_GetAttrString(imp, "load_module"))) +- { +- Py_DECREF(py_find_module); +- Py_DECREF(imp); +- return -1; +- } +- +- Py_DECREF(imp); +- +- vim_memset(&LoaderType, 0, sizeof(LoaderType)); +- LoaderType.tp_name = "vim.Loader"; +- LoaderType.tp_basicsize = sizeof(LoaderObject); +- LoaderType.tp_flags = Py_TPFLAGS_DEFAULT; +- LoaderType.tp_doc = "vim message object"; +- LoaderType.tp_methods = LoaderMethods; +- LoaderType.tp_dealloc = (destructor)LoaderDestructor; + + if (init_types()) + return -1; +--- 1376,1386 ---- +*** ../vim-7.3.1173/src/version.c 2013-06-12 14:26:20.000000000 +0200 +--- src/version.c 2013-06-12 14:35:25.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1174, + /**/ + +-- +"Hit any key to continue" is very confusing when you have two keyboards. + + /// 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 /// diff --git a/7.3.1175 b/7.3.1175 new file mode 100644 index 0000000..37235f3 --- /dev/null +++ b/7.3.1175 @@ -0,0 +1,99 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1175 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1175 +Problem: Using isalpha() and isalnum() can be slow. +Solution: Use range checks. (Mike Williams) +Files: src/ex_docmd.c, src/macros.h + + +*** ../vim-7.3.1174/src/ex_docmd.c 2013-06-08 18:19:39.000000000 +0200 +--- src/ex_docmd.c 2013-06-12 16:50:50.000000000 +0200 +*************** +*** 3120,3126 **** + for (j = 0; p[j] != NUL; ++j) + if (p[j] != cmdmods[i].name[j]) + break; +! if (!isalpha(p[j]) && j >= cmdmods[i].minlen + && (p == cmd || cmdmods[i].has_count)) + return j + (int)(p - cmd); + } +--- 3120,3126 ---- + for (j = 0; p[j] != NUL; ++j) + if (p[j] != cmdmods[i].name[j]) + break; +! if (!ASCII_ISALPHA(p[j]) && j >= cmdmods[i].minlen + && (p == cmd || cmdmods[i].has_count)) + return j + (int)(p - cmd); + } +*** ../vim-7.3.1174/src/macros.h 2013-06-12 14:10:23.000000000 +0200 +--- src/macros.h 2013-06-12 17:07:32.000000000 +0200 +*************** +*** 99,104 **** +--- 99,109 ---- + # define MB_TOUPPER(c) TOUPPER_LOC(c) + #endif + ++ /* Use our own isdigit() replacement, because on MS-Windows isdigit() returns ++ * non-zero for superscript 1. Also avoids that isdigit() crashes for numbers ++ * below 0 and above 255. */ ++ #define VIM_ISDIGIT(c) ((unsigned)(c) - '0' < 10) ++ + /* Like isalpha() but reject non-ASCII characters. Can't be used with a + * special key (negative value). */ + #ifdef EBCDIC +*************** +*** 107,123 **** + # define ASCII_ISLOWER(c) islower(c) + # define ASCII_ISUPPER(c) isupper(c) + #else +- # define ASCII_ISALPHA(c) ((c) < 0x7f && isalpha(c)) +- # define ASCII_ISALNUM(c) ((c) < 0x7f && isalnum(c)) + # define ASCII_ISLOWER(c) ((unsigned)(c) - 'a' < 26) + # define ASCII_ISUPPER(c) ((unsigned)(c) - 'A' < 26) + #endif + +- /* Use our own isdigit() replacement, because on MS-Windows isdigit() returns +- * non-zero for superscript 1. Also avoids that isdigit() crashes for numbers +- * below 0 and above 255. */ +- #define VIM_ISDIGIT(c) ((unsigned)(c) - '0' < 10) +- + /* macro version of chartab(). + * Only works with values 0-255! + * Doesn't work for UTF-8 mode with chars >= 0x80. */ +--- 112,123 ---- + # define ASCII_ISLOWER(c) islower(c) + # define ASCII_ISUPPER(c) isupper(c) + #else + # define ASCII_ISLOWER(c) ((unsigned)(c) - 'a' < 26) + # define ASCII_ISUPPER(c) ((unsigned)(c) - 'A' < 26) ++ # define ASCII_ISALPHA(c) (ASCII_ISUPPER(c) || ASCII_ISLOWER(c)) ++ # define ASCII_ISALNUM(c) (ASCII_ISALPHA(c) || VIM_ISDIGIT(c)) + #endif + + /* macro version of chartab(). + * Only works with values 0-255! + * Doesn't work for UTF-8 mode with chars >= 0x80. */ +*** ../vim-7.3.1174/src/version.c 2013-06-12 14:40:58.000000000 +0200 +--- src/version.c 2013-06-12 17:05:51.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1175, + /**/ + +-- +"Hit any key to continue" is a lie. + + /// 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 /// diff --git a/7.3.1176 b/7.3.1176 new file mode 100644 index 0000000..1e2cd6b --- /dev/null +++ b/7.3.1176 @@ -0,0 +1,89 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1176 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1176 +Problem: Compiler warnings on 64 bit system. +Solution: Add type casts. (Mike Williams) +Files: src/eval.c, src/if_py_both.h + + +*** ../vim-7.3.1175/src/eval.c 2013-06-12 13:37:36.000000000 +0200 +--- src/eval.c 2013-06-12 18:06:33.000000000 +0200 +*************** +*** 10980,10986 **** + * also work, but some plugins depend on the name being printable + * text. */ + sprintf(sid_buf, "%ld_", (long)current_SID); +! rettv->vval.v_string = alloc(STRLEN(sid_buf) + STRLEN(s + 2) + 1); + if (rettv->vval.v_string != NULL) + { + STRCPY(rettv->vval.v_string, sid_buf); +--- 10980,10987 ---- + * also work, but some plugins depend on the name being printable + * text. */ + sprintf(sid_buf, "%ld_", (long)current_SID); +! rettv->vval.v_string = +! alloc((int)(STRLEN(sid_buf) + STRLEN(s + 2) + 1)); + if (rettv->vval.v_string != NULL) + { + STRCPY(rettv->vval.v_string, sid_buf); +*** ../vim-7.3.1175/src/if_py_both.h 2013-06-12 14:40:58.000000000 +0200 +--- src/if_py_both.h 2013-06-12 18:10:27.000000000 +0200 +*************** +*** 992,998 **** + if ((dot = (char *) vim_strchr((char_u *) tail, '.'))) + { + /* +! * There is a dot in the name: call find_module recursively without the + * first component + */ + PyObject *newest_path; +--- 992,998 ---- + if ((dot = (char *) vim_strchr((char_u *) tail, '.'))) + { + /* +! * There is a dot in the name: call find_module recursively without the + * first component + */ + PyObject *newest_path; +*************** +*** 1035,1041 **** + + if (!(module = call_load_module( + fullname, +! STRLEN(fullname), + find_module_result))) + { + Py_DECREF(find_module_result); +--- 1035,1041 ---- + + if (!(module = call_load_module( + fullname, +! (int)STRLEN(fullname), + find_module_result))) + { + Py_DECREF(find_module_result); +*** ../vim-7.3.1175/src/version.c 2013-06-12 17:12:19.000000000 +0200 +--- src/version.c 2013-06-12 18:07:10.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1176, + /**/ + +-- +Living in Hollywood is like living in a bowl of granola. What ain't +fruits and nuts is flakes. + + /// 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 /// diff --git a/7.3.1177 b/7.3.1177 new file mode 100644 index 0000000..4309078 --- /dev/null +++ b/7.3.1177 @@ -0,0 +1,99 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1177 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1177 +Problem: Wasting memory on padding. +Solution: Reorder struct fields. (Dominique Pelle) +Files: src/structs.h, src/fileio.c + + +*** ../vim-7.3.1176/src/structs.h 2013-06-06 14:55:16.000000000 +0200 +--- src/structs.h 2013-06-12 19:21:02.000000000 +0200 +*************** +*** 1180,1191 **** + */ + struct dictvar_S + { + int dv_refcount; /* reference count */ +- hashtab_T dv_hashtab; /* hashtab that refers to the items */ + int dv_copyID; /* ID used by deepcopy() */ + dict_T *dv_copydict; /* copied dict used by deepcopy() */ +- char dv_lock; /* zero, VAR_LOCKED, VAR_FIXED */ +- char dv_scope; /* zero, VAR_SCOPE, VAR_DEF_SCOPE */ + dict_T *dv_used_next; /* next dict in used dicts list */ + dict_T *dv_used_prev; /* previous dict in used dicts list */ + }; +--- 1180,1191 ---- + */ + struct dictvar_S + { ++ char dv_lock; /* zero, VAR_LOCKED, VAR_FIXED */ ++ char dv_scope; /* zero, VAR_SCOPE, VAR_DEF_SCOPE */ + int dv_refcount; /* reference count */ + int dv_copyID; /* ID used by deepcopy() */ ++ hashtab_T dv_hashtab; /* hashtab that refers to the items */ + dict_T *dv_copydict; /* copied dict used by deepcopy() */ + dict_T *dv_used_next; /* next dict in used dicts list */ + dict_T *dv_used_prev; /* previous dict in used dicts list */ + }; +*** ../vim-7.3.1176/src/fileio.c 2013-06-08 18:19:39.000000000 +0200 +--- src/fileio.c 2013-06-12 19:23:35.000000000 +0200 +*************** +*** 7614,7629 **** + + typedef struct AutoPat + { +- int group; /* group ID */ + char_u *pat; /* pattern as typed (NULL when pattern + has been removed) */ +- int patlen; /* strlen() of pat */ + regprog_T *reg_prog; /* compiled regprog for pattern */ +- char allow_dirs; /* Pattern may match whole path */ +- char last; /* last pattern for apply_autocmds() */ + AutoCmd *cmds; /* list of commands to do */ + struct AutoPat *next; /* next AutoPat in AutoPat list */ + int buflocal_nr; /* !=0 for buffer-local AutoPat */ + } AutoPat; + + static struct event_name +--- 7614,7629 ---- + + typedef struct AutoPat + { + char_u *pat; /* pattern as typed (NULL when pattern + has been removed) */ + regprog_T *reg_prog; /* compiled regprog for pattern */ + AutoCmd *cmds; /* list of commands to do */ + struct AutoPat *next; /* next AutoPat in AutoPat list */ ++ int group; /* group ID */ ++ int patlen; /* strlen() of pat */ + int buflocal_nr; /* !=0 for buffer-local AutoPat */ ++ char allow_dirs; /* Pattern may match whole path */ ++ char last; /* last pattern for apply_autocmds() */ + } AutoPat; + + static struct event_name +*** ../vim-7.3.1176/src/version.c 2013-06-12 18:13:31.000000000 +0200 +--- src/version.c 2013-06-12 19:20:19.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1177, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +174. You know what a listserv is. + + /// 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 /// diff --git a/7.3.1178 b/7.3.1178 new file mode 100644 index 0000000..d6f1586 --- /dev/null +++ b/7.3.1178 @@ -0,0 +1,378 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1178 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1178 +Problem: Can't put all Vim config files together in one directory. +Solution: Load ~/.vim/vimrc if ~/.vimrc does not exist. (Lech Lorens) +Files: runtime/doc/gui.txt, runtime/doc/starting.txt, src/gui.c, + src/main.c, src/os_amiga.h, src/os_dos.h, src/os_unix.h + + +*** ../vim-7.3.1177/runtime/doc/gui.txt 2010-08-15 21:57:17.000000000 +0200 +--- runtime/doc/gui.txt 2013-06-12 20:11:13.000000000 +0200 +*************** +*** 93,102 **** + terminal version. + + Recommended place for your personal GUI initializations: +! Unix $HOME/.gvimrc +! OS/2 $HOME/.gvimrc or $VIM/.gvimrc +! MS-DOS and Win32 $HOME/_gvimrc or $VIM/_gvimrc +! Amiga s:.gvimrc or $VIM/.gvimrc + + There are a number of options which only have meaning in the GUI version of + Vim. These are 'guicursor', 'guifont', 'guipty' and 'guioptions'. They are +--- 93,108 ---- + terminal version. + + Recommended place for your personal GUI initializations: +! Unix $HOME/.gvimrc or $HOME/.vim/gvimrc +! OS/2 $HOME/.gvimrc, $HOME/vimfiles/gvimrc +! or $VIM/.gvimrc +! MS-DOS and Win32 $HOME/_gvimrc, $HOME/vimfiles/gvimrc +! or $VIM/_gvimrc +! Amiga s:.gvimrc, home:.gvimrc, home:vimfiles:gvimrc +! or $VIM/.gvimrc +! +! The personal initialization files are searched in the order specified above +! and only the first one that is found is read. + + There are a number of options which only have meaning in the GUI version of + Vim. These are 'guicursor', 'guifont', 'guipty' and 'guioptions'. They are +*** ../vim-7.3.1177/runtime/doc/starting.txt 2010-08-15 21:57:15.000000000 +0200 +--- runtime/doc/starting.txt 2013-06-12 20:31:45.000000000 +0200 +*************** +*** 95,108 **** + (normally not installed) + view vim -R Start in read-only mode (see |-R|). *view* + gvim vim -g Start the GUI (see |gui|). *gvim* +! gex vim -eg Start the GUI in Ex mode. *gex* +! gview vim -Rg Start the GUI in read-only mode. *gview* + rvim vim -Z Like "vim", but in restricted mode (see |-Z|) *rvim* +! rview vim -RZ Like "view", but in restricted mode. *rview* +! rgvim vim -gZ Like "gvim", but in restricted mode. *rgvim* +! rgview vim -RgZ Like "gview", but in restricted mode. *rgview* + evim vim -y Easy Vim: set 'insertmode' (see |-y|) *evim* +! eview vim -yR Like "evim" in read-only mode *eview* + vimdiff vim -d Start in diff mode |diff-mode| + gvimdiff vim -gd Start in diff mode |diff-mode| + +--- 95,108 ---- + (normally not installed) + view vim -R Start in read-only mode (see |-R|). *view* + gvim vim -g Start the GUI (see |gui|). *gvim* +! gex vim -eg Start the GUI in Ex mode. *gex* +! gview vim -Rg Start the GUI in read-only mode. *gview* + rvim vim -Z Like "vim", but in restricted mode (see |-Z|) *rvim* +! rview vim -RZ Like "view", but in restricted mode. *rview* +! rgvim vim -gZ Like "gvim", but in restricted mode. *rgvim* +! rgview vim -RgZ Like "gview", but in restricted mode. *rgview* + evim vim -y Easy Vim: set 'insertmode' (see |-y|) *evim* +! eview vim -yR Like "evim" in read-only mode *eview* + vimdiff vim -d Start in diff mode |diff-mode| + gvimdiff vim -gd Start in diff mode |diff-mode| + +*************** +*** 751,761 **** + file, but "exrc" is what Vi always used, "vimrc" is a Vim specific + name. Also see |vimrc-intro|. + +! Recommended place for your personal initializations: +! Unix $HOME/.vimrc +! OS/2 $HOME/.vimrc or $VIM/.vimrc (or _vimrc) +! MS-DOS and Win32 $HOME/_vimrc or $VIM/_vimrc +! Amiga s:.vimrc or $VIM/.vimrc + + If Vim was started with "-u filename", the file "filename" is used. + All following initializations until 4. are skipped. +--- 757,777 ---- + file, but "exrc" is what Vi always used, "vimrc" is a Vim specific + name. Also see |vimrc-intro|. + +! Places for your personal initializations: +! Unix $HOME/.vimrc or $HOME/.vim/vimrc +! OS/2 $HOME/.vimrc, $HOME/vimfiles/vimrc +! or $VIM/.vimrc (or _vimrc) +! MS-Windows $HOME/_vimrc, $HOME/vimfiles/vimrc +! or $VIM/_vimrc +! Amiga s:.vimrc, home:.vimrc, home:vimfiles:vimrc +! or $VIM/.vimrc +! +! The files are searched in the order specified above and only the first +! one that is found is read. +! +! RECOMMENDATION: Put all your Vim configuration stuff in the +! $HOME/.vim/ directory ($HOME/vimfiles/ for MS-Windows). That makes it +! easy to copy it to another system. + + If Vim was started with "-u filename", the file "filename" is used. + All following initializations until 4. are skipped. +*************** +*** 785,796 **** + - The environment variable VIMINIT (see also |compatible-default|) (*) + The value of $VIMINIT is used as an Ex command line. + - The user vimrc file(s): +! "$HOME/.vimrc" (for Unix and OS/2) (*) +! "s:.vimrc" (for Amiga) (*) +! "home:.vimrc" (for Amiga) (*) +! "$VIM/.vimrc" (for OS/2 and Amiga) (*) +! "$HOME/_vimrc" (for MS-DOS and Win32) (*) +! "$VIM/_vimrc" (for MS-DOS and Win32) (*) + Note: For Unix, OS/2 and Amiga, when ".vimrc" does not exist, + "_vimrc" is also tried, in case an MS-DOS compatible file + system is used. For MS-DOS and Win32 ".vimrc" is checked +--- 801,815 ---- + - The environment variable VIMINIT (see also |compatible-default|) (*) + The value of $VIMINIT is used as an Ex command line. + - The user vimrc file(s): +! "$HOME/.vimrc" (for Unix and OS/2) (*) +! "$HOME/.vim/vimrc" (for Unix and OS/2) (*) +! "s:.vimrc" (for Amiga) (*) +! "home:.vimrc" (for Amiga) (*) +! "home:vimfiles:vimrc" (for Amiga) (*) +! "$VIM/.vimrc" (for OS/2 and Amiga) (*) +! "$HOME/_vimrc" (for MS-DOS and Win32) (*) +! "$HOME/vimfiles/vimrc" (for MS-DOS and Win32) (*) +! "$VIM/_vimrc" (for MS-DOS and Win32) (*) + Note: For Unix, OS/2 and Amiga, when ".vimrc" does not exist, + "_vimrc" is also tried, in case an MS-DOS compatible file + system is used. For MS-DOS and Win32 ".vimrc" is checked +*** ../vim-7.3.1177/src/gui.c 2013-06-08 18:19:40.000000000 +0200 +--- src/gui.c 2013-06-12 20:09:44.000000000 +0200 +*************** +*** 547,556 **** + && do_source((char_u *)USR_GVIMRC_FILE2, TRUE, + DOSO_GVIMRC) == FAIL + #endif + ) + { +! #ifdef USR_GVIMRC_FILE3 +! (void)do_source((char_u *)USR_GVIMRC_FILE3, TRUE, DOSO_GVIMRC); + #endif + } + +--- 547,560 ---- + && do_source((char_u *)USR_GVIMRC_FILE2, TRUE, + DOSO_GVIMRC) == FAIL + #endif ++ #ifdef USR_GVIMRC_FILE3 ++ && do_source((char_u *)USR_GVIMRC_FILE3, TRUE, ++ DOSO_GVIMRC) == FAIL ++ #endif + ) + { +! #ifdef USR_GVIMRC_FILE4 +! (void)do_source((char_u *)USR_GVIMRC_FILE4, TRUE, DOSO_GVIMRC); + #endif + } + +*************** +*** 593,598 **** +--- 597,606 ---- + && fullpathcmp((char_u *)USR_GVIMRC_FILE3, + (char_u *)GVIMRC_FILE, FALSE) != FPC_SAME + #endif ++ #ifdef USR_GVIMRC_FILE4 ++ && fullpathcmp((char_u *)USR_GVIMRC_FILE4, ++ (char_u *)GVIMRC_FILE, FALSE) != FPC_SAME ++ #endif + ) + do_source((char_u *)GVIMRC_FILE, TRUE, DOSO_GVIMRC); + +*** ../vim-7.3.1177/src/main.c 2013-05-11 13:56:12.000000000 +0200 +--- src/main.c 2013-06-12 20:09:44.000000000 +0200 +*************** +*** 2981,2986 **** +--- 2981,2990 ---- + && do_source((char_u *)USR_VIMRC_FILE3, TRUE, + DOSO_VIMRC) == FAIL + #endif ++ #ifdef USR_VIMRC_FILE4 ++ && do_source((char_u *)USR_VIMRC_FILE4, TRUE, ++ DOSO_VIMRC) == FAIL ++ #endif + && process_env((char_u *)"EXINIT", FALSE) == FAIL + && do_source((char_u *)USR_EXRC_FILE, FALSE, DOSO_NONE) == FAIL) + { +*** ../vim-7.3.1177/src/os_amiga.h 2012-11-20 16:53:34.000000000 +0100 +--- src/os_amiga.h 2013-06-12 20:09:44.000000000 +0200 +*************** +*** 158,164 **** + # define USR_VIMRC_FILE2 "home:.vimrc" + #endif + #ifndef USR_VIMRC_FILE3 +! # define USR_VIMRC_FILE3 "$VIM/.vimrc" + #endif + #ifndef EVIM_FILE + # define EVIM_FILE "$VIMRUNTIME/evim.vim" +--- 158,167 ---- + # define USR_VIMRC_FILE2 "home:.vimrc" + #endif + #ifndef USR_VIMRC_FILE3 +! # define USR_VIMRC_FILE3 "home:vimfiles:vimrc" +! #endif +! #ifndef USR_VIMRC_FILE4 +! # define USR_VIMRC_FILE4 "$VIM/.vimrc" + #endif + #ifndef EVIM_FILE + # define EVIM_FILE "$VIMRUNTIME/evim.vim" +*************** +*** 171,177 **** + # define USR_GVIMRC_FILE2 "home:.gvimrc" + #endif + #ifndef USR_GVIMRC_FILE3 +! # define USR_GVIMRC_FILE3 "$VIM/.gvimrc" + #endif + + #ifdef FEAT_VIMINFO +--- 174,183 ---- + # define USR_GVIMRC_FILE2 "home:.gvimrc" + #endif + #ifndef USR_GVIMRC_FILE3 +! # define USR_GVIMRC_FILE3 "home:vimfiles:gvimrc" +! #endif +! #ifndef USR_GVIMRC_FILE4 +! # define USR_GVIMRC_FILE4 "$VIM/.gvimrc" + #endif + + #ifdef FEAT_VIMINFO +*** ../vim-7.3.1177/src/os_dos.h 2010-08-15 21:57:27.000000000 +0200 +--- src/os_dos.h 2013-06-12 20:09:44.000000000 +0200 +*************** +*** 20,26 **** + # define USR_VIMRC_FILE "$HOME\\_vimrc" + #endif + #ifndef USR_VIMRC_FILE2 +! # define USR_VIMRC_FILE2 "$VIM\\_vimrc" + #endif + #ifndef EVIM_FILE + # define EVIM_FILE "$VIMRUNTIME\\evim.vim" +--- 20,29 ---- + # define USR_VIMRC_FILE "$HOME\\_vimrc" + #endif + #ifndef USR_VIMRC_FILE2 +! # define USR_VIMRC_FILE2 "$HOME\\vimfiles\\vimrc" +! #endif +! #ifndef USR_VIMRC_FILE3 +! # define USR_VIMRC_FILE3 "$VIM\\_vimrc" + #endif + #ifndef EVIM_FILE + # define EVIM_FILE "$VIMRUNTIME\\evim.vim" +*************** +*** 41,47 **** + # define USR_GVIMRC_FILE "$HOME\\_gvimrc" + # endif + # ifndef USR_GVIMRC_FILE2 +! # define USR_GVIMRC_FILE2 "$VIM\\_gvimrc" + # endif + # ifndef SYS_MENU_FILE + # define SYS_MENU_FILE "$VIMRUNTIME\\menu.vim" +--- 44,53 ---- + # define USR_GVIMRC_FILE "$HOME\\_gvimrc" + # endif + # ifndef USR_GVIMRC_FILE2 +! # define USR_GVIMRC_FILE2 "$HOME\\vimfiles\\gvimrc" +! # endif +! # ifndef USR_GVIMRC_FILE3 +! # define USR_GVIMRC_FILE3 "$VIM\\_gvimrc" + # endif + # ifndef SYS_MENU_FILE + # define SYS_MENU_FILE "$VIMRUNTIME\\menu.vim" +*** ../vim-7.3.1177/src/os_unix.h 2012-11-20 16:53:34.000000000 +0100 +--- src/os_unix.h 2013-06-12 20:09:44.000000000 +0200 +*************** +*** 294,304 **** + # endif + #endif + +! #if !defined(USR_VIMRC_FILE2) && defined(OS2) +! # define USR_VIMRC_FILE2 "$VIM/.vimrc" + #endif +! #if !defined(USR_VIMRC_FILE2) && defined(VMS) +! # define USR_VIMRC_FILE2 "sys$login:_vimrc" + #endif + + #ifndef USR_GVIMRC_FILE +--- 294,317 ---- + # endif + #endif + +! +! #if !defined(USR_EXRC_FILE2) +! # ifdef OS2 +! # define USR_VIMRC_FILE2 "$HOME/vimfiles/vimrc" +! # else +! # ifdef VMS +! # define USR_VIMRC_FILE2 "sys$login:vimfiles:vimrc" +! # else +! # define USR_VIMRC_FILE2 "~/.vim/vimrc" +! # endif +! # endif +! #endif +! +! #if !defined(USR_VIMRC_FILE3) && defined(OS2) +! # define USR_VIMRC_FILE3 "$VIM/.vimrc" + #endif +! #if !defined(USR_VIMRC_FILE3) && defined(VMS) +! # define USR_VIMRC_FILE3 "sys$login:_vimrc" + #endif + + #ifndef USR_GVIMRC_FILE +*************** +*** 309,317 **** + # endif + #endif + + #ifdef VMS +! # ifndef USR_GVIMRC_FILE2 +! # define USR_GVIMRC_FILE2 "sys$login:_gvimrc" + # endif + #endif + +--- 322,342 ---- + # endif + #endif + ++ #ifndef USR_GVIMRC_FILE2 ++ # ifdef OS2 ++ # define USR_GVIMRC_FILE2 "$HOME/vimfiles/gvimrc" ++ # else ++ # ifdef VMS ++ # define USR_GVIMRC_FILE2 "sys$login:vimfiles:gvimrc" ++ # else ++ # define USR_GVIMRC_FILE2 "~/.vim/gvimrc" ++ # endif ++ # endif ++ #endif ++ + #ifdef VMS +! # ifndef USR_GVIMRC_FILE3 +! # define USR_GVIMRC_FILE3 "sys$login:_gvimrc" + # endif + #endif + +*** ../vim-7.3.1177/src/version.c 2013-06-12 19:52:11.000000000 +0200 +--- src/version.c 2013-06-12 20:34:25.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1178, + /**/ + +-- +If Microsoft would build a car... +... the oil, water temperature, and alternator warning lights would +all be replaced by a single "General Protection Fault" warning light. + + /// 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 /// diff --git a/7.3.1179 b/7.3.1179 new file mode 100644 index 0000000..e553011 --- /dev/null +++ b/7.3.1179 @@ -0,0 +1,122 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1179 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1179 +Problem: When a global mapping starts with the same characters as a + buffer-local mapping Vim waits for a character to be typed to find + out whether the global mapping is to be used. (Andy Wokula) +Solution: Use the local mapping without waiting. (Michael Henry) +Files: runtime/doc/map.txt, src/getchar.c + + +*** ../vim-7.3.1178/runtime/doc/map.txt 2013-06-08 15:24:41.000000000 +0200 +--- runtime/doc/map.txt 2013-06-12 20:50:01.000000000 +0200 +*************** +*** 107,112 **** +--- 107,114 ---- + :cmapc[lear] |mapmode-c| *:cmapc* *:cmapclear* + Remove ALL mappings for the modes where the map + command applies. {not in Vi} ++ Use the argument to remove buffer-local ++ mappings |:map-| + Warning: This also removes the default mappings. + + :map |mapmode-nvo| +*************** +*** 173,178 **** +--- 175,181 ---- + :mapclear + Local mappings are also cleared when a buffer is deleted, but not when it is + unloaded. Just like local option values. ++ Also see |map-precedence|. + + *:map-* *:map-silent* + To define a mapping which will not be echoed on the command line, add +*************** +*** 644,649 **** +--- 655,672 ---- + you type slowly, or your system is slow, reset the 'timeout' option. Then you + might want to set the 'ttimeout' option. + ++ *map-precedence* ++ Buffer-local mappings (defined using |:map-|) take precedence over ++ global mappings. When a buffer-local mapping is the same as a global mapping, ++ Vim will use the buffer-local mapping. In addition, Vim will use a complete ++ buffer-local mapping immediately, even if a longer global mapping has the ++ buffer-local mapping as a prefix. For example, given the following two ++ mappings: > ++ :map \a :echo "Local \a" ++ :map \abc :echo "Global \abc" ++ The buffer-local mapping \a will be used immediately. Vim will not wait for ++ more characters to see if the user might be typing \abc. ++ + *map-keys-fails* + There are situations where key codes might not be recognized: + - Vim can only read part of the key code. Mostly this is only the first +*** ../vim-7.3.1178/src/getchar.c 2013-05-06 05:50:22.000000000 +0200 +--- src/getchar.c 2013-06-12 20:52:49.000000000 +0200 +*************** +*** 1924,1929 **** +--- 1924,1930 ---- + mapblock_T *mp; + #ifdef FEAT_LOCALMAP + mapblock_T *mp2; ++ int expecting_global_mappings; + #endif + mapblock_T *mp_match; + int mp_match_len = 0; +*************** +*** 2105,2110 **** +--- 2106,2112 ---- + /* First try buffer-local mappings. */ + mp = curbuf->b_maphash[MAP_HASH(local_State, c1)]; + mp2 = maphash[MAP_HASH(local_State, c1)]; ++ expecting_global_mappings = (mp && mp2); + if (mp == NULL) + { + mp = mp2; +*************** +*** 2128,2133 **** +--- 2130,2145 ---- + #endif + (mp = mp->m_next)) + { ++ #ifdef FEAT_LOCALMAP ++ if (expecting_global_mappings && mp2 == NULL) ++ { ++ /* This is the first global mapping. If we've ++ * got a complete buffer-local match, use it. */ ++ if (mp_match) ++ break; ++ expecting_global_mappings = FALSE; ++ } ++ #endif + /* + * Only consider an entry if the first character + * matches and it is for the current state. +*** ../vim-7.3.1178/src/version.c 2013-06-12 20:35:46.000000000 +0200 +--- src/version.c 2013-06-12 20:56:36.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1179, + /**/ + +-- +If Apple would build a car... +... it would be powered by the sun, be reliable, five times +as fast and twice as easy to drive; but would only run on +five percent of the roads. + + /// 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 /// diff --git a/7.3.1180 b/7.3.1180 new file mode 100644 index 0000000..715ad0a --- /dev/null +++ b/7.3.1180 @@ -0,0 +1,68 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1180 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1180 +Problem: When current directory changes, path from cscope may no longer be + valid. (AS Budden) +Solution: Always store the absolute path. (Christian Brabandt) +Files: src/if_cscope.c + + +*** ../vim-7.3.1179/src/if_cscope.c 2013-05-29 19:17:55.000000000 +0200 +--- src/if_cscope.c 2013-06-12 21:15:37.000000000 +0200 +*************** +*** 539,550 **** +--- 539,565 ---- + char *fname2 = NULL; + char *ppath = NULL; + int i; ++ #ifdef FEAT_MODIFY_FNAME ++ int len; ++ int usedlen = 0; ++ char_u *fbuf = NULL; ++ #endif + + /* get the filename (arg1), expand it, and try to stat it */ + if ((fname = (char *)alloc(MAXPATHL + 1)) == NULL) + goto add_err; + + expand_env((char_u *)arg1, (char_u *)fname, MAXPATHL); ++ #ifdef FEAT_MODIFY_FNAME ++ len = (int)STRLEN(fname); ++ fbuf = (char_u *)fname; ++ (void)modify_fname((char_u *)":p", &usedlen, ++ (char_u **)&fname, &fbuf, &len); ++ if (fname == NULL) ++ goto add_err; ++ fname = (char *)vim_strnsave((char_u *)fname, len); ++ vim_free(fbuf); ++ #endif + ret = stat(fname, &statbuf); + if (ret < 0) + { +*** ../vim-7.3.1179/src/version.c 2013-06-12 21:00:18.000000000 +0200 +--- src/version.c 2013-06-12 21:05:27.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1180, + /**/ + +-- +If Microsoft would build a car... +... Occasionally, executing a maneuver such as a left turn +would cause your car to shut down and refuse to restart, in +which case you would have to reinstall the engine. + + /// 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 /// diff --git a/7.3.1181 b/7.3.1181 new file mode 100644 index 0000000..4ee8615 --- /dev/null +++ b/7.3.1181 @@ -0,0 +1,100 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1181 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1181 +Problem: Wrong error message for 1.0[0]. +Solution: Check for funcref and float separately. (Yasuhiro Matsumoto) +Files: src/eval.c + + +*** ../vim-7.3.1180/src/eval.c 2013-06-12 18:13:31.000000000 +0200 +--- src/eval.c 2013-06-12 22:06:30.000000000 +0200 +*************** +*** 112,117 **** +--- 112,118 ---- + static char *e_letwrong = N_("E734: Wrong variable type for %s="); + static char *e_nofunc = N_("E130: Unknown function: %s"); + static char *e_illvar = N_("E461: Illegal variable name: %s"); ++ static char *e_float_as_string = N_("E806: using Float as a String"); + + static dictitem_T globvars_var; /* variable used for g: */ + #define globvarht globvardict.dv_hashtab +*************** +*** 5268,5283 **** + char_u *s; + char_u *key = NULL; + +! if (rettv->v_type == VAR_FUNC +! #ifdef FEAT_FLOAT +! || rettv->v_type == VAR_FLOAT +! #endif +! ) + { + if (verbose) + EMSG(_("E695: Cannot index a Funcref")); + return FAIL; + } + + if (**arg == '.') + { +--- 5269,5288 ---- + char_u *s; + char_u *key = NULL; + +! if (rettv->v_type == VAR_FUNC) + { + if (verbose) + EMSG(_("E695: Cannot index a Funcref")); + return FAIL; + } ++ #ifdef FEAT_FLOAT ++ else if (rettv->v_type == VAR_FLOAT) ++ { ++ if (verbose) ++ EMSG(_(e_float_as_string)); ++ return FAIL; ++ } ++ #endif + + if (**arg == '.') + { +*************** +*** 20085,20091 **** + break; + #ifdef FEAT_FLOAT + case VAR_FLOAT: +! EMSG(_("E806: using Float as a String")); + break; + #endif + case VAR_STRING: +--- 20090,20096 ---- + break; + #ifdef FEAT_FLOAT + case VAR_FLOAT: +! EMSG(_(e_float_as_string)); + break; + #endif + case VAR_STRING: +*** ../vim-7.3.1180/src/version.c 2013-06-12 21:25:04.000000000 +0200 +--- src/version.c 2013-06-12 22:08:02.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1181, + /**/ + +-- +The CIA drives around in cars with the "Intel inside" logo. + + /// 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 /// diff --git a/7.3.1182 b/7.3.1182 new file mode 100644 index 0000000..eb3a298 --- /dev/null +++ b/7.3.1182 @@ -0,0 +1,588 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1182 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1182 +Problem: 'backupcopy' default on MS-Windows does not work for hard and soft + links. +Solution: Check for links. (David Pope, Ken Takata) +Files: src/fileio.c, src/os_win32.c, src/proto/os_win32.pro + + +*** ../vim-7.3.1181/src/fileio.c 2013-06-12 19:52:11.000000000 +0200 +--- src/fileio.c 2013-06-12 22:31:34.000000000 +0200 +*************** +*** 3780,3791 **** + } + } + +- # ifdef UNIX + /* + * Break symlinks and/or hardlinks if we've been asked to. + */ + if ((bkc_flags & BKC_BREAKSYMLINK) || (bkc_flags & BKC_BREAKHARDLINK)) + { + int lstat_res; + + lstat_res = mch_lstat((char *)fname, &st); +--- 3780,3791 ---- + } + } + + /* + * Break symlinks and/or hardlinks if we've been asked to. + */ + if ((bkc_flags & BKC_BREAKSYMLINK) || (bkc_flags & BKC_BREAKHARDLINK)) + { ++ # ifdef UNIX + int lstat_res; + + lstat_res = mch_lstat((char *)fname, &st); +*************** +*** 3801,3808 **** + && st_old.st_nlink > 1 + && (lstat_res != 0 || st.st_ino == st_old.st_ino)) + backup_copy = FALSE; + } +- #endif + + #endif + +--- 3801,3818 ---- + && st_old.st_nlink > 1 + && (lstat_res != 0 || st.st_ino == st_old.st_ino)) + backup_copy = FALSE; ++ # else ++ # if defined(WIN32) ++ /* Symlinks. */ ++ if ((bkc_flags & BKC_BREAKSYMLINK) && mch_is_symbolic_link(fname)) ++ backup_copy = FALSE; ++ ++ /* Hardlinks. */ ++ if ((bkc_flags & BKC_BREAKHARDLINK) && mch_is_hard_link(fname)) ++ backup_copy = FALSE; ++ # endif ++ # endif + } + + #endif + +*** ../vim-7.3.1181/src/os_win32.c 2013-06-07 19:17:12.000000000 +0200 +--- src/os_win32.c 2013-06-12 22:39:53.000000000 +0200 +*************** +*** 78,83 **** +--- 78,93 ---- + # endif + #endif + ++ /* ++ * Reparse Point ++ */ ++ #ifndef FILE_ATTRIBUTE_REPARSE_POINT ++ # define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400 ++ #endif ++ #ifndef IO_REPARSE_TAG_SYMLINK ++ # define IO_REPARSE_TAG_SYMLINK 0xA000000C ++ #endif ++ + /* Record all output and all keyboard & mouse input */ + /* #define MCH_WRITE_DUMP */ + +*************** +*** 219,224 **** +--- 229,238 ---- + static char *vimrun_path = "vimrun "; + #endif + ++ static int win32_getattrs(char_u *name); ++ static int win32_setattrs(char_u *name, int attrs); ++ static int win32_set_archive(char_u *name); ++ + #ifndef FEAT_GUI_W32 + static int suppress_winsize = 1; /* don't fiddle with console */ + #endif +*************** +*** 2623,2679 **** + /* + * get file permissions for `name' + * -1 : error +! * else FILE_ATTRIBUTE_* defined in winnt.h + */ + long + mch_getperm(char_u *name) + { +! #ifdef FEAT_MBYTE +! if (enc_codepage >= 0 && (int)GetACP() != enc_codepage) +! { +! WCHAR *p = enc_to_utf16(name, NULL); +! long n; + +! if (p != NULL) +! { +! n = (long)GetFileAttributesW(p); +! vim_free(p); +! if (n >= 0 || GetLastError() != ERROR_CALL_NOT_IMPLEMENTED) +! return n; +! /* Retry with non-wide function (for Windows 98). */ +! } +! } +! #endif +! return (long)GetFileAttributes((char *)name); + } + + + /* + * set file permission for `name' to `perm' + */ + int + mch_setperm( + char_u *name, + long perm) + { +! perm |= FILE_ATTRIBUTE_ARCHIVE; /* file has changed, set archive bit */ + #ifdef FEAT_MBYTE + if (enc_codepage >= 0 && (int)GetACP() != enc_codepage) + { +! WCHAR *p = enc_to_utf16(name, NULL); +! long n; + + if (p != NULL) + { +! n = (long)SetFileAttributesW(p, perm); + vim_free(p); +! if (n || GetLastError() != ERROR_CALL_NOT_IMPLEMENTED) +! return n ? OK : FAIL; + /* Retry with non-wide function (for Windows 98). */ + } + } + #endif +! return SetFileAttributes((char *)name, perm) ? OK : FAIL; + } + + /* +--- 2637,2690 ---- + /* + * get file permissions for `name' + * -1 : error +! * else mode_t + */ + long + mch_getperm(char_u *name) + { +! struct stat st; +! int n; + +! n = mch_stat(name, &st); +! return n == 0 ? (int)st.st_mode : -1; + } + + + /* + * set file permission for `name' to `perm' ++ * ++ * return FAIL for failure, OK otherwise + */ + int + mch_setperm( + char_u *name, + long perm) + { +! long n; + #ifdef FEAT_MBYTE ++ WCHAR *p; + if (enc_codepage >= 0 && (int)GetACP() != enc_codepage) + { +! p = enc_to_utf16(name, NULL); + + if (p != NULL) + { +! n = _wchmod(p, perm); + vim_free(p); +! if (n == -1 && GetLastError() != ERROR_CALL_NOT_IMPLEMENTED) +! return FAIL; + /* Retry with non-wide function (for Windows 98). */ + } + } ++ if (p == NULL) + #endif +! n = _chmod(name, perm); +! if (n == -1) +! return FAIL; +! +! win32_set_archive(name); +! +! return OK; + } + + /* +*************** +*** 2682,2730 **** + void + mch_hide(char_u *name) + { +! int perm; +! #ifdef FEAT_MBYTE +! WCHAR *p = NULL; +! +! if (enc_codepage >= 0 && (int)GetACP() != enc_codepage) +! p = enc_to_utf16(name, NULL); +! #endif + +! #ifdef FEAT_MBYTE +! if (p != NULL) +! { +! perm = GetFileAttributesW(p); +! if (perm < 0 && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) +! { +! /* Retry with non-wide function (for Windows 98). */ +! vim_free(p); +! p = NULL; +! } +! } +! if (p == NULL) +! #endif +! perm = GetFileAttributes((char *)name); +! if (perm >= 0) +! { +! perm |= FILE_ATTRIBUTE_HIDDEN; +! #ifdef FEAT_MBYTE +! if (p != NULL) +! { +! if (SetFileAttributesW(p, perm) == 0 +! && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) +! { +! /* Retry with non-wide function (for Windows 98). */ +! vim_free(p); +! p = NULL; +! } +! } +! if (p == NULL) +! #endif +! SetFileAttributes((char *)name, perm); +! } +! #ifdef FEAT_MBYTE +! vim_free(p); +! #endif + } + + /* +--- 2693,2704 ---- + void + mch_hide(char_u *name) + { +! int attrs = win32_getattrs(name); +! if (attrs == -1) +! return; + +! attrs |= FILE_ATTRIBUTE_HIDDEN; +! win32_setattrs(name, attrs); + } + + /* +*************** +*** 2734,2740 **** + int + mch_isdir(char_u *name) + { +! int f = mch_getperm(name); + + if (f == -1) + return FALSE; /* file does not exist at all */ +--- 2708,2714 ---- + int + mch_isdir(char_u *name) + { +! int f = win32_getattrs(name); + + if (f == -1) + return FALSE; /* file does not exist at all */ +*************** +*** 2770,2776 **** + * Return TRUE if file "fname" has more than one link. + */ + int +! mch_is_linked(char_u *fname) + { + BY_HANDLE_FILE_INFORMATION info; + +--- 2744,2750 ---- + * Return TRUE if file "fname" has more than one link. + */ + int +! mch_is_hard_link(char_u *fname) + { + BY_HANDLE_FILE_INFORMATION info; + +*************** +*** 2779,2784 **** +--- 2753,2826 ---- + } + + /* ++ * Return TRUE if file "fname" is a symbolic link. ++ */ ++ int ++ mch_is_symbolic_link(char_u *fname) ++ { ++ HANDLE hFind; ++ int res = FALSE; ++ WIN32_FIND_DATAA findDataA; ++ DWORD fileFlags = 0, reparseTag = 0; ++ #ifdef FEAT_MBYTE ++ WCHAR *wn = NULL; ++ WIN32_FIND_DATAW findDataW; ++ ++ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage) ++ wn = enc_to_utf16(fname, NULL); ++ if (wn != NULL) ++ { ++ hFind = FindFirstFileW(wn, &findDataW); ++ vim_free(wn); ++ if (hFind == INVALID_HANDLE_VALUE ++ && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) ++ { ++ /* Retry with non-wide function (for Windows 98). */ ++ hFind = FindFirstFile(fname, &findDataA); ++ if (hFind != INVALID_HANDLE_VALUE) ++ { ++ fileFlags = findDataA.dwFileAttributes; ++ reparseTag = findDataA.dwReserved0; ++ } ++ } ++ else ++ { ++ fileFlags = findDataW.dwFileAttributes; ++ reparseTag = findDataW.dwReserved0; ++ } ++ } ++ #else ++ hFind = FindFirstFile(fname, &findDataA); ++ if (hFind != INVALID_HANDLE_VALUE) ++ { ++ fileFlags = findDataA.dwFileAttributes; ++ reparseTag = findDataA.dwReserved0; ++ } ++ #endif ++ ++ if (hFind != INVALID_HANDLE_VALUE) ++ FindClose(hFind); ++ ++ if ((fileFlags & FILE_ATTRIBUTE_REPARSE_POINT) ++ && reparseTag == IO_REPARSE_TAG_SYMLINK) ++ res = TRUE; ++ ++ return res; ++ } ++ ++ /* ++ * Return TRUE if file "fname" has more than one link or if it is a symbolic ++ * link. ++ */ ++ int ++ mch_is_linked(char_u *fname) ++ { ++ if (mch_is_hard_link(fname) || mch_is_symbolic_link(fname)) ++ return TRUE; ++ return FALSE; ++ } ++ ++ /* + * Get the by-handle-file-information for "fname". + * Returns FILEINFO_OK when OK. + * returns FILEINFO_ENC_FAIL when enc_to_utf16() failed. +*************** +*** 2842,2847 **** +--- 2884,2975 ---- + } + + /* ++ * get file attributes for `name' ++ * -1 : error ++ * else FILE_ATTRIBUTE_* defined in winnt.h ++ */ ++ static ++ int ++ win32_getattrs(char_u *name) ++ { ++ int attr; ++ #ifdef FEAT_MBYTE ++ WCHAR *p = NULL; ++ ++ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage) ++ p = enc_to_utf16(name, NULL); ++ ++ if (p != NULL) ++ { ++ attr = GetFileAttributesW(p); ++ if (attr < 0 && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) ++ { ++ /* Retry with non-wide function (for Windows 98). */ ++ vim_free(p); ++ p = NULL; ++ } ++ } ++ if (p == NULL) ++ #endif ++ attr = GetFileAttributes((char *)name); ++ #ifdef FEAT_MBYTE ++ vim_free(p); ++ #endif ++ return attr; ++ } ++ ++ /* ++ * set file attributes for `name' to `attrs' ++ * ++ * return -1 for failure, 0 otherwise ++ */ ++ static ++ int ++ win32_setattrs(char_u *name, int attrs) ++ { ++ int res; ++ #ifdef FEAT_MBYTE ++ WCHAR *p = NULL; ++ ++ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage) ++ p = enc_to_utf16(name, NULL); ++ ++ if (p != NULL) ++ { ++ res = SetFileAttributesW(p, attrs); ++ if (res == FALSE ++ && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED) ++ { ++ /* Retry with non-wide function (for Windows 98). */ ++ vim_free(p); ++ p = NULL; ++ } ++ } ++ if (p == NULL) ++ #endif ++ res = SetFileAttributes((char *)name, attrs); ++ #ifdef FEAT_MBYTE ++ vim_free(p); ++ #endif ++ return res ? 0 : -1; ++ } ++ ++ /* ++ * Set archive flag for "name". ++ */ ++ static ++ int ++ win32_set_archive(char_u *name) ++ { ++ int attrs = win32_getattrs(name); ++ if (attrs == -1) ++ return -1; ++ ++ attrs |= FILE_ATTRIBUTE_ARCHIVE; ++ return win32_setattrs(name, attrs); ++ } ++ ++ /* + * Return TRUE if file or directory "name" is writable (not readonly). + * Strange semantics of Win32: a readonly directory is writable, but you can't + * delete a file. Let's say this means it is writable. +*************** +*** 2849,2858 **** + int + mch_writable(char_u *name) + { +! int perm = mch_getperm(name); + +! return (perm != -1 && (!(perm & FILE_ATTRIBUTE_READONLY) +! || (perm & FILE_ATTRIBUTE_DIRECTORY))); + } + + /* +--- 2977,2986 ---- + int + mch_writable(char_u *name) + { +! int attrs = win32_getattrs(name); + +! return (attrs != -1 && (!(attrs & FILE_ATTRIBUTE_READONLY) +! || (attrs & FILE_ATTRIBUTE_DIRECTORY))); + } + + /* +*************** +*** 5012,5024 **** + #ifdef FEAT_MBYTE + WCHAR *wn = NULL; + int n; + + if (enc_codepage >= 0 && (int)GetACP() != enc_codepage) + { + wn = enc_to_utf16(name, NULL); + if (wn != NULL) + { +- SetFileAttributesW(wn, FILE_ATTRIBUTE_NORMAL); + n = DeleteFileW(wn) ? 0 : -1; + vim_free(wn); + if (n == 0 || GetLastError() != ERROR_CALL_NOT_IMPLEMENTED) +--- 5140,5155 ---- + #ifdef FEAT_MBYTE + WCHAR *wn = NULL; + int n; ++ #endif + ++ win32_setattrs(name, FILE_ATTRIBUTE_NORMAL); ++ ++ #ifdef FEAT_MBYTE + if (enc_codepage >= 0 && (int)GetACP() != enc_codepage) + { + wn = enc_to_utf16(name, NULL); + if (wn != NULL) + { + n = DeleteFileW(wn) ? 0 : -1; + vim_free(wn); + if (n == 0 || GetLastError() != ERROR_CALL_NOT_IMPLEMENTED) +*************** +*** 5027,5033 **** + } + } + #endif +- SetFileAttributes(name, FILE_ATTRIBUTE_NORMAL); + return DeleteFile(name) ? 0 : -1; + } + +--- 5158,5163 ---- +*** ../vim-7.3.1181/src/proto/os_win32.pro 2012-11-20 16:56:49.000000000 +0100 +--- src/proto/os_win32.pro 2013-06-12 22:29:53.000000000 +0200 +*************** +*** 21,26 **** +--- 21,28 ---- + void mch_hide __ARGS((char_u *name)); + int mch_isdir __ARGS((char_u *name)); + int mch_mkdir __ARGS((char_u *name)); ++ int mch_is_hard_link __ARGS((char_u *fname)); ++ int mch_is_symbolic_link __ARGS((char_u *fname)); + int mch_is_linked __ARGS((char_u *fname)); + int win32_fileinfo __ARGS((char_u *fname, BY_HANDLE_FILE_INFORMATION *info)); + int mch_writable __ARGS((char_u *name)); +*** ../vim-7.3.1181/src/version.c 2013-06-12 22:08:54.000000000 +0200 +--- src/version.c 2013-06-12 22:40:29.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1182, + /**/ + +-- +If Microsoft would build a car... +... You'd have to press the "Start" button to turn the engine off. + + /// 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 /// diff --git a/7.3.1183 b/7.3.1183 new file mode 100644 index 0000000..633ac81 --- /dev/null +++ b/7.3.1183 @@ -0,0 +1,47 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1183 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1183 +Problem: Python tests 86 and 87 fail. +Solution: Add "empty" files. (ZyX) +Files: src/testdir/python_before/before_1.py, + src/testdir/python_before/before_2.py + + +*** ../vim-7.3.1182/src/testdir/python_before/before_1.py 2013-06-13 19:26:45.000000000 +0200 +--- src/testdir/python_before/before_1.py 2013-06-13 19:20:01.000000000 +0200 +*************** +*** 0 **** +--- 1 ---- ++ # empty file +*** ../vim-7.3.1182/src/testdir/python_before/before_2.py 2013-06-13 19:26:45.000000000 +0200 +--- src/testdir/python_before/before_2.py 2013-06-13 19:20:12.000000000 +0200 +*************** +*** 0 **** +--- 1 ---- ++ # empty file +*** ../vim-7.3.1182/src/version.c 2013-06-12 22:41:30.000000000 +0200 +--- src/version.c 2013-06-13 19:26:23.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1183, + /**/ + +-- +Wizards had always known that the act of observation changed the thing that +was observed, and sometimes forgot that it also changed the observer too. + Terry Pratchett - Interesting times + + /// 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 /// diff --git a/7.3.1184 b/7.3.1184 new file mode 100644 index 0000000..cb016ef --- /dev/null +++ b/7.3.1184 @@ -0,0 +1,65 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1184 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1184 +Problem: Highlighting is sometimes wrong. (Axel Bender) +Solution: Fetch regline again when returning from recursive regmatch. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1183/src/regexp_nfa.c 2013-06-11 22:44:03.000000000 +0200 +--- src/regexp_nfa.c 2013-06-13 19:32:31.000000000 +0200 +*************** +*** 4495,4501 **** + int **listids; + { + char_u *save_reginput = reginput; +- char_u *save_regline = regline; + int save_reglnum = reglnum; + int save_nfa_match = nfa_match; + int save_nfa_listid = nfa_listid; +--- 4495,4500 ---- +*************** +*** 4633,4640 **** + + /* restore position in input text */ + reginput = save_reginput; +- regline = save_regline; + reglnum = save_reglnum; + nfa_match = save_nfa_match; + nfa_endp = save_nfa_endp; + nfa_listid = save_nfa_listid; +--- 4632,4640 ---- + + /* restore position in input text */ + reginput = save_reginput; + reglnum = save_reglnum; ++ if (REG_MULTI) ++ regline = reg_getline(reglnum); + nfa_match = save_nfa_match; + nfa_endp = save_nfa_endp; + nfa_listid = save_nfa_listid; +*** ../vim-7.3.1183/src/version.c 2013-06-13 19:27:13.000000000 +0200 +--- src/version.c 2013-06-13 19:32:57.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1184, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +183. You move your coffeemaker next to your computer. + + /// 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 /// diff --git a/7.3.1185 b/7.3.1185 new file mode 100644 index 0000000..c209994 --- /dev/null +++ b/7.3.1185 @@ -0,0 +1,101 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1185 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1185 +Problem: New regexp engine: no match with ^ after \n. (SungHyun Nam) +Solution: Fix it, add a test. +Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok + + +*** ../vim-7.3.1184/src/regexp_nfa.c 2013-06-13 19:47:03.000000000 +0200 +--- src/regexp_nfa.c 2013-06-13 20:10:23.000000000 +0200 +*************** +*** 3936,3944 **** + case NFA_BOL: + case NFA_BOF: + /* "^" won't match past end-of-line, don't bother trying. +! * Except when we are going to the next line for a look-behind +! * match. */ + if (reginput > regline + && (nfa_endp == NULL + || !REG_MULTI + || reglnum == nfa_endp->se_u.pos.lnum)) +--- 3936,3945 ---- + case NFA_BOL: + case NFA_BOF: + /* "^" won't match past end-of-line, don't bother trying. +! * Except when at the end of the line, or when we are going to the +! * next line for a look-behind match. */ + if (reginput > regline ++ && *reginput != NUL + && (nfa_endp == NULL + || !REG_MULTI + || reglnum == nfa_endp->se_u.pos.lnum)) +*** ../vim-7.3.1184/src/testdir/test64.in 2013-06-10 16:35:11.000000000 +0200 +--- src/testdir/test64.in 2013-06-13 20:01:36.000000000 +0200 +*************** +*** 480,485 **** +--- 480,491 ---- + :.yank + y$Gop:" + :" ++ :" Check a pattern with a line break and ^ and $ ++ /^Abc: ++ /a\n^b$\n^c/e ++ :.yank ++ Gop:" ++ :" + :" Check a pattern with a look beind crossing a line boundary + /^Behind: + /\(<\_[xy]\+\)\@3<=start +*************** +*** 555,560 **** +--- 561,571 ---- + xjk + lmn + ++ Abc: ++ a ++ b ++ c ++ + Behind: + asdfasdAc 7 + ghi + ++ c ++ + xxstart3 + + thexE thE thExethe +*** ../vim-7.3.1184/src/version.c 2013-06-13 19:47:03.000000000 +0200 +--- src/version.c 2013-06-13 20:11:36.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1185, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +185. You order fast food over the Internet + + /// 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 /// diff --git a/7.3.1186 b/7.3.1186 new file mode 100644 index 0000000..870095e --- /dev/null +++ b/7.3.1186 @@ -0,0 +1,68 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.11 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1186 +Problem: Python 3: test 87 may crash. +Solution: Use _PyArg_Parse_SizeT instead of PyArg_Parse. (Jun Takimoto) +Files: src/if_python3.c + + +*** ../vim-7.3.1185/src/if_python3.c 2013-06-12 14:40:58.000000000 +0200 +--- src/if_python3.c 2013-06-13 20:44:48.000000000 +0200 +*************** +*** 425,437 **** + {"PySys_SetArgv", (PYTHON_PROC*)&py3_PySys_SetArgv}, + {"Py_SetPythonHome", (PYTHON_PROC*)&py3_Py_SetPythonHome}, + {"Py_Initialize", (PYTHON_PROC*)&py3_Py_Initialize}, +- # ifndef PY_SSIZE_T_CLEAN +- {"PyArg_ParseTuple", (PYTHON_PROC*)&py3_PyArg_ParseTuple}, +- {"Py_BuildValue", (PYTHON_PROC*)&py3_Py_BuildValue}, +- # else + {"_PyArg_ParseTuple_SizeT", (PYTHON_PROC*)&py3_PyArg_ParseTuple}, + {"_Py_BuildValue_SizeT", (PYTHON_PROC*)&py3_Py_BuildValue}, +- # endif + {"PyMem_Free", (PYTHON_PROC*)&py3_PyMem_Free}, + {"PyMem_Malloc", (PYTHON_PROC*)&py3_PyMem_Malloc}, + {"PyList_New", (PYTHON_PROC*)&py3_PyList_New}, +--- 425,432 ---- +*************** +*** 488,494 **** + {"PyEval_InitThreads", (PYTHON_PROC*)&py3_PyEval_InitThreads}, + {"PyEval_RestoreThread", (PYTHON_PROC*)&py3_PyEval_RestoreThread}, + {"PyEval_SaveThread", (PYTHON_PROC*)&py3_PyEval_SaveThread}, +! {"PyArg_Parse", (PYTHON_PROC*)&py3_PyArg_Parse}, + {"Py_IsInitialized", (PYTHON_PROC*)&py3_Py_IsInitialized}, + {"_PyObject_NextNotImplemented", (PYTHON_PROC*)&py3__PyObject_NextNotImplemented}, + {"_Py_NoneStruct", (PYTHON_PROC*)&py3__Py_NoneStruct}, +--- 483,489 ---- + {"PyEval_InitThreads", (PYTHON_PROC*)&py3_PyEval_InitThreads}, + {"PyEval_RestoreThread", (PYTHON_PROC*)&py3_PyEval_RestoreThread}, + {"PyEval_SaveThread", (PYTHON_PROC*)&py3_PyEval_SaveThread}, +! {"_PyArg_Parse_SizeT", (PYTHON_PROC*)&py3_PyArg_Parse}, + {"Py_IsInitialized", (PYTHON_PROC*)&py3_Py_IsInitialized}, + {"_PyObject_NextNotImplemented", (PYTHON_PROC*)&py3__PyObject_NextNotImplemented}, + {"_Py_NoneStruct", (PYTHON_PROC*)&py3__Py_NoneStruct}, +*** ../vim-7.3.1185/src/version.c 2013-06-13 20:19:35.000000000 +0200 +--- src/version.c 2013-06-13 20:45:49.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1186, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +188. You purchase a laptop so you can surf while sitting on the can. + + /// 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 /// diff --git a/7.3.1187 b/7.3.1187 new file mode 100644 index 0000000..614cb86 --- /dev/null +++ b/7.3.1187 @@ -0,0 +1,81 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1187 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1187 (after 7.3.1170) +Problem: "s:" is recognized but "" is not. (ZyX) +Solution: Translate "" like "s:". +Files: src/eval.c + + +*** ../vim-7.3.1186/src/eval.c 2013-06-12 22:08:54.000000000 +0200 +--- src/eval.c 2013-06-13 21:15:58.000000000 +0200 +*************** +*** 10976,10996 **** + EMSG2(_("E700: Unknown function: %s"), s); + else + { +! if (STRNCMP(s, "s:", 2) == 0) + { + char sid_buf[25]; + +! /* Expand s: into nr_, so that the function can also be +! * called from another script. Using trans_function_name() would +! * also work, but some plugins depend on the name being printable +! * text. */ + sprintf(sid_buf, "%ld_", (long)current_SID); + rettv->vval.v_string = +! alloc((int)(STRLEN(sid_buf) + STRLEN(s + 2) + 1)); + if (rettv->vval.v_string != NULL) + { + STRCPY(rettv->vval.v_string, sid_buf); +! STRCAT(rettv->vval.v_string, s + 2); + } + } + else +--- 10976,10997 ---- + EMSG2(_("E700: Unknown function: %s"), s); + else + { +! if (STRNCMP(s, "s:", 2) == 0 || STRNCMP(s, "", 5) == 0) + { + char sid_buf[25]; ++ int off = *s == 's' ? 2 : 5; + +! /* Expand s: and into nr_, so that the function can +! * also be called from another script. Using trans_function_name() +! * would also work, but some plugins depend on the name being +! * printable text. */ + sprintf(sid_buf, "%ld_", (long)current_SID); + rettv->vval.v_string = +! alloc((int)(STRLEN(sid_buf) + STRLEN(s + off) + 1)); + if (rettv->vval.v_string != NULL) + { + STRCPY(rettv->vval.v_string, sid_buf); +! STRCAT(rettv->vval.v_string, s + off); + } + } + else +*** ../vim-7.3.1186/src/version.c 2013-06-13 20:57:44.000000000 +0200 +--- src/version.c 2013-06-13 21:18:28.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1187, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +189. You put your e-mail address in the upper left-hand corner of envelopes. + + /// 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 /// diff --git a/7.3.1188 b/7.3.1188 new file mode 100644 index 0000000..ccd4047 --- /dev/null +++ b/7.3.1188 @@ -0,0 +1,61 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1188 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1188 +Problem: Newline characters messing up error message. +Solution: Remove the newlines. (Kazunobu Kuriyama) +Files: src/gui_x11.c + + +*** ../vim-7.3.1187/src/gui_x11.c 2010-11-16 15:04:51.000000000 +0100 +--- src/gui_x11.c 2013-06-13 21:54:39.000000000 +0200 +*************** +*** 2197,2208 **** + if ( xfs[i]->max_bounds.width != 2 * min_width + && xfs[i]->max_bounds.width != min_width) + { +! EMSG2(_("E253: Fontset name: %s\n"), base_name); +! EMSG2(_("Font0: %s\n"), font_name[min_font_idx]); +! EMSG2(_("Font1: %s\n"), font_name[i]); +! EMSGN(_("Font%ld width is not twice that of font0\n"), i); +! EMSGN(_("Font0 width: %ld\n"), xfs[min_font_idx]->max_bounds.width); +! EMSGN(_("Font1 width: %ld\n\n"), xfs[i]->max_bounds.width); + return FAIL; + } + } +--- 2197,2208 ---- + if ( xfs[i]->max_bounds.width != 2 * min_width + && xfs[i]->max_bounds.width != min_width) + { +! EMSG2(_("E253: Fontset name: %s"), base_name); +! EMSG2(_("Font0: %s"), font_name[min_font_idx]); +! EMSG2(_("Font1: %s"), font_name[i]); +! EMSGN(_("Font%ld width is not twice that of font0"), i); +! EMSGN(_("Font0 width: %ld"), xfs[min_font_idx]->max_bounds.width); +! EMSGN(_("Font1 width: %ld"), xfs[i]->max_bounds.width); + return FAIL; + } + } +*** ../vim-7.3.1187/src/version.c 2013-06-13 21:24:01.000000000 +0200 +--- src/version.c 2013-06-13 21:56:02.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1188, + /**/ + +-- +I'm in shape. Round IS a shape. + + /// 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 /// diff --git a/7.3.1189 b/7.3.1189 new file mode 100644 index 0000000..7e6918a --- /dev/null +++ b/7.3.1189 @@ -0,0 +1,75 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1189 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1189 (after 7.3.1185) +Problem: Highlighting is still wrong sometimes. (Dominique Pelle) +Solution: Also restore reginput properly. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1188/src/regexp_nfa.c 2013-06-13 20:19:35.000000000 +0200 +--- src/regexp_nfa.c 2013-06-13 22:52:38.000000000 +0200 +*************** +*** 4495,4501 **** + regsubs_T *m; + int **listids; + { +! char_u *save_reginput = reginput; + int save_reglnum = reglnum; + int save_nfa_match = nfa_match; + int save_nfa_listid = nfa_listid; +--- 4495,4501 ---- + regsubs_T *m; + int **listids; + { +! int save_reginput_col = (int)(reginput - regline); + int save_reglnum = reglnum; + int save_nfa_match = nfa_match; + int save_nfa_listid = nfa_listid; +*************** +*** 4632,4641 **** + } + + /* restore position in input text */ +- reginput = save_reginput; + reglnum = save_reglnum; + if (REG_MULTI) + regline = reg_getline(reglnum); + nfa_match = save_nfa_match; + nfa_endp = save_nfa_endp; + nfa_listid = save_nfa_listid; +--- 4632,4641 ---- + } + + /* restore position in input text */ + reglnum = save_reglnum; + if (REG_MULTI) + regline = reg_getline(reglnum); ++ reginput = regline + save_reginput_col; + nfa_match = save_nfa_match; + nfa_endp = save_nfa_endp; + nfa_listid = save_nfa_listid; +*** ../vim-7.3.1188/src/version.c 2013-06-13 21:57:16.000000000 +0200 +--- src/version.c 2013-06-13 22:53:34.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1189, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +194. Your business cards contain your e-mail and home page address. + + /// 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 /// diff --git a/7.3.1190 b/7.3.1190 new file mode 100644 index 0000000..0d3fec3 --- /dev/null +++ b/7.3.1190 @@ -0,0 +1,66 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1190 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1190 +Problem: Compiler warning for parentheses. (Christian Wellenbrock) +Solution: Change #ifdef. +Files: src/ex_docmd.c + + +*** ../vim-7.3.1189/src/ex_docmd.c 2013-06-12 17:12:19.000000000 +0200 +--- src/ex_docmd.c 2013-06-14 19:08:10.000000000 +0200 +*************** +*** 8568,8578 **** + break; + + default: /* CMD_rshift or CMD_lshift */ +! if ((eap->cmdidx == CMD_rshift) + #ifdef FEAT_RIGHTLEFT +! ^ curwin->w_p_rl + #endif +! ) + oa.op_type = OP_RSHIFT; + else + oa.op_type = OP_LSHIFT; +--- 8568,8580 ---- + break; + + default: /* CMD_rshift or CMD_lshift */ +! if ( + #ifdef FEAT_RIGHTLEFT +! (eap->cmdidx == CMD_rshift) ^ curwin->w_p_rl +! #else +! eap->cmdidx == CMD_rshift + #endif +! ) + oa.op_type = OP_RSHIFT; + else + oa.op_type = OP_LSHIFT; +*** ../vim-7.3.1189/src/version.c 2013-06-13 22:59:25.000000000 +0200 +--- src/version.c 2013-06-14 19:14:40.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1190, + /**/ + +-- +Some of the well known MS-Windows errors: + ETIME Wrong time, wait a little while + ECRASH Try again... + EDETECT Unable to detect errors + EOVER You lost! Play another game? + ENOCLUE Eh, what did you want? + + /// 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 /// diff --git a/7.3.1191 b/7.3.1191 new file mode 100644 index 0000000..1cf878e --- /dev/null +++ b/7.3.1191 @@ -0,0 +1,311 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1191 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1191 +Problem: Backreference to previous line doesn't work. (Lech Lorens) +Solution: Implement looking in another line. +Files: src/regexp.c, src/regexp_nfa.c, src/testdir/test64.in, + src/testdir/test64.ok + + +*** ../vim-7.3.1190/src/regexp.c 2013-06-08 18:19:39.000000000 +0200 +--- src/regexp.c 2013-06-14 20:23:33.000000000 +0200 +*************** +*** 3519,3524 **** +--- 3519,3525 ---- + *(pp) = (savep)->se_u.ptr; } + + static int re_num_cmp __ARGS((long_u val, char_u *scan)); ++ static int match_with_backref __ARGS((linenr_T start_lnum, colnr_T start_col, linenr_T end_lnum, colnr_T end_col, int *bytelen)); + static int regmatch __ARGS((char_u *prog)); + static int regrepeat __ARGS((char_u *p, long maxcount)); + +*************** +*** 4979,4987 **** + case BACKREF + 9: + { + int len; +- linenr_T clnum; +- colnr_T ccol; +- char_u *p; + + no = op - BACKREF; + cleanup_subexpr(); +--- 4980,4985 ---- +*************** +*** 5023,5089 **** + { + /* Messy situation: Need to compare between two + * lines. */ +! ccol = reg_startpos[no].col; +! clnum = reg_startpos[no].lnum; +! for (;;) +! { +! /* Since getting one line may invalidate +! * the other, need to make copy. Slow! */ +! if (regline != reg_tofree) +! { +! len = (int)STRLEN(regline); +! if (reg_tofree == NULL +! || len >= (int)reg_tofreelen) +! { +! len += 50; /* get some extra */ +! vim_free(reg_tofree); +! reg_tofree = alloc(len); +! if (reg_tofree == NULL) +! { +! status = RA_FAIL; /* outof memory!*/ +! break; +! } +! reg_tofreelen = len; +! } +! STRCPY(reg_tofree, regline); +! reginput = reg_tofree +! + (reginput - regline); +! regline = reg_tofree; +! } +! +! /* Get the line to compare with. */ +! p = reg_getline(clnum); +! if (clnum == reg_endpos[no].lnum) +! len = reg_endpos[no].col - ccol; +! else +! len = (int)STRLEN(p + ccol); +! +! if (cstrncmp(p + ccol, reginput, &len) != 0) +! { +! status = RA_NOMATCH; /* doesn't match */ +! break; +! } +! if (clnum == reg_endpos[no].lnum) +! break; /* match and at end! */ +! if (reglnum >= reg_maxline) +! { +! status = RA_NOMATCH; /* text too short */ +! break; +! } +! +! /* Advance to next line. */ +! reg_nextline(); +! ++clnum; +! ccol = 0; +! if (got_int) +! { +! status = RA_FAIL; +! break; +! } +! } +! +! /* found a match! Note that regline may now point +! * to a copy of the line, that should not matter. */ + } + } + } +--- 5021,5032 ---- + { + /* Messy situation: Need to compare between two + * lines. */ +! status = match_with_backref( +! reg_startpos[no].lnum, +! reg_startpos[no].col, +! reg_endpos[no].lnum, +! reg_endpos[no].col, +! NULL); + } + } + } +*************** +*** 6505,6510 **** +--- 6448,6522 ---- + return val == n; + } + ++ /* ++ * Check whether a backreference matches. ++ * Returns RA_FAIL, RA_NOMATCH or RA_MATCH. ++ * If "bytelen" is not NULL, it is set to the bytelength of the whole match. ++ */ ++ static int ++ match_with_backref(start_lnum, start_col, end_lnum, end_col, bytelen) ++ linenr_T start_lnum; ++ colnr_T start_col; ++ linenr_T end_lnum; ++ colnr_T end_col; ++ int *bytelen; ++ { ++ linenr_T clnum = start_lnum; ++ colnr_T ccol = start_col; ++ int len; ++ char_u *p; ++ ++ if (bytelen != NULL) ++ *bytelen = 0; ++ for (;;) ++ { ++ /* Since getting one line may invalidate the other, need to make copy. ++ * Slow! */ ++ if (regline != reg_tofree) ++ { ++ len = (int)STRLEN(regline); ++ if (reg_tofree == NULL || len >= (int)reg_tofreelen) ++ { ++ len += 50; /* get some extra */ ++ vim_free(reg_tofree); ++ reg_tofree = alloc(len); ++ if (reg_tofree == NULL) ++ return RA_FAIL; /* out of memory!*/ ++ reg_tofreelen = len; ++ } ++ STRCPY(reg_tofree, regline); ++ reginput = reg_tofree + (reginput - regline); ++ regline = reg_tofree; ++ } ++ ++ /* Get the line to compare with. */ ++ p = reg_getline(clnum); ++ if (clnum == end_lnum) ++ len = end_col - ccol; ++ else ++ len = (int)STRLEN(p + ccol); ++ ++ if (cstrncmp(p + ccol, reginput, &len) != 0) ++ return RA_NOMATCH; /* doesn't match */ ++ if (bytelen != NULL) ++ *bytelen += len; ++ if (clnum == end_lnum) ++ break; /* match and at end! */ ++ if (reglnum >= reg_maxline) ++ return RA_NOMATCH; /* text too short */ ++ ++ /* Advance to next line. */ ++ reg_nextline(); ++ ++clnum; ++ ccol = 0; ++ if (got_int) ++ return RA_FAIL; ++ } ++ ++ /* found a match! Note that regline may now point to a copy of the line, ++ * that should not matter. */ ++ return RA_MATCH; ++ } + + #ifdef BT_REGEXP_DUMP + +*** ../vim-7.3.1190/src/regexp_nfa.c 2013-06-13 22:59:25.000000000 +0200 +--- src/regexp_nfa.c 2013-06-14 20:19:59.000000000 +0200 +*************** +*** 4367,4380 **** + if (sub->list.multi[subidx].start.lnum < 0 + || sub->list.multi[subidx].end.lnum < 0) + goto retempty; +! /* TODO: line breaks */ +! len = sub->list.multi[subidx].end.col +! - sub->list.multi[subidx].start.col; +! if (cstrncmp(regline + sub->list.multi[subidx].start.col, +! reginput, &len) == 0) + { +! *bytelen = len; +! return TRUE; + } + } + else +--- 4367,4393 ---- + if (sub->list.multi[subidx].start.lnum < 0 + || sub->list.multi[subidx].end.lnum < 0) + goto retempty; +! if (sub->list.multi[subidx].start.lnum == reglnum +! && sub->list.multi[subidx].end.lnum == reglnum) + { +! len = sub->list.multi[subidx].end.col +! - sub->list.multi[subidx].start.col; +! if (cstrncmp(regline + sub->list.multi[subidx].start.col, +! reginput, &len) == 0) +! { +! *bytelen = len; +! return TRUE; +! } +! } +! else +! { +! if (match_with_backref( +! sub->list.multi[subidx].start.lnum, +! sub->list.multi[subidx].start.col, +! sub->list.multi[subidx].end.lnum, +! sub->list.multi[subidx].end.col, +! bytelen) == RA_MATCH) +! return TRUE; + } + } + else +*** ../vim-7.3.1190/src/testdir/test64.in 2013-06-13 20:19:35.000000000 +0200 +--- src/testdir/test64.in 2013-06-14 20:01:56.000000000 +0200 +*************** +*** 486,491 **** +--- 486,497 ---- + :.yank + Gop:" + :" ++ :" Check using a backref matching in a previous line ++ /^Backref: ++ /\v.*\/(.*)\n.*\/\1$ ++ :.yank ++ Gop:" ++ :" + :" Check a pattern with a look beind crossing a line boundary + /^Behind: + /\(<\_[xy]\+\)\@3<=start +*************** +*** 566,571 **** +--- 572,584 ---- + b + c + ++ Backref: ++ ./Dir1/Dir2/zyxwvuts.txt ++ ./Dir1/Dir2/abcdefgh.bat ++ ++ ./Dir1/Dir2/file1.txt ++ ./OtherDir1/OtherDir2/file1.txt ++ + Behind: + asdfasd +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1192 +Problem: Valgrind reports errors when using backreferences. (Dominique + Pelle) +Solution: Do not check the end of submatches. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1191/src/regexp_nfa.c 2013-06-14 20:31:20.000000000 +0200 +--- src/regexp_nfa.c 2013-06-14 21:09:14.000000000 +0200 +*************** +*** 3612,3618 **** + } + + /* +! * Return TRUE if "sub1" and "sub2" have the same positions. + */ + static int + sub_equal(sub1, sub2) +--- 3612,3618 ---- + } + + /* +! * Return TRUE if "sub1" and "sub2" have the same start positions. + */ + static int + sub_equal(sub1, sub2) +*************** +*** 3621,3630 **** + { + int i; + int todo; +! linenr_T s1, e1; +! linenr_T s2, e2; +! char_u *sp1, *ep1; +! char_u *sp2, *ep2; + + todo = sub1->in_use > sub2->in_use ? sub1->in_use : sub2->in_use; + if (REG_MULTI) +--- 3621,3630 ---- + { + int i; + int todo; +! linenr_T s1; +! linenr_T s2; +! char_u *sp1; +! char_u *sp2; + + todo = sub1->in_use > sub2->in_use ? sub1->in_use : sub2->in_use; + if (REG_MULTI) +*************** +*** 3632,3664 **** + for (i = 0; i < todo; ++i) + { + if (i < sub1->in_use) +- { + s1 = sub1->list.multi[i].start.lnum; +- e1 = sub1->list.multi[i].end.lnum; +- } + else +- { + s1 = 0; +- e1 = 0; +- } + if (i < sub2->in_use) +- { + s2 = sub2->list.multi[i].start.lnum; +- e2 = sub2->list.multi[i].end.lnum; +- } + else +- { + s2 = 0; +! e2 = 0; +! } +! if (s1 != s2 || e1 != e2) + return FALSE; + if (s1 != 0 && sub1->list.multi[i].start.col + != sub2->list.multi[i].start.col) + return FALSE; +- if (e1 != 0 && sub1->list.multi[i].end.col +- != sub2->list.multi[i].end.col) +- return FALSE; + } + } + else +--- 3632,3649 ---- + for (i = 0; i < todo; ++i) + { + if (i < sub1->in_use) + s1 = sub1->list.multi[i].start.lnum; + else + s1 = 0; + if (i < sub2->in_use) + s2 = sub2->list.multi[i].start.lnum; + else + s2 = 0; +! if (s1 != s2) + return FALSE; + if (s1 != 0 && sub1->list.multi[i].start.col + != sub2->list.multi[i].start.col) + return FALSE; + } + } + else +*************** +*** 3666,3691 **** + for (i = 0; i < todo; ++i) + { + if (i < sub1->in_use) +- { + sp1 = sub1->list.line[i].start; +- ep1 = sub1->list.line[i].end; +- } + else +- { + sp1 = NULL; +- ep1 = NULL; +- } + if (i < sub2->in_use) +- { + sp2 = sub2->list.line[i].start; +- ep2 = sub2->list.line[i].end; +- } + else +- { + sp2 = NULL; +! ep2 = NULL; +! } +! if (sp1 != sp2 || ep1 != ep2) + return FALSE; + } + } +--- 3651,3664 ---- + for (i = 0; i < todo; ++i) + { + if (i < sub1->in_use) + sp1 = sub1->list.line[i].start; + else + sp1 = NULL; + if (i < sub2->in_use) + sp2 = sub2->list.line[i].start; + else + sp2 = NULL; +! if (sp1 != sp2) + return FALSE; + } + } +*************** +*** 3735,3742 **** + if (thread->state->id == state->id + && sub_equal(&thread->subs.norm, &subs->norm) + #ifdef FEAT_SYN_HL +! && (!nfa_has_zsubexpr || +! sub_equal(&thread->subs.synt, &subs->synt)) + #endif + ) + return TRUE; +--- 3708,3715 ---- + if (thread->state->id == state->id + && sub_equal(&thread->subs.norm, &subs->norm) + #ifdef FEAT_SYN_HL +! && (!nfa_has_zsubexpr +! || sub_equal(&thread->subs.synt, &subs->synt)) + #endif + ) + return TRUE; +*** ../vim-7.3.1191/src/version.c 2013-06-14 20:31:20.000000000 +0200 +--- src/version.c 2013-06-14 21:14:28.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1192, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +202. You're amazed to find out Spam is a food. + + /// 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 /// diff --git a/7.3.1193 b/7.3.1193 new file mode 100644 index 0000000..3f730ff --- /dev/null +++ b/7.3.1193 @@ -0,0 +1,60 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1193 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1193 +Problem: fail_if_missing not used for Python 3. +Solution: Give an error when Python 3 can't be configured. (Andrei Olsen) +Files: src/configure.in, src/auto/configure + + +*** ../vim-7.3.1192/src/configure.in 2013-06-11 20:53:24.000000000 +0200 +--- src/configure.in 2013-06-14 21:19:40.000000000 +0200 +*************** +*** 1229,1234 **** +--- 1229,1237 ---- + AC_MSG_RESULT(too old) + fi + fi ++ if test "$fail_if_missing" = "yes" -a "$python3_ok" != "yes"; then ++ AC_MSG_ERROR([could not configure python3]) ++ fi + fi + + AC_SUBST(PYTHON3_CONFDIR) +*** ../vim-7.3.1192/src/auto/configure 2013-06-11 20:53:24.000000000 +0200 +--- src/auto/configure 2013-06-14 21:19:43.000000000 +0200 +*************** +*** 5826,5831 **** +--- 5826,5834 ---- + $as_echo "too old" >&6; } + fi + fi ++ if test "$fail_if_missing" = "yes" -a "$python3_ok" != "yes"; then ++ as_fn_error "could not configure python3" "$LINENO" 5 ++ fi + fi + + +*** ../vim-7.3.1192/src/version.c 2013-06-14 21:15:21.000000000 +0200 +--- src/version.c 2013-06-14 21:20:51.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1193, + /**/ + +-- +$ echo pizza > /dev/oven + + /// 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 /// diff --git a/7.3.1194 b/7.3.1194 new file mode 100644 index 0000000..30dda29 --- /dev/null +++ b/7.3.1194 @@ -0,0 +1,74 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1194 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1194 +Problem: Yaml highlighting is slow. +Solution: Tune the estimation of pattern failure chance. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1193/src/regexp_nfa.c 2013-06-14 21:15:21.000000000 +0200 +--- src/regexp_nfa.c 2013-06-14 22:14:17.000000000 +0200 +*************** +*** 4686,4691 **** +--- 4686,4703 ---- + /* empty match works always */ + return 0; + ++ case NFA_START_INVISIBLE: ++ case NFA_START_INVISIBLE_FIRST: ++ case NFA_START_INVISIBLE_NEG: ++ case NFA_START_INVISIBLE_NEG_FIRST: ++ case NFA_START_INVISIBLE_BEFORE: ++ case NFA_START_INVISIBLE_BEFORE_FIRST: ++ case NFA_START_INVISIBLE_BEFORE_NEG: ++ case NFA_START_INVISIBLE_BEFORE_NEG_FIRST: ++ case NFA_START_PATTERN: ++ /* recursive regmatch is expensive, use low failure chance */ ++ return 5; ++ + case NFA_BOL: + case NFA_EOL: + case NFA_BOF: +*************** +*** 5264,5270 **** + skip_lid = nextlist->id; + #endif + } +! else if(state_in_list(thislist, + t->state->out1->out->out, &t->subs)) + { + skip = t->state->out1->out->out; +--- 5276,5282 ---- + skip_lid = nextlist->id; + #endif + } +! else if (state_in_list(thislist, + t->state->out1->out->out, &t->subs)) + { + skip = t->state->out1->out->out; +*** ../vim-7.3.1193/src/version.c 2013-06-14 21:22:33.000000000 +0200 +--- src/version.c 2013-06-14 22:26:49.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1194, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +206. You religiously respond immediately to e-mail, while ignoring + your growing pile of snail mail. + + /// 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 /// diff --git a/7.3.1195 b/7.3.1195 new file mode 100644 index 0000000..8c29402 --- /dev/null +++ b/7.3.1195 @@ -0,0 +1,53 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1195 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1195 +Problem: Compiler warning for unitialized variable. (Tony Mechelynck) +Solution: Set the length to the matching backref. +Files: src/regexp.c + + +*** ../vim-7.3.1194/src/regexp.c 2013-06-14 20:31:20.000000000 +0200 +--- src/regexp.c 2013-06-14 22:46:22.000000000 +0200 +*************** +*** 5026,5032 **** + reg_startpos[no].col, + reg_endpos[no].lnum, + reg_endpos[no].col, +! NULL); + } + } + } +--- 5026,5032 ---- + reg_startpos[no].col, + reg_endpos[no].lnum, + reg_endpos[no].col, +! &len); + } + } + } +*** ../vim-7.3.1194/src/version.c 2013-06-14 22:33:47.000000000 +0200 +--- src/version.c 2013-06-14 22:42:13.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1195, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +208. Your goals for the future are obtaining an T1 connection and + a 130 gig hard drive. + + /// 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 /// diff --git a/7.3.1196 b/7.3.1196 new file mode 100644 index 0000000..61bb148 --- /dev/null +++ b/7.3.1196 @@ -0,0 +1,267 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1196 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1196 +Problem: Old regexp engine does not match pattern with backref correctly. + (Dominique Pelle) +Solution: Fix setting status. Test multi-line patterns better. +Files: src/regexp.c, src/testdir/test64.in, src/testdir/test64.ok + + +*** ../vim-7.3.1195/src/regexp.c 2013-06-14 22:48:50.000000000 +0200 +--- src/regexp.c 2013-06-15 14:09:21.000000000 +0200 +*************** +*** 5021,5032 **** + { + /* Messy situation: Need to compare between two + * lines. */ +! status = match_with_backref( + reg_startpos[no].lnum, + reg_startpos[no].col, + reg_endpos[no].lnum, + reg_endpos[no].col, + &len); + } + } + } +--- 5021,5035 ---- + { + /* Messy situation: Need to compare between two + * lines. */ +! int r = match_with_backref( + reg_startpos[no].lnum, + reg_startpos[no].col, + reg_endpos[no].lnum, + reg_endpos[no].col, + &len); ++ ++ if (r != RA_MATCH) ++ status = r; + } + } + } +*** ../vim-7.3.1195/src/testdir/test64.in 2013-06-14 20:31:20.000000000 +0200 +--- src/testdir/test64.in 2013-06-15 15:05:03.000000000 +0200 +*************** +*** 377,382 **** +--- 377,383 ---- + :call add(tl, [2, '\(\i\+\) \1', 'xgoo goox', 'goo goo', 'goo']) + :call add(tl, [2, '\(a\)\(b\)\(c\)\(dd\)\(e\)\(f\)\(g\)\(h\)\(i\)\1\2\3\4\5\6\7\8\9', 'xabcddefghiabcddefghix', 'abcddefghiabcddefghi', 'a', 'b', 'c', 'dd', 'e', 'f', 'g', 'h', 'i']) + :call add(tl, [2, '\(\d*\)a \1b', ' a b ', 'a b', '']) ++ :call add(tl, [2, '^.\(.\).\_..\1.', "aaa\naaa\nb", "aaa\naaa", 'a']) + :" + :"""" Look-behind with limit + :call add(tl, [2, '<\@<=span.', 'xxspanxx +! :" This only works on a buffer line, not with expression evaluation +! /^Find this +! /\%#=0\<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\> +! y$Gop:" +! /^Find this +! /\%#=1\<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\> +! y$Gop:" +! /^Find this +! /\%#=2\<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\> +! y$Gop:" + :" + :" Check that using a pattern on two lines doesn't get messed up by using + :" matchstr() with \ze in between. +--- 454,501 ---- + :endfor + :unlet t tl e l + :" ++ :"""""" multi-line tests ++ :let tl = [] ++ :" ++ :"""" back references ++ :call add(tl, [2, '^.\(.\).\_..\1.', ['aaa', 'aaa', 'b'], ['XX', 'b']]) ++ :call add(tl, [2, '\v.*\/(.*)\n.*\/\1$', ['./Dir1/Dir2/zyxwvuts.txt', './Dir1/Dir2/abcdefgh.bat', '', './Dir1/Dir2/file1.txt', './OtherDir1/OtherDir2/file1.txt'], ['./Dir1/Dir2/zyxwvuts.txt', './Dir1/Dir2/abcdefgh.bat', '', 'XX']]) ++ :" ++ :"""" line breaks ++ :call add(tl, [2, '\S.*\nx', ['abc', 'def', 'ghi', 'xjk', 'lmn'], ['abc', 'def', 'XXjk', 'lmn']]) ++ :" + :" Check that \_[0-9] matching EOL does not break a following \> +! :call add(tl, [2, '\<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\>', ['', 'localnet/192.168.0.1', ''], ['', 'localnet/XX', '']]) +! :" +! :" Check a pattern with a line break and ^ and $ +! :call add(tl, [2, 'a\n^b$\n^c', ['a', 'b', 'c'], ['XX']]) +! :" +! :"""" Run the multi-line tests +! :" +! :$put ='multi-line tests' +! :for t in tl +! : let re = t[0] +! : let pat = t[1] +! : let before = t[2] +! : let after = t[3] +! : for engine in [0, 1, 2] +! : if engine == 2 && re == 0 || engine == 1 && re ==1 +! : continue +! : endif +! : let ®expengine = engine +! : new +! : call setline(1, before) +! : exe '%s/' . pat . '/XX/' +! : let result = getline(1, '$') +! : q! +! : if result != after +! : $put ='ERROR: pat: \"' . pat . '\", text: \"' . string(before) . '\", expected: \"' . string(after) . '\", got: \"' . string(result) . '\"' +! : else +! : $put ='OK ' . engine . ' - ' . pat +! : endif +! : endfor +! :endfor +! :unlet t tl + :" + :" Check that using a pattern on two lines doesn't get messed up by using + :" matchstr() with \ze in between. +*************** +*** 474,497 **** + :.+1,.+2yank + Gop:" + :" +- :" Check a pattern with a line break matches in the right position. +- /^Multiline +- /\S.*\nx +- :.yank +- y$Gop:" +- :" +- :" Check a pattern with a line break and ^ and $ +- /^Abc: +- /a\n^b$\n^c/e +- :.yank +- Gop:" +- :" +- :" Check using a backref matching in a previous line +- /^Backref: +- /\v.*\/(.*)\n.*\/\1$ +- :.yank +- Gop:" +- :" + :" Check a pattern with a look beind crossing a line boundary + /^Behind: + /\(<\_[xy]\+\)\@3<=start +--- 506,511 ---- +*************** +*** 553,584 **** + :/\%#=1^Results/,$wq! test.out + ENDTEST + +- Find this: +- localnet/192.168.0.1 +- + Substitute here: + Ta 5 + Ac 7 + +- Multiline: +- abc +- def +- ghi +- xjk +- lmn +- +- Abc: +- a +- b +- c +- +- Backref: +- ./Dir1/Dir2/zyxwvuts.txt +- ./Dir1/Dir2/abcdefgh.bat +- +- ./Dir1/Dir2/file1.txt +- ./OtherDir1/OtherDir2/file1.txt +- + Behind: + asdfasdTa 5 + Ac 7 +- ghi +- +- c +- +- ./Dir1/Dir2/file1.txt + + xxstart3 + +--- 913,937 ---- + OK 0 - [0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}-\)\{3}[0-9a-zA-Z]\{12} + OK 1 - [0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}-\)\{3}[0-9a-zA-Z]\{12} + OK 2 - [0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}-\)\{3}[0-9a-zA-Z]\{12} +! multi-line tests +! OK 0 - ^.\(.\).\_..\1. +! OK 1 - ^.\(.\).\_..\1. +! OK 2 - ^.\(.\).\_..\1. +! OK 0 - \v.*\/(.*)\n.*\/\1$ +! OK 1 - \v.*\/(.*)\n.*\/\1$ +! OK 2 - \v.*\/(.*)\n.*\/\1$ +! OK 0 - \S.*\nx +! OK 1 - \S.*\nx +! OK 2 - \S.*\nx +! OK 0 - \<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\> +! OK 1 - \<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\> +! OK 2 - \<\(\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\.\)\{3\}\(25\_[0-5]\|2\_[0-4]\_[0-9]\|\_[01]\?\_[0-9]\_[0-9]\?\)\> +! OK 0 - a\n^b$\n^c +! OK 1 - a\n^b$\n^c +! OK 2 - a\n^b$\n^c + + Ta 5 + Ac 7 + + xxstart3 + +*** ../vim-7.3.1195/src/version.c 2013-06-14 22:48:50.000000000 +0200 +--- src/version.c 2013-06-15 14:12:46.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1196, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +213. Your kids start referring to you as "that guy in front of the monitor." + + /// 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 /// diff --git a/7.3.1197 b/7.3.1197 new file mode 100644 index 0000000..00fef80 --- /dev/null +++ b/7.3.1197 @@ -0,0 +1,192 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1197 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1197 +Problem: ":wviminfo!" does not write history previously read from a viminfo + file. (Roland Eggner) +Solution: When not merging history write all entries. +Files: src/ex_cmds.c, src/ex_getln.c, src/proto/ex_getln.pro + + +*** ../vim-7.3.1196/src/ex_cmds.c 2013-06-08 18:19:39.000000000 +0200 +--- src/ex_cmds.c 2013-06-15 16:16:33.000000000 +0200 +*************** +*** 1722,1732 **** + } + + /* +! * write_viminfo() -- Write the viminfo file. The old one is read in first so +! * that effectively a merge of current info and old info is done. This allows +! * multiple vims to run simultaneously, without losing any marks etc. If +! * forceit is TRUE, then the old file is not read in, and only internal info is +! * written to the file. -- webb + */ + void + write_viminfo(file, forceit) +--- 1722,1732 ---- + } + + /* +! * Write the viminfo file. The old one is read in first so that effectively a +! * merge of current info and old info is done. This allows multiple vims to +! * run simultaneously, without losing any marks etc. +! * If "forceit" is TRUE, then the old file is not read in, and only internal +! * info is written to the file. + */ + void + write_viminfo(file, forceit) +*************** +*** 2047,2052 **** +--- 2047,2053 ---- + int count = 0; + int eof = FALSE; + vir_T vir; ++ int merge = FALSE; + + if ((vir.vir_line = alloc(LSIZE)) == NULL) + return; +*************** +*** 2058,2066 **** + if (fp_in != NULL) + { + if (flags & VIF_WANT_INFO) + eof = read_viminfo_up_to_marks(&vir, + flags & VIF_FORCEIT, fp_out != NULL); +! else + /* Skip info, find start of marks */ + while (!(eof = viminfo_readline(&vir)) + && vir.vir_line[0] != '>') +--- 2059,2070 ---- + if (fp_in != NULL) + { + if (flags & VIF_WANT_INFO) ++ { + eof = read_viminfo_up_to_marks(&vir, + flags & VIF_FORCEIT, fp_out != NULL); +! merge = TRUE; +! } +! else if (flags != 0) + /* Skip info, find start of marks */ + while (!(eof = viminfo_readline(&vir)) + && vir.vir_line[0] != '>') +*************** +*** 2079,2085 **** + write_viminfo_search_pattern(fp_out); + write_viminfo_sub_string(fp_out); + #ifdef FEAT_CMDHIST +! write_viminfo_history(fp_out); + #endif + write_viminfo_registers(fp_out); + #ifdef FEAT_EVAL +--- 2083,2089 ---- + write_viminfo_search_pattern(fp_out); + write_viminfo_sub_string(fp_out); + #ifdef FEAT_CMDHIST +! write_viminfo_history(fp_out, merge); + #endif + write_viminfo_registers(fp_out); + #ifdef FEAT_EVAL +*** ../vim-7.3.1196/src/ex_getln.c 2013-06-08 18:19:39.000000000 +0200 +--- src/ex_getln.c 2013-06-15 16:23:57.000000000 +0200 +*************** +*** 6003,6008 **** +--- 6003,6011 ---- + #endif + + #if (defined(FEAT_VIMINFO) && defined(FEAT_CMDHIST)) || defined(PROTO) ++ /* ++ * Buffers for history read from a viminfo file. Only valid while reading. ++ */ + static char_u **viminfo_history[HIST_COUNT] = {NULL, NULL, NULL, NULL}; + static int viminfo_hisidx[HIST_COUNT] = {0, 0, 0, 0}; + static int viminfo_hislen[HIST_COUNT] = {0, 0, 0, 0}; +*************** +*** 6184,6192 **** + } + } + + void +! write_viminfo_history(fp) + FILE *fp; + { + int i; + int type; +--- 6187,6202 ---- + } + } + ++ /* ++ * Write history to viminfo file in "fp". ++ * When "merge" is TRUE merge history lines with a previously read viminfo ++ * file, data is in viminfo_history[]. ++ * When "merge" is FALSE just write all history lines. Used for ":wviminfo!". ++ */ + void +! write_viminfo_history(fp, merge) + FILE *fp; ++ int merge; + { + int i; + int type; +*************** +*** 6236,6242 **** + p = round == 1 ? history[type][i].hisstr + : viminfo_history[type] == NULL ? NULL + : viminfo_history[type][i]; +! if (p != NULL && (round == 2 || !history[type][i].viminfo)) + { + --num_saved; + fputc(hist_type2char(type, TRUE), fp); +--- 6246,6254 ---- + p = round == 1 ? history[type][i].hisstr + : viminfo_history[type] == NULL ? NULL + : viminfo_history[type][i]; +! if (p != NULL && (round == 2 +! || !merge +! || !history[type][i].viminfo)) + { + --num_saved; + fputc(hist_type2char(type, TRUE), fp); +*** ../vim-7.3.1196/src/proto/ex_getln.pro 2013-04-14 23:19:32.000000000 +0200 +--- src/proto/ex_getln.pro 2013-06-15 16:20:46.000000000 +0200 +*************** +*** 51,57 **** + void prepare_viminfo_history __ARGS((int asklen, int writing)); + int read_viminfo_history __ARGS((vir_T *virp, int writing)); + void finish_viminfo_history __ARGS((void)); +! void write_viminfo_history __ARGS((FILE *fp)); + void cmd_pchar __ARGS((int c, int offset)); + int cmd_gchar __ARGS((int offset)); + char_u *script_get __ARGS((exarg_T *eap, char_u *cmd)); +--- 51,57 ---- + void prepare_viminfo_history __ARGS((int asklen, int writing)); + int read_viminfo_history __ARGS((vir_T *virp, int writing)); + void finish_viminfo_history __ARGS((void)); +! void write_viminfo_history __ARGS((FILE *fp, int merge)); + void cmd_pchar __ARGS((int c, int offset)); + int cmd_gchar __ARGS((int offset)); + char_u *script_get __ARGS((exarg_T *eap, char_u *cmd)); +*** ../vim-7.3.1196/src/version.c 2013-06-15 15:09:44.000000000 +0200 +--- src/version.c 2013-06-15 16:13:55.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1197, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +216. Your pet rock leaves home. + + /// 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 /// diff --git a/7.3.1198 b/7.3.1198 new file mode 100644 index 0000000..e2237b2 --- /dev/null +++ b/7.3.1198 @@ -0,0 +1,91 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1198 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1198 +Problem: Build error when using Perl 5.18.0 and dynamic loading. +Solution: Change #ifdefs for Perl_croak_xs_usage. (Ike Devolder) +Files: src/if_perl.xs + + +*** ../vim-7.3.1197/src/if_perl.xs 2013-05-06 04:21:35.000000000 +0200 +--- src/if_perl.xs 2013-06-15 16:42:45.000000000 +0200 +*************** +*** 67,72 **** +--- 67,76 ---- + # define PERL5101_OR_LATER + #endif + ++ #if (PERL_REVISION == 5) && (PERL_VERSION >= 18) ++ # define PERL5180_OR_LATER ++ #endif ++ + #ifndef pTHX + # define pTHX void + # define pTHX_ +*************** +*** 127,135 **** +--- 131,141 ---- + # define perl_free dll_perl_free + # define Perl_get_context dll_Perl_get_context + # define Perl_croak dll_Perl_croak ++ # ifndef PERL5180_OR_LATER + # ifdef PERL5101_OR_LATER + # define Perl_croak_xs_usage dll_Perl_croak_xs_usage + # endif ++ # endif + # ifndef PROTO + # define Perl_croak_nocontext dll_Perl_croak_nocontext + # define Perl_call_argv dll_Perl_call_argv +*************** +*** 242,250 **** +--- 248,258 ---- + static int (*perl_parse)(PerlInterpreter*, XSINIT_t, int, char**, char**); + static void* (*Perl_get_context)(void); + static void (*Perl_croak)(pTHX_ const char*, ...); ++ #ifndef PERL5180_OR_LATER + #ifdef PERL5101_OR_LATER + static void (*Perl_croak_xs_usage)(pTHX_ const CV *const, const char *const params); + #endif ++ #endif + static void (*Perl_croak_nocontext)(const char*, ...); + static I32 (*Perl_dowantarray)(pTHX); + static void (*Perl_free_tmps)(pTHX); +*************** +*** 362,370 **** +--- 370,380 ---- + {"perl_parse", (PERL_PROC*)&perl_parse}, + {"Perl_get_context", (PERL_PROC*)&Perl_get_context}, + {"Perl_croak", (PERL_PROC*)&Perl_croak}, ++ #ifndef PERL5180_OR_LATER + #ifdef PERL5101_OR_LATER + {"Perl_croak_xs_usage", (PERL_PROC*)&Perl_croak_xs_usage}, + #endif ++ #endif + {"Perl_croak_nocontext", (PERL_PROC*)&Perl_croak_nocontext}, + {"Perl_dowantarray", (PERL_PROC*)&Perl_dowantarray}, + {"Perl_free_tmps", (PERL_PROC*)&Perl_free_tmps}, +*** ../vim-7.3.1197/src/version.c 2013-06-15 16:31:41.000000000 +0200 +--- src/version.c 2013-06-15 16:42:08.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1198, + /**/ + +-- +I noticed my daughter's Disney-net password on a sticky note: +"MickeyMinnieGoofyPluto". I asked her why it was so long. +"Because they say it has to have at least four characters." + + /// 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 /// diff --git a/7.3.1199 b/7.3.1199 new file mode 100644 index 0000000..515ec3a --- /dev/null +++ b/7.3.1199 @@ -0,0 +1,124 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1199 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1199 +Problem: When evaluating 'foldexpr' causes an error this is silently + ignored and evaluation is retried every time. +Solution: Set emsg_silent instead of emsg_off. Stop evaluating 'foldexpr' is + it is causing errors. (Christian Brabandt) +Files: src/fold.c + + +*** ../vim-7.3.1198/src/fold.c 2012-08-29 15:22:14.000000000 +0200 +--- src/fold.c 2013-06-15 16:57:24.000000000 +0200 +*************** +*** 1930,1937 **** + char_u *buf; + { + char_u *text = NULL; +- + #ifdef FEAT_EVAL + if (*wp->w_p_fdt != NUL) + { + char_u dashes[MAX_LEVEL + 2]; +--- 1930,1951 ---- + char_u *buf; + { + char_u *text = NULL; + #ifdef FEAT_EVAL ++ /* an error occurred when evaluating 'fdt' setting */ ++ static int got_fdt_error = FALSE; ++ int save_did_emsg = did_emsg; ++ static win_T *last_wp = NULL; ++ static linenr_T last_lnum = 0; ++ ++ if (last_wp != wp || last_wp == NULL ++ || last_lnum > lnum || last_lnum == 0) ++ /* window changed, try evaluating foldtext setting once again */ ++ got_fdt_error = FALSE; ++ ++ if (!got_fdt_error) ++ /* a previous error should not abort evaluating 'foldexpr' */ ++ did_emsg = FALSE; ++ + if (*wp->w_p_fdt != NUL) + { + char_u dashes[MAX_LEVEL + 2]; +*************** +*** 1952,1970 **** + dashes[level] = NUL; + set_vim_var_string(VV_FOLDDASHES, dashes, -1); + set_vim_var_nr(VV_FOLDLEVEL, (long)level); +- save_curwin = curwin; +- curwin = wp; +- curbuf = wp->w_buffer; + +! ++emsg_off; +! text = eval_to_string_safe(wp->w_p_fdt, NULL, + was_set_insecurely((char_u *)"foldtext", OPT_LOCAL)); +! --emsg_off; + +! curwin = save_curwin; +! curbuf = curwin->w_buffer; + set_vim_var_string(VV_FOLDDASHES, NULL, -1); + + if (text != NULL) + { + /* Replace unprintable characters, if there are any. But +--- 1966,1997 ---- + dashes[level] = NUL; + set_vim_var_string(VV_FOLDDASHES, dashes, -1); + set_vim_var_nr(VV_FOLDLEVEL, (long)level); + +! /* skip evaluating foldtext on errors */ +! if (!got_fdt_error) +! { +! save_curwin = curwin; +! curwin = wp; +! curbuf = wp->w_buffer; +! +! ++emsg_silent; /* handle exceptions, but don't display errors */ +! text = eval_to_string_safe(wp->w_p_fdt, NULL, + was_set_insecurely((char_u *)"foldtext", OPT_LOCAL)); +! --emsg_silent; +! +! if (text == NULL || did_emsg) +! got_fdt_error = TRUE; + +! curwin = save_curwin; +! curbuf = curwin->w_buffer; +! } +! last_lnum = lnum; +! last_wp = wp; + set_vim_var_string(VV_FOLDDASHES, NULL, -1); + ++ if (!did_emsg && save_did_emsg) ++ did_emsg = save_did_emsg; ++ + if (text != NULL) + { + /* Replace unprintable characters, if there are any. But +*** ../vim-7.3.1198/src/version.c 2013-06-15 16:47:31.000000000 +0200 +--- src/version.c 2013-06-15 16:53:16.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1199, + /**/ + +-- +'Psychologist' -- Someone who looks at everyone else when +an attractive woman enters the room. + + /// 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 /// diff --git a/7.3.1200 b/7.3.1200 new file mode 100644 index 0000000..883b8f3 --- /dev/null +++ b/7.3.1200 @@ -0,0 +1,101 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1200 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1200 +Problem: When calling setline() from Insert mode, using CTRL-R =, undo does + not work properly. (Israel Chauca) +Solution: Sync undo after evaluating the expression. (Christian Brabandt) +Files: src/edit.c, src/testdir/test61.in, src/testdir/test61.ok + + +*** ../vim-7.3.1199/src/edit.c 2013-06-08 18:19:39.000000000 +0200 +--- src/edit.c 2013-06-15 17:31:18.000000000 +0200 +*************** +*** 8126,8135 **** + --no_mapping; + + #ifdef FEAT_EVAL +! /* +! * Don't call u_sync() while getting the expression, +! * evaluating it or giving an error message for it! +! */ + ++no_u_sync; + if (regname == '=') + { +--- 8126,8133 ---- + --no_mapping; + + #ifdef FEAT_EVAL +! /* Don't call u_sync() while typing the expression or giving an error +! * message for it. Only call it explicitly. */ + ++no_u_sync; + if (regname == '=') + { +*************** +*** 8142,8147 **** +--- 8140,8148 ---- + if (im_on) + im_set_active(TRUE); + # endif ++ if (regname == '=') ++ /* sync undo, so the effect of e.g., setline() can be undone */ ++ u_sync(TRUE); + } + if (regname == NUL || !valid_yank_reg(regname, FALSE)) + { +*** ../vim-7.3.1199/src/testdir/test61.in 2010-09-14 12:47:30.000000000 +0200 +--- src/testdir/test61.in 2013-06-15 17:25:53.000000000 +0200 +*************** +*** 84,89 **** +--- 84,99 ---- + ggO---:0put b + ggO---:0put a + ggO---:w >>test.out ++ :so small.vim ++ :set nocp ++ :enew! ++ oa ++ :set ul=100 ++ ob ++ :set ul=100 ++ o1a2=setline('.','1234') ++ ++ uu:%w >>test.out + :qa! + ENDTEST + +*** ../vim-7.3.1199/src/testdir/test61.ok 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/test61.ok 2013-06-15 17:25:53.000000000 +0200 +*************** +*** 41,43 **** +--- 41,46 ---- + two + two + three ++ ++ a ++ b +*** ../vim-7.3.1199/src/version.c 2013-06-15 17:06:31.000000000 +0200 +--- src/version.c 2013-06-15 17:39:37.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1200, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +217. Your sex life has drastically improved...so what if it's only cyber-sex! + + /// 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 /// diff --git a/7.3.1201 b/7.3.1201 new file mode 100644 index 0000000..c3ebc5d --- /dev/null +++ b/7.3.1201 @@ -0,0 +1,70 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1201 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1201 +Problem: When a startup script creates a preview window, it probably + becomes the current window. +Solution: Make another window the current one. (Christian Brabandt) +Files: src/main.c + + +*** ../vim-7.3.1200/src/main.c 2013-06-12 20:35:46.000000000 +0200 +--- src/main.c 2013-06-15 21:46:31.000000000 +0200 +*************** +*** 2816,2822 **** + # ifdef FEAT_AUTOCMD + --autocmd_no_enter; + # endif +! win_enter(firstwin, FALSE); /* back to first window */ + # ifdef FEAT_AUTOCMD + --autocmd_no_leave; + # endif +--- 2816,2840 ---- + # ifdef FEAT_AUTOCMD + --autocmd_no_enter; + # endif +! #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) +! /* +! * Avoid making a preview window the current window. +! */ +! if (firstwin->w_p_pvw) +! { +! win_T *win; +! +! for (win = firstwin; win != NULL; win = win->w_next) +! if (!win->w_p_pvw) +! { +! firstwin = win; +! break; +! } +! } +! #endif +! /* make the first window the current window */ +! win_enter(firstwin, FALSE); +! + # ifdef FEAT_AUTOCMD + --autocmd_no_leave; + # endif +*** ../vim-7.3.1200/src/version.c 2013-06-15 17:54:36.000000000 +0200 +--- src/version.c 2013-06-15 21:48:57.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1201, + /**/ + +-- +How do I set the laser printer to stun? + + /// 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 /// diff --git a/7.3.1202 b/7.3.1202 new file mode 100644 index 0000000..16af909 --- /dev/null +++ b/7.3.1202 @@ -0,0 +1,59 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1202 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1202 (after 7.3.660) +Problem: Tags are not found in case-folded tags file. (Darren cole, Issue + 90) +Solution: Take into account that when case folding was used for the tags + file "!rm" sorts before the "!_TAG" header lines. +Files: src/tag.c + + +*** ../vim-7.3.1201/src/tag.c 2013-06-08 18:19:40.000000000 +0200 +--- src/tag.c 2013-06-15 22:26:26.000000000 +0200 +*************** +*** 1797,1803 **** + */ + if (state == TS_START) + { +! if (STRNCMP(lbuf, "!_TAG_", 6) == 0) + { + /* + * Read header line. +--- 1797,1808 ---- + */ + if (state == TS_START) + { +! /* The header ends when the line sorts below "!_TAG_". +! * There may be non-header items before the header though, +! * e.g. "!" itself. When case is folded lower case letters +! * sort before "_". */ +! if (STRNCMP(lbuf, "!_TAG_", 6) <= 0 +! || (lbuf[0] == '!' && ASCII_ISLOWER(lbuf[1]))) + { + /* + * Read header line. +*** ../vim-7.3.1201/src/version.c 2013-06-15 21:54:11.000000000 +0200 +--- src/version.c 2013-06-15 22:24:58.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1202, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +220. Your wife asks for sex and you tell her where to find you on IRC. + + /// 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 /// diff --git a/7.3.1203 b/7.3.1203 new file mode 100644 index 0000000..9dead07 --- /dev/null +++ b/7.3.1203 @@ -0,0 +1,50 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1203 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1203 +Problem: Matches from matchadd() might be highlighted incorrectly when they + are at a fixed position and inserting lines. (John Szakmeister) +Solution: Redraw all lines below a change if there are highlighted matches. + (idea by Christian Brabandt) +Files: src/screen.c + + +*** ../vim-7.3.1202/src/screen.c 2013-06-08 18:19:40.000000000 +0200 +--- src/screen.c 2013-06-15 22:57:25.000000000 +0200 +*************** +*** 1638,1643 **** +--- 1638,1647 ---- + # endif + syntax_check_changed(lnum))) + #endif ++ #ifdef FEAT_SEARCH_EXTRA ++ /* match in fixed position might need redraw */ ++ || wp->w_match_head != NULL ++ #endif + ))))) + { + #ifdef FEAT_SEARCH_EXTRA +*** ../vim-7.3.1202/src/version.c 2013-06-15 22:26:46.000000000 +0200 +--- src/version.c 2013-06-15 22:59:43.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1203, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +221. Your wife melts your keyboard in the oven. + + /// 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 /// diff --git a/7.3.1204 b/7.3.1204 new file mode 100644 index 0000000..7d07fae --- /dev/null +++ b/7.3.1204 @@ -0,0 +1,289 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1204 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1204 +Problem: Calling gettabwinvar() in 'tabline' cancels Visual mode. (Hirohito + Higashi) +Solution: Don't always use goto_tabpage_tp(). +Files: src/window.c, src/proto/window.pro, src/eval.c, src/if_py_both.h + + +*** ../vim-7.3.1203/src/window.c 2013-06-08 18:19:40.000000000 +0200 +--- src/window.c 2013-06-16 14:08:52.000000000 +0200 +*************** +*** 3774,3780 **** + /* We would like doing the TabEnter event first, but we don't have a + * valid current window yet, which may break some commands. + * This triggers autocommands, thus may make "tp" invalid. */ +! win_enter_ext(tp->tp_curwin, FALSE, TRUE, trigger_enter_autocmds, trigger_leave_autocmds); + prevwin = next_prevwin; + + last_status(FALSE); /* status line may appear or disappear */ +--- 3774,3781 ---- + /* We would like doing the TabEnter event first, but we don't have a + * valid current window yet, which may break some commands. + * This triggers autocommands, thus may make "tp" invalid. */ +! win_enter_ext(tp->tp_curwin, FALSE, TRUE, +! trigger_enter_autocmds, trigger_leave_autocmds); + prevwin = next_prevwin; + + last_status(FALSE); /* status line may appear or disappear */ +*************** +*** 6575,6588 **** + * Set "win" to be the curwin and "tp" to be the current tab page. + * restore_win() MUST be called to undo. + * No autocommands will be executed. + * Returns FAIL if switching to "win" failed. + */ + int +! switch_win(save_curwin, save_curtab, win, tp) + win_T **save_curwin; + tabpage_T **save_curtab; + win_T *win; + tabpage_T *tp; + { + # ifdef FEAT_AUTOCMD + block_autocmds(); +--- 6576,6592 ---- + * Set "win" to be the curwin and "tp" to be the current tab page. + * restore_win() MUST be called to undo. + * No autocommands will be executed. ++ * When "no_display" is TRUE the display won't be affected, no redraw is ++ * triggered, another tabpage access is limited. + * Returns FAIL if switching to "win" failed. + */ + int +! switch_win(save_curwin, save_curtab, win, tp, no_display) + win_T **save_curwin; + tabpage_T **save_curtab; + win_T *win; + tabpage_T *tp; ++ int no_display; + { + # ifdef FEAT_AUTOCMD + block_autocmds(); +*************** +*** 6592,6598 **** + if (tp != NULL) + { + *save_curtab = curtab; +! goto_tabpage_tp(tp, FALSE, FALSE); + } + if (!win_valid(win)) + { +--- 6596,6611 ---- + if (tp != NULL) + { + *save_curtab = curtab; +! if (no_display) +! { +! curtab->tp_firstwin = firstwin; +! curtab->tp_lastwin = lastwin; +! curtab = tp; +! firstwin = curtab->tp_firstwin; +! lastwin = curtab->tp_lastwin; +! } +! else +! goto_tabpage_tp(tp, FALSE, FALSE); + } + if (!win_valid(win)) + { +*************** +*** 6609,6623 **** + + /* + * Restore current tabpage and window saved by switch_win(), if still valid. + */ + void +! restore_win(save_curwin, save_curtab) + win_T *save_curwin; + tabpage_T *save_curtab; + { + # ifdef FEAT_WINDOWS + if (save_curtab != NULL && valid_tabpage(save_curtab)) +! goto_tabpage_tp(save_curtab, FALSE, FALSE); + if (win_valid(save_curwin)) + { + curwin = save_curwin; +--- 6622,6650 ---- + + /* + * Restore current tabpage and window saved by switch_win(), if still valid. ++ * When "no_display" is TRUE the display won't be affected, no redraw is ++ * triggered. + */ + void +! restore_win(save_curwin, save_curtab, no_display) + win_T *save_curwin; + tabpage_T *save_curtab; ++ int no_display; + { + # ifdef FEAT_WINDOWS + if (save_curtab != NULL && valid_tabpage(save_curtab)) +! { +! if (no_display) +! { +! curtab->tp_firstwin = firstwin; +! curtab->tp_lastwin = lastwin; +! curtab = save_curtab; +! firstwin = curtab->tp_firstwin; +! lastwin = curtab->tp_lastwin; +! } +! else +! goto_tabpage_tp(save_curtab, FALSE, FALSE); +! } + if (win_valid(save_curwin)) + { + curwin = save_curwin; +*** ../vim-7.3.1203/src/proto/window.pro 2013-05-17 16:03:53.000000000 +0200 +--- src/proto/window.pro 2013-06-16 13:48:18.000000000 +0200 +*************** +*** 70,77 **** + void check_lnums __ARGS((int do_curwin)); + void make_snapshot __ARGS((int idx)); + void restore_snapshot __ARGS((int idx, int close_curwin)); +! int switch_win __ARGS((win_T **save_curwin, tabpage_T **save_curtab, win_T *win, tabpage_T *tp)); +! void restore_win __ARGS((win_T *save_curwin, tabpage_T *save_curtab)); + void switch_buffer __ARGS((buf_T **save_curbuf, buf_T *buf)); + void restore_buffer __ARGS((buf_T *save_curbuf)); + int win_hasvertsplit __ARGS((void)); +--- 70,77 ---- + void check_lnums __ARGS((int do_curwin)); + void make_snapshot __ARGS((int idx)); + void restore_snapshot __ARGS((int idx, int close_curwin)); +! int switch_win __ARGS((win_T **save_curwin, tabpage_T **save_curtab, win_T *win, tabpage_T *tp, int no_display)); +! void restore_win __ARGS((win_T *save_curwin, tabpage_T *save_curtab, int no_display)); + void switch_buffer __ARGS((buf_T **save_curbuf, buf_T *buf)); + void restore_buffer __ARGS((buf_T *save_curbuf)); + int win_hasvertsplit __ARGS((void)); +*** ../vim-7.3.1203/src/eval.c 2013-06-13 21:24:01.000000000 +0200 +--- src/eval.c 2013-06-16 14:03:15.000000000 +0200 +*************** +*** 11952,11958 **** + { + /* Set curwin to be our win, temporarily. Also set the tabpage, + * otherwise the window is not valid. */ +! switch_win(&oldcurwin, &oldtabpage, win, tp); + + if (*varname == '&') /* window-local-option */ + { +--- 11952,11958 ---- + { + /* Set curwin to be our win, temporarily. Also set the tabpage, + * otherwise the window is not valid. */ +! switch_win(&oldcurwin, &oldtabpage, win, tp, TRUE); + + if (*varname == '&') /* window-local-option */ + { +*************** +*** 11972,11978 **** + } + + /* restore previous notion of curwin */ +! restore_win(oldcurwin, oldtabpage); + } + + if (!done && argvars[off + 2].v_type != VAR_UNKNOWN) +--- 11972,11978 ---- + } + + /* restore previous notion of curwin */ +! restore_win(oldcurwin, oldtabpage, TRUE); + } + + if (!done && argvars[off + 2].v_type != VAR_UNKNOWN) +*************** +*** 16775,16781 **** + if (win != NULL && varname != NULL && varp != NULL) + { + #ifdef FEAT_WINDOWS +! if (switch_win(&save_curwin, &save_curtab, win, tp) == FAIL) + return; + #endif + +--- 16775,16781 ---- + if (win != NULL && varname != NULL && varp != NULL) + { + #ifdef FEAT_WINDOWS +! if (switch_win(&save_curwin, &save_curtab, win, tp, TRUE) == FAIL) + return; + #endif + +*************** +*** 16804,16810 **** + } + + #ifdef FEAT_WINDOWS +! restore_win(save_curwin, save_curtab); + #endif + } + } +--- 16804,16810 ---- + } + + #ifdef FEAT_WINDOWS +! restore_win(save_curwin, save_curtab, TRUE); + #endif + } + } +*** ../vim-7.3.1203/src/if_py_both.h 2013-06-12 18:13:31.000000000 +0200 +--- src/if_py_both.h 2013-06-16 13:54:21.000000000 +0200 +*************** +*** 2706,2712 **** + { + case SREQ_WIN: + if (switch_win(&save_curwin, &save_curtab, (win_T *)from, +! win_find_tabpage((win_T *)from)) == FAIL) + { + if (VimTryEnd()) + return -1; +--- 2702,2708 ---- + { + case SREQ_WIN: + if (switch_win(&save_curwin, &save_curtab, (win_T *)from, +! win_find_tabpage((win_T *)from), FALSE) == FAIL) + { + if (VimTryEnd()) + return -1; +*************** +*** 2714,2720 **** + return -1; + } + r = set_option_value_err(key, numval, stringval, opt_flags); +! restore_win(save_curwin, save_curtab); + if (r == FAIL) + return -1; + break; +--- 2710,2716 ---- + return -1; + } + r = set_option_value_err(key, numval, stringval, opt_flags); +! restore_win(save_curwin, save_curtab, FALSE); + if (r == FAIL) + return -1; + break; +*** ../vim-7.3.1203/src/version.c 2013-06-15 23:00:26.000000000 +0200 +--- src/version.c 2013-06-16 13:44:37.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1204, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +224. You set up your own Web page. You set up a Web page for each + of your kids... and your pets. + + /// 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 /// diff --git a/7.3.1205 b/7.3.1205 new file mode 100644 index 0000000..623aa55 --- /dev/null +++ b/7.3.1205 @@ -0,0 +1,52 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1205 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1205 +Problem: logtalk.dict is not removed on uninstall. +Solution: Remove the file. (Kazunobu Kuriyama) +Files: src/Makefile + + +*** ../vim-7.3.1204/src/Makefile 2013-05-21 13:30:17.000000000 +0200 +--- src/Makefile 2013-06-16 14:13:15.000000000 +0200 +*************** +*** 2311,2317 **** + -rm -rf $(DEST_COMP) + -rm -f $(DEST_PRINT)/*.ps + -rmdir $(DEST_HELP) $(DEST_PRINT) $(DEST_COL) $(DEST_SYN) $(DEST_IND) +! -rm -rf $(DEST_FTP)/*.vim $(DEST_FTP)/README.txt + -rm -f $(DEST_AUTO)/*.vim $(DEST_AUTO)/README.txt $(DEST_AUTO)/xml/*.vim + -rm -f $(DEST_PLUG)/*.vim $(DEST_PLUG)/README.txt + -rmdir $(DEST_FTP) $(DEST_AUTO)/xml $(DEST_AUTO) $(DEST_PLUG) $(DEST_RT) +--- 2311,2317 ---- + -rm -rf $(DEST_COMP) + -rm -f $(DEST_PRINT)/*.ps + -rmdir $(DEST_HELP) $(DEST_PRINT) $(DEST_COL) $(DEST_SYN) $(DEST_IND) +! -rm -rf $(DEST_FTP)/*.vim $(DEST_FTP)/README.txt $(DEST_FTP)/logtalk.dict + -rm -f $(DEST_AUTO)/*.vim $(DEST_AUTO)/README.txt $(DEST_AUTO)/xml/*.vim + -rm -f $(DEST_PLUG)/*.vim $(DEST_PLUG)/README.txt + -rmdir $(DEST_FTP) $(DEST_AUTO)/xml $(DEST_AUTO) $(DEST_PLUG) $(DEST_RT) +*** ../vim-7.3.1204/src/version.c 2013-06-16 14:18:20.000000000 +0200 +--- src/version.c 2013-06-16 14:19:23.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1205, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +225. You sign up for free subscriptions for all the computer magazines + + /// 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 /// diff --git a/7.3.1206 b/7.3.1206 new file mode 100644 index 0000000..ab40f7d --- /dev/null +++ b/7.3.1206 @@ -0,0 +1,138 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1206 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1206 +Problem: Inconsistent function argument declarations. +Solution: Use ANSI style. +Files: src/if_py_both.h + + +*** ../vim-7.3.1205/src/if_py_both.h 2013-06-16 14:18:20.000000000 +0200 +--- src/if_py_both.h 2013-06-16 14:24:51.000000000 +0200 +*************** +*** 1278,1284 **** + } + + static dict_T * +! py_dict_alloc() + { + dict_T *r; + +--- 1278,1284 ---- + } + + static dict_T * +! py_dict_alloc(void) + { + dict_T *r; + +*************** +*** 1545,1551 **** + } + + static PyInt +! DictionaryAssItem(DictionaryObject *self, PyObject *keyObject, PyObject *valObject) + { + char_u *key; + typval_T tv; +--- 1545,1552 ---- + } + + static PyInt +! DictionaryAssItem( +! DictionaryObject *self, PyObject *keyObject, PyObject *valObject) + { + char_u *key; + typval_T tv; +*************** +*** 2669,2679 **** + } + + static int +! set_option_value_err(key, numval, stringval, opt_flags) +! char_u *key; +! int numval; +! char_u *stringval; +! int opt_flags; + { + char_u *errmsg; + +--- 2670,2676 ---- + } + + static int +! set_option_value_err(char_u *key, int numval, char_u *stringval, int opt_flags) + { + char_u *errmsg; + +*************** +*** 2688,2700 **** + } + + static int +! set_option_value_for(key, numval, stringval, opt_flags, opt_type, from) +! char_u *key; +! int numval; +! char_u *stringval; +! int opt_flags; +! int opt_type; +! void *from; + { + win_T *save_curwin = NULL; + tabpage_T *save_curtab = NULL; +--- 2685,2697 ---- + } + + static int +! set_option_value_for( +! char_u *key, +! int numval, +! char_u *stringval, +! int opt_flags, +! int opt_type, +! void *from) + { + win_T *save_curwin = NULL; + tabpage_T *save_curtab = NULL; +*************** +*** 5619,5625 **** + } + + static int +! init_sys_path() + { + PyObject *path; + PyObject *path_hook; +--- 5616,5622 ---- + } + + static int +! init_sys_path(void) + { + PyObject *path; + PyObject *path_hook; +*** ../vim-7.3.1205/src/version.c 2013-06-16 14:20:10.000000000 +0200 +--- src/version.c 2013-06-16 14:25:11.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1206, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +226. You sit down at the computer right after dinner and your spouse + says "See you in the morning." + + /// 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 /// diff --git a/7.3.1207 b/7.3.1207 new file mode 100644 index 0000000..ad8757c --- /dev/null +++ b/7.3.1207 @@ -0,0 +1,74 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1207 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1207 +Problem: New regexp engine: no match found on "#if FOO". (Lech Lorens) +Solution: When adding a state gets skipped don't adjust the index. +Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok + + +*** ../vim-7.3.1206/src/regexp_nfa.c 2013-06-14 22:33:47.000000000 +0200 +--- src/regexp_nfa.c 2013-06-16 15:38:15.000000000 +0200 +*************** +*** 4210,4215 **** +--- 4210,4217 ---- + + /* re-order to put the new state at the current position */ + count = l->n - tlen; ++ if (count == 0) ++ return; /* no state got added */ + if (count == 1) + { + /* overwrite the current state */ +*** ../vim-7.3.1206/src/testdir/test64.in 2013-06-15 15:09:44.000000000 +0200 +--- src/testdir/test64.in 2013-06-16 15:38:04.000000000 +0200 +*************** +*** 408,413 **** +--- 408,415 ---- + :"""" Requiring lots of states. + :call add(tl, [2, '[0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}-\)\{3}[0-9a-zA-Z]\{12}', " 12345678-1234-1234-1234-123456789012 ", "12345678-1234-1234-1234-123456789012", "1234-"]) + :" ++ :"""" Skip adding state twice ++ :call add(tl, [2, '^\%(\%(^\s*#\s*if\>\|#\s*if\)\)\(\%>1c.*$\)\@=', "#if FOO", "#if", ' FOO']) + :" + :"""" Run the tests + :" +*** ../vim-7.3.1206/src/testdir/test64.ok 2013-06-15 15:09:44.000000000 +0200 +--- src/testdir/test64.ok 2013-06-16 15:38:22.000000000 +0200 +*************** +*** 913,918 **** +--- 913,921 ---- + OK 0 - [0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}-\)\{3}[0-9a-zA-Z]\{12} + OK 1 - [0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}-\)\{3}[0-9a-zA-Z]\{12} + OK 2 - [0-9a-zA-Z]\{8}-\([0-9a-zA-Z]\{4}-\)\{3}[0-9a-zA-Z]\{12} ++ OK 0 - ^\%(\%(^\s*#\s*if\>\|#\s*if\)\)\(\%>1c.*$\)\@= ++ OK 1 - ^\%(\%(^\s*#\s*if\>\|#\s*if\)\)\(\%>1c.*$\)\@= ++ OK 2 - ^\%(\%(^\s*#\s*if\>\|#\s*if\)\)\(\%>1c.*$\)\@= + multi-line tests + OK 0 - ^.\(.\).\_..\1. + OK 1 - ^.\(.\).\_..\1. +*** ../vim-7.3.1206/src/version.c 2013-06-16 14:25:53.000000000 +0200 +--- src/version.c 2013-06-16 15:42:05.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1207, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +228. You spend Saturday night making the counter on your home page + pass that 2000 mark. + + /// 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 /// diff --git a/7.3.1208 b/7.3.1208 new file mode 100644 index 0000000..0e35189 --- /dev/null +++ b/7.3.1208 @@ -0,0 +1,74 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1208 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1208 +Problem: Compiler warnings on MS-Windows. +Solution: Add type cast. Move variable declaration. (Mike Williams) +Files: src/option.c, src/os_mswin.c + + +*** ../vim-7.3.1207/src/option.c 2013-06-08 18:19:40.000000000 +0200 +--- src/option.c 2013-06-16 15:59:00.000000000 +0200 +*************** +*** 3181,3187 **** + if (opt_idx >= 0) + { + #if !defined(HAVE_AVAIL_MEM) && !defined(HAVE_TOTAL_MEM) +! if ((long)options[opt_idx].def_val[VI_DEFAULT] > n + || (long)options[opt_idx].def_val[VI_DEFAULT] == 0L) + #endif + options[opt_idx].def_val[VI_DEFAULT] = (char_u *)n; +--- 3181,3187 ---- + if (opt_idx >= 0) + { + #if !defined(HAVE_AVAIL_MEM) && !defined(HAVE_TOTAL_MEM) +! if ((long)options[opt_idx].def_val[VI_DEFAULT] > (long)n + || (long)options[opt_idx].def_val[VI_DEFAULT] == 0L) + #endif + options[opt_idx].def_val[VI_DEFAULT] = (char_u *)n; +*** ../vim-7.3.1207/src/os_mswin.c 2013-05-06 04:21:35.000000000 +0200 +--- src/os_mswin.c 2013-06-16 15:59:41.000000000 +0200 +*************** +*** 1897,1903 **** + HWND sender = (HWND)wParam; + COPYDATASTRUCT reply; + char_u *res; +- char_u winstr[30]; + int retval; + char_u *str; + char_u *tofree; +--- 1897,1902 ---- +*************** +*** 1970,1975 **** +--- 1969,1976 ---- + #ifdef FEAT_AUTOCMD + else if (data->dwData == COPYDATA_REPLY) + { ++ char_u winstr[30]; ++ + sprintf((char *)winstr, PRINTF_HEX_LONG_U, (long_u)sender); + apply_autocmds(EVENT_REMOTEREPLY, winstr, str, + TRUE, curbuf); +*** ../vim-7.3.1207/src/version.c 2013-06-16 15:43:43.000000000 +0200 +--- src/version.c 2013-06-16 15:57:31.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1208, + /**/ + +-- +Get a life? What is the URL where it can be downloaded? + + /// 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 /// diff --git a/7.3.1209 b/7.3.1209 new file mode 100644 index 0000000..fe4dd5b --- /dev/null +++ b/7.3.1209 @@ -0,0 +1,45 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1209 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1209 +Problem: No completion for ":tabdo". +Solution: Add tabdo to the list of modifiers. (Dominique Pelle) +Files: src/ex_docmd.c + + +*** ../vim-7.3.1208/src/ex_docmd.c 2013-06-14 19:15:52.000000000 +0200 +--- src/ex_docmd.c 2013-06-16 16:11:32.000000000 +0200 +*************** +*** 3603,3608 **** +--- 3603,3609 ---- + case CMD_sandbox: + case CMD_silent: + case CMD_tab: ++ case CMD_tabdo: + case CMD_topleft: + case CMD_verbose: + case CMD_vertical: +*** ../vim-7.3.1208/src/version.c 2013-06-16 16:01:20.000000000 +0200 +--- src/version.c 2013-06-16 16:12:14.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1209, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +232. You start conversations with, "Have you gotten an ISDN line?" + + /// 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 /// diff --git a/7.3.1210 b/7.3.1210 new file mode 100644 index 0000000..33492ef --- /dev/null +++ b/7.3.1210 @@ -0,0 +1,69 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1210 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1210 (after 7.3.1182) +Problem: 'backupcopy' default on MS-Windows is wrong when 'encoding' equals + the current codepage. +Solution: Change the #else block. (Ken Takata) +Files: src/os_win32.c + + +*** ../vim-7.3.1209/src/os_win32.c 2013-06-12 22:41:30.000000000 +0200 +--- src/os_win32.c 2013-06-16 16:29:34.000000000 +0200 +*************** +*** 2789,2802 **** + reparseTag = findDataW.dwReserved0; + } + } +! #else +! hFind = FindFirstFile(fname, &findDataA); +! if (hFind != INVALID_HANDLE_VALUE) + { +! fileFlags = findDataA.dwFileAttributes; +! reparseTag = findDataA.dwReserved0; + } +- #endif + + if (hFind != INVALID_HANDLE_VALUE) + FindClose(hFind); +--- 2789,2804 ---- + reparseTag = findDataW.dwReserved0; + } + } +! else +! #endif + { +! hFind = FindFirstFile(fname, &findDataA); +! if (hFind != INVALID_HANDLE_VALUE) +! { +! fileFlags = findDataA.dwFileAttributes; +! reparseTag = findDataA.dwReserved0; +! } + } + + if (hFind != INVALID_HANDLE_VALUE) + FindClose(hFind); +*** ../vim-7.3.1209/src/version.c 2013-06-16 16:13:59.000000000 +0200 +--- src/version.c 2013-06-16 16:31:14.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1210, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +233. You start dreaming about web pages...in html. + + /// 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 /// diff --git a/7.3.1211 b/7.3.1211 new file mode 100644 index 0000000..9a8dc88 --- /dev/null +++ b/7.3.1211 @@ -0,0 +1,235 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1211 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1211 +Problem: MS-Windows: When 'encoding' differs from the current codepage + ":hardcopy" does not work properly. +Solution: Use TextOutW() and SetDlgItemTextW(). (Ken Takata) +Files: src/os_mswin.c, src/vim.rc + + +*** ../vim-7.3.1210/src/os_mswin.c 2013-06-16 16:01:20.000000000 +0200 +--- src/os_mswin.c 2013-06-16 16:41:11.000000000 +0200 +*************** +*** 1045,1050 **** +--- 1045,1073 ---- + #define IDC_PRINTTEXT2 402 + #define IDC_PROGRESS 403 + ++ #if !defined(FEAT_MBYTE) || defined(WIN16) ++ # define vimSetDlgItemText(h, i, s) SetDlgItemText(h, i, s) ++ #else ++ static BOOL ++ vimSetDlgItemText(HWND hDlg, int nIDDlgItem, char_u *s) ++ { ++ WCHAR *wp = NULL; ++ BOOL ret; ++ ++ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage) ++ { ++ wp = enc_to_utf16(s, NULL); ++ } ++ if (wp != NULL) ++ { ++ ret = SetDlgItemTextW(hDlg, nIDDlgItem, wp); ++ vim_free(wp); ++ return ret; ++ } ++ return SetDlgItemText(hDlg, nIDDlgItem, s); ++ } ++ #endif ++ + /* + * Convert BGR to RGB for Windows GDI calls + */ +*************** +*** 1096,1113 **** + { + SendDlgItemMessage(hDlg, i, WM_SETFONT, (WPARAM)hfont, 1); + if (GetDlgItemText(hDlg,i, buff, sizeof(buff))) +! SetDlgItemText(hDlg,i, _(buff)); + } + SendDlgItemMessage(hDlg, IDCANCEL, + WM_SETFONT, (WPARAM)hfont, 1); + if (GetDlgItemText(hDlg,IDCANCEL, buff, sizeof(buff))) +! SetDlgItemText(hDlg,IDCANCEL, _(buff)); + } + #endif + SetWindowText(hDlg, szAppName); + if (prt_name != NULL) + { +! SetDlgItemText(hDlg, IDC_PRINTTEXT2, (LPSTR)prt_name); + vim_free(prt_name); + prt_name = NULL; + } +--- 1119,1136 ---- + { + SendDlgItemMessage(hDlg, i, WM_SETFONT, (WPARAM)hfont, 1); + if (GetDlgItemText(hDlg,i, buff, sizeof(buff))) +! vimSetDlgItemText(hDlg,i, _(buff)); + } + SendDlgItemMessage(hDlg, IDCANCEL, + WM_SETFONT, (WPARAM)hfont, 1); + if (GetDlgItemText(hDlg,IDCANCEL, buff, sizeof(buff))) +! vimSetDlgItemText(hDlg,IDCANCEL, _(buff)); + } + #endif + SetWindowText(hDlg, szAppName); + if (prt_name != NULL) + { +! vimSetDlgItemText(hDlg, IDC_PRINTTEXT2, (LPSTR)prt_name); + vim_free(prt_name); + prt_name = NULL; + } +*************** +*** 1565,1571 **** + SetAbortProc(prt_dlg.hDC, AbortProc); + #endif + wsprintf(szBuffer, _("Printing '%s'"), gettail(psettings->jobname)); +! SetDlgItemText(hDlgPrint, IDC_PRINTTEXT1, (LPSTR)szBuffer); + + vim_memset(&di, 0, sizeof(DOCINFO)); + di.cbSize = sizeof(DOCINFO); +--- 1588,1594 ---- + SetAbortProc(prt_dlg.hDC, AbortProc); + #endif + wsprintf(szBuffer, _("Printing '%s'"), gettail(psettings->jobname)); +! vimSetDlgItemText(hDlgPrint, IDC_PRINTTEXT1, (LPSTR)szBuffer); + + vim_memset(&di, 0, sizeof(DOCINFO)); + di.cbSize = sizeof(DOCINFO); +*************** +*** 1599,1605 **** + mch_print_begin_page(char_u *msg) + { + if (msg != NULL) +! SetDlgItemText(hDlgPrint, IDC_PROGRESS, (LPSTR)msg); + return (StartPage(prt_dlg.hDC) > 0); + } + +--- 1622,1628 ---- + mch_print_begin_page(char_u *msg) + { + if (msg != NULL) +! vimSetDlgItemText(hDlgPrint, IDC_PROGRESS, (LPSTR)msg); + return (StartPage(prt_dlg.hDC) > 0); + } + +*************** +*** 1628,1637 **** + int + mch_print_text_out(char_u *p, int len) + { +! #ifdef FEAT_PROPORTIONAL_FONTS + SIZE sz; + #endif + + TextOut(prt_dlg.hDC, prt_pos_x + prt_left_margin, + prt_pos_y + prt_top_margin, p, len); + #ifndef FEAT_PROPORTIONAL_FONTS +--- 1651,1691 ---- + int + mch_print_text_out(char_u *p, int len) + { +! #if defined(FEAT_PROPORTIONAL_FONTS) || (defined(FEAT_MBYTE) && !defined(WIN16)) + SIZE sz; + #endif ++ #if defined(FEAT_MBYTE) && !defined(WIN16) ++ WCHAR *wp = NULL; ++ int wlen = len; + ++ if (enc_codepage >= 0 && (int)GetACP() != enc_codepage) ++ { ++ wp = enc_to_utf16(p, &wlen); ++ } ++ if (wp != NULL) ++ { ++ int ret = FALSE; ++ ++ TextOutW(prt_dlg.hDC, prt_pos_x + prt_left_margin, ++ prt_pos_y + prt_top_margin, wp, wlen); ++ GetTextExtentPoint32W(prt_dlg.hDC, wp, wlen, &sz); ++ vim_free(wp); ++ prt_pos_x += (sz.cx - prt_tm.tmOverhang); ++ /* This is wrong when printing spaces for a TAB. */ ++ if (p[len] != NUL) ++ { ++ wlen = MB_PTR2LEN(p + len); ++ wp = enc_to_utf16(p + len, &wlen); ++ if (wp != NULL) ++ { ++ GetTextExtentPoint32W(prt_dlg.hDC, wp, 1, &sz); ++ ret = (prt_pos_x + prt_left_margin + sz.cx > prt_right_margin); ++ vim_free(wp); ++ } ++ } ++ return ret; ++ } ++ #endif + TextOut(prt_dlg.hDC, prt_pos_x + prt_left_margin, + prt_pos_y + prt_top_margin, p, len); + #ifndef FEAT_PROPORTIONAL_FONTS +*************** +*** 1947,1954 **** + reply.cbData = (DWORD)STRLEN(res) + 1; + + serverSendEnc(sender); +! retval = (int)SendMessage(sender, WM_COPYDATA, (WPARAM)message_window, +! (LPARAM)(&reply)); + vim_free(res); + return retval; + +--- 2001,2008 ---- + reply.cbData = (DWORD)STRLEN(res) + 1; + + serverSendEnc(sender); +! retval = (int)SendMessage(sender, WM_COPYDATA, +! (WPARAM)message_window, (LPARAM)(&reply)); + vim_free(res); + return retval; + +*** ../vim-7.3.1210/src/vim.rc 2010-08-15 21:57:30.000000000 +0200 +--- src/vim.rc 2013-06-16 16:37:33.000000000 +0200 +*************** +*** 116,123 **** + FONT 8, "Helv" + BEGIN + DEFPUSHBUTTON "Cancel", IDCANCEL, 85, 60, 40, 14 +! CTEXT "Printing",IDC_PRINTTEXT1,23,15,157,8 +! CTEXT " ",IDC_PRINTTEXT2,23,25,157,8 +! CTEXT "Initializing...",IDC_PROGRESS,24,38,157,8 + GROUPBOX "",IDC_BOX1,19,9,170,47 + END +--- 116,123 ---- + FONT 8, "Helv" + BEGIN + DEFPUSHBUTTON "Cancel", IDCANCEL, 85, 60, 40, 14 +! CTEXT "Printing",IDC_PRINTTEXT1,23,15,157,9 +! CTEXT " ",IDC_PRINTTEXT2,23,25,157,9 +! CTEXT "Initializing...",IDC_PROGRESS,24,38,157,9 + GROUPBOX "",IDC_BOX1,19,9,170,47 + END +*** ../vim-7.3.1210/src/version.c 2013-06-16 16:34:53.000000000 +0200 +--- src/version.c 2013-06-16 16:39:19.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1211, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +235. You start naming your kids Pascal, COBOL, Algol and Fortran. + + /// 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 /// diff --git a/7.3.1212 b/7.3.1212 new file mode 100644 index 0000000..1417b5c --- /dev/null +++ b/7.3.1212 @@ -0,0 +1,122 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1212 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1212 +Problem: "make test" on MS-Windows does not report failure like Unix does. +Solution: Make it work like on Unix. (Taro Muraoka) +Files: src/testdir/Make_dos.mak + + +*** ../vim-7.3.1211/src/testdir/Make_dos.mak 2013-06-09 17:52:42.000000000 +0200 +--- src/testdir/Make_dos.mak 2013-06-16 16:52:22.000000000 +0200 +*************** +*** 40,62 **** + + .SUFFIXES: .in .out + +! nongui: fixff $(SCRIPTS16) $(SCRIPTS) +! echo ALL DONE + +! small: +! echo ALL DONE + +! gui: fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS_GUI) +! echo ALL DONE + +! win32: fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS32) +! echo ALL DONE + + fixff: + -$(VIMPROG) -u dos.vim --noplugin "+argdo set ff=dos|upd" +q *.in *.ok + -$(VIMPROG) -u dos.vim --noplugin "+argdo set ff=unix|upd" +q \ + dotest.in test60.ok test71.ok test74.ok + + clean: + -del *.out + -if exist test.ok del test.ok +--- 40,64 ---- + + .SUFFIXES: .in .out + +! nongui: fixff $(SCRIPTS16) $(SCRIPTS) report + +! small: report + +! gui: fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS_GUI) report + +! win32: fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS32) report + + fixff: + -$(VIMPROG) -u dos.vim --noplugin "+argdo set ff=dos|upd" +q *.in *.ok + -$(VIMPROG) -u dos.vim --noplugin "+argdo set ff=unix|upd" +q \ + dotest.in test60.ok test71.ok test74.ok + ++ report: ++ @echo "" ++ @echo Test results: ++ @IF EXIST test.log ( type test.log & echo TEST FAILURE & exit /b 1 ) \ ++ ELSE ( ECHO ALL DONE ) ++ + clean: + -del *.out + -if exist test.ok del test.ok +*************** +*** 67,81 **** + -if exist lua.vim del lua.vim + -del X* + -if exist viminfo del viminfo + + .in.out: + copy $*.ok test.ok + $(VIMPROG) -u dos.vim -U NONE --noplugin -s dotest.in $*.in +! diff test.out $*.ok +! -if exist $*.out del $*.out +! rename test.out $*.out + -del X* + -del X*.* + -del test.ok + -rd /s /q Xfind + -if exist viminfo del viminfo +--- 69,86 ---- + -if exist lua.vim del lua.vim + -del X* + -if exist viminfo del viminfo ++ -del test.log + + .in.out: + copy $*.ok test.ok + $(VIMPROG) -u dos.vim -U NONE --noplugin -s dotest.in $*.in +! @diff test.out $*.ok & if errorlevel 1 (echo $* FAILED >> test.log ) \ +! else ( del /F $*.out & rename test.out $*.out ) + -del X* + -del X*.* + -del test.ok + -rd /s /q Xfind + -if exist viminfo del viminfo ++ ++ nolog: ++ -del test.log +*** ../vim-7.3.1211/src/version.c 2013-06-16 16:41:42.000000000 +0200 +--- src/version.c 2013-06-16 16:54:02.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1212, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +236. You start saving URL's in your digital watch. + + /// 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 /// diff --git a/7.3.1213 b/7.3.1213 new file mode 100644 index 0000000..fc49872 --- /dev/null +++ b/7.3.1213 @@ -0,0 +1,287 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1213 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1213 +Problem: Can't build with small features and Python. +Solution: Adjust #ifdefs. +Files: src/eval.c, src/buffer.c, src/window.c + + +*** ../vim-7.3.1212/src/eval.c 2013-06-16 14:18:20.000000000 +0200 +--- src/eval.c 2013-06-16 17:24:32.000000000 +0200 +*************** +*** 112,118 **** +--- 112,120 ---- + static char *e_letwrong = N_("E734: Wrong variable type for %s="); + static char *e_nofunc = N_("E130: Unknown function: %s"); + static char *e_illvar = N_("E461: Illegal variable name: %s"); ++ #ifdef FEAT_FLOAT + static char *e_float_as_string = N_("E806: using Float as a String"); ++ #endif + + static dictitem_T globvars_var; /* variable used for g: */ + #define globvarht globvardict.dv_hashtab +*************** +*** 11882,11888 **** + static win_T * + find_win_by_nr(vp, tp) + typval_T *vp; +! tabpage_T *tp; /* NULL for current tab page */ + { + #ifdef FEAT_WINDOWS + win_T *wp; +--- 11884,11890 ---- + static win_T * + find_win_by_nr(vp, tp) + typval_T *vp; +! tabpage_T *tp UNUSED; /* NULL for current tab page */ + { + #ifdef FEAT_WINDOWS + win_T *wp; +*************** +*** 11932,11938 **** + win_T *win, *oldcurwin; + char_u *varname; + dictitem_T *v; +! tabpage_T *tp, *oldtabpage; + int done = FALSE; + + #ifdef FEAT_WINDOWS +--- 11934,11941 ---- + win_T *win, *oldcurwin; + char_u *varname; + dictitem_T *v; +! tabpage_T *tp = NULL; +! tabpage_T *oldtabpage; + int done = FALSE; + + #ifdef FEAT_WINDOWS +*************** +*** 16683,16706 **** + typval_T *argvars; + typval_T *rettv; + { + tabpage_T *save_curtab; + char_u *varname, *tabvarname; + typval_T *varp; +- tabpage_T *tp; + + rettv->vval.v_number = 0; + + if (check_restricted() || check_secure()) + return; + + tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL)); + varname = get_tv_string_chk(&argvars[1]); + varp = &argvars[2]; + +! if (tp != NULL && varname != NULL && varp != NULL) + { + save_curtab = curtab; + goto_tabpage_tp(tp, FALSE, FALSE); + + tabvarname = alloc((unsigned)STRLEN(varname) + 3); + if (tabvarname != NULL) +--- 16686,16719 ---- + typval_T *argvars; + typval_T *rettv; + { ++ #ifdef FEAT_WINDOWS + tabpage_T *save_curtab; ++ tabpage_T *tp; ++ #endif + char_u *varname, *tabvarname; + typval_T *varp; + + rettv->vval.v_number = 0; + + if (check_restricted() || check_secure()) + return; + ++ #ifdef FEAT_WINDOWS + tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL)); ++ #endif + varname = get_tv_string_chk(&argvars[1]); + varp = &argvars[2]; + +! if (varname != NULL && varp != NULL +! #ifdef FEAT_WINDOWS +! && tp != NULL +! #endif +! ) + { ++ #ifdef FEAT_WINDOWS + save_curtab = curtab; + goto_tabpage_tp(tp, FALSE, FALSE); ++ #endif + + tabvarname = alloc((unsigned)STRLEN(varname) + 3); + if (tabvarname != NULL) +*************** +*** 16711,16719 **** +--- 16724,16734 ---- + vim_free(tabvarname); + } + ++ #ifdef FEAT_WINDOWS + /* Restore current tabpage */ + if (valid_tabpage(save_curtab)) + goto_tabpage_tp(save_curtab, FALSE, FALSE); ++ #endif + } + } + +*************** +*** 16757,16763 **** + char_u *varname, *winvarname; + typval_T *varp; + char_u nbuf[NUMBUFLEN]; +! tabpage_T *tp; + + if (check_restricted() || check_secure()) + return; +--- 16772,16778 ---- + char_u *varname, *winvarname; + typval_T *varp; + char_u nbuf[NUMBUFLEN]; +! tabpage_T *tp = NULL; + + if (check_restricted() || check_secure()) + return; +*** ../vim-7.3.1212/src/buffer.c 2013-06-08 18:19:39.000000000 +0200 +--- src/buffer.c 2013-06-16 17:14:14.000000000 +0200 +*************** +*** 984,989 **** +--- 984,993 ---- + + return errormsg; + } ++ #endif /* FEAT_LISTCMDS */ ++ ++ #if defined(FEAT_LISTCMDS) || defined(FEAT_PYTHON) \ ++ || defined(FEAT_PYTHON3) || defined(PROTO) + + /* + * Implementation of the commands for the buffer list. +*************** +*** 1364,1371 **** + + return OK; + } +! +! #endif /* FEAT_LISTCMDS */ + + /* + * Set current buffer to "buf". Executes autocommands and closes current +--- 1368,1374 ---- + + return OK; + } +! #endif + + /* + * Set current buffer to "buf". Executes autocommands and closes current +*** ../vim-7.3.1212/src/window.c 2013-06-16 14:18:20.000000000 +0200 +--- src/window.c 2013-06-16 17:25:11.000000000 +0200 +*************** +*** 6582,6592 **** + */ + int + switch_win(save_curwin, save_curtab, win, tp, no_display) +! win_T **save_curwin; +! tabpage_T **save_curtab; +! win_T *win; +! tabpage_T *tp; +! int no_display; + { + # ifdef FEAT_AUTOCMD + block_autocmds(); +--- 6582,6592 ---- + */ + int + switch_win(save_curwin, save_curtab, win, tp, no_display) +! win_T **save_curwin UNUSED; +! tabpage_T **save_curtab UNUSED; +! win_T *win UNUSED; +! tabpage_T *tp UNUSED; +! int no_display UNUSED; + { + # ifdef FEAT_AUTOCMD + block_autocmds(); +*************** +*** 6627,6635 **** + */ + void + restore_win(save_curwin, save_curtab, no_display) +! win_T *save_curwin; +! tabpage_T *save_curtab; +! int no_display; + { + # ifdef FEAT_WINDOWS + if (save_curtab != NULL && valid_tabpage(save_curtab)) +--- 6627,6635 ---- + */ + void + restore_win(save_curwin, save_curtab, no_display) +! win_T *save_curwin UNUSED; +! tabpage_T *save_curtab UNUSED; +! int no_display UNUSED; + { + # ifdef FEAT_WINDOWS + if (save_curtab != NULL && valid_tabpage(save_curtab)) +*************** +*** 6906,6914 **** + } + + int +! get_tab_number(tabpage_T *tp) + { + int i = 1; + tabpage_T *t; + + for (t = first_tabpage; t != NULL && t != tp; t = t->tp_next) +--- 6906,6915 ---- + } + + int +! get_tab_number(tabpage_T *tp UNUSED) + { + int i = 1; ++ # ifdef FEAT_WINDOWS + tabpage_T *t; + + for (t = first_tabpage; t != NULL && t != tp; t = t->tp_next) +*************** +*** 6917,6922 **** +--- 6918,6924 ---- + if (t == NULL) + return 0; + else ++ # endif + return i; + } + #endif +*** ../vim-7.3.1212/src/version.c 2013-06-16 16:57:43.000000000 +0200 +--- src/version.c 2013-06-16 17:30:40.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1213, + /**/ + +-- +You can tune a file system, but you can't tuna fish + -- man tunefs + + /// 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 /// diff --git a/7.3.1214 b/7.3.1214 new file mode 100644 index 0000000..c70443b --- /dev/null +++ b/7.3.1214 @@ -0,0 +1,76 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1214 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1214 +Problem: Missing declaration for init_users() and realloc_post_list(). + (Salman Halim) +Solution: Add the declarations. +Files: src/misc1.c, src/regexp_nfa.c + + +*** ../vim-7.3.1213/src/misc1.c 2013-06-08 18:19:40.000000000 +0200 +--- src/misc1.c 2013-06-16 22:46:01.000000000 +0200 +*************** +*** 16,21 **** +--- 16,22 ---- + + static char_u *vim_version_dir __ARGS((char_u *vimdir)); + static char_u *remove_tail __ARGS((char_u *p, char_u *pend, char_u *name)); ++ static void init_users __ARGS((void)); + static int copy_indent __ARGS((int size, char_u *src)); + + /* All user names (for ~user completion as done by shell). */ +*************** +*** 4487,4493 **** + * Done only once and then cached. + */ + static void +! init_users() { + static int lazy_init_done = FALSE; + + if (lazy_init_done) +--- 4488,4495 ---- + * Done only once and then cached. + */ + static void +! init_users() +! { + static int lazy_init_done = FALSE; + + if (lazy_init_done) +*** ../vim-7.3.1213/src/regexp_nfa.c 2013-06-16 15:43:43.000000000 +0200 +--- src/regexp_nfa.c 2013-06-16 22:46:35.000000000 +0200 +*************** +*** 273,278 **** +--- 273,279 ---- + static int nfa_get_reganch __ARGS((nfa_state_T *start, int depth)); + static int nfa_get_regstart __ARGS((nfa_state_T *start, int depth)); + static char_u *nfa_get_match_text __ARGS((nfa_state_T *start)); ++ static int realloc_post_list __ARGS((void)); + static int nfa_recognize_char_class __ARGS((char_u *start, char_u *end, int extra_newl)); + static int nfa_emit_equi_class __ARGS((int c)); + static int nfa_regatom __ARGS((void)); +*** ../vim-7.3.1213/src/version.c 2013-06-16 17:32:33.000000000 +0200 +--- src/version.c 2013-06-16 22:45:31.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1214, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +239. You think "surfing" is something you do on dry land. + + /// 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 /// diff --git a/7.3.1215 b/7.3.1215 new file mode 100644 index 0000000..3cd3df1 --- /dev/null +++ b/7.3.1215 @@ -0,0 +1,48 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1215 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1215 +Problem: Compiler warning for function not defined. +Solution: Add #ifdef. +Files: src/misc1.c + + +*** ../vim-7.3.1214/src/misc1.c 2013-06-16 22:49:09.000000000 +0200 +--- src/misc1.c 2013-06-17 19:19:27.000000000 +0200 +*************** +*** 16,22 **** +--- 16,24 ---- + + static char_u *vim_version_dir __ARGS((char_u *vimdir)); + static char_u *remove_tail __ARGS((char_u *p, char_u *pend, char_u *name)); ++ #if defined(FEAT_CMDL_COMPL) + static void init_users __ARGS((void)); ++ #endif + static int copy_indent __ARGS((int size, char_u *src)); + + /* All user names (for ~user completion as done by shell). */ +*** ../vim-7.3.1214/src/version.c 2013-06-16 22:49:09.000000000 +0200 +--- src/version.c 2013-06-17 19:20:16.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1215, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +242. You turn down a better-paying job because it doesn't come with + a free e-mail account. + + /// 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 /// diff --git a/7.3.1216 b/7.3.1216 new file mode 100644 index 0000000..91eda39 --- /dev/null +++ b/7.3.1216 @@ -0,0 +1,119 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1216 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1216 +Problem: Configure can't find Motif on Ubuntu. +Solution: Search for libXm in /usr/lib/*-linux-gnu. +Files: src/configure.in, src/auto/configure + + +*** ../vim-7.3.1215/src/configure.in 2013-06-14 21:22:33.000000000 +0200 +--- src/configure.in 2013-06-17 20:15:13.000000000 +0200 +*************** +*** 2277,2284 **** + dnl Remove "-L" from before $GUI_LIB_LOC if it's there + GUI_LIB_LOC="`echo $GUI_LIB_LOC|sed 's%-L%%g'`" + + AC_MSG_CHECKING(for location of Motif GUI libs) +! gui_libs="`echo $x_libraries|sed 's%/[^/][^/]*$%%'` `echo "$gui_XXX" | sed s/XXX/lib/g` `echo "$GUI_INC_LOC" | sed s/include/lib/` $GUI_LIB_LOC" + GUI_LIB_LOC= + for try in $gui_libs; do + for libtry in "$try"/libXm.a "$try"/libXm.so* "$try"/libXm.sl "$try"/libXm.dylib; do +--- 2277,2286 ---- + dnl Remove "-L" from before $GUI_LIB_LOC if it's there + GUI_LIB_LOC="`echo $GUI_LIB_LOC|sed 's%-L%%g'`" + ++ dnl Ubuntu has libXm.so in /usr/lib/i386-linux-gnu and elsewhere. The ++ dnl linker will figure out which one to use, we only check if one exists. + AC_MSG_CHECKING(for location of Motif GUI libs) +! gui_libs="`echo $x_libraries|sed 's%/[^/][^/]*$%%'` `echo "$gui_XXX" | sed s/XXX/lib/g` /usr/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu `echo "$GUI_INC_LOC" | sed s/include/lib/` $GUI_LIB_LOC" + GUI_LIB_LOC= + for try in $gui_libs; do + for libtry in "$try"/libXm.a "$try"/libXm.so* "$try"/libXm.sl "$try"/libXm.dylib; do +*************** +*** 2289,2295 **** + done + if test -n "$GUI_LIB_LOC"; then + dnl Remove /usr/lib, it causes trouble on some systems +! if test "$GUI_LIB_LOC" = /usr/lib; then + GUI_LIB_LOC= + AC_MSG_RESULT(in default path) + else +--- 2291,2299 ---- + done + if test -n "$GUI_LIB_LOC"; then + dnl Remove /usr/lib, it causes trouble on some systems +! if test "$GUI_LIB_LOC" = /usr/lib \ +! -o "$GUI_LIB_LOC" = /usr/lib/i386-linux-gnu \ +! -o "$GUI_LIB_LOC" = /usr/lib/x86_64-linux-gnu; then + GUI_LIB_LOC= + AC_MSG_RESULT(in default path) + else +*** ../vim-7.3.1215/src/auto/configure 2013-06-14 21:22:33.000000000 +0200 +--- src/auto/configure 2013-06-17 20:15:17.000000000 +0200 +*************** +*** 8346,8354 **** + + GUI_LIB_LOC="`echo $GUI_LIB_LOC|sed 's%-L%%g'`" + +! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of Motif GUI libs" >&5 + $as_echo_n "checking for location of Motif GUI libs... " >&6; } +! gui_libs="`echo $x_libraries|sed 's%/^/^/*$%%'` `echo "$gui_XXX" | sed s/XXX/lib/g` `echo "$GUI_INC_LOC" | sed s/include/lib/` $GUI_LIB_LOC" + GUI_LIB_LOC= + for try in $gui_libs; do + for libtry in "$try"/libXm.a "$try"/libXm.so* "$try"/libXm.sl "$try"/libXm.dylib; do +--- 8346,8354 ---- + + GUI_LIB_LOC="`echo $GUI_LIB_LOC|sed 's%-L%%g'`" + +! { $as_echo "$as_me:${as_lineno-$LINENO}: checking for location of Motif GUI libs" >&5 + $as_echo_n "checking for location of Motif GUI libs... " >&6; } +! gui_libs="`echo $x_libraries|sed 's%/^/^/*$%%'` `echo "$gui_XXX" | sed s/XXX/lib/g` /usr/lib/i386-linux-gnu /usr/lib/x86_64-linux-gnu `echo "$GUI_INC_LOC" | sed s/include/lib/` $GUI_LIB_LOC" + GUI_LIB_LOC= + for try in $gui_libs; do + for libtry in "$try"/libXm.a "$try"/libXm.so* "$try"/libXm.sl "$try"/libXm.dylib; do +*************** +*** 8358,8364 **** + done + done + if test -n "$GUI_LIB_LOC"; then +! if test "$GUI_LIB_LOC" = /usr/lib; then + GUI_LIB_LOC= + { $as_echo "$as_me:${as_lineno-$LINENO}: result: in default path" >&5 + $as_echo "in default path" >&6; } +--- 8358,8366 ---- + done + done + if test -n "$GUI_LIB_LOC"; then +! if test "$GUI_LIB_LOC" = /usr/lib \ +! -o "$GUI_LIB_LOC" = /usr/lib/i386-linux-gnu \ +! -o "$GUI_LIB_LOC" = /usr/lib/x86_64-linux-gnu; then + GUI_LIB_LOC= + { $as_echo "$as_me:${as_lineno-$LINENO}: result: in default path" >&5 + $as_echo "in default path" >&6; } +*** ../vim-7.3.1215/src/version.c 2013-06-17 19:26:29.000000000 +0200 +--- src/version.c 2013-06-17 20:06:50.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1216, + /**/ + +-- +Married is a three ring circus: +First comes the engagement ring. +Then comes the wedding ring. +Then comes the suffering. + + /// 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 /// diff --git a/7.3.1217 b/7.3.1217 new file mode 100644 index 0000000..089af79 --- /dev/null +++ b/7.3.1217 @@ -0,0 +1,93 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1217 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1217 +Problem: New regexp engine: Can't handle \%[[ao]]. (Yukihiro Nakadaira) +Solution: Support nested atoms inside \%[]. +Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok + + +*** ../vim-7.3.1216/src/regexp_nfa.c 2013-06-16 22:49:09.000000000 +0200 +--- src/regexp_nfa.c 2013-06-17 21:27:03.000000000 +0200 +*************** +*** 1150,1162 **** + int n; + + /* \%[abc] */ +! for (n = 0; (c = getchr()) != ']'; ++n) + { + if (c == NUL) + EMSG2_RET_FAIL(_(e_missing_sb), + reg_magic == MAGIC_ALL); +! EMIT(c); + } + if (n == 0) + EMSG2_RET_FAIL(_(e_empty_sb), + reg_magic == MAGIC_ALL); +--- 1150,1165 ---- + int n; + + /* \%[abc] */ +! for (n = 0; (c = peekchr()) != ']'; ++n) + { + if (c == NUL) + EMSG2_RET_FAIL(_(e_missing_sb), + reg_magic == MAGIC_ALL); +! /* recursive call! */ +! if (nfa_regatom() == FAIL) +! return FAIL; + } ++ getchr(); /* get the ] */ + if (n == 0) + EMSG2_RET_FAIL(_(e_empty_sb), + reg_magic == MAGIC_ALL); +*** ../vim-7.3.1216/src/testdir/test64.in 2013-06-16 15:43:43.000000000 +0200 +--- src/testdir/test64.in 2013-06-17 21:21:35.000000000 +0200 +*************** +*** 366,371 **** +--- 366,372 ---- + :call add(tl, [2, '\%[bar]x', 'barxx', 'barx']) + :call add(tl, [2, '\%[bar]x', 'bxx', 'bx']) + :call add(tl, [2, '\%[bar]x', 'xxx', 'x']) ++ :call add(tl, [2, 'b\%[[ao]r]', 'bar bor', 'bar']) + :" + :"""" Alternatives, must use first longest match + :call add(tl, [2, 'goo\|go', 'google', 'goo']) +*** ../vim-7.3.1216/src/testdir/test64.ok 2013-06-16 15:43:43.000000000 +0200 +--- src/testdir/test64.ok 2013-06-17 21:27:09.000000000 +0200 +*************** +*** 836,841 **** +--- 836,844 ---- + OK 0 - \%[bar]x + OK 1 - \%[bar]x + OK 2 - \%[bar]x ++ OK 0 - b\%[[ao]r] ++ OK 1 - b\%[[ao]r] ++ OK 2 - b\%[[ao]r] + OK 0 - goo\|go + OK 1 - goo\|go + OK 2 - goo\|go +*** ../vim-7.3.1216/src/version.c 2013-06-17 20:27:13.000000000 +0200 +--- src/version.c 2013-06-17 21:20:10.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1217, + /**/ + + +-- +Marriage isn't a word. It's a sentence. + + /// 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 /// diff --git a/7.3.1218 b/7.3.1218 new file mode 100644 index 0000000..9629361 --- /dev/null +++ b/7.3.1218 @@ -0,0 +1,91 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1218 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1218 +Problem: "make test" on MS-Windows does not clean all temporary files and + gives some unneccessary message. +Solution: Clean the right files. Create .failed files. (Ken Takata) +Files: src/testdir/Make_dos.mak + + +*** ../vim-7.3.1217/src/testdir/Make_dos.mak 2013-06-16 16:57:43.000000000 +0200 +--- src/testdir/Make_dos.mak 2013-06-17 21:49:44.000000000 +0200 +*************** +*** 61,66 **** +--- 61,67 ---- + + clean: + -del *.out ++ -del *.failed + -if exist test.ok del test.ok + -if exist small.vim del small.vim + -if exist tiny.vim del tiny.vim +*************** +*** 68,85 **** + -if exist mzscheme.vim del mzscheme.vim + -if exist lua.vim del lua.vim + -del X* + -if exist viminfo del viminfo + -del test.log + + .in.out: + copy $*.ok test.ok + $(VIMPROG) -u dos.vim -U NONE --noplugin -s dotest.in $*.in +! @diff test.out $*.ok & if errorlevel 1 (echo $* FAILED >> test.log ) \ +! else ( del /F $*.out & rename test.out $*.out ) + -del X* +- -del X*.* + -del test.ok +! -rd /s /q Xfind + -if exist viminfo del viminfo + + nolog: +--- 69,90 ---- + -if exist mzscheme.vim del mzscheme.vim + -if exist lua.vim del lua.vim + -del X* ++ -if exist Xdir1 rd /s /q Xdir1 ++ -if exist Xfind rd /s /q Xfind + -if exist viminfo del viminfo + -del test.log + + .in.out: ++ -if exist $*.failed del $*.failed + copy $*.ok test.ok + $(VIMPROG) -u dos.vim -U NONE --noplugin -s dotest.in $*.in +! @diff test.out $*.ok & if errorlevel 1 \ +! ( move /y test.out $*.failed & echo $* FAILED >> test.log ) \ +! else ( move /y test.out $*.out ) + -del X* + -del test.ok +! -if exist Xdir1 rd /s /q Xdir1 +! -if exist Xfind rd /s /q Xfind + -if exist viminfo del viminfo + + nolog: +*** ../vim-7.3.1217/src/version.c 2013-06-17 21:33:36.000000000 +0200 +--- src/version.c 2013-06-17 21:52:02.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1218, + /**/ + +-- +"After a few years of marriage a man can look right at a woman +without seeing her and a woman can see right through a man +without looking at him." + - Helen Rowland + + /// 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 /// diff --git a/7.3.1219 b/7.3.1219 new file mode 100644 index 0000000..ed654cb --- /dev/null +++ b/7.3.1219 @@ -0,0 +1,58 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1219 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1219 +Problem: No test for using []] inside \%[]. +Solution: Add a test. +Files: src/testdir/test64.in, src/testdir/test64.ok + + +*** ../vim-7.3.1218/src/testdir/test64.in 2013-06-17 21:33:36.000000000 +0200 +--- src/testdir/test64.in 2013-06-17 21:59:47.000000000 +0200 +*************** +*** 367,372 **** +--- 367,373 ---- + :call add(tl, [2, '\%[bar]x', 'bxx', 'bx']) + :call add(tl, [2, '\%[bar]x', 'xxx', 'x']) + :call add(tl, [2, 'b\%[[ao]r]', 'bar bor', 'bar']) ++ :call add(tl, [2, 'b\%[[]]r]', 'b]r bor', 'b]r']) + :" + :"""" Alternatives, must use first longest match + :call add(tl, [2, 'goo\|go', 'google', 'goo']) +*** ../vim-7.3.1218/src/testdir/test64.ok 2013-06-17 21:33:36.000000000 +0200 +--- src/testdir/test64.ok 2013-06-17 21:59:51.000000000 +0200 +*************** +*** 839,844 **** +--- 839,847 ---- + OK 0 - b\%[[ao]r] + OK 1 - b\%[[ao]r] + OK 2 - b\%[[ao]r] ++ OK 0 - b\%[[]]r] ++ OK 1 - b\%[[]]r] ++ OK 2 - b\%[[]]r] + OK 0 - goo\|go + OK 1 - goo\|go + OK 2 - goo\|go +*** ../vim-7.3.1218/src/version.c 2013-06-17 21:53:33.000000000 +0200 +--- src/version.c 2013-06-17 22:03:18.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1219, + /**/ + +-- +If you're sending someone Styrofoam, what do you pack it in? + + /// 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 /// diff --git a/7.3.1220 b/7.3.1220 new file mode 100644 index 0000000..e1d8c81 --- /dev/null +++ b/7.3.1220 @@ -0,0 +1,211 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1220 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1220 +Problem: MS-Windows: When using wide font italic and bold are not included. +Solution: Support wide-bold, wide-italic and wide-bold-italic. (Ken Takata, + Taro Muraoka) +Files: src/gui.c, src/gui.h, src/gui_w48.c + + +*** ../vim-7.3.1219/src/gui.c 2013-06-12 20:35:46.000000000 +0200 +--- src/gui.c 2013-06-17 22:22:49.000000000 +0200 +*************** +*** 410,415 **** +--- 410,423 ---- + gui.fontset = NOFONTSET; + # endif + #endif ++ #ifdef FEAT_MBYTE ++ gui.wide_font = NOFONT; ++ # ifndef FEAT_GUI_GTK ++ gui.wide_bold_font = NOFONT; ++ gui.wide_ital_font = NOFONT; ++ gui.wide_boldital_font = NOFONT; ++ # endif ++ #endif + + #ifdef FEAT_MENU + # ifndef FEAT_GUI_GTK +*************** +*** 1012,1017 **** +--- 1020,1030 ---- + gui.wide_font = font; + # ifdef FEAT_GUI_MSWIN + gui_mch_wide_font_changed(); ++ # else ++ /* ++ * TODO: setup wide_bold_font, wide_ital_font and wide_boldital_font to ++ * support those fonts for 'guifontwide'. ++ */ + # endif + return OK; + } +*************** +*** 2180,2185 **** +--- 2193,2201 ---- + guicolor_T sp_color; + #if !defined(MSWIN16_FASTTEXT) && !defined(FEAT_GUI_GTK) + GuiFont font = NOFONT; ++ # ifdef FEAT_MBYTE ++ GuiFont wide_font = NOFONT; ++ # endif + # ifdef FEAT_XFONTSET + GuiFontset fontset = NOFONTSET; + # endif +*************** +*** 2269,2274 **** +--- 2285,2307 ---- + } + else + font = gui.norm_font; ++ ++ # ifdef FEAT_MBYTE ++ /* ++ * Choose correct wide_font by font. wide_font should be set with font ++ * at same time in above block. But it will make many "ifdef" nasty ++ * blocks. So we do it here. ++ */ ++ if (font == gui.boldital_font && gui.wide_boldital_font) ++ wide_font = gui.wide_boldital_font; ++ else if (font == gui.bold_font && gui.wide_bold_font) ++ wide_font = gui.wide_bold_font; ++ else if (font == gui.ital_font && gui.wide_ital_font) ++ wide_font = gui.wide_ital_font; ++ else if (font == gui.norm_font && gui.wide_font) ++ wide_font = gui.wide_font; ++ # endif ++ + } + # ifdef FEAT_XFONTSET + if (fontset != NOFONTSET) +*************** +*** 2407,2413 **** + # ifdef FEAT_XFONTSET + && fontset == NOFONTSET + # endif +! && gui.wide_font != NOFONT) + curr_wide = TRUE; + else + curr_wide = FALSE; +--- 2440,2446 ---- + # ifdef FEAT_XFONTSET + && fontset == NOFONTSET + # endif +! && wide_font != NOFONT) + curr_wide = TRUE; + else + curr_wide = FALSE; +*************** +*** 2441,2447 **** + if (thislen > 0) + { + if (prev_wide) +! gui_mch_set_font(gui.wide_font); + gui_mch_draw_string(gui.row, scol, s + start, thislen, + draw_flags); + if (prev_wide) +--- 2474,2480 ---- + if (thislen > 0) + { + if (prev_wide) +! gui_mch_set_font(wide_font); + gui_mch_draw_string(gui.row, scol, s + start, thislen, + draw_flags); + if (prev_wide) +*** ../vim-7.3.1219/src/gui.h 2013-01-23 13:40:54.000000000 +0100 +--- src/gui.h 2013-06-17 22:22:49.000000000 +0200 +*************** +*** 311,317 **** + # endif + #endif + #ifdef FEAT_MBYTE +! GuiFont wide_font; /* 'guifontwide' font */ + #endif + #ifdef FEAT_XFONTSET + GuiFontset fontset; /* set of fonts for multi-byte chars */ +--- 311,322 ---- + # endif + #endif + #ifdef FEAT_MBYTE +! GuiFont wide_font; /* Normal 'guifontwide' font */ +! # ifndef FEAT_GUI_GTK +! GuiFont wide_bold_font; /* Bold 'guifontwide' font */ +! GuiFont wide_ital_font; /* Italic 'guifontwide' font */ +! GuiFont wide_boldital_font; /* Bold-Italic 'guifontwide' font */ +! # endif + #endif + #ifdef FEAT_XFONTSET + GuiFontset fontset; /* set of fonts for multi-byte chars */ +*** ../vim-7.3.1219/src/gui_w48.c 2013-05-06 04:21:35.000000000 +0200 +--- src/gui_w48.c 2013-06-17 22:22:49.000000000 +0200 +*************** +*** 3123,3131 **** +--- 3123,3165 ---- + void + gui_mch_wide_font_changed() + { ++ # ifndef MSWIN16_FASTTEXT ++ LOGFONT lf; ++ # endif ++ + # ifdef FEAT_MBYTE_IME + update_im_font(); + # endif ++ ++ # ifndef MSWIN16_FASTTEXT ++ gui_mch_free_font(gui.wide_ital_font); ++ gui.wide_ital_font = NOFONT; ++ gui_mch_free_font(gui.wide_bold_font); ++ gui.wide_bold_font = NOFONT; ++ gui_mch_free_font(gui.wide_boldital_font); ++ gui.wide_boldital_font = NOFONT; ++ ++ if (gui.wide_font ++ && GetObject((HFONT)gui.wide_font, sizeof(lf), &lf)) ++ { ++ if (!lf.lfItalic) ++ { ++ lf.lfItalic = TRUE; ++ gui.wide_ital_font = get_font_handle(&lf); ++ lf.lfItalic = FALSE; ++ } ++ if (lf.lfWeight < FW_BOLD) ++ { ++ lf.lfWeight = FW_BOLD; ++ gui.wide_bold_font = get_font_handle(&lf); ++ if (!lf.lfItalic) ++ { ++ lf.lfItalic = TRUE; ++ gui.wide_boldital_font = get_font_handle(&lf); ++ } ++ } ++ } ++ # endif + } + #endif + +*** ../vim-7.3.1219/src/version.c 2013-06-17 22:04:34.000000000 +0200 +--- src/version.c 2013-06-17 22:24:18.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1220, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +243. You unsuccessfully try to download a pizza from www.dominos.com. + + /// 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 /// diff --git a/7.3.1221 b/7.3.1221 new file mode 100644 index 0000000..2af249a --- /dev/null +++ b/7.3.1221 @@ -0,0 +1,220 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1221 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1221 +Problem: When build flags change "make distclean" run into a configure + error. +Solution: When CFLAGS changes delete auto/config.cache. Also avoid adding + duplicate text to flags. +Files: src/Makefile, src/configure.in, src/auto/configure + + +*** ../vim-7.3.1220/src/Makefile 2013-06-16 14:20:10.000000000 +0200 +--- src/Makefile 2013-06-18 23:04:56.000000000 +0200 +*************** +*** 1655,1660 **** +--- 1656,1666 ---- + # sure configure is run when it's needed. + # + config auto/config.mk: auto/configure config.mk.in config.h.in ++ if test -f auto/config.cache && \ ++ grep '^ac_cv_env_CFLAGS_value=' auto/config.cache > /dev/null && \ ++ ! grep -x -F 'ac_cv_env_CFLAGS_value=$(CFLAGS)' auto/config.cache > /dev/null; then \ ++ rm auto/config.cache; \ ++ fi + GUI_INC_LOC="$(GUI_INC_LOC)" GUI_LIB_LOC="$(GUI_LIB_LOC)" \ + CC="$(CC)" CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS)" \ + LDFLAGS="$(LDFLAGS)" $(CONF_SHELL) srcdir="$(srcdir)" \ +*** ../vim-7.3.1220/src/configure.in 2013-06-17 20:27:13.000000000 +0200 +--- src/configure.in 2013-06-18 23:04:56.000000000 +0200 +*************** +*** 776,781 **** +--- 776,782 ---- + ldflags_save=$LDFLAGS + CFLAGS="$CFLAGS $perlcppflags" + LIBS="$LIBS $perllibs" ++ perlldflags=`echo "$perlldflags" | sed -e 's/^ *//g'` + LDFLAGS="$perlldflags $LDFLAGS" + AC_TRY_LINK(,[ ], + AC_MSG_RESULT(yes); perl_ok=yes, +*************** +*** 789,795 **** + PERL_CFLAGS=`echo "$perlcppflags" | sed -e 's/-pipe //' -e 's/-W[[^ ]]*//'` + fi + if test "X$perlldflags" != "X"; then +! LDFLAGS="$perlldflags $LDFLAGS" + fi + PERL_LIBS=$perllibs + PERL_SRC="auto/if_perl.c if_perlsfio.c" +--- 790,798 ---- + PERL_CFLAGS=`echo "$perlcppflags" | sed -e 's/-pipe //' -e 's/-W[[^ ]]*//'` + fi + if test "X$perlldflags" != "X"; then +! if test "X`echo \"$LDFLAGS\" | grep -F -e \"$perlldflags\"`" = "X"; then +! LDFLAGS="$perlldflags $LDFLAGS" +! fi + fi + PERL_LIBS=$perllibs + PERL_SRC="auto/if_perl.c if_perlsfio.c" +*************** +*** 1546,1552 **** + dnl configure, so strip these flags first (if present) + rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'` + if test "X$rubyldflags" != "X"; then +! LDFLAGS="$rubyldflags $LDFLAGS" + fi + fi + RUBY_SRC="if_ruby.c" +--- 1549,1557 ---- + dnl configure, so strip these flags first (if present) + rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'` + if test "X$rubyldflags" != "X"; then +! if test "X`echo \"$LDFLAGS\" | grep -F -e \"$rubyldflags\"`" = "X"; then +! LDFLAGS="$rubyldflags $LDFLAGS" +! fi + fi + fi + RUBY_SRC="if_ruby.c" +*************** +*** 3719,3725 **** + dnl And undefine it first to avoid a warning. + AC_MSG_CHECKING(whether we need -D_FORTIFY_SOURCE=1) + if test "$gccmajor" -gt "3"; then +! CFLAGS=`echo "$CFLAGS" | sed -e 's/-Wp,-D_FORTIFY_SOURCE=.//g' -e 's/-D_FORTIFY_SOURCE=.//g' -e 's/$/ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1/'` + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) +--- 3724,3730 ---- + dnl And undefine it first to avoid a warning. + AC_MSG_CHECKING(whether we need -D_FORTIFY_SOURCE=1) + if test "$gccmajor" -gt "3"; then +! CFLAGS=`echo "$CFLAGS" | sed -e 's/ *-Wp,-D_FORTIFY_SOURCE=.//g' -e 's/ *-D_FORTIFY_SOURCE=.//g' -e 's/ *-U_FORTIFY_SOURCE//g' -e 's/$/ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1/'` + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) +*************** +*** 3734,3740 **** + LINK_AS_NEEDED= + # Check if linker supports --as-needed and --no-as-needed options + if $CC -Wl,--help 2>/dev/null | grep as-needed > /dev/null; then +! LDFLAGS="$LDFLAGS -Wl,--as-needed" + LINK_AS_NEEDED=yes + fi + if test "$LINK_AS_NEEDED" = yes; then +--- 3739,3745 ---- + LINK_AS_NEEDED= + # Check if linker supports --as-needed and --no-as-needed options + if $CC -Wl,--help 2>/dev/null | grep as-needed > /dev/null; then +! LDFLAGS=`echo "$LDFLAGS" | sed -e 's/ *-Wl,--as-needed//g' | sed -e 's/$/ -Wl,--as-needed/'` + LINK_AS_NEEDED=yes + fi + if test "$LINK_AS_NEEDED" = yes; then +*** ../vim-7.3.1220/src/auto/configure 2013-06-17 20:27:13.000000000 +0200 +--- src/auto/configure 2013-06-18 23:27:35.000000000 +0200 +*************** +*** 5133,5138 **** +--- 5133,5139 ---- + ldflags_save=$LDFLAGS + CFLAGS="$CFLAGS $perlcppflags" + LIBS="$LIBS $perllibs" ++ perlldflags=`echo "$perlldflags" | sed -e 's/^ *//g'` + LDFLAGS="$perlldflags $LDFLAGS" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +*************** +*** 5162,5168 **** + PERL_CFLAGS=`echo "$perlcppflags" | sed -e 's/-pipe //' -e 's/-W[^ ]*//'` + fi + if test "X$perlldflags" != "X"; then +! LDFLAGS="$perlldflags $LDFLAGS" + fi + PERL_LIBS=$perllibs + PERL_SRC="auto/if_perl.c if_perlsfio.c" +--- 5163,5171 ---- + PERL_CFLAGS=`echo "$perlcppflags" | sed -e 's/-pipe //' -e 's/-W[^ ]*//'` + fi + if test "X$perlldflags" != "X"; then +! if test "X`echo \"$LDFLAGS\" | grep -F -e \"$perlldflags\"`" = "X"; then +! LDFLAGS="$perlldflags $LDFLAGS" +! fi + fi + PERL_LIBS=$perllibs + PERL_SRC="auto/if_perl.c if_perlsfio.c" +*************** +*** 6454,6460 **** + if test "X$rubyldflags" != "X"; then + rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'` + if test "X$rubyldflags" != "X"; then +! LDFLAGS="$rubyldflags $LDFLAGS" + fi + fi + RUBY_SRC="if_ruby.c" +--- 6457,6465 ---- + if test "X$rubyldflags" != "X"; then + rubyldflags=`echo "$rubyldflags" | sed -e 's/-arch\ ppc//' -e 's/-arch\ i386//' -e 's/-arch\ x86_64//'` + if test "X$rubyldflags" != "X"; then +! if test "X`echo \"$LDFLAGS\" | grep -F -e \"$rubyldflags\"`" = "X"; then +! LDFLAGS="$rubyldflags $LDFLAGS" +! fi + fi + fi + RUBY_SRC="if_ruby.c" +*************** +*** 12690,12696 **** + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need -D_FORTIFY_SOURCE=1" >&5 + $as_echo_n "checking whether we need -D_FORTIFY_SOURCE=1... " >&6; } + if test "$gccmajor" -gt "3"; then +! CFLAGS=`echo "$CFLAGS" | sed -e 's/-Wp,-D_FORTIFY_SOURCE=.//g' -e 's/-D_FORTIFY_SOURCE=.//g' -e 's/$/ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1/'` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + $as_echo "yes" >&6; } + else +--- 12695,12701 ---- + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we need -D_FORTIFY_SOURCE=1" >&5 + $as_echo_n "checking whether we need -D_FORTIFY_SOURCE=1... " >&6; } + if test "$gccmajor" -gt "3"; then +! CFLAGS=`echo "$CFLAGS" | sed -e 's/ *-Wp,-D_FORTIFY_SOURCE=.//g' -e 's/ *-D_FORTIFY_SOURCE=.//g' -e 's/ *-U_FORTIFY_SOURCE//g' -e 's/$/ -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1/'` + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + $as_echo "yes" >&6; } + else +*************** +*** 12705,12711 **** + LINK_AS_NEEDED= + # Check if linker supports --as-needed and --no-as-needed options + if $CC -Wl,--help 2>/dev/null | grep as-needed > /dev/null; then +! LDFLAGS="$LDFLAGS -Wl,--as-needed" + LINK_AS_NEEDED=yes + fi + if test "$LINK_AS_NEEDED" = yes; then +--- 12710,12716 ---- + LINK_AS_NEEDED= + # Check if linker supports --as-needed and --no-as-needed options + if $CC -Wl,--help 2>/dev/null | grep as-needed > /dev/null; then +! LDFLAGS=`echo "$LDFLAGS" | sed -e 's/ *-Wl,--as-needed//g' | sed -e 's/$/ -Wl,--as-needed/'` + LINK_AS_NEEDED=yes + fi + if test "$LINK_AS_NEEDED" = yes; then +*** ../vim-7.3.1220/src/version.c 2013-06-17 22:43:18.000000000 +0200 +--- src/version.c 2013-06-18 23:18:45.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1221, + /**/ + + +-- +hundred-and-one symptoms of being an internet addict: +251. You've never seen your closest friends who usually live WAY too far away. + + /// 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 /// diff --git a/7.3.1222 b/7.3.1222 new file mode 100644 index 0000000..5e6fc84 --- /dev/null +++ b/7.3.1222 @@ -0,0 +1,70 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1222 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1222 +Problem: Cannot execute some tests from the src directly. +Solution: Add missing targets. +Files: src/Makefile + + +*** ../vim-7.3.1221/src/Makefile 2013-06-18 23:31:41.000000000 +0200 +--- src/Makefile 2013-06-19 20:05:45.000000000 +0200 +*************** +*** 1867,1882 **** + done + + # Run individual test, assuming that Vim was already compiled. +! test1 test2 test3 test4 test5 test6 test7 test8 test9 test10 \ +! test11 test12 test13 test14 test15 test16 test17 test18 test19 \ +! test21 test22 test23 test24 test25 test26 test27 test28 test29 \ +! test31 test32 test33 test34 test35 test36 test37 test38 test39 \ +! test41 test42 test43 test44 test45 test46 test47 test48 test49 \ +! test51 test52 test53 test54 test55 test56 test57 test58 test59 \ +! test61 test62 test63 test64 test65 test66 test67 test68 test69 \ +! test71 test72 test73 test74 test75 test76 test77 test78 test79 \ +! test81 test82 test83 test84 test85 test86 test87 test88 test89 \ +! test91 test92 test93 test94 test95 test96 test97 test98 test99: + cd testdir; rm $@.out; $(MAKE) -f Makefile $@.out VIMPROG=../$(VIMTARGET) + + testclean: +--- 1868,1883 ---- + done + + # Run individual test, assuming that Vim was already compiled. +! test1 test2 test3 test4 test5 test6 test7 test8 test9 \ +! test10 test11 test12 test13 test14 test15 test16 test17 test18 test19 \ +! test20 test21 test22 test23 test24 test25 test26 test27 test28 test29 \ +! test30 test31 test32 test33 test34 test35 test36 test37 test38 test39 \ +! test40 test41 test42 test43 test44 test45 test46 test47 test48 test49 \ +! test50 test51 test52 test53 test54 test55 test56 test57 test58 test59 \ +! test60 test61 test62 test63 test64 test65 test66 test67 test68 test69 \ +! test70 test71 test72 test73 test74 test75 test76 test77 test78 test79 \ +! test80 test81 test82 test83 test84 test85 test86 test87 test88 test89 \ +! test90 test91 test92 test93 test94 test95 test96 test97 test98 test99: + cd testdir; rm $@.out; $(MAKE) -f Makefile $@.out VIMPROG=../$(VIMTARGET) + + testclean: +*** ../vim-7.3.1221/src/version.c 2013-06-18 23:31:41.000000000 +0200 +--- src/version.c 2013-06-19 20:11:01.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1222, + /**/ + +-- +If VIM were a woman, I'd marry her. Slim, organized, helpful +and beautiful; what's not to like? --David A. Rogers + + /// 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 /// diff --git a/7.3.1223 b/7.3.1223 new file mode 100644 index 0000000..be6e89b --- /dev/null +++ b/7.3.1223 @@ -0,0 +1,262 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1223 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1223 +Problem: Tests fail on MS-Windows. +Solution: Avoid depending on OS version. Use DOS commands instead of Unix + commands. (Taro Muraoka, Ken Takata) +Files: src/testdir/test17.in, src/testdir/test50.in, + src/testdir/test71.in, src/testdir/test77.in + + +*** ../vim-7.3.1222/src/testdir/test17.in 2012-07-25 13:46:25.000000000 +0200 +--- src/testdir/test17.in 2013-06-19 21:01:57.000000000 +0200 +*************** +*** 9,14 **** +--- 9,21 ---- + :else + : set isfname=@,48-57,/,.,-,_,+,,,$,:,~,{,} + :endif ++ :function! DeleteDirectory(dir) ++ : if has("win16") || has("win32") || has("win64") || has("dos16") || has("dos32") ++ : exec "silent !rmdir /Q /S " . a:dir ++ : else ++ : exec "silent !rm -rf " . a:dir ++ : endif ++ :endfun + :if has("unix") + :let $CDIR = "." + /CDIR +*************** +*** 20,25 **** +--- 27,37 ---- + :endif + /TDIR + :endif ++ :" Dummy writing for making that sure gf doesn't fail even if the current ++ :" file is modified. It can be occurred when executing the following command ++ :" directly on Windows without fixing the 'fileformat': ++ :" > nmake -f Make_dos.mak test17.out ++ :w! test.out + gf + :w! test.out + :brewind +*************** +*** 31,40 **** + STARTTEST + :" check for 'include' without \zs or \ze + :lang C +! :!rm -f ./Xbase.a +! :!rm -rf ./Xdir1 +! :!mkdir -p Xdir1/dir2 +! :e Xdir1/dir2/foo.a + i#include "bar.a" + :w + :e Xdir1/dir2/bar.a +--- 43,53 ---- + STARTTEST + :" check for 'include' without \zs or \ze + :lang C +! :call delete("./Xbase.a") +! :call DeleteDirectory("Xdir1") +! :!mkdir Xdir1 +! :!mkdir "Xdir1/dir2" +! :e! Xdir1/dir2/foo.a + i#include "bar.a" + :w + :e Xdir1/dir2/bar.a +*************** +*** 55,69 **** + + STARTTEST + :" check for 'include' with \zs and \ze +! :!rm -f ./Xbase.b +! :!rm -rf ./Xdir1 +! :!mkdir -p Xdir1/dir2 + :let &include='^\s*%inc\s*/\zs[^/]\+\ze' + :function! DotsToSlashes() + : return substitute(v:fname, '\.', '/', 'g') . '.b' + :endfunction + :let &includeexpr='DotsToSlashes()' +! :e Xdir1/dir2/foo.b + i%inc /bar/ + :w + :e Xdir1/dir2/bar.b +--- 68,83 ---- + + STARTTEST + :" check for 'include' with \zs and \ze +! :call delete("./Xbase.b") +! :call DeleteDirectory("Xdir1") +! :!mkdir Xdir1 +! :!mkdir "Xdir1/dir2" + :let &include='^\s*%inc\s*/\zs[^/]\+\ze' + :function! DotsToSlashes() + : return substitute(v:fname, '\.', '/', 'g') . '.b' + :endfunction + :let &includeexpr='DotsToSlashes()' +! :e! Xdir1/dir2/foo.b + i%inc /bar/ + :w + :e Xdir1/dir2/bar.b +*************** +*** 84,92 **** + + STARTTEST + :" check for 'include' with \zs and no \ze +! :!rm -f ./Xbase.c +! :!rm -rf ./Xdir1 +! :!mkdir -p Xdir1/dir2 + :let &include='^\s*%inc\s*\%([[:upper:]][^[:space:]]*\s\+\)\?\zs\S\+\ze' + :function! StripNewlineChar() + : if v:fname =~ '\n$' +--- 98,107 ---- + + STARTTEST + :" check for 'include' with \zs and no \ze +! :call delete("./Xbase.c") +! :call DeleteDirectory("Xdir1") +! :!mkdir Xdir1 +! :!mkdir "Xdir1/dir2" + :let &include='^\s*%inc\s*\%([[:upper:]][^[:space:]]*\s\+\)\?\zs\S\+\ze' + :function! StripNewlineChar() + : if v:fname =~ '\n$' +*************** +*** 95,101 **** + : return v:fname + :endfunction + :let &includeexpr='StripNewlineChar()' +! :e Xdir1/dir2/foo.c + i%inc bar.c + :w + :e Xdir1/dir2/bar.c +--- 110,116 ---- + : return v:fname + :endfunction + :let &includeexpr='StripNewlineChar()' +! :e! Xdir1/dir2/foo.c + i%inc bar.c + :w + :e Xdir1/dir2/bar.c +*************** +*** 115,120 **** +--- 130,139 ---- + :checkpath! + :redir END + :brewind ++ :" replace "\" to "/" for Windows ++ :e test.out ++ :%s#\\#/#g ++ :w + :q + ENDTEST + +*** ../vim-7.3.1222/src/testdir/test50.in 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/test50.in 2013-06-19 20:03:18.000000000 +0200 +*************** +*** 33,39 **** + " This could change for CygWin to //cygdrive/c + let dir1='c:/x.x.y' + if filereadable(dir1) || isdirectory(dir1) +! call confirm( "'".dir1."' exists, cannot run test" ) + return + endif + let file1=dir1.'/zz.y.txt' +--- 33,39 ---- + " This could change for CygWin to //cygdrive/c + let dir1='c:/x.x.y' + if filereadable(dir1) || isdirectory(dir1) +! echo "FATAL: '".dir1."' exists, cannot run test" + return + endif + let file1=dir1.'/zz.y.txt' +*************** +*** 41,53 **** + let dir2=dir1.'/VimIsTheGreatestSinceSlicedBread' + let file2=dir2.'/z.txt' + let nofile2=dir2.'/zz.txt' +! let resdir1='c:/XX2235~1.Y' + let resfile1=resdir1.'/ZZY~1.TXT' + let resnofile1=resdir1.'/z.y.txt' + let resdir2=resdir1.'/VIMIST~1' + let resfile2=resdir2.'/z.txt' + let resnofile2=resdir2.'/zz.txt' +- call MakeDir( dir1 ) + call MakeDir( dir2 ) + call MakeFile( file1 ) + call MakeFile( file2 ) +--- 41,58 ---- + let dir2=dir1.'/VimIsTheGreatestSinceSlicedBread' + let file2=dir2.'/z.txt' + let nofile2=dir2.'/zz.txt' +! call MakeDir( dir1 ) +! let resdir1 = substitute(fnamemodify(dir1, ':p:8'), '\\$', '', '') +! if resdir1 !~ '\V\^c:/XX\x\x\x\x~1.Y\$' +! echo "FATAL: unexpected short name: " . resdir1 +! echo "INFO: please report your OS to vim-dev" +! return +! endif + let resfile1=resdir1.'/ZZY~1.TXT' + let resnofile1=resdir1.'/z.y.txt' + let resdir2=resdir1.'/VIMIST~1' + let resfile2=resdir2.'/z.txt' + let resnofile2=resdir2.'/zz.txt' + call MakeDir( dir2 ) + call MakeFile( file1 ) + call MakeFile( file2 ) +*** ../vim-7.3.1222/src/testdir/test71.in 2010-08-15 21:57:29.000000000 +0200 +--- src/testdir/test71.in 2013-06-19 20:09:12.000000000 +0200 +*************** +*** 8,14 **** + :let cm0_bytes = getline('.', '.') + :/^start of cm=blowfish bytes/+1 + :let cm1_bytes = getline('.', '.') +! :bwipe + :call append(0, text_lines) + :$d + :X +--- 8,14 ---- + :let cm0_bytes = getline('.', '.') + :/^start of cm=blowfish bytes/+1 + :let cm1_bytes = getline('.', '.') +! :bwipe! + :call append(0, text_lines) + :$d + :X +*** ../vim-7.3.1222/src/testdir/test77.in 2012-04-30 11:34:20.000000000 +0200 +--- src/testdir/test77.in 2013-06-19 20:03:54.000000000 +0200 +*************** +*** 23,28 **** +--- 23,29 ---- + :w! Xtest + :r !cksum Xtest + :s/\s/ /g ++ :set fileformat& + :.w! test.out + :qa! + ENDTEST +*** ../vim-7.3.1222/src/version.c 2013-06-19 20:11:44.000000000 +0200 +--- src/version.c 2013-06-19 21:03:21.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1223, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +255. You work for a newspaper and your editor asks you to write an + article about Internet addiction...in the "first person." + + /// 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 /// diff --git a/7.3.1224 b/7.3.1224 new file mode 100644 index 0000000..8da1fc0 --- /dev/null +++ b/7.3.1224 @@ -0,0 +1,105 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1224 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1224 +Problem: Clang gives warnings on xxd. +Solution: Change how to use part of a string. (Dominique Pelle) Also avoid + warning for return not reached. +Files: src/xxd/xxd.c, src/regexp_nfa.c + +*** ../vim-7.3.1223/src/xxd/xxd.c 2013-02-26 14:14:01.000000000 +0100 +--- src/xxd/xxd.c 2013-06-21 18:23:53.000000000 +0200 +*************** +*** 722,728 **** + while ((length < 0 || p < length) && (c = getc(fp)) != EOF) + { + if (fprintf(fpo, (hexx == hexxa) ? "%s0x%02x" : "%s0X%02X", +! (p % cols) ? ", " : ",\n "+2*!p, c) < 0) + die(3); + p++; + } +--- 722,728 ---- + while ((length < 0 || p < length) && (c = getc(fp)) != EOF) + { + if (fprintf(fpo, (hexx == hexxa) ? "%s0x%02x" : "%s0X%02X", +! (p % cols) ? ", " : &",\n "[2*!p], c) < 0) + die(3); + p++; + } +*************** +*** 731,737 **** + + if (p && fputs("\n", fpo) == EOF) + die(3); +! if (fputs("};\n" + 3 * (fp == stdin), fpo) == EOF) + die(3); + + if (fp != stdin) +--- 731,737 ---- + + if (p && fputs("\n", fpo) == EOF) + die(3); +! if (fputs(&"};\n"[3 * (fp == stdin)], fpo) == EOF) + die(3); + + if (fp != stdin) +*** ../vim-7.3.1223/src/regexp_nfa.c 2013-06-17 21:33:36.000000000 +0200 +--- src/regexp_nfa.c 2013-06-21 18:29:43.000000000 +0200 +*************** +*** 2611,2617 **** + if (depth > 4) + return -1; + +! for (;;) + { + switch (state->c) + { +--- 2611,2617 ---- + if (depth > 4) + return -1; + +! while (state != NULL) + { + switch (state->c) + { +*************** +*** 2810,2816 **** + state = state->out; + } + +! /* unrecognized */ + return -1; + } + +--- 2810,2816 ---- + state = state->out; + } + +! /* unrecognized, "cannot happen" */ + return -1; + } + +*** ../vim-7.3.1223/src/version.c 2013-06-19 21:17:26.000000000 +0200 +--- src/version.c 2013-06-21 18:25:09.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1224, + /**/ + +-- +Two fish in a tank. One says to the other: +"Do you know how to drive this thing?" + + /// 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 /// diff --git a/7.3.1225 b/7.3.1225 new file mode 100644 index 0000000..823c16b --- /dev/null +++ b/7.3.1225 @@ -0,0 +1,69 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1225 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1225 +Problem: Compiler warnings when building with Motif. +Solution: Change set_label() argument. (Kazunobu Kuriyama) +Files: src/gui_motif.c + + +*** ../vim-7.3.1224/src/gui_motif.c 2013-05-06 04:21:35.000000000 +0200 +--- src/gui_motif.c 2013-06-22 12:54:44.000000000 +0200 +*************** +*** 3653,3659 **** + static void + set_label(w, label) + Widget w; +! char_u *label; + { + XmString str; + char_u *p, *next; +--- 3653,3659 ---- + static void + set_label(w, label) + Widget w; +! char *label; + { + XmString str; + char_u *p, *next; +*************** +*** 3662,3668 **** + if (!w) + return; + +! p = vim_strsave(label); + if (p == NULL) + return; + for (next = p; *next; ++next) +--- 3662,3668 ---- + if (!w) + return; + +! p = vim_strsave((char_u *)label); + if (p == NULL) + return; + for (next = p; *next; ++next) +*** ../vim-7.3.1224/src/version.c 2013-06-21 18:31:16.000000000 +0200 +--- src/version.c 2013-06-22 12:59:52.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1225, + /**/ + +-- +hundred-and-one symptoms of being an internet addict: +10E. You start counting in hex. + + /// 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 /// diff --git a/7.3.1226 b/7.3.1226 new file mode 100644 index 0000000..c506ae5 --- /dev/null +++ b/7.3.1226 @@ -0,0 +1,232 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1226 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1226 +Problem: Python: duplicate code. +Solution: Share code between OutputWrite() and OutputWritelines(). (ZyX) +Files: src/if_py_both.h, src/testdir/test86.ok, src/testdir/test87.ok + + +*** ../vim-7.3.1225/src/if_py_both.h 2013-06-16 14:25:53.000000000 +0200 +--- src/if_py_both.h 2013-06-23 12:46:03.000000000 +0200 +*************** +*** 281,295 **** + } + } + +! static PyObject * +! OutputWrite(OutputObject *self, PyObject *args) + { +! Py_ssize_t len = 0; +! char *str = NULL; +! int error = self->error; + +! if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len)) +! return NULL; + + Py_BEGIN_ALLOW_THREADS + Python_Lock_Vim(); +--- 281,295 ---- + } + } + +! static int +! write_output(OutputObject *self, PyObject *string) + { +! Py_ssize_t len = 0; +! char *str = NULL; +! int error = self->error; + +! if (!PyArg_Parse(string, "et#", ENC_OPT, &str, &len)) +! return -1; + + Py_BEGIN_ALLOW_THREADS + Python_Lock_Vim(); +*************** +*** 298,341 **** + Py_END_ALLOW_THREADS + PyMem_Free(str); + + Py_INCREF(Py_None); + return Py_None; + } + + static PyObject * +! OutputWritelines(OutputObject *self, PyObject *args) + { +- PyObject *seq; + PyObject *iterator; + PyObject *item; +- int error = self->error; +- +- if (!PyArg_ParseTuple(args, "O", &seq)) +- return NULL; + + if (!(iterator = PyObject_GetIter(seq))) + return NULL; + + while ((item = PyIter_Next(iterator))) + { +! char *str = NULL; +! PyInt len; +! +! if (!PyArg_Parse(item, "et#", ENC_OPT, &str, &len)) + { +- PyErr_SetString(PyExc_TypeError, _("writelines() requires list of strings")); + Py_DECREF(iterator); + Py_DECREF(item); + return NULL; + } + Py_DECREF(item); +- +- Py_BEGIN_ALLOW_THREADS +- Python_Lock_Vim(); +- writer((writefn)(error ? emsg : msg), (char_u *)str, len); +- Python_Release_Vim(); +- Py_END_ALLOW_THREADS +- PyMem_Free(str); + } + + Py_DECREF(iterator); +--- 298,334 ---- + Py_END_ALLOW_THREADS + PyMem_Free(str); + ++ return 0; ++ } ++ ++ static PyObject * ++ OutputWrite(OutputObject *self, PyObject *string) ++ { ++ if (write_output(self, string)) ++ return NULL; ++ + Py_INCREF(Py_None); + return Py_None; + } + + static PyObject * +! OutputWritelines(OutputObject *self, PyObject *seq) + { + PyObject *iterator; + PyObject *item; + + if (!(iterator = PyObject_GetIter(seq))) + return NULL; + + while ((item = PyIter_Next(iterator))) + { +! if (write_output(self, item)) + { + Py_DECREF(iterator); + Py_DECREF(item); + return NULL; + } + Py_DECREF(item); + } + + Py_DECREF(iterator); +*************** +*** 360,367 **** + + static struct PyMethodDef OutputMethods[] = { + /* name, function, calling, doc */ +! {"write", (PyCFunction)OutputWrite, METH_VARARGS, ""}, +! {"writelines", (PyCFunction)OutputWritelines, METH_VARARGS, ""}, + {"flush", (PyCFunction)OutputFlush, METH_NOARGS, ""}, + {"__dir__", (PyCFunction)OutputDir, METH_NOARGS, ""}, + { NULL, NULL, 0, NULL} +--- 353,360 ---- + + static struct PyMethodDef OutputMethods[] = { + /* name, function, calling, doc */ +! {"write", (PyCFunction)OutputWrite, METH_O, ""}, +! {"writelines", (PyCFunction)OutputWritelines, METH_O, ""}, + {"flush", (PyCFunction)OutputFlush, METH_NOARGS, ""}, + {"__dir__", (PyCFunction)OutputDir, METH_NOARGS, ""}, + { NULL, NULL, 0, NULL} +*************** +*** 3009,3015 **** + return NULL; + } + +! /* Window object + */ + + typedef struct +--- 3002,3009 ---- + return NULL; + } + +! /* +! * Window object + */ + + typedef struct +*** ../vim-7.3.1225/src/testdir/test86.ok 2013-06-12 14:26:20.000000000 +0200 +--- src/testdir/test86.ok 2013-06-23 12:43:55.000000000 +0200 +*************** +*** 444,450 **** + sys.stdout.write(None):TypeError:('coercing to Unicode: need string or buffer, NoneType found',) + >> OutputWriteLines + sys.stdout.writelines(None):TypeError:("'NoneType' object is not iterable",) +! sys.stdout.writelines([1]):TypeError:('writelines() requires list of strings',) + > VimCommand + vim.command(1):TypeError:('must be string, not int',) + > VimToPython +--- 444,450 ---- + sys.stdout.write(None):TypeError:('coercing to Unicode: need string or buffer, NoneType found',) + >> OutputWriteLines + sys.stdout.writelines(None):TypeError:("'NoneType' object is not iterable",) +! sys.stdout.writelines([1]):TypeError:('coercing to Unicode: need string or buffer, int found',) + > VimCommand + vim.command(1):TypeError:('must be string, not int',) + > VimToPython +*** ../vim-7.3.1225/src/testdir/test87.ok 2013-06-12 14:20:15.000000000 +0200 +--- src/testdir/test87.ok 2013-06-23 12:44:00.000000000 +0200 +*************** +*** 433,439 **** + sys.stdout.write(None):(, TypeError("Can't convert 'NoneType' object to str implicitly",)) + >> OutputWriteLines + sys.stdout.writelines(None):(, TypeError("'NoneType' object is not iterable",)) +! sys.stdout.writelines([1]):(, TypeError('writelines() requires list of strings',)) + >>> Testing *Iter* using sys.stdout.writelines(%s) + sys.stdout.writelines(FailingIter()):(, NotImplementedError()) + sys.stdout.writelines(FailingIterNext()):(, NotImplementedError()) +--- 433,439 ---- + sys.stdout.write(None):(, TypeError("Can't convert 'NoneType' object to str implicitly",)) + >> OutputWriteLines + sys.stdout.writelines(None):(, TypeError("'NoneType' object is not iterable",)) +! sys.stdout.writelines([1]):(, TypeError("Can't convert 'int' object to str implicitly",)) + >>> Testing *Iter* using sys.stdout.writelines(%s) + sys.stdout.writelines(FailingIter()):(, NotImplementedError()) + sys.stdout.writelines(FailingIterNext()):(, NotImplementedError()) +*** ../vim-7.3.1225/src/version.c 2013-06-22 13:00:14.000000000 +0200 +--- src/version.c 2013-06-23 12:45:35.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1226, + /**/ + +-- + We're knights of the round table + We dance whene'er we're able + We do routines and chorus scenes + With footwork impeccable. + We dine well here in Camelot + We eat ham and jam and spam a lot. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// 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 /// diff --git a/7.3.1227 b/7.3.1227 new file mode 100644 index 0000000..2f8271b --- /dev/null +++ b/7.3.1227 @@ -0,0 +1,602 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1227 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1227 +Problem: Inconsistent string conversion. +Solution: Use 'encoding' instead of utf-8. Use METH_O in place of + METH_VARARGS where appropriate. (ZyX) +Files: src/if_py_both.h, src/testdir/test86.ok, src/testdir/test87.ok + + +*** ../vim-7.3.1226/src/if_py_both.h 2013-06-23 12:51:27.000000000 +0200 +--- src/if_py_both.h 2013-06-23 12:57:34.000000000 +0200 +*************** +*** 466,486 **** + */ + + static PyObject * +! VimCommand(PyObject *self UNUSED, PyObject *args) + { +! char *cmd; +! PyObject *result; + +! if (!PyArg_ParseTuple(args, "s", &cmd)) + return NULL; + +- PyErr_Clear(); +- + Py_BEGIN_ALLOW_THREADS + Python_Lock_Vim(); + + VimTryStart(); +! do_cmdline_cmd((char_u *)cmd); + update_screen(VALID); + + Python_Release_Vim(); +--- 466,485 ---- + */ + + static PyObject * +! VimCommand(PyObject *self UNUSED, PyObject *string) + { +! char_u *cmd; +! PyObject *result; +! PyObject *todecref; + +! if (!(cmd = StringToChars(string, &todecref))) + return NULL; + + Py_BEGIN_ALLOW_THREADS + Python_Lock_Vim(); + + VimTryStart(); +! do_cmdline_cmd(cmd); + update_screen(VALID); + + Python_Release_Vim(); +*************** +*** 491,498 **** + else + result = Py_None; + +- + Py_XINCREF(result); + return result; + } + +--- 490,497 ---- + else + result = Py_None; + + Py_XINCREF(result); ++ Py_XDECREF(todecref); + return result; + } + +*************** +*** 641,661 **** + static PyObject * + VimEval(PyObject *self UNUSED, PyObject *args) + { +! char *expr; + typval_T *our_tv; + PyObject *result; +! PyObject *lookup_dict; + +! if (!PyArg_ParseTuple(args, "s", &expr)) + return NULL; + + Py_BEGIN_ALLOW_THREADS + Python_Lock_Vim(); + VimTryStart(); +! our_tv = eval_expr((char_u *)expr, NULL); + Python_Release_Vim(); + Py_END_ALLOW_THREADS + + if (VimTryEnd()) + return NULL; + +--- 640,667 ---- + static PyObject * + VimEval(PyObject *self UNUSED, PyObject *args) + { +! char_u *expr; + typval_T *our_tv; ++ PyObject *string; ++ PyObject *todecref; + PyObject *result; +! PyObject *lookup_dict; + +! if (!PyArg_ParseTuple(args, "O", &string)) +! return NULL; +! +! if (!(expr = StringToChars(string, &todecref))) + return NULL; + + Py_BEGIN_ALLOW_THREADS + Python_Lock_Vim(); + VimTryStart(); +! our_tv = eval_expr(expr, NULL); + Python_Release_Vim(); + Py_END_ALLOW_THREADS + ++ Py_XDECREF(todecref); ++ + if (VimTryEnd()) + return NULL; + +*************** +*** 688,709 **** + static PyObject *ConvertToPyObject(typval_T *); + + static PyObject * +! VimEvalPy(PyObject *self UNUSED, PyObject *args) + { +- char *expr; + typval_T *our_tv; + PyObject *result; + +! if (!PyArg_ParseTuple(args, "s", &expr)) + return NULL; + + Py_BEGIN_ALLOW_THREADS + Python_Lock_Vim(); + VimTryStart(); +! our_tv = eval_expr((char_u *)expr, NULL); + Python_Release_Vim(); + Py_END_ALLOW_THREADS + + if (VimTryEnd()) + return NULL; + +--- 694,718 ---- + static PyObject *ConvertToPyObject(typval_T *); + + static PyObject * +! VimEvalPy(PyObject *self UNUSED, PyObject *string) + { + typval_T *our_tv; + PyObject *result; ++ char_u *expr; ++ PyObject *todecref; + +! if (!(expr = StringToChars(string, &todecref))) + return NULL; + + Py_BEGIN_ALLOW_THREADS + Python_Lock_Vim(); + VimTryStart(); +! our_tv = eval_expr(expr, NULL); + Python_Release_Vim(); + Py_END_ALLOW_THREADS + ++ Py_XDECREF(todecref); ++ + if (VimTryEnd()) + return NULL; + +*************** +*** 724,743 **** + } + + static PyObject * +! VimStrwidth(PyObject *self UNUSED, PyObject *args) + { +! char *expr; + +! if (!PyArg_ParseTuple(args, "s", &expr)) + return NULL; + +- return PyLong_FromLong( + #ifdef FEAT_MBYTE +! mb_string2cells((char_u *)expr, (int)STRLEN(expr)) + #else +! STRLEN(expr) + #endif +! ); + } + + static PyObject * +--- 733,756 ---- + } + + static PyObject * +! VimStrwidth(PyObject *self UNUSED, PyObject *string) + { +! char_u *str; +! PyObject *todecref; +! int result; + +! if (!(str = StringToChars(string, &todecref))) + return NULL; + + #ifdef FEAT_MBYTE +! result = mb_string2cells(str, (int)STRLEN(str)); + #else +! result = STRLEN(str); + #endif +! +! Py_XDECREF(todecref); +! +! return PyLong_FromLong(result); + } + + static PyObject * +*************** +*** 840,852 **** + } + + static PyObject * +! VimForeachRTP(PyObject *self UNUSED, PyObject *args) + { + map_rtp_data data; + +! if (!PyArg_ParseTuple(args, "O", &data.callable)) +! return NULL; +! + data.result = NULL; + + do_in_runtimepath(NULL, FALSE, &map_rtp_callback, &data); +--- 853,863 ---- + } + + static PyObject * +! VimForeachRTP(PyObject *self UNUSED, PyObject *callable) + { + map_rtp_data data; + +! data.callable = callable; + data.result = NULL; + + do_in_runtimepath(NULL, FALSE, &map_rtp_callback, &data); +*************** +*** 1099,1111 **** + + static struct PyMethodDef VimMethods[] = { + /* name, function, calling, documentation */ +! {"command", VimCommand, METH_VARARGS, "Execute a Vim ex-mode command" }, + {"eval", VimEval, METH_VARARGS, "Evaluate an expression using Vim evaluator" }, +! {"bindeval", VimEvalPy, METH_VARARGS, "Like eval(), but returns objects attached to vim ones"}, +! {"strwidth", VimStrwidth, METH_VARARGS, "Screen string width, counts as having width 1"}, + {"chdir", (PyCFunction)VimChdir, METH_VARARGS|METH_KEYWORDS, "Change directory"}, + {"fchdir", (PyCFunction)VimFchdir, METH_VARARGS|METH_KEYWORDS, "Change directory"}, +! {"foreach_rtp", VimForeachRTP, METH_VARARGS, "Call given callable for each path in &rtp"}, + {"find_module", FinderFindModule, METH_VARARGS, "Internal use only, returns loader object for any input it receives"}, + {"path_hook", VimPathHook, METH_VARARGS, "Hook function to install in sys.path_hooks"}, + {"_get_paths", (PyCFunction)Vim_GetPaths, METH_NOARGS, "Get &rtp-based additions to sys.path"}, +--- 1110,1122 ---- + + static struct PyMethodDef VimMethods[] = { + /* name, function, calling, documentation */ +! {"command", VimCommand, METH_O, "Execute a Vim ex-mode command" }, + {"eval", VimEval, METH_VARARGS, "Evaluate an expression using Vim evaluator" }, +! {"bindeval", VimEvalPy, METH_O, "Like eval(), but returns objects attached to vim ones"}, +! {"strwidth", VimStrwidth, METH_O, "Screen string width, counts as having width 1"}, + {"chdir", (PyCFunction)VimChdir, METH_VARARGS|METH_KEYWORDS, "Change directory"}, + {"fchdir", (PyCFunction)VimFchdir, METH_VARARGS|METH_KEYWORDS, "Change directory"}, +! {"foreach_rtp", VimForeachRTP, METH_O, "Call given callable for each path in &rtp"}, + {"find_module", FinderFindModule, METH_VARARGS, "Internal use only, returns loader object for any input it receives"}, + {"path_hook", VimPathHook, METH_VARARGS, "Hook function to install in sys.path_hooks"}, + {"_get_paths", (PyCFunction)Vim_GetPaths, METH_NOARGS, "Get &rtp-based additions to sys.path"}, +*************** +*** 1733,1739 **** + { + PyObject *object; + +! if (!PyArg_Parse(args, "(O)", &object)) + return NULL; + + if (PyObject_HasAttrString(object, "keys")) +--- 1744,1750 ---- + { + PyObject *object; + +! if (!PyArg_ParseTuple(args, "O", &object)) + return NULL; + + if (PyObject_HasAttrString(object, "keys")) +*************** +*** 1877,1889 **** + } + + static PyObject * +! DictionaryHasKey(DictionaryObject *self, PyObject *args) + { +- PyObject *keyObject; +- +- if (!PyArg_ParseTuple(args, "O", &keyObject)) +- return NULL; +- + return _DictionaryItem(self, keyObject, DICT_FLAG_RETURN_BOOL); + } + +--- 1888,1895 ---- + } + + static PyObject * +! DictionaryHasKey(DictionaryObject *self, PyObject *keyObject) + { + return _DictionaryItem(self, keyObject, DICT_FLAG_RETURN_BOOL); + } + +*************** +*** 1914,1920 **** + {"get", (PyCFunction)DictionaryGet, METH_VARARGS, ""}, + {"pop", (PyCFunction)DictionaryPop, METH_VARARGS, ""}, + {"popitem", (PyCFunction)DictionaryPopItem, METH_NOARGS, ""}, +! {"has_key", (PyCFunction)DictionaryHasKey, METH_VARARGS, ""}, + {"__dir__", (PyCFunction)DictionaryDir, METH_NOARGS, ""}, + { NULL, NULL, 0, NULL} + }; +--- 1920,1926 ---- + {"get", (PyCFunction)DictionaryGet, METH_VARARGS, ""}, + {"pop", (PyCFunction)DictionaryPop, METH_VARARGS, ""}, + {"popitem", (PyCFunction)DictionaryPopItem, METH_NOARGS, ""}, +! {"has_key", (PyCFunction)DictionaryHasKey, METH_O, ""}, + {"__dir__", (PyCFunction)DictionaryDir, METH_NOARGS, ""}, + { NULL, NULL, 0, NULL} + }; +*************** +*** 2434,2444 **** + return NULL; + } + +! if (!PyArg_ParseTuple(args, "s", &name)) + return NULL; + + self = FunctionNew(subtype, name); + + return self; + } + +--- 2440,2452 ---- + return NULL; + } + +! if (!PyArg_ParseTuple(args, "et", "ascii", &name)) + return NULL; + + self = FunctionNew(subtype, name); + ++ PyMem_Free(name); ++ + return self; + } + +*************** +*** 4383,4402 **** + } + + static PyObject * +! BufferMark(BufferObject *self, PyObject *args) + { + pos_T *posp; +! char *pmark; +! char mark; + buf_T *savebuf; + + if (CheckBuffer(self)) + return NULL; + +! if (!PyArg_ParseTuple(args, "s", &pmark)) + return NULL; + +! if (STRLEN(pmark) != 1) + { + PyErr_SetString(PyExc_ValueError, + _("mark name must be a single character")); +--- 4391,4411 ---- + } + + static PyObject * +! BufferMark(BufferObject *self, PyObject *pmarkObject) + { + pos_T *posp; +! char_u *pmark; +! char_u mark; + buf_T *savebuf; ++ PyObject *todecref; + + if (CheckBuffer(self)) + return NULL; + +! if (!(pmark = StringToChars(pmarkObject, &todecref))) + return NULL; + +! if (pmark[0] == '\0' || pmark[1] != '\0') + { + PyErr_SetString(PyExc_ValueError, + _("mark name must be a single character")); +*************** +*** 4404,4409 **** +--- 4413,4421 ---- + } + + mark = *pmark; ++ ++ Py_XDECREF(todecref); ++ + VimTryStart(); + switch_buffer(&savebuf, self->buf); + posp = getmark(mark, FALSE); +*************** +*** 4461,4467 **** + static struct PyMethodDef BufferMethods[] = { + /* name, function, calling, documentation */ + {"append", (PyCFunction)BufferAppend, METH_VARARGS, "Append data to Vim buffer" }, +! {"mark", (PyCFunction)BufferMark, METH_VARARGS, "Return (row,col) representing position of named mark" }, + {"range", (PyCFunction)BufferRange, METH_VARARGS, "Return a range object which represents the part of the given buffer between line numbers s and e" }, + {"__dir__", (PyCFunction)BufferDir, METH_NOARGS, ""}, + { NULL, NULL, 0, NULL} +--- 4473,4479 ---- + static struct PyMethodDef BufferMethods[] = { + /* name, function, calling, documentation */ + {"append", (PyCFunction)BufferAppend, METH_VARARGS, "Append data to Vim buffer" }, +! {"mark", (PyCFunction)BufferMark, METH_O, "Return (row,col) representing position of named mark" }, + {"range", (PyCFunction)BufferRange, METH_VARARGS, "Return a range object which represents the part of the given buffer between line numbers s and e" }, + {"__dir__", (PyCFunction)BufferDir, METH_NOARGS, ""}, + { NULL, NULL, 0, NULL} +*** ../vim-7.3.1226/src/testdir/test86.ok 2013-06-23 12:51:27.000000000 +0200 +--- src/testdir/test86.ok 2013-06-23 12:57:34.000000000 +0200 +*************** +*** 446,459 **** + sys.stdout.writelines(None):TypeError:("'NoneType' object is not iterable",) + sys.stdout.writelines([1]):TypeError:('coercing to Unicode: need string or buffer, int found',) + > VimCommand +! vim.command(1):TypeError:('must be string, not int',) + > VimToPython + > VimEval +! vim.eval(1):TypeError:('must be string, not int',) + > VimEvalPy +! vim.bindeval(1):TypeError:('must be string, not int',) + > VimStrwidth +! vim.strwidth(1):TypeError:('must be string, not int',) + > Dictionary + >> DictionaryConstructor + vim.Dictionary("abc"):ValueError:('expected sequence element of size 2',) +--- 446,459 ---- + sys.stdout.writelines(None):TypeError:("'NoneType' object is not iterable",) + sys.stdout.writelines([1]):TypeError:('coercing to Unicode: need string or buffer, int found',) + > VimCommand +! vim.command(1):TypeError:('object must be string',) + > VimToPython + > VimEval +! vim.eval(1):TypeError:('object must be string',) + > VimEvalPy +! vim.bindeval(1):TypeError:('object must be string',) + > VimStrwidth +! vim.strwidth(1):TypeError:('object must be string',) + > Dictionary + >> DictionaryConstructor + vim.Dictionary("abc"):ValueError:('expected sequence element of size 2',) +*************** +*** 683,689 **** + >> DictionaryPopItem + d.popitem(1, 2):TypeError:('popitem() takes no arguments (2 given)',) + >> DictionaryHasKey +! d.has_key():TypeError:('function takes exactly 1 argument (0 given)',) + > List + >> ListConstructor + vim.List(1, 2):TypeError:('function takes at most 1 argument (2 given)',) +--- 683,689 ---- + >> DictionaryPopItem + d.popitem(1, 2):TypeError:('popitem() takes no arguments (2 given)',) + >> DictionaryHasKey +! d.has_key():TypeError:('has_key() takes exactly one argument (0 given)',) + > List + >> ListConstructor + vim.List(1, 2):TypeError:('function takes at most 1 argument (2 given)',) +*************** +*** 1065,1071 **** + vim.current.buffer.name = True:TypeError:('object must be string',) + vim.current.buffer.xxx = True:AttributeError:('xxx',) + >> BufferMark +! vim.current.buffer.mark(0):TypeError:('must be string, not int',) + vim.current.buffer.mark("abc"):ValueError:('mark name must be a single character',) + vim.current.buffer.mark("!"):error:('invalid mark name',) + >> BufferRange +--- 1065,1071 ---- + vim.current.buffer.name = True:TypeError:('object must be string',) + vim.current.buffer.xxx = True:AttributeError:('xxx',) + >> BufferMark +! vim.current.buffer.mark(0):TypeError:('object must be string',) + vim.current.buffer.mark("abc"):ValueError:('mark name must be a single character',) + vim.current.buffer.mark("!"):error:('invalid mark name',) + >> BufferRange +*** ../vim-7.3.1226/src/testdir/test87.ok 2013-06-23 12:51:27.000000000 +0200 +--- src/testdir/test87.ok 2013-06-23 12:57:34.000000000 +0200 +*************** +*** 439,452 **** + sys.stdout.writelines(FailingIterNext()):(, NotImplementedError()) + <<< Finished + > VimCommand +! vim.command(1):(, TypeError('must be str, not int',)) + > VimToPython + > VimEval +! vim.eval(1):(, TypeError('must be str, not int',)) + > VimEvalPy +! vim.bindeval(1):(, TypeError('must be str, not int',)) + > VimStrwidth +! vim.strwidth(1):(, TypeError('must be str, not int',)) + > Dictionary + >> DictionaryConstructor + vim.Dictionary("abc"):(, ValueError('expected sequence element of size 2',)) +--- 439,452 ---- + sys.stdout.writelines(FailingIterNext()):(, NotImplementedError()) + <<< Finished + > VimCommand +! vim.command(1):(, TypeError('object must be string',)) + > VimToPython + > VimEval +! vim.eval(1):(, TypeError('object must be string',)) + > VimEvalPy +! vim.bindeval(1):(, TypeError('object must be string',)) + > VimStrwidth +! vim.strwidth(1):(, TypeError('object must be string',)) + > Dictionary + >> DictionaryConstructor + vim.Dictionary("abc"):(, ValueError('expected sequence element of size 2',)) +*************** +*** 680,686 **** + >> DictionaryPopItem + d.popitem(1, 2):(, TypeError('popitem() takes no arguments (2 given)',)) + >> DictionaryHasKey +! d.has_key():(, TypeError('function takes exactly 1 argument (0 given)',)) + > List + >> ListConstructor + vim.List(1, 2):(, TypeError('function takes at most 1 argument (2 given)',)) +--- 680,686 ---- + >> DictionaryPopItem + d.popitem(1, 2):(, TypeError('popitem() takes no arguments (2 given)',)) + >> DictionaryHasKey +! d.has_key():(, TypeError('has_key() takes exactly one argument (0 given)',)) + > List + >> ListConstructor + vim.List(1, 2):(, TypeError('function takes at most 1 argument (2 given)',)) +*************** +*** 1074,1080 **** + vim.current.buffer.name = True:(, TypeError('object must be string',)) + vim.current.buffer.xxx = True:(, AttributeError('xxx',)) + >> BufferMark +! vim.current.buffer.mark(0):(, TypeError('must be str, not int',)) + vim.current.buffer.mark("abc"):(, ValueError('mark name must be a single character',)) + vim.current.buffer.mark("!"):(, error('invalid mark name',)) + >> BufferRange +--- 1074,1080 ---- + vim.current.buffer.name = True:(, TypeError('object must be string',)) + vim.current.buffer.xxx = True:(, AttributeError('xxx',)) + >> BufferMark +! vim.current.buffer.mark(0):(, TypeError('object must be string',)) + vim.current.buffer.mark("abc"):(, ValueError('mark name must be a single character',)) + vim.current.buffer.mark("!"):(, error('invalid mark name',)) + >> BufferRange +*** ../vim-7.3.1226/src/version.c 2013-06-23 12:51:27.000000000 +0200 +--- src/version.c 2013-06-23 12:56:45.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1227, + /**/ + +-- + We're knights of the Round Table + Our shows are formidable + But many times + We're given rhymes + That are quite unsingable + We're opera mad in Camelot + We sing from the diaphragm a lot. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// 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 /// diff --git a/7.3.1228 b/7.3.1228 new file mode 100644 index 0000000..9fc1cd8 --- /dev/null +++ b/7.3.1228 @@ -0,0 +1,359 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1228 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1228 +Problem: Python: various inconsistencies and problems. +Solution: StringToLine now supports both bytes() and unicode() objects. + Make function names consistant. Fix memory leak fixed in + StringToLine. (ZyX) +Files: src/if_py_both.h, src/if_python3.c, src/if_python.c + + +*** ../vim-7.3.1227/src/if_py_both.h 2013-06-23 13:00:40.000000000 +0200 +--- src/if_py_both.h 2013-06-23 13:08:18.000000000 +0200 +*************** +*** 18,24 **** + #endif + + #ifdef FEAT_MBYTE +! # define ENC_OPT p_enc + #else + # define ENC_OPT "latin1" + #endif +--- 18,24 ---- + #endif + + #ifdef FEAT_MBYTE +! # define ENC_OPT ((char *)p_enc) + #else + # define ENC_OPT "latin1" + #endif +*************** +*** 92,119 **** + StringToChars(PyObject *object, PyObject **todecref) + { + char_u *p; +- PyObject *bytes = NULL; + + if (PyBytes_Check(object)) + { + +! if (PyString_AsStringAndSize(object, (char **) &p, NULL) == -1) +! return NULL; +! if (p == NULL) + return NULL; + + *todecref = NULL; + } + else if (PyUnicode_Check(object)) + { +! bytes = PyUnicode_AsEncodedString(object, (char *)ENC_OPT, NULL); +! if (bytes == NULL) +! return NULL; + +! if(PyString_AsStringAndSize(bytes, (char **) &p, NULL) == -1) + return NULL; +! if (p == NULL) + return NULL; + + *todecref = bytes; + } +--- 92,120 ---- + StringToChars(PyObject *object, PyObject **todecref) + { + char_u *p; + + if (PyBytes_Check(object)) + { + +! if (PyBytes_AsStringAndSize(object, (char **) &p, NULL) == -1 +! || p == NULL) + return NULL; + + *todecref = NULL; + } + else if (PyUnicode_Check(object)) + { +! PyObject *bytes; + +! if (!(bytes = PyUnicode_AsEncodedString(object, ENC_OPT, NULL))) + return NULL; +! +! if(PyBytes_AsStringAndSize(bytes, (char **) &p, NULL) == -1 +! || p == NULL) +! { +! Py_DECREF(bytes); + return NULL; ++ } + + *todecref = bytes; + } +*************** +*** 133,138 **** +--- 134,140 ---- + + if (!(string = PyString_FromString(s))) + return -1; ++ + if (PyList_Append(list, string)) + { + Py_DECREF(string); +*************** +*** 534,543 **** + } + + if (our_tv->v_type == VAR_STRING) +- { + result = PyString_FromString(our_tv->vval.v_string == NULL + ? "" : (char *)our_tv->vval.v_string); +- } + else if (our_tv->v_type == VAR_NUMBER) + { + char buf[NUMBUFLEN]; +--- 536,543 ---- +*************** +*** 3385,3406 **** + static char * + StringToLine(PyObject *obj) + { +! const char *str; +! char *save; +! PyObject *bytes; +! PyInt len; +! PyInt i; +! char *p; + +! if (obj == NULL || !PyString_Check(obj)) + { +! PyErr_BadArgument(); +! return NULL; + } + +! bytes = PyString_AsBytes(obj); /* for Python 2 this does nothing */ +! str = PyString_AsString(bytes); +! len = PyString_Size(bytes); + + /* + * Error checking: String must not contain newlines, as we +--- 3385,3415 ---- + static char * + StringToLine(PyObject *obj) + { +! char *str; +! char *save; +! PyObject *bytes = NULL; +! Py_ssize_t len; +! PyInt i; +! char *p; + +! if (PyBytes_Check(obj)) + { +! if (PyBytes_AsStringAndSize(obj, &str, &len) == -1 +! || str == NULL) +! return NULL; + } ++ else if (PyUnicode_Check(obj)) ++ { ++ if (!(bytes = PyUnicode_AsEncodedString(obj, ENC_OPT, NULL))) ++ return NULL; + +! if(PyBytes_AsStringAndSize(bytes, &str, &len) == -1 +! || str == NULL) +! { +! Py_DECREF(bytes); +! return NULL; +! } +! } + + /* + * Error checking: String must not contain newlines, as we +*************** +*** 3439,3445 **** + } + + save[i] = '\0'; +! PyString_FreeBytes(bytes); /* Python 2 does nothing here */ + + return save; + } +--- 3448,3454 ---- + } + + save[i] = '\0'; +! Py_XDECREF(bytes); /* Python 2 does nothing here */ + + return save; + } +*************** +*** 3568,3577 **** + + return OK; + } +! else if (PyString_Check(line)) + { +! char *save = StringToLine(line); +! buf_T *savebuf; + + if (save == NULL) + return FAIL; +--- 3577,3586 ---- + + return OK; + } +! else if (PyBytes_Check(line) || PyUnicode_Check(line)) + { +! char *save = StringToLine(line); +! buf_T *savebuf; + + if (save == NULL) + return FAIL; +*************** +*** 3821,3827 **** + /* First of all, we check the type of the supplied Python object. + * It must be a string or a list, or the call is in error. + */ +! if (PyString_Check(lines)) + { + char *str = StringToLine(lines); + buf_T *savebuf; +--- 3830,3836 ---- + /* First of all, we check the type of the supplied Python object. + * It must be a string or a list, or the call is in error. + */ +! if (PyBytes_Check(lines) || PyUnicode_Check(lines)) + { + char *str = StringToLine(lines); + buf_T *savebuf; +*************** +*** 5254,5260 **** + { + char_u *result; + +! if (PyString_AsStringAndSize(obj, (char **) &result, NULL) == -1) + return -1; + if (result == NULL) + return -1; +--- 5263,5269 ---- + { + char_u *result; + +! if (PyBytes_AsStringAndSize(obj, (char **) &result, NULL) == -1) + return -1; + if (result == NULL) + return -1; +*************** +*** 5269,5279 **** + PyObject *bytes; + char_u *result; + +! bytes = PyUnicode_AsEncodedString(obj, (char *)ENC_OPT, NULL); + if (bytes == NULL) + return -1; + +! if(PyString_AsStringAndSize(bytes, (char **) &result, NULL) == -1) + return -1; + if (result == NULL) + return -1; +--- 5278,5288 ---- + PyObject *bytes; + char_u *result; + +! bytes = PyUnicode_AsEncodedString(obj, ENC_OPT, NULL); + if (bytes == NULL) + return -1; + +! if(PyBytes_AsStringAndSize(bytes, (char **) &result, NULL) == -1) + return -1; + if (result == NULL) + return -1; +*** ../vim-7.3.1227/src/if_python3.c 2013-06-13 20:57:44.000000000 +0200 +--- src/if_python3.c 2013-06-23 13:08:18.000000000 +0200 +*************** +*** 84,96 **** + + #define PyInt Py_ssize_t + #define PyString_Check(obj) PyUnicode_Check(obj) +- #define PyString_AsBytes(obj) PyUnicode_AsEncodedString(obj, (char *)ENC_OPT, CODEC_ERROR_HANDLER) +- #define PyString_FreeBytes(obj) Py_XDECREF(bytes) +- #define PyString_AsString(obj) PyBytes_AsString(obj) +- #define PyString_Size(obj) PyBytes_GET_SIZE(bytes) + #define PyString_FromString(repr) PyUnicode_FromString(repr) + #define PyString_FromFormat PyUnicode_FromFormat +- #define PyString_AsStringAndSize(obj, buffer, len) PyBytes_AsStringAndSize(obj, buffer, len) + #define PyInt_Check(obj) PyLong_Check(obj) + #define PyInt_FromLong(i) PyLong_FromLong(i) + #define PyInt_AsLong(obj) PyLong_AsLong(obj) +--- 84,91 ---- +*************** +*** 357,363 **** + # endif + static PyObject* (*py3_PyUnicode_AsEncodedString)(PyObject *unicode, const char* encoding, const char* errors); + static char* (*py3_PyBytes_AsString)(PyObject *bytes); +! static int (*py3_PyBytes_AsStringAndSize)(PyObject *bytes, char **buffer, int *length); + static PyObject* (*py3_PyBytes_FromString)(char *str); + static PyObject* (*py3_PyFloat_FromDouble)(double num); + static double (*py3_PyFloat_AsDouble)(PyObject *); +--- 352,358 ---- + # endif + static PyObject* (*py3_PyUnicode_AsEncodedString)(PyObject *unicode, const char* encoding, const char* errors); + static char* (*py3_PyBytes_AsString)(PyObject *bytes); +! static int (*py3_PyBytes_AsStringAndSize)(PyObject *bytes, char **buffer, Py_ssize_t *length); + static PyObject* (*py3_PyBytes_FromString)(char *str); + static PyObject* (*py3_PyFloat_FromDouble)(double num); + static double (*py3_PyFloat_AsDouble)(PyObject *); +*** ../vim-7.3.1227/src/if_python.c 2013-06-12 14:40:58.000000000 +0200 +--- src/if_python.c 2013-06-23 13:08:18.000000000 +0200 +*************** +*** 68,79 **** + #undef main /* Defined in python.h - aargh */ + #undef HAVE_FCNTL_H /* Clash with os_win32.h */ + +! #define PyBytes_FromString PyString_FromString +! #define PyBytes_Check PyString_Check +! +! /* No-op conversion functions, use with care! */ +! #define PyString_AsBytes(obj) (obj) +! #define PyString_FreeBytes(obj) + + #if !defined(FEAT_PYTHON) && defined(PROTO) + /* Use this to be able to generate prototypes without python being used. */ +--- 68,76 ---- + #undef main /* Defined in python.h - aargh */ + #undef HAVE_FCNTL_H /* Clash with os_win32.h */ + +! #define PyBytes_FromString PyString_FromString +! #define PyBytes_Check PyString_Check +! #define PyBytes_AsStringAndSize PyString_AsStringAndSize + + #if !defined(FEAT_PYTHON) && defined(PROTO) + /* Use this to be able to generate prototypes without python being used. */ +*** ../vim-7.3.1227/src/version.c 2013-06-23 13:00:40.000000000 +0200 +--- src/version.c 2013-06-23 13:07:40.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1228, + /**/ + +-- + In war we're tough and able. + Quite indefatigable + Between our quests + We sequin vests + And impersonate Clark Gable + It's a busy life in Camelot. + I have to push the pram a lot. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// 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 /// diff --git a/7.3.1229 b/7.3.1229 new file mode 100644 index 0000000..ef4c8ec --- /dev/null +++ b/7.3.1229 @@ -0,0 +1,1572 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1229 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1229 +Problem: Python: not so easy to delete/restore translating. +Solution: Make macros do translation of exception messages. (ZyX) + Note: this breaks translations! +Files: src/if_py_both.h, src/if_python3.c + + +*** ../vim-7.3.1228/src/if_py_both.h 2013-06-23 13:11:14.000000000 +0200 +--- src/if_py_both.h 2013-06-23 13:19:01.000000000 +0200 +*************** +*** 26,35 **** + + static const char *vim_special_path = "_vim_path_"; + + #define PyErr_SetVim(str) PyErr_SetString(VimError, str) + +! #define RAISE_NO_EMPTY_KEYS PyErr_SetString(PyExc_ValueError, \ +! _("empty keys are not allowed")) + + #define INVALID_BUFFER_VALUE ((buf_T *)(-1)) + #define INVALID_WINDOW_VALUE ((win_T *)(-1)) +--- 26,37 ---- + + static const char *vim_special_path = "_vim_path_"; + ++ #define PyErr_SET_STRING(exc, str) PyErr_SetString(exc, _(str)) + #define PyErr_SetVim(str) PyErr_SetString(VimError, str) ++ #define PyErr_SET_VIM(str) PyErr_SET_STRING(VimError, str) + +! #define RAISE_NO_EMPTY_KEYS PyErr_SET_STRING(PyExc_ValueError, \ +! "empty keys are not allowed") + + #define INVALID_BUFFER_VALUE ((buf_T *)(-1)) + #define INVALID_WINDOW_VALUE ((win_T *)(-1)) +*************** +*** 120,126 **** + } + else + { +! PyErr_SetString(PyExc_TypeError, _("object must be string")); + return NULL; + } + +--- 122,128 ---- + } + else + { +! PyErr_SET_STRING(PyExc_TypeError, "object must be string"); + return NULL; + } + +*************** +*** 212,219 **** + { + if (val == NULL) + { +! PyErr_SetString(PyExc_AttributeError, +! _("can't delete OutputObject attributes")); + return -1; + } + +--- 214,221 ---- + { + if (val == NULL) + { +! PyErr_SET_STRING(PyExc_AttributeError, +! "can't delete OutputObject attributes"); + return -1; + } + +*************** +*** 221,227 **** + { + if (!PyInt_Check(val)) + { +! PyErr_SetString(PyExc_TypeError, _("softspace must be an integer")); + return -1; + } + +--- 223,229 ---- + { + if (!PyInt_Check(val)) + { +! PyErr_SET_STRING(PyExc_TypeError, "softspace must be an integer"); + return -1; + } + +*************** +*** 229,235 **** + return 0; + } + +! PyErr_SetString(PyExc_AttributeError, _("invalid attribute")); + return -1; + } + +--- 231,237 ---- + return 0; + } + +! PyErr_SET_STRING(PyExc_AttributeError, "invalid attribute"); + return -1; + } + +*************** +*** 667,673 **** + + if (our_tv == NULL) + { +! PyErr_SetVim(_("invalid expression")); + return NULL; + } + +--- 669,675 ---- + + if (our_tv == NULL) + { +! PyErr_SET_VIM("invalid expression"); + return NULL; + } + +*************** +*** 718,724 **** + + if (our_tv == NULL) + { +! PyErr_SetVim(_("invalid expression")); + return NULL; + } + +--- 720,726 ---- + + if (our_tv == NULL) + { +! PyErr_SET_VIM("invalid expression"); + return NULL; + } + +*************** +*** 790,796 **** + if (VimTryEnd()) + return NULL; + +! PyErr_SetVim(_("failed to change directory")); + return NULL; + } + +--- 792,798 ---- + if (VimTryEnd()) + return NULL; + +! PyErr_SET_VIM("failed to change directory"); + return NULL; + } + +*************** +*** 968,975 **** + if (!PyTuple_Check(find_module_result) + || PyTuple_GET_SIZE(find_module_result) != 3) + { +! PyErr_SetString(PyExc_TypeError, +! _("expected 3-tuple as imp.find_module() result")); + return NULL; + } + +--- 970,977 ---- + if (!PyTuple_Check(find_module_result) + || PyTuple_GET_SIZE(find_module_result) != 3) + { +! PyErr_SET_STRING(PyExc_TypeError, +! "expected 3-tuple as imp.find_module() result"); + return NULL; + } + +*************** +*** 977,984 **** + || !(pathname = PyTuple_GET_ITEM(find_module_result, 1)) + || !(description = PyTuple_GET_ITEM(find_module_result, 2))) + { +! PyErr_SetString(PyExc_RuntimeError, +! _("internal error: imp.find_module returned tuple with NULL")); + return NULL; + } + +--- 979,986 ---- + || !(pathname = PyTuple_GET_ITEM(find_module_result, 1)) + || !(description = PyTuple_GET_ITEM(find_module_result, 2))) + { +! PyErr_SET_STRING(PyExc_RuntimeError, +! "internal error: imp.find_module returned tuple with NULL"); + return NULL; + } + +*************** +*** 1349,1356 **** + { + if (val == NULL) + { +! PyErr_SetString(PyExc_AttributeError, +! _("cannot delete vim.Dictionary attributes")); + return -1; + } + +--- 1351,1358 ---- + { + if (val == NULL) + { +! PyErr_SET_STRING(PyExc_AttributeError, +! "cannot delete vim.Dictionary attributes"); + return -1; + } + +*************** +*** 1358,1364 **** + { + if (self->dict->dv_lock == VAR_FIXED) + { +! PyErr_SetString(PyExc_TypeError, _("cannot modify fixed dictionary")); + return -1; + } + else +--- 1360,1366 ---- + { + if (self->dict->dv_lock == VAR_FIXED) + { +! PyErr_SET_STRING(PyExc_TypeError, "cannot modify fixed dictionary"); + return -1; + } + else +*************** +*** 1375,1381 **** + } + else + { +! PyErr_SetString(PyExc_AttributeError, _("cannot set this attribute")); + return -1; + } + } +--- 1377,1383 ---- + } + else + { +! PyErr_SET_STRING(PyExc_AttributeError, "cannot set this attribute"); + return -1; + } + } +*************** +*** 1457,1463 **** + { + if (dict->dv_lock) + { +! PyErr_SetVim(_("dict is locked")); + Py_DECREF(r); + return NULL; + } +--- 1459,1465 ---- + { + if (dict->dv_lock) + { +! PyErr_SET_VIM("dict is locked"); + Py_DECREF(r); + return NULL; + } +*************** +*** 1508,1515 **** + if ((*dii)->ht->ht_array != (*dii)->ht_array || + (*dii)->ht->ht_used != (*dii)->ht_used) + { +! PyErr_SetString(PyExc_RuntimeError, +! _("hashtab changed during iteration")); + return NULL; + } + +--- 1510,1517 ---- + if ((*dii)->ht->ht_array != (*dii)->ht_array || + (*dii)->ht->ht_used != (*dii)->ht_used) + { +! PyErr_SET_STRING(PyExc_RuntimeError, +! "hashtab changed during iteration"); + return NULL; + } + +*************** +*** 1560,1566 **** + + if (dict->dv_lock) + { +! PyErr_SetVim(_("dict is locked")); + return -1; + } + +--- 1562,1568 ---- + + if (dict->dv_lock) + { +! PyErr_SET_VIM("dict is locked"); + return -1; + } + +*************** +*** 1615,1621 **** + Py_XDECREF(todecref); + vim_free(di); + dictitem_free(di); +! PyErr_SetVim(_("failed to add key to dictionary")); + return -1; + } + } +--- 1617,1623 ---- + Py_XDECREF(todecref); + vim_free(di); + dictitem_free(di); +! PyErr_SET_VIM("failed to add key to dictionary"); + return -1; + } + } +*************** +*** 1723,1729 **** + + if (dict->dv_lock) + { +! PyErr_SetVim(_("dict is locked")); + return NULL; + } + +--- 1725,1731 ---- + + if (dict->dv_lock) + { +! PyErr_SET_VIM("dict is locked"); + return NULL; + } + +*************** +*** 1779,1786 **** + { + Py_DECREF(iterator); + Py_DECREF(fast); +! PyErr_SetString(PyExc_ValueError, +! _("expected sequence element of size 2")); + return NULL; + } + +--- 1781,1788 ---- + { + Py_DECREF(iterator); + Py_DECREF(fast); +! PyErr_SET_STRING(PyExc_ValueError, +! "expected sequence element of size 2"); + return NULL; + } + +*************** +*** 1823,1829 **** + { + Py_DECREF(iterator); + dictitem_free(di); +! PyErr_SetVim(_("failed to add key to dictionary")); + return NULL; + } + } +--- 1825,1831 ---- + { + Py_DECREF(iterator); + dictitem_free(di); +! PyErr_SET_VIM("failed to add key to dictionary"); + return NULL; + } + } +*************** +*** 2021,2028 **** + + if (kwargs) + { +! PyErr_SetString(PyExc_TypeError, +! _("list constructor does not accept keyword arguments")); + return NULL; + } + +--- 2023,2030 ---- + + if (kwargs) + { +! PyErr_SET_STRING(PyExc_TypeError, +! "list constructor does not accept keyword arguments"); + return NULL; + } + +*************** +*** 2077,2089 **** + + if (index >= ListLength(self)) + { +! PyErr_SetString(PyExc_IndexError, _("list index out of range")); + return NULL; + } + li = list_find(self->list, (long) index); + if (li == NULL) + { +! PyErr_SetVim(_("internal error: failed to get vim list item")); + return NULL; + } + return ConvertToPyObject(&li->li_tv); +--- 2079,2091 ---- + + if (index >= ListLength(self)) + { +! PyErr_SET_STRING(PyExc_IndexError, "list index out of range"); + return NULL; + } + li = list_find(self->list, (long) index); + if (li == NULL) + { +! PyErr_SET_VIM("internal error: failed to get vim list item"); + return NULL; + } + return ConvertToPyObject(&li->li_tv); +*************** +*** 2196,2207 **** + + if (l->lv_lock) + { +! PyErr_SetVim(_("list is locked")); + return -1; + } + if (index>length || (index==length && obj==NULL)) + { +! PyErr_SetString(PyExc_IndexError, _("list index out of range")); + return -1; + } + +--- 2198,2209 ---- + + if (l->lv_lock) + { +! PyErr_SET_VIM("list is locked"); + return -1; + } + if (index>length || (index==length && obj==NULL)) + { +! PyErr_SET_STRING(PyExc_IndexError, "list index out of range"); + return -1; + } + +*************** +*** 2222,2228 **** + if (list_append_tv(l, &tv) == FAIL) + { + clear_tv(&tv); +! PyErr_SetVim(_("failed to add item to list")); + return -1; + } + } +--- 2224,2230 ---- + if (list_append_tv(l, &tv) == FAIL) + { + clear_tv(&tv); +! PyErr_SET_VIM("failed to add item to list"); + return -1; + } + } +*************** +*** 2250,2256 **** + + if (l->lv_lock) + { +! PyErr_SetVim(_("list is locked")); + return -1; + } + +--- 2252,2258 ---- + + if (l->lv_lock) + { +! PyErr_SET_VIM("list is locked"); + return -1; + } + +*************** +*** 2263,2269 **** + li = list_find(l, (long) first); + if (li == NULL) + { +! PyErr_SetVim(_("internal error: no vim list item")); + return -1; + } + if (last > first) +--- 2265,2271 ---- + li = list_find(l, (long) first); + if (li == NULL) + { +! PyErr_SET_VIM("internal error: no vim list item"); + return -1; + } + if (last > first) +*************** +*** 2296,2302 **** + if (list_insert_tv(l, &v, li) == FAIL) + { + clear_tv(&v); +! PyErr_SetVim(_("internal error: failed to add item to list")); + return -1; + } + clear_tv(&v); +--- 2298,2304 ---- + if (list_insert_tv(l, &v, li) == FAIL) + { + clear_tv(&v); +! PyErr_SET_VIM("internal error: failed to add item to list"); + return -1; + } + clear_tv(&v); +*************** +*** 2313,2319 **** + + if (l->lv_lock) + { +! PyErr_SetVim(_("list is locked")); + return NULL; + } + +--- 2315,2321 ---- + + if (l->lv_lock) + { +! PyErr_SET_VIM("list is locked"); + return NULL; + } + +*************** +*** 2347,2354 **** + { + if (val == NULL) + { +! PyErr_SetString(PyExc_AttributeError, +! _("cannot delete vim.List attributes")); + return -1; + } + +--- 2349,2356 ---- + { + if (val == NULL) + { +! PyErr_SET_STRING(PyExc_AttributeError, +! "cannot delete vim.List attributes"); + return -1; + } + +*************** +*** 2356,2362 **** + { + if (self->list->lv_lock == VAR_FIXED) + { +! PyErr_SetString(PyExc_TypeError, _("cannot modify fixed list")); + return -1; + } + else +--- 2358,2364 ---- + { + if (self->list->lv_lock == VAR_FIXED) + { +! PyErr_SET_STRING(PyExc_TypeError, "cannot modify fixed list"); + return -1; + } + else +*************** +*** 2373,2379 **** + } + else + { +! PyErr_SetString(PyExc_AttributeError, _("cannot set this attribute")); + return -1; + } + } +--- 2375,2381 ---- + } + else + { +! PyErr_SET_STRING(PyExc_AttributeError, "cannot set this attribute"); + return -1; + } + } +*************** +*** 2408,2415 **** + { + if (!translated_function_exists(name)) + { +! PyErr_SetString(PyExc_ValueError, +! _("unnamed function does not exist")); + return NULL; + } + self->name = vim_strsave(name); +--- 2410,2417 ---- + { + if (!translated_function_exists(name)) + { +! PyErr_SET_STRING(PyExc_ValueError, +! "unnamed function does not exist"); + return NULL; + } + self->name = vim_strsave(name); +*************** +*** 2420,2426 **** + vim_strchr(name, AUTOLOAD_CHAR) == NULL)) + == NULL) + { +! PyErr_SetString(PyExc_ValueError, _("function does not exist")); + return NULL; + } + +--- 2422,2428 ---- + vim_strchr(name, AUTOLOAD_CHAR) == NULL)) + == NULL) + { +! PyErr_SET_STRING(PyExc_ValueError, "function does not exist"); + return NULL; + } + +*************** +*** 2435,2442 **** + + if (kwargs) + { +! PyErr_SetString(PyExc_TypeError, +! _("function constructor does not accept keyword arguments")); + return NULL; + } + +--- 2437,2444 ---- + + if (kwargs) + { +! PyErr_SET_STRING(PyExc_TypeError, +! "function constructor does not accept keyword arguments"); + return NULL; + } + +*************** +*** 2513,2519 **** + else if (error != OK) + { + result = NULL; +! PyErr_SetVim(_("failed to run function")); + } + else + result = ConvertToPyObject(&rettv); +--- 2515,2521 ---- + else if (error != OK) + { + result = NULL; +! PyErr_SET_VIM("failed to run function"); + } + else + result = ConvertToPyObject(&rettv); +*************** +*** 2658,2671 **** + } + else + { +! PyErr_SetString(PyExc_RuntimeError, +! _("unable to get option value")); + return NULL; + } + } + else + { +! PyErr_SetVim("Internal error: unknown option type. Should not happen"); + return NULL; + } + } +--- 2660,2673 ---- + } + else + { +! PyErr_SET_STRING(PyExc_RuntimeError, +! "unable to get option value"); + return NULL; + } + } + else + { +! PyErr_SET_VIM("internal error: unknown option type"); + return NULL; + } + } +*************** +*** 2708,2714 **** + { + if (VimTryEnd()) + return -1; +! PyErr_SetVim("Problem while switching windows."); + return -1; + } + r = set_option_value_err(key, numval, stringval, opt_flags); +--- 2710,2716 ---- + { + if (VimTryEnd()) + return -1; +! PyErr_SET_VIM("problem while switching windows"); + return -1; + } + r = set_option_value_err(key, numval, stringval, opt_flags); +*************** +*** 2768,2782 **** + { + if (self->opt_type == SREQ_GLOBAL) + { +! PyErr_SetString(PyExc_ValueError, +! _("unable to unset global option")); + Py_XDECREF(todecref); + return -1; + } + else if (!(flags & SOPT_GLOBAL)) + { +! PyErr_SetString(PyExc_ValueError, _("unable to unset option " +! "without global value")); + Py_XDECREF(todecref); + return -1; + } +--- 2770,2783 ---- + { + if (self->opt_type == SREQ_GLOBAL) + { +! PyErr_SET_STRING(PyExc_ValueError, "unable to unset global option"); + Py_XDECREF(todecref); + return -1; + } + else if (!(flags & SOPT_GLOBAL)) + { +! PyErr_SET_STRING(PyExc_ValueError, "unable to unset option " +! "without global value"); + Py_XDECREF(todecref); + return -1; + } +*************** +*** 2813,2819 **** + val = PyLong_AsLong(valObject); + else + { +! PyErr_SetString(PyExc_TypeError, _("object must be integer")); + Py_XDECREF(todecref); + return -1; + } +--- 2814,2820 ---- + val = PyLong_AsLong(valObject); + else + { +! PyErr_SET_STRING(PyExc_TypeError, "object must be integer"); + Py_XDECREF(todecref); + return -1; + } +*************** +*** 2862,2868 **** + { + if (self->tab == INVALID_TABPAGE_VALUE) + { +! PyErr_SetVim(_("attempt to refer to deleted tab page")); + return -1; + } + +--- 2863,2869 ---- + { + if (self->tab == INVALID_TABPAGE_VALUE) + { +! PyErr_SET_VIM("attempt to refer to deleted tab page"); + return -1; + } + +*************** +*** 3006,3012 **** + if (n == 0) + return TabPageNew(tp); + +! PyErr_SetString(PyExc_IndexError, _("no such tab page")); + return NULL; + } + +--- 3007,3013 ---- + if (n == 0) + return TabPageNew(tp); + +! PyErr_SET_STRING(PyExc_IndexError, "no such tab page"); + return NULL; + } + +*************** +*** 3028,3034 **** + { + if (self->win == INVALID_WINDOW_VALUE) + { +! PyErr_SetVim(_("attempt to refer to deleted window")); + return -1; + } + +--- 3029,3035 ---- + { + if (self->win == INVALID_WINDOW_VALUE) + { +! PyErr_SET_VIM("attempt to refer to deleted window"); + return -1; + } + +*************** +*** 3194,3200 **** + + if (strcmp(name, "buffer") == 0) + { +! PyErr_SetString(PyExc_TypeError, _("readonly attribute")); + return -1; + } + else if (strcmp(name, "cursor") == 0) +--- 3195,3201 ---- + + if (strcmp(name, "buffer") == 0) + { +! PyErr_SET_STRING(PyExc_TypeError, "readonly attribute"); + return -1; + } + else if (strcmp(name, "cursor") == 0) +*************** +*** 3207,3213 **** + + if (lnum <= 0 || lnum > self->win->w_buffer->b_ml.ml_line_count) + { +! PyErr_SetVim(_("cursor position outside buffer")); + return -1; + } + +--- 3208,3214 ---- + + if (lnum <= 0 || lnum > self->win->w_buffer->b_ml.ml_line_count) + { +! PyErr_SET_VIM("cursor position outside buffer"); + return -1; + } + +*************** +*** 3370,3376 **** + if (n == 0) + return WindowNew(w, self->tabObject? self->tabObject->tab: curtab); + +! PyErr_SetString(PyExc_IndexError, _("no such window")); + return NULL; + } + +--- 3371,3377 ---- + if (n == 0) + return WindowNew(w, self->tabObject? self->tabObject->tab: curtab); + +! PyErr_SET_STRING(PyExc_IndexError, "no such window"); + return NULL; + } + +*************** +*** 3424,3430 **** + --len; + else + { +! PyErr_SetVim(_("string cannot contain newlines")); + return NULL; + } + } +--- 3425,3431 ---- + --len; + else + { +! PyErr_SET_VIM("string cannot contain newlines"); + return NULL; + } + } +*************** +*** 3557,3565 **** + VimTryStart(); + + if (u_savedel((linenr_T)n, 1L) == FAIL) +! PyErr_SetVim(_("cannot save undo information")); + else if (ml_delete((linenr_T)n, FALSE) == FAIL) +! PyErr_SetVim(_("cannot delete line")); + else + { + if (buf == savebuf) +--- 3558,3566 ---- + VimTryStart(); + + if (u_savedel((linenr_T)n, 1L) == FAIL) +! PyErr_SET_VIM("cannot save undo information"); + else if (ml_delete((linenr_T)n, FALSE) == FAIL) +! PyErr_SET_VIM("cannot delete line"); + else + { + if (buf == savebuf) +*************** +*** 3593,3604 **** + + if (u_savesub((linenr_T)n) == FAIL) + { +! PyErr_SetVim(_("cannot save undo information")); + vim_free(save); + } + else if (ml_replace((linenr_T)n, (char_u *)save, FALSE) == FAIL) + { +! PyErr_SetVim(_("cannot replace line")); + vim_free(save); + } + else +--- 3594,3605 ---- + + if (u_savesub((linenr_T)n) == FAIL) + { +! PyErr_SET_VIM("cannot save undo information"); + vim_free(save); + } + else if (ml_replace((linenr_T)n, (char_u *)save, FALSE) == FAIL) + { +! PyErr_SET_VIM("cannot replace line"); + vim_free(save); + } + else +*************** +*** 3653,3666 **** + switch_buffer(&savebuf, buf); + + if (u_savedel((linenr_T)lo, (long)n) == FAIL) +! PyErr_SetVim(_("cannot save undo information")); + else + { + for (i = 0; i < n; ++i) + { + if (ml_delete((linenr_T)lo, FALSE) == FAIL) + { +! PyErr_SetVim(_("cannot delete line")); + break; + } + } +--- 3654,3667 ---- + switch_buffer(&savebuf, buf); + + if (u_savedel((linenr_T)lo, (long)n) == FAIL) +! PyErr_SET_VIM("cannot save undo information"); + else + { + for (i = 0; i < n; ++i) + { + if (ml_delete((linenr_T)lo, FALSE) == FAIL) + { +! PyErr_SET_VIM("cannot delete line"); + break; + } + } +*************** +*** 3721,3727 **** + switch_buffer(&savebuf, buf); + + if (u_save((linenr_T)(lo-1), (linenr_T)hi) == FAIL) +! PyErr_SetVim(_("cannot save undo information")); + + /* If the size of the range is reducing (ie, new_len < old_len) we + * need to delete some old_len. We do this at the start, by +--- 3722,3728 ---- + switch_buffer(&savebuf, buf); + + if (u_save((linenr_T)(lo-1), (linenr_T)hi) == FAIL) +! PyErr_SET_VIM("cannot save undo information"); + + /* If the size of the range is reducing (ie, new_len < old_len) we + * need to delete some old_len. We do this at the start, by +*************** +*** 3732,3738 **** + for (i = 0; i < old_len - new_len; ++i) + if (ml_delete((linenr_T)lo, FALSE) == FAIL) + { +! PyErr_SetVim(_("cannot delete line")); + break; + } + extra -= i; +--- 3733,3739 ---- + for (i = 0; i < old_len - new_len; ++i) + if (ml_delete((linenr_T)lo, FALSE) == FAIL) + { +! PyErr_SET_VIM("cannot delete line"); + break; + } + extra -= i; +*************** +*** 3748,3754 **** + if (ml_replace((linenr_T)(lo+i), (char_u *)array[i], FALSE) + == FAIL) + { +! PyErr_SetVim(_("cannot replace line")); + break; + } + } +--- 3749,3755 ---- + if (ml_replace((linenr_T)(lo+i), (char_u *)array[i], FALSE) + == FAIL) + { +! PyErr_SET_VIM("cannot replace line"); + break; + } + } +*************** +*** 3766,3772 **** + if (ml_append((linenr_T)(lo + i - 1), + (char_u *)array[i], 0, FALSE) == FAIL) + { +! PyErr_SetVim(_("cannot insert line")); + break; + } + vim_free(array[i]); +--- 3767,3773 ---- + if (ml_append((linenr_T)(lo + i - 1), + (char_u *)array[i], 0, FALSE) == FAIL) + { +! PyErr_SET_VIM("cannot insert line"); + break; + } + vim_free(array[i]); +*************** +*** 3843,3851 **** + switch_buffer(&savebuf, buf); + + if (u_save((linenr_T)n, (linenr_T)(n+1)) == FAIL) +! PyErr_SetVim(_("cannot save undo information")); + else if (ml_append((linenr_T)n, (char_u *)str, 0, FALSE) == FAIL) +! PyErr_SetVim(_("cannot insert line")); + else + appended_lines_mark((linenr_T)n, 1L); + +--- 3844,3852 ---- + switch_buffer(&savebuf, buf); + + if (u_save((linenr_T)n, (linenr_T)(n+1)) == FAIL) +! PyErr_SET_VIM("cannot save undo information"); + else if (ml_append((linenr_T)n, (char_u *)str, 0, FALSE) == FAIL) +! PyErr_SET_VIM("cannot insert line"); + else + appended_lines_mark((linenr_T)n, 1L); + +*************** +*** 3894,3900 **** + switch_buffer(&savebuf, buf); + + if (u_save((linenr_T)n, (linenr_T)(n + 1)) == FAIL) +! PyErr_SetVim(_("cannot save undo information")); + else + { + for (i = 0; i < size; ++i) +--- 3895,3901 ---- + switch_buffer(&savebuf, buf); + + if (u_save((linenr_T)n, (linenr_T)(n + 1)) == FAIL) +! PyErr_SET_VIM("cannot save undo information"); + else + { + for (i = 0; i < size; ++i) +*************** +*** 3902,3908 **** + if (ml_append((linenr_T)(n + i), + (char_u *)array[i], 0, FALSE) == FAIL) + { +! PyErr_SetVim(_("cannot insert line")); + + /* Free the rest of the lines */ + while (i < size) +--- 3903,3909 ---- + if (ml_append((linenr_T)(n + i), + (char_u *)array[i], 0, FALSE) == FAIL) + { +! PyErr_SET_VIM("cannot insert line"); + + /* Free the rest of the lines */ + while (i < size) +*************** +*** 3955,3961 **** + { + if (self->buf == INVALID_BUFFER_VALUE) + { +! PyErr_SetVim(_("attempt to refer to deleted buffer")); + return -1; + } + +--- 3956,3962 ---- + { + if (self->buf == INVALID_BUFFER_VALUE) + { +! PyErr_SET_VIM("attempt to refer to deleted buffer"); + return -1; + } + +*************** +*** 3976,3982 **** + + if (n < 0 || n > end - start) + { +! PyErr_SetString(PyExc_IndexError, _("line number out of range")); + return NULL; + } + +--- 3977,3983 ---- + + if (n < 0 || n > end - start) + { +! PyErr_SET_STRING(PyExc_IndexError, "line number out of range"); + return NULL; + } + +*************** +*** 4026,4032 **** + + if (n < 0 || n > end - start) + { +! PyErr_SetString(PyExc_IndexError, _("line number out of range")); + return -1; + } + +--- 4027,4033 ---- + + if (n < 0 || n > end - start) + { +! PyErr_SET_STRING(PyExc_IndexError, "line number out of range"); + return -1; + } + +*************** +*** 4098,4104 **** + + if (n < 0 || n > max) + { +! PyErr_SetString(PyExc_IndexError, _("line number out of range")); + return NULL; + } + +--- 4099,4105 ---- + + if (n < 0 || n > max) + { +! PyErr_SET_STRING(PyExc_IndexError, "line number out of range"); + return NULL; + } + +*************** +*** 4381,4387 **** + + if (r == FAIL) + { +! PyErr_SetVim(_("failed to rename buffer")); + return -1; + } + return 0; +--- 4382,4388 ---- + + if (r == FAIL) + { +! PyErr_SET_VIM("failed to rename buffer"); + return -1; + } + return 0; +*************** +*** 4416,4423 **** + + if (pmark[0] == '\0' || pmark[1] != '\0') + { +! PyErr_SetString(PyExc_ValueError, +! _("mark name must be a single character")); + return NULL; + } + +--- 4417,4424 ---- + + if (pmark[0] == '\0' || pmark[1] != '\0') + { +! PyErr_SET_STRING(PyExc_ValueError, +! "mark name must be a single character"); + return NULL; + } + +*************** +*** 4434,4440 **** + + if (posp == NULL) + { +! PyErr_SetVim(_("invalid mark name")); + return NULL; + } + +--- 4435,4441 ---- + + if (posp == NULL) + { +! PyErr_SET_VIM("invalid mark name"); + return NULL; + } + +*************** +*** 4529,4535 **** + bnr = PyLong_AsLong(keyObject); + else + { +! PyErr_SetString(PyExc_TypeError, _("key must be integer")); + return NULL; + } + +--- 4530,4536 ---- + bnr = PyLong_AsLong(keyObject); + else + { +! PyErr_SET_STRING(PyExc_TypeError, "key must be integer"); + return NULL; + } + +*************** +*** 4667,4673 **** + + if (value->ob_type != &BufferType) + { +! PyErr_SetString(PyExc_TypeError, _("expected vim.Buffer object")); + return -1; + } + +--- 4668,4674 ---- + + if (value->ob_type != &BufferType) + { +! PyErr_SET_STRING(PyExc_TypeError, "expected vim.Buffer object"); + return -1; + } + +*************** +*** 4680,4686 **** + { + if (VimTryEnd()) + return -1; +! PyErr_SetVim(_("failed to switch to given buffer")); + return -1; + } + +--- 4681,4687 ---- + { + if (VimTryEnd()) + return -1; +! PyErr_SET_VIM("failed to switch to given buffer"); + return -1; + } + +*************** +*** 4692,4698 **** + + if (value->ob_type != &WindowType) + { +! PyErr_SetString(PyExc_TypeError, _("expected vim.Window object")); + return -1; + } + +--- 4693,4699 ---- + + if (value->ob_type != &WindowType) + { +! PyErr_SET_STRING(PyExc_TypeError, "expected vim.Window object"); + return -1; + } + +*************** +*** 4702,4709 **** + + if (!count) + { +! PyErr_SetString(PyExc_ValueError, +! _("failed to find window in the current tab page")); + return -1; + } + +--- 4703,4710 ---- + + if (!count) + { +! PyErr_SET_STRING(PyExc_ValueError, +! "failed to find window in the current tab page"); + return -1; + } + +*************** +*** 4713,4720 **** + { + if (VimTryEnd()) + return -1; +! PyErr_SetString(PyExc_RuntimeError, +! _("did not switch to the specified window")); + return -1; + } + +--- 4714,4721 ---- + { + if (VimTryEnd()) + return -1; +! PyErr_SET_STRING(PyExc_RuntimeError, +! "did not switch to the specified window"); + return -1; + } + +*************** +*** 4724,4730 **** + { + if (value->ob_type != &TabPageType) + { +! PyErr_SetString(PyExc_TypeError, _("expected vim.TabPage object")); + return -1; + } + +--- 4725,4731 ---- + { + if (value->ob_type != &TabPageType) + { +! PyErr_SET_STRING(PyExc_TypeError, "expected vim.TabPage object"); + return -1; + } + +*************** +*** 4737,4744 **** + { + if (VimTryEnd()) + return -1; +! PyErr_SetString(PyExc_RuntimeError, +! _("did not switch to the specified tab page")); + return -1; + } + +--- 4738,4745 ---- + { + if (VimTryEnd()) + return -1; +! PyErr_SET_STRING(PyExc_RuntimeError, +! "did not switch to the specified tab page"); + return -1; + } + +*************** +*** 5005,5011 **** + clear_tv(&di->di_tv); + vim_free(di); + dict_unref(dict); +! PyErr_SetVim(_("failed to add key to dictionary")); + return -1; + } + } +--- 5006,5012 ---- + clear_tv(&di->di_tv); + vim_free(di); + dict_unref(dict); +! PyErr_SET_VIM("failed to add key to dictionary"); + return -1; + } + } +*************** +*** 5107,5113 **** + Py_DECREF(iterator); + dictitem_free(di); + dict_unref(dict); +! PyErr_SetVim(_("failed to add key to dictionary")); + return -1; + } + } +--- 5108,5114 ---- + Py_DECREF(iterator); + dictitem_free(di); + dict_unref(dict); +! PyErr_SET_VIM("failed to add key to dictionary"); + return -1; + } + } +*************** +*** 5215,5222 **** + r = convert_dl(obj, tv, pymap_to_tv, lookup_dict); + else + { +! PyErr_SetString(PyExc_TypeError, +! _("unable to convert object to vim dictionary")); + r = -1; + } + Py_DECREF(lookup_dict); +--- 5216,5223 ---- + r = convert_dl(obj, tv, pymap_to_tv, lookup_dict); + else + { +! PyErr_SET_STRING(PyExc_TypeError, +! "unable to convert object to vim dictionary"); + r = -1; + } + Py_DECREF(lookup_dict); +*************** +*** 5325,5332 **** + return convert_dl(obj, tv, pymap_to_tv, lookup_dict); + else + { +! PyErr_SetString(PyExc_TypeError, +! _("unable to convert to vim structure")); + return -1; + } + return 0; +--- 5326,5333 ---- + return convert_dl(obj, tv, pymap_to_tv, lookup_dict); + else + { +! PyErr_SET_STRING(PyExc_TypeError, +! "unable to convert to vim structure"); + return -1; + } + return 0; +*************** +*** 5337,5343 **** + { + if (tv == NULL) + { +! PyErr_SetVim(_("NULL reference passed")); + return NULL; + } + switch (tv->v_type) +--- 5338,5344 ---- + { + if (tv == NULL) + { +! PyErr_SET_VIM("NULL reference passed"); + return NULL; + } + switch (tv->v_type) +*************** +*** 5362,5368 **** + Py_INCREF(Py_None); + return Py_None; + default: +! PyErr_SetVim(_("internal error: invalid value type")); + return NULL; + } + } +--- 5363,5369 ---- + Py_INCREF(Py_None); + return Py_None; + default: +! PyErr_SET_VIM("internal error: invalid value type"); + return NULL; + } + } +*** ../vim-7.3.1228/src/if_python3.c 2013-06-23 13:11:14.000000000 +0200 +--- src/if_python3.c 2013-06-23 13:25:51.000000000 +0200 +*************** +*** 1169,1175 **** + } + else + { +! PyErr_SetString(PyExc_TypeError, _("index must be int or slice")); + return NULL; + } + } +--- 1169,1175 ---- + } + else + { +! PyErr_SET_STRING(PyExc_TypeError, "index must be int or slice"); + return NULL; + } + } +*************** +*** 1203,1209 **** + } + else + { +! PyErr_SetString(PyExc_TypeError, _("index must be int or slice")); + return -1; + } + } +--- 1203,1209 ---- + } + else + { +! PyErr_SET_STRING(PyExc_TypeError, "index must be int or slice"); + return -1; + } + } +*************** +*** 1285,1291 **** + } + else + { +! PyErr_SetString(PyExc_TypeError, _("index must be int or slice")); + return NULL; + } + } +--- 1285,1291 ---- + } + else + { +! PyErr_SET_STRING(PyExc_TypeError, "index must be int or slice"); + return NULL; + } + } +*************** +*** 1312,1318 **** + } + else + { +! PyErr_SetString(PyExc_TypeError, _("index must be int or slice")); + return -1; + } + } +--- 1312,1318 ---- + } + else + { +! PyErr_SET_STRING(PyExc_TypeError, "index must be int or slice"); + return -1; + } + } +*************** +*** 1491,1497 **** + } + else + { +! PyErr_SetString(PyExc_TypeError, _("index must be int or slice")); + return NULL; + } + } +--- 1491,1497 ---- + } + else + { +! PyErr_SET_STRING(PyExc_TypeError, "index must be int or slice"); + return NULL; + } + } +*************** +*** 1515,1521 **** + } + else + { +! PyErr_SetString(PyExc_TypeError, _("index must be int or slice")); + return -1; + } + } +--- 1515,1521 ---- + } + else + { +! PyErr_SET_STRING(PyExc_TypeError, "index must be int or slice"); + return -1; + } + } +*** ../vim-7.3.1228/src/version.c 2013-06-23 13:11:14.000000000 +0200 +--- src/version.c 2013-06-23 13:12:35.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1229, + /**/ + +-- +There is a fine line between courage and foolishness. +Unfortunately, it's not a fence. + + /// 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 /// diff --git a/7.3.1230 b/7.3.1230 new file mode 100644 index 0000000..d275d09 --- /dev/null +++ b/7.3.1230 @@ -0,0 +1,3406 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1230 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1230 +Problem: Python: Exception messages are not clear. +Solution: Make exception messages more verbose. (ZyX) +Files: src/if_py_both.h, src/if_python3.c, src/if_python.c, + src/testdir/test86.ok, src/testdir/test87.ok + + +*** ../vim-7.3.1229/src/if_py_both.h 2013-06-23 13:28:11.000000000 +0200 +--- src/if_py_both.h 2013-06-23 13:31:16.000000000 +0200 +*************** +*** 29,37 **** +--- 29,53 ---- + #define PyErr_SET_STRING(exc, str) PyErr_SetString(exc, _(str)) + #define PyErr_SetVim(str) PyErr_SetString(VimError, str) + #define PyErr_SET_VIM(str) PyErr_SET_STRING(VimError, str) ++ #define PyErr_FORMAT(exc, str, tail) PyErr_Format(exc, _(str), tail) ++ #define PyErr_VIM_FORMAT(str, tail) PyErr_FORMAT(VimError, str, tail) ++ ++ #define Py_TYPE_NAME(obj) (obj->ob_type->tp_name == NULL \ ++ ? "(NULL)" \ ++ : obj->ob_type->tp_name) + + #define RAISE_NO_EMPTY_KEYS PyErr_SET_STRING(PyExc_ValueError, \ + "empty keys are not allowed") ++ #define RAISE_LOCKED(type) PyErr_SET_VIM(_(type " is locked")) ++ #define RAISE_LOCKED_DICTIONARY RAISE_LOCKED("dictionary") ++ #define RAISE_LOCKED_LIST RAISE_LOCKED("list") ++ #define RAISE_UNDO_FAIL PyErr_SET_VIM("cannot save undo information") ++ #define RAISE_LINE_FAIL(act) PyErr_SET_VIM("cannot " act " line") ++ #define RAISE_KEY_ADD_FAIL(key) \ ++ PyErr_VIM_FORMAT("failed to add key '%s' to dictionary", key) ++ #define RAISE_INVALID_INDEX_TYPE(idx) \ ++ PyErr_FORMAT(PyExc_TypeError, "index must be int or slice, not %s", \ ++ Py_TYPE_NAME(idx)); + + #define INVALID_BUFFER_VALUE ((buf_T *)(-1)) + #define INVALID_WINDOW_VALUE ((win_T *)(-1)) +*************** +*** 122,128 **** + } + else + { +! PyErr_SET_STRING(PyExc_TypeError, "object must be string"); + return NULL; + } + +--- 138,150 ---- + } + else + { +! PyErr_FORMAT(PyExc_TypeError, +! #if PY_MAJOR_VERSION < 3 +! "expected str() or unicode() instance, but got %s" +! #else +! "expected bytes() or str() instance, but got %s" +! #endif +! , Py_TYPE_NAME(object)); + return NULL; + } + +*************** +*** 231,237 **** + return 0; + } + +! PyErr_SET_STRING(PyExc_AttributeError, "invalid attribute"); + return -1; + } + +--- 253,259 ---- + return 0; + } + +! PyErr_FORMAT(PyExc_AttributeError, "invalid attribute: %s", name); + return -1; + } + +*************** +*** 967,977 **** + { + PyObject *fd, *pathname, *description; + +! if (!PyTuple_Check(find_module_result) +! || PyTuple_GET_SIZE(find_module_result) != 3) + { +! PyErr_SET_STRING(PyExc_TypeError, +! "expected 3-tuple as imp.find_module() result"); + return NULL; + } + +--- 989,1007 ---- + { + PyObject *fd, *pathname, *description; + +! if (!PyTuple_Check(find_module_result)) + { +! PyErr_FORMAT(PyExc_TypeError, +! "expected 3-tuple as imp.find_module() result, but got %s", +! Py_TYPE_NAME(find_module_result)); +! return NULL; +! } +! if (PyTuple_GET_SIZE(find_module_result) != 3) +! { +! PyErr_FORMAT(PyExc_TypeError, +! "expected 3-tuple as imp.find_module() result, but got " +! "tuple of size %d", +! (int) PyTuple_GET_SIZE(find_module_result)); + return NULL; + } + +*************** +*** 1377,1383 **** + } + else + { +! PyErr_SET_STRING(PyExc_AttributeError, "cannot set this attribute"); + return -1; + } + } +--- 1407,1413 ---- + } + else + { +! PyErr_FORMAT(PyExc_AttributeError, "cannot set attribute %s", name); + return -1; + } + } +*************** +*** 1459,1465 **** + { + if (dict->dv_lock) + { +! PyErr_SET_VIM("dict is locked"); + Py_DECREF(r); + return NULL; + } +--- 1489,1495 ---- + { + if (dict->dv_lock) + { +! RAISE_LOCKED_DICTIONARY; + Py_DECREF(r); + return NULL; + } +*************** +*** 1562,1568 **** + + if (dict->dv_lock) + { +! PyErr_SET_VIM("dict is locked"); + return -1; + } + +--- 1592,1598 ---- + + if (dict->dv_lock) + { +! RAISE_LOCKED_DICTIONARY; + return -1; + } + +*************** +*** 1614,1623 **** + + if (dict_add(dict, di) == FAIL) + { +- Py_XDECREF(todecref); + vim_free(di); + dictitem_free(di); +! PyErr_SET_VIM("failed to add key to dictionary"); + return -1; + } + } +--- 1644,1653 ---- + + if (dict_add(dict, di) == FAIL) + { + vim_free(di); + dictitem_free(di); +! RAISE_KEY_ADD_FAIL(key); +! Py_XDECREF(todecref); + return -1; + } + } +*************** +*** 1725,1731 **** + + if (dict->dv_lock) + { +! PyErr_SET_VIM("dict is locked"); + return NULL; + } + +--- 1755,1761 ---- + + if (dict->dv_lock) + { +! RAISE_LOCKED_DICTIONARY; + return NULL; + } + +*************** +*** 1781,1788 **** + { + Py_DECREF(iterator); + Py_DECREF(fast); +! PyErr_SET_STRING(PyExc_ValueError, +! "expected sequence element of size 2"); + return NULL; + } + +--- 1811,1820 ---- + { + Py_DECREF(iterator); + Py_DECREF(fast); +! PyErr_FORMAT(PyExc_ValueError, +! "expected sequence element of size 2, " +! "but got sequence of size %d", +! PySequence_Fast_GET_SIZE(fast)); + return NULL; + } + +*************** +*** 1823,1831 **** + + if (dict_add(dict, di) == FAIL) + { + Py_DECREF(iterator); + dictitem_free(di); +- PyErr_SET_VIM("failed to add key to dictionary"); + return NULL; + } + } +--- 1855,1863 ---- + + if (dict_add(dict, di) == FAIL) + { ++ RAISE_KEY_ADD_FAIL(di->di_key); + Py_DECREF(iterator); + dictitem_free(di); + return NULL; + } + } +*************** +*** 2085,2091 **** + li = list_find(self->list, (long) index); + if (li == NULL) + { +! PyErr_SET_VIM("internal error: failed to get vim list item"); + return NULL; + } + return ConvertToPyObject(&li->li_tv); +--- 2117,2125 ---- + li = list_find(self->list, (long) index); + if (li == NULL) + { +! /* No more suitable format specifications in python-2.3 */ +! PyErr_VIM_FORMAT("internal error: failed to get vim list item %d", +! (int) index); + return NULL; + } + return ConvertToPyObject(&li->li_tv); +*************** +*** 2198,2204 **** + + if (l->lv_lock) + { +! PyErr_SET_VIM("list is locked"); + return -1; + } + if (index>length || (index==length && obj==NULL)) +--- 2232,2238 ---- + + if (l->lv_lock) + { +! RAISE_LOCKED_LIST; + return -1; + } + if (index>length || (index==length && obj==NULL)) +*************** +*** 2252,2258 **** + + if (l->lv_lock) + { +! PyErr_SET_VIM("list is locked"); + return -1; + } + +--- 2286,2292 ---- + + if (l->lv_lock) + { +! RAISE_LOCKED_LIST; + return -1; + } + +*************** +*** 2265,2271 **** + li = list_find(l, (long) first); + if (li == NULL) + { +! PyErr_SET_VIM("internal error: no vim list item"); + return -1; + } + if (last > first) +--- 2299,2305 ---- + li = list_find(l, (long) first); + if (li == NULL) + { +! PyErr_VIM_FORMAT("internal error: no vim list item %d", (int)first); + return -1; + } + if (last > first) +*************** +*** 2315,2321 **** + + if (l->lv_lock) + { +! PyErr_SET_VIM("list is locked"); + return NULL; + } + +--- 2349,2355 ---- + + if (l->lv_lock) + { +! RAISE_LOCKED_LIST; + return NULL; + } + +*************** +*** 2375,2381 **** + } + else + { +! PyErr_SET_STRING(PyExc_AttributeError, "cannot set this attribute"); + return -1; + } + } +--- 2409,2415 ---- + } + else + { +! PyErr_FORMAT(PyExc_AttributeError, "cannot set attribute %s", name); + return -1; + } + } +*************** +*** 2410,2417 **** + { + if (!translated_function_exists(name)) + { +! PyErr_SET_STRING(PyExc_ValueError, +! "unnamed function does not exist"); + return NULL; + } + self->name = vim_strsave(name); +--- 2444,2451 ---- + { + if (!translated_function_exists(name)) + { +! PyErr_FORMAT(PyExc_ValueError, +! "unnamed function %s does not exist", name); + return NULL; + } + self->name = vim_strsave(name); +*************** +*** 2422,2428 **** + vim_strchr(name, AUTOLOAD_CHAR) == NULL)) + == NULL) + { +! PyErr_SET_STRING(PyExc_ValueError, "function does not exist"); + return NULL; + } + +--- 2456,2462 ---- + vim_strchr(name, AUTOLOAD_CHAR) == NULL)) + == NULL) + { +! PyErr_FORMAT(PyExc_ValueError, "function %s does not exist", name); + return NULL; + } + +*************** +*** 2515,2521 **** + else if (error != OK) + { + result = NULL; +! PyErr_SET_VIM("failed to run function"); + } + else + result = ConvertToPyObject(&rettv); +--- 2549,2555 ---- + else if (error != OK) + { + result = NULL; +! PyErr_VIM_FORMAT("failed to run function %s", (char *)name); + } + else + result = ConvertToPyObject(&rettv); +*************** +*** 2770,2783 **** + { + if (self->opt_type == SREQ_GLOBAL) + { +! PyErr_SET_STRING(PyExc_ValueError, "unable to unset global option"); + Py_XDECREF(todecref); + return -1; + } + else if (!(flags & SOPT_GLOBAL)) + { +! PyErr_SET_STRING(PyExc_ValueError, "unable to unset option " +! "without global value"); + Py_XDECREF(todecref); + return -1; + } +--- 2804,2819 ---- + { + if (self->opt_type == SREQ_GLOBAL) + { +! PyErr_FORMAT(PyExc_ValueError, +! "unable to unset global option %s", key); + Py_XDECREF(todecref); + return -1; + } + else if (!(flags & SOPT_GLOBAL)) + { +! PyErr_FORMAT(PyExc_ValueError, +! "unable to unset option %s " +! "which does not have global value", key); + Py_XDECREF(todecref); + return -1; + } +*************** +*** 3195,3201 **** + + if (strcmp(name, "buffer") == 0) + { +! PyErr_SET_STRING(PyExc_TypeError, "readonly attribute"); + return -1; + } + else if (strcmp(name, "cursor") == 0) +--- 3231,3237 ---- + + if (strcmp(name, "buffer") == 0) + { +! PyErr_SET_STRING(PyExc_TypeError, "readonly attribute: buffer"); + return -1; + } + else if (strcmp(name, "cursor") == 0) +*************** +*** 3558,3566 **** + VimTryStart(); + + if (u_savedel((linenr_T)n, 1L) == FAIL) +! PyErr_SET_VIM("cannot save undo information"); + else if (ml_delete((linenr_T)n, FALSE) == FAIL) +! PyErr_SET_VIM("cannot delete line"); + else + { + if (buf == savebuf) +--- 3594,3602 ---- + VimTryStart(); + + if (u_savedel((linenr_T)n, 1L) == FAIL) +! RAISE_UNDO_FAIL; + else if (ml_delete((linenr_T)n, FALSE) == FAIL) +! RAISE_LINE_FAIL("delete"); + else + { + if (buf == savebuf) +*************** +*** 3594,3605 **** + + if (u_savesub((linenr_T)n) == FAIL) + { +! PyErr_SET_VIM("cannot save undo information"); + vim_free(save); + } + else if (ml_replace((linenr_T)n, (char_u *)save, FALSE) == FAIL) + { +! PyErr_SET_VIM("cannot replace line"); + vim_free(save); + } + else +--- 3630,3641 ---- + + if (u_savesub((linenr_T)n) == FAIL) + { +! RAISE_UNDO_FAIL; + vim_free(save); + } + else if (ml_replace((linenr_T)n, (char_u *)save, FALSE) == FAIL) + { +! RAISE_LINE_FAIL("replace"); + vim_free(save); + } + else +*************** +*** 3654,3667 **** + switch_buffer(&savebuf, buf); + + if (u_savedel((linenr_T)lo, (long)n) == FAIL) +! PyErr_SET_VIM("cannot save undo information"); + else + { + for (i = 0; i < n; ++i) + { + if (ml_delete((linenr_T)lo, FALSE) == FAIL) + { +! PyErr_SET_VIM("cannot delete line"); + break; + } + } +--- 3690,3703 ---- + switch_buffer(&savebuf, buf); + + if (u_savedel((linenr_T)lo, (long)n) == FAIL) +! RAISE_UNDO_FAIL; + else + { + for (i = 0; i < n; ++i) + { + if (ml_delete((linenr_T)lo, FALSE) == FAIL) + { +! RAISE_LINE_FAIL("delete"); + break; + } + } +*************** +*** 3722,3728 **** + switch_buffer(&savebuf, buf); + + if (u_save((linenr_T)(lo-1), (linenr_T)hi) == FAIL) +! PyErr_SET_VIM("cannot save undo information"); + + /* If the size of the range is reducing (ie, new_len < old_len) we + * need to delete some old_len. We do this at the start, by +--- 3758,3764 ---- + switch_buffer(&savebuf, buf); + + if (u_save((linenr_T)(lo-1), (linenr_T)hi) == FAIL) +! RAISE_UNDO_FAIL; + + /* If the size of the range is reducing (ie, new_len < old_len) we + * need to delete some old_len. We do this at the start, by +*************** +*** 3733,3739 **** + for (i = 0; i < old_len - new_len; ++i) + if (ml_delete((linenr_T)lo, FALSE) == FAIL) + { +! PyErr_SET_VIM("cannot delete line"); + break; + } + extra -= i; +--- 3769,3775 ---- + for (i = 0; i < old_len - new_len; ++i) + if (ml_delete((linenr_T)lo, FALSE) == FAIL) + { +! RAISE_LINE_FAIL("delete"); + break; + } + extra -= i; +*************** +*** 3749,3755 **** + if (ml_replace((linenr_T)(lo+i), (char_u *)array[i], FALSE) + == FAIL) + { +! PyErr_SET_VIM("cannot replace line"); + break; + } + } +--- 3785,3791 ---- + if (ml_replace((linenr_T)(lo+i), (char_u *)array[i], FALSE) + == FAIL) + { +! RAISE_LINE_FAIL("replace"); + break; + } + } +*************** +*** 3767,3773 **** + if (ml_append((linenr_T)(lo + i - 1), + (char_u *)array[i], 0, FALSE) == FAIL) + { +! PyErr_SET_VIM("cannot insert line"); + break; + } + vim_free(array[i]); +--- 3803,3809 ---- + if (ml_append((linenr_T)(lo + i - 1), + (char_u *)array[i], 0, FALSE) == FAIL) + { +! RAISE_LINE_FAIL("insert"); + break; + } + vim_free(array[i]); +*************** +*** 3844,3852 **** + switch_buffer(&savebuf, buf); + + if (u_save((linenr_T)n, (linenr_T)(n+1)) == FAIL) +! PyErr_SET_VIM("cannot save undo information"); + else if (ml_append((linenr_T)n, (char_u *)str, 0, FALSE) == FAIL) +! PyErr_SET_VIM("cannot insert line"); + else + appended_lines_mark((linenr_T)n, 1L); + +--- 3880,3888 ---- + switch_buffer(&savebuf, buf); + + if (u_save((linenr_T)n, (linenr_T)(n+1)) == FAIL) +! RAISE_UNDO_FAIL; + else if (ml_append((linenr_T)n, (char_u *)str, 0, FALSE) == FAIL) +! RAISE_LINE_FAIL("insert"); + else + appended_lines_mark((linenr_T)n, 1L); + +*************** +*** 3895,3901 **** + switch_buffer(&savebuf, buf); + + if (u_save((linenr_T)n, (linenr_T)(n + 1)) == FAIL) +! PyErr_SET_VIM("cannot save undo information"); + else + { + for (i = 0; i < size; ++i) +--- 3931,3937 ---- + switch_buffer(&savebuf, buf); + + if (u_save((linenr_T)n, (linenr_T)(n + 1)) == FAIL) +! RAISE_UNDO_FAIL; + else + { + for (i = 0; i < size; ++i) +*************** +*** 3903,3909 **** + if (ml_append((linenr_T)(n + i), + (char_u *)array[i], 0, FALSE) == FAIL) + { +! PyErr_SET_VIM("cannot insert line"); + + /* Free the rest of the lines */ + while (i < size) +--- 3939,3945 ---- + if (ml_append((linenr_T)(n + i), + (char_u *)array[i], 0, FALSE) == FAIL) + { +! RAISE_LINE_FAIL("insert"); + + /* Free the rest of the lines */ + while (i < size) +*************** +*** 4668,4674 **** + + if (value->ob_type != &BufferType) + { +! PyErr_SET_STRING(PyExc_TypeError, "expected vim.Buffer object"); + return -1; + } + +--- 4704,4712 ---- + + if (value->ob_type != &BufferType) + { +! PyErr_FORMAT(PyExc_TypeError, +! "expected vim.Buffer object, but got %s", +! Py_TYPE_NAME(value)); + return -1; + } + +*************** +*** 4681,4687 **** + { + if (VimTryEnd()) + return -1; +! PyErr_SET_VIM("failed to switch to given buffer"); + return -1; + } + +--- 4719,4725 ---- + { + if (VimTryEnd()) + return -1; +! PyErr_VIM_FORMAT("failed to switch to buffer %d", count); + return -1; + } + +*************** +*** 4693,4699 **** + + if (value->ob_type != &WindowType) + { +! PyErr_SET_STRING(PyExc_TypeError, "expected vim.Window object"); + return -1; + } + +--- 4731,4739 ---- + + if (value->ob_type != &WindowType) + { +! PyErr_FORMAT(PyExc_TypeError, +! "expected vim.Window object, but got %s", +! Py_TYPE_NAME(value)); + return -1; + } + +*************** +*** 4725,4731 **** + { + if (value->ob_type != &TabPageType) + { +! PyErr_SET_STRING(PyExc_TypeError, "expected vim.TabPage object"); + return -1; + } + +--- 4765,4773 ---- + { + if (value->ob_type != &TabPageType) + { +! PyErr_FORMAT(PyExc_TypeError, +! "expected vim.TabPage object, but got %s", +! Py_TYPE_NAME(value)); + return -1; + } + +*************** +*** 5003,5012 **** + + if (dict_add(dict, di) == FAIL) + { + clear_tv(&di->di_tv); + vim_free(di); + dict_unref(dict); +- PyErr_SET_VIM("failed to add key to dictionary"); + return -1; + } + } +--- 5045,5054 ---- + + if (dict_add(dict, di) == FAIL) + { ++ RAISE_KEY_ADD_FAIL(di->di_key); + clear_tv(&di->di_tv); + vim_free(di); + dict_unref(dict); + return -1; + } + } +*************** +*** 5105,5114 **** + + if (dict_add(dict, di) == FAIL) + { + Py_DECREF(iterator); + dictitem_free(di); + dict_unref(dict); +- PyErr_SET_VIM("failed to add key to dictionary"); + return -1; + } + } +--- 5147,5156 ---- + + if (dict_add(dict, di) == FAIL) + { ++ RAISE_KEY_ADD_FAIL(di->di_key); + Py_DECREF(iterator); + dictitem_free(di); + dict_unref(dict); + return -1; + } + } +*************** +*** 5216,5223 **** + r = convert_dl(obj, tv, pymap_to_tv, lookup_dict); + else + { +! PyErr_SET_STRING(PyExc_TypeError, +! "unable to convert object to vim dictionary"); + r = -1; + } + Py_DECREF(lookup_dict); +--- 5258,5266 ---- + r = convert_dl(obj, tv, pymap_to_tv, lookup_dict); + else + { +! PyErr_FORMAT(PyExc_TypeError, +! "unable to convert %s to vim dictionary", +! Py_TYPE_NAME(obj)); + r = -1; + } + Py_DECREF(lookup_dict); +*************** +*** 5326,5333 **** + return convert_dl(obj, tv, pymap_to_tv, lookup_dict); + else + { +! PyErr_SET_STRING(PyExc_TypeError, +! "unable to convert to vim structure"); + return -1; + } + return 0; +--- 5369,5377 ---- + return convert_dl(obj, tv, pymap_to_tv, lookup_dict); + else + { +! PyErr_FORMAT(PyExc_TypeError, +! "unable to convert %s to vim structure", +! Py_TYPE_NAME(obj)); + return -1; + } + return 0; +*************** +*** 5338,5344 **** + { + if (tv == NULL) + { +! PyErr_SET_VIM("NULL reference passed"); + return NULL; + } + switch (tv->v_type) +--- 5382,5388 ---- + { + if (tv == NULL) + { +! PyErr_SET_VIM("internal error: NULL reference passed"); + return NULL; + } + switch (tv->v_type) +*** ../vim-7.3.1229/src/if_python3.c 2013-06-23 13:28:11.000000000 +0200 +--- src/if_python3.c 2013-06-23 13:31:16.000000000 +0200 +*************** +*** 122,127 **** +--- 122,128 ---- + # define PyDict_SetItemString py3_PyDict_SetItemString + # define PyErr_BadArgument py3_PyErr_BadArgument + # define PyErr_Clear py3_PyErr_Clear ++ # define PyErr_Format py3_PyErr_Format + # define PyErr_PrintEx py3_PyErr_PrintEx + # define PyErr_NoMemory py3_PyErr_NoMemory + # define PyErr_Occurred py3_PyErr_Occurred +*************** +*** 337,342 **** +--- 338,344 ---- + static void* (*py3_PyMem_Malloc)(size_t); + static int (*py3_Py_IsInitialized)(void); + static void (*py3_PyErr_Clear)(void); ++ static PyObject* (*py3_PyErr_Format)(PyObject *, const char *, ...); + static void (*py3_PyErr_PrintEx)(int); + static PyObject*(*py3__PyObject_Init)(PyObject *, PyTypeObject *); + static iternextfunc py3__PyObject_NextNotImplemented; +*************** +*** 485,490 **** +--- 487,493 ---- + {"_Py_FalseStruct", (PYTHON_PROC*)&py3__Py_FalseStruct}, + {"_Py_TrueStruct", (PYTHON_PROC*)&py3__Py_TrueStruct}, + {"PyErr_Clear", (PYTHON_PROC*)&py3_PyErr_Clear}, ++ {"PyErr_Format", (PYTHON_PROC*)&py3_PyErr_Format}, + {"PyErr_PrintEx", (PYTHON_PROC*)&py3_PyErr_PrintEx}, + {"PyObject_Init", (PYTHON_PROC*)&py3__PyObject_Init}, + {"PyModule_AddObject", (PYTHON_PROC*)&py3_PyModule_AddObject}, +*************** +*** 1169,1175 **** + } + else + { +! PyErr_SET_STRING(PyExc_TypeError, "index must be int or slice"); + return NULL; + } + } +--- 1172,1178 ---- + } + else + { +! RAISE_INVALID_INDEX_TYPE(idx); + return NULL; + } + } +*************** +*** 1203,1209 **** + } + else + { +! PyErr_SET_STRING(PyExc_TypeError, "index must be int or slice"); + return -1; + } + } +--- 1206,1212 ---- + } + else + { +! RAISE_INVALID_INDEX_TYPE(idx); + return -1; + } + } +*************** +*** 1285,1291 **** + } + else + { +! PyErr_SET_STRING(PyExc_TypeError, "index must be int or slice"); + return NULL; + } + } +--- 1288,1294 ---- + } + else + { +! RAISE_INVALID_INDEX_TYPE(idx); + return NULL; + } + } +*************** +*** 1312,1318 **** + } + else + { +! PyErr_SET_STRING(PyExc_TypeError, "index must be int or slice"); + return -1; + } + } +--- 1315,1321 ---- + } + else + { +! RAISE_INVALID_INDEX_TYPE(idx); + return -1; + } + } +*************** +*** 1491,1497 **** + } + else + { +! PyErr_SET_STRING(PyExc_TypeError, "index must be int or slice"); + return NULL; + } + } +--- 1494,1500 ---- + } + else + { +! RAISE_INVALID_INDEX_TYPE(idx); + return NULL; + } + } +*************** +*** 1515,1521 **** + } + else + { +! PyErr_SET_STRING(PyExc_TypeError, "index must be int or slice"); + return -1; + } + } +--- 1518,1524 ---- + } + else + { +! RAISE_INVALID_INDEX_TYPE(idx); + return -1; + } + } +*** ../vim-7.3.1229/src/if_python.c 2013-06-23 13:11:14.000000000 +0200 +--- src/if_python.c 2013-06-23 13:31:16.000000000 +0200 +*************** +*** 160,165 **** +--- 160,166 ---- + # define PyErr_BadArgument dll_PyErr_BadArgument + # define PyErr_NewException dll_PyErr_NewException + # define PyErr_Clear dll_PyErr_Clear ++ # define PyErr_Format dll_PyErr_Format + # define PyErr_PrintEx dll_PyErr_PrintEx + # define PyErr_NoMemory dll_PyErr_NoMemory + # define PyErr_Occurred dll_PyErr_Occurred +*************** +*** 301,306 **** +--- 302,308 ---- + static int(*dll_PyErr_BadArgument)(void); + static PyObject *(*dll_PyErr_NewException)(char *, PyObject *, PyObject *); + static void(*dll_PyErr_Clear)(void); ++ static PyObject*(*dll_PyErr_Format)(PyObject *, const char *, ...); + static void(*dll_PyErr_PrintEx)(int); + static PyObject*(*dll_PyErr_NoMemory)(void); + static PyObject*(*dll_PyErr_Occurred)(void); +*************** +*** 473,478 **** +--- 475,481 ---- + {"PyErr_BadArgument", (PYTHON_PROC*)&dll_PyErr_BadArgument}, + {"PyErr_NewException", (PYTHON_PROC*)&dll_PyErr_NewException}, + {"PyErr_Clear", (PYTHON_PROC*)&dll_PyErr_Clear}, ++ {"PyErr_Format", (PYTHON_PROC*)&dll_PyErr_Format}, + {"PyErr_PrintEx", (PYTHON_PROC*)&dll_PyErr_PrintEx}, + {"PyErr_NoMemory", (PYTHON_PROC*)&dll_PyErr_NoMemory}, + {"PyErr_Occurred", (PYTHON_PROC*)&dll_PyErr_Occurred}, +*** ../vim-7.3.1229/src/testdir/test86.ok 2013-06-23 13:00:40.000000000 +0200 +--- src/testdir/test86.ok 2013-06-23 13:44:43.000000000 +0200 +*************** +*** 439,544 **** + >> OutputSetattr + del sys.stdout.softspace:AttributeError:("can't delete OutputObject attributes",) + sys.stdout.softspace = []:TypeError:('softspace must be an integer',) +! sys.stdout.attr = None:AttributeError:('invalid attribute',) + >> OutputWrite + sys.stdout.write(None):TypeError:('coercing to Unicode: need string or buffer, NoneType found',) + >> OutputWriteLines + sys.stdout.writelines(None):TypeError:("'NoneType' object is not iterable",) + sys.stdout.writelines([1]):TypeError:('coercing to Unicode: need string or buffer, int found',) + > VimCommand +! vim.command(1):TypeError:('object must be string',) + > VimToPython + > VimEval +! vim.eval(1):TypeError:('object must be string',) + > VimEvalPy +! vim.bindeval(1):TypeError:('object must be string',) + > VimStrwidth +! vim.strwidth(1):TypeError:('object must be string',) + > Dictionary + >> DictionaryConstructor +! vim.Dictionary("abc"):ValueError:('expected sequence element of size 2',) + >> DictionarySetattr + del d.locked:AttributeError:('cannot delete vim.Dictionary attributes',) + d.locked = FailingTrue():NotImplementedError:() + vim.vvars.locked = False:TypeError:('cannot modify fixed dictionary',) +! d.scope = True:AttributeError:('cannot set this attribute',) +! d.xxx = True:AttributeError:('cannot set this attribute',) + >> _DictionaryItem + d.get("a", 2, 3):TypeError:('function takes at most 2 arguments (3 given)',) + >>> Testing StringToChars using d.get(%s) +! d.get(1):TypeError:('object must be string',) + d.get(u"\0"):TypeError:('expected string without null bytes',) + d.get("\0"):TypeError:('expected string without null bytes',) + <<< Finished + d.pop("a"):KeyError:('a',) +! dl.pop("a"):error:('dict is locked',) + >> DictionaryIterNext + for i in ned: ned["a"] = 1:RuntimeError:('hashtab changed during iteration',) + >> DictionaryAssItem +! dl["b"] = 1:error:('dict is locked',) + >>> Testing StringToChars using d[%s] = 1 +! d[1] = 1:TypeError:('object must be string',) + d[u"\0"] = 1:TypeError:('expected string without null bytes',) + d["\0"] = 1:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d["a"] = {%s : 1} +! d["a"] = {1 : 1}:TypeError:('object must be string',) + d["a"] = {u"\0" : 1}:TypeError:('expected string without null bytes',) + d["a"] = {"\0" : 1}:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d["a"] = {"abc" : {%s : 1}} +! d["a"] = {"abc" : {1 : 1}}:TypeError:('object must be string',) + d["a"] = {"abc" : {u"\0" : 1}}:TypeError:('expected string without null bytes',) + d["a"] = {"abc" : {"\0" : 1}}:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d["a"] = {"abc" : Mapping({%s : 1})} +! d["a"] = {"abc" : Mapping({1 : 1})}:TypeError:('object must be string',) + d["a"] = {"abc" : Mapping({u"\0" : 1})}:TypeError:('expected string without null bytes',) + d["a"] = {"abc" : Mapping({"\0" : 1})}:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using d["a"] = {"abc" : %s} +! d["a"] = {"abc" : FailingIter()}:TypeError:('unable to convert to vim structure',) + d["a"] = {"abc" : FailingIterNext()}:NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = {"abc" : %s} +! d["a"] = {"abc" : None}:TypeError:('unable to convert to vim structure',) + d["a"] = {"abc" : {"": 1}}:ValueError:('empty keys are not allowed',) + d["a"] = {"abc" : {u"": 1}}:ValueError:('empty keys are not allowed',) + d["a"] = {"abc" : FailingMapping()}:NotImplementedError:() + d["a"] = {"abc" : FailingMappingKey()}:NotImplementedError:() + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({%s : 1}) +! d["a"] = Mapping({1 : 1}):TypeError:('object must be string',) + d["a"] = Mapping({u"\0" : 1}):TypeError:('expected string without null bytes',) + d["a"] = Mapping({"\0" : 1}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({"abc" : {%s : 1}}) +! d["a"] = Mapping({"abc" : {1 : 1}}):TypeError:('object must be string',) + d["a"] = Mapping({"abc" : {u"\0" : 1}}):TypeError:('expected string without null bytes',) + d["a"] = Mapping({"abc" : {"\0" : 1}}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({"abc" : Mapping({%s : 1})}) +! d["a"] = Mapping({"abc" : Mapping({1 : 1})}):TypeError:('object must be string',) + d["a"] = Mapping({"abc" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',) + d["a"] = Mapping({"abc" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using d["a"] = Mapping({"abc" : %s}) +! d["a"] = Mapping({"abc" : FailingIter()}):TypeError:('unable to convert to vim structure',) + d["a"] = Mapping({"abc" : FailingIterNext()}):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abc" : %s}) +! d["a"] = Mapping({"abc" : None}):TypeError:('unable to convert to vim structure',) + d["a"] = Mapping({"abc" : {"": 1}}):ValueError:('empty keys are not allowed',) + d["a"] = Mapping({"abc" : {u"": 1}}):ValueError:('empty keys are not allowed',) + d["a"] = Mapping({"abc" : FailingMapping()}):NotImplementedError:() + d["a"] = Mapping({"abc" : FailingMappingKey()}):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using d["a"] = %s +! d["a"] = FailingIter():TypeError:('unable to convert to vim structure',) + d["a"] = FailingIterNext():NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = %s +! d["a"] = None:TypeError:('unable to convert to vim structure',) + d["a"] = {"": 1}:ValueError:('empty keys are not allowed',) + d["a"] = {u"": 1}:ValueError:('empty keys are not allowed',) + d["a"] = FailingMapping():NotImplementedError:() +--- 439,544 ---- + >> OutputSetattr + del sys.stdout.softspace:AttributeError:("can't delete OutputObject attributes",) + sys.stdout.softspace = []:TypeError:('softspace must be an integer',) +! sys.stdout.attr = None:AttributeError:('invalid attribute: attr',) + >> OutputWrite + sys.stdout.write(None):TypeError:('coercing to Unicode: need string or buffer, NoneType found',) + >> OutputWriteLines + sys.stdout.writelines(None):TypeError:("'NoneType' object is not iterable",) + sys.stdout.writelines([1]):TypeError:('coercing to Unicode: need string or buffer, int found',) + > VimCommand +! vim.command(1):TypeError:('expected str() or unicode() instance, but got int',) + > VimToPython + > VimEval +! vim.eval(1):TypeError:('expected str() or unicode() instance, but got int',) + > VimEvalPy +! vim.bindeval(1):TypeError:('expected str() or unicode() instance, but got int',) + > VimStrwidth +! vim.strwidth(1):TypeError:('expected str() or unicode() instance, but got int',) + > Dictionary + >> DictionaryConstructor +! vim.Dictionary("abc"):ValueError:('expected sequence element of size 2, but got sequence of size 1',) + >> DictionarySetattr + del d.locked:AttributeError:('cannot delete vim.Dictionary attributes',) + d.locked = FailingTrue():NotImplementedError:() + vim.vvars.locked = False:TypeError:('cannot modify fixed dictionary',) +! d.scope = True:AttributeError:('cannot set attribute scope',) +! d.xxx = True:AttributeError:('cannot set attribute xxx',) + >> _DictionaryItem + d.get("a", 2, 3):TypeError:('function takes at most 2 arguments (3 given)',) + >>> Testing StringToChars using d.get(%s) +! d.get(1):TypeError:('expected str() or unicode() instance, but got int',) + d.get(u"\0"):TypeError:('expected string without null bytes',) + d.get("\0"):TypeError:('expected string without null bytes',) + <<< Finished + d.pop("a"):KeyError:('a',) +! dl.pop("a"):error:('dictionary is locked',) + >> DictionaryIterNext + for i in ned: ned["a"] = 1:RuntimeError:('hashtab changed during iteration',) + >> DictionaryAssItem +! dl["b"] = 1:error:('dictionary is locked',) + >>> Testing StringToChars using d[%s] = 1 +! d[1] = 1:TypeError:('expected str() or unicode() instance, but got int',) + d[u"\0"] = 1:TypeError:('expected string without null bytes',) + d["\0"] = 1:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d["a"] = {%s : 1} +! d["a"] = {1 : 1}:TypeError:('expected str() or unicode() instance, but got int',) + d["a"] = {u"\0" : 1}:TypeError:('expected string without null bytes',) + d["a"] = {"\0" : 1}:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d["a"] = {"abc" : {%s : 1}} +! d["a"] = {"abc" : {1 : 1}}:TypeError:('expected str() or unicode() instance, but got int',) + d["a"] = {"abc" : {u"\0" : 1}}:TypeError:('expected string without null bytes',) + d["a"] = {"abc" : {"\0" : 1}}:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d["a"] = {"abc" : Mapping({%s : 1})} +! d["a"] = {"abc" : Mapping({1 : 1})}:TypeError:('expected str() or unicode() instance, but got int',) + d["a"] = {"abc" : Mapping({u"\0" : 1})}:TypeError:('expected string without null bytes',) + d["a"] = {"abc" : Mapping({"\0" : 1})}:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using d["a"] = {"abc" : %s} +! d["a"] = {"abc" : FailingIter()}:TypeError:('unable to convert FailingIter to vim structure',) + d["a"] = {"abc" : FailingIterNext()}:NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = {"abc" : %s} +! d["a"] = {"abc" : None}:TypeError:('unable to convert NoneType to vim structure',) + d["a"] = {"abc" : {"": 1}}:ValueError:('empty keys are not allowed',) + d["a"] = {"abc" : {u"": 1}}:ValueError:('empty keys are not allowed',) + d["a"] = {"abc" : FailingMapping()}:NotImplementedError:() + d["a"] = {"abc" : FailingMappingKey()}:NotImplementedError:() + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({%s : 1}) +! d["a"] = Mapping({1 : 1}):TypeError:('expected str() or unicode() instance, but got int',) + d["a"] = Mapping({u"\0" : 1}):TypeError:('expected string without null bytes',) + d["a"] = Mapping({"\0" : 1}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({"abc" : {%s : 1}}) +! d["a"] = Mapping({"abc" : {1 : 1}}):TypeError:('expected str() or unicode() instance, but got int',) + d["a"] = Mapping({"abc" : {u"\0" : 1}}):TypeError:('expected string without null bytes',) + d["a"] = Mapping({"abc" : {"\0" : 1}}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({"abc" : Mapping({%s : 1})}) +! d["a"] = Mapping({"abc" : Mapping({1 : 1})}):TypeError:('expected str() or unicode() instance, but got int',) + d["a"] = Mapping({"abc" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',) + d["a"] = Mapping({"abc" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using d["a"] = Mapping({"abc" : %s}) +! d["a"] = Mapping({"abc" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',) + d["a"] = Mapping({"abc" : FailingIterNext()}):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abc" : %s}) +! d["a"] = Mapping({"abc" : None}):TypeError:('unable to convert NoneType to vim structure',) + d["a"] = Mapping({"abc" : {"": 1}}):ValueError:('empty keys are not allowed',) + d["a"] = Mapping({"abc" : {u"": 1}}):ValueError:('empty keys are not allowed',) + d["a"] = Mapping({"abc" : FailingMapping()}):NotImplementedError:() + d["a"] = Mapping({"abc" : FailingMappingKey()}):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using d["a"] = %s +! d["a"] = FailingIter():TypeError:('unable to convert FailingIter to vim structure',) + d["a"] = FailingIterNext():NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = %s +! d["a"] = None:TypeError:('unable to convert NoneType to vim structure',) + d["a"] = {"": 1}:ValueError:('empty keys are not allowed',) + d["a"] = {u"": 1}:ValueError:('empty keys are not allowed',) + d["a"] = FailingMapping():NotImplementedError:() +*************** +*** 550,601 **** + d.update(FailingMapping()):NotImplementedError:() + d.update([FailingIterNext()]):NotImplementedError:() + >>> Testing StringToChars using d.update({%s : 1}) +! d.update({1 : 1}):TypeError:('object must be string',) + d.update({u"\0" : 1}):TypeError:('expected string without null bytes',) + d.update({"\0" : 1}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update({"abc" : {%s : 1}}) +! d.update({"abc" : {1 : 1}}):TypeError:('object must be string',) + d.update({"abc" : {u"\0" : 1}}):TypeError:('expected string without null bytes',) + d.update({"abc" : {"\0" : 1}}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update({"abc" : Mapping({%s : 1})}) +! d.update({"abc" : Mapping({1 : 1})}):TypeError:('object must be string',) + d.update({"abc" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',) + d.update({"abc" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using d.update({"abc" : %s}) +! d.update({"abc" : FailingIter()}):TypeError:('unable to convert to vim structure',) + d.update({"abc" : FailingIterNext()}):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d.update({"abc" : %s}) +! d.update({"abc" : None}):TypeError:('unable to convert to vim structure',) + d.update({"abc" : {"": 1}}):ValueError:('empty keys are not allowed',) + d.update({"abc" : {u"": 1}}):ValueError:('empty keys are not allowed',) + d.update({"abc" : FailingMapping()}):NotImplementedError:() + d.update({"abc" : FailingMappingKey()}):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using d.update(Mapping({%s : 1})) +! d.update(Mapping({1 : 1})):TypeError:('object must be string',) + d.update(Mapping({u"\0" : 1})):TypeError:('expected string without null bytes',) + d.update(Mapping({"\0" : 1})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update(Mapping({"abc" : {%s : 1}})) +! d.update(Mapping({"abc" : {1 : 1}})):TypeError:('object must be string',) + d.update(Mapping({"abc" : {u"\0" : 1}})):TypeError:('expected string without null bytes',) + d.update(Mapping({"abc" : {"\0" : 1}})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update(Mapping({"abc" : Mapping({%s : 1})})) +! d.update(Mapping({"abc" : Mapping({1 : 1})})):TypeError:('object must be string',) + d.update(Mapping({"abc" : Mapping({u"\0" : 1})})):TypeError:('expected string without null bytes',) + d.update(Mapping({"abc" : Mapping({"\0" : 1})})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using d.update(Mapping({"abc" : %s})) +! d.update(Mapping({"abc" : FailingIter()})):TypeError:('unable to convert to vim structure',) + d.update(Mapping({"abc" : FailingIterNext()})):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d.update(Mapping({"abc" : %s})) +! d.update(Mapping({"abc" : None})):TypeError:('unable to convert to vim structure',) + d.update(Mapping({"abc" : {"": 1}})):ValueError:('empty keys are not allowed',) + d.update(Mapping({"abc" : {u"": 1}})):ValueError:('empty keys are not allowed',) + d.update(Mapping({"abc" : FailingMapping()})):NotImplementedError:() +--- 550,601 ---- + d.update(FailingMapping()):NotImplementedError:() + d.update([FailingIterNext()]):NotImplementedError:() + >>> Testing StringToChars using d.update({%s : 1}) +! d.update({1 : 1}):TypeError:('expected str() or unicode() instance, but got int',) + d.update({u"\0" : 1}):TypeError:('expected string without null bytes',) + d.update({"\0" : 1}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update({"abc" : {%s : 1}}) +! d.update({"abc" : {1 : 1}}):TypeError:('expected str() or unicode() instance, but got int',) + d.update({"abc" : {u"\0" : 1}}):TypeError:('expected string without null bytes',) + d.update({"abc" : {"\0" : 1}}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update({"abc" : Mapping({%s : 1})}) +! d.update({"abc" : Mapping({1 : 1})}):TypeError:('expected str() or unicode() instance, but got int',) + d.update({"abc" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',) + d.update({"abc" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using d.update({"abc" : %s}) +! d.update({"abc" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',) + d.update({"abc" : FailingIterNext()}):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d.update({"abc" : %s}) +! d.update({"abc" : None}):TypeError:('unable to convert NoneType to vim structure',) + d.update({"abc" : {"": 1}}):ValueError:('empty keys are not allowed',) + d.update({"abc" : {u"": 1}}):ValueError:('empty keys are not allowed',) + d.update({"abc" : FailingMapping()}):NotImplementedError:() + d.update({"abc" : FailingMappingKey()}):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using d.update(Mapping({%s : 1})) +! d.update(Mapping({1 : 1})):TypeError:('expected str() or unicode() instance, but got int',) + d.update(Mapping({u"\0" : 1})):TypeError:('expected string without null bytes',) + d.update(Mapping({"\0" : 1})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update(Mapping({"abc" : {%s : 1}})) +! d.update(Mapping({"abc" : {1 : 1}})):TypeError:('expected str() or unicode() instance, but got int',) + d.update(Mapping({"abc" : {u"\0" : 1}})):TypeError:('expected string without null bytes',) + d.update(Mapping({"abc" : {"\0" : 1}})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update(Mapping({"abc" : Mapping({%s : 1})})) +! d.update(Mapping({"abc" : Mapping({1 : 1})})):TypeError:('expected str() or unicode() instance, but got int',) + d.update(Mapping({"abc" : Mapping({u"\0" : 1})})):TypeError:('expected string without null bytes',) + d.update(Mapping({"abc" : Mapping({"\0" : 1})})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using d.update(Mapping({"abc" : %s})) +! d.update(Mapping({"abc" : FailingIter()})):TypeError:('unable to convert FailingIter to vim structure',) + d.update(Mapping({"abc" : FailingIterNext()})):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d.update(Mapping({"abc" : %s})) +! d.update(Mapping({"abc" : None})):TypeError:('unable to convert NoneType to vim structure',) + d.update(Mapping({"abc" : {"": 1}})):ValueError:('empty keys are not allowed',) + d.update(Mapping({"abc" : {u"": 1}})):ValueError:('empty keys are not allowed',) + d.update(Mapping({"abc" : FailingMapping()})):NotImplementedError:() +*************** +*** 613,680 **** + d.update(FailingMappingKey()):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using d.update(((%s, 0),)) +! d.update(((1, 0),)):TypeError:('object must be string',) + d.update(((u"\0", 0),)):TypeError:('expected string without null bytes',) + d.update((("\0", 0),)):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update((("a", {%s : 1}),)) +! d.update((("a", {1 : 1}),)):TypeError:('object must be string',) + d.update((("a", {u"\0" : 1}),)):TypeError:('expected string without null bytes',) + d.update((("a", {"\0" : 1}),)):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update((("a", {"abc" : {%s : 1}}),)) +! d.update((("a", {"abc" : {1 : 1}}),)):TypeError:('object must be string',) + d.update((("a", {"abc" : {u"\0" : 1}}),)):TypeError:('expected string without null bytes',) + d.update((("a", {"abc" : {"\0" : 1}}),)):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update((("a", {"abc" : Mapping({%s : 1})}),)) +! d.update((("a", {"abc" : Mapping({1 : 1})}),)):TypeError:('object must be string',) + d.update((("a", {"abc" : Mapping({u"\0" : 1})}),)):TypeError:('expected string without null bytes',) + d.update((("a", {"abc" : Mapping({"\0" : 1})}),)):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using d.update((("a", {"abc" : %s}),)) +! d.update((("a", {"abc" : FailingIter()}),)):TypeError:('unable to convert to vim structure',) + d.update((("a", {"abc" : FailingIterNext()}),)):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", {"abc" : %s}),)) +! d.update((("a", {"abc" : None}),)):TypeError:('unable to convert to vim structure',) + d.update((("a", {"abc" : {"": 1}}),)):ValueError:('empty keys are not allowed',) + d.update((("a", {"abc" : {u"": 1}}),)):ValueError:('empty keys are not allowed',) + d.update((("a", {"abc" : FailingMapping()}),)):NotImplementedError:() + d.update((("a", {"abc" : FailingMappingKey()}),)):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),)) +! d.update((("a", Mapping({1 : 1})),)):TypeError:('object must be string',) + d.update((("a", Mapping({u"\0" : 1})),)):TypeError:('expected string without null bytes',) + d.update((("a", Mapping({"\0" : 1})),)):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({"abc" : {%s : 1}})),)) +! d.update((("a", Mapping({"abc" : {1 : 1}})),)):TypeError:('object must be string',) + d.update((("a", Mapping({"abc" : {u"\0" : 1}})),)):TypeError:('expected string without null bytes',) + d.update((("a", Mapping({"abc" : {"\0" : 1}})),)):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({"abc" : Mapping({%s : 1})})),)) +! d.update((("a", Mapping({"abc" : Mapping({1 : 1})})),)):TypeError:('object must be string',) + d.update((("a", Mapping({"abc" : Mapping({u"\0" : 1})})),)):TypeError:('expected string without null bytes',) + d.update((("a", Mapping({"abc" : Mapping({"\0" : 1})})),)):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using d.update((("a", Mapping({"abc" : %s})),)) +! d.update((("a", Mapping({"abc" : FailingIter()})),)):TypeError:('unable to convert to vim structure',) + d.update((("a", Mapping({"abc" : FailingIterNext()})),)):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abc" : %s})),)) +! d.update((("a", Mapping({"abc" : None})),)):TypeError:('unable to convert to vim structure',) + d.update((("a", Mapping({"abc" : {"": 1}})),)):ValueError:('empty keys are not allowed',) + d.update((("a", Mapping({"abc" : {u"": 1}})),)):ValueError:('empty keys are not allowed',) + d.update((("a", Mapping({"abc" : FailingMapping()})),)):NotImplementedError:() + d.update((("a", Mapping({"abc" : FailingMappingKey()})),)):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using d.update((("a", %s),)) +! d.update((("a", FailingIter()),)):TypeError:('unable to convert to vim structure',) + d.update((("a", FailingIterNext()),)):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", %s),)) +! d.update((("a", None),)):TypeError:('unable to convert to vim structure',) + d.update((("a", {"": 1}),)):ValueError:('empty keys are not allowed',) + d.update((("a", {u"": 1}),)):ValueError:('empty keys are not allowed',) + d.update((("a", FailingMapping()),)):NotImplementedError:() +--- 613,680 ---- + d.update(FailingMappingKey()):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using d.update(((%s, 0),)) +! d.update(((1, 0),)):TypeError:('expected str() or unicode() instance, but got int',) + d.update(((u"\0", 0),)):TypeError:('expected string without null bytes',) + d.update((("\0", 0),)):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update((("a", {%s : 1}),)) +! d.update((("a", {1 : 1}),)):TypeError:('expected str() or unicode() instance, but got int',) + d.update((("a", {u"\0" : 1}),)):TypeError:('expected string without null bytes',) + d.update((("a", {"\0" : 1}),)):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update((("a", {"abc" : {%s : 1}}),)) +! d.update((("a", {"abc" : {1 : 1}}),)):TypeError:('expected str() or unicode() instance, but got int',) + d.update((("a", {"abc" : {u"\0" : 1}}),)):TypeError:('expected string without null bytes',) + d.update((("a", {"abc" : {"\0" : 1}}),)):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update((("a", {"abc" : Mapping({%s : 1})}),)) +! d.update((("a", {"abc" : Mapping({1 : 1})}),)):TypeError:('expected str() or unicode() instance, but got int',) + d.update((("a", {"abc" : Mapping({u"\0" : 1})}),)):TypeError:('expected string without null bytes',) + d.update((("a", {"abc" : Mapping({"\0" : 1})}),)):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using d.update((("a", {"abc" : %s}),)) +! d.update((("a", {"abc" : FailingIter()}),)):TypeError:('unable to convert FailingIter to vim structure',) + d.update((("a", {"abc" : FailingIterNext()}),)):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", {"abc" : %s}),)) +! d.update((("a", {"abc" : None}),)):TypeError:('unable to convert NoneType to vim structure',) + d.update((("a", {"abc" : {"": 1}}),)):ValueError:('empty keys are not allowed',) + d.update((("a", {"abc" : {u"": 1}}),)):ValueError:('empty keys are not allowed',) + d.update((("a", {"abc" : FailingMapping()}),)):NotImplementedError:() + d.update((("a", {"abc" : FailingMappingKey()}),)):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),)) +! d.update((("a", Mapping({1 : 1})),)):TypeError:('expected str() or unicode() instance, but got int',) + d.update((("a", Mapping({u"\0" : 1})),)):TypeError:('expected string without null bytes',) + d.update((("a", Mapping({"\0" : 1})),)):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({"abc" : {%s : 1}})),)) +! d.update((("a", Mapping({"abc" : {1 : 1}})),)):TypeError:('expected str() or unicode() instance, but got int',) + d.update((("a", Mapping({"abc" : {u"\0" : 1}})),)):TypeError:('expected string without null bytes',) + d.update((("a", Mapping({"abc" : {"\0" : 1}})),)):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({"abc" : Mapping({%s : 1})})),)) +! d.update((("a", Mapping({"abc" : Mapping({1 : 1})})),)):TypeError:('expected str() or unicode() instance, but got int',) + d.update((("a", Mapping({"abc" : Mapping({u"\0" : 1})})),)):TypeError:('expected string without null bytes',) + d.update((("a", Mapping({"abc" : Mapping({"\0" : 1})})),)):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using d.update((("a", Mapping({"abc" : %s})),)) +! d.update((("a", Mapping({"abc" : FailingIter()})),)):TypeError:('unable to convert FailingIter to vim structure',) + d.update((("a", Mapping({"abc" : FailingIterNext()})),)):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abc" : %s})),)) +! d.update((("a", Mapping({"abc" : None})),)):TypeError:('unable to convert NoneType to vim structure',) + d.update((("a", Mapping({"abc" : {"": 1}})),)):ValueError:('empty keys are not allowed',) + d.update((("a", Mapping({"abc" : {u"": 1}})),)):ValueError:('empty keys are not allowed',) + d.update((("a", Mapping({"abc" : FailingMapping()})),)):NotImplementedError:() + d.update((("a", Mapping({"abc" : FailingMappingKey()})),)):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using d.update((("a", %s),)) +! d.update((("a", FailingIter()),)):TypeError:('unable to convert FailingIter to vim structure',) + d.update((("a", FailingIterNext()),)):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", %s),)) +! d.update((("a", None),)):TypeError:('unable to convert NoneType to vim structure',) + d.update((("a", {"": 1}),)):ValueError:('empty keys are not allowed',) + d.update((("a", {u"": 1}),)):ValueError:('empty keys are not allowed',) + d.update((("a", FailingMapping()),)):NotImplementedError:() +*************** +*** 689,751 **** + vim.List(1, 2):TypeError:('function takes at most 1 argument (2 given)',) + vim.List(a=1):TypeError:('list constructor does not accept keyword arguments',) + >>> Testing StringToChars using vim.List([{%s : 1}]) +! vim.List([{1 : 1}]):TypeError:('object must be string',) + vim.List([{u"\0" : 1}]):TypeError:('expected string without null bytes',) + vim.List([{"\0" : 1}]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using vim.List([{"abc" : {%s : 1}}]) +! vim.List([{"abc" : {1 : 1}}]):TypeError:('object must be string',) + vim.List([{"abc" : {u"\0" : 1}}]):TypeError:('expected string without null bytes',) + vim.List([{"abc" : {"\0" : 1}}]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using vim.List([{"abc" : Mapping({%s : 1})}]) +! vim.List([{"abc" : Mapping({1 : 1})}]):TypeError:('object must be string',) + vim.List([{"abc" : Mapping({u"\0" : 1})}]):TypeError:('expected string without null bytes',) + vim.List([{"abc" : Mapping({"\0" : 1})}]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using vim.List([{"abc" : %s}]) +! vim.List([{"abc" : FailingIter()}]):TypeError:('unable to convert to vim structure',) + vim.List([{"abc" : FailingIterNext()}]):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([{"abc" : %s}]) +! vim.List([{"abc" : None}]):TypeError:('unable to convert to vim structure',) + vim.List([{"abc" : {"": 1}}]):ValueError:('empty keys are not allowed',) + vim.List([{"abc" : {u"": 1}}]):ValueError:('empty keys are not allowed',) + vim.List([{"abc" : FailingMapping()}]):NotImplementedError:() + vim.List([{"abc" : FailingMappingKey()}]):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({%s : 1})]) +! vim.List([Mapping({1 : 1})]):TypeError:('object must be string',) + vim.List([Mapping({u"\0" : 1})]):TypeError:('expected string without null bytes',) + vim.List([Mapping({"\0" : 1})]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({"abc" : {%s : 1}})]) +! vim.List([Mapping({"abc" : {1 : 1}})]):TypeError:('object must be string',) + vim.List([Mapping({"abc" : {u"\0" : 1}})]):TypeError:('expected string without null bytes',) + vim.List([Mapping({"abc" : {"\0" : 1}})]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({"abc" : Mapping({%s : 1})})]) +! vim.List([Mapping({"abc" : Mapping({1 : 1})})]):TypeError:('object must be string',) + vim.List([Mapping({"abc" : Mapping({u"\0" : 1})})]):TypeError:('expected string without null bytes',) + vim.List([Mapping({"abc" : Mapping({"\0" : 1})})]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using vim.List([Mapping({"abc" : %s})]) +! vim.List([Mapping({"abc" : FailingIter()})]):TypeError:('unable to convert to vim structure',) + vim.List([Mapping({"abc" : FailingIterNext()})]):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([Mapping({"abc" : %s})]) +! vim.List([Mapping({"abc" : None})]):TypeError:('unable to convert to vim structure',) + vim.List([Mapping({"abc" : {"": 1}})]):ValueError:('empty keys are not allowed',) + vim.List([Mapping({"abc" : {u"": 1}})]):ValueError:('empty keys are not allowed',) + vim.List([Mapping({"abc" : FailingMapping()})]):NotImplementedError:() + vim.List([Mapping({"abc" : FailingMappingKey()})]):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using vim.List([%s]) +! vim.List([FailingIter()]):TypeError:('unable to convert to vim structure',) + vim.List([FailingIterNext()]):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([%s]) +! vim.List([None]):TypeError:('unable to convert to vim structure',) + vim.List([{"": 1}]):ValueError:('empty keys are not allowed',) + vim.List([{u"": 1}]):ValueError:('empty keys are not allowed',) + vim.List([FailingMapping()]):NotImplementedError:() +--- 689,751 ---- + vim.List(1, 2):TypeError:('function takes at most 1 argument (2 given)',) + vim.List(a=1):TypeError:('list constructor does not accept keyword arguments',) + >>> Testing StringToChars using vim.List([{%s : 1}]) +! vim.List([{1 : 1}]):TypeError:('expected str() or unicode() instance, but got int',) + vim.List([{u"\0" : 1}]):TypeError:('expected string without null bytes',) + vim.List([{"\0" : 1}]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using vim.List([{"abc" : {%s : 1}}]) +! vim.List([{"abc" : {1 : 1}}]):TypeError:('expected str() or unicode() instance, but got int',) + vim.List([{"abc" : {u"\0" : 1}}]):TypeError:('expected string without null bytes',) + vim.List([{"abc" : {"\0" : 1}}]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using vim.List([{"abc" : Mapping({%s : 1})}]) +! vim.List([{"abc" : Mapping({1 : 1})}]):TypeError:('expected str() or unicode() instance, but got int',) + vim.List([{"abc" : Mapping({u"\0" : 1})}]):TypeError:('expected string without null bytes',) + vim.List([{"abc" : Mapping({"\0" : 1})}]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using vim.List([{"abc" : %s}]) +! vim.List([{"abc" : FailingIter()}]):TypeError:('unable to convert FailingIter to vim structure',) + vim.List([{"abc" : FailingIterNext()}]):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([{"abc" : %s}]) +! vim.List([{"abc" : None}]):TypeError:('unable to convert NoneType to vim structure',) + vim.List([{"abc" : {"": 1}}]):ValueError:('empty keys are not allowed',) + vim.List([{"abc" : {u"": 1}}]):ValueError:('empty keys are not allowed',) + vim.List([{"abc" : FailingMapping()}]):NotImplementedError:() + vim.List([{"abc" : FailingMappingKey()}]):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({%s : 1})]) +! vim.List([Mapping({1 : 1})]):TypeError:('expected str() or unicode() instance, but got int',) + vim.List([Mapping({u"\0" : 1})]):TypeError:('expected string without null bytes',) + vim.List([Mapping({"\0" : 1})]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({"abc" : {%s : 1}})]) +! vim.List([Mapping({"abc" : {1 : 1}})]):TypeError:('expected str() or unicode() instance, but got int',) + vim.List([Mapping({"abc" : {u"\0" : 1}})]):TypeError:('expected string without null bytes',) + vim.List([Mapping({"abc" : {"\0" : 1}})]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({"abc" : Mapping({%s : 1})})]) +! vim.List([Mapping({"abc" : Mapping({1 : 1})})]):TypeError:('expected str() or unicode() instance, but got int',) + vim.List([Mapping({"abc" : Mapping({u"\0" : 1})})]):TypeError:('expected string without null bytes',) + vim.List([Mapping({"abc" : Mapping({"\0" : 1})})]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using vim.List([Mapping({"abc" : %s})]) +! vim.List([Mapping({"abc" : FailingIter()})]):TypeError:('unable to convert FailingIter to vim structure',) + vim.List([Mapping({"abc" : FailingIterNext()})]):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([Mapping({"abc" : %s})]) +! vim.List([Mapping({"abc" : None})]):TypeError:('unable to convert NoneType to vim structure',) + vim.List([Mapping({"abc" : {"": 1}})]):ValueError:('empty keys are not allowed',) + vim.List([Mapping({"abc" : {u"": 1}})]):ValueError:('empty keys are not allowed',) + vim.List([Mapping({"abc" : FailingMapping()})]):NotImplementedError:() + vim.List([Mapping({"abc" : FailingMappingKey()})]):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using vim.List([%s]) +! vim.List([FailingIter()]):TypeError:('unable to convert FailingIter to vim structure',) + vim.List([FailingIterNext()]):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([%s]) +! vim.List([None]):TypeError:('unable to convert NoneType to vim structure',) + vim.List([{"": 1}]):ValueError:('empty keys are not allowed',) + vim.List([{u"": 1}]):ValueError:('empty keys are not allowed',) + vim.List([FailingMapping()]):NotImplementedError:() +*************** +*** 759,821 **** + >> ListAssSlice + ll[1:100] = "abc":error:('list is locked',) + >>> Testing StringToChars using l[:] = [{%s : 1}] +! l[:] = [{1 : 1}]:TypeError:('object must be string',) + l[:] = [{u"\0" : 1}]:TypeError:('expected string without null bytes',) + l[:] = [{"\0" : 1}]:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using l[:] = [{"abc" : {%s : 1}}] +! l[:] = [{"abc" : {1 : 1}}]:TypeError:('object must be string',) + l[:] = [{"abc" : {u"\0" : 1}}]:TypeError:('expected string without null bytes',) + l[:] = [{"abc" : {"\0" : 1}}]:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using l[:] = [{"abc" : Mapping({%s : 1})}] +! l[:] = [{"abc" : Mapping({1 : 1})}]:TypeError:('object must be string',) + l[:] = [{"abc" : Mapping({u"\0" : 1})}]:TypeError:('expected string without null bytes',) + l[:] = [{"abc" : Mapping({"\0" : 1})}]:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using l[:] = [{"abc" : %s}] +! l[:] = [{"abc" : FailingIter()}]:TypeError:('unable to convert to vim structure',) + l[:] = [{"abc" : FailingIterNext()}]:NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [{"abc" : %s}] +! l[:] = [{"abc" : None}]:TypeError:('unable to convert to vim structure',) + l[:] = [{"abc" : {"": 1}}]:ValueError:('empty keys are not allowed',) + l[:] = [{"abc" : {u"": 1}}]:ValueError:('empty keys are not allowed',) + l[:] = [{"abc" : FailingMapping()}]:NotImplementedError:() + l[:] = [{"abc" : FailingMappingKey()}]:NotImplementedError:() + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({%s : 1})] +! l[:] = [Mapping({1 : 1})]:TypeError:('object must be string',) + l[:] = [Mapping({u"\0" : 1})]:TypeError:('expected string without null bytes',) + l[:] = [Mapping({"\0" : 1})]:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({"abc" : {%s : 1}})] +! l[:] = [Mapping({"abc" : {1 : 1}})]:TypeError:('object must be string',) + l[:] = [Mapping({"abc" : {u"\0" : 1}})]:TypeError:('expected string without null bytes',) + l[:] = [Mapping({"abc" : {"\0" : 1}})]:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({"abc" : Mapping({%s : 1})})] +! l[:] = [Mapping({"abc" : Mapping({1 : 1})})]:TypeError:('object must be string',) + l[:] = [Mapping({"abc" : Mapping({u"\0" : 1})})]:TypeError:('expected string without null bytes',) + l[:] = [Mapping({"abc" : Mapping({"\0" : 1})})]:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using l[:] = [Mapping({"abc" : %s})] +! l[:] = [Mapping({"abc" : FailingIter()})]:TypeError:('unable to convert to vim structure',) + l[:] = [Mapping({"abc" : FailingIterNext()})]:NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abc" : %s})] +! l[:] = [Mapping({"abc" : None})]:TypeError:('unable to convert to vim structure',) + l[:] = [Mapping({"abc" : {"": 1}})]:ValueError:('empty keys are not allowed',) + l[:] = [Mapping({"abc" : {u"": 1}})]:ValueError:('empty keys are not allowed',) + l[:] = [Mapping({"abc" : FailingMapping()})]:NotImplementedError:() + l[:] = [Mapping({"abc" : FailingMappingKey()})]:NotImplementedError:() + <<< Finished + >>> Testing *Iter* using l[:] = [%s] +! l[:] = [FailingIter()]:TypeError:('unable to convert to vim structure',) + l[:] = [FailingIterNext()]:NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [%s] +! l[:] = [None]:TypeError:('unable to convert to vim structure',) + l[:] = [{"": 1}]:ValueError:('empty keys are not allowed',) + l[:] = [{u"": 1}]:ValueError:('empty keys are not allowed',) + l[:] = [FailingMapping()]:NotImplementedError:() +--- 759,821 ---- + >> ListAssSlice + ll[1:100] = "abc":error:('list is locked',) + >>> Testing StringToChars using l[:] = [{%s : 1}] +! l[:] = [{1 : 1}]:TypeError:('expected str() or unicode() instance, but got int',) + l[:] = [{u"\0" : 1}]:TypeError:('expected string without null bytes',) + l[:] = [{"\0" : 1}]:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using l[:] = [{"abc" : {%s : 1}}] +! l[:] = [{"abc" : {1 : 1}}]:TypeError:('expected str() or unicode() instance, but got int',) + l[:] = [{"abc" : {u"\0" : 1}}]:TypeError:('expected string without null bytes',) + l[:] = [{"abc" : {"\0" : 1}}]:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using l[:] = [{"abc" : Mapping({%s : 1})}] +! l[:] = [{"abc" : Mapping({1 : 1})}]:TypeError:('expected str() or unicode() instance, but got int',) + l[:] = [{"abc" : Mapping({u"\0" : 1})}]:TypeError:('expected string without null bytes',) + l[:] = [{"abc" : Mapping({"\0" : 1})}]:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using l[:] = [{"abc" : %s}] +! l[:] = [{"abc" : FailingIter()}]:TypeError:('unable to convert FailingIter to vim structure',) + l[:] = [{"abc" : FailingIterNext()}]:NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [{"abc" : %s}] +! l[:] = [{"abc" : None}]:TypeError:('unable to convert NoneType to vim structure',) + l[:] = [{"abc" : {"": 1}}]:ValueError:('empty keys are not allowed',) + l[:] = [{"abc" : {u"": 1}}]:ValueError:('empty keys are not allowed',) + l[:] = [{"abc" : FailingMapping()}]:NotImplementedError:() + l[:] = [{"abc" : FailingMappingKey()}]:NotImplementedError:() + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({%s : 1})] +! l[:] = [Mapping({1 : 1})]:TypeError:('expected str() or unicode() instance, but got int',) + l[:] = [Mapping({u"\0" : 1})]:TypeError:('expected string without null bytes',) + l[:] = [Mapping({"\0" : 1})]:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({"abc" : {%s : 1}})] +! l[:] = [Mapping({"abc" : {1 : 1}})]:TypeError:('expected str() or unicode() instance, but got int',) + l[:] = [Mapping({"abc" : {u"\0" : 1}})]:TypeError:('expected string without null bytes',) + l[:] = [Mapping({"abc" : {"\0" : 1}})]:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({"abc" : Mapping({%s : 1})})] +! l[:] = [Mapping({"abc" : Mapping({1 : 1})})]:TypeError:('expected str() or unicode() instance, but got int',) + l[:] = [Mapping({"abc" : Mapping({u"\0" : 1})})]:TypeError:('expected string without null bytes',) + l[:] = [Mapping({"abc" : Mapping({"\0" : 1})})]:TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using l[:] = [Mapping({"abc" : %s})] +! l[:] = [Mapping({"abc" : FailingIter()})]:TypeError:('unable to convert FailingIter to vim structure',) + l[:] = [Mapping({"abc" : FailingIterNext()})]:NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abc" : %s})] +! l[:] = [Mapping({"abc" : None})]:TypeError:('unable to convert NoneType to vim structure',) + l[:] = [Mapping({"abc" : {"": 1}})]:ValueError:('empty keys are not allowed',) + l[:] = [Mapping({"abc" : {u"": 1}})]:ValueError:('empty keys are not allowed',) + l[:] = [Mapping({"abc" : FailingMapping()})]:NotImplementedError:() + l[:] = [Mapping({"abc" : FailingMappingKey()})]:NotImplementedError:() + <<< Finished + >>> Testing *Iter* using l[:] = [%s] +! l[:] = [FailingIter()]:TypeError:('unable to convert FailingIter to vim structure',) + l[:] = [FailingIterNext()]:NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [%s] +! l[:] = [None]:TypeError:('unable to convert NoneType to vim structure',) + l[:] = [{"": 1}]:ValueError:('empty keys are not allowed',) + l[:] = [{u"": 1}]:ValueError:('empty keys are not allowed',) + l[:] = [FailingMapping()]:NotImplementedError:() +*************** +*** 823,885 **** + <<< Finished + >> ListConcatInPlace + >>> Testing StringToChars using l.extend([{%s : 1}]) +! l.extend([{1 : 1}]):TypeError:('object must be string',) + l.extend([{u"\0" : 1}]):TypeError:('expected string without null bytes',) + l.extend([{"\0" : 1}]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using l.extend([{"abc" : {%s : 1}}]) +! l.extend([{"abc" : {1 : 1}}]):TypeError:('object must be string',) + l.extend([{"abc" : {u"\0" : 1}}]):TypeError:('expected string without null bytes',) + l.extend([{"abc" : {"\0" : 1}}]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using l.extend([{"abc" : Mapping({%s : 1})}]) +! l.extend([{"abc" : Mapping({1 : 1})}]):TypeError:('object must be string',) + l.extend([{"abc" : Mapping({u"\0" : 1})}]):TypeError:('expected string without null bytes',) + l.extend([{"abc" : Mapping({"\0" : 1})}]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using l.extend([{"abc" : %s}]) +! l.extend([{"abc" : FailingIter()}]):TypeError:('unable to convert to vim structure',) + l.extend([{"abc" : FailingIterNext()}]):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([{"abc" : %s}]) +! l.extend([{"abc" : None}]):TypeError:('unable to convert to vim structure',) + l.extend([{"abc" : {"": 1}}]):ValueError:('empty keys are not allowed',) + l.extend([{"abc" : {u"": 1}}]):ValueError:('empty keys are not allowed',) + l.extend([{"abc" : FailingMapping()}]):NotImplementedError:() + l.extend([{"abc" : FailingMappingKey()}]):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({%s : 1})]) +! l.extend([Mapping({1 : 1})]):TypeError:('object must be string',) + l.extend([Mapping({u"\0" : 1})]):TypeError:('expected string without null bytes',) + l.extend([Mapping({"\0" : 1})]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({"abc" : {%s : 1}})]) +! l.extend([Mapping({"abc" : {1 : 1}})]):TypeError:('object must be string',) + l.extend([Mapping({"abc" : {u"\0" : 1}})]):TypeError:('expected string without null bytes',) + l.extend([Mapping({"abc" : {"\0" : 1}})]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({"abc" : Mapping({%s : 1})})]) +! l.extend([Mapping({"abc" : Mapping({1 : 1})})]):TypeError:('object must be string',) + l.extend([Mapping({"abc" : Mapping({u"\0" : 1})})]):TypeError:('expected string without null bytes',) + l.extend([Mapping({"abc" : Mapping({"\0" : 1})})]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using l.extend([Mapping({"abc" : %s})]) +! l.extend([Mapping({"abc" : FailingIter()})]):TypeError:('unable to convert to vim structure',) + l.extend([Mapping({"abc" : FailingIterNext()})]):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([Mapping({"abc" : %s})]) +! l.extend([Mapping({"abc" : None})]):TypeError:('unable to convert to vim structure',) + l.extend([Mapping({"abc" : {"": 1}})]):ValueError:('empty keys are not allowed',) + l.extend([Mapping({"abc" : {u"": 1}})]):ValueError:('empty keys are not allowed',) + l.extend([Mapping({"abc" : FailingMapping()})]):NotImplementedError:() + l.extend([Mapping({"abc" : FailingMappingKey()})]):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using l.extend([%s]) +! l.extend([FailingIter()]):TypeError:('unable to convert to vim structure',) + l.extend([FailingIterNext()]):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([%s]) +! l.extend([None]):TypeError:('unable to convert to vim structure',) + l.extend([{"": 1}]):ValueError:('empty keys are not allowed',) + l.extend([{u"": 1}]):ValueError:('empty keys are not allowed',) + l.extend([FailingMapping()]):NotImplementedError:() +--- 823,885 ---- + <<< Finished + >> ListConcatInPlace + >>> Testing StringToChars using l.extend([{%s : 1}]) +! l.extend([{1 : 1}]):TypeError:('expected str() or unicode() instance, but got int',) + l.extend([{u"\0" : 1}]):TypeError:('expected string without null bytes',) + l.extend([{"\0" : 1}]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using l.extend([{"abc" : {%s : 1}}]) +! l.extend([{"abc" : {1 : 1}}]):TypeError:('expected str() or unicode() instance, but got int',) + l.extend([{"abc" : {u"\0" : 1}}]):TypeError:('expected string without null bytes',) + l.extend([{"abc" : {"\0" : 1}}]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using l.extend([{"abc" : Mapping({%s : 1})}]) +! l.extend([{"abc" : Mapping({1 : 1})}]):TypeError:('expected str() or unicode() instance, but got int',) + l.extend([{"abc" : Mapping({u"\0" : 1})}]):TypeError:('expected string without null bytes',) + l.extend([{"abc" : Mapping({"\0" : 1})}]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using l.extend([{"abc" : %s}]) +! l.extend([{"abc" : FailingIter()}]):TypeError:('unable to convert FailingIter to vim structure',) + l.extend([{"abc" : FailingIterNext()}]):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([{"abc" : %s}]) +! l.extend([{"abc" : None}]):TypeError:('unable to convert NoneType to vim structure',) + l.extend([{"abc" : {"": 1}}]):ValueError:('empty keys are not allowed',) + l.extend([{"abc" : {u"": 1}}]):ValueError:('empty keys are not allowed',) + l.extend([{"abc" : FailingMapping()}]):NotImplementedError:() + l.extend([{"abc" : FailingMappingKey()}]):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({%s : 1})]) +! l.extend([Mapping({1 : 1})]):TypeError:('expected str() or unicode() instance, but got int',) + l.extend([Mapping({u"\0" : 1})]):TypeError:('expected string without null bytes',) + l.extend([Mapping({"\0" : 1})]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({"abc" : {%s : 1}})]) +! l.extend([Mapping({"abc" : {1 : 1}})]):TypeError:('expected str() or unicode() instance, but got int',) + l.extend([Mapping({"abc" : {u"\0" : 1}})]):TypeError:('expected string without null bytes',) + l.extend([Mapping({"abc" : {"\0" : 1}})]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({"abc" : Mapping({%s : 1})})]) +! l.extend([Mapping({"abc" : Mapping({1 : 1})})]):TypeError:('expected str() or unicode() instance, but got int',) + l.extend([Mapping({"abc" : Mapping({u"\0" : 1})})]):TypeError:('expected string without null bytes',) + l.extend([Mapping({"abc" : Mapping({"\0" : 1})})]):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using l.extend([Mapping({"abc" : %s})]) +! l.extend([Mapping({"abc" : FailingIter()})]):TypeError:('unable to convert FailingIter to vim structure',) + l.extend([Mapping({"abc" : FailingIterNext()})]):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([Mapping({"abc" : %s})]) +! l.extend([Mapping({"abc" : None})]):TypeError:('unable to convert NoneType to vim structure',) + l.extend([Mapping({"abc" : {"": 1}})]):ValueError:('empty keys are not allowed',) + l.extend([Mapping({"abc" : {u"": 1}})]):ValueError:('empty keys are not allowed',) + l.extend([Mapping({"abc" : FailingMapping()})]):NotImplementedError:() + l.extend([Mapping({"abc" : FailingMappingKey()})]):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using l.extend([%s]) +! l.extend([FailingIter()]):TypeError:('unable to convert FailingIter to vim structure',) + l.extend([FailingIterNext()]):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([%s]) +! l.extend([None]):TypeError:('unable to convert NoneType to vim structure',) + l.extend([{"": 1}]):ValueError:('empty keys are not allowed',) + l.extend([{u"": 1}]):ValueError:('empty keys are not allowed',) + l.extend([FailingMapping()]):NotImplementedError:() +*************** +*** 888,1028 **** + >> ListSetattr + del l.locked:AttributeError:('cannot delete vim.List attributes',) + l.locked = FailingTrue():NotImplementedError:() +! l.xxx = True:AttributeError:('cannot set this attribute',) + > Function + >> FunctionConstructor +! vim.Function("123"):ValueError:('unnamed function does not exist',) +! vim.Function("xxx_non_existent_function_xxx"):ValueError:('function does not exist',) + vim.Function("xxx#non#existent#function#xxx"):NOT FAILED + >> FunctionCall + >>> Testing StringToChars using f({%s : 1}) +! f({1 : 1}):TypeError:('object must be string',) + f({u"\0" : 1}):TypeError:('expected string without null bytes',) + f({"\0" : 1}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using f({"abc" : {%s : 1}}) +! f({"abc" : {1 : 1}}):TypeError:('object must be string',) + f({"abc" : {u"\0" : 1}}):TypeError:('expected string without null bytes',) + f({"abc" : {"\0" : 1}}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using f({"abc" : Mapping({%s : 1})}) +! f({"abc" : Mapping({1 : 1})}):TypeError:('object must be string',) + f({"abc" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',) + f({"abc" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using f({"abc" : %s}) +! f({"abc" : FailingIter()}):TypeError:('unable to convert to vim structure',) + f({"abc" : FailingIterNext()}):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using f({"abc" : %s}) +! f({"abc" : None}):TypeError:('unable to convert to vim structure',) + f({"abc" : {"": 1}}):ValueError:('empty keys are not allowed',) + f({"abc" : {u"": 1}}):ValueError:('empty keys are not allowed',) + f({"abc" : FailingMapping()}):NotImplementedError:() + f({"abc" : FailingMappingKey()}):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using f(Mapping({%s : 1})) +! f(Mapping({1 : 1})):TypeError:('object must be string',) + f(Mapping({u"\0" : 1})):TypeError:('expected string without null bytes',) + f(Mapping({"\0" : 1})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using f(Mapping({"abc" : {%s : 1}})) +! f(Mapping({"abc" : {1 : 1}})):TypeError:('object must be string',) + f(Mapping({"abc" : {u"\0" : 1}})):TypeError:('expected string without null bytes',) + f(Mapping({"abc" : {"\0" : 1}})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using f(Mapping({"abc" : Mapping({%s : 1})})) +! f(Mapping({"abc" : Mapping({1 : 1})})):TypeError:('object must be string',) + f(Mapping({"abc" : Mapping({u"\0" : 1})})):TypeError:('expected string without null bytes',) + f(Mapping({"abc" : Mapping({"\0" : 1})})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using f(Mapping({"abc" : %s})) +! f(Mapping({"abc" : FailingIter()})):TypeError:('unable to convert to vim structure',) + f(Mapping({"abc" : FailingIterNext()})):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using f(Mapping({"abc" : %s})) +! f(Mapping({"abc" : None})):TypeError:('unable to convert to vim structure',) + f(Mapping({"abc" : {"": 1}})):ValueError:('empty keys are not allowed',) + f(Mapping({"abc" : {u"": 1}})):ValueError:('empty keys are not allowed',) + f(Mapping({"abc" : FailingMapping()})):NotImplementedError:() + f(Mapping({"abc" : FailingMappingKey()})):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using f(%s) +! f(FailingIter()):TypeError:('unable to convert to vim structure',) + f(FailingIterNext()):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using f(%s) +! f(None):TypeError:('unable to convert to vim structure',) + f({"": 1}):ValueError:('empty keys are not allowed',) + f({u"": 1}):ValueError:('empty keys are not allowed',) + f(FailingMapping()):NotImplementedError:() + f(FailingMappingKey()):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using fd(self={%s : 1}) +! fd(self={1 : 1}):TypeError:('object must be string',) + fd(self={u"\0" : 1}):TypeError:('expected string without null bytes',) + fd(self={"\0" : 1}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using fd(self={"abc" : {%s : 1}}) +! fd(self={"abc" : {1 : 1}}):TypeError:('object must be string',) + fd(self={"abc" : {u"\0" : 1}}):TypeError:('expected string without null bytes',) + fd(self={"abc" : {"\0" : 1}}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using fd(self={"abc" : Mapping({%s : 1})}) +! fd(self={"abc" : Mapping({1 : 1})}):TypeError:('object must be string',) + fd(self={"abc" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',) + fd(self={"abc" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using fd(self={"abc" : %s}) +! fd(self={"abc" : FailingIter()}):TypeError:('unable to convert to vim structure',) + fd(self={"abc" : FailingIterNext()}):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using fd(self={"abc" : %s}) +! fd(self={"abc" : None}):TypeError:('unable to convert to vim structure',) + fd(self={"abc" : {"": 1}}):ValueError:('empty keys are not allowed',) + fd(self={"abc" : {u"": 1}}):ValueError:('empty keys are not allowed',) + fd(self={"abc" : FailingMapping()}):NotImplementedError:() + fd(self={"abc" : FailingMappingKey()}):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({%s : 1})) +! fd(self=Mapping({1 : 1})):TypeError:('object must be string',) + fd(self=Mapping({u"\0" : 1})):TypeError:('expected string without null bytes',) + fd(self=Mapping({"\0" : 1})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({"abc" : {%s : 1}})) +! fd(self=Mapping({"abc" : {1 : 1}})):TypeError:('object must be string',) + fd(self=Mapping({"abc" : {u"\0" : 1}})):TypeError:('expected string without null bytes',) + fd(self=Mapping({"abc" : {"\0" : 1}})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({"abc" : Mapping({%s : 1})})) +! fd(self=Mapping({"abc" : Mapping({1 : 1})})):TypeError:('object must be string',) + fd(self=Mapping({"abc" : Mapping({u"\0" : 1})})):TypeError:('expected string without null bytes',) + fd(self=Mapping({"abc" : Mapping({"\0" : 1})})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using fd(self=Mapping({"abc" : %s})) +! fd(self=Mapping({"abc" : FailingIter()})):TypeError:('unable to convert to vim structure',) + fd(self=Mapping({"abc" : FailingIterNext()})):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using fd(self=Mapping({"abc" : %s})) +! fd(self=Mapping({"abc" : None})):TypeError:('unable to convert to vim structure',) + fd(self=Mapping({"abc" : {"": 1}})):ValueError:('empty keys are not allowed',) + fd(self=Mapping({"abc" : {u"": 1}})):ValueError:('empty keys are not allowed',) + fd(self=Mapping({"abc" : FailingMapping()})):NotImplementedError:() + fd(self=Mapping({"abc" : FailingMappingKey()})):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using fd(self=%s) +! fd(self=FailingIter()):TypeError:('unable to convert object to vim dictionary',) +! fd(self=FailingIterNext()):TypeError:('unable to convert object to vim dictionary',) + <<< Finished + >>> Testing ConvertFromPyObject using fd(self=%s) +! fd(self=None):TypeError:('unable to convert object to vim dictionary',) + fd(self={"": 1}):ValueError:('empty keys are not allowed',) + fd(self={u"": 1}):ValueError:('empty keys are not allowed',) + fd(self=FailingMapping()):NotImplementedError:() + fd(self=FailingMappingKey()):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyMapping using fd(self=%s) +! fd(self=[]):TypeError:('unable to convert object to vim dictionary',) + <<< Finished + > TabPage + >> TabPageAttr +--- 888,1028 ---- + >> ListSetattr + del l.locked:AttributeError:('cannot delete vim.List attributes',) + l.locked = FailingTrue():NotImplementedError:() +! l.xxx = True:AttributeError:('cannot set attribute xxx',) + > Function + >> FunctionConstructor +! vim.Function("123"):ValueError:('unnamed function 123 does not exist',) +! vim.Function("xxx_non_existent_function_xxx"):ValueError:('function xxx_non_existent_function_xxx does not exist',) + vim.Function("xxx#non#existent#function#xxx"):NOT FAILED + >> FunctionCall + >>> Testing StringToChars using f({%s : 1}) +! f({1 : 1}):TypeError:('expected str() or unicode() instance, but got int',) + f({u"\0" : 1}):TypeError:('expected string without null bytes',) + f({"\0" : 1}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using f({"abc" : {%s : 1}}) +! f({"abc" : {1 : 1}}):TypeError:('expected str() or unicode() instance, but got int',) + f({"abc" : {u"\0" : 1}}):TypeError:('expected string without null bytes',) + f({"abc" : {"\0" : 1}}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using f({"abc" : Mapping({%s : 1})}) +! f({"abc" : Mapping({1 : 1})}):TypeError:('expected str() or unicode() instance, but got int',) + f({"abc" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',) + f({"abc" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using f({"abc" : %s}) +! f({"abc" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',) + f({"abc" : FailingIterNext()}):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using f({"abc" : %s}) +! f({"abc" : None}):TypeError:('unable to convert NoneType to vim structure',) + f({"abc" : {"": 1}}):ValueError:('empty keys are not allowed',) + f({"abc" : {u"": 1}}):ValueError:('empty keys are not allowed',) + f({"abc" : FailingMapping()}):NotImplementedError:() + f({"abc" : FailingMappingKey()}):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using f(Mapping({%s : 1})) +! f(Mapping({1 : 1})):TypeError:('expected str() or unicode() instance, but got int',) + f(Mapping({u"\0" : 1})):TypeError:('expected string without null bytes',) + f(Mapping({"\0" : 1})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using f(Mapping({"abc" : {%s : 1}})) +! f(Mapping({"abc" : {1 : 1}})):TypeError:('expected str() or unicode() instance, but got int',) + f(Mapping({"abc" : {u"\0" : 1}})):TypeError:('expected string without null bytes',) + f(Mapping({"abc" : {"\0" : 1}})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using f(Mapping({"abc" : Mapping({%s : 1})})) +! f(Mapping({"abc" : Mapping({1 : 1})})):TypeError:('expected str() or unicode() instance, but got int',) + f(Mapping({"abc" : Mapping({u"\0" : 1})})):TypeError:('expected string without null bytes',) + f(Mapping({"abc" : Mapping({"\0" : 1})})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using f(Mapping({"abc" : %s})) +! f(Mapping({"abc" : FailingIter()})):TypeError:('unable to convert FailingIter to vim structure',) + f(Mapping({"abc" : FailingIterNext()})):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using f(Mapping({"abc" : %s})) +! f(Mapping({"abc" : None})):TypeError:('unable to convert NoneType to vim structure',) + f(Mapping({"abc" : {"": 1}})):ValueError:('empty keys are not allowed',) + f(Mapping({"abc" : {u"": 1}})):ValueError:('empty keys are not allowed',) + f(Mapping({"abc" : FailingMapping()})):NotImplementedError:() + f(Mapping({"abc" : FailingMappingKey()})):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using f(%s) +! f(FailingIter()):TypeError:('unable to convert FailingIter to vim structure',) + f(FailingIterNext()):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using f(%s) +! f(None):TypeError:('unable to convert NoneType to vim structure',) + f({"": 1}):ValueError:('empty keys are not allowed',) + f({u"": 1}):ValueError:('empty keys are not allowed',) + f(FailingMapping()):NotImplementedError:() + f(FailingMappingKey()):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using fd(self={%s : 1}) +! fd(self={1 : 1}):TypeError:('expected str() or unicode() instance, but got int',) + fd(self={u"\0" : 1}):TypeError:('expected string without null bytes',) + fd(self={"\0" : 1}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using fd(self={"abc" : {%s : 1}}) +! fd(self={"abc" : {1 : 1}}):TypeError:('expected str() or unicode() instance, but got int',) + fd(self={"abc" : {u"\0" : 1}}):TypeError:('expected string without null bytes',) + fd(self={"abc" : {"\0" : 1}}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using fd(self={"abc" : Mapping({%s : 1})}) +! fd(self={"abc" : Mapping({1 : 1})}):TypeError:('expected str() or unicode() instance, but got int',) + fd(self={"abc" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',) + fd(self={"abc" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using fd(self={"abc" : %s}) +! fd(self={"abc" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',) + fd(self={"abc" : FailingIterNext()}):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using fd(self={"abc" : %s}) +! fd(self={"abc" : None}):TypeError:('unable to convert NoneType to vim structure',) + fd(self={"abc" : {"": 1}}):ValueError:('empty keys are not allowed',) + fd(self={"abc" : {u"": 1}}):ValueError:('empty keys are not allowed',) + fd(self={"abc" : FailingMapping()}):NotImplementedError:() + fd(self={"abc" : FailingMappingKey()}):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({%s : 1})) +! fd(self=Mapping({1 : 1})):TypeError:('expected str() or unicode() instance, but got int',) + fd(self=Mapping({u"\0" : 1})):TypeError:('expected string without null bytes',) + fd(self=Mapping({"\0" : 1})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({"abc" : {%s : 1}})) +! fd(self=Mapping({"abc" : {1 : 1}})):TypeError:('expected str() or unicode() instance, but got int',) + fd(self=Mapping({"abc" : {u"\0" : 1}})):TypeError:('expected string without null bytes',) + fd(self=Mapping({"abc" : {"\0" : 1}})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({"abc" : Mapping({%s : 1})})) +! fd(self=Mapping({"abc" : Mapping({1 : 1})})):TypeError:('expected str() or unicode() instance, but got int',) + fd(self=Mapping({"abc" : Mapping({u"\0" : 1})})):TypeError:('expected string without null bytes',) + fd(self=Mapping({"abc" : Mapping({"\0" : 1})})):TypeError:('expected string without null bytes',) + <<< Finished + >>> Testing *Iter* using fd(self=Mapping({"abc" : %s})) +! fd(self=Mapping({"abc" : FailingIter()})):TypeError:('unable to convert FailingIter to vim structure',) + fd(self=Mapping({"abc" : FailingIterNext()})):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using fd(self=Mapping({"abc" : %s})) +! fd(self=Mapping({"abc" : None})):TypeError:('unable to convert NoneType to vim structure',) + fd(self=Mapping({"abc" : {"": 1}})):ValueError:('empty keys are not allowed',) + fd(self=Mapping({"abc" : {u"": 1}})):ValueError:('empty keys are not allowed',) + fd(self=Mapping({"abc" : FailingMapping()})):NotImplementedError:() + fd(self=Mapping({"abc" : FailingMappingKey()})):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using fd(self=%s) +! fd(self=FailingIter()):TypeError:('unable to convert FailingIter to vim dictionary',) +! fd(self=FailingIterNext()):TypeError:('unable to convert FailingIterNext to vim dictionary',) + <<< Finished + >>> Testing ConvertFromPyObject using fd(self=%s) +! fd(self=None):TypeError:('unable to convert NoneType to vim dictionary',) + fd(self={"": 1}):ValueError:('empty keys are not allowed',) + fd(self={u"": 1}):ValueError:('empty keys are not allowed',) + fd(self=FailingMapping()):NotImplementedError:() + fd(self=FailingMappingKey()):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyMapping using fd(self=%s) +! fd(self=[]):TypeError:('unable to convert list to vim dictionary',) + <<< Finished + > TabPage + >> TabPageAttr +*************** +*** 1034,1040 **** + >> WindowAttr + vim.current.window.xxx:AttributeError:('xxx',) + >> WindowSetattr +! vim.current.window.buffer = 0:TypeError:('readonly attribute',) + vim.current.window.cursor = (100000000, 100000000):error:('cursor position outside buffer',) + vim.current.window.cursor = True:TypeError:('argument must be 2-item sequence, not bool',) + vim.current.window.height = "abc":TypeError:('an integer is required',) +--- 1034,1040 ---- + >> WindowAttr + vim.current.window.xxx:AttributeError:('xxx',) + >> WindowSetattr +! vim.current.window.buffer = 0:TypeError:('readonly attribute: buffer',) + vim.current.window.cursor = (100000000, 100000000):error:('cursor position outside buffer',) + vim.current.window.cursor = True:TypeError:('argument must be 2-item sequence, not bool',) + vim.current.window.height = "abc":TypeError:('an integer is required',) +*************** +*** 1062,1071 **** + >> BufferAttr + vim.current.buffer.xxx:AttributeError:('xxx',) + >> BufferSetattr +! vim.current.buffer.name = True:TypeError:('object must be string',) + vim.current.buffer.xxx = True:AttributeError:('xxx',) + >> BufferMark +! vim.current.buffer.mark(0):TypeError:('object must be string',) + vim.current.buffer.mark("abc"):ValueError:('mark name must be a single character',) + vim.current.buffer.mark("!"):error:('invalid mark name',) + >> BufferRange +--- 1062,1071 ---- + >> BufferAttr + vim.current.buffer.xxx:AttributeError:('xxx',) + >> BufferSetattr +! vim.current.buffer.name = True:TypeError:('expected str() or unicode() instance, but got bool',) + vim.current.buffer.xxx = True:AttributeError:('xxx',) + >> BufferMark +! vim.current.buffer.mark(0):TypeError:('expected str() or unicode() instance, but got int',) + vim.current.buffer.mark("abc"):ValueError:('mark name must be a single character',) + vim.current.buffer.mark("!"):error:('invalid mark name',) + >> BufferRange +*************** +*** 1079,1087 **** + vim.current.xxx:AttributeError:('xxx',) + >> CurrentSetattr + vim.current.line = True:TypeError:('bad argument type for built-in operation',) +! vim.current.buffer = True:TypeError:('expected vim.Buffer object',) +! vim.current.window = True:TypeError:('expected vim.Window object',) +! vim.current.tabpage = True:TypeError:('expected vim.TabPage object',) + vim.current.xxx = True:AttributeError:('xxx',) + 2,xx + before +--- 1079,1087 ---- + vim.current.xxx:AttributeError:('xxx',) + >> CurrentSetattr + vim.current.line = True:TypeError:('bad argument type for built-in operation',) +! vim.current.buffer = True:TypeError:('expected vim.Buffer object, but got bool',) +! vim.current.window = True:TypeError:('expected vim.Window object, but got bool',) +! vim.current.tabpage = True:TypeError:('expected vim.TabPage object, but got bool',) + vim.current.xxx = True:AttributeError:('xxx',) + 2,xx + before +*** ../vim-7.3.1229/src/testdir/test87.ok 2013-06-23 13:00:40.000000000 +0200 +--- src/testdir/test87.ok 2013-06-23 13:31:16.000000000 +0200 +*************** +*** 428,434 **** + >> OutputSetattr + del sys.stdout.softspace:(, AttributeError("can't delete OutputObject attributes",)) + sys.stdout.softspace = []:(, TypeError('softspace must be an integer',)) +! sys.stdout.attr = None:(, AttributeError('invalid attribute',)) + >> OutputWrite + sys.stdout.write(None):(, TypeError("Can't convert 'NoneType' object to str implicitly",)) + >> OutputWriteLines +--- 428,434 ---- + >> OutputSetattr + del sys.stdout.softspace:(, AttributeError("can't delete OutputObject attributes",)) + sys.stdout.softspace = []:(, TypeError('softspace must be an integer',)) +! sys.stdout.attr = None:(, AttributeError('invalid attribute: attr',)) + >> OutputWrite + sys.stdout.write(None):(, TypeError("Can't convert 'NoneType' object to str implicitly",)) + >> OutputWriteLines +*************** +*** 439,537 **** + sys.stdout.writelines(FailingIterNext()):(, NotImplementedError()) + <<< Finished + > VimCommand +! vim.command(1):(, TypeError('object must be string',)) + > VimToPython + > VimEval +! vim.eval(1):(, TypeError('object must be string',)) + > VimEvalPy +! vim.bindeval(1):(, TypeError('object must be string',)) + > VimStrwidth +! vim.strwidth(1):(, TypeError('object must be string',)) + > Dictionary + >> DictionaryConstructor +! vim.Dictionary("abc"):(, ValueError('expected sequence element of size 2',)) + >> DictionarySetattr + del d.locked:(, AttributeError('cannot delete vim.Dictionary attributes',)) + d.locked = FailingTrue():(, NotImplementedError()) + vim.vvars.locked = False:(, TypeError('cannot modify fixed dictionary',)) +! d.scope = True:(, AttributeError('cannot set this attribute',)) +! d.xxx = True:(, AttributeError('cannot set this attribute',)) + >> _DictionaryItem + d.get("a", 2, 3):(, TypeError('function takes at most 2 arguments (3 given)',)) + >>> Testing StringToChars using d.get(%s) +! d.get(1):(, TypeError('object must be string',)) + d.get(b"\0"):(, TypeError('expected bytes with no null',)) + d.get("\0"):(, TypeError('expected bytes with no null',)) + <<< Finished + d.pop("a"):(, KeyError('a',)) +! dl.pop("a"):(, error('dict is locked',)) + >> DictionaryIterNext + for i in ned: ned["a"] = 1:(, RuntimeError('hashtab changed during iteration',)) + >> DictionaryAssItem +! dl["b"] = 1:(, error('dict is locked',)) + >>> Testing StringToChars using d[%s] = 1 +! d[1] = 1:(, TypeError('object must be string',)) + d[b"\0"] = 1:(, TypeError('expected bytes with no null',)) + d["\0"] = 1:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d["a"] = {%s : 1} +! d["a"] = {1 : 1}:(, TypeError('object must be string',)) + d["a"] = {b"\0" : 1}:(, TypeError('expected bytes with no null',)) + d["a"] = {"\0" : 1}:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d["a"] = {"abc" : {%s : 1}} +! d["a"] = {"abc" : {1 : 1}}:(, TypeError('object must be string',)) + d["a"] = {"abc" : {b"\0" : 1}}:(, TypeError('expected bytes with no null',)) + d["a"] = {"abc" : {"\0" : 1}}:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d["a"] = {"abc" : Mapping({%s : 1})} +! d["a"] = {"abc" : Mapping({1 : 1})}:(, TypeError('object must be string',)) + d["a"] = {"abc" : Mapping({b"\0" : 1})}:(, TypeError('expected bytes with no null',)) + d["a"] = {"abc" : Mapping({"\0" : 1})}:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using d["a"] = {"abc" : %s} +! d["a"] = {"abc" : FailingIter()}:(, TypeError('unable to convert to vim structure',)) + d["a"] = {"abc" : FailingIterNext()}:(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = {"abc" : %s} +! d["a"] = {"abc" : None}:(, TypeError('unable to convert to vim structure',)) + d["a"] = {"abc" : {b"": 1}}:(, ValueError('empty keys are not allowed',)) + d["a"] = {"abc" : {"": 1}}:(, ValueError('empty keys are not allowed',)) + d["a"] = {"abc" : FailingMapping()}:(, NotImplementedError()) + d["a"] = {"abc" : FailingMappingKey()}:(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({%s : 1}) +! d["a"] = Mapping({1 : 1}):(, TypeError('object must be string',)) + d["a"] = Mapping({b"\0" : 1}):(, TypeError('expected bytes with no null',)) + d["a"] = Mapping({"\0" : 1}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({"abc" : {%s : 1}}) +! d["a"] = Mapping({"abc" : {1 : 1}}):(, TypeError('object must be string',)) + d["a"] = Mapping({"abc" : {b"\0" : 1}}):(, TypeError('expected bytes with no null',)) + d["a"] = Mapping({"abc" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({"abc" : Mapping({%s : 1})}) +! d["a"] = Mapping({"abc" : Mapping({1 : 1})}):(, TypeError('object must be string',)) + d["a"] = Mapping({"abc" : Mapping({b"\0" : 1})}):(, TypeError('expected bytes with no null',)) + d["a"] = Mapping({"abc" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using d["a"] = Mapping({"abc" : %s}) +! d["a"] = Mapping({"abc" : FailingIter()}):(, TypeError('unable to convert to vim structure',)) + d["a"] = Mapping({"abc" : FailingIterNext()}):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abc" : %s}) +! d["a"] = Mapping({"abc" : None}):(, TypeError('unable to convert to vim structure',)) + d["a"] = Mapping({"abc" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) + d["a"] = Mapping({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) + d["a"] = Mapping({"abc" : FailingMapping()}):(, NotImplementedError()) + d["a"] = Mapping({"abc" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using d["a"] = %s +! d["a"] = FailingIter():(, TypeError('unable to convert to vim structure',)) + d["a"] = FailingIterNext():(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = %s +! d["a"] = None:(, TypeError('unable to convert to vim structure',)) + d["a"] = {b"": 1}:(, ValueError('empty keys are not allowed',)) + d["a"] = {"": 1}:(, ValueError('empty keys are not allowed',)) + d["a"] = FailingMapping():(, NotImplementedError()) +--- 439,537 ---- + sys.stdout.writelines(FailingIterNext()):(, NotImplementedError()) + <<< Finished + > VimCommand +! vim.command(1):(, TypeError('expected bytes() or str() instance, but got int',)) + > VimToPython + > VimEval +! vim.eval(1):(, TypeError('expected bytes() or str() instance, but got int',)) + > VimEvalPy +! vim.bindeval(1):(, TypeError('expected bytes() or str() instance, but got int',)) + > VimStrwidth +! vim.strwidth(1):(, TypeError('expected bytes() or str() instance, but got int',)) + > Dictionary + >> DictionaryConstructor +! vim.Dictionary("abc"):(, ValueError('expected sequence element of size 2, but got sequence of size 1',)) + >> DictionarySetattr + del d.locked:(, AttributeError('cannot delete vim.Dictionary attributes',)) + d.locked = FailingTrue():(, NotImplementedError()) + vim.vvars.locked = False:(, TypeError('cannot modify fixed dictionary',)) +! d.scope = True:(, AttributeError('cannot set attribute scope',)) +! d.xxx = True:(, AttributeError('cannot set attribute xxx',)) + >> _DictionaryItem + d.get("a", 2, 3):(, TypeError('function takes at most 2 arguments (3 given)',)) + >>> Testing StringToChars using d.get(%s) +! d.get(1):(, TypeError('expected bytes() or str() instance, but got int',)) + d.get(b"\0"):(, TypeError('expected bytes with no null',)) + d.get("\0"):(, TypeError('expected bytes with no null',)) + <<< Finished + d.pop("a"):(, KeyError('a',)) +! dl.pop("a"):(, error('dictionary is locked',)) + >> DictionaryIterNext + for i in ned: ned["a"] = 1:(, RuntimeError('hashtab changed during iteration',)) + >> DictionaryAssItem +! dl["b"] = 1:(, error('dictionary is locked',)) + >>> Testing StringToChars using d[%s] = 1 +! d[1] = 1:(, TypeError('expected bytes() or str() instance, but got int',)) + d[b"\0"] = 1:(, TypeError('expected bytes with no null',)) + d["\0"] = 1:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d["a"] = {%s : 1} +! d["a"] = {1 : 1}:(, TypeError('expected bytes() or str() instance, but got int',)) + d["a"] = {b"\0" : 1}:(, TypeError('expected bytes with no null',)) + d["a"] = {"\0" : 1}:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d["a"] = {"abc" : {%s : 1}} +! d["a"] = {"abc" : {1 : 1}}:(, TypeError('expected bytes() or str() instance, but got int',)) + d["a"] = {"abc" : {b"\0" : 1}}:(, TypeError('expected bytes with no null',)) + d["a"] = {"abc" : {"\0" : 1}}:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d["a"] = {"abc" : Mapping({%s : 1})} +! d["a"] = {"abc" : Mapping({1 : 1})}:(, TypeError('expected bytes() or str() instance, but got int',)) + d["a"] = {"abc" : Mapping({b"\0" : 1})}:(, TypeError('expected bytes with no null',)) + d["a"] = {"abc" : Mapping({"\0" : 1})}:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using d["a"] = {"abc" : %s} +! d["a"] = {"abc" : FailingIter()}:(, TypeError('unable to convert FailingIter to vim structure',)) + d["a"] = {"abc" : FailingIterNext()}:(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = {"abc" : %s} +! d["a"] = {"abc" : None}:(, TypeError('unable to convert NoneType to vim structure',)) + d["a"] = {"abc" : {b"": 1}}:(, ValueError('empty keys are not allowed',)) + d["a"] = {"abc" : {"": 1}}:(, ValueError('empty keys are not allowed',)) + d["a"] = {"abc" : FailingMapping()}:(, NotImplementedError()) + d["a"] = {"abc" : FailingMappingKey()}:(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({%s : 1}) +! d["a"] = Mapping({1 : 1}):(, TypeError('expected bytes() or str() instance, but got int',)) + d["a"] = Mapping({b"\0" : 1}):(, TypeError('expected bytes with no null',)) + d["a"] = Mapping({"\0" : 1}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({"abc" : {%s : 1}}) +! d["a"] = Mapping({"abc" : {1 : 1}}):(, TypeError('expected bytes() or str() instance, but got int',)) + d["a"] = Mapping({"abc" : {b"\0" : 1}}):(, TypeError('expected bytes with no null',)) + d["a"] = Mapping({"abc" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({"abc" : Mapping({%s : 1})}) +! d["a"] = Mapping({"abc" : Mapping({1 : 1})}):(, TypeError('expected bytes() or str() instance, but got int',)) + d["a"] = Mapping({"abc" : Mapping({b"\0" : 1})}):(, TypeError('expected bytes with no null',)) + d["a"] = Mapping({"abc" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using d["a"] = Mapping({"abc" : %s}) +! d["a"] = Mapping({"abc" : FailingIter()}):(, TypeError('unable to convert FailingIter to vim structure',)) + d["a"] = Mapping({"abc" : FailingIterNext()}):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abc" : %s}) +! d["a"] = Mapping({"abc" : None}):(, TypeError('unable to convert NoneType to vim structure',)) + d["a"] = Mapping({"abc" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) + d["a"] = Mapping({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) + d["a"] = Mapping({"abc" : FailingMapping()}):(, NotImplementedError()) + d["a"] = Mapping({"abc" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using d["a"] = %s +! d["a"] = FailingIter():(, TypeError('unable to convert FailingIter to vim structure',)) + d["a"] = FailingIterNext():(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = %s +! d["a"] = None:(, TypeError('unable to convert NoneType to vim structure',)) + d["a"] = {b"": 1}:(, ValueError('empty keys are not allowed',)) + d["a"] = {"": 1}:(, ValueError('empty keys are not allowed',)) + d["a"] = FailingMapping():(, NotImplementedError()) +*************** +*** 547,598 **** + d.update(FailingIterNext()):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d.update({%s : 1}) +! d.update({1 : 1}):(, TypeError('object must be string',)) + d.update({b"\0" : 1}):(, TypeError('expected bytes with no null',)) + d.update({"\0" : 1}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update({"abc" : {%s : 1}}) +! d.update({"abc" : {1 : 1}}):(, TypeError('object must be string',)) + d.update({"abc" : {b"\0" : 1}}):(, TypeError('expected bytes with no null',)) + d.update({"abc" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update({"abc" : Mapping({%s : 1})}) +! d.update({"abc" : Mapping({1 : 1})}):(, TypeError('object must be string',)) + d.update({"abc" : Mapping({b"\0" : 1})}):(, TypeError('expected bytes with no null',)) + d.update({"abc" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using d.update({"abc" : %s}) +! d.update({"abc" : FailingIter()}):(, TypeError('unable to convert to vim structure',)) + d.update({"abc" : FailingIterNext()}):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d.update({"abc" : %s}) +! d.update({"abc" : None}):(, TypeError('unable to convert to vim structure',)) + d.update({"abc" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) + d.update({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) + d.update({"abc" : FailingMapping()}):(, NotImplementedError()) + d.update({"abc" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d.update(Mapping({%s : 1})) +! d.update(Mapping({1 : 1})):(, TypeError('object must be string',)) + d.update(Mapping({b"\0" : 1})):(, TypeError('expected bytes with no null',)) + d.update(Mapping({"\0" : 1})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update(Mapping({"abc" : {%s : 1}})) +! d.update(Mapping({"abc" : {1 : 1}})):(, TypeError('object must be string',)) + d.update(Mapping({"abc" : {b"\0" : 1}})):(, TypeError('expected bytes with no null',)) + d.update(Mapping({"abc" : {"\0" : 1}})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update(Mapping({"abc" : Mapping({%s : 1})})) +! d.update(Mapping({"abc" : Mapping({1 : 1})})):(, TypeError('object must be string',)) + d.update(Mapping({"abc" : Mapping({b"\0" : 1})})):(, TypeError('expected bytes with no null',)) + d.update(Mapping({"abc" : Mapping({"\0" : 1})})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using d.update(Mapping({"abc" : %s})) +! d.update(Mapping({"abc" : FailingIter()})):(, TypeError('unable to convert to vim structure',)) + d.update(Mapping({"abc" : FailingIterNext()})):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d.update(Mapping({"abc" : %s})) +! d.update(Mapping({"abc" : None})):(, TypeError('unable to convert to vim structure',)) + d.update(Mapping({"abc" : {b"": 1}})):(, ValueError('empty keys are not allowed',)) + d.update(Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) + d.update(Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) +--- 547,598 ---- + d.update(FailingIterNext()):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d.update({%s : 1}) +! d.update({1 : 1}):(, TypeError('expected bytes() or str() instance, but got int',)) + d.update({b"\0" : 1}):(, TypeError('expected bytes with no null',)) + d.update({"\0" : 1}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update({"abc" : {%s : 1}}) +! d.update({"abc" : {1 : 1}}):(, TypeError('expected bytes() or str() instance, but got int',)) + d.update({"abc" : {b"\0" : 1}}):(, TypeError('expected bytes with no null',)) + d.update({"abc" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update({"abc" : Mapping({%s : 1})}) +! d.update({"abc" : Mapping({1 : 1})}):(, TypeError('expected bytes() or str() instance, but got int',)) + d.update({"abc" : Mapping({b"\0" : 1})}):(, TypeError('expected bytes with no null',)) + d.update({"abc" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using d.update({"abc" : %s}) +! d.update({"abc" : FailingIter()}):(, TypeError('unable to convert FailingIter to vim structure',)) + d.update({"abc" : FailingIterNext()}):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d.update({"abc" : %s}) +! d.update({"abc" : None}):(, TypeError('unable to convert NoneType to vim structure',)) + d.update({"abc" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) + d.update({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) + d.update({"abc" : FailingMapping()}):(, NotImplementedError()) + d.update({"abc" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d.update(Mapping({%s : 1})) +! d.update(Mapping({1 : 1})):(, TypeError('expected bytes() or str() instance, but got int',)) + d.update(Mapping({b"\0" : 1})):(, TypeError('expected bytes with no null',)) + d.update(Mapping({"\0" : 1})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update(Mapping({"abc" : {%s : 1}})) +! d.update(Mapping({"abc" : {1 : 1}})):(, TypeError('expected bytes() or str() instance, but got int',)) + d.update(Mapping({"abc" : {b"\0" : 1}})):(, TypeError('expected bytes with no null',)) + d.update(Mapping({"abc" : {"\0" : 1}})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update(Mapping({"abc" : Mapping({%s : 1})})) +! d.update(Mapping({"abc" : Mapping({1 : 1})})):(, TypeError('expected bytes() or str() instance, but got int',)) + d.update(Mapping({"abc" : Mapping({b"\0" : 1})})):(, TypeError('expected bytes with no null',)) + d.update(Mapping({"abc" : Mapping({"\0" : 1})})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using d.update(Mapping({"abc" : %s})) +! d.update(Mapping({"abc" : FailingIter()})):(, TypeError('unable to convert FailingIter to vim structure',)) + d.update(Mapping({"abc" : FailingIterNext()})):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d.update(Mapping({"abc" : %s})) +! d.update(Mapping({"abc" : None})):(, TypeError('unable to convert NoneType to vim structure',)) + d.update(Mapping({"abc" : {b"": 1}})):(, ValueError('empty keys are not allowed',)) + d.update(Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) + d.update(Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) +*************** +*** 610,677 **** + d.update(FailingMappingKey()):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d.update(((%s, 0),)) +! d.update(((1, 0),)):(, TypeError('object must be string',)) + d.update(((b"\0", 0),)):(, TypeError('expected bytes with no null',)) + d.update((("\0", 0),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", {%s : 1}),)) +! d.update((("a", {1 : 1}),)):(, TypeError('object must be string',)) + d.update((("a", {b"\0" : 1}),)):(, TypeError('expected bytes with no null',)) + d.update((("a", {"\0" : 1}),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", {"abc" : {%s : 1}}),)) +! d.update((("a", {"abc" : {1 : 1}}),)):(, TypeError('object must be string',)) + d.update((("a", {"abc" : {b"\0" : 1}}),)):(, TypeError('expected bytes with no null',)) + d.update((("a", {"abc" : {"\0" : 1}}),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", {"abc" : Mapping({%s : 1})}),)) +! d.update((("a", {"abc" : Mapping({1 : 1})}),)):(, TypeError('object must be string',)) + d.update((("a", {"abc" : Mapping({b"\0" : 1})}),)):(, TypeError('expected bytes with no null',)) + d.update((("a", {"abc" : Mapping({"\0" : 1})}),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using d.update((("a", {"abc" : %s}),)) +! d.update((("a", {"abc" : FailingIter()}),)):(, TypeError('unable to convert to vim structure',)) + d.update((("a", {"abc" : FailingIterNext()}),)):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", {"abc" : %s}),)) +! d.update((("a", {"abc" : None}),)):(, TypeError('unable to convert to vim structure',)) + d.update((("a", {"abc" : {b"": 1}}),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", {"abc" : {"": 1}}),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", {"abc" : FailingMapping()}),)):(, NotImplementedError()) + d.update((("a", {"abc" : FailingMappingKey()}),)):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),)) +! d.update((("a", Mapping({1 : 1})),)):(, TypeError('object must be string',)) + d.update((("a", Mapping({b"\0" : 1})),)):(, TypeError('expected bytes with no null',)) + d.update((("a", Mapping({"\0" : 1})),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({"abc" : {%s : 1}})),)) +! d.update((("a", Mapping({"abc" : {1 : 1}})),)):(, TypeError('object must be string',)) + d.update((("a", Mapping({"abc" : {b"\0" : 1}})),)):(, TypeError('expected bytes with no null',)) + d.update((("a", Mapping({"abc" : {"\0" : 1}})),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({"abc" : Mapping({%s : 1})})),)) +! d.update((("a", Mapping({"abc" : Mapping({1 : 1})})),)):(, TypeError('object must be string',)) + d.update((("a", Mapping({"abc" : Mapping({b"\0" : 1})})),)):(, TypeError('expected bytes with no null',)) + d.update((("a", Mapping({"abc" : Mapping({"\0" : 1})})),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using d.update((("a", Mapping({"abc" : %s})),)) +! d.update((("a", Mapping({"abc" : FailingIter()})),)):(, TypeError('unable to convert to vim structure',)) + d.update((("a", Mapping({"abc" : FailingIterNext()})),)):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abc" : %s})),)) +! d.update((("a", Mapping({"abc" : None})),)):(, TypeError('unable to convert to vim structure',)) + d.update((("a", Mapping({"abc" : {b"": 1}})),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", Mapping({"abc" : {"": 1}})),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", Mapping({"abc" : FailingMapping()})),)):(, NotImplementedError()) + d.update((("a", Mapping({"abc" : FailingMappingKey()})),)):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using d.update((("a", %s),)) +! d.update((("a", FailingIter()),)):(, TypeError('unable to convert to vim structure',)) + d.update((("a", FailingIterNext()),)):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", %s),)) +! d.update((("a", None),)):(, TypeError('unable to convert to vim structure',)) + d.update((("a", {b"": 1}),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", {"": 1}),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", FailingMapping()),)):(, NotImplementedError()) +--- 610,677 ---- + d.update(FailingMappingKey()):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d.update(((%s, 0),)) +! d.update(((1, 0),)):(, TypeError('expected bytes() or str() instance, but got int',)) + d.update(((b"\0", 0),)):(, TypeError('expected bytes with no null',)) + d.update((("\0", 0),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", {%s : 1}),)) +! d.update((("a", {1 : 1}),)):(, TypeError('expected bytes() or str() instance, but got int',)) + d.update((("a", {b"\0" : 1}),)):(, TypeError('expected bytes with no null',)) + d.update((("a", {"\0" : 1}),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", {"abc" : {%s : 1}}),)) +! d.update((("a", {"abc" : {1 : 1}}),)):(, TypeError('expected bytes() or str() instance, but got int',)) + d.update((("a", {"abc" : {b"\0" : 1}}),)):(, TypeError('expected bytes with no null',)) + d.update((("a", {"abc" : {"\0" : 1}}),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", {"abc" : Mapping({%s : 1})}),)) +! d.update((("a", {"abc" : Mapping({1 : 1})}),)):(, TypeError('expected bytes() or str() instance, but got int',)) + d.update((("a", {"abc" : Mapping({b"\0" : 1})}),)):(, TypeError('expected bytes with no null',)) + d.update((("a", {"abc" : Mapping({"\0" : 1})}),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using d.update((("a", {"abc" : %s}),)) +! d.update((("a", {"abc" : FailingIter()}),)):(, TypeError('unable to convert FailingIter to vim structure',)) + d.update((("a", {"abc" : FailingIterNext()}),)):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", {"abc" : %s}),)) +! d.update((("a", {"abc" : None}),)):(, TypeError('unable to convert NoneType to vim structure',)) + d.update((("a", {"abc" : {b"": 1}}),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", {"abc" : {"": 1}}),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", {"abc" : FailingMapping()}),)):(, NotImplementedError()) + d.update((("a", {"abc" : FailingMappingKey()}),)):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),)) +! d.update((("a", Mapping({1 : 1})),)):(, TypeError('expected bytes() or str() instance, but got int',)) + d.update((("a", Mapping({b"\0" : 1})),)):(, TypeError('expected bytes with no null',)) + d.update((("a", Mapping({"\0" : 1})),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({"abc" : {%s : 1}})),)) +! d.update((("a", Mapping({"abc" : {1 : 1}})),)):(, TypeError('expected bytes() or str() instance, but got int',)) + d.update((("a", Mapping({"abc" : {b"\0" : 1}})),)):(, TypeError('expected bytes with no null',)) + d.update((("a", Mapping({"abc" : {"\0" : 1}})),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({"abc" : Mapping({%s : 1})})),)) +! d.update((("a", Mapping({"abc" : Mapping({1 : 1})})),)):(, TypeError('expected bytes() or str() instance, but got int',)) + d.update((("a", Mapping({"abc" : Mapping({b"\0" : 1})})),)):(, TypeError('expected bytes with no null',)) + d.update((("a", Mapping({"abc" : Mapping({"\0" : 1})})),)):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using d.update((("a", Mapping({"abc" : %s})),)) +! d.update((("a", Mapping({"abc" : FailingIter()})),)):(, TypeError('unable to convert FailingIter to vim structure',)) + d.update((("a", Mapping({"abc" : FailingIterNext()})),)):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abc" : %s})),)) +! d.update((("a", Mapping({"abc" : None})),)):(, TypeError('unable to convert NoneType to vim structure',)) + d.update((("a", Mapping({"abc" : {b"": 1}})),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", Mapping({"abc" : {"": 1}})),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", Mapping({"abc" : FailingMapping()})),)):(, NotImplementedError()) + d.update((("a", Mapping({"abc" : FailingMappingKey()})),)):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using d.update((("a", %s),)) +! d.update((("a", FailingIter()),)):(, TypeError('unable to convert FailingIter to vim structure',)) + d.update((("a", FailingIterNext()),)):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", %s),)) +! d.update((("a", None),)):(, TypeError('unable to convert NoneType to vim structure',)) + d.update((("a", {b"": 1}),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", {"": 1}),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", FailingMapping()),)):(, NotImplementedError()) +*************** +*** 690,752 **** + vim.List(FailingIterNext()):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using vim.List([{%s : 1}]) +! vim.List([{1 : 1}]):(, TypeError('object must be string',)) + vim.List([{b"\0" : 1}]):(, TypeError('expected bytes with no null',)) + vim.List([{"\0" : 1}]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using vim.List([{"abc" : {%s : 1}}]) +! vim.List([{"abc" : {1 : 1}}]):(, TypeError('object must be string',)) + vim.List([{"abc" : {b"\0" : 1}}]):(, TypeError('expected bytes with no null',)) + vim.List([{"abc" : {"\0" : 1}}]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using vim.List([{"abc" : Mapping({%s : 1})}]) +! vim.List([{"abc" : Mapping({1 : 1})}]):(, TypeError('object must be string',)) + vim.List([{"abc" : Mapping({b"\0" : 1})}]):(, TypeError('expected bytes with no null',)) + vim.List([{"abc" : Mapping({"\0" : 1})}]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using vim.List([{"abc" : %s}]) +! vim.List([{"abc" : FailingIter()}]):(, TypeError('unable to convert to vim structure',)) + vim.List([{"abc" : FailingIterNext()}]):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([{"abc" : %s}]) +! vim.List([{"abc" : None}]):(, TypeError('unable to convert to vim structure',)) + vim.List([{"abc" : {b"": 1}}]):(, ValueError('empty keys are not allowed',)) + vim.List([{"abc" : {"": 1}}]):(, ValueError('empty keys are not allowed',)) + vim.List([{"abc" : FailingMapping()}]):(, NotImplementedError()) + vim.List([{"abc" : FailingMappingKey()}]):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({%s : 1})]) +! vim.List([Mapping({1 : 1})]):(, TypeError('object must be string',)) + vim.List([Mapping({b"\0" : 1})]):(, TypeError('expected bytes with no null',)) + vim.List([Mapping({"\0" : 1})]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({"abc" : {%s : 1}})]) +! vim.List([Mapping({"abc" : {1 : 1}})]):(, TypeError('object must be string',)) + vim.List([Mapping({"abc" : {b"\0" : 1}})]):(, TypeError('expected bytes with no null',)) + vim.List([Mapping({"abc" : {"\0" : 1}})]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({"abc" : Mapping({%s : 1})})]) +! vim.List([Mapping({"abc" : Mapping({1 : 1})})]):(, TypeError('object must be string',)) + vim.List([Mapping({"abc" : Mapping({b"\0" : 1})})]):(, TypeError('expected bytes with no null',)) + vim.List([Mapping({"abc" : Mapping({"\0" : 1})})]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using vim.List([Mapping({"abc" : %s})]) +! vim.List([Mapping({"abc" : FailingIter()})]):(, TypeError('unable to convert to vim structure',)) + vim.List([Mapping({"abc" : FailingIterNext()})]):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([Mapping({"abc" : %s})]) +! vim.List([Mapping({"abc" : None})]):(, TypeError('unable to convert to vim structure',)) + vim.List([Mapping({"abc" : {b"": 1}})]):(, ValueError('empty keys are not allowed',)) + vim.List([Mapping({"abc" : {"": 1}})]):(, ValueError('empty keys are not allowed',)) + vim.List([Mapping({"abc" : FailingMapping()})]):(, NotImplementedError()) + vim.List([Mapping({"abc" : FailingMappingKey()})]):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using vim.List([%s]) +! vim.List([FailingIter()]):(, TypeError('unable to convert to vim structure',)) + vim.List([FailingIterNext()]):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([%s]) +! vim.List([None]):(, TypeError('unable to convert to vim structure',)) + vim.List([{b"": 1}]):(, ValueError('empty keys are not allowed',)) + vim.List([{"": 1}]):(, ValueError('empty keys are not allowed',)) + vim.List([FailingMapping()]):(, NotImplementedError()) +--- 690,752 ---- + vim.List(FailingIterNext()):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using vim.List([{%s : 1}]) +! vim.List([{1 : 1}]):(, TypeError('expected bytes() or str() instance, but got int',)) + vim.List([{b"\0" : 1}]):(, TypeError('expected bytes with no null',)) + vim.List([{"\0" : 1}]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using vim.List([{"abc" : {%s : 1}}]) +! vim.List([{"abc" : {1 : 1}}]):(, TypeError('expected bytes() or str() instance, but got int',)) + vim.List([{"abc" : {b"\0" : 1}}]):(, TypeError('expected bytes with no null',)) + vim.List([{"abc" : {"\0" : 1}}]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using vim.List([{"abc" : Mapping({%s : 1})}]) +! vim.List([{"abc" : Mapping({1 : 1})}]):(, TypeError('expected bytes() or str() instance, but got int',)) + vim.List([{"abc" : Mapping({b"\0" : 1})}]):(, TypeError('expected bytes with no null',)) + vim.List([{"abc" : Mapping({"\0" : 1})}]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using vim.List([{"abc" : %s}]) +! vim.List([{"abc" : FailingIter()}]):(, TypeError('unable to convert FailingIter to vim structure',)) + vim.List([{"abc" : FailingIterNext()}]):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([{"abc" : %s}]) +! vim.List([{"abc" : None}]):(, TypeError('unable to convert NoneType to vim structure',)) + vim.List([{"abc" : {b"": 1}}]):(, ValueError('empty keys are not allowed',)) + vim.List([{"abc" : {"": 1}}]):(, ValueError('empty keys are not allowed',)) + vim.List([{"abc" : FailingMapping()}]):(, NotImplementedError()) + vim.List([{"abc" : FailingMappingKey()}]):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({%s : 1})]) +! vim.List([Mapping({1 : 1})]):(, TypeError('expected bytes() or str() instance, but got int',)) + vim.List([Mapping({b"\0" : 1})]):(, TypeError('expected bytes with no null',)) + vim.List([Mapping({"\0" : 1})]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({"abc" : {%s : 1}})]) +! vim.List([Mapping({"abc" : {1 : 1}})]):(, TypeError('expected bytes() or str() instance, but got int',)) + vim.List([Mapping({"abc" : {b"\0" : 1}})]):(, TypeError('expected bytes with no null',)) + vim.List([Mapping({"abc" : {"\0" : 1}})]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({"abc" : Mapping({%s : 1})})]) +! vim.List([Mapping({"abc" : Mapping({1 : 1})})]):(, TypeError('expected bytes() or str() instance, but got int',)) + vim.List([Mapping({"abc" : Mapping({b"\0" : 1})})]):(, TypeError('expected bytes with no null',)) + vim.List([Mapping({"abc" : Mapping({"\0" : 1})})]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using vim.List([Mapping({"abc" : %s})]) +! vim.List([Mapping({"abc" : FailingIter()})]):(, TypeError('unable to convert FailingIter to vim structure',)) + vim.List([Mapping({"abc" : FailingIterNext()})]):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([Mapping({"abc" : %s})]) +! vim.List([Mapping({"abc" : None})]):(, TypeError('unable to convert NoneType to vim structure',)) + vim.List([Mapping({"abc" : {b"": 1}})]):(, ValueError('empty keys are not allowed',)) + vim.List([Mapping({"abc" : {"": 1}})]):(, ValueError('empty keys are not allowed',)) + vim.List([Mapping({"abc" : FailingMapping()})]):(, NotImplementedError()) + vim.List([Mapping({"abc" : FailingMappingKey()})]):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using vim.List([%s]) +! vim.List([FailingIter()]):(, TypeError('unable to convert FailingIter to vim structure',)) + vim.List([FailingIterNext()]):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([%s]) +! vim.List([None]):(, TypeError('unable to convert NoneType to vim structure',)) + vim.List([{b"": 1}]):(, ValueError('empty keys are not allowed',)) + vim.List([{"": 1}]):(, ValueError('empty keys are not allowed',)) + vim.List([FailingMapping()]):(, NotImplementedError()) +*************** +*** 764,826 **** + l[:] = FailingIterNext()::(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using l[:] = [{%s : 1}] +! l[:] = [{1 : 1}]:(, TypeError('object must be string',)) + l[:] = [{b"\0" : 1}]:(, TypeError('expected bytes with no null',)) + l[:] = [{"\0" : 1}]:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l[:] = [{"abc" : {%s : 1}}] +! l[:] = [{"abc" : {1 : 1}}]:(, TypeError('object must be string',)) + l[:] = [{"abc" : {b"\0" : 1}}]:(, TypeError('expected bytes with no null',)) + l[:] = [{"abc" : {"\0" : 1}}]:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l[:] = [{"abc" : Mapping({%s : 1})}] +! l[:] = [{"abc" : Mapping({1 : 1})}]:(, TypeError('object must be string',)) + l[:] = [{"abc" : Mapping({b"\0" : 1})}]:(, TypeError('expected bytes with no null',)) + l[:] = [{"abc" : Mapping({"\0" : 1})}]:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using l[:] = [{"abc" : %s}] +! l[:] = [{"abc" : FailingIter()}]:(, TypeError('unable to convert to vim structure',)) + l[:] = [{"abc" : FailingIterNext()}]:(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [{"abc" : %s}] +! l[:] = [{"abc" : None}]:(, TypeError('unable to convert to vim structure',)) + l[:] = [{"abc" : {b"": 1}}]:(, ValueError('empty keys are not allowed',)) + l[:] = [{"abc" : {"": 1}}]:(, ValueError('empty keys are not allowed',)) + l[:] = [{"abc" : FailingMapping()}]:(, NotImplementedError()) + l[:] = [{"abc" : FailingMappingKey()}]:(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({%s : 1})] +! l[:] = [Mapping({1 : 1})]:(, TypeError('object must be string',)) + l[:] = [Mapping({b"\0" : 1})]:(, TypeError('expected bytes with no null',)) + l[:] = [Mapping({"\0" : 1})]:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({"abc" : {%s : 1}})] +! l[:] = [Mapping({"abc" : {1 : 1}})]:(, TypeError('object must be string',)) + l[:] = [Mapping({"abc" : {b"\0" : 1}})]:(, TypeError('expected bytes with no null',)) + l[:] = [Mapping({"abc" : {"\0" : 1}})]:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({"abc" : Mapping({%s : 1})})] +! l[:] = [Mapping({"abc" : Mapping({1 : 1})})]:(, TypeError('object must be string',)) + l[:] = [Mapping({"abc" : Mapping({b"\0" : 1})})]:(, TypeError('expected bytes with no null',)) + l[:] = [Mapping({"abc" : Mapping({"\0" : 1})})]:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using l[:] = [Mapping({"abc" : %s})] +! l[:] = [Mapping({"abc" : FailingIter()})]:(, TypeError('unable to convert to vim structure',)) + l[:] = [Mapping({"abc" : FailingIterNext()})]:(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abc" : %s})] +! l[:] = [Mapping({"abc" : None})]:(, TypeError('unable to convert to vim structure',)) + l[:] = [Mapping({"abc" : {b"": 1}})]:(, ValueError('empty keys are not allowed',)) + l[:] = [Mapping({"abc" : {"": 1}})]:(, ValueError('empty keys are not allowed',)) + l[:] = [Mapping({"abc" : FailingMapping()})]:(, NotImplementedError()) + l[:] = [Mapping({"abc" : FailingMappingKey()})]:(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using l[:] = [%s] +! l[:] = [FailingIter()]:(, TypeError('unable to convert to vim structure',)) + l[:] = [FailingIterNext()]:(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [%s] +! l[:] = [None]:(, TypeError('unable to convert to vim structure',)) + l[:] = [{b"": 1}]:(, ValueError('empty keys are not allowed',)) + l[:] = [{"": 1}]:(, ValueError('empty keys are not allowed',)) + l[:] = [FailingMapping()]:(, NotImplementedError()) +--- 764,826 ---- + l[:] = FailingIterNext()::(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using l[:] = [{%s : 1}] +! l[:] = [{1 : 1}]:(, TypeError('expected bytes() or str() instance, but got int',)) + l[:] = [{b"\0" : 1}]:(, TypeError('expected bytes with no null',)) + l[:] = [{"\0" : 1}]:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l[:] = [{"abc" : {%s : 1}}] +! l[:] = [{"abc" : {1 : 1}}]:(, TypeError('expected bytes() or str() instance, but got int',)) + l[:] = [{"abc" : {b"\0" : 1}}]:(, TypeError('expected bytes with no null',)) + l[:] = [{"abc" : {"\0" : 1}}]:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l[:] = [{"abc" : Mapping({%s : 1})}] +! l[:] = [{"abc" : Mapping({1 : 1})}]:(, TypeError('expected bytes() or str() instance, but got int',)) + l[:] = [{"abc" : Mapping({b"\0" : 1})}]:(, TypeError('expected bytes with no null',)) + l[:] = [{"abc" : Mapping({"\0" : 1})}]:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using l[:] = [{"abc" : %s}] +! l[:] = [{"abc" : FailingIter()}]:(, TypeError('unable to convert FailingIter to vim structure',)) + l[:] = [{"abc" : FailingIterNext()}]:(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [{"abc" : %s}] +! l[:] = [{"abc" : None}]:(, TypeError('unable to convert NoneType to vim structure',)) + l[:] = [{"abc" : {b"": 1}}]:(, ValueError('empty keys are not allowed',)) + l[:] = [{"abc" : {"": 1}}]:(, ValueError('empty keys are not allowed',)) + l[:] = [{"abc" : FailingMapping()}]:(, NotImplementedError()) + l[:] = [{"abc" : FailingMappingKey()}]:(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({%s : 1})] +! l[:] = [Mapping({1 : 1})]:(, TypeError('expected bytes() or str() instance, but got int',)) + l[:] = [Mapping({b"\0" : 1})]:(, TypeError('expected bytes with no null',)) + l[:] = [Mapping({"\0" : 1})]:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({"abc" : {%s : 1}})] +! l[:] = [Mapping({"abc" : {1 : 1}})]:(, TypeError('expected bytes() or str() instance, but got int',)) + l[:] = [Mapping({"abc" : {b"\0" : 1}})]:(, TypeError('expected bytes with no null',)) + l[:] = [Mapping({"abc" : {"\0" : 1}})]:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({"abc" : Mapping({%s : 1})})] +! l[:] = [Mapping({"abc" : Mapping({1 : 1})})]:(, TypeError('expected bytes() or str() instance, but got int',)) + l[:] = [Mapping({"abc" : Mapping({b"\0" : 1})})]:(, TypeError('expected bytes with no null',)) + l[:] = [Mapping({"abc" : Mapping({"\0" : 1})})]:(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using l[:] = [Mapping({"abc" : %s})] +! l[:] = [Mapping({"abc" : FailingIter()})]:(, TypeError('unable to convert FailingIter to vim structure',)) + l[:] = [Mapping({"abc" : FailingIterNext()})]:(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abc" : %s})] +! l[:] = [Mapping({"abc" : None})]:(, TypeError('unable to convert NoneType to vim structure',)) + l[:] = [Mapping({"abc" : {b"": 1}})]:(, ValueError('empty keys are not allowed',)) + l[:] = [Mapping({"abc" : {"": 1}})]:(, ValueError('empty keys are not allowed',)) + l[:] = [Mapping({"abc" : FailingMapping()})]:(, NotImplementedError()) + l[:] = [Mapping({"abc" : FailingMappingKey()})]:(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using l[:] = [%s] +! l[:] = [FailingIter()]:(, TypeError('unable to convert FailingIter to vim structure',)) + l[:] = [FailingIterNext()]:(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [%s] +! l[:] = [None]:(, TypeError('unable to convert NoneType to vim structure',)) + l[:] = [{b"": 1}]:(, ValueError('empty keys are not allowed',)) + l[:] = [{"": 1}]:(, ValueError('empty keys are not allowed',)) + l[:] = [FailingMapping()]:(, NotImplementedError()) +*************** +*** 832,894 **** + l.extend(FailingIterNext()):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using l.extend([{%s : 1}]) +! l.extend([{1 : 1}]):(, TypeError('object must be string',)) + l.extend([{b"\0" : 1}]):(, TypeError('expected bytes with no null',)) + l.extend([{"\0" : 1}]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l.extend([{"abc" : {%s : 1}}]) +! l.extend([{"abc" : {1 : 1}}]):(, TypeError('object must be string',)) + l.extend([{"abc" : {b"\0" : 1}}]):(, TypeError('expected bytes with no null',)) + l.extend([{"abc" : {"\0" : 1}}]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l.extend([{"abc" : Mapping({%s : 1})}]) +! l.extend([{"abc" : Mapping({1 : 1})}]):(, TypeError('object must be string',)) + l.extend([{"abc" : Mapping({b"\0" : 1})}]):(, TypeError('expected bytes with no null',)) + l.extend([{"abc" : Mapping({"\0" : 1})}]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using l.extend([{"abc" : %s}]) +! l.extend([{"abc" : FailingIter()}]):(, TypeError('unable to convert to vim structure',)) + l.extend([{"abc" : FailingIterNext()}]):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([{"abc" : %s}]) +! l.extend([{"abc" : None}]):(, TypeError('unable to convert to vim structure',)) + l.extend([{"abc" : {b"": 1}}]):(, ValueError('empty keys are not allowed',)) + l.extend([{"abc" : {"": 1}}]):(, ValueError('empty keys are not allowed',)) + l.extend([{"abc" : FailingMapping()}]):(, NotImplementedError()) + l.extend([{"abc" : FailingMappingKey()}]):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({%s : 1})]) +! l.extend([Mapping({1 : 1})]):(, TypeError('object must be string',)) + l.extend([Mapping({b"\0" : 1})]):(, TypeError('expected bytes with no null',)) + l.extend([Mapping({"\0" : 1})]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({"abc" : {%s : 1}})]) +! l.extend([Mapping({"abc" : {1 : 1}})]):(, TypeError('object must be string',)) + l.extend([Mapping({"abc" : {b"\0" : 1}})]):(, TypeError('expected bytes with no null',)) + l.extend([Mapping({"abc" : {"\0" : 1}})]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({"abc" : Mapping({%s : 1})})]) +! l.extend([Mapping({"abc" : Mapping({1 : 1})})]):(, TypeError('object must be string',)) + l.extend([Mapping({"abc" : Mapping({b"\0" : 1})})]):(, TypeError('expected bytes with no null',)) + l.extend([Mapping({"abc" : Mapping({"\0" : 1})})]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using l.extend([Mapping({"abc" : %s})]) +! l.extend([Mapping({"abc" : FailingIter()})]):(, TypeError('unable to convert to vim structure',)) + l.extend([Mapping({"abc" : FailingIterNext()})]):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([Mapping({"abc" : %s})]) +! l.extend([Mapping({"abc" : None})]):(, TypeError('unable to convert to vim structure',)) + l.extend([Mapping({"abc" : {b"": 1}})]):(, ValueError('empty keys are not allowed',)) + l.extend([Mapping({"abc" : {"": 1}})]):(, ValueError('empty keys are not allowed',)) + l.extend([Mapping({"abc" : FailingMapping()})]):(, NotImplementedError()) + l.extend([Mapping({"abc" : FailingMappingKey()})]):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using l.extend([%s]) +! l.extend([FailingIter()]):(, TypeError('unable to convert to vim structure',)) + l.extend([FailingIterNext()]):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([%s]) +! l.extend([None]):(, TypeError('unable to convert to vim structure',)) + l.extend([{b"": 1}]):(, ValueError('empty keys are not allowed',)) + l.extend([{"": 1}]):(, ValueError('empty keys are not allowed',)) + l.extend([FailingMapping()]):(, NotImplementedError()) +--- 832,894 ---- + l.extend(FailingIterNext()):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using l.extend([{%s : 1}]) +! l.extend([{1 : 1}]):(, TypeError('expected bytes() or str() instance, but got int',)) + l.extend([{b"\0" : 1}]):(, TypeError('expected bytes with no null',)) + l.extend([{"\0" : 1}]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l.extend([{"abc" : {%s : 1}}]) +! l.extend([{"abc" : {1 : 1}}]):(, TypeError('expected bytes() or str() instance, but got int',)) + l.extend([{"abc" : {b"\0" : 1}}]):(, TypeError('expected bytes with no null',)) + l.extend([{"abc" : {"\0" : 1}}]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l.extend([{"abc" : Mapping({%s : 1})}]) +! l.extend([{"abc" : Mapping({1 : 1})}]):(, TypeError('expected bytes() or str() instance, but got int',)) + l.extend([{"abc" : Mapping({b"\0" : 1})}]):(, TypeError('expected bytes with no null',)) + l.extend([{"abc" : Mapping({"\0" : 1})}]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using l.extend([{"abc" : %s}]) +! l.extend([{"abc" : FailingIter()}]):(, TypeError('unable to convert FailingIter to vim structure',)) + l.extend([{"abc" : FailingIterNext()}]):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([{"abc" : %s}]) +! l.extend([{"abc" : None}]):(, TypeError('unable to convert NoneType to vim structure',)) + l.extend([{"abc" : {b"": 1}}]):(, ValueError('empty keys are not allowed',)) + l.extend([{"abc" : {"": 1}}]):(, ValueError('empty keys are not allowed',)) + l.extend([{"abc" : FailingMapping()}]):(, NotImplementedError()) + l.extend([{"abc" : FailingMappingKey()}]):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({%s : 1})]) +! l.extend([Mapping({1 : 1})]):(, TypeError('expected bytes() or str() instance, but got int',)) + l.extend([Mapping({b"\0" : 1})]):(, TypeError('expected bytes with no null',)) + l.extend([Mapping({"\0" : 1})]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({"abc" : {%s : 1}})]) +! l.extend([Mapping({"abc" : {1 : 1}})]):(, TypeError('expected bytes() or str() instance, but got int',)) + l.extend([Mapping({"abc" : {b"\0" : 1}})]):(, TypeError('expected bytes with no null',)) + l.extend([Mapping({"abc" : {"\0" : 1}})]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({"abc" : Mapping({%s : 1})})]) +! l.extend([Mapping({"abc" : Mapping({1 : 1})})]):(, TypeError('expected bytes() or str() instance, but got int',)) + l.extend([Mapping({"abc" : Mapping({b"\0" : 1})})]):(, TypeError('expected bytes with no null',)) + l.extend([Mapping({"abc" : Mapping({"\0" : 1})})]):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using l.extend([Mapping({"abc" : %s})]) +! l.extend([Mapping({"abc" : FailingIter()})]):(, TypeError('unable to convert FailingIter to vim structure',)) + l.extend([Mapping({"abc" : FailingIterNext()})]):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([Mapping({"abc" : %s})]) +! l.extend([Mapping({"abc" : None})]):(, TypeError('unable to convert NoneType to vim structure',)) + l.extend([Mapping({"abc" : {b"": 1}})]):(, ValueError('empty keys are not allowed',)) + l.extend([Mapping({"abc" : {"": 1}})]):(, ValueError('empty keys are not allowed',)) + l.extend([Mapping({"abc" : FailingMapping()})]):(, NotImplementedError()) + l.extend([Mapping({"abc" : FailingMappingKey()})]):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using l.extend([%s]) +! l.extend([FailingIter()]):(, TypeError('unable to convert FailingIter to vim structure',)) + l.extend([FailingIterNext()]):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([%s]) +! l.extend([None]):(, TypeError('unable to convert NoneType to vim structure',)) + l.extend([{b"": 1}]):(, ValueError('empty keys are not allowed',)) + l.extend([{"": 1}]):(, ValueError('empty keys are not allowed',)) + l.extend([FailingMapping()]):(, NotImplementedError()) +*************** +*** 897,1030 **** + >> ListSetattr + del l.locked:(, AttributeError('cannot delete vim.List attributes',)) + l.locked = FailingTrue():(, NotImplementedError()) +! l.xxx = True:(, AttributeError('cannot set this attribute',)) + > Function + >> FunctionConstructor +! vim.Function("123"):(, ValueError('unnamed function does not exist',)) +! vim.Function("xxx_non_existent_function_xxx"):(, ValueError('function does not exist',)) + vim.Function("xxx#non#existent#function#xxx"):NOT FAILED + >> FunctionCall + >>> Testing StringToChars using f({%s : 1}) +! f({1 : 1}):(, TypeError('object must be string',)) + f({b"\0" : 1}):(, TypeError('expected bytes with no null',)) + f({"\0" : 1}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using f({"abc" : {%s : 1}}) +! f({"abc" : {1 : 1}}):(, TypeError('object must be string',)) + f({"abc" : {b"\0" : 1}}):(, TypeError('expected bytes with no null',)) + f({"abc" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using f({"abc" : Mapping({%s : 1})}) +! f({"abc" : Mapping({1 : 1})}):(, TypeError('object must be string',)) + f({"abc" : Mapping({b"\0" : 1})}):(, TypeError('expected bytes with no null',)) + f({"abc" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using f({"abc" : %s}) +! f({"abc" : FailingIter()}):(, TypeError('unable to convert to vim structure',)) + f({"abc" : FailingIterNext()}):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using f({"abc" : %s}) +! f({"abc" : None}):(, TypeError('unable to convert to vim structure',)) + f({"abc" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) + f({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) + f({"abc" : FailingMapping()}):(, NotImplementedError()) + f({"abc" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using f(Mapping({%s : 1})) +! f(Mapping({1 : 1})):(, TypeError('object must be string',)) + f(Mapping({b"\0" : 1})):(, TypeError('expected bytes with no null',)) + f(Mapping({"\0" : 1})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using f(Mapping({"abc" : {%s : 1}})) +! f(Mapping({"abc" : {1 : 1}})):(, TypeError('object must be string',)) + f(Mapping({"abc" : {b"\0" : 1}})):(, TypeError('expected bytes with no null',)) + f(Mapping({"abc" : {"\0" : 1}})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using f(Mapping({"abc" : Mapping({%s : 1})})) +! f(Mapping({"abc" : Mapping({1 : 1})})):(, TypeError('object must be string',)) + f(Mapping({"abc" : Mapping({b"\0" : 1})})):(, TypeError('expected bytes with no null',)) + f(Mapping({"abc" : Mapping({"\0" : 1})})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using f(Mapping({"abc" : %s})) +! f(Mapping({"abc" : FailingIter()})):(, TypeError('unable to convert to vim structure',)) + f(Mapping({"abc" : FailingIterNext()})):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using f(Mapping({"abc" : %s})) +! f(Mapping({"abc" : None})):(, TypeError('unable to convert to vim structure',)) + f(Mapping({"abc" : {b"": 1}})):(, ValueError('empty keys are not allowed',)) + f(Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) + f(Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) + f(Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using f(%s) +! f(FailingIter()):(, TypeError('unable to convert to vim structure',)) + f(FailingIterNext()):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using f(%s) +! f(None):(, TypeError('unable to convert to vim structure',)) + f({b"": 1}):(, ValueError('empty keys are not allowed',)) + f({"": 1}):(, ValueError('empty keys are not allowed',)) + f(FailingMapping()):(, NotImplementedError()) + f(FailingMappingKey()):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using fd(self={%s : 1}) +! fd(self={1 : 1}):(, TypeError('object must be string',)) + fd(self={b"\0" : 1}):(, TypeError('expected bytes with no null',)) + fd(self={"\0" : 1}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using fd(self={"abc" : {%s : 1}}) +! fd(self={"abc" : {1 : 1}}):(, TypeError('object must be string',)) + fd(self={"abc" : {b"\0" : 1}}):(, TypeError('expected bytes with no null',)) + fd(self={"abc" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using fd(self={"abc" : Mapping({%s : 1})}) +! fd(self={"abc" : Mapping({1 : 1})}):(, TypeError('object must be string',)) + fd(self={"abc" : Mapping({b"\0" : 1})}):(, TypeError('expected bytes with no null',)) + fd(self={"abc" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using fd(self={"abc" : %s}) +! fd(self={"abc" : FailingIter()}):(, TypeError('unable to convert to vim structure',)) + fd(self={"abc" : FailingIterNext()}):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using fd(self={"abc" : %s}) +! fd(self={"abc" : None}):(, TypeError('unable to convert to vim structure',)) + fd(self={"abc" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) + fd(self={"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) + fd(self={"abc" : FailingMapping()}):(, NotImplementedError()) + fd(self={"abc" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({%s : 1})) +! fd(self=Mapping({1 : 1})):(, TypeError('object must be string',)) + fd(self=Mapping({b"\0" : 1})):(, TypeError('expected bytes with no null',)) + fd(self=Mapping({"\0" : 1})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({"abc" : {%s : 1}})) +! fd(self=Mapping({"abc" : {1 : 1}})):(, TypeError('object must be string',)) + fd(self=Mapping({"abc" : {b"\0" : 1}})):(, TypeError('expected bytes with no null',)) + fd(self=Mapping({"abc" : {"\0" : 1}})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({"abc" : Mapping({%s : 1})})) +! fd(self=Mapping({"abc" : Mapping({1 : 1})})):(, TypeError('object must be string',)) + fd(self=Mapping({"abc" : Mapping({b"\0" : 1})})):(, TypeError('expected bytes with no null',)) + fd(self=Mapping({"abc" : Mapping({"\0" : 1})})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using fd(self=Mapping({"abc" : %s})) +! fd(self=Mapping({"abc" : FailingIter()})):(, TypeError('unable to convert to vim structure',)) + fd(self=Mapping({"abc" : FailingIterNext()})):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using fd(self=Mapping({"abc" : %s})) +! fd(self=Mapping({"abc" : None})):(, TypeError('unable to convert to vim structure',)) + fd(self=Mapping({"abc" : {b"": 1}})):(, ValueError('empty keys are not allowed',)) + fd(self=Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) + fd(self=Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) + fd(self=Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using fd(self=%s) +! fd(self=FailingIter()):(, TypeError('unable to convert object to vim dictionary',)) +! fd(self=FailingIterNext()):(, TypeError('unable to convert object to vim dictionary',)) + <<< Finished + >>> Testing ConvertFromPyObject using fd(self=%s) +! fd(self=None):(, TypeError('unable to convert object to vim dictionary',)) + fd(self={b"": 1}):(, ValueError('empty keys are not allowed',)) + fd(self={"": 1}):(, ValueError('empty keys are not allowed',)) + fd(self=FailingMapping()):(, NotImplementedError()) +--- 897,1030 ---- + >> ListSetattr + del l.locked:(, AttributeError('cannot delete vim.List attributes',)) + l.locked = FailingTrue():(, NotImplementedError()) +! l.xxx = True:(, AttributeError('cannot set attribute xxx',)) + > Function + >> FunctionConstructor +! vim.Function("123"):(, ValueError('unnamed function 123 does not exist',)) +! vim.Function("xxx_non_existent_function_xxx"):(, ValueError('function xxx_non_existent_function_xxx does not exist',)) + vim.Function("xxx#non#existent#function#xxx"):NOT FAILED + >> FunctionCall + >>> Testing StringToChars using f({%s : 1}) +! f({1 : 1}):(, TypeError('expected bytes() or str() instance, but got int',)) + f({b"\0" : 1}):(, TypeError('expected bytes with no null',)) + f({"\0" : 1}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using f({"abc" : {%s : 1}}) +! f({"abc" : {1 : 1}}):(, TypeError('expected bytes() or str() instance, but got int',)) + f({"abc" : {b"\0" : 1}}):(, TypeError('expected bytes with no null',)) + f({"abc" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using f({"abc" : Mapping({%s : 1})}) +! f({"abc" : Mapping({1 : 1})}):(, TypeError('expected bytes() or str() instance, but got int',)) + f({"abc" : Mapping({b"\0" : 1})}):(, TypeError('expected bytes with no null',)) + f({"abc" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using f({"abc" : %s}) +! f({"abc" : FailingIter()}):(, TypeError('unable to convert FailingIter to vim structure',)) + f({"abc" : FailingIterNext()}):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using f({"abc" : %s}) +! f({"abc" : None}):(, TypeError('unable to convert NoneType to vim structure',)) + f({"abc" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) + f({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) + f({"abc" : FailingMapping()}):(, NotImplementedError()) + f({"abc" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using f(Mapping({%s : 1})) +! f(Mapping({1 : 1})):(, TypeError('expected bytes() or str() instance, but got int',)) + f(Mapping({b"\0" : 1})):(, TypeError('expected bytes with no null',)) + f(Mapping({"\0" : 1})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using f(Mapping({"abc" : {%s : 1}})) +! f(Mapping({"abc" : {1 : 1}})):(, TypeError('expected bytes() or str() instance, but got int',)) + f(Mapping({"abc" : {b"\0" : 1}})):(, TypeError('expected bytes with no null',)) + f(Mapping({"abc" : {"\0" : 1}})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using f(Mapping({"abc" : Mapping({%s : 1})})) +! f(Mapping({"abc" : Mapping({1 : 1})})):(, TypeError('expected bytes() or str() instance, but got int',)) + f(Mapping({"abc" : Mapping({b"\0" : 1})})):(, TypeError('expected bytes with no null',)) + f(Mapping({"abc" : Mapping({"\0" : 1})})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using f(Mapping({"abc" : %s})) +! f(Mapping({"abc" : FailingIter()})):(, TypeError('unable to convert FailingIter to vim structure',)) + f(Mapping({"abc" : FailingIterNext()})):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using f(Mapping({"abc" : %s})) +! f(Mapping({"abc" : None})):(, TypeError('unable to convert NoneType to vim structure',)) + f(Mapping({"abc" : {b"": 1}})):(, ValueError('empty keys are not allowed',)) + f(Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) + f(Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) + f(Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using f(%s) +! f(FailingIter()):(, TypeError('unable to convert FailingIter to vim structure',)) + f(FailingIterNext()):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using f(%s) +! f(None):(, TypeError('unable to convert NoneType to vim structure',)) + f({b"": 1}):(, ValueError('empty keys are not allowed',)) + f({"": 1}):(, ValueError('empty keys are not allowed',)) + f(FailingMapping()):(, NotImplementedError()) + f(FailingMappingKey()):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using fd(self={%s : 1}) +! fd(self={1 : 1}):(, TypeError('expected bytes() or str() instance, but got int',)) + fd(self={b"\0" : 1}):(, TypeError('expected bytes with no null',)) + fd(self={"\0" : 1}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using fd(self={"abc" : {%s : 1}}) +! fd(self={"abc" : {1 : 1}}):(, TypeError('expected bytes() or str() instance, but got int',)) + fd(self={"abc" : {b"\0" : 1}}):(, TypeError('expected bytes with no null',)) + fd(self={"abc" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using fd(self={"abc" : Mapping({%s : 1})}) +! fd(self={"abc" : Mapping({1 : 1})}):(, TypeError('expected bytes() or str() instance, but got int',)) + fd(self={"abc" : Mapping({b"\0" : 1})}):(, TypeError('expected bytes with no null',)) + fd(self={"abc" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using fd(self={"abc" : %s}) +! fd(self={"abc" : FailingIter()}):(, TypeError('unable to convert FailingIter to vim structure',)) + fd(self={"abc" : FailingIterNext()}):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using fd(self={"abc" : %s}) +! fd(self={"abc" : None}):(, TypeError('unable to convert NoneType to vim structure',)) + fd(self={"abc" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) + fd(self={"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) + fd(self={"abc" : FailingMapping()}):(, NotImplementedError()) + fd(self={"abc" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({%s : 1})) +! fd(self=Mapping({1 : 1})):(, TypeError('expected bytes() or str() instance, but got int',)) + fd(self=Mapping({b"\0" : 1})):(, TypeError('expected bytes with no null',)) + fd(self=Mapping({"\0" : 1})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({"abc" : {%s : 1}})) +! fd(self=Mapping({"abc" : {1 : 1}})):(, TypeError('expected bytes() or str() instance, but got int',)) + fd(self=Mapping({"abc" : {b"\0" : 1}})):(, TypeError('expected bytes with no null',)) + fd(self=Mapping({"abc" : {"\0" : 1}})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({"abc" : Mapping({%s : 1})})) +! fd(self=Mapping({"abc" : Mapping({1 : 1})})):(, TypeError('expected bytes() or str() instance, but got int',)) + fd(self=Mapping({"abc" : Mapping({b"\0" : 1})})):(, TypeError('expected bytes with no null',)) + fd(self=Mapping({"abc" : Mapping({"\0" : 1})})):(, TypeError('expected bytes with no null',)) + <<< Finished + >>> Testing *Iter* using fd(self=Mapping({"abc" : %s})) +! fd(self=Mapping({"abc" : FailingIter()})):(, TypeError('unable to convert FailingIter to vim structure',)) + fd(self=Mapping({"abc" : FailingIterNext()})):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using fd(self=Mapping({"abc" : %s})) +! fd(self=Mapping({"abc" : None})):(, TypeError('unable to convert NoneType to vim structure',)) + fd(self=Mapping({"abc" : {b"": 1}})):(, ValueError('empty keys are not allowed',)) + fd(self=Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) + fd(self=Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) + fd(self=Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using fd(self=%s) +! fd(self=FailingIter()):(, TypeError('unable to convert FailingIter to vim dictionary',)) +! fd(self=FailingIterNext()):(, TypeError('unable to convert FailingIterNext to vim dictionary',)) + <<< Finished + >>> Testing ConvertFromPyObject using fd(self=%s) +! fd(self=None):(, TypeError('unable to convert NoneType to vim dictionary',)) + fd(self={b"": 1}):(, ValueError('empty keys are not allowed',)) + fd(self={"": 1}):(, ValueError('empty keys are not allowed',)) + fd(self=FailingMapping()):(, NotImplementedError()) +*************** +*** 1043,1049 **** + >> WindowAttr + vim.current.window.xxx:(, AttributeError("'vim.window' object has no attribute 'xxx'",)) + >> WindowSetattr +! vim.current.window.buffer = 0:(, TypeError('readonly attribute',)) + vim.current.window.cursor = (100000000, 100000000):(, error('cursor position outside buffer',)) + vim.current.window.cursor = True:(, TypeError('argument must be 2-item sequence, not bool',)) + vim.current.window.height = "abc":(, TypeError('an integer is required',)) +--- 1043,1049 ---- + >> WindowAttr + vim.current.window.xxx:(, AttributeError("'vim.window' object has no attribute 'xxx'",)) + >> WindowSetattr +! vim.current.window.buffer = 0:(, TypeError('readonly attribute: buffer',)) + vim.current.window.cursor = (100000000, 100000000):(, error('cursor position outside buffer',)) + vim.current.window.cursor = True:(, TypeError('argument must be 2-item sequence, not bool',)) + vim.current.window.height = "abc":(, TypeError('an integer is required',)) +*************** +*** 1071,1080 **** + >> BufferAttr + vim.current.buffer.xxx:(, AttributeError("'vim.buffer' object has no attribute 'xxx'",)) + >> BufferSetattr +! vim.current.buffer.name = True:(, TypeError('object must be string',)) + vim.current.buffer.xxx = True:(, AttributeError('xxx',)) + >> BufferMark +! vim.current.buffer.mark(0):(, TypeError('object must be string',)) + vim.current.buffer.mark("abc"):(, ValueError('mark name must be a single character',)) + vim.current.buffer.mark("!"):(, error('invalid mark name',)) + >> BufferRange +--- 1071,1080 ---- + >> BufferAttr + vim.current.buffer.xxx:(, AttributeError("'vim.buffer' object has no attribute 'xxx'",)) + >> BufferSetattr +! vim.current.buffer.name = True:(, TypeError('expected bytes() or str() instance, but got bool',)) + vim.current.buffer.xxx = True:(, AttributeError('xxx',)) + >> BufferMark +! vim.current.buffer.mark(0):(, TypeError('expected bytes() or str() instance, but got int',)) + vim.current.buffer.mark("abc"):(, ValueError('mark name must be a single character',)) + vim.current.buffer.mark("!"):(, error('invalid mark name',)) + >> BufferRange +*************** +*** 1088,1096 **** + vim.current.xxx:(, AttributeError("'vim.currentdata' object has no attribute 'xxx'",)) + >> CurrentSetattr + vim.current.line = True:(, TypeError('bad argument type for built-in operation',)) +! vim.current.buffer = True:(, TypeError('expected vim.Buffer object',)) +! vim.current.window = True:(, TypeError('expected vim.Window object',)) +! vim.current.tabpage = True:(, TypeError('expected vim.TabPage object',)) + vim.current.xxx = True:(, AttributeError('xxx',)) + 3,xx + before +--- 1088,1096 ---- + vim.current.xxx:(, AttributeError("'vim.currentdata' object has no attribute 'xxx'",)) + >> CurrentSetattr + vim.current.line = True:(, TypeError('bad argument type for built-in operation',)) +! vim.current.buffer = True:(, TypeError('expected vim.Buffer object, but got bool',)) +! vim.current.window = True:(, TypeError('expected vim.Window object, but got bool',)) +! vim.current.tabpage = True:(, TypeError('expected vim.TabPage object, but got bool',)) + vim.current.xxx = True:(, AttributeError('xxx',)) + 3,xx + before +*** ../vim-7.3.1229/src/version.c 2013-06-23 13:28:11.000000000 +0200 +--- src/version.c 2013-06-23 13:30:05.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1230, + /**/ + +-- +MAN: You don't frighten us, English pig-dog! Go and boil your bottoms, + son of a silly person. I blow my nose on you, so-called Arthur-king, + you and your silly English K...kaniggets. + He puts hands to his ears and blows a raspberry. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// 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 /// diff --git a/7.3.1231 b/7.3.1231 new file mode 100644 index 0000000..13c2bc3 --- /dev/null +++ b/7.3.1231 @@ -0,0 +1,678 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1231 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1231 +Problem: Python: use of numbers not consistent. +Solution: Add support for Number protocol. (ZyX) +Files: src/if_py_both.h, src/if_python3.c, src/if_python.c, + src/testdir/test86.ok, src/testdir/test87.ok + + +*** ../vim-7.3.1230/src/if_py_both.h 2013-06-23 13:46:36.000000000 +0200 +--- src/if_py_both.h 2013-06-23 14:15:25.000000000 +0200 +*************** +*** 151,156 **** +--- 151,245 ---- + return (char_u *) p; + } + ++ #define NUMBER_LONG 1 ++ #define NUMBER_INT 2 ++ #define NUMBER_NATURAL 4 ++ #define NUMBER_UNSIGNED 8 ++ ++ static int ++ NumberToLong(PyObject *obj, long *result, int flags) ++ { ++ #if PY_MAJOR_VERSION < 3 ++ if (PyInt_Check(obj)) ++ { ++ *result = PyInt_AsLong(obj); ++ if (PyErr_Occurred()) ++ return -1; ++ } ++ else ++ #endif ++ if (PyLong_Check(obj)) ++ { ++ *result = PyLong_AsLong(obj); ++ if (PyErr_Occurred()) ++ return -1; ++ } ++ else if (PyNumber_Check(obj)) ++ { ++ PyObject *num; ++ ++ if (!(num = PyNumber_Long(obj))) ++ return -1; ++ ++ *result = PyLong_AsLong(num); ++ ++ Py_DECREF(num); ++ ++ if (PyErr_Occurred()) ++ return -1; ++ } ++ else ++ { ++ PyErr_FORMAT(PyExc_TypeError, ++ #if PY_MAJOR_VERSION < 3 ++ "expected int(), long() or something supporting " ++ "coercing to long(), but got %s" ++ #else ++ "expected int() or something supporting coercing to int(), " ++ "but got %s" ++ #endif ++ , Py_TYPE_NAME(obj)); ++ return -1; ++ } ++ ++ if (flags & NUMBER_INT) ++ { ++ if (*result > INT_MAX) ++ { ++ PyErr_SET_STRING(PyExc_OverflowError, ++ "value is too large to fit into C int type"); ++ return -1; ++ } ++ else if (*result < INT_MIN) ++ { ++ PyErr_SET_STRING(PyExc_OverflowError, ++ "value is too small to fit into C int type"); ++ return -1; ++ } ++ } ++ ++ if (flags & NUMBER_NATURAL) ++ { ++ if (*result <= 0) ++ { ++ PyErr_SET_STRING(PyExc_ValueError, ++ "number must be greater then zero"); ++ return -1; ++ } ++ } ++ else if (flags & NUMBER_UNSIGNED) ++ { ++ if (*result < 0) ++ { ++ PyErr_SET_STRING(PyExc_ValueError, ++ "number must be greater or equal to zero"); ++ return -1; ++ } ++ } ++ ++ return 0; ++ } ++ + static int + add_string(PyObject *list, char *s) + { +*************** +*** 243,255 **** + + if (strcmp(name, "softspace") == 0) + { +! if (!PyInt_Check(val)) +! { +! PyErr_SET_STRING(PyExc_TypeError, "softspace must be an integer"); + return -1; +- } +- +- self->softspace = PyInt_AsLong(val); + return 0; + } + +--- 332,339 ---- + + if (strcmp(name, "softspace") == 0) + { +! if (NumberToLong(val, &(self->softspace), NUMBER_UNSIGNED)) + return -1; + return 0; + } + +*************** +*** 2839,2861 **** + } + else if (flags & SOPT_NUM) + { +! int val; + +! #if PY_MAJOR_VERSION < 3 +! if (PyInt_Check(valObject)) +! val = PyInt_AsLong(valObject); +! else +! #endif +! if (PyLong_Check(valObject)) +! val = PyLong_AsLong(valObject); +! else + { +- PyErr_SET_STRING(PyExc_TypeError, "object must be integer"); + Py_XDECREF(todecref); + return -1; + } + +! r = set_option_value_for(key, val, NULL, opt_flags, + self->opt_type, self->from); + } + else +--- 2923,2937 ---- + } + else if (flags & SOPT_NUM) + { +! long val; + +! if (NumberToLong(valObject, &val, NUMBER_INT)) + { + Py_XDECREF(todecref); + return -1; + } + +! r = set_option_value_for(key, (int) val, NULL, opt_flags, + self->opt_type, self->from); + } + else +*************** +*** 3265,3274 **** + } + else if (strcmp(name, "height") == 0) + { +! int height; + win_T *savewin; + +! if (!PyArg_Parse(val, "i", &height)) + return -1; + + #ifdef FEAT_GUI +--- 3341,3350 ---- + } + else if (strcmp(name, "height") == 0) + { +! long height; + win_T *savewin; + +! if (NumberToLong(val, &height, NUMBER_INT)) + return -1; + + #ifdef FEAT_GUI +*************** +*** 3278,3284 **** + curwin = self->win; + + VimTryStart(); +! win_setheight(height); + curwin = savewin; + if (VimTryEnd()) + return -1; +--- 3354,3360 ---- + curwin = self->win; + + VimTryStart(); +! win_setheight((int) height); + curwin = savewin; + if (VimTryEnd()) + return -1; +*************** +*** 3288,3297 **** + #ifdef FEAT_VERTSPLIT + else if (strcmp(name, "width") == 0) + { +! int width; + win_T *savewin; + +! if (!PyArg_Parse(val, "i", &width)) + return -1; + + #ifdef FEAT_GUI +--- 3364,3373 ---- + #ifdef FEAT_VERTSPLIT + else if (strcmp(name, "width") == 0) + { +! long width; + win_T *savewin; + +! if (NumberToLong(val, &width, NUMBER_INT)) + return -1; + + #ifdef FEAT_GUI +*************** +*** 3301,3307 **** + curwin = self->win; + + VimTryStart(); +! win_setwidth(width); + curwin = savewin; + if (VimTryEnd()) + return -1; +--- 3377,3383 ---- + curwin = self->win; + + VimTryStart(); +! win_setwidth((int) width); + curwin = savewin; + if (VimTryEnd()) + return -1; +*************** +*** 4555,4576 **** + BufMapItem(PyObject *self UNUSED, PyObject *keyObject) + { + buf_T *b; +! int bnr; + +! #if PY_MAJOR_VERSION < 3 +! if (PyInt_Check(keyObject)) +! bnr = PyInt_AsLong(keyObject); +! else +! #endif +! if (PyLong_Check(keyObject)) +! bnr = PyLong_AsLong(keyObject); +! else +! { +! PyErr_SET_STRING(PyExc_TypeError, "key must be integer"); + return NULL; +- } + +! b = buflist_findnr(bnr); + + if (b) + return BufferNew(b); +--- 4631,4642 ---- + BufMapItem(PyObject *self UNUSED, PyObject *keyObject) + { + buf_T *b; +! long bnr; + +! if (NumberToLong(keyObject, &bnr, NUMBER_INT|NUMBER_NATURAL)) + return NULL; + +! b = buflist_findnr((int) bnr); + + if (b) + return BufferNew(b); +*************** +*** 5345,5356 **** +--- 5411,5426 ---- + { + tv->v_type = VAR_NUMBER; + tv->vval.v_number = (varnumber_T) PyInt_AsLong(obj); ++ if (PyErr_Occurred()) ++ return -1; + } + #endif + else if (PyLong_Check(obj)) + { + tv->v_type = VAR_NUMBER; + tv->vval.v_number = (varnumber_T) PyLong_AsLong(obj); ++ if (PyErr_Occurred()) ++ return -1; + } + else if (PyDict_Check(obj)) + return convert_dl(obj, tv, pydict_to_tv, lookup_dict); +*************** +*** 5367,5372 **** +--- 5437,5454 ---- + return convert_dl(obj, tv, pyseq_to_tv, lookup_dict); + else if (PyMapping_Check(obj)) + return convert_dl(obj, tv, pymap_to_tv, lookup_dict); ++ else if (PyNumber_Check(obj)) ++ { ++ PyObject *num; ++ ++ if (!(num = PyNumber_Long(obj))) ++ return -1; ++ ++ tv->v_type = VAR_NUMBER; ++ tv->vval.v_number = (varnumber_T) PyLong_AsLong(num); ++ ++ Py_DECREF(num); ++ } + else + { + PyErr_FORMAT(PyExc_TypeError, +*** ../vim-7.3.1230/src/if_python3.c 2013-06-23 13:46:36.000000000 +0200 +--- src/if_python3.c 2013-06-23 14:15:25.000000000 +0200 +*************** +*** 160,165 **** +--- 160,166 ---- + # define PyMapping_Keys py3_PyMapping_Keys + # define PyIter_Next py3_PyIter_Next + # define PyObject_GetIter py3_PyObject_GetIter ++ # define PyObject_Repr py3_PyObject_Repr + # define PyObject_GetItem py3_PyObject_GetItem + # define PyObject_IsTrue py3_PyObject_IsTrue + # define PyModule_GetDict py3_PyModule_GetDict +*************** +*** 211,216 **** +--- 212,219 ---- + # define PyType_Type (*py3_PyType_Type) + # define PySlice_Type (*py3_PySlice_Type) + # define PyFloat_Type (*py3_PyFloat_Type) ++ # define PyNumber_Check (*py3_PyNumber_Check) ++ # define PyNumber_Long (*py3_PyNumber_Long) + # define PyBool_Type (*py3_PyBool_Type) + # define PyErr_NewException py3_PyErr_NewException + # ifdef Py_DEBUG +*************** +*** 310,315 **** +--- 313,319 ---- + static PyObject* (*py3_PyDict_New)(void); + static PyObject* (*py3_PyIter_Next)(PyObject *); + static PyObject* (*py3_PyObject_GetIter)(PyObject *); ++ static PyObject* (*py3_PyObject_Repr)(PyObject *); + static PyObject* (*py3_PyObject_GetItem)(PyObject *, PyObject *); + static int (*py3_PyObject_IsTrue)(PyObject *); + static PyObject* (*py3_Py_BuildValue)(char *, ...); +*************** +*** 365,370 **** +--- 369,376 ---- + static PyTypeObject* py3_PySlice_Type; + static PyTypeObject* py3_PyFloat_Type; + static PyTypeObject* py3_PyBool_Type; ++ static int (*py3_PyNumber_Check)(PyObject *); ++ static PyObject* (*py3_PyNumber_Long)(PyObject *); + static PyObject* (*py3_PyErr_NewException)(char *name, PyObject *base, PyObject *dict); + static PyObject* (*py3_PyCapsule_New)(void *, char *, PyCapsule_Destructor); + static void* (*py3_PyCapsule_GetPointer)(PyObject *, char *); +*************** +*** 399,404 **** +--- 405,411 ---- + static PyObject *p3imp_PyExc_ValueError; + static PyObject *p3imp_PyExc_RuntimeError; + static PyObject *p3imp_PyExc_ImportError; ++ static PyObject *p3imp_PyExc_OverflowError; + + # define PyExc_AttributeError p3imp_PyExc_AttributeError + # define PyExc_IndexError p3imp_PyExc_IndexError +*************** +*** 408,413 **** +--- 415,421 ---- + # define PyExc_ValueError p3imp_PyExc_ValueError + # define PyExc_RuntimeError p3imp_PyExc_RuntimeError + # define PyExc_ImportError p3imp_PyExc_ImportError ++ # define PyExc_OverflowError p3imp_PyExc_OverflowError + + /* + * Table of name to function pointer of python. +*************** +*** 469,474 **** +--- 477,483 ---- + {"PyMapping_Keys", (PYTHON_PROC*)&py3_PyMapping_Keys}, + {"PyIter_Next", (PYTHON_PROC*)&py3_PyIter_Next}, + {"PyObject_GetIter", (PYTHON_PROC*)&py3_PyObject_GetIter}, ++ {"PyObject_Repr", (PYTHON_PROC*)&py3_PyObject_Repr}, + {"PyObject_GetItem", (PYTHON_PROC*)&py3_PyObject_GetItem}, + {"PyObject_IsTrue", (PYTHON_PROC*)&py3_PyObject_IsTrue}, + {"PyLong_FromLong", (PYTHON_PROC*)&py3_PyLong_FromLong}, +*************** +*** 518,523 **** +--- 527,534 ---- + {"PySlice_Type", (PYTHON_PROC*)&py3_PySlice_Type}, + {"PyFloat_Type", (PYTHON_PROC*)&py3_PyFloat_Type}, + {"PyBool_Type", (PYTHON_PROC*)&py3_PyBool_Type}, ++ {"PyNumber_Check", (PYTHON_PROC*)&py3_PyNumber_Check}, ++ {"PyNumber_Long", (PYTHON_PROC*)&py3_PyNumber_Long}, + {"PyErr_NewException", (PYTHON_PROC*)&py3_PyErr_NewException}, + # ifdef Py_DEBUG + {"_Py_NegativeRefcount", (PYTHON_PROC*)&py3__Py_NegativeRefcount}, +*************** +*** 672,677 **** +--- 683,689 ---- + p3imp_PyExc_ValueError = PyDict_GetItemString(exdict, "ValueError"); + p3imp_PyExc_RuntimeError = PyDict_GetItemString(exdict, "RuntimeError"); + p3imp_PyExc_ImportError = PyDict_GetItemString(exdict, "ImportError"); ++ p3imp_PyExc_OverflowError = PyDict_GetItemString(exdict, "OverflowError"); + Py_XINCREF(p3imp_PyExc_AttributeError); + Py_XINCREF(p3imp_PyExc_IndexError); + Py_XINCREF(p3imp_PyExc_KeyError); +*************** +*** 680,685 **** +--- 692,698 ---- + Py_XINCREF(p3imp_PyExc_ValueError); + Py_XINCREF(p3imp_PyExc_RuntimeError); + Py_XINCREF(p3imp_PyExc_ImportError); ++ Py_XINCREF(p3imp_PyExc_OverflowError); + Py_XDECREF(exmod); + } + #endif /* DYNAMIC_PYTHON3 */ +*** ../vim-7.3.1230/src/if_python.c 2013-06-23 13:46:36.000000000 +0200 +--- src/if_python.c 2013-06-23 14:15:25.000000000 +0200 +*************** +*** 220,225 **** +--- 220,226 ---- + # define PyObject_CallFunctionObjArgs dll_PyObject_CallFunctionObjArgs + # define PyObject_CallFunction dll_PyObject_CallFunction + # define PyObject_Call dll_PyObject_Call ++ # define PyObject_Repr dll_PyObject_Repr + # define PyString_AsString dll_PyString_AsString + # define PyString_AsStringAndSize dll_PyString_AsStringAndSize + # define PyString_FromString dll_PyString_FromString +*************** +*** 233,238 **** +--- 234,241 ---- + # define PyFloat_AsDouble dll_PyFloat_AsDouble + # define PyFloat_FromDouble dll_PyFloat_FromDouble + # define PyFloat_Type (*dll_PyFloat_Type) ++ # define PyNumber_Check dll_PyNumber_Check ++ # define PyNumber_Long dll_PyNumber_Long + # define PyImport_AddModule (*dll_PyImport_AddModule) + # define PySys_SetObject dll_PySys_SetObject + # define PySys_GetObject dll_PySys_GetObject +*************** +*** 360,365 **** +--- 363,369 ---- + static PyObject* (*dll_PyObject_CallFunctionObjArgs)(PyObject *, ...); + static PyObject* (*dll_PyObject_CallFunction)(PyObject *, char *, ...); + static PyObject* (*dll_PyObject_Call)(PyObject *, PyObject *, PyObject *); ++ static PyObject* (*dll_PyObject_Repr)(PyObject *); + static char*(*dll_PyString_AsString)(PyObject *); + static int(*dll_PyString_AsStringAndSize)(PyObject *, char **, int *); + static PyObject*(*dll_PyString_FromString)(const char *); +*************** +*** 372,377 **** +--- 376,383 ---- + static double(*dll_PyFloat_AsDouble)(PyObject *); + static PyObject*(*dll_PyFloat_FromDouble)(double); + static PyTypeObject* dll_PyFloat_Type; ++ static int(*dll_PyNumber_Check)(PyObject *); ++ static PyObject*(*dll_PyNumber_Long)(PyObject *); + static int(*dll_PySys_SetObject)(char *, PyObject *); + static PyObject *(*dll_PySys_GetObject)(char *); + static int(*dll_PySys_SetArgv)(int, char **); +*************** +*** 440,445 **** +--- 446,452 ---- + static PyObject *imp_PyExc_ValueError; + static PyObject *imp_PyExc_RuntimeError; + static PyObject *imp_PyExc_ImportError; ++ static PyObject *imp_PyExc_OverflowError; + + # define PyExc_AttributeError imp_PyExc_AttributeError + # define PyExc_IndexError imp_PyExc_IndexError +*************** +*** 449,454 **** +--- 456,462 ---- + # define PyExc_ValueError imp_PyExc_ValueError + # define PyExc_RuntimeError imp_PyExc_RuntimeError + # define PyExc_ImportError imp_PyExc_ImportError ++ # define PyExc_OverflowError imp_PyExc_OverflowError + + /* + * Table of name to function pointer of python. +*************** +*** 533,538 **** +--- 541,547 ---- + {"PyObject_CallFunctionObjArgs", (PYTHON_PROC*)&dll_PyObject_CallFunctionObjArgs}, + {"PyObject_CallFunction", (PYTHON_PROC*)&dll_PyObject_CallFunction}, + {"PyObject_Call", (PYTHON_PROC*)&dll_PyObject_Call}, ++ {"PyObject_Repr", (PYTHON_PROC*)&dll_PyObject_Repr}, + {"PyString_AsString", (PYTHON_PROC*)&dll_PyString_AsString}, + {"PyString_AsStringAndSize", (PYTHON_PROC*)&dll_PyString_AsStringAndSize}, + {"PyString_FromString", (PYTHON_PROC*)&dll_PyString_FromString}, +*************** +*** 545,550 **** +--- 554,561 ---- + {"PyFloat_AsDouble", (PYTHON_PROC*)&dll_PyFloat_AsDouble}, + {"PyFloat_FromDouble", (PYTHON_PROC*)&dll_PyFloat_FromDouble}, + {"PyImport_AddModule", (PYTHON_PROC*)&dll_PyImport_AddModule}, ++ {"PyNumber_Check", (PYTHON_PROC*)&dll_PyNumber_Check}, ++ {"PyNumber_Long", (PYTHON_PROC*)&dll_PyNumber_Long}, + {"PySys_SetObject", (PYTHON_PROC*)&dll_PySys_SetObject}, + {"PySys_GetObject", (PYTHON_PROC*)&dll_PySys_GetObject}, + {"PySys_SetArgv", (PYTHON_PROC*)&dll_PySys_SetArgv}, +*************** +*** 722,727 **** +--- 733,739 ---- + imp_PyExc_ValueError = PyDict_GetItemString(exdict, "ValueError"); + imp_PyExc_RuntimeError = PyDict_GetItemString(exdict, "RuntimeError"); + imp_PyExc_ImportError = PyDict_GetItemString(exdict, "ImportError"); ++ imp_PyExc_OverflowError = PyDict_GetItemString(exdict, "OverflowError"); + Py_XINCREF(imp_PyExc_AttributeError); + Py_XINCREF(imp_PyExc_IndexError); + Py_XINCREF(imp_PyExc_KeyError); +*************** +*** 730,735 **** +--- 742,748 ---- + Py_XINCREF(imp_PyExc_ValueError); + Py_XINCREF(imp_PyExc_RuntimeError); + Py_XINCREF(imp_PyExc_ImportError); ++ Py_XINCREF(imp_PyExc_OverflowError); + Py_XDECREF(exmod); + } + #endif /* DYNAMIC_PYTHON */ +*** ../vim-7.3.1230/src/testdir/test86.ok 2013-06-23 13:46:36.000000000 +0200 +--- src/testdir/test86.ok 2013-06-23 14:15:25.000000000 +0200 +*************** +*** 438,444 **** + > Output + >> OutputSetattr + del sys.stdout.softspace:AttributeError:("can't delete OutputObject attributes",) +! sys.stdout.softspace = []:TypeError:('softspace must be an integer',) + sys.stdout.attr = None:AttributeError:('invalid attribute: attr',) + >> OutputWrite + sys.stdout.write(None):TypeError:('coercing to Unicode: need string or buffer, NoneType found',) +--- 438,444 ---- + > Output + >> OutputSetattr + del sys.stdout.softspace:AttributeError:("can't delete OutputObject attributes",) +! sys.stdout.softspace = []:TypeError:('expected int(), long() or something supporting coercing to long(), but got list',) + sys.stdout.attr = None:AttributeError:('invalid attribute: attr',) + >> OutputWrite + sys.stdout.write(None):TypeError:('coercing to Unicode: need string or buffer, NoneType found',) +*************** +*** 1037,1044 **** + vim.current.window.buffer = 0:TypeError:('readonly attribute: buffer',) + vim.current.window.cursor = (100000000, 100000000):error:('cursor position outside buffer',) + vim.current.window.cursor = True:TypeError:('argument must be 2-item sequence, not bool',) +! vim.current.window.height = "abc":TypeError:('an integer is required',) +! vim.current.window.width = "abc":TypeError:('an integer is required',) + vim.current.window.xxxxxx = True:AttributeError:('xxxxxx',) + > WinList + >> WinListItem +--- 1037,1044 ---- + vim.current.window.buffer = 0:TypeError:('readonly attribute: buffer',) + vim.current.window.cursor = (100000000, 100000000):error:('cursor position outside buffer',) + vim.current.window.cursor = True:TypeError:('argument must be 2-item sequence, not bool',) +! vim.current.window.height = "abc":TypeError:('expected int(), long() or something supporting coercing to long(), but got str',) +! vim.current.window.width = "abc":TypeError:('expected int(), long() or something supporting coercing to long(), but got str',) + vim.current.window.xxxxxx = True:AttributeError:('xxxxxx',) + > WinList + >> WinListItem +*************** +*** 1072,1078 **** + vim.current.buffer.range(1, 2, 3):TypeError:('function takes exactly 2 arguments (3 given)',) + > BufMap + >> BufMapItem +! vim.buffers[None]:TypeError:('key must be integer',) + vim.buffers[100000000]:KeyError:(100000000,) + > Current + >> CurrentGetattr +--- 1072,1078 ---- + vim.current.buffer.range(1, 2, 3):TypeError:('function takes exactly 2 arguments (3 given)',) + > BufMap + >> BufMapItem +! vim.buffers[None]:TypeError:('expected int(), long() or something supporting coercing to long(), but got NoneType',) + vim.buffers[100000000]:KeyError:(100000000,) + > Current + >> CurrentGetattr +*** ../vim-7.3.1230/src/testdir/test87.ok 2013-06-23 13:46:36.000000000 +0200 +--- src/testdir/test87.ok 2013-06-23 14:15:25.000000000 +0200 +*************** +*** 427,433 **** + > Output + >> OutputSetattr + del sys.stdout.softspace:(, AttributeError("can't delete OutputObject attributes",)) +! sys.stdout.softspace = []:(, TypeError('softspace must be an integer',)) + sys.stdout.attr = None:(, AttributeError('invalid attribute: attr',)) + >> OutputWrite + sys.stdout.write(None):(, TypeError("Can't convert 'NoneType' object to str implicitly",)) +--- 427,433 ---- + > Output + >> OutputSetattr + del sys.stdout.softspace:(, AttributeError("can't delete OutputObject attributes",)) +! sys.stdout.softspace = []:(, TypeError('expected int() or something supporting coercing to int(), but got list',)) + sys.stdout.attr = None:(, AttributeError('invalid attribute: attr',)) + >> OutputWrite + sys.stdout.write(None):(, TypeError("Can't convert 'NoneType' object to str implicitly",)) +*************** +*** 1046,1053 **** + vim.current.window.buffer = 0:(, TypeError('readonly attribute: buffer',)) + vim.current.window.cursor = (100000000, 100000000):(, error('cursor position outside buffer',)) + vim.current.window.cursor = True:(, TypeError('argument must be 2-item sequence, not bool',)) +! vim.current.window.height = "abc":(, TypeError('an integer is required',)) +! vim.current.window.width = "abc":(, TypeError('an integer is required',)) + vim.current.window.xxxxxx = True:(, AttributeError('xxxxxx',)) + > WinList + >> WinListItem +--- 1046,1053 ---- + vim.current.window.buffer = 0:(, TypeError('readonly attribute: buffer',)) + vim.current.window.cursor = (100000000, 100000000):(, error('cursor position outside buffer',)) + vim.current.window.cursor = True:(, TypeError('argument must be 2-item sequence, not bool',)) +! vim.current.window.height = "abc":(, TypeError('expected int() or something supporting coercing to int(), but got str',)) +! vim.current.window.width = "abc":(, TypeError('expected int() or something supporting coercing to int(), but got str',)) + vim.current.window.xxxxxx = True:(, AttributeError('xxxxxx',)) + > WinList + >> WinListItem +*************** +*** 1081,1087 **** + vim.current.buffer.range(1, 2, 3):(, TypeError('function takes exactly 2 arguments (3 given)',)) + > BufMap + >> BufMapItem +! vim.buffers[None]:(, TypeError('key must be integer',)) + vim.buffers[100000000]:(, KeyError(100000000,)) + > Current + >> CurrentGetattr +--- 1081,1087 ---- + vim.current.buffer.range(1, 2, 3):(, TypeError('function takes exactly 2 arguments (3 given)',)) + > BufMap + >> BufMapItem +! vim.buffers[None]:(, TypeError('expected int() or something supporting coercing to int(), but got NoneType',)) + vim.buffers[100000000]:(, KeyError(100000000,)) + > Current + >> CurrentGetattr +*** ../vim-7.3.1230/src/version.c 2013-06-23 13:46:36.000000000 +0200 +--- src/version.c 2013-06-23 14:13:45.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1231, + /**/ + +-- +MAN: Fetchez la vache! +GUARD: Quoi? +MAN: Fetchez la vache! + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// 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 /// diff --git a/7.3.1232 b/7.3.1232 new file mode 100644 index 0000000..5cf35f8 --- /dev/null +++ b/7.3.1232 @@ -0,0 +1,2562 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1232 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1232 +Problem: Python: inconsistencies in variable names. +Solution: Rename variables. (ZyX) +Files: src/eval.c, src/if_py_both.h + + +*** ../vim-7.3.1231/src/eval.c 2013-06-16 17:32:33.000000000 +0200 +--- src/eval.c 2013-06-23 14:29:13.000000000 +0200 +*************** +*** 3228,3234 **** + void *fi_void; + char_u *arg; + { +! forinfo_T *fi = (forinfo_T *)fi_void; + int result; + listitem_T *item; + +--- 3228,3234 ---- + void *fi_void; + char_u *arg; + { +! forinfo_T *fi = (forinfo_T *)fi_void; + int result; + listitem_T *item; + +*** ../vim-7.3.1231/src/if_py_both.h 2013-06-23 14:16:53.000000000 +0200 +--- src/if_py_both.h 2013-06-23 14:29:13.000000000 +0200 +*************** +*** 107,134 **** + * Use Py_XDECREF to decrement reference count. + */ + static char_u * +! StringToChars(PyObject *object, PyObject **todecref) + { +! char_u *p; + +! if (PyBytes_Check(object)) + { + +! if (PyBytes_AsStringAndSize(object, (char **) &p, NULL) == -1 +! || p == NULL) + return NULL; + + *todecref = NULL; + } +! else if (PyUnicode_Check(object)) + { + PyObject *bytes; + +! if (!(bytes = PyUnicode_AsEncodedString(object, ENC_OPT, NULL))) + return NULL; + +! if(PyBytes_AsStringAndSize(bytes, (char **) &p, NULL) == -1 +! || p == NULL) + { + Py_DECREF(bytes); + return NULL; +--- 107,134 ---- + * Use Py_XDECREF to decrement reference count. + */ + static char_u * +! StringToChars(PyObject *obj, PyObject **todecref) + { +! char_u *str; + +! if (PyBytes_Check(obj)) + { + +! if (PyBytes_AsStringAndSize(obj, (char **) &str, NULL) == -1 +! || str == NULL) + return NULL; + + *todecref = NULL; + } +! else if (PyUnicode_Check(obj)) + { + PyObject *bytes; + +! if (!(bytes = PyUnicode_AsEncodedString(obj, ENC_OPT, NULL))) + return NULL; + +! if(PyBytes_AsStringAndSize(bytes, (char **) &str, NULL) == -1 +! || str == NULL) + { + Py_DECREF(bytes); + return NULL; +*************** +*** 144,154 **** + #else + "expected bytes() or str() instance, but got %s" + #endif +! , Py_TYPE_NAME(object)); + return NULL; + } + +! return (char_u *) p; + } + + #define NUMBER_LONG 1 +--- 144,154 ---- + #else + "expected bytes() or str() instance, but got %s" + #endif +! , Py_TYPE_NAME(obj)); + return NULL; + } + +! return (char_u *) str; + } + + #define NUMBER_LONG 1 +*************** +*** 263,297 **** + { + PyMethodDef *method; + char **attr; +! PyObject *r; + +! if (!(r = PyList_New(0))) + return NULL; + + if (self) + for (method = self->ob_type->tp_methods ; method->ml_name != NULL ; ++method) +! if (add_string(r, (char *) method->ml_name)) + { +! Py_DECREF(r); + return NULL; + } + + for (attr = attributes ; *attr ; ++attr) +! if (add_string(r, *attr)) + { +! Py_DECREF(r); + return NULL; + } + + #if PY_MAJOR_VERSION < 3 +! if (add_string(r, "__members__")) + { +! Py_DECREF(r); + return NULL; + } + #endif + +! return r; + } + + /* Output buffer management +--- 263,297 ---- + { + PyMethodDef *method; + char **attr; +! PyObject *ret; + +! if (!(ret = PyList_New(0))) + return NULL; + + if (self) + for (method = self->ob_type->tp_methods ; method->ml_name != NULL ; ++method) +! if (add_string(ret, (char *) method->ml_name)) + { +! Py_DECREF(ret); + return NULL; + } + + for (attr = attributes ; *attr ; ++attr) +! if (add_string(ret, *attr)) + { +! Py_DECREF(ret); + return NULL; + } + + #if PY_MAJOR_VERSION < 3 +! if (add_string(ret, "__members__")) + { +! Py_DECREF(ret); + return NULL; + } + #endif + +! return ret; + } + + /* Output buffer management +*************** +*** 321,329 **** + } + + static int +! OutputSetattr(OutputObject *self, char *name, PyObject *val) + { +! if (val == NULL) + { + PyErr_SET_STRING(PyExc_AttributeError, + "can't delete OutputObject attributes"); +--- 321,329 ---- + } + + static int +! OutputSetattr(OutputObject *self, char *name, PyObject *valObject) + { +! if (valObject == NULL) + { + PyErr_SET_STRING(PyExc_AttributeError, + "can't delete OutputObject attributes"); +*************** +*** 332,338 **** + + if (strcmp(name, "softspace") == 0) + { +! if (NumberToLong(val, &(self->softspace), NUMBER_UNSIGNED)) + return -1; + return 0; + } +--- 332,338 ---- + + if (strcmp(name, "softspace") == 0) + { +! if (NumberToLong(valObject, &(self->softspace), NUMBER_UNSIGNED)) + return -1; + return 0; + } +*************** +*** 518,527 **** + static PyObject * + LoaderLoadModule(LoaderObject *self, PyObject *args UNUSED) + { +! PyObject *r = self->module; + +! Py_INCREF(r); +! return r; + } + + static struct PyMethodDef LoaderMethods[] = { +--- 518,527 ---- + static PyObject * + LoaderLoadModule(LoaderObject *self, PyObject *args UNUSED) + { +! PyObject *ret = self->module; + +! Py_INCREF(ret); +! return ret; + } + + static struct PyMethodDef LoaderMethods[] = { +*************** +*** 579,585 **** + VimCommand(PyObject *self UNUSED, PyObject *string) + { + char_u *cmd; +! PyObject *result; + PyObject *todecref; + + if (!(cmd = StringToChars(string, &todecref))) +--- 579,585 ---- + VimCommand(PyObject *self UNUSED, PyObject *string) + { + char_u *cmd; +! PyObject *ret; + PyObject *todecref; + + if (!(cmd = StringToChars(string, &todecref))) +*************** +*** 596,608 **** + Py_END_ALLOW_THREADS + + if (VimTryEnd()) +! result = NULL; + else +! result = Py_None; + +! Py_XINCREF(result); + Py_XDECREF(todecref); +! return result; + } + + /* +--- 596,608 ---- + Py_END_ALLOW_THREADS + + if (VimTryEnd()) +! ret = NULL; + else +! ret = Py_None; + +! Py_XINCREF(ret); + Py_XDECREF(todecref); +! return ret; + } + + /* +*************** +*** 615,621 **** + static PyObject * + VimToPython(typval_T *our_tv, int depth, PyObject *lookup_dict) + { +! PyObject *result; + PyObject *newObj; + char ptrBuf[sizeof(void *) * 2 + 3]; + +--- 615,621 ---- + static PyObject * + VimToPython(typval_T *our_tv, int depth, PyObject *lookup_dict) + { +! PyObject *ret; + PyObject *newObj; + char ptrBuf[sizeof(void *) * 2 + 3]; + +*************** +*** 623,630 **** + if (depth > 100) + { + Py_INCREF(Py_None); +! result = Py_None; +! return result; + } + + /* Check if we run into a recursive loop. The item must be in lookup_dict +--- 623,630 ---- + if (depth > 100) + { + Py_INCREF(Py_None); +! ret = Py_None; +! return ret; + } + + /* Check if we run into a recursive loop. The item must be in lookup_dict +*************** +*** 636,650 **** + our_tv->v_type == VAR_LIST ? (void *)our_tv->vval.v_list + : (void *)our_tv->vval.v_dict); + +! if ((result = PyDict_GetItemString(lookup_dict, ptrBuf))) + { +! Py_INCREF(result); +! return result; + } + } + + if (our_tv->v_type == VAR_STRING) +! result = PyString_FromString(our_tv->vval.v_string == NULL + ? "" : (char *)our_tv->vval.v_string); + else if (our_tv->v_type == VAR_NUMBER) + { +--- 636,650 ---- + our_tv->v_type == VAR_LIST ? (void *)our_tv->vval.v_list + : (void *)our_tv->vval.v_dict); + +! if ((ret = PyDict_GetItemString(lookup_dict, ptrBuf))) + { +! Py_INCREF(ret); +! return ret; + } + } + + if (our_tv->v_type == VAR_STRING) +! ret = PyString_FromString(our_tv->vval.v_string == NULL + ? "" : (char *)our_tv->vval.v_string); + else if (our_tv->v_type == VAR_NUMBER) + { +*************** +*** 652,658 **** + + /* For backwards compatibility numbers are stored as strings. */ + sprintf(buf, "%ld", (long)our_tv->vval.v_number); +! result = PyString_FromString((char *) buf); + } + # ifdef FEAT_FLOAT + else if (our_tv->v_type == VAR_FLOAT) +--- 652,658 ---- + + /* For backwards compatibility numbers are stored as strings. */ + sprintf(buf, "%ld", (long)our_tv->vval.v_number); +! ret = PyString_FromString((char *) buf); + } + # ifdef FEAT_FLOAT + else if (our_tv->v_type == VAR_FLOAT) +*************** +*** 660,666 **** + char buf[NUMBUFLEN]; + + sprintf(buf, "%f", our_tv->vval.v_float); +! result = PyString_FromString((char *) buf); + } + # endif + else if (our_tv->v_type == VAR_LIST) +--- 660,666 ---- + char buf[NUMBUFLEN]; + + sprintf(buf, "%f", our_tv->vval.v_float); +! ret = PyString_FromString((char *) buf); + } + # endif + else if (our_tv->v_type == VAR_LIST) +*************** +*** 671,682 **** + if (list == NULL) + return NULL; + +! if (!(result = PyList_New(0))) + return NULL; + +! if (PyDict_SetItemString(lookup_dict, ptrBuf, result)) + { +! Py_DECREF(result); + return NULL; + } + +--- 671,682 ---- + if (list == NULL) + return NULL; + +! if (!(ret = PyList_New(0))) + return NULL; + +! if (PyDict_SetItemString(lookup_dict, ptrBuf, ret)) + { +! Py_DECREF(ret); + return NULL; + } + +*************** +*** 684,696 **** + { + if (!(newObj = VimToPython(&curr->li_tv, depth + 1, lookup_dict))) + { +! Py_DECREF(result); + return NULL; + } +! if (PyList_Append(result, newObj)) + { + Py_DECREF(newObj); +! Py_DECREF(result); + return NULL; + } + Py_DECREF(newObj); +--- 684,696 ---- + { + if (!(newObj = VimToPython(&curr->li_tv, depth + 1, lookup_dict))) + { +! Py_DECREF(ret); + return NULL; + } +! if (PyList_Append(ret, newObj)) + { + Py_DECREF(newObj); +! Py_DECREF(ret); + return NULL; + } + Py_DECREF(newObj); +*************** +*** 706,717 **** + if (our_tv->vval.v_dict == NULL) + return NULL; + +! if (!(result = PyDict_New())) + return NULL; + +! if (PyDict_SetItemString(lookup_dict, ptrBuf, result)) + { +! Py_DECREF(result); + return NULL; + } + +--- 706,717 ---- + if (our_tv->vval.v_dict == NULL) + return NULL; + +! if (!(ret = PyDict_New())) + return NULL; + +! if (PyDict_SetItemString(lookup_dict, ptrBuf, ret)) + { +! Py_DECREF(ret); + return NULL; + } + +*************** +*** 724,735 **** + di = dict_lookup(hi); + if (!(newObj = VimToPython(&di->di_tv, depth + 1, lookup_dict))) + { +! Py_DECREF(result); + return NULL; + } +! if (PyDict_SetItemString(result, (char *)hi->hi_key, newObj)) + { +! Py_DECREF(result); + Py_DECREF(newObj); + return NULL; + } +--- 724,735 ---- + di = dict_lookup(hi); + if (!(newObj = VimToPython(&di->di_tv, depth + 1, lookup_dict))) + { +! Py_DECREF(ret); + return NULL; + } +! if (PyDict_SetItemString(ret, (char *)hi->hi_key, newObj)) + { +! Py_DECREF(ret); + Py_DECREF(newObj); + return NULL; + } +*************** +*** 739,748 **** + else + { + Py_INCREF(Py_None); +! result = Py_None; + } + +! return result; + } + + static PyObject * +--- 739,748 ---- + else + { + Py_INCREF(Py_None); +! ret = Py_None; + } + +! return ret; + } + + static PyObject * +*************** +*** 752,758 **** + typval_T *our_tv; + PyObject *string; + PyObject *todecref; +! PyObject *result; + PyObject *lookup_dict; + + if (!PyArg_ParseTuple(args, "O", &string)) +--- 752,758 ---- + typval_T *our_tv; + PyObject *string; + PyObject *todecref; +! PyObject *ret; + PyObject *lookup_dict; + + if (!PyArg_ParseTuple(args, "O", &string)) +*************** +*** 782,791 **** + /* Convert the Vim type into a Python type. Create a dictionary that's + * used to check for recursive loops. */ + if (!(lookup_dict = PyDict_New())) +! result = NULL; + else + { +! result = VimToPython(our_tv, 1, lookup_dict); + Py_DECREF(lookup_dict); + } + +--- 782,791 ---- + /* Convert the Vim type into a Python type. Create a dictionary that's + * used to check for recursive loops. */ + if (!(lookup_dict = PyDict_New())) +! ret = NULL; + else + { +! ret = VimToPython(our_tv, 1, lookup_dict); + Py_DECREF(lookup_dict); + } + +*************** +*** 796,802 **** + Python_Release_Vim(); + Py_END_ALLOW_THREADS + +! return result; + } + + static PyObject *ConvertToPyObject(typval_T *); +--- 796,802 ---- + Python_Release_Vim(); + Py_END_ALLOW_THREADS + +! return ret; + } + + static PyObject *ConvertToPyObject(typval_T *); +*************** +*** 805,811 **** + VimEvalPy(PyObject *self UNUSED, PyObject *string) + { + typval_T *our_tv; +! PyObject *result; + char_u *expr; + PyObject *todecref; + +--- 805,811 ---- + VimEvalPy(PyObject *self UNUSED, PyObject *string) + { + typval_T *our_tv; +! PyObject *ret; + char_u *expr; + PyObject *todecref; + +*************** +*** 830,843 **** + return NULL; + } + +! result = ConvertToPyObject(our_tv); + Py_BEGIN_ALLOW_THREADS + Python_Lock_Vim(); + free_tv(our_tv); + Python_Release_Vim(); + Py_END_ALLOW_THREADS + +! return result; + } + + static PyObject * +--- 830,843 ---- + return NULL; + } + +! ret = ConvertToPyObject(our_tv); + Py_BEGIN_ALLOW_THREADS + Python_Lock_Vim(); + free_tv(our_tv); + Python_Release_Vim(); + Py_END_ALLOW_THREADS + +! return ret; + } + + static PyObject * +*************** +*** 845,888 **** + { + char_u *str; + PyObject *todecref; +! int result; + + if (!(str = StringToChars(string, &todecref))) + return NULL; + + #ifdef FEAT_MBYTE +! result = mb_string2cells(str, (int)STRLEN(str)); + #else +! result = STRLEN(str); + #endif + + Py_XDECREF(todecref); + +! return PyLong_FromLong(result); + } + + static PyObject * + _VimChdir(PyObject *_chdir, PyObject *args, PyObject *kwargs) + { +! PyObject *r; + PyObject *newwd; + PyObject *todecref; + char_u *new_dir; + + if (_chdir == NULL) + return NULL; +! if (!(r = PyObject_Call(_chdir, args, kwargs))) + return NULL; + + if (!(newwd = PyObject_CallFunctionObjArgs(py_getcwd, NULL))) + { +! Py_DECREF(r); + return NULL; + } + + if (!(new_dir = StringToChars(newwd, &todecref))) + { +! Py_DECREF(r); + Py_DECREF(newwd); + return NULL; + } +--- 845,888 ---- + { + char_u *str; + PyObject *todecref; +! int len; + + if (!(str = StringToChars(string, &todecref))) + return NULL; + + #ifdef FEAT_MBYTE +! len = mb_string2cells(str, (int)STRLEN(str)); + #else +! len = STRLEN(str); + #endif + + Py_XDECREF(todecref); + +! return PyLong_FromLong(len); + } + + static PyObject * + _VimChdir(PyObject *_chdir, PyObject *args, PyObject *kwargs) + { +! PyObject *ret; + PyObject *newwd; + PyObject *todecref; + char_u *new_dir; + + if (_chdir == NULL) + return NULL; +! if (!(ret = PyObject_Call(_chdir, args, kwargs))) + return NULL; + + if (!(newwd = PyObject_CallFunctionObjArgs(py_getcwd, NULL))) + { +! Py_DECREF(ret); + return NULL; + } + + if (!(new_dir = StringToChars(newwd, &todecref))) + { +! Py_DECREF(ret); + Py_DECREF(newwd); + return NULL; + } +*************** +*** 891,897 **** + + if (vim_chdir(new_dir)) + { +! Py_DECREF(r); + Py_DECREF(newwd); + Py_XDECREF(todecref); + +--- 891,897 ---- + + if (vim_chdir(new_dir)) + { +! Py_DECREF(ret); + Py_DECREF(newwd); + Py_XDECREF(todecref); + +*************** +*** 909,919 **** + + if (VimTryEnd()) + { +! Py_DECREF(r); + return NULL; + } + +! return r; + } + + static PyObject * +--- 909,919 ---- + + if (VimTryEnd()) + { +! Py_DECREF(ret); + return NULL; + } + +! return ret; + } + + static PyObject * +*************** +*** 1052,1071 **** + static PyObject * + Vim_GetPaths(PyObject *self UNUSED) + { +! PyObject *r; + +! if (!(r = PyList_New(0))) + return NULL; + +! do_in_runtimepath(NULL, FALSE, &map_finder_callback, r); + + if (PyErr_Occurred()) + { +! Py_DECREF(r); + return NULL; + } + +! return r; + } + + static PyObject * +--- 1052,1071 ---- + static PyObject * + Vim_GetPaths(PyObject *self UNUSED) + { +! PyObject *ret; + +! if (!(ret = PyList_New(0))) + return NULL; + +! do_in_runtimepath(NULL, FALSE, &map_finder_callback, ret); + + if (PyErr_Occurred()) + { +! Py_DECREF(ret); + return NULL; + } + +! return ret; + } + + static PyObject * +*************** +*** 1400,1415 **** + static dict_T * + py_dict_alloc(void) + { +! dict_T *r; + +! if (!(r = dict_alloc())) + { + PyErr_NoMemory(); + return NULL; + } +! ++r->dv_refcount; + +! return r; + } + + static PyObject * +--- 1400,1415 ---- + static dict_T * + py_dict_alloc(void) + { +! dict_T *ret; + +! if (!(ret = dict_alloc())) + { + PyErr_NoMemory(); + return NULL; + } +! ++ret->dv_refcount; + +! return ret; + } + + static PyObject * +*************** +*** 1461,1469 **** + } + + static int +! DictionarySetattr(DictionaryObject *self, char *name, PyObject *val) + { +! if (val == NULL) + { + PyErr_SET_STRING(PyExc_AttributeError, + "cannot delete vim.Dictionary attributes"); +--- 1461,1469 ---- + } + + static int +! DictionarySetattr(DictionaryObject *self, char *name, PyObject *valObject) + { +! if (valObject == NULL) + { + PyErr_SET_STRING(PyExc_AttributeError, + "cannot delete vim.Dictionary attributes"); +*************** +*** 1479,1485 **** + } + else + { +! int istrue = PyObject_IsTrue(val); + if (istrue == -1) + return -1; + else if (istrue) +--- 1479,1485 ---- + } + else + { +! int istrue = PyObject_IsTrue(valObject); + if (istrue == -1) + return -1; + else if (istrue) +*************** +*** 1513,1519 **** + { + PyObject *keyObject; + PyObject *defObject = ((flags & DICT_FLAG_NONE_DEFAULT)? Py_None : NULL); +! PyObject *r; + char_u *key; + dictitem_T *di; + dict_T *dict = self->dict; +--- 1513,1519 ---- + { + PyObject *keyObject; + PyObject *defObject = ((flags & DICT_FLAG_NONE_DEFAULT)? Py_None : NULL); +! PyObject *ret; + char_u *key; + dictitem_T *di; + dict_T *dict = self->dict; +*************** +*** 1566,1572 **** + + di = dict_lookup(hi); + +! if (!(r = ConvertToPyObject(&di->di_tv))) + return NULL; + + if (flags & DICT_FLAG_POP) +--- 1566,1572 ---- + + di = dict_lookup(hi); + +! if (!(ret = ConvertToPyObject(&di->di_tv))) + return NULL; + + if (flags & DICT_FLAG_POP) +*************** +*** 1574,1580 **** + if (dict->dv_lock) + { + RAISE_LOCKED_DICTIONARY; +! Py_DECREF(r); + return NULL; + } + +--- 1574,1580 ---- + if (dict->dv_lock) + { + RAISE_LOCKED_DICTIONARY; +! Py_DECREF(ret); + return NULL; + } + +*************** +*** 1582,1588 **** + dictitem_free(di); + } + +! return r; + } + + static PyObject * +--- 1582,1588 ---- + dictitem_free(di); + } + +! return ret; + } + + static PyObject * +*************** +*** 1595,1607 **** + DictionaryContains(DictionaryObject *self, PyObject *keyObject) + { + PyObject *rObj = _DictionaryItem(self, keyObject, DICT_FLAG_RETURN_BOOL); +! int r; + +! r = (rObj == Py_True); + + Py_DECREF(Py_True); + +! return r; + } + + typedef struct +--- 1595,1607 ---- + DictionaryContains(DictionaryObject *self, PyObject *keyObject) + { + PyObject *rObj = _DictionaryItem(self, keyObject, DICT_FLAG_RETURN_BOOL); +! int ret; + +! ret = (rObj == Py_True); + + Py_DECREF(Py_True); + +! return ret; + } + + typedef struct +*************** +*** 1616,1622 **** + static PyObject * + DictionaryIterNext(dictiterinfo_T **dii) + { +! PyObject *r; + + if (!(*dii)->todo) + return NULL; +--- 1616,1622 ---- + static PyObject * + DictionaryIterNext(dictiterinfo_T **dii) + { +! PyObject *ret; + + if (!(*dii)->todo) + return NULL; +*************** +*** 1634,1643 **** + + --((*dii)->todo); + +! if (!(r = PyBytes_FromString((char *) (*dii)->hi->hi_key))) + return NULL; + +! return r; + } + + static PyObject * +--- 1634,1643 ---- + + --((*dii)->todo); + +! if (!(ret = PyBytes_FromString((char *) (*dii)->hi->hi_key))) + return NULL; + +! return ret; + } + + static PyObject * +*************** +*** 1753,1778 **** + dict_T *dict = self->dict; + long_u todo = dict->dv_hashtab.ht_used; + Py_ssize_t i = 0; +! PyObject *r; + hashitem_T *hi; + PyObject *newObj; + +! r = PyList_New(todo); + for (hi = dict->dv_hashtab.ht_array; todo > 0; ++hi) + { + if (!HASHITEM_EMPTY(hi)) + { + if (!(newObj = hiconvert(hi))) + { +! Py_DECREF(r); + return NULL; + } +! PyList_SET_ITEM(r, i, newObj); + --todo; + ++i; + } + } +! return r; + } + + static PyObject * +--- 1753,1778 ---- + dict_T *dict = self->dict; + long_u todo = dict->dv_hashtab.ht_used; + Py_ssize_t i = 0; +! PyObject *ret; + hashitem_T *hi; + PyObject *newObj; + +! ret = PyList_New(todo); + for (hi = dict->dv_hashtab.ht_array; todo > 0; ++hi) + { + if (!HASHITEM_EMPTY(hi)) + { + if (!(newObj = hiconvert(hi))) + { +! Py_DECREF(ret); + return NULL; + } +! PyList_SET_ITEM(ret, i, newObj); + --todo; + ++i; + } + } +! return ret; + } + + static PyObject * +*************** +*** 1807,1813 **** + { + PyObject *keyObject; + PyObject *valObject; +! PyObject *r; + + if (!(keyObject = dict_key(hi))) + return NULL; +--- 1807,1813 ---- + { + PyObject *keyObject; + PyObject *valObject; +! PyObject *ret; + + if (!(keyObject = dict_key(hi))) + return NULL; +*************** +*** 1818,1829 **** + return NULL; + } + +! r = Py_BuildValue("(OO)", keyObject, valObject); + + Py_DECREF(keyObject); + Py_DECREF(valObject); + +! return r; + } + + static PyObject * +--- 1818,1829 ---- + return NULL; + } + +! ret = Py_BuildValue("(OO)", keyObject, valObject); + + Py_DECREF(keyObject); + Py_DECREF(valObject); + +! return ret; + } + + static PyObject * +*************** +*** 1858,1876 **** + } + else + { +! PyObject *object; + +! if (!PyArg_ParseTuple(args, "O", &object)) + return NULL; + +! if (PyObject_HasAttrString(object, "keys")) +! return DictionaryUpdate(self, NULL, object); + else + { + PyObject *iterator; + PyObject *item; + +! if (!(iterator = PyObject_GetIter(object))) + return NULL; + + while ((item = PyIter_Next(iterator))) +--- 1858,1876 ---- + } + else + { +! PyObject *obj; + +! if (!PyArg_ParseTuple(args, "O", &obj)) + return NULL; + +! if (PyObject_HasAttrString(obj, "keys")) +! return DictionaryUpdate(self, NULL, obj); + else + { + PyObject *iterator; + PyObject *item; + +! if (!(iterator = PyObject_GetIter(obj))) + return NULL; + + while ((item = PyIter_Next(iterator))) +*************** +*** 1974,1980 **** + DictionaryPopItem(DictionaryObject *self) + { + hashitem_T *hi; +! PyObject *r; + PyObject *valObject; + dictitem_T *di; + +--- 1974,1980 ---- + DictionaryPopItem(DictionaryObject *self) + { + hashitem_T *hi; +! PyObject *ret; + PyObject *valObject; + dictitem_T *di; + +*************** +*** 1993,1999 **** + if (!(valObject = ConvertToPyObject(&di->di_tv))) + return NULL; + +! if (!(r = Py_BuildValue("(" Py_bytes_fmt "O)", hi->hi_key, valObject))) + { + Py_DECREF(valObject); + return NULL; +--- 1993,1999 ---- + if (!(valObject = ConvertToPyObject(&di->di_tv))) + return NULL; + +! if (!(ret = Py_BuildValue("(" Py_bytes_fmt "O)", hi->hi_key, valObject))) + { + Py_DECREF(valObject); + return NULL; +*************** +*** 2002,2008 **** + hash_remove(&self->dict->dv_hashtab, hi); + dictitem_free(di); + +! return r; + } + + static PyObject * +--- 2002,2008 ---- + hash_remove(&self->dict->dv_hashtab, hi); + dictitem_free(di); + +! return ret; + } + + static PyObject * +*************** +*** 2075,2090 **** + static list_T * + py_list_alloc() + { +! list_T *r; + +! if (!(r = list_alloc())) + { + PyErr_NoMemory(); + return NULL; + } +! ++r->lv_refcount; + +! return r; + } + + static int +--- 2075,2090 ---- + static list_T * + py_list_alloc() + { +! list_T *ret; + +! if (!(ret = list_alloc())) + { + PyErr_NoMemory(); + return NULL; + } +! ++ret->lv_refcount; + +! return ret; + } + + static int +*************** +*** 2272,2288 **** + static PyObject * + ListIterNext(listiterinfo_T **lii) + { +! PyObject *r; + + if (!((*lii)->lw.lw_item)) + return NULL; + +! if (!(r = ConvertToPyObject(&((*lii)->lw.lw_item->li_tv)))) + return NULL; + + (*lii)->lw.lw_item = (*lii)->lw.lw_item->li_next; + +! return r; + } + + static PyObject * +--- 2272,2288 ---- + static PyObject * + ListIterNext(listiterinfo_T **lii) + { +! PyObject *ret; + + if (!((*lii)->lw.lw_item)) + return NULL; + +! if (!(ret = ConvertToPyObject(&((*lii)->lw.lw_item->li_tv)))) + return NULL; + + (*lii)->lw.lw_item = (*lii)->lw.lw_item->li_next; + +! return ret; + } + + static PyObject * +*************** +*** 2319,2325 **** + RAISE_LOCKED_LIST; + return -1; + } +! if (index>length || (index==length && obj==NULL)) + { + PyErr_SET_STRING(PyExc_IndexError, "list index out of range"); + return -1; +--- 2319,2325 ---- + RAISE_LOCKED_LIST; + return -1; + } +! if (index > length || (index == length && obj == NULL)) + { + PyErr_SET_STRING(PyExc_IndexError, "list index out of range"); + return -1; +*************** +*** 2463,2471 **** + } + + static int +! ListSetattr(ListObject *self, char *name, PyObject *val) + { +! if (val == NULL) + { + PyErr_SET_STRING(PyExc_AttributeError, + "cannot delete vim.List attributes"); +--- 2463,2471 ---- + } + + static int +! ListSetattr(ListObject *self, char *name, PyObject *valObject) + { +! if (valObject == NULL) + { + PyErr_SET_STRING(PyExc_AttributeError, + "cannot delete vim.List attributes"); +*************** +*** 2481,2487 **** + } + else + { +! int istrue = PyObject_IsTrue(val); + if (istrue == -1) + return -1; + else if (istrue) +--- 2481,2487 ---- + } + else + { +! int istrue = PyObject_IsTrue(valObject); + if (istrue == -1) + return -1; + else if (istrue) +*************** +*** 2599,2605 **** + typval_T rettv; + dict_T *selfdict = NULL; + PyObject *selfdictObject; +! PyObject *result; + int error; + + if (ConvertFromPyObject(argsObject, &args) == -1) +--- 2599,2605 ---- + typval_T rettv; + dict_T *selfdict = NULL; + PyObject *selfdictObject; +! PyObject *ret; + int error; + + if (ConvertFromPyObject(argsObject, &args) == -1) +*************** +*** 2629,2649 **** + Py_END_ALLOW_THREADS + + if (VimTryEnd()) +! result = NULL; + else if (error != OK) + { +! result = NULL; + PyErr_VIM_FORMAT("failed to run function %s", (char *)name); + } + else +! result = ConvertToPyObject(&rettv); + + clear_tv(&args); + clear_tv(&rettv); + if (selfdict != NULL) + clear_tv(&selfdicttv); + +! return result; + } + + static PyObject * +--- 2629,2649 ---- + Py_END_ALLOW_THREADS + + if (VimTryEnd()) +! ret = NULL; + else if (error != OK) + { +! ret = NULL; + PyErr_VIM_FORMAT("failed to run function %s", (char *)name); + } + else +! ret = ConvertToPyObject(&rettv); + + clear_tv(&args); + clear_tv(&rettv); + if (selfdict != NULL) + clear_tv(&selfdicttv); + +! return ret; + } + + static PyObject * +*************** +*** 2761,2770 **** + } + else if (flags & SOPT_BOOL) + { +! PyObject *r; +! r = numval ? Py_True : Py_False; +! Py_INCREF(r); +! return r; + } + else if (flags & SOPT_NUM) + return PyInt_FromLong(numval); +--- 2761,2770 ---- + } + else if (flags & SOPT_BOOL) + { +! PyObject *ret; +! ret = numval ? Py_True : Py_False; +! Py_INCREF(ret); +! return ret; + } + else if (flags & SOPT_NUM) + return PyInt_FromLong(numval); +*************** +*** 2772,2780 **** + { + if (stringval) + { +! PyObject *r = PyBytes_FromString((char *) stringval); + vim_free(stringval); +! return r; + } + else + { +--- 2772,2780 ---- + { + if (stringval) + { +! PyObject *ret = PyBytes_FromString((char *) stringval); + vim_free(stringval); +! return ret; + } + else + { +*************** +*** 2817,2823 **** + win_T *save_curwin = NULL; + tabpage_T *save_curtab = NULL; + buf_T *save_curbuf = NULL; +! int r = 0; + + VimTryStart(); + switch (opt_type) +--- 2817,2823 ---- + win_T *save_curwin = NULL; + tabpage_T *save_curtab = NULL; + buf_T *save_curbuf = NULL; +! int set_ret = 0; + + VimTryStart(); + switch (opt_type) +*************** +*** 2831,2854 **** + PyErr_SET_VIM("problem while switching windows"); + return -1; + } +! r = set_option_value_err(key, numval, stringval, opt_flags); +! restore_win(save_curwin, save_curtab, FALSE); +! if (r == FAIL) +! return -1; + break; + case SREQ_BUF: + switch_buffer(&save_curbuf, (buf_T *)from); +! r = set_option_value_err(key, numval, stringval, opt_flags); + restore_buffer(save_curbuf); +- if (r == FAIL) +- return -1; + break; + case SREQ_GLOBAL: +! r = set_option_value_err(key, numval, stringval, opt_flags); +! if (r == FAIL) +! return -1; + break; + } + return VimTryEnd(); + } + +--- 2831,2850 ---- + PyErr_SET_VIM("problem while switching windows"); + return -1; + } +! set_ret = set_option_value_err(key, numval, stringval, opt_flags); +! restore_win(save_curwin, save_curtab, TRUE); + break; + case SREQ_BUF: + switch_buffer(&save_curbuf, (buf_T *)from); +! set_ret = set_option_value_err(key, numval, stringval, opt_flags); + restore_buffer(save_curbuf); + break; + case SREQ_GLOBAL: +! set_ret = set_option_value_err(key, numval, stringval, opt_flags); + break; + } ++ if (set_ret == FAIL) ++ return -1; + return VimTryEnd(); + } + +*************** +*** 2858,2864 **** + char_u *key; + int flags; + int opt_flags; +! int r = 0; + PyObject *todecref; + + if (self->Check(self->from)) +--- 2854,2860 ---- + char_u *key; + int flags; + int opt_flags; +! int ret = 0; + PyObject *todecref; + + if (self->Check(self->from)) +*************** +*** 2916,2924 **** + int istrue = PyObject_IsTrue(valObject); + + if (istrue == -1) +! r = -1; + else +! r = set_option_value_for(key, istrue, NULL, + opt_flags, self->opt_type, self->from); + } + else if (flags & SOPT_NUM) +--- 2912,2920 ---- + int istrue = PyObject_IsTrue(valObject); + + if (istrue == -1) +! ret = -1; + else +! ret = set_option_value_for(key, istrue, NULL, + opt_flags, self->opt_type, self->from); + } + else if (flags & SOPT_NUM) +*************** +*** 2931,2954 **** + return -1; + } + +! r = set_option_value_for(key, (int) val, NULL, opt_flags, + self->opt_type, self->from); + } + else + { +! char_u *val; + PyObject *todecref; + + if ((val = StringToChars(valObject, &todecref))) +! r = set_option_value_for(key, 0, val, opt_flags, + self->opt_type, self->from); + else +! r = -1; + } + + Py_XDECREF(todecref); + +! return r; + } + + static PyMappingMethods OptionsAsMapping = { +--- 2927,2950 ---- + return -1; + } + +! ret = set_option_value_for(key, (int) val, NULL, opt_flags, + self->opt_type, self->from); + } + else + { +! char_u *val; + PyObject *todecref; + + if ((val = StringToChars(valObject, &todecref))) +! ret = set_option_value_for(key, 0, val, opt_flags, + self->opt_type, self->from); + else +! ret = -1; + } + + Py_XDECREF(todecref); + +! return ret; + } + + static PyMappingMethods OptionsAsMapping = { +*************** +*** 3027,3040 **** + static PyObject * + TabPageAttrValid(TabPageObject *self, char *name) + { +! PyObject *r; + + if (strcmp(name, "valid") != 0) + return NULL; + +! r = ((self->tab == INVALID_TABPAGE_VALUE) ? Py_False : Py_True); +! Py_INCREF(r); +! return r; + } + + static PyObject * +--- 3023,3036 ---- + static PyObject * + TabPageAttrValid(TabPageObject *self, char *name) + { +! PyObject *ret; + + if (strcmp(name, "valid") != 0) + return NULL; + +! ret = ((self->tab == INVALID_TABPAGE_VALUE) ? Py_False : Py_True); +! Py_INCREF(ret); +! return ret; + } + + static PyObject * +*************** +*** 3243,3256 **** + static PyObject * + WindowAttrValid(WindowObject *self, char *name) + { +! PyObject *r; + + if (strcmp(name, "valid") != 0) + return NULL; + +! r = ((self->win == INVALID_WINDOW_VALUE) ? Py_False : Py_True); +! Py_INCREF(r); +! return r; + } + + static PyObject * +--- 3239,3252 ---- + static PyObject * + WindowAttrValid(WindowObject *self, char *name) + { +! PyObject *ret; + + if (strcmp(name, "valid") != 0) + return NULL; + +! ret = ((self->win == INVALID_WINDOW_VALUE) ? Py_False : Py_True); +! Py_INCREF(ret); +! return ret; + } + + static PyObject * +*************** +*** 3300,3306 **** + } + + static int +! WindowSetattr(WindowObject *self, char *name, PyObject *val) + { + if (CheckWindow(self)) + return -1; +--- 3296,3302 ---- + } + + static int +! WindowSetattr(WindowObject *self, char *name, PyObject *valObject) + { + if (CheckWindow(self)) + return -1; +*************** +*** 3315,3321 **** + long lnum; + long col; + +! if (!PyArg_Parse(val, "(ll)", &lnum, &col)) + return -1; + + if (lnum <= 0 || lnum > self->win->w_buffer->b_ml.ml_line_count) +--- 3311,3317 ---- + long lnum; + long col; + +! if (!PyArg_Parse(valObject, "(ll)", &lnum, &col)) + return -1; + + if (lnum <= 0 || lnum > self->win->w_buffer->b_ml.ml_line_count) +*************** +*** 3344,3350 **** + long height; + win_T *savewin; + +! if (NumberToLong(val, &height, NUMBER_INT)) + return -1; + + #ifdef FEAT_GUI +--- 3340,3346 ---- + long height; + win_T *savewin; + +! if (NumberToLong(valObject, &height, NUMBER_INT)) + return -1; + + #ifdef FEAT_GUI +*************** +*** 3367,3373 **** + long width; + win_T *savewin; + +! if (NumberToLong(val, &width, NUMBER_INT)) + return -1; + + #ifdef FEAT_GUI +--- 3363,3369 ---- + long width; + win_T *savewin; + +! if (NumberToLong(valObject, &width, NUMBER_INT)) + return -1; + + #ifdef FEAT_GUI +*************** +*** 3584,3608 **** + static PyObject * + GetBufferLineList(buf_T *buf, PyInt lo, PyInt hi) + { +! PyInt i; +! PyInt n = hi - lo; +! PyObject *list = PyList_New(n); + + if (list == NULL) + return NULL; + + for (i = 0; i < n; ++i) + { +! PyObject *str = LineToString((char *)ml_get_buf(buf, (linenr_T)(lo+i), FALSE)); + + /* Error check - was the Python string creation OK? */ +! if (str == NULL) + { + Py_DECREF(list); + return NULL; + } + +! PyList_SET_ITEM(list, i, str); + } + + /* The ownership of the Python list is passed to the caller (ie, +--- 3580,3605 ---- + static PyObject * + GetBufferLineList(buf_T *buf, PyInt lo, PyInt hi) + { +! PyInt i; +! PyInt n = hi - lo; +! PyObject *list = PyList_New(n); + + if (list == NULL) + return NULL; + + for (i = 0; i < n; ++i) + { +! PyObject *string = LineToString( +! (char *)ml_get_buf(buf, (linenr_T)(lo+i), FALSE)); + + /* Error check - was the Python string creation OK? */ +! if (string == NULL) + { + Py_DECREF(list); + return NULL; + } + +! PyList_SET_ITEM(list, i, string); + } + + /* The ownership of the Python list is passed to the caller (ie, +*************** +*** 3662,3668 **** + */ + if (line == Py_None || line == NULL) + { +! buf_T *savebuf; + + PyErr_Clear(); + switch_buffer(&savebuf, buf); +--- 3659,3665 ---- + */ + if (line == Py_None || line == NULL) + { +! buf_T *savebuf; + + PyErr_Clear(); + switch_buffer(&savebuf, buf); +*************** +*** 3747,3753 **** + * is set to the change in the buffer length. + */ + static int +! SetBufferLineList(buf_T *buf, PyInt lo, PyInt hi, PyObject *list, PyInt *len_change) + { + /* First of all, we check the type of the supplied Python object. + * There are three cases: +--- 3744,3755 ---- + * is set to the change in the buffer length. + */ + static int +! SetBufferLineList( +! buf_T *buf, +! PyInt lo, +! PyInt hi, +! PyObject *list, +! PyInt *len_change) + { + /* First of all, we check the type of the supplied Python object. + * There are three cases: +*************** +*** 4124,4130 **** + } + + static PyInt +! RBAsItem(BufferObject *self, PyInt n, PyObject *val, PyInt start, PyInt end, PyInt *new_end) + { + PyInt len_change; + +--- 4126,4138 ---- + } + + static PyInt +! RBAsItem( +! BufferObject *self, +! PyInt n, +! PyObject *valObject, +! PyInt start, +! PyInt end, +! PyInt *new_end) + { + PyInt len_change; + +*************** +*** 4143,4149 **** + return -1; + } + +! if (SetBufferLine(self->buf, n+start, val, &len_change) == FAIL) + return -1; + + if (new_end) +--- 4151,4157 ---- + return -1; + } + +! if (SetBufferLine(self->buf, n+start, valObject, &len_change) == FAIL) + return -1; + + if (new_end) +*************** +*** 4153,4159 **** + } + + static PyInt +! RBAsSlice(BufferObject *self, PyInt lo, PyInt hi, PyObject *val, PyInt start, PyInt end, PyInt *new_end) + { + PyInt size; + PyInt len_change; +--- 4161,4174 ---- + } + + static PyInt +! RBAsSlice( +! BufferObject *self, +! PyInt lo, +! PyInt hi, +! PyObject *valObject, +! PyInt start, +! PyInt end, +! PyInt *new_end) + { + PyInt size; + PyInt len_change; +*************** +*** 4180,4186 **** + hi = size; + + if (SetBufferLineList(self->buf, lo + start, hi + start, +! val, &len_change) == FAIL) + return -1; + + if (new_end) +--- 4195,4201 ---- + hi = size; + + if (SetBufferLineList(self->buf, lo + start, hi + start, +! valObject, &len_change) == FAIL) + return -1; + + if (new_end) +*************** +*** 4191,4197 **** + + + static PyObject * +! RBAppend(BufferObject *self, PyObject *args, PyInt start, PyInt end, PyInt *new_end) + { + PyObject *lines; + PyInt len_change; +--- 4206,4217 ---- + + + static PyObject * +! RBAppend( +! BufferObject *self, +! PyObject *args, +! PyInt start, +! PyInt end, +! PyInt *new_end) + { + PyObject *lines; + PyInt len_change; +*************** +*** 4438,4451 **** + static PyObject * + BufferAttrValid(BufferObject *self, char *name) + { +! PyObject *r; + + if (strcmp(name, "valid") != 0) + return NULL; + +! r = ((self->buf == INVALID_BUFFER_VALUE) ? Py_False : Py_True); +! Py_INCREF(r); +! return r; + } + + static PyObject * +--- 4458,4471 ---- + static PyObject * + BufferAttrValid(BufferObject *self, char *name) + { +! PyObject *ret; + + if (strcmp(name, "valid") != 0) + return NULL; + +! ret = ((self->buf == INVALID_BUFFER_VALUE) ? Py_False : Py_True); +! Py_INCREF(ret); +! return ret; + } + + static PyObject * +*************** +*** 4475,4483 **** + + if (strcmp(name, "name") == 0) + { +! char_u *val; + aco_save_T aco; +! int r; + PyObject *todecref; + + if (!(val = StringToChars(valObject, &todecref))) +--- 4495,4503 ---- + + if (strcmp(name, "name") == 0) + { +! char_u *val; + aco_save_T aco; +! int ren_ret; + PyObject *todecref; + + if (!(val = StringToChars(valObject, &todecref))) +*************** +*** 4486,4498 **** + VimTryStart(); + /* Using aucmd_*: autocommands will be executed by rename_buffer */ + aucmd_prepbuf(&aco, self->buf); +! r = rename_buffer(val); + aucmd_restbuf(&aco); + Py_XDECREF(todecref); + if (VimTryEnd()) + return -1; + +! if (r == FAIL) + { + PyErr_SET_VIM("failed to rename buffer"); + return -1; +--- 4506,4518 ---- + VimTryStart(); + /* Using aucmd_*: autocommands will be executed by rename_buffer */ + aucmd_prepbuf(&aco, self->buf); +! ren_ret = rename_buffer(val); + aucmd_restbuf(&aco); + Py_XDECREF(todecref); + if (VimTryEnd()) + return -1; + +! if (ren_ret == FAIL) + { + PyErr_SET_VIM("failed to rename buffer"); + return -1; +*************** +*** 4677,4703 **** + BufMapIterNext(PyObject **buffer) + { + PyObject *next; +! PyObject *r; + + if (!*buffer) + return NULL; + +! r = *buffer; + +! if (CheckBuffer((BufferObject *)(r))) + { + *buffer = NULL; + return NULL; + } + +! if (!((BufferObject *)(r))->buf->b_next) + next = NULL; +! else if (!(next = BufferNew(((BufferObject *)(r))->buf->b_next))) + return NULL; + *buffer = next; + /* Do not increment reference: we no longer hold it (decref), but whoever + * on other side will hold (incref). Decref+incref = nothing. */ +! return r; + } + + static PyObject * +--- 4697,4723 ---- + BufMapIterNext(PyObject **buffer) + { + PyObject *next; +! PyObject *ret; + + if (!*buffer) + return NULL; + +! ret = *buffer; + +! if (CheckBuffer((BufferObject *)(ret))) + { + *buffer = NULL; + return NULL; + } + +! if (!((BufferObject *)(ret))->buf->b_next) + next = NULL; +! else if (!(next = BufferNew(((BufferObject *)(ret))->buf->b_next))) + return NULL; + *buffer = next; + /* Do not increment reference: we no longer hold it (decref), but whoever + * on other side will hold (incref). Decref+incref = nothing. */ +! return ret; + } + + static PyObject * +*************** +*** 4755,4765 **** + } + + static int +! CurrentSetattr(PyObject *self UNUSED, char *name, PyObject *value) + { + if (strcmp(name, "line") == 0) + { +! if (SetBufferLine(curbuf, (PyInt)curwin->w_cursor.lnum, value, NULL) == FAIL) + return -1; + + return 0; +--- 4775,4786 ---- + } + + static int +! CurrentSetattr(PyObject *self UNUSED, char *name, PyObject *valObject) + { + if (strcmp(name, "line") == 0) + { +! if (SetBufferLine(curbuf, (PyInt)curwin->w_cursor.lnum, valObject, +! NULL) == FAIL) + return -1; + + return 0; +*************** +*** 4768,4784 **** + { + int count; + +! if (value->ob_type != &BufferType) + { + PyErr_FORMAT(PyExc_TypeError, + "expected vim.Buffer object, but got %s", +! Py_TYPE_NAME(value)); + return -1; + } + +! if (CheckBuffer((BufferObject *)(value))) + return -1; +! count = ((BufferObject *)(value))->buf->b_fnum; + + VimTryStart(); + if (do_buffer(DOBUF_GOTO, DOBUF_FIRST, FORWARD, count, 0) == FAIL) +--- 4789,4805 ---- + { + int count; + +! if (valObject->ob_type != &BufferType) + { + PyErr_FORMAT(PyExc_TypeError, + "expected vim.Buffer object, but got %s", +! Py_TYPE_NAME(valObject)); + return -1; + } + +! if (CheckBuffer((BufferObject *)(valObject))) + return -1; +! count = ((BufferObject *)(valObject))->buf->b_fnum; + + VimTryStart(); + if (do_buffer(DOBUF_GOTO, DOBUF_FIRST, FORWARD, count, 0) == FAIL) +*************** +*** 4795,4811 **** + { + int count; + +! if (value->ob_type != &WindowType) + { + PyErr_FORMAT(PyExc_TypeError, + "expected vim.Window object, but got %s", +! Py_TYPE_NAME(value)); + return -1; + } + +! if (CheckWindow((WindowObject *)(value))) + return -1; +! count = get_win_number(((WindowObject *)(value))->win, firstwin); + + if (!count) + { +--- 4816,4832 ---- + { + int count; + +! if (valObject->ob_type != &WindowType) + { + PyErr_FORMAT(PyExc_TypeError, + "expected vim.Window object, but got %s", +! Py_TYPE_NAME(valObject)); + return -1; + } + +! if (CheckWindow((WindowObject *)(valObject))) + return -1; +! count = get_win_number(((WindowObject *)(valObject))->win, firstwin); + + if (!count) + { +*************** +*** 4815,4822 **** + } + + VimTryStart(); +! win_goto(((WindowObject *)(value))->win); +! if (((WindowObject *)(value))->win != curwin) + { + if (VimTryEnd()) + return -1; +--- 4836,4843 ---- + } + + VimTryStart(); +! win_goto(((WindowObject *)(valObject))->win); +! if (((WindowObject *)(valObject))->win != curwin) + { + if (VimTryEnd()) + return -1; +*************** +*** 4829,4848 **** + } + else if (strcmp(name, "tabpage") == 0) + { +! if (value->ob_type != &TabPageType) + { + PyErr_FORMAT(PyExc_TypeError, + "expected vim.TabPage object, but got %s", +! Py_TYPE_NAME(value)); + return -1; + } + +! if (CheckTabPage((TabPageObject *)(value))) + return -1; + + VimTryStart(); +! goto_tabpage_tp(((TabPageObject *)(value))->tab, TRUE, TRUE); +! if (((TabPageObject *)(value))->tab != curtab) + { + if (VimTryEnd()) + return -1; +--- 4850,4869 ---- + } + else if (strcmp(name, "tabpage") == 0) + { +! if (valObject->ob_type != &TabPageType) + { + PyErr_FORMAT(PyExc_TypeError, + "expected vim.TabPage object, but got %s", +! Py_TYPE_NAME(valObject)); + return -1; + } + +! if (CheckTabPage((TabPageObject *)(valObject))) + return -1; + + VimTryStart(); +! goto_tabpage_tp(((TabPageObject *)(valObject))->tab, TRUE, TRUE); +! if (((TabPageObject *)(valObject))->tab != curtab) + { + if (VimTryEnd()) + return -1; +*************** +*** 4934,4940 **** + + for (lnum = RangeStart; lnum <= RangeEnd; ++lnum) + { +! PyObject *line, *linenr, *ret; + + #ifdef PY_CAN_RECURSE + *pygilstate = PyGILState_Ensure(); +--- 4955,4963 ---- + + for (lnum = RangeStart; lnum <= RangeEnd; ++lnum) + { +! PyObject *line; +! PyObject *linenr; +! PyObject *ret; + + #ifdef PY_CAN_RECURSE + *pygilstate = PyGILState_Ensure(); +*************** +*** 4990,4999 **** + #endif + ) + { +! PyObject *r; + +! r = PyRun_String((char *) cmd, Py_eval_input, globals, globals); +! if (r == NULL) + { + if (PyErr_Occurred() && !msg_silent) + PyErr_PrintEx(0); +--- 5013,5022 ---- + #endif + ) + { +! PyObject *run_ret; + +! run_ret = PyRun_String((char *) cmd, Py_eval_input, globals, globals); +! if (run_ret == NULL) + { + if (PyErr_Occurred() && !msg_silent) + PyErr_PrintEx(0); +*************** +*** 5001,5009 **** + } + else + { +! if (ConvertFromPyObject(r, rettv) == -1) + EMSG(_("E859: Failed to convert returned python object to vim value")); +! Py_DECREF(r); + } + PyErr_Clear(); + } +--- 5024,5032 ---- + } + else + { +! if (ConvertFromPyObject(run_ret, rettv) == -1) + EMSG(_("E859: Failed to convert returned python object to vim value")); +! Py_DECREF(run_ret); + } + PyErr_Clear(); + } +*************** +*** 5306,5312 **** + ConvertFromPyMapping(PyObject *obj, typval_T *tv) + { + PyObject *lookup_dict; +! int r; + + if (!(lookup_dict = PyDict_New())) + return -1; +--- 5329,5335 ---- + ConvertFromPyMapping(PyObject *obj, typval_T *tv) + { + PyObject *lookup_dict; +! int ret; + + if (!(lookup_dict = PyDict_New())) + return -1; +*************** +*** 5316,5349 **** + tv->v_type = VAR_DICT; + tv->vval.v_dict = (((DictionaryObject *)(obj))->dict); + ++tv->vval.v_dict->dv_refcount; +! r = 0; + } + else if (PyDict_Check(obj)) +! r = convert_dl(obj, tv, pydict_to_tv, lookup_dict); + else if (PyMapping_Check(obj)) +! r = convert_dl(obj, tv, pymap_to_tv, lookup_dict); + else + { + PyErr_FORMAT(PyExc_TypeError, + "unable to convert %s to vim dictionary", + Py_TYPE_NAME(obj)); +! r = -1; + } + Py_DECREF(lookup_dict); +! return r; + } + + static int + ConvertFromPyObject(PyObject *obj, typval_T *tv) + { + PyObject *lookup_dict; +! int r; + + if (!(lookup_dict = PyDict_New())) + return -1; +! r = _ConvertFromPyObject(obj, tv, lookup_dict); + Py_DECREF(lookup_dict); +! return r; + } + + static int +--- 5339,5372 ---- + tv->v_type = VAR_DICT; + tv->vval.v_dict = (((DictionaryObject *)(obj))->dict); + ++tv->vval.v_dict->dv_refcount; +! ret = 0; + } + else if (PyDict_Check(obj)) +! ret = convert_dl(obj, tv, pydict_to_tv, lookup_dict); + else if (PyMapping_Check(obj)) +! ret = convert_dl(obj, tv, pymap_to_tv, lookup_dict); + else + { + PyErr_FORMAT(PyExc_TypeError, + "unable to convert %s to vim dictionary", + Py_TYPE_NAME(obj)); +! ret = -1; + } + Py_DECREF(lookup_dict); +! return ret; + } + + static int + ConvertFromPyObject(PyObject *obj, typval_T *tv) + { + PyObject *lookup_dict; +! int ret; + + if (!(lookup_dict = PyDict_New())) + return -1; +! ret = _ConvertFromPyObject(obj, tv, lookup_dict); + Py_DECREF(lookup_dict); +! return ret; + } + + static int +*************** +*** 5371,5384 **** + } + else if (PyBytes_Check(obj)) + { +! char_u *result; + +! if (PyBytes_AsStringAndSize(obj, (char **) &result, NULL) == -1) + return -1; +! if (result == NULL) + return -1; + +! if (set_string_copy(result, tv) == -1) + return -1; + + tv->v_type = VAR_STRING; +--- 5394,5407 ---- + } + else if (PyBytes_Check(obj)) + { +! char_u *str; + +! if (PyBytes_AsStringAndSize(obj, (char **) &str, NULL) == -1) + return -1; +! if (str == NULL) + return -1; + +! if (set_string_copy(str, tv) == -1) + return -1; + + tv->v_type = VAR_STRING; +*************** +*** 5386,5403 **** + else if (PyUnicode_Check(obj)) + { + PyObject *bytes; +! char_u *result; + + bytes = PyUnicode_AsEncodedString(obj, ENC_OPT, NULL); + if (bytes == NULL) + return -1; + +! if(PyBytes_AsStringAndSize(bytes, (char **) &result, NULL) == -1) + return -1; +! if (result == NULL) + return -1; + +! if (set_string_copy(result, tv)) + { + Py_XDECREF(bytes); + return -1; +--- 5409,5426 ---- + else if (PyUnicode_Check(obj)) + { + PyObject *bytes; +! char_u *str; + + bytes = PyUnicode_AsEncodedString(obj, ENC_OPT, NULL); + if (bytes == NULL) + return -1; + +! if(PyBytes_AsStringAndSize(bytes, (char **) &str, NULL) == -1) + return -1; +! if (str == NULL) + return -1; + +! if (set_string_copy(str, tv)) + { + Py_XDECREF(bytes); + return -1; +*************** +*** 5852,5858 **** + + static struct numeric_constant { + char *name; +! int value; + } numeric_constants[] = { + {"VAR_LOCKED", VAR_LOCKED}, + {"VAR_FIXED", VAR_FIXED}, +--- 5875,5881 ---- + + static struct numeric_constant { + char *name; +! int val; + } numeric_constants[] = { + {"VAR_LOCKED", VAR_LOCKED}, + {"VAR_FIXED", VAR_FIXED}, +*************** +*** 5862,5868 **** + + static struct object_constant { + char *name; +! PyObject *value; + } object_constants[] = { + {"buffers", (PyObject *)(void *)&TheBufferMap}, + {"windows", (PyObject *)(void *)&TheWindowList}, +--- 5885,5891 ---- + + static struct object_constant { + char *name; +! PyObject *valObject; + } object_constants[] = { + {"buffers", (PyObject *)(void *)&TheBufferMap}, + {"windows", (PyObject *)(void *)&TheWindowList}, +*************** +*** 5889,5898 **** + + #define ADD_CHECKED_OBJECT(m, name, obj) \ + { \ +! PyObject *value = obj; \ +! if (!value) \ + return -1; \ +! ADD_OBJECT(m, name, value); \ + } + + static int +--- 5912,5921 ---- + + #define ADD_CHECKED_OBJECT(m, name, obj) \ + { \ +! PyObject *valObject = obj; \ +! if (!valObject) \ + return -1; \ +! ADD_OBJECT(m, name, valObject); \ + } + + static int +*************** +*** 5907,5923 **** + / sizeof(struct numeric_constant)); + ++i) + ADD_CHECKED_OBJECT(m, numeric_constants[i].name, +! PyInt_FromLong(numeric_constants[i].value)); + + for (i = 0; i < (int)(sizeof(object_constants) + / sizeof(struct object_constant)); + ++i) + { +! PyObject *value; + +! value = object_constants[i].value; +! Py_INCREF(value); +! ADD_OBJECT(m, object_constants[i].name, value); + } + + if (!(VimError = PyErr_NewException("vim.error", NULL, NULL))) +--- 5930,5946 ---- + / sizeof(struct numeric_constant)); + ++i) + ADD_CHECKED_OBJECT(m, numeric_constants[i].name, +! PyInt_FromLong(numeric_constants[i].val)); + + for (i = 0; i < (int)(sizeof(object_constants) + / sizeof(struct object_constant)); + ++i) + { +! PyObject *valObject; + +! valObject = object_constants[i].valObject; +! Py_INCREF(valObject); +! ADD_OBJECT(m, object_constants[i].name, valObject); + } + + if (!(VimError = PyErr_NewException("vim.error", NULL, NULL))) +*** ../vim-7.3.1231/src/version.c 2013-06-23 14:16:53.000000000 +0200 +--- src/version.c 2013-06-23 14:27:07.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1232, + /**/ + +-- +Ten bugs in the hand is better than one as yet undetected. + + /// 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 /// diff --git a/7.3.1233 b/7.3.1233 new file mode 100644 index 0000000..eede8af --- /dev/null +++ b/7.3.1233 @@ -0,0 +1,3829 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1233 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1233 +Problem: Various Python problems. +Solution: Fix VimTryEnd. Crash with debug build and PYTHONDUMPREFS=1. Memory + leaks in StringToLine(), BufferMark() and convert_dl. (ZyX) +Files: src/if_py_both.h, src/testdir/test86.in, src/testdir/test86.ok, + src/testdir/test87.in, src/testdir/test87.ok + + +*** ../vim-7.3.1232/src/if_py_both.h 2013-06-23 14:30:42.000000000 +0200 +--- src/if_py_both.h 2013-06-23 14:34:17.000000000 +0200 +*************** +*** 544,563 **** + VimTryEnd(void) + { + --trylevel; + if (got_int) + { + PyErr_SetNone(PyExc_KeyboardInterrupt); +! return 1; + } + else if (!did_throw) +! return 0; + else if (PyErr_Occurred()) +! return 1; + else + { + PyErr_SetVim((char *) current_exception->value); + discard_current_exception(); +! return 1; + } + } + +--- 544,573 ---- + VimTryEnd(void) + { + --trylevel; ++ /* Without this it stops processing all subsequent VimL commands and ++ * generates strange error messages if I e.g. try calling Test() in a cycle */ ++ did_emsg = FALSE; ++ /* Keyboard interrupt should be preferred over anything else */ + if (got_int) + { ++ did_throw = got_int = FALSE; + PyErr_SetNone(PyExc_KeyboardInterrupt); +! return -1; + } + else if (!did_throw) +! return (PyErr_Occurred() ? -1 : 0); +! /* Python exception is preferred over vim one; unlikely to occur though */ + else if (PyErr_Occurred()) +! { +! did_throw = FALSE; +! return -1; +! } +! /* Finally transform VimL exception to python one */ + else + { + PyErr_SetVim((char *) current_exception->value); + discard_current_exception(); +! return -1; + } + } + +*************** +*** 2649,2655 **** + static PyObject * + FunctionRepr(FunctionObject *self) + { +! return PyString_FromFormat("", self->name); + } + + static struct PyMethodDef FunctionMethods[] = { +--- 2659,2672 ---- + static PyObject * + FunctionRepr(FunctionObject *self) + { +! #ifdef Py_TRACE_REFS +! /* For unknown reason self->name may be NULL after calling +! * Finalize */ +! return PyString_FromFormat("", +! (self->name == NULL ? "" : (char *) self->name)); +! #else +! return PyString_FromFormat("", (char *) self->name); +! #endif + } + + static struct PyMethodDef FunctionMethods[] = { +*************** +*** 3534,3539 **** +--- 3551,3557 ---- + else + { + PyErr_SET_VIM("string cannot contain newlines"); ++ Py_XDECREF(bytes); + return NULL; + } + } +*************** +*** 3545,3550 **** +--- 3563,3569 ---- + if (save == NULL) + { + PyErr_NoMemory(); ++ Py_XDECREF(bytes); + return NULL; + } + +*************** +*** 4551,4556 **** +--- 4570,4576 ---- + { + PyErr_SET_STRING(PyExc_ValueError, + "mark name must be a single character"); ++ Py_XDECREF(todecref); + return NULL; + } + +*************** +*** 5298,5303 **** +--- 5318,5326 ---- + tv->v_type = VAR_UNKNOWN; + return -1; + } ++ ++ Py_DECREF(capsule); ++ + if (py_to_tv(obj, tv, lookup_dict) == -1) + { + tv->v_type = VAR_UNKNOWN; +*************** +*** 5378,5390 **** + tv->vval.v_dict = (((DictionaryObject *)(obj))->dict); + ++tv->vval.v_dict->dv_refcount; + } +! else if (obj->ob_type == &ListType) + { + tv->v_type = VAR_LIST; + tv->vval.v_list = (((ListObject *)(obj))->list); + ++tv->vval.v_list->lv_refcount; + } +! else if (obj->ob_type == &FunctionType) + { + if (set_string_copy(((FunctionObject *) (obj))->name, tv) == -1) + return -1; +--- 5401,5413 ---- + tv->vval.v_dict = (((DictionaryObject *)(obj))->dict); + ++tv->vval.v_dict->dv_refcount; + } +! else if (PyType_IsSubtype(obj->ob_type, &ListType)) + { + tv->v_type = VAR_LIST; + tv->vval.v_list = (((ListObject *)(obj))->list); + ++tv->vval.v_list->lv_refcount; + } +! else if (PyType_IsSubtype(obj->ob_type, &FunctionType)) + { + if (set_string_copy(((FunctionObject *) (obj))->name, tv) == -1) + return -1; +*** ../vim-7.3.1232/src/testdir/test86.in 2013-06-12 14:26:20.000000000 +0200 +--- src/testdir/test86.in 2013-06-23 14:34:17.000000000 +0200 +*************** +*** 11,18 **** + :set noswapfile + :if !has('python') | e! test.ok | wq! test.out | endif + :lang C +- :py import vim + :fun Test() + :let l = [] + :py l=vim.bindeval('l') + :py f=vim.bindeval('function("strlen")') +--- 11,18 ---- + :set noswapfile + :if !has('python') | e! test.ok | wq! test.out | endif + :lang C + :fun Test() ++ :py import vim + :let l = [] + :py l=vim.bindeval('l') + :py f=vim.bindeval('function("strlen")') +*************** +*** 58,63 **** +--- 58,66 ---- + : $put =string(key) . ' : ' . string(Val) + : unlet key Val + :endfor ++ :py del dk ++ :py del di ++ :py del dv + :" + :" removing items with del + :py del l[2] +*************** +*** 176,187 **** + :unlockvar! l + :" + :" Function calls +! :function New(...) +! :return ['NewStart']+a:000+['NewEnd'] +! :endfunction +! :function DictNew(...) dict +! :return ['DictNewStart']+a:000+['DictNewEnd', self] +! :endfunction + :let l=[function('New'), function('DictNew')] + :py l=vim.bindeval('l') + :py l.extend(list(l[0](1, 2, 3))) +--- 179,190 ---- + :unlockvar! l + :" + :" Function calls +! :fun New(...) +! : return ['NewStart']+a:000+['NewEnd'] +! :endfun +! :fun DictNew(...) dict +! : return ['DictNewStart']+a:000+['DictNewEnd', self] +! :endfun + :let l=[function('New'), function('DictNew')] + :py l=vim.bindeval('l') + :py l.extend(list(l[0](1, 2, 3))) +*************** +*** 211,216 **** +--- 214,220 ---- + : $put ='[0.0, 0.0]' + :endif + :let messages=[] ++ :delfunction DictNew + py < 8 # check if the background thread is working ++ :py del time ++ :py del threading + :$put =string(l) + :" + :" settrace +*************** +*** 333,338 **** +--- 342,349 ---- + EOF + :py sys.settrace(traceit) + :py trace_main() ++ :py del traceit ++ :py del trace_main + :py sys.settrace(None) + :$put =string(l) + :" +*************** +*** 363,369 **** + :" + :" Vars + :let g:foo = 'bac' +! :let w:abc = 'def' + :let b:baz = 'bar' + :let t:bar = 'jkl' + :try +--- 374,380 ---- + :" + :" Vars + :let g:foo = 'bac' +! :let w:abc3 = 'def' + :let b:baz = 'bar' + :let t:bar = 'jkl' + :try +*************** +*** 372,378 **** + : put =pyeval('vim.vvars[''exception'']') + :endtry + :put =pyeval('vim.vars[''foo'']') +! :put =pyeval('vim.current.window.vars[''abc'']') + :put =pyeval('vim.current.buffer.vars[''baz'']') + :put =pyeval('vim.current.tabpage.vars[''bar'']') + :" +--- 383,389 ---- + : put =pyeval('vim.vvars[''exception'']') + :endtry + :put =pyeval('vim.vars[''foo'']') +! :put =pyeval('vim.current.window.vars[''abc3'']') + :put =pyeval('vim.current.buffer.vars[''baz'']') + :put =pyeval('vim.current.tabpage.vars[''bar'']') + :" +*************** +*** 420,435 **** + vim.command('let exc=' + repr(sys.exc_type.__name__)) + return 0 + EOF +! :function E(s) + : python e(vim.eval('a:s')) +! :endfunction +! :function Ev(s) + : let r=pyeval('ev(vim.eval("a:s"))') + : if exists('exc') + : throw exc + : endif + : return r +! :endfunction + :py gopts1=vim.options + :py wopts1=vim.windows[2].options + :py wopts2=vim.windows[0].options +--- 431,446 ---- + vim.command('let exc=' + repr(sys.exc_type.__name__)) + return 0 + EOF +! :fun E(s) + : python e(vim.eval('a:s')) +! :endfun +! :fun Ev(s) + : let r=pyeval('ev(vim.eval("a:s"))') + : if exists('exc') + : throw exc + : endif + : return r +! :endfun + :py gopts1=vim.options + :py wopts1=vim.windows[2].options + :py wopts2=vim.windows[0].options +*************** +*** 444,450 **** + :let lst+=[['operatorfunc', 'A', 'B', 'C', 2, 0, 1, 0 ]] + :let lst+=[['number', 0, 1, 1, 0, 1, 0, 1 ]] + :let lst+=[['numberwidth', 2, 3, 5, -100, 0, 0, 1 ]] +! :let lst+=[['colorcolumn', '+1', '+2', '+3', 'abc', 0, 0, 1 ]] + :let lst+=[['statusline', '1', '2', '4', 0, 0, 1, 1 ]] + :let lst+=[['autoindent', 0, 1, 1, 2, 1, 0, 2 ]] + :let lst+=[['shiftwidth', 0, 2, 1, 3, 0, 0, 2 ]] +--- 455,461 ---- + :let lst+=[['operatorfunc', 'A', 'B', 'C', 2, 0, 1, 0 ]] + :let lst+=[['number', 0, 1, 1, 0, 1, 0, 1 ]] + :let lst+=[['numberwidth', 2, 3, 5, -100, 0, 0, 1 ]] +! :let lst+=[['colorcolumn', '+1', '+2', '+3', 'abc4', 0, 0, 1 ]] + :let lst+=[['statusline', '1', '2', '4', 0, 0, 1, 1 ]] + :let lst+=[['autoindent', 0, 1, 1, 2, 1, 0, 2 ]] + :let lst+=[['shiftwidth', 0, 2, 1, 3, 0, 0, 2 ]] +*************** +*** 494,503 **** +--- 505,531 ---- + : endfor + : call RecVars(oname) + :endfor ++ :delfunction RecVars ++ :delfunction E ++ :delfunction Ev ++ :py del ev ++ :py del e + :only + :for buf in g:bufs[1:] + : execute 'bwipeout!' buf + :endfor ++ :py del gopts1 ++ :py del wopts1 ++ :py del wopts2 ++ :py del wopts3 ++ :py del bopts1 ++ :py del bopts2 ++ :py del bopts3 ++ :py del oval1 ++ :py del oval2 ++ :py del oval3 ++ :py del oname ++ :py del invval + :" + :" Test buffer object + :vnew +*************** +*** 517,523 **** + # Tests BufferAppend and BufferItem + cb.append(b[0]) + # Tests BufferSlice and BufferAssSlice +! cb.append('abc') # Will be overwritten + cb[-1:] = b[:-2] + # Test BufferLength and BufferAssSlice + cb.append('def') # Will not be overwritten +--- 545,551 ---- + # Tests BufferAppend and BufferItem + cb.append(b[0]) + # Tests BufferSlice and BufferAssSlice +! cb.append('abc5') # Will be overwritten + cb[-1:] = b[:-2] + # Test BufferLength and BufferAssSlice + cb.append('def') # Will not be overwritten +*************** +*** 541,553 **** + cb.append(b.name[-11:].replace(os.path.sep, '/')) + cb.name = old_name + cb.append(cb.name[-17:].replace(os.path.sep, '/')) + # Test CheckBuffer + for _b in vim.buffers: + if _b is not cb: + vim.command('bwipeout! ' + str(_b.number)) + del _b + cb.append('valid: b:%s, cb:%s' % (repr(b.valid), repr(cb.valid))) +! for expr in ('b[1]','b[:] = ["A", "B"]','b[:]','b.append("abc")', 'b.name = "!"'): + try: + exec(expr) + except vim.error: +--- 569,582 ---- + cb.append(b.name[-11:].replace(os.path.sep, '/')) + cb.name = old_name + cb.append(cb.name[-17:].replace(os.path.sep, '/')) ++ del old_name + # Test CheckBuffer + for _b in vim.buffers: + if _b is not cb: + vim.command('bwipeout! ' + str(_b.number)) + del _b + cb.append('valid: b:%s, cb:%s' % (repr(b.valid), repr(cb.valid))) +! for expr in ('b[1]','b[:] = ["A", "B"]','b[:]','b.append("abc6")', 'b.name = "!"'): + try: + exec(expr) + except vim.error: +*************** +*** 557,562 **** +--- 586,592 ---- + # Should not happen in any case + cb.append('No exception for ' + expr) + vim.command('cd .') ++ del b + EOF + :augroup BUFS + : autocmd! +*************** +*** 598,603 **** +--- 628,634 ---- + # Check indexing: vim.buffers[number].number == number + cb.append(str(b.number) + ':' + repr(vim.buffers[b.number]) + '=' + repr(b)) + prevnum = b.number ++ del prevnum + + cb.append(str(len(vim.buffers))) + +*************** +*** 621,626 **** +--- 652,659 ---- + next(i4) + except StopIteration: + cb.append('StopIteration') ++ del i4 ++ del bnums + EOF + :" + :" Test vim.{tabpage,window}list and vim.{tabpage,window} objects +*************** +*** 663,669 **** +--- 696,706 ---- + raise ValueError + except Exception: + cb.append('!!!!!! Error while getting attribute ' + attr + ': ' + sys.exc_type.__name__) ++ del aval ++ del attr + w.cursor = (len(w.buffer), 0) ++ del W ++ del Cursor + cb.append('Number of windows in current tab page: ' + str(len(vim.windows))) + if list(vim.windows) != list(vim.current.tabpage.windows): + cb.append('!!!!!! Windows differ') +*************** +*** 676,681 **** +--- 713,719 ---- + cb.append('Current tab page: ' + repr(vim.current.tabpage)) + cb.append('Current window: ' + repr(vim.current.window) + ': ' + H(vim.current.window) + ' is ' + H(vim.current.tabpage.window)) + cb.append('Current buffer: ' + repr(vim.current.buffer) + ': ' + H(vim.current.buffer) + ' is ' + H(vim.current.window.buffer)+ ' is ' + H(vim.current.tabpage.window.buffer)) ++ del H + # Assigning: fails + try: + vim.current.window = vim.tabpages[0].window +*************** +*** 687,692 **** +--- 725,731 ---- + setattr(vim.current, attr, None) + except TypeError: + cb.append('Type error at assigning None to vim.current.' + attr) ++ del attr + + # Assigning: success + vim.current.tabpage = vim.tabpages[-2] +*************** +*** 702,709 **** +--- 741,753 ---- + for b in vim.buffers: + if b is not cb: + vim.command('bwipeout! ' + str(b.number)) ++ del b + cb.append('w.valid: ' + repr([w.valid for w in ws])) + cb.append('t.valid: ' + repr([t.valid for t in ts])) ++ del w ++ del t ++ del ts ++ del ws + EOF + :tabonly! + :only! +*************** +*** 722,727 **** +--- 766,773 ---- + ('vim.current.tabpage', 'TabPage'), + ): + cb.append(expr + ':' + attr + ':' + repr(type(eval(expr)) is getattr(vim, attr))) ++ del expr ++ del attr + EOF + :" + :" Test __dir__() method +*************** +*** 747,761 **** + :$put =string(pyeval('vim.Dictionary(a=1)')) + :$put =string(pyeval('vim.Dictionary(((''a'', 1),))')) + :$put =string(pyeval('vim.List()')) +! :$put =string(pyeval('vim.List(iter(''abc''))')) + :$put =string(pyeval('vim.Function(''tr'')')) + :" + :" Test stdout/stderr + :redir => messages +! :py sys.stdout.write('abc') ; sys.stdout.write('def') +! :py sys.stderr.write('abc') ; sys.stderr.write('def') +! :py sys.stdout.writelines(iter('abc')) +! :py sys.stderr.writelines(iter('abc')) + :redir END + :$put =string(substitute(messages, '\d\+', '', 'g')) + :" Test subclassing +--- 793,807 ---- + :$put =string(pyeval('vim.Dictionary(a=1)')) + :$put =string(pyeval('vim.Dictionary(((''a'', 1),))')) + :$put =string(pyeval('vim.List()')) +! :$put =string(pyeval('vim.List(iter(''abc7''))')) + :$put =string(pyeval('vim.Function(''tr'')')) + :" + :" Test stdout/stderr + :redir => messages +! :py sys.stdout.write('abc8') ; sys.stdout.write('def') +! :py sys.stderr.write('abc9') ; sys.stderr.write('def') +! :py sys.stdout.writelines(iter('abcA')) +! :py sys.stderr.writelines(iter('abcB')) + :redir END + :$put =string(substitute(messages, '\d\+', '', 'g')) + :" Test subclassing +*************** +*** 776,782 **** + return [super(DupList, self).__getitem__(idx)] * 2 + + dl = DupList() +! dl2 = DupList(iter('abc')) + dl.extend(dl2[0]) + + class DupFun(vim.Function): +--- 822,828 ---- + return [super(DupList, self).__getitem__(idx)] * 2 + + dl = DupList() +! dl2 = DupList(iter('abcC')) + dl.extend(dl2[0]) + + class DupFun(vim.Function): +*************** +*** 789,794 **** +--- 835,853 ---- + :$put =string(pyeval('dl')) + :$put =string(pyeval('dl2')) + :$put =string(pyeval('df(2)')) ++ :$put =string(pyeval('dl') is# pyeval('dl')) ++ :$put =string(pyeval('dd') is# pyeval('dd')) ++ :$put =string(pyeval('df')) ++ :delfunction Put ++ py << EOF ++ del DupDict ++ del DupList ++ del DupFun ++ del dd ++ del dl ++ del dl2 ++ del df ++ EOF + :" + :" Test chdir + py << EOF +*************** +*** 802,807 **** +--- 861,867 ---- + os.chdir('testdir') + cb.append(fnamemodify('.', ':p:h:t')) + cb.append(vim.eval('@%')) ++ del fnamemodify + EOF + :" + :" Test errors +*************** +*** 828,838 **** + else: + cb.append(expr + ':NOT FAILED') + d = vim.Dictionary() +! ned = vim.Dictionary(foo='bar', baz='abc') + dl = vim.Dictionary(a=1) + dl.locked = True + l = vim.List() +! ll = vim.List('abc') + ll.locked = True + f = vim.Function('string') + fd = vim.Function('F') +--- 888,898 ---- + else: + cb.append(expr + ':NOT FAILED') + d = vim.Dictionary() +! ned = vim.Dictionary(foo='bar', baz='abcD') + dl = vim.Dictionary(a=1) + dl.locked = True + l = vim.List() +! ll = vim.List('abcE') + ll.locked = True + f = vim.Function('string') + fd = vim.Function('F') +*************** +*** 869,879 **** + # pydict_to_tv + stringtochars_test(expr % '{%s : 1}') + if recurse: +! convertfrompyobject_test(expr % '{"abc" : %s}', False) + # pymap_to_tv + stringtochars_test(expr % 'Mapping({%s : 1})') + if recurse: +! convertfrompyobject_test(expr % 'Mapping({"abc" : %s})', False) + # pyseq_to_tv + iter_test(expr) + return subexpr_test(expr, 'ConvertFromPyObject', ( +--- 929,939 ---- + # pydict_to_tv + stringtochars_test(expr % '{%s : 1}') + if recurse: +! convertfrompyobject_test(expr % '{"abcF" : %s}', False) + # pymap_to_tv + stringtochars_test(expr % 'Mapping({%s : 1})') + if recurse: +! convertfrompyobject_test(expr % 'Mapping({"abcG" : %s})', False) + # pyseq_to_tv + iter_test(expr) + return subexpr_test(expr, 'ConvertFromPyObject', ( +*************** +*** 916,922 **** + raise NotImplementedError + + def keys(self): +! return list("abc") + + class FailingMapping(object): + def __getitem__(self): +--- 976,982 ---- + raise NotImplementedError + + def keys(self): +! return list("abcH") + + class FailingMapping(object): + def __getitem__(self): +*************** +*** 958,964 **** + ee('vim.strwidth(1)') + cb.append("> Dictionary") + cb.append(">> DictionaryConstructor") +! ee('vim.Dictionary("abc")') + ##! Not checked: py_dict_alloc failure + cb.append(">> DictionarySetattr") + ee('del d.locked') +--- 1018,1024 ---- + ee('vim.strwidth(1)') + cb.append("> Dictionary") + cb.append(">> DictionaryConstructor") +! ee('vim.Dictionary("abcI")') + ##! Not checked: py_dict_alloc failure + cb.append(">> DictionarySetattr") + ee('del d.locked') +*************** +*** 973,978 **** +--- 1033,1039 ---- + ee('dl.pop("a")') + cb.append(">> DictionaryIterNext") + ee('for i in ned: ned["a"] = 1') ++ del i + cb.append(">> DictionaryAssItem") + ee('dl["b"] = 1') + stringtochars_test('d[%s] = 1') +*************** +*** 1002,1008 **** + ee('ll[1] = 2') + ee('l[1000] = 3') + cb.append(">> ListAssSlice") +! ee('ll[1:100] = "abc"') + #iter_test('l[:] = %s') + convertfrompyobject_test('l[:] = [%s]') + cb.append(">> ListConcatInPlace") +--- 1063,1069 ---- + ee('ll[1] = 2') + ee('l[1000] = 3') + cb.append(">> ListAssSlice") +! ee('ll[1:100] = "abcJ"') + #iter_test('l[:] = %s') + convertfrompyobject_test('l[:] = [%s]') + cb.append(">> ListConcatInPlace") +*************** +*** 1033,1040 **** + ee('vim.current.window.buffer = 0') + ee('vim.current.window.cursor = (100000000, 100000000)') + ee('vim.current.window.cursor = True') +! ee('vim.current.window.height = "abc"') +! ee('vim.current.window.width = "abc"') + ee('vim.current.window.xxxxxx = True') + cb.append("> WinList") + cb.append(">> WinListItem") +--- 1094,1101 ---- + ee('vim.current.window.buffer = 0') + ee('vim.current.window.cursor = (100000000, 100000000)') + ee('vim.current.window.cursor = True') +! ee('vim.current.window.height = "abcK"') +! ee('vim.current.window.width = "abcL"') + ee('vim.current.window.xxxxxx = True') + cb.append("> WinList") + cb.append(">> WinListItem") +*************** +*** 1044,1050 **** + ee('vim.current.buffer[0] = "\\na"') + cb.append(">> SetBufferLine (indirect)") + ee('vim.current.buffer[0] = True') +! cb.append(">> SetBufferLines (indirect)") + ee('vim.current.buffer[:] = True') + ee('vim.current.buffer[:] = ["\\na", "bc"]') + cb.append(">> InsertBufferLines (indirect)") +--- 1105,1111 ---- + ee('vim.current.buffer[0] = "\\na"') + cb.append(">> SetBufferLine (indirect)") + ee('vim.current.buffer[0] = True') +! cb.append(">> SetBufferLineList (indirect)") + ee('vim.current.buffer[:] = True') + ee('vim.current.buffer[:] = ["\\na", "bc"]') + cb.append(">> InsertBufferLines (indirect)") +*************** +*** 1062,1068 **** + ee('vim.current.buffer.xxx = True') + cb.append(">> BufferMark") + ee('vim.current.buffer.mark(0)') +! ee('vim.current.buffer.mark("abc")') + ee('vim.current.buffer.mark("!")') + cb.append(">> BufferRange") + ee('vim.current.buffer.range(1, 2, 3)') +--- 1123,1129 ---- + ee('vim.current.buffer.xxx = True') + cb.append(">> BufferMark") + ee('vim.current.buffer.mark(0)') +! ee('vim.current.buffer.mark("abcM")') + ee('vim.current.buffer.mark("!")') + cb.append(">> BufferRange") + ee('vim.current.buffer.range(1, 2, 3)') +*************** +*** 1079,1085 **** +--- 1140,1167 ---- + ee('vim.current.window = True') + ee('vim.current.tabpage = True') + ee('vim.current.xxx = True') ++ del d ++ del ned ++ del dl ++ del l ++ del ll ++ del f ++ del fd ++ del fdel ++ del subexpr_test ++ del stringtochars_test ++ del Mapping ++ del convertfrompyobject_test ++ del convertfrompymapping_test ++ del iter_test ++ del FailingTrue ++ del FailingIter ++ del FailingIterNext ++ del FailingMapping ++ del FailingMappingKey ++ del FailingList + EOF ++ :delfunction F + :" + :" Test import + py << EOF +*************** +*** 1093,1098 **** +--- 1175,1184 ---- + cb.append(before.dir) + import after + cb.append(after.dir) ++ del before ++ del after ++ del d ++ del ddir + EOF + :" + :" Test exceptions +*************** +*** 1101,1118 **** + :endfun + py << EOF + Exe = vim.bindeval('function("Exe")') +! ee('vim.command("throw \'abc\'")') + ee('Exe("throw \'def\'")') + ee('vim.eval("Exe(\'throw \'\'ghi\'\'\')")') + ee('vim.eval("Exe(\'echoerr \'\'jkl\'\'\')")') + ee('vim.eval("Exe(\'xxx_non_existent_command_xxx\')")') + ee('vim.bindeval("Exe(\'xxx_non_existent_command_xxx\')")') + EOF + :endfun + :" +! :call Test() + :" +! :delfunc Test + :call garbagecollect(1) + :" + :/^start:/,$wq! test.out +--- 1187,1234 ---- + :endfun + py << EOF + Exe = vim.bindeval('function("Exe")') +! ee('vim.command("throw \'abcN\'")') + ee('Exe("throw \'def\'")') + ee('vim.eval("Exe(\'throw \'\'ghi\'\'\')")') + ee('vim.eval("Exe(\'echoerr \'\'jkl\'\'\')")') + ee('vim.eval("Exe(\'xxx_non_existent_command_xxx\')")') + ee('vim.bindeval("Exe(\'xxx_non_existent_command_xxx\')")') ++ del Exe ++ EOF ++ :delfunction Exe ++ :" ++ :" Cleanup ++ py << EOF ++ del cb ++ del ee ++ del sys ++ del os ++ del vim + EOF + :endfun + :" +! :fun RunTest() +! :let checkrefs = !empty($PYTHONDUMPREFS) +! :let start = getline(1, '$') +! :for i in range(checkrefs ? 10 : 1) +! : if i != 0 +! : %d _ +! : call setline(1, start) +! : endif +! : call Test() +! : if i == 0 +! : let result = getline(1, '$') +! : endif +! :endfor +! :if checkrefs +! : %d _ +! : call setline(1, result) +! :endif +! :endfun + :" +! :call RunTest() +! :delfunction RunTest +! :delfunction Test + :call garbagecollect(1) + :" + :/^start:/,$wq! test.out +*** ../vim-7.3.1232/src/testdir/test86.ok 2013-06-23 14:16:53.000000000 +0200 +--- src/testdir/test86.ok 2013-06-23 14:34:17.000000000 +0200 +*************** +*** 68,74 **** + dl : locked:1;scope:0 + v: : locked:2;scope:1 + g: : locked:0;scope:2 +! d:{'abc': 1} + dl:{'def': 1} + l : locked:0 + ll : locked:1 +--- 68,74 ---- + dl : locked:1;scope:0 + v: : locked:2;scope:1 + g: : locked:0;scope:2 +! d:{'abc2': 1} + dl:{'def': 1} + l : locked:0 + ll : locked:1 +*************** +*** 202,213 **** + B: 1:3 2:5 3:2 4:8 + >>> colorcolumn + p/gopts1! KeyError +! inv: 'abc'! KeyError + gopts1! KeyError + p/wopts1: '' +! inv: 'abc'! error + p/bopts1! KeyError +! inv: 'abc'! KeyError + bopts1! KeyError + bopts2! KeyError + bopts3! KeyError +--- 202,213 ---- + B: 1:3 2:5 3:2 4:8 + >>> colorcolumn + p/gopts1! KeyError +! inv: 'abc4'! KeyError + gopts1! KeyError + p/wopts1: '' +! inv: 'abc4'! error + p/bopts1! KeyError +! inv: 'abc4'! KeyError + bopts1! KeyError + bopts2! KeyError + bopts3! KeyError +*************** +*** 415,434 **** + {'a': 1} + {'a': 1} + [] +! ['a', 'b', 'c'] + function('tr') + ' + abcdef + line : + abcdef +! abc + line : +! abc' + ['a', 'dup_a'] + ['a', 'a'] +! ['a', 'b', 'c'] + [2, 2] + [2, 2] + testdir + test86.in + src +--- 415,437 ---- + {'a': 1} + {'a': 1} + [] +! ['a', 'b', 'c', '7'] + function('tr') + ' + abcdef + line : + abcdef +! abcA + line : +! abcB' + ['a', 'dup_a'] + ['a', 'a'] +! ['a', 'b', 'c', 'C'] + [2, 2] + [2, 2] ++ 1 ++ 1 ++ function('Put') + testdir + test86.in + src +*************** +*** 456,462 **** + vim.strwidth(1):TypeError:('expected str() or unicode() instance, but got int',) + > Dictionary + >> DictionaryConstructor +! vim.Dictionary("abc"):ValueError:('expected sequence element of size 2, but got sequence of size 1',) + >> DictionarySetattr + del d.locked:AttributeError:('cannot delete vim.Dictionary attributes',) + d.locked = FailingTrue():NotImplementedError:() +--- 459,465 ---- + vim.strwidth(1):TypeError:('expected str() or unicode() instance, but got int',) + > Dictionary + >> DictionaryConstructor +! vim.Dictionary("abcI"):ValueError:('expected sequence element of size 2, but got sequence of size 1',) + >> DictionarySetattr + del d.locked:AttributeError:('cannot delete vim.Dictionary attributes',) + d.locked = FailingTrue():NotImplementedError:() +*************** +*** 486,537 **** + d["a"] = {u"\0" : 1}:TypeError:('expected string without null bytes',) + d["a"] = {"\0" : 1}:TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using d["a"] = {"abc" : {%s : 1}} +! d["a"] = {"abc" : {1 : 1}}:TypeError:('expected str() or unicode() instance, but got int',) +! d["a"] = {"abc" : {u"\0" : 1}}:TypeError:('expected string without null bytes',) +! d["a"] = {"abc" : {"\0" : 1}}:TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using d["a"] = {"abc" : Mapping({%s : 1})} +! d["a"] = {"abc" : Mapping({1 : 1})}:TypeError:('expected str() or unicode() instance, but got int',) +! d["a"] = {"abc" : Mapping({u"\0" : 1})}:TypeError:('expected string without null bytes',) +! d["a"] = {"abc" : Mapping({"\0" : 1})}:TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using d["a"] = {"abc" : %s} +! d["a"] = {"abc" : FailingIter()}:TypeError:('unable to convert FailingIter to vim structure',) +! d["a"] = {"abc" : FailingIterNext()}:NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using d["a"] = {"abc" : %s} +! d["a"] = {"abc" : None}:TypeError:('unable to convert NoneType to vim structure',) +! d["a"] = {"abc" : {"": 1}}:ValueError:('empty keys are not allowed',) +! d["a"] = {"abc" : {u"": 1}}:ValueError:('empty keys are not allowed',) +! d["a"] = {"abc" : FailingMapping()}:NotImplementedError:() +! d["a"] = {"abc" : FailingMappingKey()}:NotImplementedError:() + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({%s : 1}) + d["a"] = Mapping({1 : 1}):TypeError:('expected str() or unicode() instance, but got int',) + d["a"] = Mapping({u"\0" : 1}):TypeError:('expected string without null bytes',) + d["a"] = Mapping({"\0" : 1}):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using d["a"] = Mapping({"abc" : {%s : 1}}) +! d["a"] = Mapping({"abc" : {1 : 1}}):TypeError:('expected str() or unicode() instance, but got int',) +! d["a"] = Mapping({"abc" : {u"\0" : 1}}):TypeError:('expected string without null bytes',) +! d["a"] = Mapping({"abc" : {"\0" : 1}}):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using d["a"] = Mapping({"abc" : Mapping({%s : 1})}) +! d["a"] = Mapping({"abc" : Mapping({1 : 1})}):TypeError:('expected str() or unicode() instance, but got int',) +! d["a"] = Mapping({"abc" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',) +! d["a"] = Mapping({"abc" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using d["a"] = Mapping({"abc" : %s}) +! d["a"] = Mapping({"abc" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',) +! d["a"] = Mapping({"abc" : FailingIterNext()}):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abc" : %s}) +! d["a"] = Mapping({"abc" : None}):TypeError:('unable to convert NoneType to vim structure',) +! d["a"] = Mapping({"abc" : {"": 1}}):ValueError:('empty keys are not allowed',) +! d["a"] = Mapping({"abc" : {u"": 1}}):ValueError:('empty keys are not allowed',) +! d["a"] = Mapping({"abc" : FailingMapping()}):NotImplementedError:() +! d["a"] = Mapping({"abc" : FailingMappingKey()}):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using d["a"] = %s + d["a"] = FailingIter():TypeError:('unable to convert FailingIter to vim structure',) +--- 489,540 ---- + d["a"] = {u"\0" : 1}:TypeError:('expected string without null bytes',) + d["a"] = {"\0" : 1}:TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using d["a"] = {"abcF" : {%s : 1}} +! d["a"] = {"abcF" : {1 : 1}}:TypeError:('expected str() or unicode() instance, but got int',) +! d["a"] = {"abcF" : {u"\0" : 1}}:TypeError:('expected string without null bytes',) +! d["a"] = {"abcF" : {"\0" : 1}}:TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using d["a"] = {"abcF" : Mapping({%s : 1})} +! d["a"] = {"abcF" : Mapping({1 : 1})}:TypeError:('expected str() or unicode() instance, but got int',) +! d["a"] = {"abcF" : Mapping({u"\0" : 1})}:TypeError:('expected string without null bytes',) +! d["a"] = {"abcF" : Mapping({"\0" : 1})}:TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using d["a"] = {"abcF" : %s} +! d["a"] = {"abcF" : FailingIter()}:TypeError:('unable to convert FailingIter to vim structure',) +! d["a"] = {"abcF" : FailingIterNext()}:NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using d["a"] = {"abcF" : %s} +! d["a"] = {"abcF" : None}:TypeError:('unable to convert NoneType to vim structure',) +! d["a"] = {"abcF" : {"": 1}}:ValueError:('empty keys are not allowed',) +! d["a"] = {"abcF" : {u"": 1}}:ValueError:('empty keys are not allowed',) +! d["a"] = {"abcF" : FailingMapping()}:NotImplementedError:() +! d["a"] = {"abcF" : FailingMappingKey()}:NotImplementedError:() + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({%s : 1}) + d["a"] = Mapping({1 : 1}):TypeError:('expected str() or unicode() instance, but got int',) + d["a"] = Mapping({u"\0" : 1}):TypeError:('expected string without null bytes',) + d["a"] = Mapping({"\0" : 1}):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using d["a"] = Mapping({"abcG" : {%s : 1}}) +! d["a"] = Mapping({"abcG" : {1 : 1}}):TypeError:('expected str() or unicode() instance, but got int',) +! d["a"] = Mapping({"abcG" : {u"\0" : 1}}):TypeError:('expected string without null bytes',) +! d["a"] = Mapping({"abcG" : {"\0" : 1}}):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using d["a"] = Mapping({"abcG" : Mapping({%s : 1})}) +! d["a"] = Mapping({"abcG" : Mapping({1 : 1})}):TypeError:('expected str() or unicode() instance, but got int',) +! d["a"] = Mapping({"abcG" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',) +! d["a"] = Mapping({"abcG" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using d["a"] = Mapping({"abcG" : %s}) +! d["a"] = Mapping({"abcG" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',) +! d["a"] = Mapping({"abcG" : FailingIterNext()}):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abcG" : %s}) +! d["a"] = Mapping({"abcG" : None}):TypeError:('unable to convert NoneType to vim structure',) +! d["a"] = Mapping({"abcG" : {"": 1}}):ValueError:('empty keys are not allowed',) +! d["a"] = Mapping({"abcG" : {u"": 1}}):ValueError:('empty keys are not allowed',) +! d["a"] = Mapping({"abcG" : FailingMapping()}):NotImplementedError:() +! d["a"] = Mapping({"abcG" : FailingMappingKey()}):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using d["a"] = %s + d["a"] = FailingIter():TypeError:('unable to convert FailingIter to vim structure',) +*************** +*** 554,605 **** + d.update({u"\0" : 1}):TypeError:('expected string without null bytes',) + d.update({"\0" : 1}):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using d.update({"abc" : {%s : 1}}) +! d.update({"abc" : {1 : 1}}):TypeError:('expected str() or unicode() instance, but got int',) +! d.update({"abc" : {u"\0" : 1}}):TypeError:('expected string without null bytes',) +! d.update({"abc" : {"\0" : 1}}):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using d.update({"abc" : Mapping({%s : 1})}) +! d.update({"abc" : Mapping({1 : 1})}):TypeError:('expected str() or unicode() instance, but got int',) +! d.update({"abc" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',) +! d.update({"abc" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using d.update({"abc" : %s}) +! d.update({"abc" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',) +! d.update({"abc" : FailingIterNext()}):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update({"abc" : %s}) +! d.update({"abc" : None}):TypeError:('unable to convert NoneType to vim structure',) +! d.update({"abc" : {"": 1}}):ValueError:('empty keys are not allowed',) +! d.update({"abc" : {u"": 1}}):ValueError:('empty keys are not allowed',) +! d.update({"abc" : FailingMapping()}):NotImplementedError:() +! d.update({"abc" : FailingMappingKey()}):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using d.update(Mapping({%s : 1})) + d.update(Mapping({1 : 1})):TypeError:('expected str() or unicode() instance, but got int',) + d.update(Mapping({u"\0" : 1})):TypeError:('expected string without null bytes',) + d.update(Mapping({"\0" : 1})):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using d.update(Mapping({"abc" : {%s : 1}})) +! d.update(Mapping({"abc" : {1 : 1}})):TypeError:('expected str() or unicode() instance, but got int',) +! d.update(Mapping({"abc" : {u"\0" : 1}})):TypeError:('expected string without null bytes',) +! d.update(Mapping({"abc" : {"\0" : 1}})):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using d.update(Mapping({"abc" : Mapping({%s : 1})})) +! d.update(Mapping({"abc" : Mapping({1 : 1})})):TypeError:('expected str() or unicode() instance, but got int',) +! d.update(Mapping({"abc" : Mapping({u"\0" : 1})})):TypeError:('expected string without null bytes',) +! d.update(Mapping({"abc" : Mapping({"\0" : 1})})):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using d.update(Mapping({"abc" : %s})) +! d.update(Mapping({"abc" : FailingIter()})):TypeError:('unable to convert FailingIter to vim structure',) +! d.update(Mapping({"abc" : FailingIterNext()})):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update(Mapping({"abc" : %s})) +! d.update(Mapping({"abc" : None})):TypeError:('unable to convert NoneType to vim structure',) +! d.update(Mapping({"abc" : {"": 1}})):ValueError:('empty keys are not allowed',) +! d.update(Mapping({"abc" : {u"": 1}})):ValueError:('empty keys are not allowed',) +! d.update(Mapping({"abc" : FailingMapping()})):NotImplementedError:() +! d.update(Mapping({"abc" : FailingMappingKey()})):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using d.update(%s) + d.update(FailingIter()):NotImplementedError:() +--- 557,608 ---- + d.update({u"\0" : 1}):TypeError:('expected string without null bytes',) + d.update({"\0" : 1}):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using d.update({"abcF" : {%s : 1}}) +! d.update({"abcF" : {1 : 1}}):TypeError:('expected str() or unicode() instance, but got int',) +! d.update({"abcF" : {u"\0" : 1}}):TypeError:('expected string without null bytes',) +! d.update({"abcF" : {"\0" : 1}}):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using d.update({"abcF" : Mapping({%s : 1})}) +! d.update({"abcF" : Mapping({1 : 1})}):TypeError:('expected str() or unicode() instance, but got int',) +! d.update({"abcF" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',) +! d.update({"abcF" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using d.update({"abcF" : %s}) +! d.update({"abcF" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',) +! d.update({"abcF" : FailingIterNext()}):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update({"abcF" : %s}) +! d.update({"abcF" : None}):TypeError:('unable to convert NoneType to vim structure',) +! d.update({"abcF" : {"": 1}}):ValueError:('empty keys are not allowed',) +! d.update({"abcF" : {u"": 1}}):ValueError:('empty keys are not allowed',) +! d.update({"abcF" : FailingMapping()}):NotImplementedError:() +! d.update({"abcF" : FailingMappingKey()}):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using d.update(Mapping({%s : 1})) + d.update(Mapping({1 : 1})):TypeError:('expected str() or unicode() instance, but got int',) + d.update(Mapping({u"\0" : 1})):TypeError:('expected string without null bytes',) + d.update(Mapping({"\0" : 1})):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using d.update(Mapping({"abcG" : {%s : 1}})) +! d.update(Mapping({"abcG" : {1 : 1}})):TypeError:('expected str() or unicode() instance, but got int',) +! d.update(Mapping({"abcG" : {u"\0" : 1}})):TypeError:('expected string without null bytes',) +! d.update(Mapping({"abcG" : {"\0" : 1}})):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using d.update(Mapping({"abcG" : Mapping({%s : 1})})) +! d.update(Mapping({"abcG" : Mapping({1 : 1})})):TypeError:('expected str() or unicode() instance, but got int',) +! d.update(Mapping({"abcG" : Mapping({u"\0" : 1})})):TypeError:('expected string without null bytes',) +! d.update(Mapping({"abcG" : Mapping({"\0" : 1})})):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using d.update(Mapping({"abcG" : %s})) +! d.update(Mapping({"abcG" : FailingIter()})):TypeError:('unable to convert FailingIter to vim structure',) +! d.update(Mapping({"abcG" : FailingIterNext()})):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update(Mapping({"abcG" : %s})) +! d.update(Mapping({"abcG" : None})):TypeError:('unable to convert NoneType to vim structure',) +! d.update(Mapping({"abcG" : {"": 1}})):ValueError:('empty keys are not allowed',) +! d.update(Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',) +! d.update(Mapping({"abcG" : FailingMapping()})):NotImplementedError:() +! d.update(Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using d.update(%s) + d.update(FailingIter()):NotImplementedError:() +*************** +*** 622,673 **** + d.update((("a", {u"\0" : 1}),)):TypeError:('expected string without null bytes',) + d.update((("a", {"\0" : 1}),)):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using d.update((("a", {"abc" : {%s : 1}}),)) +! d.update((("a", {"abc" : {1 : 1}}),)):TypeError:('expected str() or unicode() instance, but got int',) +! d.update((("a", {"abc" : {u"\0" : 1}}),)):TypeError:('expected string without null bytes',) +! d.update((("a", {"abc" : {"\0" : 1}}),)):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using d.update((("a", {"abc" : Mapping({%s : 1})}),)) +! d.update((("a", {"abc" : Mapping({1 : 1})}),)):TypeError:('expected str() or unicode() instance, but got int',) +! d.update((("a", {"abc" : Mapping({u"\0" : 1})}),)):TypeError:('expected string without null bytes',) +! d.update((("a", {"abc" : Mapping({"\0" : 1})}),)):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using d.update((("a", {"abc" : %s}),)) +! d.update((("a", {"abc" : FailingIter()}),)):TypeError:('unable to convert FailingIter to vim structure',) +! d.update((("a", {"abc" : FailingIterNext()}),)):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update((("a", {"abc" : %s}),)) +! d.update((("a", {"abc" : None}),)):TypeError:('unable to convert NoneType to vim structure',) +! d.update((("a", {"abc" : {"": 1}}),)):ValueError:('empty keys are not allowed',) +! d.update((("a", {"abc" : {u"": 1}}),)):ValueError:('empty keys are not allowed',) +! d.update((("a", {"abc" : FailingMapping()}),)):NotImplementedError:() +! d.update((("a", {"abc" : FailingMappingKey()}),)):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),)) + d.update((("a", Mapping({1 : 1})),)):TypeError:('expected str() or unicode() instance, but got int',) + d.update((("a", Mapping({u"\0" : 1})),)):TypeError:('expected string without null bytes',) + d.update((("a", Mapping({"\0" : 1})),)):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using d.update((("a", Mapping({"abc" : {%s : 1}})),)) +! d.update((("a", Mapping({"abc" : {1 : 1}})),)):TypeError:('expected str() or unicode() instance, but got int',) +! d.update((("a", Mapping({"abc" : {u"\0" : 1}})),)):TypeError:('expected string without null bytes',) +! d.update((("a", Mapping({"abc" : {"\0" : 1}})),)):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using d.update((("a", Mapping({"abc" : Mapping({%s : 1})})),)) +! d.update((("a", Mapping({"abc" : Mapping({1 : 1})})),)):TypeError:('expected str() or unicode() instance, but got int',) +! d.update((("a", Mapping({"abc" : Mapping({u"\0" : 1})})),)):TypeError:('expected string without null bytes',) +! d.update((("a", Mapping({"abc" : Mapping({"\0" : 1})})),)):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using d.update((("a", Mapping({"abc" : %s})),)) +! d.update((("a", Mapping({"abc" : FailingIter()})),)):TypeError:('unable to convert FailingIter to vim structure',) +! d.update((("a", Mapping({"abc" : FailingIterNext()})),)):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abc" : %s})),)) +! d.update((("a", Mapping({"abc" : None})),)):TypeError:('unable to convert NoneType to vim structure',) +! d.update((("a", Mapping({"abc" : {"": 1}})),)):ValueError:('empty keys are not allowed',) +! d.update((("a", Mapping({"abc" : {u"": 1}})),)):ValueError:('empty keys are not allowed',) +! d.update((("a", Mapping({"abc" : FailingMapping()})),)):NotImplementedError:() +! d.update((("a", Mapping({"abc" : FailingMappingKey()})),)):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using d.update((("a", %s),)) + d.update((("a", FailingIter()),)):TypeError:('unable to convert FailingIter to vim structure',) +--- 625,676 ---- + d.update((("a", {u"\0" : 1}),)):TypeError:('expected string without null bytes',) + d.update((("a", {"\0" : 1}),)):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using d.update((("a", {"abcF" : {%s : 1}}),)) +! d.update((("a", {"abcF" : {1 : 1}}),)):TypeError:('expected str() or unicode() instance, but got int',) +! d.update((("a", {"abcF" : {u"\0" : 1}}),)):TypeError:('expected string without null bytes',) +! d.update((("a", {"abcF" : {"\0" : 1}}),)):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using d.update((("a", {"abcF" : Mapping({%s : 1})}),)) +! d.update((("a", {"abcF" : Mapping({1 : 1})}),)):TypeError:('expected str() or unicode() instance, but got int',) +! d.update((("a", {"abcF" : Mapping({u"\0" : 1})}),)):TypeError:('expected string without null bytes',) +! d.update((("a", {"abcF" : Mapping({"\0" : 1})}),)):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using d.update((("a", {"abcF" : %s}),)) +! d.update((("a", {"abcF" : FailingIter()}),)):TypeError:('unable to convert FailingIter to vim structure',) +! d.update((("a", {"abcF" : FailingIterNext()}),)):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update((("a", {"abcF" : %s}),)) +! d.update((("a", {"abcF" : None}),)):TypeError:('unable to convert NoneType to vim structure',) +! d.update((("a", {"abcF" : {"": 1}}),)):ValueError:('empty keys are not allowed',) +! d.update((("a", {"abcF" : {u"": 1}}),)):ValueError:('empty keys are not allowed',) +! d.update((("a", {"abcF" : FailingMapping()}),)):NotImplementedError:() +! d.update((("a", {"abcF" : FailingMappingKey()}),)):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),)) + d.update((("a", Mapping({1 : 1})),)):TypeError:('expected str() or unicode() instance, but got int',) + d.update((("a", Mapping({u"\0" : 1})),)):TypeError:('expected string without null bytes',) + d.update((("a", Mapping({"\0" : 1})),)):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using d.update((("a", Mapping({"abcG" : {%s : 1}})),)) +! d.update((("a", Mapping({"abcG" : {1 : 1}})),)):TypeError:('expected str() or unicode() instance, but got int',) +! d.update((("a", Mapping({"abcG" : {u"\0" : 1}})),)):TypeError:('expected string without null bytes',) +! d.update((("a", Mapping({"abcG" : {"\0" : 1}})),)):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using d.update((("a", Mapping({"abcG" : Mapping({%s : 1})})),)) +! d.update((("a", Mapping({"abcG" : Mapping({1 : 1})})),)):TypeError:('expected str() or unicode() instance, but got int',) +! d.update((("a", Mapping({"abcG" : Mapping({u"\0" : 1})})),)):TypeError:('expected string without null bytes',) +! d.update((("a", Mapping({"abcG" : Mapping({"\0" : 1})})),)):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using d.update((("a", Mapping({"abcG" : %s})),)) +! d.update((("a", Mapping({"abcG" : FailingIter()})),)):TypeError:('unable to convert FailingIter to vim structure',) +! d.update((("a", Mapping({"abcG" : FailingIterNext()})),)):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abcG" : %s})),)) +! d.update((("a", Mapping({"abcG" : None})),)):TypeError:('unable to convert NoneType to vim structure',) +! d.update((("a", Mapping({"abcG" : {"": 1}})),)):ValueError:('empty keys are not allowed',) +! d.update((("a", Mapping({"abcG" : {u"": 1}})),)):ValueError:('empty keys are not allowed',) +! d.update((("a", Mapping({"abcG" : FailingMapping()})),)):NotImplementedError:() +! d.update((("a", Mapping({"abcG" : FailingMappingKey()})),)):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using d.update((("a", %s),)) + d.update((("a", FailingIter()),)):TypeError:('unable to convert FailingIter to vim structure',) +*************** +*** 693,744 **** + vim.List([{u"\0" : 1}]):TypeError:('expected string without null bytes',) + vim.List([{"\0" : 1}]):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using vim.List([{"abc" : {%s : 1}}]) +! vim.List([{"abc" : {1 : 1}}]):TypeError:('expected str() or unicode() instance, but got int',) +! vim.List([{"abc" : {u"\0" : 1}}]):TypeError:('expected string without null bytes',) +! vim.List([{"abc" : {"\0" : 1}}]):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using vim.List([{"abc" : Mapping({%s : 1})}]) +! vim.List([{"abc" : Mapping({1 : 1})}]):TypeError:('expected str() or unicode() instance, but got int',) +! vim.List([{"abc" : Mapping({u"\0" : 1})}]):TypeError:('expected string without null bytes',) +! vim.List([{"abc" : Mapping({"\0" : 1})}]):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using vim.List([{"abc" : %s}]) +! vim.List([{"abc" : FailingIter()}]):TypeError:('unable to convert FailingIter to vim structure',) +! vim.List([{"abc" : FailingIterNext()}]):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using vim.List([{"abc" : %s}]) +! vim.List([{"abc" : None}]):TypeError:('unable to convert NoneType to vim structure',) +! vim.List([{"abc" : {"": 1}}]):ValueError:('empty keys are not allowed',) +! vim.List([{"abc" : {u"": 1}}]):ValueError:('empty keys are not allowed',) +! vim.List([{"abc" : FailingMapping()}]):NotImplementedError:() +! vim.List([{"abc" : FailingMappingKey()}]):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({%s : 1})]) + vim.List([Mapping({1 : 1})]):TypeError:('expected str() or unicode() instance, but got int',) + vim.List([Mapping({u"\0" : 1})]):TypeError:('expected string without null bytes',) + vim.List([Mapping({"\0" : 1})]):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using vim.List([Mapping({"abc" : {%s : 1}})]) +! vim.List([Mapping({"abc" : {1 : 1}})]):TypeError:('expected str() or unicode() instance, but got int',) +! vim.List([Mapping({"abc" : {u"\0" : 1}})]):TypeError:('expected string without null bytes',) +! vim.List([Mapping({"abc" : {"\0" : 1}})]):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using vim.List([Mapping({"abc" : Mapping({%s : 1})})]) +! vim.List([Mapping({"abc" : Mapping({1 : 1})})]):TypeError:('expected str() or unicode() instance, but got int',) +! vim.List([Mapping({"abc" : Mapping({u"\0" : 1})})]):TypeError:('expected string without null bytes',) +! vim.List([Mapping({"abc" : Mapping({"\0" : 1})})]):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using vim.List([Mapping({"abc" : %s})]) +! vim.List([Mapping({"abc" : FailingIter()})]):TypeError:('unable to convert FailingIter to vim structure',) +! vim.List([Mapping({"abc" : FailingIterNext()})]):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using vim.List([Mapping({"abc" : %s})]) +! vim.List([Mapping({"abc" : None})]):TypeError:('unable to convert NoneType to vim structure',) +! vim.List([Mapping({"abc" : {"": 1}})]):ValueError:('empty keys are not allowed',) +! vim.List([Mapping({"abc" : {u"": 1}})]):ValueError:('empty keys are not allowed',) +! vim.List([Mapping({"abc" : FailingMapping()})]):NotImplementedError:() +! vim.List([Mapping({"abc" : FailingMappingKey()})]):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using vim.List([%s]) + vim.List([FailingIter()]):TypeError:('unable to convert FailingIter to vim structure',) +--- 696,747 ---- + vim.List([{u"\0" : 1}]):TypeError:('expected string without null bytes',) + vim.List([{"\0" : 1}]):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using vim.List([{"abcF" : {%s : 1}}]) +! vim.List([{"abcF" : {1 : 1}}]):TypeError:('expected str() or unicode() instance, but got int',) +! vim.List([{"abcF" : {u"\0" : 1}}]):TypeError:('expected string without null bytes',) +! vim.List([{"abcF" : {"\0" : 1}}]):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using vim.List([{"abcF" : Mapping({%s : 1})}]) +! vim.List([{"abcF" : Mapping({1 : 1})}]):TypeError:('expected str() or unicode() instance, but got int',) +! vim.List([{"abcF" : Mapping({u"\0" : 1})}]):TypeError:('expected string without null bytes',) +! vim.List([{"abcF" : Mapping({"\0" : 1})}]):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using vim.List([{"abcF" : %s}]) +! vim.List([{"abcF" : FailingIter()}]):TypeError:('unable to convert FailingIter to vim structure',) +! vim.List([{"abcF" : FailingIterNext()}]):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using vim.List([{"abcF" : %s}]) +! vim.List([{"abcF" : None}]):TypeError:('unable to convert NoneType to vim structure',) +! vim.List([{"abcF" : {"": 1}}]):ValueError:('empty keys are not allowed',) +! vim.List([{"abcF" : {u"": 1}}]):ValueError:('empty keys are not allowed',) +! vim.List([{"abcF" : FailingMapping()}]):NotImplementedError:() +! vim.List([{"abcF" : FailingMappingKey()}]):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({%s : 1})]) + vim.List([Mapping({1 : 1})]):TypeError:('expected str() or unicode() instance, but got int',) + vim.List([Mapping({u"\0" : 1})]):TypeError:('expected string without null bytes',) + vim.List([Mapping({"\0" : 1})]):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using vim.List([Mapping({"abcG" : {%s : 1}})]) +! vim.List([Mapping({"abcG" : {1 : 1}})]):TypeError:('expected str() or unicode() instance, but got int',) +! vim.List([Mapping({"abcG" : {u"\0" : 1}})]):TypeError:('expected string without null bytes',) +! vim.List([Mapping({"abcG" : {"\0" : 1}})]):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using vim.List([Mapping({"abcG" : Mapping({%s : 1})})]) +! vim.List([Mapping({"abcG" : Mapping({1 : 1})})]):TypeError:('expected str() or unicode() instance, but got int',) +! vim.List([Mapping({"abcG" : Mapping({u"\0" : 1})})]):TypeError:('expected string without null bytes',) +! vim.List([Mapping({"abcG" : Mapping({"\0" : 1})})]):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using vim.List([Mapping({"abcG" : %s})]) +! vim.List([Mapping({"abcG" : FailingIter()})]):TypeError:('unable to convert FailingIter to vim structure',) +! vim.List([Mapping({"abcG" : FailingIterNext()})]):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using vim.List([Mapping({"abcG" : %s})]) +! vim.List([Mapping({"abcG" : None})]):TypeError:('unable to convert NoneType to vim structure',) +! vim.List([Mapping({"abcG" : {"": 1}})]):ValueError:('empty keys are not allowed',) +! vim.List([Mapping({"abcG" : {u"": 1}})]):ValueError:('empty keys are not allowed',) +! vim.List([Mapping({"abcG" : FailingMapping()})]):NotImplementedError:() +! vim.List([Mapping({"abcG" : FailingMappingKey()})]):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using vim.List([%s]) + vim.List([FailingIter()]):TypeError:('unable to convert FailingIter to vim structure',) +*************** +*** 757,814 **** + ll[1] = 2:error:('list is locked',) + l[1000] = 3:IndexError:('list index out of range',) + >> ListAssSlice +! ll[1:100] = "abc":error:('list is locked',) + >>> Testing StringToChars using l[:] = [{%s : 1}] + l[:] = [{1 : 1}]:TypeError:('expected str() or unicode() instance, but got int',) + l[:] = [{u"\0" : 1}]:TypeError:('expected string without null bytes',) + l[:] = [{"\0" : 1}]:TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using l[:] = [{"abc" : {%s : 1}}] +! l[:] = [{"abc" : {1 : 1}}]:TypeError:('expected str() or unicode() instance, but got int',) +! l[:] = [{"abc" : {u"\0" : 1}}]:TypeError:('expected string without null bytes',) +! l[:] = [{"abc" : {"\0" : 1}}]:TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using l[:] = [{"abc" : Mapping({%s : 1})}] +! l[:] = [{"abc" : Mapping({1 : 1})}]:TypeError:('expected str() or unicode() instance, but got int',) +! l[:] = [{"abc" : Mapping({u"\0" : 1})}]:TypeError:('expected string without null bytes',) +! l[:] = [{"abc" : Mapping({"\0" : 1})}]:TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using l[:] = [{"abc" : %s}] +! l[:] = [{"abc" : FailingIter()}]:TypeError:('unable to convert FailingIter to vim structure',) +! l[:] = [{"abc" : FailingIterNext()}]:NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using l[:] = [{"abc" : %s}] +! l[:] = [{"abc" : None}]:TypeError:('unable to convert NoneType to vim structure',) +! l[:] = [{"abc" : {"": 1}}]:ValueError:('empty keys are not allowed',) +! l[:] = [{"abc" : {u"": 1}}]:ValueError:('empty keys are not allowed',) +! l[:] = [{"abc" : FailingMapping()}]:NotImplementedError:() +! l[:] = [{"abc" : FailingMappingKey()}]:NotImplementedError:() + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({%s : 1})] + l[:] = [Mapping({1 : 1})]:TypeError:('expected str() or unicode() instance, but got int',) + l[:] = [Mapping({u"\0" : 1})]:TypeError:('expected string without null bytes',) + l[:] = [Mapping({"\0" : 1})]:TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using l[:] = [Mapping({"abc" : {%s : 1}})] +! l[:] = [Mapping({"abc" : {1 : 1}})]:TypeError:('expected str() or unicode() instance, but got int',) +! l[:] = [Mapping({"abc" : {u"\0" : 1}})]:TypeError:('expected string without null bytes',) +! l[:] = [Mapping({"abc" : {"\0" : 1}})]:TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using l[:] = [Mapping({"abc" : Mapping({%s : 1})})] +! l[:] = [Mapping({"abc" : Mapping({1 : 1})})]:TypeError:('expected str() or unicode() instance, but got int',) +! l[:] = [Mapping({"abc" : Mapping({u"\0" : 1})})]:TypeError:('expected string without null bytes',) +! l[:] = [Mapping({"abc" : Mapping({"\0" : 1})})]:TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using l[:] = [Mapping({"abc" : %s})] +! l[:] = [Mapping({"abc" : FailingIter()})]:TypeError:('unable to convert FailingIter to vim structure',) +! l[:] = [Mapping({"abc" : FailingIterNext()})]:NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abc" : %s})] +! l[:] = [Mapping({"abc" : None})]:TypeError:('unable to convert NoneType to vim structure',) +! l[:] = [Mapping({"abc" : {"": 1}})]:ValueError:('empty keys are not allowed',) +! l[:] = [Mapping({"abc" : {u"": 1}})]:ValueError:('empty keys are not allowed',) +! l[:] = [Mapping({"abc" : FailingMapping()})]:NotImplementedError:() +! l[:] = [Mapping({"abc" : FailingMappingKey()})]:NotImplementedError:() + <<< Finished + >>> Testing *Iter* using l[:] = [%s] + l[:] = [FailingIter()]:TypeError:('unable to convert FailingIter to vim structure',) +--- 760,817 ---- + ll[1] = 2:error:('list is locked',) + l[1000] = 3:IndexError:('list index out of range',) + >> ListAssSlice +! ll[1:100] = "abcJ":error:('list is locked',) + >>> Testing StringToChars using l[:] = [{%s : 1}] + l[:] = [{1 : 1}]:TypeError:('expected str() or unicode() instance, but got int',) + l[:] = [{u"\0" : 1}]:TypeError:('expected string without null bytes',) + l[:] = [{"\0" : 1}]:TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using l[:] = [{"abcF" : {%s : 1}}] +! l[:] = [{"abcF" : {1 : 1}}]:TypeError:('expected str() or unicode() instance, but got int',) +! l[:] = [{"abcF" : {u"\0" : 1}}]:TypeError:('expected string without null bytes',) +! l[:] = [{"abcF" : {"\0" : 1}}]:TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using l[:] = [{"abcF" : Mapping({%s : 1})}] +! l[:] = [{"abcF" : Mapping({1 : 1})}]:TypeError:('expected str() or unicode() instance, but got int',) +! l[:] = [{"abcF" : Mapping({u"\0" : 1})}]:TypeError:('expected string without null bytes',) +! l[:] = [{"abcF" : Mapping({"\0" : 1})}]:TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using l[:] = [{"abcF" : %s}] +! l[:] = [{"abcF" : FailingIter()}]:TypeError:('unable to convert FailingIter to vim structure',) +! l[:] = [{"abcF" : FailingIterNext()}]:NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using l[:] = [{"abcF" : %s}] +! l[:] = [{"abcF" : None}]:TypeError:('unable to convert NoneType to vim structure',) +! l[:] = [{"abcF" : {"": 1}}]:ValueError:('empty keys are not allowed',) +! l[:] = [{"abcF" : {u"": 1}}]:ValueError:('empty keys are not allowed',) +! l[:] = [{"abcF" : FailingMapping()}]:NotImplementedError:() +! l[:] = [{"abcF" : FailingMappingKey()}]:NotImplementedError:() + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({%s : 1})] + l[:] = [Mapping({1 : 1})]:TypeError:('expected str() or unicode() instance, but got int',) + l[:] = [Mapping({u"\0" : 1})]:TypeError:('expected string without null bytes',) + l[:] = [Mapping({"\0" : 1})]:TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using l[:] = [Mapping({"abcG" : {%s : 1}})] +! l[:] = [Mapping({"abcG" : {1 : 1}})]:TypeError:('expected str() or unicode() instance, but got int',) +! l[:] = [Mapping({"abcG" : {u"\0" : 1}})]:TypeError:('expected string without null bytes',) +! l[:] = [Mapping({"abcG" : {"\0" : 1}})]:TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using l[:] = [Mapping({"abcG" : Mapping({%s : 1})})] +! l[:] = [Mapping({"abcG" : Mapping({1 : 1})})]:TypeError:('expected str() or unicode() instance, but got int',) +! l[:] = [Mapping({"abcG" : Mapping({u"\0" : 1})})]:TypeError:('expected string without null bytes',) +! l[:] = [Mapping({"abcG" : Mapping({"\0" : 1})})]:TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using l[:] = [Mapping({"abcG" : %s})] +! l[:] = [Mapping({"abcG" : FailingIter()})]:TypeError:('unable to convert FailingIter to vim structure',) +! l[:] = [Mapping({"abcG" : FailingIterNext()})]:NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abcG" : %s})] +! l[:] = [Mapping({"abcG" : None})]:TypeError:('unable to convert NoneType to vim structure',) +! l[:] = [Mapping({"abcG" : {"": 1}})]:ValueError:('empty keys are not allowed',) +! l[:] = [Mapping({"abcG" : {u"": 1}})]:ValueError:('empty keys are not allowed',) +! l[:] = [Mapping({"abcG" : FailingMapping()})]:NotImplementedError:() +! l[:] = [Mapping({"abcG" : FailingMappingKey()})]:NotImplementedError:() + <<< Finished + >>> Testing *Iter* using l[:] = [%s] + l[:] = [FailingIter()]:TypeError:('unable to convert FailingIter to vim structure',) +*************** +*** 827,878 **** + l.extend([{u"\0" : 1}]):TypeError:('expected string without null bytes',) + l.extend([{"\0" : 1}]):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using l.extend([{"abc" : {%s : 1}}]) +! l.extend([{"abc" : {1 : 1}}]):TypeError:('expected str() or unicode() instance, but got int',) +! l.extend([{"abc" : {u"\0" : 1}}]):TypeError:('expected string without null bytes',) +! l.extend([{"abc" : {"\0" : 1}}]):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using l.extend([{"abc" : Mapping({%s : 1})}]) +! l.extend([{"abc" : Mapping({1 : 1})}]):TypeError:('expected str() or unicode() instance, but got int',) +! l.extend([{"abc" : Mapping({u"\0" : 1})}]):TypeError:('expected string without null bytes',) +! l.extend([{"abc" : Mapping({"\0" : 1})}]):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using l.extend([{"abc" : %s}]) +! l.extend([{"abc" : FailingIter()}]):TypeError:('unable to convert FailingIter to vim structure',) +! l.extend([{"abc" : FailingIterNext()}]):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using l.extend([{"abc" : %s}]) +! l.extend([{"abc" : None}]):TypeError:('unable to convert NoneType to vim structure',) +! l.extend([{"abc" : {"": 1}}]):ValueError:('empty keys are not allowed',) +! l.extend([{"abc" : {u"": 1}}]):ValueError:('empty keys are not allowed',) +! l.extend([{"abc" : FailingMapping()}]):NotImplementedError:() +! l.extend([{"abc" : FailingMappingKey()}]):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({%s : 1})]) + l.extend([Mapping({1 : 1})]):TypeError:('expected str() or unicode() instance, but got int',) + l.extend([Mapping({u"\0" : 1})]):TypeError:('expected string without null bytes',) + l.extend([Mapping({"\0" : 1})]):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using l.extend([Mapping({"abc" : {%s : 1}})]) +! l.extend([Mapping({"abc" : {1 : 1}})]):TypeError:('expected str() or unicode() instance, but got int',) +! l.extend([Mapping({"abc" : {u"\0" : 1}})]):TypeError:('expected string without null bytes',) +! l.extend([Mapping({"abc" : {"\0" : 1}})]):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using l.extend([Mapping({"abc" : Mapping({%s : 1})})]) +! l.extend([Mapping({"abc" : Mapping({1 : 1})})]):TypeError:('expected str() or unicode() instance, but got int',) +! l.extend([Mapping({"abc" : Mapping({u"\0" : 1})})]):TypeError:('expected string without null bytes',) +! l.extend([Mapping({"abc" : Mapping({"\0" : 1})})]):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using l.extend([Mapping({"abc" : %s})]) +! l.extend([Mapping({"abc" : FailingIter()})]):TypeError:('unable to convert FailingIter to vim structure',) +! l.extend([Mapping({"abc" : FailingIterNext()})]):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using l.extend([Mapping({"abc" : %s})]) +! l.extend([Mapping({"abc" : None})]):TypeError:('unable to convert NoneType to vim structure',) +! l.extend([Mapping({"abc" : {"": 1}})]):ValueError:('empty keys are not allowed',) +! l.extend([Mapping({"abc" : {u"": 1}})]):ValueError:('empty keys are not allowed',) +! l.extend([Mapping({"abc" : FailingMapping()})]):NotImplementedError:() +! l.extend([Mapping({"abc" : FailingMappingKey()})]):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using l.extend([%s]) + l.extend([FailingIter()]):TypeError:('unable to convert FailingIter to vim structure',) +--- 830,881 ---- + l.extend([{u"\0" : 1}]):TypeError:('expected string without null bytes',) + l.extend([{"\0" : 1}]):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using l.extend([{"abcF" : {%s : 1}}]) +! l.extend([{"abcF" : {1 : 1}}]):TypeError:('expected str() or unicode() instance, but got int',) +! l.extend([{"abcF" : {u"\0" : 1}}]):TypeError:('expected string without null bytes',) +! l.extend([{"abcF" : {"\0" : 1}}]):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using l.extend([{"abcF" : Mapping({%s : 1})}]) +! l.extend([{"abcF" : Mapping({1 : 1})}]):TypeError:('expected str() or unicode() instance, but got int',) +! l.extend([{"abcF" : Mapping({u"\0" : 1})}]):TypeError:('expected string without null bytes',) +! l.extend([{"abcF" : Mapping({"\0" : 1})}]):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using l.extend([{"abcF" : %s}]) +! l.extend([{"abcF" : FailingIter()}]):TypeError:('unable to convert FailingIter to vim structure',) +! l.extend([{"abcF" : FailingIterNext()}]):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using l.extend([{"abcF" : %s}]) +! l.extend([{"abcF" : None}]):TypeError:('unable to convert NoneType to vim structure',) +! l.extend([{"abcF" : {"": 1}}]):ValueError:('empty keys are not allowed',) +! l.extend([{"abcF" : {u"": 1}}]):ValueError:('empty keys are not allowed',) +! l.extend([{"abcF" : FailingMapping()}]):NotImplementedError:() +! l.extend([{"abcF" : FailingMappingKey()}]):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({%s : 1})]) + l.extend([Mapping({1 : 1})]):TypeError:('expected str() or unicode() instance, but got int',) + l.extend([Mapping({u"\0" : 1})]):TypeError:('expected string without null bytes',) + l.extend([Mapping({"\0" : 1})]):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using l.extend([Mapping({"abcG" : {%s : 1}})]) +! l.extend([Mapping({"abcG" : {1 : 1}})]):TypeError:('expected str() or unicode() instance, but got int',) +! l.extend([Mapping({"abcG" : {u"\0" : 1}})]):TypeError:('expected string without null bytes',) +! l.extend([Mapping({"abcG" : {"\0" : 1}})]):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using l.extend([Mapping({"abcG" : Mapping({%s : 1})})]) +! l.extend([Mapping({"abcG" : Mapping({1 : 1})})]):TypeError:('expected str() or unicode() instance, but got int',) +! l.extend([Mapping({"abcG" : Mapping({u"\0" : 1})})]):TypeError:('expected string without null bytes',) +! l.extend([Mapping({"abcG" : Mapping({"\0" : 1})})]):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using l.extend([Mapping({"abcG" : %s})]) +! l.extend([Mapping({"abcG" : FailingIter()})]):TypeError:('unable to convert FailingIter to vim structure',) +! l.extend([Mapping({"abcG" : FailingIterNext()})]):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using l.extend([Mapping({"abcG" : %s})]) +! l.extend([Mapping({"abcG" : None})]):TypeError:('unable to convert NoneType to vim structure',) +! l.extend([Mapping({"abcG" : {"": 1}})]):ValueError:('empty keys are not allowed',) +! l.extend([Mapping({"abcG" : {u"": 1}})]):ValueError:('empty keys are not allowed',) +! l.extend([Mapping({"abcG" : FailingMapping()})]):NotImplementedError:() +! l.extend([Mapping({"abcG" : FailingMappingKey()})]):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using l.extend([%s]) + l.extend([FailingIter()]):TypeError:('unable to convert FailingIter to vim structure',) +*************** +*** 900,951 **** + f({u"\0" : 1}):TypeError:('expected string without null bytes',) + f({"\0" : 1}):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using f({"abc" : {%s : 1}}) +! f({"abc" : {1 : 1}}):TypeError:('expected str() or unicode() instance, but got int',) +! f({"abc" : {u"\0" : 1}}):TypeError:('expected string without null bytes',) +! f({"abc" : {"\0" : 1}}):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using f({"abc" : Mapping({%s : 1})}) +! f({"abc" : Mapping({1 : 1})}):TypeError:('expected str() or unicode() instance, but got int',) +! f({"abc" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',) +! f({"abc" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using f({"abc" : %s}) +! f({"abc" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',) +! f({"abc" : FailingIterNext()}):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using f({"abc" : %s}) +! f({"abc" : None}):TypeError:('unable to convert NoneType to vim structure',) +! f({"abc" : {"": 1}}):ValueError:('empty keys are not allowed',) +! f({"abc" : {u"": 1}}):ValueError:('empty keys are not allowed',) +! f({"abc" : FailingMapping()}):NotImplementedError:() +! f({"abc" : FailingMappingKey()}):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using f(Mapping({%s : 1})) + f(Mapping({1 : 1})):TypeError:('expected str() or unicode() instance, but got int',) + f(Mapping({u"\0" : 1})):TypeError:('expected string without null bytes',) + f(Mapping({"\0" : 1})):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using f(Mapping({"abc" : {%s : 1}})) +! f(Mapping({"abc" : {1 : 1}})):TypeError:('expected str() or unicode() instance, but got int',) +! f(Mapping({"abc" : {u"\0" : 1}})):TypeError:('expected string without null bytes',) +! f(Mapping({"abc" : {"\0" : 1}})):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using f(Mapping({"abc" : Mapping({%s : 1})})) +! f(Mapping({"abc" : Mapping({1 : 1})})):TypeError:('expected str() or unicode() instance, but got int',) +! f(Mapping({"abc" : Mapping({u"\0" : 1})})):TypeError:('expected string without null bytes',) +! f(Mapping({"abc" : Mapping({"\0" : 1})})):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using f(Mapping({"abc" : %s})) +! f(Mapping({"abc" : FailingIter()})):TypeError:('unable to convert FailingIter to vim structure',) +! f(Mapping({"abc" : FailingIterNext()})):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using f(Mapping({"abc" : %s})) +! f(Mapping({"abc" : None})):TypeError:('unable to convert NoneType to vim structure',) +! f(Mapping({"abc" : {"": 1}})):ValueError:('empty keys are not allowed',) +! f(Mapping({"abc" : {u"": 1}})):ValueError:('empty keys are not allowed',) +! f(Mapping({"abc" : FailingMapping()})):NotImplementedError:() +! f(Mapping({"abc" : FailingMappingKey()})):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using f(%s) + f(FailingIter()):TypeError:('unable to convert FailingIter to vim structure',) +--- 903,954 ---- + f({u"\0" : 1}):TypeError:('expected string without null bytes',) + f({"\0" : 1}):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using f({"abcF" : {%s : 1}}) +! f({"abcF" : {1 : 1}}):TypeError:('expected str() or unicode() instance, but got int',) +! f({"abcF" : {u"\0" : 1}}):TypeError:('expected string without null bytes',) +! f({"abcF" : {"\0" : 1}}):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using f({"abcF" : Mapping({%s : 1})}) +! f({"abcF" : Mapping({1 : 1})}):TypeError:('expected str() or unicode() instance, but got int',) +! f({"abcF" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',) +! f({"abcF" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using f({"abcF" : %s}) +! f({"abcF" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',) +! f({"abcF" : FailingIterNext()}):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using f({"abcF" : %s}) +! f({"abcF" : None}):TypeError:('unable to convert NoneType to vim structure',) +! f({"abcF" : {"": 1}}):ValueError:('empty keys are not allowed',) +! f({"abcF" : {u"": 1}}):ValueError:('empty keys are not allowed',) +! f({"abcF" : FailingMapping()}):NotImplementedError:() +! f({"abcF" : FailingMappingKey()}):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using f(Mapping({%s : 1})) + f(Mapping({1 : 1})):TypeError:('expected str() or unicode() instance, but got int',) + f(Mapping({u"\0" : 1})):TypeError:('expected string without null bytes',) + f(Mapping({"\0" : 1})):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using f(Mapping({"abcG" : {%s : 1}})) +! f(Mapping({"abcG" : {1 : 1}})):TypeError:('expected str() or unicode() instance, but got int',) +! f(Mapping({"abcG" : {u"\0" : 1}})):TypeError:('expected string without null bytes',) +! f(Mapping({"abcG" : {"\0" : 1}})):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using f(Mapping({"abcG" : Mapping({%s : 1})})) +! f(Mapping({"abcG" : Mapping({1 : 1})})):TypeError:('expected str() or unicode() instance, but got int',) +! f(Mapping({"abcG" : Mapping({u"\0" : 1})})):TypeError:('expected string without null bytes',) +! f(Mapping({"abcG" : Mapping({"\0" : 1})})):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using f(Mapping({"abcG" : %s})) +! f(Mapping({"abcG" : FailingIter()})):TypeError:('unable to convert FailingIter to vim structure',) +! f(Mapping({"abcG" : FailingIterNext()})):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using f(Mapping({"abcG" : %s})) +! f(Mapping({"abcG" : None})):TypeError:('unable to convert NoneType to vim structure',) +! f(Mapping({"abcG" : {"": 1}})):ValueError:('empty keys are not allowed',) +! f(Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',) +! f(Mapping({"abcG" : FailingMapping()})):NotImplementedError:() +! f(Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using f(%s) + f(FailingIter()):TypeError:('unable to convert FailingIter to vim structure',) +*************** +*** 963,1014 **** + fd(self={u"\0" : 1}):TypeError:('expected string without null bytes',) + fd(self={"\0" : 1}):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using fd(self={"abc" : {%s : 1}}) +! fd(self={"abc" : {1 : 1}}):TypeError:('expected str() or unicode() instance, but got int',) +! fd(self={"abc" : {u"\0" : 1}}):TypeError:('expected string without null bytes',) +! fd(self={"abc" : {"\0" : 1}}):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using fd(self={"abc" : Mapping({%s : 1})}) +! fd(self={"abc" : Mapping({1 : 1})}):TypeError:('expected str() or unicode() instance, but got int',) +! fd(self={"abc" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',) +! fd(self={"abc" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using fd(self={"abc" : %s}) +! fd(self={"abc" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',) +! fd(self={"abc" : FailingIterNext()}):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using fd(self={"abc" : %s}) +! fd(self={"abc" : None}):TypeError:('unable to convert NoneType to vim structure',) +! fd(self={"abc" : {"": 1}}):ValueError:('empty keys are not allowed',) +! fd(self={"abc" : {u"": 1}}):ValueError:('empty keys are not allowed',) +! fd(self={"abc" : FailingMapping()}):NotImplementedError:() +! fd(self={"abc" : FailingMappingKey()}):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({%s : 1})) + fd(self=Mapping({1 : 1})):TypeError:('expected str() or unicode() instance, but got int',) + fd(self=Mapping({u"\0" : 1})):TypeError:('expected string without null bytes',) + fd(self=Mapping({"\0" : 1})):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using fd(self=Mapping({"abc" : {%s : 1}})) +! fd(self=Mapping({"abc" : {1 : 1}})):TypeError:('expected str() or unicode() instance, but got int',) +! fd(self=Mapping({"abc" : {u"\0" : 1}})):TypeError:('expected string without null bytes',) +! fd(self=Mapping({"abc" : {"\0" : 1}})):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using fd(self=Mapping({"abc" : Mapping({%s : 1})})) +! fd(self=Mapping({"abc" : Mapping({1 : 1})})):TypeError:('expected str() or unicode() instance, but got int',) +! fd(self=Mapping({"abc" : Mapping({u"\0" : 1})})):TypeError:('expected string without null bytes',) +! fd(self=Mapping({"abc" : Mapping({"\0" : 1})})):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using fd(self=Mapping({"abc" : %s})) +! fd(self=Mapping({"abc" : FailingIter()})):TypeError:('unable to convert FailingIter to vim structure',) +! fd(self=Mapping({"abc" : FailingIterNext()})):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using fd(self=Mapping({"abc" : %s})) +! fd(self=Mapping({"abc" : None})):TypeError:('unable to convert NoneType to vim structure',) +! fd(self=Mapping({"abc" : {"": 1}})):ValueError:('empty keys are not allowed',) +! fd(self=Mapping({"abc" : {u"": 1}})):ValueError:('empty keys are not allowed',) +! fd(self=Mapping({"abc" : FailingMapping()})):NotImplementedError:() +! fd(self=Mapping({"abc" : FailingMappingKey()})):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using fd(self=%s) + fd(self=FailingIter()):TypeError:('unable to convert FailingIter to vim dictionary',) +--- 966,1017 ---- + fd(self={u"\0" : 1}):TypeError:('expected string without null bytes',) + fd(self={"\0" : 1}):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using fd(self={"abcF" : {%s : 1}}) +! fd(self={"abcF" : {1 : 1}}):TypeError:('expected str() or unicode() instance, but got int',) +! fd(self={"abcF" : {u"\0" : 1}}):TypeError:('expected string without null bytes',) +! fd(self={"abcF" : {"\0" : 1}}):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using fd(self={"abcF" : Mapping({%s : 1})}) +! fd(self={"abcF" : Mapping({1 : 1})}):TypeError:('expected str() or unicode() instance, but got int',) +! fd(self={"abcF" : Mapping({u"\0" : 1})}):TypeError:('expected string without null bytes',) +! fd(self={"abcF" : Mapping({"\0" : 1})}):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using fd(self={"abcF" : %s}) +! fd(self={"abcF" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',) +! fd(self={"abcF" : FailingIterNext()}):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using fd(self={"abcF" : %s}) +! fd(self={"abcF" : None}):TypeError:('unable to convert NoneType to vim structure',) +! fd(self={"abcF" : {"": 1}}):ValueError:('empty keys are not allowed',) +! fd(self={"abcF" : {u"": 1}}):ValueError:('empty keys are not allowed',) +! fd(self={"abcF" : FailingMapping()}):NotImplementedError:() +! fd(self={"abcF" : FailingMappingKey()}):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({%s : 1})) + fd(self=Mapping({1 : 1})):TypeError:('expected str() or unicode() instance, but got int',) + fd(self=Mapping({u"\0" : 1})):TypeError:('expected string without null bytes',) + fd(self=Mapping({"\0" : 1})):TypeError:('expected string without null bytes',) + <<< Finished +! >>> Testing StringToChars using fd(self=Mapping({"abcG" : {%s : 1}})) +! fd(self=Mapping({"abcG" : {1 : 1}})):TypeError:('expected str() or unicode() instance, but got int',) +! fd(self=Mapping({"abcG" : {u"\0" : 1}})):TypeError:('expected string without null bytes',) +! fd(self=Mapping({"abcG" : {"\0" : 1}})):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing StringToChars using fd(self=Mapping({"abcG" : Mapping({%s : 1})})) +! fd(self=Mapping({"abcG" : Mapping({1 : 1})})):TypeError:('expected str() or unicode() instance, but got int',) +! fd(self=Mapping({"abcG" : Mapping({u"\0" : 1})})):TypeError:('expected string without null bytes',) +! fd(self=Mapping({"abcG" : Mapping({"\0" : 1})})):TypeError:('expected string without null bytes',) +! <<< Finished +! >>> Testing *Iter* using fd(self=Mapping({"abcG" : %s})) +! fd(self=Mapping({"abcG" : FailingIter()})):TypeError:('unable to convert FailingIter to vim structure',) +! fd(self=Mapping({"abcG" : FailingIterNext()})):NotImplementedError:() +! <<< Finished +! >>> Testing ConvertFromPyObject using fd(self=Mapping({"abcG" : %s})) +! fd(self=Mapping({"abcG" : None})):TypeError:('unable to convert NoneType to vim structure',) +! fd(self=Mapping({"abcG" : {"": 1}})):ValueError:('empty keys are not allowed',) +! fd(self=Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',) +! fd(self=Mapping({"abcG" : FailingMapping()})):NotImplementedError:() +! fd(self=Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using fd(self=%s) + fd(self=FailingIter()):TypeError:('unable to convert FailingIter to vim dictionary',) +*************** +*** 1037,1044 **** + vim.current.window.buffer = 0:TypeError:('readonly attribute: buffer',) + vim.current.window.cursor = (100000000, 100000000):error:('cursor position outside buffer',) + vim.current.window.cursor = True:TypeError:('argument must be 2-item sequence, not bool',) +! vim.current.window.height = "abc":TypeError:('expected int(), long() or something supporting coercing to long(), but got str',) +! vim.current.window.width = "abc":TypeError:('expected int(), long() or something supporting coercing to long(), but got str',) + vim.current.window.xxxxxx = True:AttributeError:('xxxxxx',) + > WinList + >> WinListItem +--- 1040,1047 ---- + vim.current.window.buffer = 0:TypeError:('readonly attribute: buffer',) + vim.current.window.cursor = (100000000, 100000000):error:('cursor position outside buffer',) + vim.current.window.cursor = True:TypeError:('argument must be 2-item sequence, not bool',) +! vim.current.window.height = "abcK":TypeError:('expected int(), long() or something supporting coercing to long(), but got str',) +! vim.current.window.width = "abcL":TypeError:('expected int(), long() or something supporting coercing to long(), but got str',) + vim.current.window.xxxxxx = True:AttributeError:('xxxxxx',) + > WinList + >> WinListItem +*************** +*** 1048,1054 **** + vim.current.buffer[0] = "\na":error:('string cannot contain newlines',) + >> SetBufferLine (indirect) + vim.current.buffer[0] = True:TypeError:('bad argument type for built-in operation',) +! >> SetBufferLines (indirect) + vim.current.buffer[:] = True:TypeError:('bad argument type for built-in operation',) + vim.current.buffer[:] = ["\na", "bc"]:error:('string cannot contain newlines',) + >> InsertBufferLines (indirect) +--- 1051,1057 ---- + vim.current.buffer[0] = "\na":error:('string cannot contain newlines',) + >> SetBufferLine (indirect) + vim.current.buffer[0] = True:TypeError:('bad argument type for built-in operation',) +! >> SetBufferLineList (indirect) + vim.current.buffer[:] = True:TypeError:('bad argument type for built-in operation',) + vim.current.buffer[:] = ["\na", "bc"]:error:('string cannot contain newlines',) + >> InsertBufferLines (indirect) +*************** +*** 1066,1072 **** + vim.current.buffer.xxx = True:AttributeError:('xxx',) + >> BufferMark + vim.current.buffer.mark(0):TypeError:('expected str() or unicode() instance, but got int',) +! vim.current.buffer.mark("abc"):ValueError:('mark name must be a single character',) + vim.current.buffer.mark("!"):error:('invalid mark name',) + >> BufferRange + vim.current.buffer.range(1, 2, 3):TypeError:('function takes exactly 2 arguments (3 given)',) +--- 1069,1075 ---- + vim.current.buffer.xxx = True:AttributeError:('xxx',) + >> BufferMark + vim.current.buffer.mark(0):TypeError:('expected str() or unicode() instance, but got int',) +! vim.current.buffer.mark("abcM"):ValueError:('mark name must be a single character',) + vim.current.buffer.mark("!"):error:('invalid mark name',) + >> BufferRange + vim.current.buffer.range(1, 2, 3):TypeError:('function takes exactly 2 arguments (3 given)',) +*************** +*** 1086,1092 **** + 2,xx + before + after +! vim.command("throw 'abc'"):error:('abc',) + Exe("throw 'def'"):error:('def',) + vim.eval("Exe('throw ''ghi''')"):error:('ghi',) + vim.eval("Exe('echoerr ''jkl''')"):error:('Vim(echoerr):jkl',) +--- 1089,1095 ---- + 2,xx + before + after +! vim.command("throw 'abcN'"):error:('abcN',) + Exe("throw 'def'"):error:('def',) + vim.eval("Exe('throw ''ghi''')"):error:('ghi',) + vim.eval("Exe('echoerr ''jkl''')"):error:('Vim(echoerr):jkl',) +*** ../vim-7.3.1232/src/testdir/test87.in 2013-06-12 14:20:15.000000000 +0200 +--- src/testdir/test87.in 2013-06-23 14:34:17.000000000 +0200 +*************** +*** 5,12 **** + :set noswapfile + :if !has('python3') | e! test.ok | wq! test.out | endif + :lang C +- :py3 import vim + :fun Test() + :let l = [] + :py3 l=vim.bindeval('l') + :py3 f=vim.bindeval('function("strlen")') +--- 5,12 ---- + :set noswapfile + :if !has('python3') | e! test.ok | wq! test.out | endif + :lang C + :fun Test() ++ :py3 import vim + :let l = [] + :py3 l=vim.bindeval('l') + :py3 f=vim.bindeval('function("strlen")') +*************** +*** 51,56 **** +--- 51,59 ---- + : $put =string(key) . ' : ' . string(Val) + : unlet key Val + :endfor ++ :py3 del dk ++ :py3 del di ++ :py3 del dv + :" + :" removing items with del + :py3 del l[2] +*************** +*** 169,180 **** + :unlockvar! l + :" + :" Function calls +! :function New(...) +! :return ['NewStart']+a:000+['NewEnd'] +! :endfunction +! :function DictNew(...) dict +! :return ['DictNewStart']+a:000+['DictNewEnd', self] +! :endfunction + :let l=[function('New'), function('DictNew')] + :py3 l=vim.bindeval('l') + :py3 l.extend(list(l[0](1, 2, 3))) +--- 172,183 ---- + :unlockvar! l + :" + :" Function calls +! :fun New(...) +! : return ['NewStart']+a:000+['NewEnd'] +! :endfun +! :fun DictNew(...) dict +! : return ['DictNewStart']+a:000+['DictNewEnd', self] +! :endfun + :let l=[function('New'), function('DictNew')] + :py3 l=vim.bindeval('l') + :py3 l.extend(list(l[0](1, 2, 3))) +*************** +*** 204,210 **** + : $put ='[0.0, 0.0]' + :endif + :let messages=[] +! :py3 < 8 # check if the background thread is working ++ :py3 del time ++ :py3 del threading + :$put =string(l) + :" + :" settrace +*************** +*** 326,337 **** + EOF + :py3 sys.settrace(traceit) + :py3 trace_main() + :py3 sys.settrace(None) + :$put =string(l) + :" + :" Vars + :let g:foo = 'bac' +! :let w:abc = 'def' + :let b:baz = 'bar' + :let t:bar = 'jkl' + :try +--- 335,348 ---- + EOF + :py3 sys.settrace(traceit) + :py3 trace_main() ++ :py3 del traceit ++ :py3 del trace_main + :py3 sys.settrace(None) + :$put =string(l) + :" + :" Vars + :let g:foo = 'bac' +! :let w:abc3 = 'def' + :let b:baz = 'bar' + :let t:bar = 'jkl' + :try +*************** +*** 340,346 **** + : put =py3eval('vim.vvars[''exception'']') + :endtry + :put =py3eval('vim.vars[''foo'']') +! :put =py3eval('vim.current.window.vars[''abc'']') + :put =py3eval('vim.current.buffer.vars[''baz'']') + :put =py3eval('vim.current.tabpage.vars[''bar'']') + :" +--- 351,357 ---- + : put =py3eval('vim.vvars[''exception'']') + :endtry + :put =py3eval('vim.vars[''foo'']') +! :put =py3eval('vim.current.window.vars[''abc3'']') + :put =py3eval('vim.current.buffer.vars[''baz'']') + :put =py3eval('vim.current.tabpage.vars[''bar'']') + :" +*************** +*** 388,403 **** + vim.command('let exc=' + repr(e.__class__.__name__)) + return 0 + EOF +! :function E(s) + : python3 e(vim.eval('a:s')) +! :endfunction +! :function Ev(s) + : let r=py3eval('ev(vim.eval("a:s"))') + : if exists('exc') + : throw exc + : endif + : return r +! :endfunction + :py3 gopts1=vim.options + :py3 wopts1=vim.windows[2].options + :py3 wopts2=vim.windows[0].options +--- 399,414 ---- + vim.command('let exc=' + repr(e.__class__.__name__)) + return 0 + EOF +! :fun E(s) + : python3 e(vim.eval('a:s')) +! :endfun +! :fun Ev(s) + : let r=py3eval('ev(vim.eval("a:s"))') + : if exists('exc') + : throw exc + : endif + : return r +! :endfun + :py3 gopts1=vim.options + :py3 wopts1=vim.windows[2].options + :py3 wopts2=vim.windows[0].options +*************** +*** 412,418 **** + :let lst+=[['operatorfunc', 'A', 'B', 'C', 2, 0, 1, 0 ]] + :let lst+=[['number', 0, 1, 1, 0, 1, 0, 1 ]] + :let lst+=[['numberwidth', 2, 3, 5, -100, 0, 0, 1 ]] +! :let lst+=[['colorcolumn', '+1', '+2', '+3', 'abc', 0, 0, 1 ]] + :let lst+=[['statusline', '1', '2', '4', 0, 0, 1, 1 ]] + :let lst+=[['autoindent', 0, 1, 1, 2, 1, 0, 2 ]] + :let lst+=[['shiftwidth', 0, 2, 1, 3, 0, 0, 2 ]] +--- 423,429 ---- + :let lst+=[['operatorfunc', 'A', 'B', 'C', 2, 0, 1, 0 ]] + :let lst+=[['number', 0, 1, 1, 0, 1, 0, 1 ]] + :let lst+=[['numberwidth', 2, 3, 5, -100, 0, 0, 1 ]] +! :let lst+=[['colorcolumn', '+1', '+2', '+3', 'abc4', 0, 0, 1 ]] + :let lst+=[['statusline', '1', '2', '4', 0, 0, 1, 1 ]] + :let lst+=[['autoindent', 0, 1, 1, 2, 1, 0, 2 ]] + :let lst+=[['shiftwidth', 0, 2, 1, 3, 0, 0, 2 ]] +*************** +*** 462,471 **** +--- 473,499 ---- + : endfor + : call RecVars(oname) + :endfor ++ :delfunction RecVars ++ :delfunction E ++ :delfunction Ev ++ :py3 del ev ++ :py3 del e + :only + :for buf in g:bufs[1:] + : execute 'bwipeout!' buf + :endfor ++ :py3 del gopts1 ++ :py3 del wopts1 ++ :py3 del wopts2 ++ :py3 del wopts3 ++ :py3 del bopts1 ++ :py3 del bopts2 ++ :py3 del bopts3 ++ :py3 del oval1 ++ :py3 del oval2 ++ :py3 del oval3 ++ :py3 del oname ++ :py3 del invval + :" + :" Test buffer object + :vnew +*************** +*** 485,491 **** + # Tests BufferAppend and BufferItem + cb.append(b[0]) + # Tests BufferSlice and BufferAssSlice +! cb.append('abc') # Will be overwritten + cb[-1:] = b[:-2] + # Test BufferLength and BufferAssSlice + cb.append('def') # Will not be overwritten +--- 513,519 ---- + # Tests BufferAppend and BufferItem + cb.append(b[0]) + # Tests BufferSlice and BufferAssSlice +! cb.append('abc5') # Will be overwritten + cb[-1:] = b[:-2] + # Test BufferLength and BufferAssSlice + cb.append('def') # Will not be overwritten +*************** +*** 509,521 **** + cb.append(b.name[-11:].replace(os.path.sep, '/')) + cb.name = old_name + cb.append(cb.name[-17:].replace(os.path.sep, '/')) + # Test CheckBuffer + for _b in vim.buffers: + if _b is not cb: + vim.command('bwipeout! ' + str(_b.number)) + del _b + cb.append('valid: b:%s, cb:%s' % (repr(b.valid), repr(cb.valid))) +! for expr in ('b[1]','b[:] = ["A", "B"]','b[:]','b.append("abc")'): + try: + exec(expr) + except vim.error: +--- 537,550 ---- + cb.append(b.name[-11:].replace(os.path.sep, '/')) + cb.name = old_name + cb.append(cb.name[-17:].replace(os.path.sep, '/')) ++ del old_name + # Test CheckBuffer + for _b in vim.buffers: + if _b is not cb: + vim.command('bwipeout! ' + str(_b.number)) + del _b + cb.append('valid: b:%s, cb:%s' % (repr(b.valid), repr(cb.valid))) +! for expr in ('b[1]','b[:] = ["A", "B"]','b[:]','b.append("abc6")'): + try: + exec(expr) + except vim.error: +*************** +*** 525,530 **** +--- 554,560 ---- + # Should not happen in any case + cb.append('No exception for ' + expr) + vim.command('cd .') ++ del b + EOF + :" + :" Test vim.buffers object +*************** +*** 558,563 **** +--- 588,594 ---- + # Check indexing: vim.buffers[number].number == number + cb.append(str(b.number) + ':' + repr(vim.buffers[b.number]) + '=' + repr(b)) + prevnum = b.number ++ del prevnum + + cb.append(str(len(vim.buffers))) + +*************** +*** 581,586 **** +--- 612,619 ---- + next(i4) + except StopIteration: + cb.append('StopIteration') ++ del i4 ++ del bnums + EOF + :" + :" Test vim.{tabpage,window}list and vim.{tabpage,window} objects +*************** +*** 622,628 **** +--- 655,665 ---- + raise ValueError + except Exception as e: + cb.append('!!!!!! Error while getting attribute ' + attr + ': ' + e.__class__.__name__) ++ del aval ++ del attr + w.cursor = (len(w.buffer), 0) ++ del W ++ del Cursor + cb.append('Number of windows in current tab page: ' + str(len(vim.windows))) + if list(vim.windows) != list(vim.current.tabpage.windows): + cb.append('!!!!!! Windows differ') +*************** +*** 635,640 **** +--- 672,678 ---- + cb.append('Current tab page: ' + repr(vim.current.tabpage)) + cb.append('Current window: ' + repr(vim.current.window) + ': ' + H(vim.current.window) + ' is ' + H(vim.current.tabpage.window)) + cb.append('Current buffer: ' + repr(vim.current.buffer) + ': ' + H(vim.current.buffer) + ' is ' + H(vim.current.window.buffer)+ ' is ' + H(vim.current.tabpage.window.buffer)) ++ del H + # Assigning: fails + try: + vim.current.window = vim.tabpages[0].window +*************** +*** 646,651 **** +--- 684,690 ---- + setattr(vim.current, attr, None) + except TypeError: + cb.append('Type error at assigning None to vim.current.' + attr) ++ del attr + + # Assigning: success + vim.current.tabpage = vim.tabpages[-2] +*************** +*** 661,668 **** +--- 700,712 ---- + for b in vim.buffers: + if b is not cb: + vim.command('bwipeout! ' + str(b.number)) ++ del b + cb.append('w.valid: ' + repr([w.valid for w in ws])) + cb.append('t.valid: ' + repr([t.valid for t in ts])) ++ del w ++ del t ++ del ts ++ del ws + EOF + :tabonly! + :only! +*************** +*** 681,686 **** +--- 725,732 ---- + ('vim.current.tabpage', 'TabPage'), + ): + cb.append(expr + ':' + attr + ':' + repr(type(eval(expr)) is getattr(vim, attr))) ++ del expr ++ del attr + EOF + :" + :" Test __dir__() method +*************** +*** 706,720 **** + :$put =string(py3eval('vim.Dictionary(a=1)')) + :$put =string(py3eval('vim.Dictionary(((''a'', 1),))')) + :$put =string(py3eval('vim.List()')) +! :$put =string(py3eval('vim.List(iter(''abc''))')) + :$put =string(py3eval('vim.Function(''tr'')')) + :" + :" Test stdout/stderr + :redir => messages +! :py3 sys.stdout.write('abc') ; sys.stdout.write('def') +! :py3 sys.stderr.write('abc') ; sys.stderr.write('def') +! :py3 sys.stdout.writelines(iter('abc')) +! :py3 sys.stderr.writelines(iter('abc')) + :redir END + :$put =string(substitute(messages, '\d\+', '', 'g')) + :" Test subclassing +--- 752,766 ---- + :$put =string(py3eval('vim.Dictionary(a=1)')) + :$put =string(py3eval('vim.Dictionary(((''a'', 1),))')) + :$put =string(py3eval('vim.List()')) +! :$put =string(py3eval('vim.List(iter(''abc7''))')) + :$put =string(py3eval('vim.Function(''tr'')')) + :" + :" Test stdout/stderr + :redir => messages +! :py3 sys.stdout.write('abc8') ; sys.stdout.write('def') +! :py3 sys.stderr.write('abc9') ; sys.stderr.write('def') +! :py3 sys.stdout.writelines(iter('abcA')) +! :py3 sys.stderr.writelines(iter('abcB')) + :redir END + :$put =string(substitute(messages, '\d\+', '', 'g')) + :" Test subclassing +*************** +*** 735,741 **** + return [super(DupList, self).__getitem__(idx)] * 2 + + dl = DupList() +! dl2 = DupList(iter('abc')) + dl.extend(dl2[0]) + + class DupFun(vim.Function): +--- 781,787 ---- + return [super(DupList, self).__getitem__(idx)] * 2 + + dl = DupList() +! dl2 = DupList(iter('abcC')) + dl.extend(dl2[0]) + + class DupFun(vim.Function): +*************** +*** 748,753 **** +--- 794,812 ---- + :$put =string(py3eval('dl')) + :$put =string(py3eval('dl2')) + :$put =string(py3eval('df(2)')) ++ :$put =string(py3eval('dl') is# py3eval('dl')) ++ :$put =string(py3eval('dd') is# py3eval('dd')) ++ :$put =string(py3eval('df')) ++ :delfunction Put ++ py3 << EOF ++ del DupDict ++ del DupList ++ del DupFun ++ del dd ++ del dl ++ del dl2 ++ del df ++ EOF + :" + :" Test chdir + py3 << EOF +*************** +*** 761,766 **** +--- 820,826 ---- + os.chdir('testdir') + cb.append(str(fnamemodify('.', ':p:h:t'))) + cb.append(vim.eval('@%')) ++ del fnamemodify + EOF + :" + :" Test errors +*************** +*** 784,794 **** + cb.append(expr + '::' + repr((e.__class__, e))) + + d = vim.Dictionary() +! ned = vim.Dictionary(foo='bar', baz='abc') + dl = vim.Dictionary(a=1) + dl.locked = True + l = vim.List() +! ll = vim.List('abc') + ll.locked = True + f = vim.Function('string') + fd = vim.Function('F') +--- 844,854 ---- + cb.append(expr + '::' + repr((e.__class__, e))) + + d = vim.Dictionary() +! ned = vim.Dictionary(foo='bar', baz='abcD') + dl = vim.Dictionary(a=1) + dl.locked = True + l = vim.List() +! ll = vim.List('abcE') + ll.locked = True + f = vim.Function('string') + fd = vim.Function('F') +*************** +*** 825,835 **** + # pydict_to_tv + stringtochars_test(expr % '{%s : 1}') + if recurse: +! convertfrompyobject_test(expr % '{"abc" : %s}', False) + # pymap_to_tv + stringtochars_test(expr % 'Mapping({%s : 1})') + if recurse: +! convertfrompyobject_test(expr % 'Mapping({"abc" : %s})', False) + # pyseq_to_tv + iter_test(expr) + return subexpr_test(expr, 'ConvertFromPyObject', ( +--- 885,895 ---- + # pydict_to_tv + stringtochars_test(expr % '{%s : 1}') + if recurse: +! convertfrompyobject_test(expr % '{"abcF" : %s}', False) + # pymap_to_tv + stringtochars_test(expr % 'Mapping({%s : 1})') + if recurse: +! convertfrompyobject_test(expr % 'Mapping({"abcG" : %s})', False) + # pyseq_to_tv + iter_test(expr) + return subexpr_test(expr, 'ConvertFromPyObject', ( +*************** +*** 872,878 **** + raise NotImplementedError + + def keys(self): +! return list("abc") + + class FailingMapping(object): + def __getitem__(self): +--- 932,938 ---- + raise NotImplementedError + + def keys(self): +! return list("abcH") + + class FailingMapping(object): + def __getitem__(self): +*************** +*** 914,920 **** + ee('vim.strwidth(1)') + cb.append("> Dictionary") + cb.append(">> DictionaryConstructor") +! ee('vim.Dictionary("abc")') + ##! Not checked: py_dict_alloc failure + cb.append(">> DictionarySetattr") + ee('del d.locked') +--- 974,980 ---- + ee('vim.strwidth(1)') + cb.append("> Dictionary") + cb.append(">> DictionaryConstructor") +! ee('vim.Dictionary("abcI")') + ##! Not checked: py_dict_alloc failure + cb.append(">> DictionarySetattr") + ee('del d.locked') +*************** +*** 929,934 **** +--- 989,995 ---- + ee('dl.pop("a")') + cb.append(">> DictionaryIterNext") + ee('for i in ned: ned["a"] = 1') ++ del i + cb.append(">> DictionaryAssItem") + ee('dl["b"] = 1') + stringtochars_test('d[%s] = 1') +*************** +*** 958,964 **** + ee('ll[1] = 2') + ee('l[1000] = 3') + cb.append(">> ListAssSlice") +! ee('ll[1:100] = "abc"') + iter_test('l[:] = %s') + convertfrompyobject_test('l[:] = [%s]') + cb.append(">> ListConcatInPlace") +--- 1019,1025 ---- + ee('ll[1] = 2') + ee('l[1000] = 3') + cb.append(">> ListAssSlice") +! ee('ll[1:100] = "abcJ"') + iter_test('l[:] = %s') + convertfrompyobject_test('l[:] = [%s]') + cb.append(">> ListConcatInPlace") +*************** +*** 989,996 **** + ee('vim.current.window.buffer = 0') + ee('vim.current.window.cursor = (100000000, 100000000)') + ee('vim.current.window.cursor = True') +! ee('vim.current.window.height = "abc"') +! ee('vim.current.window.width = "abc"') + ee('vim.current.window.xxxxxx = True') + cb.append("> WinList") + cb.append(">> WinListItem") +--- 1050,1057 ---- + ee('vim.current.window.buffer = 0') + ee('vim.current.window.cursor = (100000000, 100000000)') + ee('vim.current.window.cursor = True') +! ee('vim.current.window.height = "abcK"') +! ee('vim.current.window.width = "abcL"') + ee('vim.current.window.xxxxxx = True') + cb.append("> WinList") + cb.append(">> WinListItem") +*************** +*** 1000,1006 **** + ee('vim.current.buffer[0] = "\\na"') + cb.append(">> SetBufferLine (indirect)") + ee('vim.current.buffer[0] = True') +! cb.append(">> SetBufferLines (indirect)") + ee('vim.current.buffer[:] = True') + ee('vim.current.buffer[:] = ["\\na", "bc"]') + cb.append(">> InsertBufferLines (indirect)") +--- 1061,1067 ---- + ee('vim.current.buffer[0] = "\\na"') + cb.append(">> SetBufferLine (indirect)") + ee('vim.current.buffer[0] = True') +! cb.append(">> SetBufferLineList (indirect)") + ee('vim.current.buffer[:] = True') + ee('vim.current.buffer[:] = ["\\na", "bc"]') + cb.append(">> InsertBufferLines (indirect)") +*************** +*** 1018,1024 **** + ee('vim.current.buffer.xxx = True') + cb.append(">> BufferMark") + ee('vim.current.buffer.mark(0)') +! ee('vim.current.buffer.mark("abc")') + ee('vim.current.buffer.mark("!")') + cb.append(">> BufferRange") + ee('vim.current.buffer.range(1, 2, 3)') +--- 1079,1085 ---- + ee('vim.current.buffer.xxx = True') + cb.append(">> BufferMark") + ee('vim.current.buffer.mark(0)') +! ee('vim.current.buffer.mark("abcM")') + ee('vim.current.buffer.mark("!")') + cb.append(">> BufferRange") + ee('vim.current.buffer.range(1, 2, 3)') +*************** +*** 1035,1041 **** +--- 1096,1123 ---- + ee('vim.current.window = True') + ee('vim.current.tabpage = True') + ee('vim.current.xxx = True') ++ del d ++ del ned ++ del dl ++ del l ++ del ll ++ del f ++ del fd ++ del fdel ++ del subexpr_test ++ del stringtochars_test ++ del Mapping ++ del convertfrompyobject_test ++ del convertfrompymapping_test ++ del iter_test ++ del FailingTrue ++ del FailingIter ++ del FailingIterNext ++ del FailingMapping ++ del FailingMappingKey ++ del FailingList + EOF ++ :delfunction F + :" + :" Test import + py3 << EOF +*************** +*** 1049,1054 **** +--- 1131,1140 ---- + cb.append(before.dir) + import after + cb.append(after.dir) ++ del before ++ del after ++ del d ++ del ddir + EOF + :" + :" Test exceptions +*************** +*** 1057,1074 **** + :endfun + py3 << EOF + Exe = vim.bindeval('function("Exe")') +! ee('vim.command("throw \'abc\'")') + ee('Exe("throw \'def\'")') + ee('vim.eval("Exe(\'throw \'\'ghi\'\'\')")') + ee('vim.eval("Exe(\'echoerr \'\'jkl\'\'\')")') + ee('vim.eval("Exe(\'xxx_non_existent_command_xxx\')")') + ee('vim.bindeval("Exe(\'xxx_non_existent_command_xxx\')")') + EOF + :endfun + :" +! :call Test() + :" +! :delfunc Test + :call garbagecollect(1) + :" + :/^start:/,$wq! test.out +--- 1143,1190 ---- + :endfun + py3 << EOF + Exe = vim.bindeval('function("Exe")') +! ee('vim.command("throw \'abcN\'")') + ee('Exe("throw \'def\'")') + ee('vim.eval("Exe(\'throw \'\'ghi\'\'\')")') + ee('vim.eval("Exe(\'echoerr \'\'jkl\'\'\')")') + ee('vim.eval("Exe(\'xxx_non_existent_command_xxx\')")') + ee('vim.bindeval("Exe(\'xxx_non_existent_command_xxx\')")') ++ del Exe ++ EOF ++ :delfunction Exe ++ :" ++ :" Cleanup ++ py3 << EOF ++ del cb ++ del ee ++ del sys ++ del os ++ del vim + EOF + :endfun + :" +! :fun RunTest() +! :let checkrefs = !empty($PYTHONDUMPREFS) +! :let start = getline(1, '$') +! :for i in range(checkrefs ? 10 : 1) +! : if i != 0 +! : %d _ +! : call setline(1, start) +! : endif +! : call Test() +! : if i == 0 +! : let result = getline(1, '$') +! : endif +! :endfor +! :if checkrefs +! : %d _ +! : call setline(1, result) +! :endif +! :endfun + :" +! :call RunTest() +! :delfunction RunTest +! :delfunction Test + :call garbagecollect(1) + :" + :/^start:/,$wq! test.out +*** ../vim-7.3.1232/src/testdir/test87.ok 2013-06-23 14:16:53.000000000 +0200 +--- src/testdir/test87.ok 2013-06-23 14:34:17.000000000 +0200 +*************** +*** 68,74 **** + dl : locked:1;scope:0 + v: : locked:2;scope:1 + g: : locked:0;scope:2 +! d:{'abc': 1} + dl:{'def': 1} + l : locked:0 + ll : locked:1 +--- 68,74 ---- + dl : locked:1;scope:0 + v: : locked:2;scope:1 + g: : locked:0;scope:2 +! d:{'abc2': 1} + dl:{'def': 1} + l : locked:0 + ll : locked:1 +*************** +*** 191,202 **** + B: 1:3 2:5 3:2 4:8 + >>> colorcolumn + p/gopts1! KeyError +! inv: 'abc'! KeyError + gopts1! KeyError + p/wopts1: b'' +! inv: 'abc'! error + p/bopts1! KeyError +! inv: 'abc'! KeyError + bopts1! KeyError + bopts2! KeyError + bopts3! KeyError +--- 191,202 ---- + B: 1:3 2:5 3:2 4:8 + >>> colorcolumn + p/gopts1! KeyError +! inv: 'abc4'! KeyError + gopts1! KeyError + p/wopts1: b'' +! inv: 'abc4'! error + p/bopts1! KeyError +! inv: 'abc4'! KeyError + bopts1! KeyError + bopts2! KeyError + bopts3! KeyError +*************** +*** 404,423 **** + {'a': 1} + {'a': 1} + [] +! ['a', 'b', 'c'] + function('tr') + ' + abcdef + line : + abcdef +! abc + line : +! abc' + ['a', 'dup_a'] + ['a', 'a'] +! ['a', 'b', 'c'] + [2, 2] + [2, 2] + b'testdir' + test87.in + b'src' +--- 404,426 ---- + {'a': 1} + {'a': 1} + [] +! ['a', 'b', 'c', '7'] + function('tr') + ' + abcdef + line : + abcdef +! abcA + line : +! abcB' + ['a', 'dup_a'] + ['a', 'a'] +! ['a', 'b', 'c', 'C'] + [2, 2] + [2, 2] ++ 1 ++ 1 ++ function('Put') + b'testdir' + test87.in + b'src' +*************** +*** 449,455 **** + vim.strwidth(1):(, TypeError('expected bytes() or str() instance, but got int',)) + > Dictionary + >> DictionaryConstructor +! vim.Dictionary("abc"):(, ValueError('expected sequence element of size 2, but got sequence of size 1',)) + >> DictionarySetattr + del d.locked:(, AttributeError('cannot delete vim.Dictionary attributes',)) + d.locked = FailingTrue():(, NotImplementedError()) +--- 452,458 ---- + vim.strwidth(1):(, TypeError('expected bytes() or str() instance, but got int',)) + > Dictionary + >> DictionaryConstructor +! vim.Dictionary("abcI"):(, ValueError('expected sequence element of size 2, but got sequence of size 1',)) + >> DictionarySetattr + del d.locked:(, AttributeError('cannot delete vim.Dictionary attributes',)) + d.locked = FailingTrue():(, NotImplementedError()) +*************** +*** 479,530 **** + d["a"] = {b"\0" : 1}:(, TypeError('expected bytes with no null',)) + d["a"] = {"\0" : 1}:(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using d["a"] = {"abc" : {%s : 1}} +! d["a"] = {"abc" : {1 : 1}}:(, TypeError('expected bytes() or str() instance, but got int',)) +! d["a"] = {"abc" : {b"\0" : 1}}:(, TypeError('expected bytes with no null',)) +! d["a"] = {"abc" : {"\0" : 1}}:(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d["a"] = {"abc" : Mapping({%s : 1})} +! d["a"] = {"abc" : Mapping({1 : 1})}:(, TypeError('expected bytes() or str() instance, but got int',)) +! d["a"] = {"abc" : Mapping({b"\0" : 1})}:(, TypeError('expected bytes with no null',)) +! d["a"] = {"abc" : Mapping({"\0" : 1})}:(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using d["a"] = {"abc" : %s} +! d["a"] = {"abc" : FailingIter()}:(, TypeError('unable to convert FailingIter to vim structure',)) +! d["a"] = {"abc" : FailingIterNext()}:(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d["a"] = {"abc" : %s} +! d["a"] = {"abc" : None}:(, TypeError('unable to convert NoneType to vim structure',)) +! d["a"] = {"abc" : {b"": 1}}:(, ValueError('empty keys are not allowed',)) +! d["a"] = {"abc" : {"": 1}}:(, ValueError('empty keys are not allowed',)) +! d["a"] = {"abc" : FailingMapping()}:(, NotImplementedError()) +! d["a"] = {"abc" : FailingMappingKey()}:(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({%s : 1}) + d["a"] = Mapping({1 : 1}):(, TypeError('expected bytes() or str() instance, but got int',)) + d["a"] = Mapping({b"\0" : 1}):(, TypeError('expected bytes with no null',)) + d["a"] = Mapping({"\0" : 1}):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using d["a"] = Mapping({"abc" : {%s : 1}}) +! d["a"] = Mapping({"abc" : {1 : 1}}):(, TypeError('expected bytes() or str() instance, but got int',)) +! d["a"] = Mapping({"abc" : {b"\0" : 1}}):(, TypeError('expected bytes with no null',)) +! d["a"] = Mapping({"abc" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d["a"] = Mapping({"abc" : Mapping({%s : 1})}) +! d["a"] = Mapping({"abc" : Mapping({1 : 1})}):(, TypeError('expected bytes() or str() instance, but got int',)) +! d["a"] = Mapping({"abc" : Mapping({b"\0" : 1})}):(, TypeError('expected bytes with no null',)) +! d["a"] = Mapping({"abc" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using d["a"] = Mapping({"abc" : %s}) +! d["a"] = Mapping({"abc" : FailingIter()}):(, TypeError('unable to convert FailingIter to vim structure',)) +! d["a"] = Mapping({"abc" : FailingIterNext()}):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abc" : %s}) +! d["a"] = Mapping({"abc" : None}):(, TypeError('unable to convert NoneType to vim structure',)) +! d["a"] = Mapping({"abc" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) +! d["a"] = Mapping({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! d["a"] = Mapping({"abc" : FailingMapping()}):(, NotImplementedError()) +! d["a"] = Mapping({"abc" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using d["a"] = %s + d["a"] = FailingIter():(, TypeError('unable to convert FailingIter to vim structure',)) +--- 482,533 ---- + d["a"] = {b"\0" : 1}:(, TypeError('expected bytes with no null',)) + d["a"] = {"\0" : 1}:(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using d["a"] = {"abcF" : {%s : 1}} +! d["a"] = {"abcF" : {1 : 1}}:(, TypeError('expected bytes() or str() instance, but got int',)) +! d["a"] = {"abcF" : {b"\0" : 1}}:(, TypeError('expected bytes with no null',)) +! d["a"] = {"abcF" : {"\0" : 1}}:(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d["a"] = {"abcF" : Mapping({%s : 1})} +! d["a"] = {"abcF" : Mapping({1 : 1})}:(, TypeError('expected bytes() or str() instance, but got int',)) +! d["a"] = {"abcF" : Mapping({b"\0" : 1})}:(, TypeError('expected bytes with no null',)) +! d["a"] = {"abcF" : Mapping({"\0" : 1})}:(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using d["a"] = {"abcF" : %s} +! d["a"] = {"abcF" : FailingIter()}:(, TypeError('unable to convert FailingIter to vim structure',)) +! d["a"] = {"abcF" : FailingIterNext()}:(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d["a"] = {"abcF" : %s} +! d["a"] = {"abcF" : None}:(, TypeError('unable to convert NoneType to vim structure',)) +! d["a"] = {"abcF" : {b"": 1}}:(, ValueError('empty keys are not allowed',)) +! d["a"] = {"abcF" : {"": 1}}:(, ValueError('empty keys are not allowed',)) +! d["a"] = {"abcF" : FailingMapping()}:(, NotImplementedError()) +! d["a"] = {"abcF" : FailingMappingKey()}:(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({%s : 1}) + d["a"] = Mapping({1 : 1}):(, TypeError('expected bytes() or str() instance, but got int',)) + d["a"] = Mapping({b"\0" : 1}):(, TypeError('expected bytes with no null',)) + d["a"] = Mapping({"\0" : 1}):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using d["a"] = Mapping({"abcG" : {%s : 1}}) +! d["a"] = Mapping({"abcG" : {1 : 1}}):(, TypeError('expected bytes() or str() instance, but got int',)) +! d["a"] = Mapping({"abcG" : {b"\0" : 1}}):(, TypeError('expected bytes with no null',)) +! d["a"] = Mapping({"abcG" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d["a"] = Mapping({"abcG" : Mapping({%s : 1})}) +! d["a"] = Mapping({"abcG" : Mapping({1 : 1})}):(, TypeError('expected bytes() or str() instance, but got int',)) +! d["a"] = Mapping({"abcG" : Mapping({b"\0" : 1})}):(, TypeError('expected bytes with no null',)) +! d["a"] = Mapping({"abcG" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using d["a"] = Mapping({"abcG" : %s}) +! d["a"] = Mapping({"abcG" : FailingIter()}):(, TypeError('unable to convert FailingIter to vim structure',)) +! d["a"] = Mapping({"abcG" : FailingIterNext()}):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abcG" : %s}) +! d["a"] = Mapping({"abcG" : None}):(, TypeError('unable to convert NoneType to vim structure',)) +! d["a"] = Mapping({"abcG" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) +! d["a"] = Mapping({"abcG" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! d["a"] = Mapping({"abcG" : FailingMapping()}):(, NotImplementedError()) +! d["a"] = Mapping({"abcG" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using d["a"] = %s + d["a"] = FailingIter():(, TypeError('unable to convert FailingIter to vim structure',)) +*************** +*** 551,602 **** + d.update({b"\0" : 1}):(, TypeError('expected bytes with no null',)) + d.update({"\0" : 1}):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using d.update({"abc" : {%s : 1}}) +! d.update({"abc" : {1 : 1}}):(, TypeError('expected bytes() or str() instance, but got int',)) +! d.update({"abc" : {b"\0" : 1}}):(, TypeError('expected bytes with no null',)) +! d.update({"abc" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d.update({"abc" : Mapping({%s : 1})}) +! d.update({"abc" : Mapping({1 : 1})}):(, TypeError('expected bytes() or str() instance, but got int',)) +! d.update({"abc" : Mapping({b"\0" : 1})}):(, TypeError('expected bytes with no null',)) +! d.update({"abc" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using d.update({"abc" : %s}) +! d.update({"abc" : FailingIter()}):(, TypeError('unable to convert FailingIter to vim structure',)) +! d.update({"abc" : FailingIterNext()}):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update({"abc" : %s}) +! d.update({"abc" : None}):(, TypeError('unable to convert NoneType to vim structure',)) +! d.update({"abc" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) +! d.update({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! d.update({"abc" : FailingMapping()}):(, NotImplementedError()) +! d.update({"abc" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d.update(Mapping({%s : 1})) + d.update(Mapping({1 : 1})):(, TypeError('expected bytes() or str() instance, but got int',)) + d.update(Mapping({b"\0" : 1})):(, TypeError('expected bytes with no null',)) + d.update(Mapping({"\0" : 1})):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using d.update(Mapping({"abc" : {%s : 1}})) +! d.update(Mapping({"abc" : {1 : 1}})):(, TypeError('expected bytes() or str() instance, but got int',)) +! d.update(Mapping({"abc" : {b"\0" : 1}})):(, TypeError('expected bytes with no null',)) +! d.update(Mapping({"abc" : {"\0" : 1}})):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d.update(Mapping({"abc" : Mapping({%s : 1})})) +! d.update(Mapping({"abc" : Mapping({1 : 1})})):(, TypeError('expected bytes() or str() instance, but got int',)) +! d.update(Mapping({"abc" : Mapping({b"\0" : 1})})):(, TypeError('expected bytes with no null',)) +! d.update(Mapping({"abc" : Mapping({"\0" : 1})})):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using d.update(Mapping({"abc" : %s})) +! d.update(Mapping({"abc" : FailingIter()})):(, TypeError('unable to convert FailingIter to vim structure',)) +! d.update(Mapping({"abc" : FailingIterNext()})):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update(Mapping({"abc" : %s})) +! d.update(Mapping({"abc" : None})):(, TypeError('unable to convert NoneType to vim structure',)) +! d.update(Mapping({"abc" : {b"": 1}})):(, ValueError('empty keys are not allowed',)) +! d.update(Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) +! d.update(Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) +! d.update(Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using d.update(%s) + d.update(FailingIter()):(, NotImplementedError()) +--- 554,605 ---- + d.update({b"\0" : 1}):(, TypeError('expected bytes with no null',)) + d.update({"\0" : 1}):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using d.update({"abcF" : {%s : 1}}) +! d.update({"abcF" : {1 : 1}}):(, TypeError('expected bytes() or str() instance, but got int',)) +! d.update({"abcF" : {b"\0" : 1}}):(, TypeError('expected bytes with no null',)) +! d.update({"abcF" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d.update({"abcF" : Mapping({%s : 1})}) +! d.update({"abcF" : Mapping({1 : 1})}):(, TypeError('expected bytes() or str() instance, but got int',)) +! d.update({"abcF" : Mapping({b"\0" : 1})}):(, TypeError('expected bytes with no null',)) +! d.update({"abcF" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using d.update({"abcF" : %s}) +! d.update({"abcF" : FailingIter()}):(, TypeError('unable to convert FailingIter to vim structure',)) +! d.update({"abcF" : FailingIterNext()}):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update({"abcF" : %s}) +! d.update({"abcF" : None}):(, TypeError('unable to convert NoneType to vim structure',)) +! d.update({"abcF" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) +! d.update({"abcF" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! d.update({"abcF" : FailingMapping()}):(, NotImplementedError()) +! d.update({"abcF" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d.update(Mapping({%s : 1})) + d.update(Mapping({1 : 1})):(, TypeError('expected bytes() or str() instance, but got int',)) + d.update(Mapping({b"\0" : 1})):(, TypeError('expected bytes with no null',)) + d.update(Mapping({"\0" : 1})):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using d.update(Mapping({"abcG" : {%s : 1}})) +! d.update(Mapping({"abcG" : {1 : 1}})):(, TypeError('expected bytes() or str() instance, but got int',)) +! d.update(Mapping({"abcG" : {b"\0" : 1}})):(, TypeError('expected bytes with no null',)) +! d.update(Mapping({"abcG" : {"\0" : 1}})):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d.update(Mapping({"abcG" : Mapping({%s : 1})})) +! d.update(Mapping({"abcG" : Mapping({1 : 1})})):(, TypeError('expected bytes() or str() instance, but got int',)) +! d.update(Mapping({"abcG" : Mapping({b"\0" : 1})})):(, TypeError('expected bytes with no null',)) +! d.update(Mapping({"abcG" : Mapping({"\0" : 1})})):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using d.update(Mapping({"abcG" : %s})) +! d.update(Mapping({"abcG" : FailingIter()})):(, TypeError('unable to convert FailingIter to vim structure',)) +! d.update(Mapping({"abcG" : FailingIterNext()})):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update(Mapping({"abcG" : %s})) +! d.update(Mapping({"abcG" : None})):(, TypeError('unable to convert NoneType to vim structure',)) +! d.update(Mapping({"abcG" : {b"": 1}})):(, ValueError('empty keys are not allowed',)) +! d.update(Mapping({"abcG" : {"": 1}})):(, ValueError('empty keys are not allowed',)) +! d.update(Mapping({"abcG" : FailingMapping()})):(, NotImplementedError()) +! d.update(Mapping({"abcG" : FailingMappingKey()})):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using d.update(%s) + d.update(FailingIter()):(, NotImplementedError()) +*************** +*** 619,670 **** + d.update((("a", {b"\0" : 1}),)):(, TypeError('expected bytes with no null',)) + d.update((("a", {"\0" : 1}),)):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using d.update((("a", {"abc" : {%s : 1}}),)) +! d.update((("a", {"abc" : {1 : 1}}),)):(, TypeError('expected bytes() or str() instance, but got int',)) +! d.update((("a", {"abc" : {b"\0" : 1}}),)):(, TypeError('expected bytes with no null',)) +! d.update((("a", {"abc" : {"\0" : 1}}),)):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d.update((("a", {"abc" : Mapping({%s : 1})}),)) +! d.update((("a", {"abc" : Mapping({1 : 1})}),)):(, TypeError('expected bytes() or str() instance, but got int',)) +! d.update((("a", {"abc" : Mapping({b"\0" : 1})}),)):(, TypeError('expected bytes with no null',)) +! d.update((("a", {"abc" : Mapping({"\0" : 1})}),)):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using d.update((("a", {"abc" : %s}),)) +! d.update((("a", {"abc" : FailingIter()}),)):(, TypeError('unable to convert FailingIter to vim structure',)) +! d.update((("a", {"abc" : FailingIterNext()}),)):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update((("a", {"abc" : %s}),)) +! d.update((("a", {"abc" : None}),)):(, TypeError('unable to convert NoneType to vim structure',)) +! d.update((("a", {"abc" : {b"": 1}}),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", {"abc" : {"": 1}}),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", {"abc" : FailingMapping()}),)):(, NotImplementedError()) +! d.update((("a", {"abc" : FailingMappingKey()}),)):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),)) + d.update((("a", Mapping({1 : 1})),)):(, TypeError('expected bytes() or str() instance, but got int',)) + d.update((("a", Mapping({b"\0" : 1})),)):(, TypeError('expected bytes with no null',)) + d.update((("a", Mapping({"\0" : 1})),)):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using d.update((("a", Mapping({"abc" : {%s : 1}})),)) +! d.update((("a", Mapping({"abc" : {1 : 1}})),)):(, TypeError('expected bytes() or str() instance, but got int',)) +! d.update((("a", Mapping({"abc" : {b"\0" : 1}})),)):(, TypeError('expected bytes with no null',)) +! d.update((("a", Mapping({"abc" : {"\0" : 1}})),)):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d.update((("a", Mapping({"abc" : Mapping({%s : 1})})),)) +! d.update((("a", Mapping({"abc" : Mapping({1 : 1})})),)):(, TypeError('expected bytes() or str() instance, but got int',)) +! d.update((("a", Mapping({"abc" : Mapping({b"\0" : 1})})),)):(, TypeError('expected bytes with no null',)) +! d.update((("a", Mapping({"abc" : Mapping({"\0" : 1})})),)):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using d.update((("a", Mapping({"abc" : %s})),)) +! d.update((("a", Mapping({"abc" : FailingIter()})),)):(, TypeError('unable to convert FailingIter to vim structure',)) +! d.update((("a", Mapping({"abc" : FailingIterNext()})),)):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abc" : %s})),)) +! d.update((("a", Mapping({"abc" : None})),)):(, TypeError('unable to convert NoneType to vim structure',)) +! d.update((("a", Mapping({"abc" : {b"": 1}})),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", Mapping({"abc" : {"": 1}})),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", Mapping({"abc" : FailingMapping()})),)):(, NotImplementedError()) +! d.update((("a", Mapping({"abc" : FailingMappingKey()})),)):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using d.update((("a", %s),)) + d.update((("a", FailingIter()),)):(, TypeError('unable to convert FailingIter to vim structure',)) +--- 622,673 ---- + d.update((("a", {b"\0" : 1}),)):(, TypeError('expected bytes with no null',)) + d.update((("a", {"\0" : 1}),)):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using d.update((("a", {"abcF" : {%s : 1}}),)) +! d.update((("a", {"abcF" : {1 : 1}}),)):(, TypeError('expected bytes() or str() instance, but got int',)) +! d.update((("a", {"abcF" : {b"\0" : 1}}),)):(, TypeError('expected bytes with no null',)) +! d.update((("a", {"abcF" : {"\0" : 1}}),)):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d.update((("a", {"abcF" : Mapping({%s : 1})}),)) +! d.update((("a", {"abcF" : Mapping({1 : 1})}),)):(, TypeError('expected bytes() or str() instance, but got int',)) +! d.update((("a", {"abcF" : Mapping({b"\0" : 1})}),)):(, TypeError('expected bytes with no null',)) +! d.update((("a", {"abcF" : Mapping({"\0" : 1})}),)):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using d.update((("a", {"abcF" : %s}),)) +! d.update((("a", {"abcF" : FailingIter()}),)):(, TypeError('unable to convert FailingIter to vim structure',)) +! d.update((("a", {"abcF" : FailingIterNext()}),)):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update((("a", {"abcF" : %s}),)) +! d.update((("a", {"abcF" : None}),)):(, TypeError('unable to convert NoneType to vim structure',)) +! d.update((("a", {"abcF" : {b"": 1}}),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", {"abcF" : {"": 1}}),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", {"abcF" : FailingMapping()}),)):(, NotImplementedError()) +! d.update((("a", {"abcF" : FailingMappingKey()}),)):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),)) + d.update((("a", Mapping({1 : 1})),)):(, TypeError('expected bytes() or str() instance, but got int',)) + d.update((("a", Mapping({b"\0" : 1})),)):(, TypeError('expected bytes with no null',)) + d.update((("a", Mapping({"\0" : 1})),)):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using d.update((("a", Mapping({"abcG" : {%s : 1}})),)) +! d.update((("a", Mapping({"abcG" : {1 : 1}})),)):(, TypeError('expected bytes() or str() instance, but got int',)) +! d.update((("a", Mapping({"abcG" : {b"\0" : 1}})),)):(, TypeError('expected bytes with no null',)) +! d.update((("a", Mapping({"abcG" : {"\0" : 1}})),)):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using d.update((("a", Mapping({"abcG" : Mapping({%s : 1})})),)) +! d.update((("a", Mapping({"abcG" : Mapping({1 : 1})})),)):(, TypeError('expected bytes() or str() instance, but got int',)) +! d.update((("a", Mapping({"abcG" : Mapping({b"\0" : 1})})),)):(, TypeError('expected bytes with no null',)) +! d.update((("a", Mapping({"abcG" : Mapping({"\0" : 1})})),)):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using d.update((("a", Mapping({"abcG" : %s})),)) +! d.update((("a", Mapping({"abcG" : FailingIter()})),)):(, TypeError('unable to convert FailingIter to vim structure',)) +! d.update((("a", Mapping({"abcG" : FailingIterNext()})),)):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abcG" : %s})),)) +! d.update((("a", Mapping({"abcG" : None})),)):(, TypeError('unable to convert NoneType to vim structure',)) +! d.update((("a", Mapping({"abcG" : {b"": 1}})),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", Mapping({"abcG" : {"": 1}})),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", Mapping({"abcG" : FailingMapping()})),)):(, NotImplementedError()) +! d.update((("a", Mapping({"abcG" : FailingMappingKey()})),)):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using d.update((("a", %s),)) + d.update((("a", FailingIter()),)):(, TypeError('unable to convert FailingIter to vim structure',)) +*************** +*** 694,745 **** + vim.List([{b"\0" : 1}]):(, TypeError('expected bytes with no null',)) + vim.List([{"\0" : 1}]):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using vim.List([{"abc" : {%s : 1}}]) +! vim.List([{"abc" : {1 : 1}}]):(, TypeError('expected bytes() or str() instance, but got int',)) +! vim.List([{"abc" : {b"\0" : 1}}]):(, TypeError('expected bytes with no null',)) +! vim.List([{"abc" : {"\0" : 1}}]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using vim.List([{"abc" : Mapping({%s : 1})}]) +! vim.List([{"abc" : Mapping({1 : 1})}]):(, TypeError('expected bytes() or str() instance, but got int',)) +! vim.List([{"abc" : Mapping({b"\0" : 1})}]):(, TypeError('expected bytes with no null',)) +! vim.List([{"abc" : Mapping({"\0" : 1})}]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using vim.List([{"abc" : %s}]) +! vim.List([{"abc" : FailingIter()}]):(, TypeError('unable to convert FailingIter to vim structure',)) +! vim.List([{"abc" : FailingIterNext()}]):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using vim.List([{"abc" : %s}]) +! vim.List([{"abc" : None}]):(, TypeError('unable to convert NoneType to vim structure',)) +! vim.List([{"abc" : {b"": 1}}]):(, ValueError('empty keys are not allowed',)) +! vim.List([{"abc" : {"": 1}}]):(, ValueError('empty keys are not allowed',)) +! vim.List([{"abc" : FailingMapping()}]):(, NotImplementedError()) +! vim.List([{"abc" : FailingMappingKey()}]):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({%s : 1})]) + vim.List([Mapping({1 : 1})]):(, TypeError('expected bytes() or str() instance, but got int',)) + vim.List([Mapping({b"\0" : 1})]):(, TypeError('expected bytes with no null',)) + vim.List([Mapping({"\0" : 1})]):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using vim.List([Mapping({"abc" : {%s : 1}})]) +! vim.List([Mapping({"abc" : {1 : 1}})]):(, TypeError('expected bytes() or str() instance, but got int',)) +! vim.List([Mapping({"abc" : {b"\0" : 1}})]):(, TypeError('expected bytes with no null',)) +! vim.List([Mapping({"abc" : {"\0" : 1}})]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using vim.List([Mapping({"abc" : Mapping({%s : 1})})]) +! vim.List([Mapping({"abc" : Mapping({1 : 1})})]):(, TypeError('expected bytes() or str() instance, but got int',)) +! vim.List([Mapping({"abc" : Mapping({b"\0" : 1})})]):(, TypeError('expected bytes with no null',)) +! vim.List([Mapping({"abc" : Mapping({"\0" : 1})})]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using vim.List([Mapping({"abc" : %s})]) +! vim.List([Mapping({"abc" : FailingIter()})]):(, TypeError('unable to convert FailingIter to vim structure',)) +! vim.List([Mapping({"abc" : FailingIterNext()})]):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using vim.List([Mapping({"abc" : %s})]) +! vim.List([Mapping({"abc" : None})]):(, TypeError('unable to convert NoneType to vim structure',)) +! vim.List([Mapping({"abc" : {b"": 1}})]):(, ValueError('empty keys are not allowed',)) +! vim.List([Mapping({"abc" : {"": 1}})]):(, ValueError('empty keys are not allowed',)) +! vim.List([Mapping({"abc" : FailingMapping()})]):(, NotImplementedError()) +! vim.List([Mapping({"abc" : FailingMappingKey()})]):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using vim.List([%s]) + vim.List([FailingIter()]):(, TypeError('unable to convert FailingIter to vim structure',)) +--- 697,748 ---- + vim.List([{b"\0" : 1}]):(, TypeError('expected bytes with no null',)) + vim.List([{"\0" : 1}]):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using vim.List([{"abcF" : {%s : 1}}]) +! vim.List([{"abcF" : {1 : 1}}]):(, TypeError('expected bytes() or str() instance, but got int',)) +! vim.List([{"abcF" : {b"\0" : 1}}]):(, TypeError('expected bytes with no null',)) +! vim.List([{"abcF" : {"\0" : 1}}]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using vim.List([{"abcF" : Mapping({%s : 1})}]) +! vim.List([{"abcF" : Mapping({1 : 1})}]):(, TypeError('expected bytes() or str() instance, but got int',)) +! vim.List([{"abcF" : Mapping({b"\0" : 1})}]):(, TypeError('expected bytes with no null',)) +! vim.List([{"abcF" : Mapping({"\0" : 1})}]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using vim.List([{"abcF" : %s}]) +! vim.List([{"abcF" : FailingIter()}]):(, TypeError('unable to convert FailingIter to vim structure',)) +! vim.List([{"abcF" : FailingIterNext()}]):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using vim.List([{"abcF" : %s}]) +! vim.List([{"abcF" : None}]):(, TypeError('unable to convert NoneType to vim structure',)) +! vim.List([{"abcF" : {b"": 1}}]):(, ValueError('empty keys are not allowed',)) +! vim.List([{"abcF" : {"": 1}}]):(, ValueError('empty keys are not allowed',)) +! vim.List([{"abcF" : FailingMapping()}]):(, NotImplementedError()) +! vim.List([{"abcF" : FailingMappingKey()}]):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({%s : 1})]) + vim.List([Mapping({1 : 1})]):(, TypeError('expected bytes() or str() instance, but got int',)) + vim.List([Mapping({b"\0" : 1})]):(, TypeError('expected bytes with no null',)) + vim.List([Mapping({"\0" : 1})]):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using vim.List([Mapping({"abcG" : {%s : 1}})]) +! vim.List([Mapping({"abcG" : {1 : 1}})]):(, TypeError('expected bytes() or str() instance, but got int',)) +! vim.List([Mapping({"abcG" : {b"\0" : 1}})]):(, TypeError('expected bytes with no null',)) +! vim.List([Mapping({"abcG" : {"\0" : 1}})]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using vim.List([Mapping({"abcG" : Mapping({%s : 1})})]) +! vim.List([Mapping({"abcG" : Mapping({1 : 1})})]):(, TypeError('expected bytes() or str() instance, but got int',)) +! vim.List([Mapping({"abcG" : Mapping({b"\0" : 1})})]):(, TypeError('expected bytes with no null',)) +! vim.List([Mapping({"abcG" : Mapping({"\0" : 1})})]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using vim.List([Mapping({"abcG" : %s})]) +! vim.List([Mapping({"abcG" : FailingIter()})]):(, TypeError('unable to convert FailingIter to vim structure',)) +! vim.List([Mapping({"abcG" : FailingIterNext()})]):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using vim.List([Mapping({"abcG" : %s})]) +! vim.List([Mapping({"abcG" : None})]):(, TypeError('unable to convert NoneType to vim structure',)) +! vim.List([Mapping({"abcG" : {b"": 1}})]):(, ValueError('empty keys are not allowed',)) +! vim.List([Mapping({"abcG" : {"": 1}})]):(, ValueError('empty keys are not allowed',)) +! vim.List([Mapping({"abcG" : FailingMapping()})]):(, NotImplementedError()) +! vim.List([Mapping({"abcG" : FailingMappingKey()})]):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using vim.List([%s]) + vim.List([FailingIter()]):(, TypeError('unable to convert FailingIter to vim structure',)) +*************** +*** 758,764 **** + ll[1] = 2:(, error('list is locked',)) + l[1000] = 3:(, IndexError('list index out of range',)) + >> ListAssSlice +! ll[1:100] = "abc":(, error('list is locked',)) + >>> Testing *Iter* using l[:] = %s + l[:] = FailingIter():(, NotImplementedError()) + l[:] = FailingIterNext()::(, NotImplementedError()) +--- 761,767 ---- + ll[1] = 2:(, error('list is locked',)) + l[1000] = 3:(, IndexError('list index out of range',)) + >> ListAssSlice +! ll[1:100] = "abcJ":(, error('list is locked',)) + >>> Testing *Iter* using l[:] = %s + l[:] = FailingIter():(, NotImplementedError()) + l[:] = FailingIterNext()::(, NotImplementedError()) +*************** +*** 768,819 **** + l[:] = [{b"\0" : 1}]:(, TypeError('expected bytes with no null',)) + l[:] = [{"\0" : 1}]:(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using l[:] = [{"abc" : {%s : 1}}] +! l[:] = [{"abc" : {1 : 1}}]:(, TypeError('expected bytes() or str() instance, but got int',)) +! l[:] = [{"abc" : {b"\0" : 1}}]:(, TypeError('expected bytes with no null',)) +! l[:] = [{"abc" : {"\0" : 1}}]:(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using l[:] = [{"abc" : Mapping({%s : 1})}] +! l[:] = [{"abc" : Mapping({1 : 1})}]:(, TypeError('expected bytes() or str() instance, but got int',)) +! l[:] = [{"abc" : Mapping({b"\0" : 1})}]:(, TypeError('expected bytes with no null',)) +! l[:] = [{"abc" : Mapping({"\0" : 1})}]:(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using l[:] = [{"abc" : %s}] +! l[:] = [{"abc" : FailingIter()}]:(, TypeError('unable to convert FailingIter to vim structure',)) +! l[:] = [{"abc" : FailingIterNext()}]:(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using l[:] = [{"abc" : %s}] +! l[:] = [{"abc" : None}]:(, TypeError('unable to convert NoneType to vim structure',)) +! l[:] = [{"abc" : {b"": 1}}]:(, ValueError('empty keys are not allowed',)) +! l[:] = [{"abc" : {"": 1}}]:(, ValueError('empty keys are not allowed',)) +! l[:] = [{"abc" : FailingMapping()}]:(, NotImplementedError()) +! l[:] = [{"abc" : FailingMappingKey()}]:(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({%s : 1})] + l[:] = [Mapping({1 : 1})]:(, TypeError('expected bytes() or str() instance, but got int',)) + l[:] = [Mapping({b"\0" : 1})]:(, TypeError('expected bytes with no null',)) + l[:] = [Mapping({"\0" : 1})]:(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using l[:] = [Mapping({"abc" : {%s : 1}})] +! l[:] = [Mapping({"abc" : {1 : 1}})]:(, TypeError('expected bytes() or str() instance, but got int',)) +! l[:] = [Mapping({"abc" : {b"\0" : 1}})]:(, TypeError('expected bytes with no null',)) +! l[:] = [Mapping({"abc" : {"\0" : 1}})]:(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using l[:] = [Mapping({"abc" : Mapping({%s : 1})})] +! l[:] = [Mapping({"abc" : Mapping({1 : 1})})]:(, TypeError('expected bytes() or str() instance, but got int',)) +! l[:] = [Mapping({"abc" : Mapping({b"\0" : 1})})]:(, TypeError('expected bytes with no null',)) +! l[:] = [Mapping({"abc" : Mapping({"\0" : 1})})]:(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using l[:] = [Mapping({"abc" : %s})] +! l[:] = [Mapping({"abc" : FailingIter()})]:(, TypeError('unable to convert FailingIter to vim structure',)) +! l[:] = [Mapping({"abc" : FailingIterNext()})]:(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abc" : %s})] +! l[:] = [Mapping({"abc" : None})]:(, TypeError('unable to convert NoneType to vim structure',)) +! l[:] = [Mapping({"abc" : {b"": 1}})]:(, ValueError('empty keys are not allowed',)) +! l[:] = [Mapping({"abc" : {"": 1}})]:(, ValueError('empty keys are not allowed',)) +! l[:] = [Mapping({"abc" : FailingMapping()})]:(, NotImplementedError()) +! l[:] = [Mapping({"abc" : FailingMappingKey()})]:(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using l[:] = [%s] + l[:] = [FailingIter()]:(, TypeError('unable to convert FailingIter to vim structure',)) +--- 771,822 ---- + l[:] = [{b"\0" : 1}]:(, TypeError('expected bytes with no null',)) + l[:] = [{"\0" : 1}]:(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using l[:] = [{"abcF" : {%s : 1}}] +! l[:] = [{"abcF" : {1 : 1}}]:(, TypeError('expected bytes() or str() instance, but got int',)) +! l[:] = [{"abcF" : {b"\0" : 1}}]:(, TypeError('expected bytes with no null',)) +! l[:] = [{"abcF" : {"\0" : 1}}]:(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using l[:] = [{"abcF" : Mapping({%s : 1})}] +! l[:] = [{"abcF" : Mapping({1 : 1})}]:(, TypeError('expected bytes() or str() instance, but got int',)) +! l[:] = [{"abcF" : Mapping({b"\0" : 1})}]:(, TypeError('expected bytes with no null',)) +! l[:] = [{"abcF" : Mapping({"\0" : 1})}]:(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using l[:] = [{"abcF" : %s}] +! l[:] = [{"abcF" : FailingIter()}]:(, TypeError('unable to convert FailingIter to vim structure',)) +! l[:] = [{"abcF" : FailingIterNext()}]:(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using l[:] = [{"abcF" : %s}] +! l[:] = [{"abcF" : None}]:(, TypeError('unable to convert NoneType to vim structure',)) +! l[:] = [{"abcF" : {b"": 1}}]:(, ValueError('empty keys are not allowed',)) +! l[:] = [{"abcF" : {"": 1}}]:(, ValueError('empty keys are not allowed',)) +! l[:] = [{"abcF" : FailingMapping()}]:(, NotImplementedError()) +! l[:] = [{"abcF" : FailingMappingKey()}]:(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({%s : 1})] + l[:] = [Mapping({1 : 1})]:(, TypeError('expected bytes() or str() instance, but got int',)) + l[:] = [Mapping({b"\0" : 1})]:(, TypeError('expected bytes with no null',)) + l[:] = [Mapping({"\0" : 1})]:(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using l[:] = [Mapping({"abcG" : {%s : 1}})] +! l[:] = [Mapping({"abcG" : {1 : 1}})]:(, TypeError('expected bytes() or str() instance, but got int',)) +! l[:] = [Mapping({"abcG" : {b"\0" : 1}})]:(, TypeError('expected bytes with no null',)) +! l[:] = [Mapping({"abcG" : {"\0" : 1}})]:(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using l[:] = [Mapping({"abcG" : Mapping({%s : 1})})] +! l[:] = [Mapping({"abcG" : Mapping({1 : 1})})]:(, TypeError('expected bytes() or str() instance, but got int',)) +! l[:] = [Mapping({"abcG" : Mapping({b"\0" : 1})})]:(, TypeError('expected bytes with no null',)) +! l[:] = [Mapping({"abcG" : Mapping({"\0" : 1})})]:(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using l[:] = [Mapping({"abcG" : %s})] +! l[:] = [Mapping({"abcG" : FailingIter()})]:(, TypeError('unable to convert FailingIter to vim structure',)) +! l[:] = [Mapping({"abcG" : FailingIterNext()})]:(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abcG" : %s})] +! l[:] = [Mapping({"abcG" : None})]:(, TypeError('unable to convert NoneType to vim structure',)) +! l[:] = [Mapping({"abcG" : {b"": 1}})]:(, ValueError('empty keys are not allowed',)) +! l[:] = [Mapping({"abcG" : {"": 1}})]:(, ValueError('empty keys are not allowed',)) +! l[:] = [Mapping({"abcG" : FailingMapping()})]:(, NotImplementedError()) +! l[:] = [Mapping({"abcG" : FailingMappingKey()})]:(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using l[:] = [%s] + l[:] = [FailingIter()]:(, TypeError('unable to convert FailingIter to vim structure',)) +*************** +*** 836,887 **** + l.extend([{b"\0" : 1}]):(, TypeError('expected bytes with no null',)) + l.extend([{"\0" : 1}]):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using l.extend([{"abc" : {%s : 1}}]) +! l.extend([{"abc" : {1 : 1}}]):(, TypeError('expected bytes() or str() instance, but got int',)) +! l.extend([{"abc" : {b"\0" : 1}}]):(, TypeError('expected bytes with no null',)) +! l.extend([{"abc" : {"\0" : 1}}]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using l.extend([{"abc" : Mapping({%s : 1})}]) +! l.extend([{"abc" : Mapping({1 : 1})}]):(, TypeError('expected bytes() or str() instance, but got int',)) +! l.extend([{"abc" : Mapping({b"\0" : 1})}]):(, TypeError('expected bytes with no null',)) +! l.extend([{"abc" : Mapping({"\0" : 1})}]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using l.extend([{"abc" : %s}]) +! l.extend([{"abc" : FailingIter()}]):(, TypeError('unable to convert FailingIter to vim structure',)) +! l.extend([{"abc" : FailingIterNext()}]):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using l.extend([{"abc" : %s}]) +! l.extend([{"abc" : None}]):(, TypeError('unable to convert NoneType to vim structure',)) +! l.extend([{"abc" : {b"": 1}}]):(, ValueError('empty keys are not allowed',)) +! l.extend([{"abc" : {"": 1}}]):(, ValueError('empty keys are not allowed',)) +! l.extend([{"abc" : FailingMapping()}]):(, NotImplementedError()) +! l.extend([{"abc" : FailingMappingKey()}]):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({%s : 1})]) + l.extend([Mapping({1 : 1})]):(, TypeError('expected bytes() or str() instance, but got int',)) + l.extend([Mapping({b"\0" : 1})]):(, TypeError('expected bytes with no null',)) + l.extend([Mapping({"\0" : 1})]):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using l.extend([Mapping({"abc" : {%s : 1}})]) +! l.extend([Mapping({"abc" : {1 : 1}})]):(, TypeError('expected bytes() or str() instance, but got int',)) +! l.extend([Mapping({"abc" : {b"\0" : 1}})]):(, TypeError('expected bytes with no null',)) +! l.extend([Mapping({"abc" : {"\0" : 1}})]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using l.extend([Mapping({"abc" : Mapping({%s : 1})})]) +! l.extend([Mapping({"abc" : Mapping({1 : 1})})]):(, TypeError('expected bytes() or str() instance, but got int',)) +! l.extend([Mapping({"abc" : Mapping({b"\0" : 1})})]):(, TypeError('expected bytes with no null',)) +! l.extend([Mapping({"abc" : Mapping({"\0" : 1})})]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using l.extend([Mapping({"abc" : %s})]) +! l.extend([Mapping({"abc" : FailingIter()})]):(, TypeError('unable to convert FailingIter to vim structure',)) +! l.extend([Mapping({"abc" : FailingIterNext()})]):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using l.extend([Mapping({"abc" : %s})]) +! l.extend([Mapping({"abc" : None})]):(, TypeError('unable to convert NoneType to vim structure',)) +! l.extend([Mapping({"abc" : {b"": 1}})]):(, ValueError('empty keys are not allowed',)) +! l.extend([Mapping({"abc" : {"": 1}})]):(, ValueError('empty keys are not allowed',)) +! l.extend([Mapping({"abc" : FailingMapping()})]):(, NotImplementedError()) +! l.extend([Mapping({"abc" : FailingMappingKey()})]):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using l.extend([%s]) + l.extend([FailingIter()]):(, TypeError('unable to convert FailingIter to vim structure',)) +--- 839,890 ---- + l.extend([{b"\0" : 1}]):(, TypeError('expected bytes with no null',)) + l.extend([{"\0" : 1}]):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using l.extend([{"abcF" : {%s : 1}}]) +! l.extend([{"abcF" : {1 : 1}}]):(, TypeError('expected bytes() or str() instance, but got int',)) +! l.extend([{"abcF" : {b"\0" : 1}}]):(, TypeError('expected bytes with no null',)) +! l.extend([{"abcF" : {"\0" : 1}}]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using l.extend([{"abcF" : Mapping({%s : 1})}]) +! l.extend([{"abcF" : Mapping({1 : 1})}]):(, TypeError('expected bytes() or str() instance, but got int',)) +! l.extend([{"abcF" : Mapping({b"\0" : 1})}]):(, TypeError('expected bytes with no null',)) +! l.extend([{"abcF" : Mapping({"\0" : 1})}]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using l.extend([{"abcF" : %s}]) +! l.extend([{"abcF" : FailingIter()}]):(, TypeError('unable to convert FailingIter to vim structure',)) +! l.extend([{"abcF" : FailingIterNext()}]):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using l.extend([{"abcF" : %s}]) +! l.extend([{"abcF" : None}]):(, TypeError('unable to convert NoneType to vim structure',)) +! l.extend([{"abcF" : {b"": 1}}]):(, ValueError('empty keys are not allowed',)) +! l.extend([{"abcF" : {"": 1}}]):(, ValueError('empty keys are not allowed',)) +! l.extend([{"abcF" : FailingMapping()}]):(, NotImplementedError()) +! l.extend([{"abcF" : FailingMappingKey()}]):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({%s : 1})]) + l.extend([Mapping({1 : 1})]):(, TypeError('expected bytes() or str() instance, but got int',)) + l.extend([Mapping({b"\0" : 1})]):(, TypeError('expected bytes with no null',)) + l.extend([Mapping({"\0" : 1})]):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using l.extend([Mapping({"abcG" : {%s : 1}})]) +! l.extend([Mapping({"abcG" : {1 : 1}})]):(, TypeError('expected bytes() or str() instance, but got int',)) +! l.extend([Mapping({"abcG" : {b"\0" : 1}})]):(, TypeError('expected bytes with no null',)) +! l.extend([Mapping({"abcG" : {"\0" : 1}})]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using l.extend([Mapping({"abcG" : Mapping({%s : 1})})]) +! l.extend([Mapping({"abcG" : Mapping({1 : 1})})]):(, TypeError('expected bytes() or str() instance, but got int',)) +! l.extend([Mapping({"abcG" : Mapping({b"\0" : 1})})]):(, TypeError('expected bytes with no null',)) +! l.extend([Mapping({"abcG" : Mapping({"\0" : 1})})]):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using l.extend([Mapping({"abcG" : %s})]) +! l.extend([Mapping({"abcG" : FailingIter()})]):(, TypeError('unable to convert FailingIter to vim structure',)) +! l.extend([Mapping({"abcG" : FailingIterNext()})]):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using l.extend([Mapping({"abcG" : %s})]) +! l.extend([Mapping({"abcG" : None})]):(, TypeError('unable to convert NoneType to vim structure',)) +! l.extend([Mapping({"abcG" : {b"": 1}})]):(, ValueError('empty keys are not allowed',)) +! l.extend([Mapping({"abcG" : {"": 1}})]):(, ValueError('empty keys are not allowed',)) +! l.extend([Mapping({"abcG" : FailingMapping()})]):(, NotImplementedError()) +! l.extend([Mapping({"abcG" : FailingMappingKey()})]):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using l.extend([%s]) + l.extend([FailingIter()]):(, TypeError('unable to convert FailingIter to vim structure',)) +*************** +*** 909,960 **** + f({b"\0" : 1}):(, TypeError('expected bytes with no null',)) + f({"\0" : 1}):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using f({"abc" : {%s : 1}}) +! f({"abc" : {1 : 1}}):(, TypeError('expected bytes() or str() instance, but got int',)) +! f({"abc" : {b"\0" : 1}}):(, TypeError('expected bytes with no null',)) +! f({"abc" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using f({"abc" : Mapping({%s : 1})}) +! f({"abc" : Mapping({1 : 1})}):(, TypeError('expected bytes() or str() instance, but got int',)) +! f({"abc" : Mapping({b"\0" : 1})}):(, TypeError('expected bytes with no null',)) +! f({"abc" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using f({"abc" : %s}) +! f({"abc" : FailingIter()}):(, TypeError('unable to convert FailingIter to vim structure',)) +! f({"abc" : FailingIterNext()}):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using f({"abc" : %s}) +! f({"abc" : None}):(, TypeError('unable to convert NoneType to vim structure',)) +! f({"abc" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) +! f({"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! f({"abc" : FailingMapping()}):(, NotImplementedError()) +! f({"abc" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using f(Mapping({%s : 1})) + f(Mapping({1 : 1})):(, TypeError('expected bytes() or str() instance, but got int',)) + f(Mapping({b"\0" : 1})):(, TypeError('expected bytes with no null',)) + f(Mapping({"\0" : 1})):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using f(Mapping({"abc" : {%s : 1}})) +! f(Mapping({"abc" : {1 : 1}})):(, TypeError('expected bytes() or str() instance, but got int',)) +! f(Mapping({"abc" : {b"\0" : 1}})):(, TypeError('expected bytes with no null',)) +! f(Mapping({"abc" : {"\0" : 1}})):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using f(Mapping({"abc" : Mapping({%s : 1})})) +! f(Mapping({"abc" : Mapping({1 : 1})})):(, TypeError('expected bytes() or str() instance, but got int',)) +! f(Mapping({"abc" : Mapping({b"\0" : 1})})):(, TypeError('expected bytes with no null',)) +! f(Mapping({"abc" : Mapping({"\0" : 1})})):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using f(Mapping({"abc" : %s})) +! f(Mapping({"abc" : FailingIter()})):(, TypeError('unable to convert FailingIter to vim structure',)) +! f(Mapping({"abc" : FailingIterNext()})):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using f(Mapping({"abc" : %s})) +! f(Mapping({"abc" : None})):(, TypeError('unable to convert NoneType to vim structure',)) +! f(Mapping({"abc" : {b"": 1}})):(, ValueError('empty keys are not allowed',)) +! f(Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) +! f(Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) +! f(Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using f(%s) + f(FailingIter()):(, TypeError('unable to convert FailingIter to vim structure',)) +--- 912,963 ---- + f({b"\0" : 1}):(, TypeError('expected bytes with no null',)) + f({"\0" : 1}):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using f({"abcF" : {%s : 1}}) +! f({"abcF" : {1 : 1}}):(, TypeError('expected bytes() or str() instance, but got int',)) +! f({"abcF" : {b"\0" : 1}}):(, TypeError('expected bytes with no null',)) +! f({"abcF" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using f({"abcF" : Mapping({%s : 1})}) +! f({"abcF" : Mapping({1 : 1})}):(, TypeError('expected bytes() or str() instance, but got int',)) +! f({"abcF" : Mapping({b"\0" : 1})}):(, TypeError('expected bytes with no null',)) +! f({"abcF" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using f({"abcF" : %s}) +! f({"abcF" : FailingIter()}):(, TypeError('unable to convert FailingIter to vim structure',)) +! f({"abcF" : FailingIterNext()}):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using f({"abcF" : %s}) +! f({"abcF" : None}):(, TypeError('unable to convert NoneType to vim structure',)) +! f({"abcF" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) +! f({"abcF" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! f({"abcF" : FailingMapping()}):(, NotImplementedError()) +! f({"abcF" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using f(Mapping({%s : 1})) + f(Mapping({1 : 1})):(, TypeError('expected bytes() or str() instance, but got int',)) + f(Mapping({b"\0" : 1})):(, TypeError('expected bytes with no null',)) + f(Mapping({"\0" : 1})):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using f(Mapping({"abcG" : {%s : 1}})) +! f(Mapping({"abcG" : {1 : 1}})):(, TypeError('expected bytes() or str() instance, but got int',)) +! f(Mapping({"abcG" : {b"\0" : 1}})):(, TypeError('expected bytes with no null',)) +! f(Mapping({"abcG" : {"\0" : 1}})):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using f(Mapping({"abcG" : Mapping({%s : 1})})) +! f(Mapping({"abcG" : Mapping({1 : 1})})):(, TypeError('expected bytes() or str() instance, but got int',)) +! f(Mapping({"abcG" : Mapping({b"\0" : 1})})):(, TypeError('expected bytes with no null',)) +! f(Mapping({"abcG" : Mapping({"\0" : 1})})):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using f(Mapping({"abcG" : %s})) +! f(Mapping({"abcG" : FailingIter()})):(, TypeError('unable to convert FailingIter to vim structure',)) +! f(Mapping({"abcG" : FailingIterNext()})):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using f(Mapping({"abcG" : %s})) +! f(Mapping({"abcG" : None})):(, TypeError('unable to convert NoneType to vim structure',)) +! f(Mapping({"abcG" : {b"": 1}})):(, ValueError('empty keys are not allowed',)) +! f(Mapping({"abcG" : {"": 1}})):(, ValueError('empty keys are not allowed',)) +! f(Mapping({"abcG" : FailingMapping()})):(, NotImplementedError()) +! f(Mapping({"abcG" : FailingMappingKey()})):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using f(%s) + f(FailingIter()):(, TypeError('unable to convert FailingIter to vim structure',)) +*************** +*** 972,1023 **** + fd(self={b"\0" : 1}):(, TypeError('expected bytes with no null',)) + fd(self={"\0" : 1}):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using fd(self={"abc" : {%s : 1}}) +! fd(self={"abc" : {1 : 1}}):(, TypeError('expected bytes() or str() instance, but got int',)) +! fd(self={"abc" : {b"\0" : 1}}):(, TypeError('expected bytes with no null',)) +! fd(self={"abc" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using fd(self={"abc" : Mapping({%s : 1})}) +! fd(self={"abc" : Mapping({1 : 1})}):(, TypeError('expected bytes() or str() instance, but got int',)) +! fd(self={"abc" : Mapping({b"\0" : 1})}):(, TypeError('expected bytes with no null',)) +! fd(self={"abc" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using fd(self={"abc" : %s}) +! fd(self={"abc" : FailingIter()}):(, TypeError('unable to convert FailingIter to vim structure',)) +! fd(self={"abc" : FailingIterNext()}):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using fd(self={"abc" : %s}) +! fd(self={"abc" : None}):(, TypeError('unable to convert NoneType to vim structure',)) +! fd(self={"abc" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) +! fd(self={"abc" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! fd(self={"abc" : FailingMapping()}):(, NotImplementedError()) +! fd(self={"abc" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({%s : 1})) + fd(self=Mapping({1 : 1})):(, TypeError('expected bytes() or str() instance, but got int',)) + fd(self=Mapping({b"\0" : 1})):(, TypeError('expected bytes with no null',)) + fd(self=Mapping({"\0" : 1})):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using fd(self=Mapping({"abc" : {%s : 1}})) +! fd(self=Mapping({"abc" : {1 : 1}})):(, TypeError('expected bytes() or str() instance, but got int',)) +! fd(self=Mapping({"abc" : {b"\0" : 1}})):(, TypeError('expected bytes with no null',)) +! fd(self=Mapping({"abc" : {"\0" : 1}})):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using fd(self=Mapping({"abc" : Mapping({%s : 1})})) +! fd(self=Mapping({"abc" : Mapping({1 : 1})})):(, TypeError('expected bytes() or str() instance, but got int',)) +! fd(self=Mapping({"abc" : Mapping({b"\0" : 1})})):(, TypeError('expected bytes with no null',)) +! fd(self=Mapping({"abc" : Mapping({"\0" : 1})})):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using fd(self=Mapping({"abc" : %s})) +! fd(self=Mapping({"abc" : FailingIter()})):(, TypeError('unable to convert FailingIter to vim structure',)) +! fd(self=Mapping({"abc" : FailingIterNext()})):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using fd(self=Mapping({"abc" : %s})) +! fd(self=Mapping({"abc" : None})):(, TypeError('unable to convert NoneType to vim structure',)) +! fd(self=Mapping({"abc" : {b"": 1}})):(, ValueError('empty keys are not allowed',)) +! fd(self=Mapping({"abc" : {"": 1}})):(, ValueError('empty keys are not allowed',)) +! fd(self=Mapping({"abc" : FailingMapping()})):(, NotImplementedError()) +! fd(self=Mapping({"abc" : FailingMappingKey()})):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using fd(self=%s) + fd(self=FailingIter()):(, TypeError('unable to convert FailingIter to vim dictionary',)) +--- 975,1026 ---- + fd(self={b"\0" : 1}):(, TypeError('expected bytes with no null',)) + fd(self={"\0" : 1}):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using fd(self={"abcF" : {%s : 1}}) +! fd(self={"abcF" : {1 : 1}}):(, TypeError('expected bytes() or str() instance, but got int',)) +! fd(self={"abcF" : {b"\0" : 1}}):(, TypeError('expected bytes with no null',)) +! fd(self={"abcF" : {"\0" : 1}}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using fd(self={"abcF" : Mapping({%s : 1})}) +! fd(self={"abcF" : Mapping({1 : 1})}):(, TypeError('expected bytes() or str() instance, but got int',)) +! fd(self={"abcF" : Mapping({b"\0" : 1})}):(, TypeError('expected bytes with no null',)) +! fd(self={"abcF" : Mapping({"\0" : 1})}):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using fd(self={"abcF" : %s}) +! fd(self={"abcF" : FailingIter()}):(, TypeError('unable to convert FailingIter to vim structure',)) +! fd(self={"abcF" : FailingIterNext()}):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using fd(self={"abcF" : %s}) +! fd(self={"abcF" : None}):(, TypeError('unable to convert NoneType to vim structure',)) +! fd(self={"abcF" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) +! fd(self={"abcF" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! fd(self={"abcF" : FailingMapping()}):(, NotImplementedError()) +! fd(self={"abcF" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({%s : 1})) + fd(self=Mapping({1 : 1})):(, TypeError('expected bytes() or str() instance, but got int',)) + fd(self=Mapping({b"\0" : 1})):(, TypeError('expected bytes with no null',)) + fd(self=Mapping({"\0" : 1})):(, TypeError('expected bytes with no null',)) + <<< Finished +! >>> Testing StringToChars using fd(self=Mapping({"abcG" : {%s : 1}})) +! fd(self=Mapping({"abcG" : {1 : 1}})):(, TypeError('expected bytes() or str() instance, but got int',)) +! fd(self=Mapping({"abcG" : {b"\0" : 1}})):(, TypeError('expected bytes with no null',)) +! fd(self=Mapping({"abcG" : {"\0" : 1}})):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing StringToChars using fd(self=Mapping({"abcG" : Mapping({%s : 1})})) +! fd(self=Mapping({"abcG" : Mapping({1 : 1})})):(, TypeError('expected bytes() or str() instance, but got int',)) +! fd(self=Mapping({"abcG" : Mapping({b"\0" : 1})})):(, TypeError('expected bytes with no null',)) +! fd(self=Mapping({"abcG" : Mapping({"\0" : 1})})):(, TypeError('expected bytes with no null',)) +! <<< Finished +! >>> Testing *Iter* using fd(self=Mapping({"abcG" : %s})) +! fd(self=Mapping({"abcG" : FailingIter()})):(, TypeError('unable to convert FailingIter to vim structure',)) +! fd(self=Mapping({"abcG" : FailingIterNext()})):(, NotImplementedError()) +! <<< Finished +! >>> Testing ConvertFromPyObject using fd(self=Mapping({"abcG" : %s})) +! fd(self=Mapping({"abcG" : None})):(, TypeError('unable to convert NoneType to vim structure',)) +! fd(self=Mapping({"abcG" : {b"": 1}})):(, ValueError('empty keys are not allowed',)) +! fd(self=Mapping({"abcG" : {"": 1}})):(, ValueError('empty keys are not allowed',)) +! fd(self=Mapping({"abcG" : FailingMapping()})):(, NotImplementedError()) +! fd(self=Mapping({"abcG" : FailingMappingKey()})):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using fd(self=%s) + fd(self=FailingIter()):(, TypeError('unable to convert FailingIter to vim dictionary',)) +*************** +*** 1046,1053 **** + vim.current.window.buffer = 0:(, TypeError('readonly attribute: buffer',)) + vim.current.window.cursor = (100000000, 100000000):(, error('cursor position outside buffer',)) + vim.current.window.cursor = True:(, TypeError('argument must be 2-item sequence, not bool',)) +! vim.current.window.height = "abc":(, TypeError('expected int() or something supporting coercing to int(), but got str',)) +! vim.current.window.width = "abc":(, TypeError('expected int() or something supporting coercing to int(), but got str',)) + vim.current.window.xxxxxx = True:(, AttributeError('xxxxxx',)) + > WinList + >> WinListItem +--- 1049,1056 ---- + vim.current.window.buffer = 0:(, TypeError('readonly attribute: buffer',)) + vim.current.window.cursor = (100000000, 100000000):(, error('cursor position outside buffer',)) + vim.current.window.cursor = True:(, TypeError('argument must be 2-item sequence, not bool',)) +! vim.current.window.height = "abcK":(, TypeError('expected int() or something supporting coercing to int(), but got str',)) +! vim.current.window.width = "abcL":(, TypeError('expected int() or something supporting coercing to int(), but got str',)) + vim.current.window.xxxxxx = True:(, AttributeError('xxxxxx',)) + > WinList + >> WinListItem +*************** +*** 1057,1063 **** + vim.current.buffer[0] = "\na":(, error('string cannot contain newlines',)) + >> SetBufferLine (indirect) + vim.current.buffer[0] = True:(, TypeError('bad argument type for built-in operation',)) +! >> SetBufferLines (indirect) + vim.current.buffer[:] = True:(, TypeError('bad argument type for built-in operation',)) + vim.current.buffer[:] = ["\na", "bc"]:(, error('string cannot contain newlines',)) + >> InsertBufferLines (indirect) +--- 1060,1066 ---- + vim.current.buffer[0] = "\na":(, error('string cannot contain newlines',)) + >> SetBufferLine (indirect) + vim.current.buffer[0] = True:(, TypeError('bad argument type for built-in operation',)) +! >> SetBufferLineList (indirect) + vim.current.buffer[:] = True:(, TypeError('bad argument type for built-in operation',)) + vim.current.buffer[:] = ["\na", "bc"]:(, error('string cannot contain newlines',)) + >> InsertBufferLines (indirect) +*************** +*** 1075,1081 **** + vim.current.buffer.xxx = True:(, AttributeError('xxx',)) + >> BufferMark + vim.current.buffer.mark(0):(, TypeError('expected bytes() or str() instance, but got int',)) +! vim.current.buffer.mark("abc"):(, ValueError('mark name must be a single character',)) + vim.current.buffer.mark("!"):(, error('invalid mark name',)) + >> BufferRange + vim.current.buffer.range(1, 2, 3):(, TypeError('function takes exactly 2 arguments (3 given)',)) +--- 1078,1084 ---- + vim.current.buffer.xxx = True:(, AttributeError('xxx',)) + >> BufferMark + vim.current.buffer.mark(0):(, TypeError('expected bytes() or str() instance, but got int',)) +! vim.current.buffer.mark("abcM"):(, ValueError('mark name must be a single character',)) + vim.current.buffer.mark("!"):(, error('invalid mark name',)) + >> BufferRange + vim.current.buffer.range(1, 2, 3):(, TypeError('function takes exactly 2 arguments (3 given)',)) +*************** +*** 1095,1101 **** + 3,xx + before + after +! vim.command("throw 'abc'"):(, error('abc',)) + Exe("throw 'def'"):(, error('def',)) + vim.eval("Exe('throw ''ghi''')"):(, error('ghi',)) + vim.eval("Exe('echoerr ''jkl''')"):(, error('Vim(echoerr):jkl',)) +--- 1098,1104 ---- + 3,xx + before + after +! vim.command("throw 'abcN'"):(, error('abcN',)) + Exe("throw 'def'"):(, error('def',)) + vim.eval("Exe('throw ''ghi''')"):(, error('ghi',)) + vim.eval("Exe('echoerr ''jkl''')"):(, error('Vim(echoerr):jkl',)) +*** ../vim-7.3.1232/src/version.c 2013-06-23 14:30:42.000000000 +0200 +--- src/version.c 2013-06-23 14:32:12.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1233, + /**/ + +-- +ARTHUR: Right! Knights! Forward! + ARTHUR leads a charge toward the castle. Various shots of them battling on, + despite being hit by a variety of farm animals. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// 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 /// diff --git a/7.3.1234 b/7.3.1234 new file mode 100644 index 0000000..ac14dda --- /dev/null +++ b/7.3.1234 @@ -0,0 +1,1283 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1234 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1234 (after 7.3.1229) +Problem: Python: Strings are not marked for translation. +Solution: Add N_() where appropriate. (ZyX) +Files: src/if_py_both.h + + +*** ../vim-7.3.1233/src/if_py_both.h 2013-06-23 14:37:00.000000000 +0200 +--- src/if_py_both.h 2013-06-23 16:00:03.000000000 +0200 +*************** +*** 37,52 **** + : obj->ob_type->tp_name) + + #define RAISE_NO_EMPTY_KEYS PyErr_SET_STRING(PyExc_ValueError, \ +! "empty keys are not allowed") +! #define RAISE_LOCKED(type) PyErr_SET_VIM(_(type " is locked")) +! #define RAISE_LOCKED_DICTIONARY RAISE_LOCKED("dictionary") +! #define RAISE_LOCKED_LIST RAISE_LOCKED("list") +! #define RAISE_UNDO_FAIL PyErr_SET_VIM("cannot save undo information") +! #define RAISE_LINE_FAIL(act) PyErr_SET_VIM("cannot " act " line") + #define RAISE_KEY_ADD_FAIL(key) \ +! PyErr_VIM_FORMAT("failed to add key '%s' to dictionary", key) + #define RAISE_INVALID_INDEX_TYPE(idx) \ +! PyErr_FORMAT(PyExc_TypeError, "index must be int or slice, not %s", \ + Py_TYPE_NAME(idx)); + + #define INVALID_BUFFER_VALUE ((buf_T *)(-1)) +--- 37,53 ---- + : obj->ob_type->tp_name) + + #define RAISE_NO_EMPTY_KEYS PyErr_SET_STRING(PyExc_ValueError, \ +! N_("empty keys are not allowed")) +! #define RAISE_LOCKED_DICTIONARY PyErr_SET_VIM(N_("dictionary is locked")) +! #define RAISE_LOCKED_LIST PyErr_SET_VIM(N_("list is locked")) +! #define RAISE_UNDO_FAIL PyErr_SET_VIM(N_("cannot save undo information")) +! #define RAISE_DELETE_LINE_FAIL PyErr_SET_VIM(N_("cannot delete line")) +! #define RAISE_INSERT_LINE_FAIL PyErr_SET_VIM(N_("cannot insert line")) +! #define RAISE_REPLACE_LINE_FAIL PyErr_SET_VIM(N_("cannot replace line")) + #define RAISE_KEY_ADD_FAIL(key) \ +! PyErr_VIM_FORMAT(N_("failed to add key '%s' to dictionary"), key) + #define RAISE_INVALID_INDEX_TYPE(idx) \ +! PyErr_FORMAT(PyExc_TypeError, N_("index must be int or slice, not %s"), \ + Py_TYPE_NAME(idx)); + + #define INVALID_BUFFER_VALUE ((buf_T *)(-1)) +*************** +*** 140,148 **** + { + PyErr_FORMAT(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 +! "expected str() or unicode() instance, but got %s" + #else +! "expected bytes() or str() instance, but got %s" + #endif + , Py_TYPE_NAME(obj)); + return NULL; +--- 141,149 ---- + { + PyErr_FORMAT(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 +! N_("expected str() or unicode() instance, but got %s") + #else +! N_("expected bytes() or str() instance, but got %s") + #endif + , Py_TYPE_NAME(obj)); + return NULL; +*************** +*** 192,202 **** + { + PyErr_FORMAT(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 +! "expected int(), long() or something supporting " +! "coercing to long(), but got %s" + #else +! "expected int() or something supporting coercing to int(), " +! "but got %s" + #endif + , Py_TYPE_NAME(obj)); + return -1; +--- 193,203 ---- + { + PyErr_FORMAT(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 +! N_("expected int(), long() or something supporting " +! "coercing to long(), but got %s") + #else +! N_("expected int() or something supporting coercing to int(), " +! "but got %s") + #endif + , Py_TYPE_NAME(obj)); + return -1; +*************** +*** 207,219 **** + if (*result > INT_MAX) + { + PyErr_SET_STRING(PyExc_OverflowError, +! "value is too large to fit into C int type"); + return -1; + } + else if (*result < INT_MIN) + { + PyErr_SET_STRING(PyExc_OverflowError, +! "value is too small to fit into C int type"); + return -1; + } + } +--- 208,220 ---- + if (*result > INT_MAX) + { + PyErr_SET_STRING(PyExc_OverflowError, +! N_("value is too large to fit into C int type")); + return -1; + } + else if (*result < INT_MIN) + { + PyErr_SET_STRING(PyExc_OverflowError, +! N_("value is too small to fit into C int type")); + return -1; + } + } +*************** +*** 223,229 **** + if (*result <= 0) + { + PyErr_SET_STRING(PyExc_ValueError, +! "number must be greater then zero"); + return -1; + } + } +--- 224,230 ---- + if (*result <= 0) + { + PyErr_SET_STRING(PyExc_ValueError, +! N_("number must be greater then zero")); + return -1; + } + } +*************** +*** 232,238 **** + if (*result < 0) + { + PyErr_SET_STRING(PyExc_ValueError, +! "number must be greater or equal to zero"); + return -1; + } + } +--- 233,239 ---- + if (*result < 0) + { + PyErr_SET_STRING(PyExc_ValueError, +! N_("number must be greater or equal to zero")); + return -1; + } + } +*************** +*** 326,332 **** + if (valObject == NULL) + { + PyErr_SET_STRING(PyExc_AttributeError, +! "can't delete OutputObject attributes"); + return -1; + } + +--- 327,333 ---- + if (valObject == NULL) + { + PyErr_SET_STRING(PyExc_AttributeError, +! N_("can't delete OutputObject attributes")); + return -1; + } + +*************** +*** 337,343 **** + return 0; + } + +! PyErr_FORMAT(PyExc_AttributeError, "invalid attribute: %s", name); + return -1; + } + +--- 338,344 ---- + return 0; + } + +! PyErr_FORMAT(PyExc_AttributeError, N_("invalid attribute: %s"), name); + return -1; + } + +*************** +*** 785,791 **** + + if (our_tv == NULL) + { +! PyErr_SET_VIM("invalid expression"); + return NULL; + } + +--- 786,792 ---- + + if (our_tv == NULL) + { +! PyErr_SET_VIM(N_("invalid expression")); + return NULL; + } + +*************** +*** 836,842 **** + + if (our_tv == NULL) + { +! PyErr_SET_VIM("invalid expression"); + return NULL; + } + +--- 837,843 ---- + + if (our_tv == NULL) + { +! PyErr_SET_VIM(N_("invalid expression")); + return NULL; + } + +*************** +*** 908,914 **** + if (VimTryEnd()) + return NULL; + +! PyErr_SET_VIM("failed to change directory"); + return NULL; + } + +--- 909,915 ---- + if (VimTryEnd()) + return NULL; + +! PyErr_SET_VIM(N_("failed to change directory")); + return NULL; + } + +*************** +*** 1086,1100 **** + if (!PyTuple_Check(find_module_result)) + { + PyErr_FORMAT(PyExc_TypeError, +! "expected 3-tuple as imp.find_module() result, but got %s", + Py_TYPE_NAME(find_module_result)); + return NULL; + } + if (PyTuple_GET_SIZE(find_module_result) != 3) + { + PyErr_FORMAT(PyExc_TypeError, +! "expected 3-tuple as imp.find_module() result, but got " +! "tuple of size %d", + (int) PyTuple_GET_SIZE(find_module_result)); + return NULL; + } +--- 1087,1101 ---- + if (!PyTuple_Check(find_module_result)) + { + PyErr_FORMAT(PyExc_TypeError, +! N_("expected 3-tuple as imp.find_module() result, but got %s"), + Py_TYPE_NAME(find_module_result)); + return NULL; + } + if (PyTuple_GET_SIZE(find_module_result) != 3) + { + PyErr_FORMAT(PyExc_TypeError, +! N_("expected 3-tuple as imp.find_module() result, but got " +! "tuple of size %d"), + (int) PyTuple_GET_SIZE(find_module_result)); + return NULL; + } +*************** +*** 1104,1110 **** + || !(description = PyTuple_GET_ITEM(find_module_result, 2))) + { + PyErr_SET_STRING(PyExc_RuntimeError, +! "internal error: imp.find_module returned tuple with NULL"); + return NULL; + } + +--- 1105,1111 ---- + || !(description = PyTuple_GET_ITEM(find_module_result, 2))) + { + PyErr_SET_STRING(PyExc_RuntimeError, +! N_("internal error: imp.find_module returned tuple with NULL")); + return NULL; + } + +*************** +*** 1476,1482 **** + if (valObject == NULL) + { + PyErr_SET_STRING(PyExc_AttributeError, +! "cannot delete vim.Dictionary attributes"); + return -1; + } + +--- 1477,1483 ---- + if (valObject == NULL) + { + PyErr_SET_STRING(PyExc_AttributeError, +! N_("cannot delete vim.Dictionary attributes")); + return -1; + } + +*************** +*** 1484,1490 **** + { + if (self->dict->dv_lock == VAR_FIXED) + { +! PyErr_SET_STRING(PyExc_TypeError, "cannot modify fixed dictionary"); + return -1; + } + else +--- 1485,1492 ---- + { + if (self->dict->dv_lock == VAR_FIXED) + { +! PyErr_SET_STRING(PyExc_TypeError, +! N_("cannot modify fixed dictionary")); + return -1; + } + else +*************** +*** 1501,1507 **** + } + else + { +! PyErr_FORMAT(PyExc_AttributeError, "cannot set attribute %s", name); + return -1; + } + } +--- 1503,1509 ---- + } + else + { +! PyErr_FORMAT(PyExc_AttributeError, N_("cannot set attribute %s"), name); + return -1; + } + } +*************** +*** 1635,1641 **** + (*dii)->ht->ht_used != (*dii)->ht_used) + { + PyErr_SET_STRING(PyExc_RuntimeError, +! "hashtab changed during iteration"); + return NULL; + } + +--- 1637,1643 ---- + (*dii)->ht->ht_used != (*dii)->ht_used) + { + PyErr_SET_STRING(PyExc_RuntimeError, +! N_("hashtab changed during iteration")); + return NULL; + } + +*************** +*** 1906,1913 **** + Py_DECREF(iterator); + Py_DECREF(fast); + PyErr_FORMAT(PyExc_ValueError, +! "expected sequence element of size 2, " +! "but got sequence of size %d", + PySequence_Fast_GET_SIZE(fast)); + return NULL; + } +--- 1908,1915 ---- + Py_DECREF(iterator); + Py_DECREF(fast); + PyErr_FORMAT(PyExc_ValueError, +! N_("expected sequence element of size 2, " +! "but got sequence of size %d"), + PySequence_Fast_GET_SIZE(fast)); + return NULL; + } +*************** +*** 2150,2156 **** + if (kwargs) + { + PyErr_SET_STRING(PyExc_TypeError, +! "list constructor does not accept keyword arguments"); + return NULL; + } + +--- 2152,2158 ---- + if (kwargs) + { + PyErr_SET_STRING(PyExc_TypeError, +! N_("list constructor does not accept keyword arguments")); + return NULL; + } + +*************** +*** 2205,2218 **** + + if (index >= ListLength(self)) + { +! PyErr_SET_STRING(PyExc_IndexError, "list index out of range"); + return NULL; + } + li = list_find(self->list, (long) index); + if (li == NULL) + { + /* No more suitable format specifications in python-2.3 */ +! PyErr_VIM_FORMAT("internal error: failed to get vim list item %d", + (int) index); + return NULL; + } +--- 2207,2220 ---- + + if (index >= ListLength(self)) + { +! PyErr_SET_STRING(PyExc_IndexError, N_("list index out of range")); + return NULL; + } + li = list_find(self->list, (long) index); + if (li == NULL) + { + /* No more suitable format specifications in python-2.3 */ +! PyErr_VIM_FORMAT(N_("internal error: failed to get vim list item %d"), + (int) index); + return NULL; + } +*************** +*** 2331,2337 **** + } + if (index > length || (index == length && obj == NULL)) + { +! PyErr_SET_STRING(PyExc_IndexError, "list index out of range"); + return -1; + } + +--- 2333,2339 ---- + } + if (index > length || (index == length && obj == NULL)) + { +! PyErr_SET_STRING(PyExc_IndexError, N_("list index out of range")); + return -1; + } + +*************** +*** 2352,2358 **** + if (list_append_tv(l, &tv) == FAIL) + { + clear_tv(&tv); +! PyErr_SET_VIM("failed to add item to list"); + return -1; + } + } +--- 2354,2360 ---- + if (list_append_tv(l, &tv) == FAIL) + { + clear_tv(&tv); +! PyErr_SET_VIM(N_("failed to add item to list")); + return -1; + } + } +*************** +*** 2393,2399 **** + li = list_find(l, (long) first); + if (li == NULL) + { +! PyErr_VIM_FORMAT("internal error: no vim list item %d", (int)first); + return -1; + } + if (last > first) +--- 2395,2402 ---- + li = list_find(l, (long) first); + if (li == NULL) + { +! PyErr_VIM_FORMAT(N_("internal error: no vim list item %d"), +! (int)first); + return -1; + } + if (last > first) +*************** +*** 2426,2432 **** + if (list_insert_tv(l, &v, li) == FAIL) + { + clear_tv(&v); +! PyErr_SET_VIM("internal error: failed to add item to list"); + return -1; + } + clear_tv(&v); +--- 2429,2435 ---- + if (list_insert_tv(l, &v, li) == FAIL) + { + clear_tv(&v); +! PyErr_SET_VIM(N_("internal error: failed to add item to list")); + return -1; + } + clear_tv(&v); +*************** +*** 2478,2484 **** + if (valObject == NULL) + { + PyErr_SET_STRING(PyExc_AttributeError, +! "cannot delete vim.List attributes"); + return -1; + } + +--- 2481,2487 ---- + if (valObject == NULL) + { + PyErr_SET_STRING(PyExc_AttributeError, +! N_("cannot delete vim.List attributes")); + return -1; + } + +*************** +*** 2486,2492 **** + { + if (self->list->lv_lock == VAR_FIXED) + { +! PyErr_SET_STRING(PyExc_TypeError, "cannot modify fixed list"); + return -1; + } + else +--- 2489,2495 ---- + { + if (self->list->lv_lock == VAR_FIXED) + { +! PyErr_SET_STRING(PyExc_TypeError, N_("cannot modify fixed list")); + return -1; + } + else +*************** +*** 2503,2509 **** + } + else + { +! PyErr_FORMAT(PyExc_AttributeError, "cannot set attribute %s", name); + return -1; + } + } +--- 2506,2512 ---- + } + else + { +! PyErr_FORMAT(PyExc_AttributeError, N_("cannot set attribute %s"), name); + return -1; + } + } +*************** +*** 2539,2545 **** + if (!translated_function_exists(name)) + { + PyErr_FORMAT(PyExc_ValueError, +! "unnamed function %s does not exist", name); + return NULL; + } + self->name = vim_strsave(name); +--- 2542,2548 ---- + if (!translated_function_exists(name)) + { + PyErr_FORMAT(PyExc_ValueError, +! N_("unnamed function %s does not exist"), name); + return NULL; + } + self->name = vim_strsave(name); +*************** +*** 2550,2556 **** + vim_strchr(name, AUTOLOAD_CHAR) == NULL)) + == NULL) + { +! PyErr_FORMAT(PyExc_ValueError, "function %s does not exist", name); + return NULL; + } + +--- 2553,2560 ---- + vim_strchr(name, AUTOLOAD_CHAR) == NULL)) + == NULL) + { +! PyErr_FORMAT(PyExc_ValueError, +! N_("function %s does not exist"), name); + return NULL; + } + +*************** +*** 2566,2572 **** + if (kwargs) + { + PyErr_SET_STRING(PyExc_TypeError, +! "function constructor does not accept keyword arguments"); + return NULL; + } + +--- 2570,2576 ---- + if (kwargs) + { + PyErr_SET_STRING(PyExc_TypeError, +! N_("function constructor does not accept keyword arguments")); + return NULL; + } + +*************** +*** 2643,2649 **** + else if (error != OK) + { + ret = NULL; +! PyErr_VIM_FORMAT("failed to run function %s", (char *)name); + } + else + ret = ConvertToPyObject(&rettv); +--- 2647,2653 ---- + else if (error != OK) + { + ret = NULL; +! PyErr_VIM_FORMAT(N_("failed to run function %s"), (char *)name); + } + else + ret = ConvertToPyObject(&rettv); +*************** +*** 2796,2808 **** + else + { + PyErr_SET_STRING(PyExc_RuntimeError, +! "unable to get option value"); + return NULL; + } + } + else + { +! PyErr_SET_VIM("internal error: unknown option type"); + return NULL; + } + } +--- 2800,2812 ---- + else + { + PyErr_SET_STRING(PyExc_RuntimeError, +! N_("unable to get option value")); + return NULL; + } + } + else + { +! PyErr_SET_VIM(N_("internal error: unknown option type")); + return NULL; + } + } +*************** +*** 2845,2851 **** + { + if (VimTryEnd()) + return -1; +! PyErr_SET_VIM("problem while switching windows"); + return -1; + } + set_ret = set_option_value_err(key, numval, stringval, opt_flags); +--- 2849,2855 ---- + { + if (VimTryEnd()) + return -1; +! PyErr_SET_VIM(N_("problem while switching windows")); + return -1; + } + set_ret = set_option_value_err(key, numval, stringval, opt_flags); +*************** +*** 2902,2916 **** + if (self->opt_type == SREQ_GLOBAL) + { + PyErr_FORMAT(PyExc_ValueError, +! "unable to unset global option %s", key); + Py_XDECREF(todecref); + return -1; + } + else if (!(flags & SOPT_GLOBAL)) + { + PyErr_FORMAT(PyExc_ValueError, +! "unable to unset option %s " +! "which does not have global value", key); + Py_XDECREF(todecref); + return -1; + } +--- 2906,2920 ---- + if (self->opt_type == SREQ_GLOBAL) + { + PyErr_FORMAT(PyExc_ValueError, +! N_("unable to unset global option %s"), key); + Py_XDECREF(todecref); + return -1; + } + else if (!(flags & SOPT_GLOBAL)) + { + PyErr_FORMAT(PyExc_ValueError, +! N_("unable to unset option %s " +! "which does not have global value"), key); + Py_XDECREF(todecref); + return -1; + } +*************** +*** 2988,2994 **** + { + if (self->tab == INVALID_TABPAGE_VALUE) + { +! PyErr_SET_VIM("attempt to refer to deleted tab page"); + return -1; + } + +--- 2992,2998 ---- + { + if (self->tab == INVALID_TABPAGE_VALUE) + { +! PyErr_SET_VIM(N_("attempt to refer to deleted tab page")); + return -1; + } + +*************** +*** 3132,3138 **** + if (n == 0) + return TabPageNew(tp); + +! PyErr_SET_STRING(PyExc_IndexError, "no such tab page"); + return NULL; + } + +--- 3136,3142 ---- + if (n == 0) + return TabPageNew(tp); + +! PyErr_SET_STRING(PyExc_IndexError, N_("no such tab page")); + return NULL; + } + +*************** +*** 3154,3160 **** + { + if (self->win == INVALID_WINDOW_VALUE) + { +! PyErr_SET_VIM("attempt to refer to deleted window"); + return -1; + } + +--- 3158,3164 ---- + { + if (self->win == INVALID_WINDOW_VALUE) + { +! PyErr_SET_VIM(N_("attempt to refer to deleted window")); + return -1; + } + +*************** +*** 3320,3326 **** + + if (strcmp(name, "buffer") == 0) + { +! PyErr_SET_STRING(PyExc_TypeError, "readonly attribute: buffer"); + return -1; + } + else if (strcmp(name, "cursor") == 0) +--- 3324,3330 ---- + + if (strcmp(name, "buffer") == 0) + { +! PyErr_SET_STRING(PyExc_TypeError, N_("readonly attribute: buffer")); + return -1; + } + else if (strcmp(name, "cursor") == 0) +*************** +*** 3333,3339 **** + + if (lnum <= 0 || lnum > self->win->w_buffer->b_ml.ml_line_count) + { +! PyErr_SET_VIM("cursor position outside buffer"); + return -1; + } + +--- 3337,3343 ---- + + if (lnum <= 0 || lnum > self->win->w_buffer->b_ml.ml_line_count) + { +! PyErr_SET_VIM(N_("cursor position outside buffer")); + return -1; + } + +*************** +*** 3496,3502 **** + if (n == 0) + return WindowNew(w, self->tabObject? self->tabObject->tab: curtab); + +! PyErr_SET_STRING(PyExc_IndexError, "no such window"); + return NULL; + } + +--- 3500,3506 ---- + if (n == 0) + return WindowNew(w, self->tabObject? self->tabObject->tab: curtab); + +! PyErr_SET_STRING(PyExc_IndexError, N_("no such window")); + return NULL; + } + +*************** +*** 3550,3556 **** + --len; + else + { +! PyErr_SET_VIM("string cannot contain newlines"); + Py_XDECREF(bytes); + return NULL; + } +--- 3554,3560 ---- + --len; + else + { +! PyErr_SET_VIM(N_("string cannot contain newlines")); + Py_XDECREF(bytes); + return NULL; + } +*************** +*** 3688,3694 **** + if (u_savedel((linenr_T)n, 1L) == FAIL) + RAISE_UNDO_FAIL; + else if (ml_delete((linenr_T)n, FALSE) == FAIL) +! RAISE_LINE_FAIL("delete"); + else + { + if (buf == savebuf) +--- 3692,3698 ---- + if (u_savedel((linenr_T)n, 1L) == FAIL) + RAISE_UNDO_FAIL; + else if (ml_delete((linenr_T)n, FALSE) == FAIL) +! RAISE_DELETE_LINE_FAIL; + else + { + if (buf == savebuf) +*************** +*** 3727,3733 **** + } + else if (ml_replace((linenr_T)n, (char_u *)save, FALSE) == FAIL) + { +! RAISE_LINE_FAIL("replace"); + vim_free(save); + } + else +--- 3731,3737 ---- + } + else if (ml_replace((linenr_T)n, (char_u *)save, FALSE) == FAIL) + { +! RAISE_REPLACE_LINE_FAIL; + vim_free(save); + } + else +*************** +*** 3794,3800 **** + { + if (ml_delete((linenr_T)lo, FALSE) == FAIL) + { +! RAISE_LINE_FAIL("delete"); + break; + } + } +--- 3798,3804 ---- + { + if (ml_delete((linenr_T)lo, FALSE) == FAIL) + { +! RAISE_DELETE_LINE_FAIL; + break; + } + } +*************** +*** 3866,3872 **** + for (i = 0; i < old_len - new_len; ++i) + if (ml_delete((linenr_T)lo, FALSE) == FAIL) + { +! RAISE_LINE_FAIL("delete"); + break; + } + extra -= i; +--- 3870,3876 ---- + for (i = 0; i < old_len - new_len; ++i) + if (ml_delete((linenr_T)lo, FALSE) == FAIL) + { +! RAISE_DELETE_LINE_FAIL; + break; + } + extra -= i; +*************** +*** 3882,3888 **** + if (ml_replace((linenr_T)(lo+i), (char_u *)array[i], FALSE) + == FAIL) + { +! RAISE_LINE_FAIL("replace"); + break; + } + } +--- 3886,3892 ---- + if (ml_replace((linenr_T)(lo+i), (char_u *)array[i], FALSE) + == FAIL) + { +! RAISE_REPLACE_LINE_FAIL; + break; + } + } +*************** +*** 3900,3906 **** + if (ml_append((linenr_T)(lo + i - 1), + (char_u *)array[i], 0, FALSE) == FAIL) + { +! RAISE_LINE_FAIL("insert"); + break; + } + vim_free(array[i]); +--- 3904,3910 ---- + if (ml_append((linenr_T)(lo + i - 1), + (char_u *)array[i], 0, FALSE) == FAIL) + { +! RAISE_INSERT_LINE_FAIL; + break; + } + vim_free(array[i]); +*************** +*** 3979,3985 **** + if (u_save((linenr_T)n, (linenr_T)(n+1)) == FAIL) + RAISE_UNDO_FAIL; + else if (ml_append((linenr_T)n, (char_u *)str, 0, FALSE) == FAIL) +! RAISE_LINE_FAIL("insert"); + else + appended_lines_mark((linenr_T)n, 1L); + +--- 3983,3989 ---- + if (u_save((linenr_T)n, (linenr_T)(n+1)) == FAIL) + RAISE_UNDO_FAIL; + else if (ml_append((linenr_T)n, (char_u *)str, 0, FALSE) == FAIL) +! RAISE_INSERT_LINE_FAIL; + else + appended_lines_mark((linenr_T)n, 1L); + +*************** +*** 4036,4042 **** + if (ml_append((linenr_T)(n + i), + (char_u *)array[i], 0, FALSE) == FAIL) + { +! RAISE_LINE_FAIL("insert"); + + /* Free the rest of the lines */ + while (i < size) +--- 4040,4046 ---- + if (ml_append((linenr_T)(n + i), + (char_u *)array[i], 0, FALSE) == FAIL) + { +! RAISE_INSERT_LINE_FAIL; + + /* Free the rest of the lines */ + while (i < size) +*************** +*** 4089,4095 **** + { + if (self->buf == INVALID_BUFFER_VALUE) + { +! PyErr_SET_VIM("attempt to refer to deleted buffer"); + return -1; + } + +--- 4093,4099 ---- + { + if (self->buf == INVALID_BUFFER_VALUE) + { +! PyErr_SET_VIM(N_("attempt to refer to deleted buffer")); + return -1; + } + +*************** +*** 4110,4116 **** + + if (n < 0 || n > end - start) + { +! PyErr_SET_STRING(PyExc_IndexError, "line number out of range"); + return NULL; + } + +--- 4114,4120 ---- + + if (n < 0 || n > end - start) + { +! PyErr_SET_STRING(PyExc_IndexError, N_("line number out of range")); + return NULL; + } + +*************** +*** 4166,4172 **** + + if (n < 0 || n > end - start) + { +! PyErr_SET_STRING(PyExc_IndexError, "line number out of range"); + return -1; + } + +--- 4170,4176 ---- + + if (n < 0 || n > end - start) + { +! PyErr_SET_STRING(PyExc_IndexError, N_("line number out of range")); + return -1; + } + +*************** +*** 4250,4256 **** + + if (n < 0 || n > max) + { +! PyErr_SET_STRING(PyExc_IndexError, "line number out of range"); + return NULL; + } + +--- 4254,4260 ---- + + if (n < 0 || n > max) + { +! PyErr_SET_STRING(PyExc_IndexError, N_("line number out of range")); + return NULL; + } + +*************** +*** 4533,4539 **** + + if (ren_ret == FAIL) + { +! PyErr_SET_VIM("failed to rename buffer"); + return -1; + } + return 0; +--- 4537,4543 ---- + + if (ren_ret == FAIL) + { +! PyErr_SET_VIM(N_("failed to rename buffer")); + return -1; + } + return 0; +*************** +*** 4569,4575 **** + if (pmark[0] == '\0' || pmark[1] != '\0') + { + PyErr_SET_STRING(PyExc_ValueError, +! "mark name must be a single character"); + Py_XDECREF(todecref); + return NULL; + } +--- 4573,4579 ---- + if (pmark[0] == '\0' || pmark[1] != '\0') + { + PyErr_SET_STRING(PyExc_ValueError, +! N_("mark name must be a single character")); + Py_XDECREF(todecref); + return NULL; + } +*************** +*** 4587,4593 **** + + if (posp == NULL) + { +! PyErr_SET_VIM("invalid mark name"); + return NULL; + } + +--- 4591,4597 ---- + + if (posp == NULL) + { +! PyErr_SET_VIM(N_("invalid mark name")); + return NULL; + } + +*************** +*** 4812,4818 **** + if (valObject->ob_type != &BufferType) + { + PyErr_FORMAT(PyExc_TypeError, +! "expected vim.Buffer object, but got %s", + Py_TYPE_NAME(valObject)); + return -1; + } +--- 4816,4822 ---- + if (valObject->ob_type != &BufferType) + { + PyErr_FORMAT(PyExc_TypeError, +! N_("expected vim.Buffer object, but got %s"), + Py_TYPE_NAME(valObject)); + return -1; + } +*************** +*** 4826,4832 **** + { + if (VimTryEnd()) + return -1; +! PyErr_VIM_FORMAT("failed to switch to buffer %d", count); + return -1; + } + +--- 4830,4836 ---- + { + if (VimTryEnd()) + return -1; +! PyErr_VIM_FORMAT(N_("failed to switch to buffer %d"), count); + return -1; + } + +*************** +*** 4839,4845 **** + if (valObject->ob_type != &WindowType) + { + PyErr_FORMAT(PyExc_TypeError, +! "expected vim.Window object, but got %s", + Py_TYPE_NAME(valObject)); + return -1; + } +--- 4843,4849 ---- + if (valObject->ob_type != &WindowType) + { + PyErr_FORMAT(PyExc_TypeError, +! N_("expected vim.Window object, but got %s"), + Py_TYPE_NAME(valObject)); + return -1; + } +*************** +*** 4851,4857 **** + if (!count) + { + PyErr_SET_STRING(PyExc_ValueError, +! "failed to find window in the current tab page"); + return -1; + } + +--- 4855,4861 ---- + if (!count) + { + PyErr_SET_STRING(PyExc_ValueError, +! N_("failed to find window in the current tab page")); + return -1; + } + +*************** +*** 4862,4868 **** + if (VimTryEnd()) + return -1; + PyErr_SET_STRING(PyExc_RuntimeError, +! "did not switch to the specified window"); + return -1; + } + +--- 4866,4872 ---- + if (VimTryEnd()) + return -1; + PyErr_SET_STRING(PyExc_RuntimeError, +! N_("did not switch to the specified window")); + return -1; + } + +*************** +*** 4873,4879 **** + if (valObject->ob_type != &TabPageType) + { + PyErr_FORMAT(PyExc_TypeError, +! "expected vim.TabPage object, but got %s", + Py_TYPE_NAME(valObject)); + return -1; + } +--- 4877,4883 ---- + if (valObject->ob_type != &TabPageType) + { + PyErr_FORMAT(PyExc_TypeError, +! N_("expected vim.TabPage object, but got %s"), + Py_TYPE_NAME(valObject)); + return -1; + } +*************** +*** 4888,4894 **** + if (VimTryEnd()) + return -1; + PyErr_SET_STRING(PyExc_RuntimeError, +! "did not switch to the specified tab page"); + return -1; + } + +--- 4892,4898 ---- + if (VimTryEnd()) + return -1; + PyErr_SET_STRING(PyExc_RuntimeError, +! N_("did not switch to the specified tab page")); + return -1; + } + +*************** +*** 5371,5377 **** + else + { + PyErr_FORMAT(PyExc_TypeError, +! "unable to convert %s to vim dictionary", + Py_TYPE_NAME(obj)); + ret = -1; + } +--- 5375,5381 ---- + else + { + PyErr_FORMAT(PyExc_TypeError, +! N_("unable to convert %s to vim dictionary"), + Py_TYPE_NAME(obj)); + ret = -1; + } +*************** +*** 5498,5504 **** + else + { + PyErr_FORMAT(PyExc_TypeError, +! "unable to convert %s to vim structure", + Py_TYPE_NAME(obj)); + return -1; + } +--- 5502,5508 ---- + else + { + PyErr_FORMAT(PyExc_TypeError, +! N_("unable to convert %s to vim structure"), + Py_TYPE_NAME(obj)); + return -1; + } +*************** +*** 5510,5516 **** + { + if (tv == NULL) + { +! PyErr_SET_VIM("internal error: NULL reference passed"); + return NULL; + } + switch (tv->v_type) +--- 5514,5520 ---- + { + if (tv == NULL) + { +! PyErr_SET_VIM(N_("internal error: NULL reference passed")); + return NULL; + } + switch (tv->v_type) +*************** +*** 5535,5541 **** + Py_INCREF(Py_None); + return Py_None; + default: +! PyErr_SET_VIM("internal error: invalid value type"); + return NULL; + } + } +--- 5539,5545 ---- + Py_INCREF(Py_None); + return Py_None; + default: +! PyErr_SET_VIM(N_("internal error: invalid value type")); + return NULL; + } + } +*** ../vim-7.3.1233/src/version.c 2013-06-23 14:37:00.000000000 +0200 +--- src/version.c 2013-06-23 14:41:34.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1234, + /**/ + +-- + Bravely bold Sir Robin, rode forth from Camelot, + He was not afraid to die, Oh Brave Sir Robin, + He was not at all afraid to be killed in nasty ways + Brave, brave, brave, brave Sir Robin. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// 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 /// diff --git a/7.3.1235 b/7.3.1235 new file mode 100644 index 0000000..7ccde9f --- /dev/null +++ b/7.3.1235 @@ -0,0 +1,63 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1235 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1235 +Problem: In insert mode CTRL-] is not inserted, on the command-line it is. +Solution: Don't insert CTRL-] on the command line. (Yukihiro Nakadaira) +Files: src/ex_getln.c + + +*** ../vim-7.3.1234/src/ex_getln.c 2013-06-15 16:31:41.000000000 +0200 +--- src/ex_getln.c 2013-06-23 16:12:03.000000000 +0200 +*************** +*** 1700,1712 **** + * We come here if we have a normal character. + */ + +! if (do_abbr && (IS_SPECIAL(c) || !vim_iswordc(c)) && ccheck_abbr( + #ifdef FEAT_MBYTE + /* Add ABBR_OFF for characters above 0x100, this is + * what check_abbr() expects. */ + (has_mbyte && c >= 0x100) ? (c + ABBR_OFF) : + #endif +! c)) + goto cmdline_changed; + + /* +--- 1700,1712 ---- + * We come here if we have a normal character. + */ + +! if (do_abbr && (IS_SPECIAL(c) || !vim_iswordc(c)) && (ccheck_abbr( + #ifdef FEAT_MBYTE + /* Add ABBR_OFF for characters above 0x100, this is + * what check_abbr() expects. */ + (has_mbyte && c >= 0x100) ? (c + ABBR_OFF) : + #endif +! c) || c == Ctrl_RSB)) + goto cmdline_changed; + + /* +*** ../vim-7.3.1234/src/version.c 2013-06-23 16:04:04.000000000 +0200 +--- src/version.c 2013-06-23 16:12:50.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1235, + /**/ + +-- +Error:015 - Unable to exit Windows. Try the door. + + /// 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 /// diff --git a/7.3.1236 b/7.3.1236 new file mode 100644 index 0000000..8b5182f --- /dev/null +++ b/7.3.1236 @@ -0,0 +1,2992 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1236 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1236 +Problem: Python: WindowSetattr() missing support for NUMBER_UNSIGNED. +Solution: Add NUMBER_UNSIGNED, add more tests. Various fixes. (ZyX) +Files: src/if_py_both.h, src/if_python3.c, src/if_python.c, + src/testdir/pythonx/failing.py, + src/testdir/pythonx/failing_import.py, src/testdir/test86.in, + src/testdir/test86.ok, src/testdir/test87.in, + src/testdir/test87.ok, src/testdir/pythonx/topmodule/__init__.py, + src/testdir/pythonx/topmodule/submodule/__init__.py, + src/testdir/pythonx/topmodule/submodule/subsubmodule/__init__.py, + src/testdir/pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py + + +*** ../vim-7.3.1235/src/if_py_both.h 2013-06-23 16:04:04.000000000 +0200 +--- src/if_py_both.h 2013-06-23 16:27:37.000000000 +0200 +*************** +*** 1611,1617 **** + + ret = (rObj == Py_True); + +! Py_DECREF(Py_True); + + return ret; + } +--- 1611,1617 ---- + + ret = (rObj == Py_True); + +! Py_DECREF(rObj); + + return ret; + } +*************** +*** 1910,1916 **** + PyErr_FORMAT(PyExc_ValueError, + N_("expected sequence element of size 2, " + "but got sequence of size %d"), +! PySequence_Fast_GET_SIZE(fast)); + return NULL; + } + +--- 1910,1916 ---- + PyErr_FORMAT(PyExc_ValueError, + N_("expected sequence element of size 2, " + "but got sequence of size %d"), +! (int) PySequence_Fast_GET_SIZE(fast)); + return NULL; + } + +*************** +*** 2435,2440 **** +--- 2435,2444 ---- + clear_tv(&v); + } + Py_DECREF(iterator); ++ ++ if (PyErr_Occurred()) ++ return -1; ++ + return 0; + } + +*************** +*** 3361,3367 **** + long height; + win_T *savewin; + +! if (NumberToLong(valObject, &height, NUMBER_INT)) + return -1; + + #ifdef FEAT_GUI +--- 3365,3371 ---- + long height; + win_T *savewin; + +! if (NumberToLong(valObject, &height, NUMBER_INT|NUMBER_UNSIGNED)) + return -1; + + #ifdef FEAT_GUI +*************** +*** 3384,3390 **** + long width; + win_T *savewin; + +! if (NumberToLong(valObject, &width, NUMBER_INT)) + return -1; + + #ifdef FEAT_GUI +--- 3388,3394 ---- + long width; + win_T *savewin; + +! if (NumberToLong(valObject, &width, NUMBER_INT|NUMBER_UNSIGNED)) + return -1; + + #ifdef FEAT_GUI +*************** +*** 3518,3524 **** + char *str; + char *save; + PyObject *bytes = NULL; +! Py_ssize_t len; + PyInt i; + char *p; + +--- 3522,3528 ---- + char *str; + char *save; + PyObject *bytes = NULL; +! Py_ssize_t len = 0; + PyInt i; + char *p; + +*************** +*** 5483,5488 **** +--- 5487,5493 ---- + #endif + else if (PyObject_HasAttrString(obj, "keys")) + return convert_dl(obj, tv, pymap_to_tv, lookup_dict); ++ /* PyObject_GetIter can create built-in iterator for any sequence object */ + else if (PyIter_Check(obj) || PySequence_Check(obj)) + return convert_dl(obj, tv, pyseq_to_tv, lookup_dict); + else if (PyMapping_Check(obj)) +*************** +*** 5930,5940 **** + {"_Loader", (PyObject *)&LoaderType}, + }; + +- typedef int (*object_adder)(PyObject *, const char *, PyObject *); +- typedef PyObject *(*attr_getter)(PyObject *, const char *); +- + #define ADD_OBJECT(m, name, obj) \ +! if (add_object(m, name, obj)) \ + return -1; + + #define ADD_CHECKED_OBJECT(m, name, obj) \ +--- 5935,5942 ---- + {"_Loader", (PyObject *)&LoaderType}, + }; + + #define ADD_OBJECT(m, name, obj) \ +! if (PyModule_AddObject(m, name, obj)) \ + return -1; + + #define ADD_CHECKED_OBJECT(m, name, obj) \ +*************** +*** 5946,5952 **** + } + + static int +! populate_module(PyObject *m, object_adder add_object, attr_getter get_attr) + { + int i; + PyObject *other_module; +--- 5948,5954 ---- + } + + static int +! populate_module(PyObject *m) + { + int i; + PyObject *other_module; +*************** +*** 5990,5996 **** + if (!(py_chdir = PyObject_GetAttrString(other_module, "chdir"))) + return -1; + ADD_OBJECT(m, "_chdir", py_chdir); +! if (!(attr = get_attr(m, "chdir"))) + return -1; + if (PyObject_SetAttrString(other_module, "chdir", attr)) + { +--- 5992,5998 ---- + if (!(py_chdir = PyObject_GetAttrString(other_module, "chdir"))) + return -1; + ADD_OBJECT(m, "_chdir", py_chdir); +! if (!(attr = PyObject_GetAttrString(m, "chdir"))) + return -1; + if (PyObject_SetAttrString(other_module, "chdir", attr)) + { +*************** +*** 6002,6008 **** + if ((py_fchdir = PyObject_GetAttrString(other_module, "fchdir"))) + { + ADD_OBJECT(m, "_fchdir", py_fchdir); +! if (!(attr = get_attr(m, "fchdir"))) + return -1; + if (PyObject_SetAttrString(other_module, "fchdir", attr)) + { +--- 6004,6010 ---- + if ((py_fchdir = PyObject_GetAttrString(other_module, "fchdir"))) + { + ADD_OBJECT(m, "_fchdir", py_fchdir); +! if (!(attr = PyObject_GetAttrString(m, "fchdir"))) + return -1; + if (PyObject_SetAttrString(other_module, "fchdir", attr)) + { +*** ../vim-7.3.1235/src/if_python3.c 2013-06-23 14:16:53.000000000 +0200 +--- src/if_python3.c 2013-06-23 16:26:40.000000000 +0200 +*************** +*** 1623,1629 **** + if ((vim_module = PyModule_Create(&vimmodule)) == NULL) + return NULL; + +! if (populate_module(vim_module, PyModule_AddObject, PyObject_GetAttrString)) + return NULL; + + if (init_sys_path()) +--- 1623,1629 ---- + if ((vim_module = PyModule_Create(&vimmodule)) == NULL) + return NULL; + +! if (populate_module(vim_module)) + return NULL; + + if (init_sys_path()) +*** ../vim-7.3.1235/src/if_python.c 2013-06-23 14:16:53.000000000 +0200 +--- src/if_python.c 2013-06-23 16:26:40.000000000 +0200 +*************** +*** 1404,1411 **** + vim_module = Py_InitModule4("vim", VimMethods, (char *)NULL, + (PyObject *)NULL, PYTHON_API_VERSION); + +! if (populate_module(vim_module, PyModule_AddObject, +! PyObject_GetAttrString)) + return -1; + + if (init_sys_path()) +--- 1404,1410 ---- + vim_module = Py_InitModule4("vim", VimMethods, (char *)NULL, + (PyObject *)NULL, PYTHON_API_VERSION); + +! if (populate_module(vim_module)) + return -1; + + if (init_sys_path()) +*** ../vim-7.3.1235/src/testdir/pythonx/failing.py 2013-06-23 16:35:21.000000000 +0200 +--- src/testdir/pythonx/failing.py 2013-06-23 16:22:10.000000000 +0200 +*************** +*** 0 **** +--- 1 ---- ++ raise NotImplementedError +*** ../vim-7.3.1235/src/testdir/pythonx/failing_import.py 2013-06-23 16:35:21.000000000 +0200 +--- src/testdir/pythonx/failing_import.py 2013-06-23 16:22:10.000000000 +0200 +*************** +*** 0 **** +--- 1 ---- ++ raise ImportError +*** ../vim-7.3.1235/src/testdir/test86.in 2013-06-23 14:37:00.000000000 +0200 +--- src/testdir/test86.in 2013-06-23 16:26:40.000000000 +0200 +*************** +*** 216,221 **** +--- 216,222 ---- + :let messages=[] + :delfunction DictNew + py < -1: + msg = msg.replace('TypeError:(\'iteration over non-sequence\',)', + 'TypeError:("\'NoneType\' object is not iterable",)') + if expr == 'fd(self=[])': + # HACK: PyMapping_Check changed meaning + msg = msg.replace('AttributeError:(\'keys\',)', +! 'TypeError:(\'unable to convert object to vim dictionary\',)') + cb.append(expr + ':' + msg) + else: + cb.append(expr + ':NOT FAILED') +--- 881,896 ---- + if expr.find('None') > -1: + msg = msg.replace('TypeError:(\'iteration over non-sequence\',)', + 'TypeError:("\'NoneType\' object is not iterable",)') ++ if expr.find('FailingNumber') > -1: ++ msg = msg.replace(', not \'FailingNumber\'', '').replace('"', '\'') ++ msg = msg.replace('TypeError:(\'iteration over non-sequence\',)', ++ 'TypeError:("\'FailingNumber\' object is not iterable",)') ++ if msg.find('(\'\'') > -1 or msg.find('(\'can\'t') > -1: ++ msg = msg.replace('(\'', '("').replace('\',)', '",)') + if expr == 'fd(self=[])': + # HACK: PyMapping_Check changed meaning + msg = msg.replace('AttributeError:(\'keys\',)', +! 'TypeError:(\'unable to convert list to vim dictionary\',)') + cb.append(expr + ':' + msg) + else: + cb.append(expr + ':NOT FAILED') +*************** +*** 942,947 **** +--- 949,955 ---- + '{u"": 1}', # Same, but with unicode object + 'FailingMapping()', # + 'FailingMappingKey()', # ++ 'FailingNumber()', # + )) + + def convertfrompymapping_test(expr): +*************** +*** 956,1021 **** + 'FailingIterNext()', + )) + + class FailingTrue(object): + def __nonzero__(self): +! raise NotImplementedError + + class FailingIter(object): + def __iter__(self): +! raise NotImplementedError + + class FailingIterNext(object): + def __iter__(self): + return self + + def next(self): +! raise NotImplementedError + + class FailingMappingKey(object): + def __getitem__(self, item): +! raise NotImplementedError + + def keys(self): + return list("abcH") + + class FailingMapping(object): + def __getitem__(self): +! raise NotImplementedError + + def keys(self): +! raise NotImplementedError + + class FailingList(list): + def __getitem__(self, idx): + if i == 2: +! raise NotImplementedError + else: + return super(FailingList, self).__getitem__(idx) + + cb.append("> Output") + cb.append(">> OutputSetattr") + ee('del sys.stdout.softspace') +! ee('sys.stdout.softspace = []') + ee('sys.stdout.attr = None') + cb.append(">> OutputWrite") + ee('sys.stdout.write(None)') + cb.append(">> OutputWriteLines") + ee('sys.stdout.writelines(None)') + ee('sys.stdout.writelines([1])') +! #iter_test('sys.stdout.writelines(%s)') + cb.append("> VimCommand") +! ee('vim.command(1)') + #! Not checked: vim->python exceptions translating: checked later + cb.append("> VimToPython") + #! Not checked: everything: needs errors in internal python functions + cb.append("> VimEval") +! ee('vim.eval(1)') + #! Not checked: everything: needs errors in internal python functions + cb.append("> VimEvalPy") +! ee('vim.bindeval(1)') + #! Not checked: vim->python exceptions translating: checked later + cb.append("> VimStrwidth") +! ee('vim.strwidth(1)') + cb.append("> Dictionary") + cb.append(">> DictionaryConstructor") + ee('vim.Dictionary("abcI")') +--- 964,1067 ---- + 'FailingIterNext()', + )) + ++ def number_test(expr, natural=False, unsigned=False): ++ if natural: ++ unsigned = True ++ return subexpr_test(expr, 'NumberToLong', ( ++ '[]', ++ 'None', ++ ) + (unsigned and ('-1',) or ()) ++ + (natural and ('0',) or ())) ++ + class FailingTrue(object): + def __nonzero__(self): +! raise NotImplementedError('bool') + + class FailingIter(object): + def __iter__(self): +! raise NotImplementedError('iter') + + class FailingIterNext(object): + def __iter__(self): + return self + + def next(self): +! raise NotImplementedError('next') + + class FailingMappingKey(object): + def __getitem__(self, item): +! raise NotImplementedError('getitem:mappingkey') + + def keys(self): + return list("abcH") + + class FailingMapping(object): + def __getitem__(self): +! raise NotImplementedError('getitem:mapping') + + def keys(self): +! raise NotImplementedError('keys') + + class FailingList(list): + def __getitem__(self, idx): + if i == 2: +! raise NotImplementedError('getitem:list') + else: + return super(FailingList, self).__getitem__(idx) + ++ class NoArgsCall(object): ++ def __call__(self): ++ pass ++ ++ class FailingCall(object): ++ def __call__(self, path): ++ raise NotImplementedError('call') ++ ++ class FailingNumber(object): ++ def __int__(self): ++ raise NotImplementedError('int') ++ + cb.append("> Output") + cb.append(">> OutputSetattr") + ee('del sys.stdout.softspace') +! number_test('sys.stdout.softspace = %s', unsigned=True) +! number_test('sys.stderr.softspace = %s', unsigned=True) + ee('sys.stdout.attr = None') + cb.append(">> OutputWrite") + ee('sys.stdout.write(None)') + cb.append(">> OutputWriteLines") + ee('sys.stdout.writelines(None)') + ee('sys.stdout.writelines([1])') +! iter_test('sys.stdout.writelines(%s)') + cb.append("> VimCommand") +! stringtochars_test('vim.command(%s)') +! ee('vim.command("", 2)') + #! Not checked: vim->python exceptions translating: checked later + cb.append("> VimToPython") + #! Not checked: everything: needs errors in internal python functions + cb.append("> VimEval") +! stringtochars_test('vim.eval(%s)') +! ee('vim.eval("", FailingTrue())') + #! Not checked: everything: needs errors in internal python functions + cb.append("> VimEvalPy") +! stringtochars_test('vim.bindeval(%s)') +! ee('vim.eval("", 2)') + #! Not checked: vim->python exceptions translating: checked later + cb.append("> VimStrwidth") +! stringtochars_test('vim.strwidth(%s)') +! cb.append("> VimForeachRTP") +! ee('vim.foreach_rtp(None)') +! ee('vim.foreach_rtp(NoArgsCall())') +! ee('vim.foreach_rtp(FailingCall())') +! ee('vim.foreach_rtp(int, 2)') +! cb.append('> import') +! old_rtp = vim.options['rtp'] +! vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\') +! ee('import xxx_no_such_module_xxx') +! ee('import failing_import') +! ee('import failing') +! vim.options['rtp'] = old_rtp +! del old_rtp + cb.append("> Dictionary") + cb.append(">> DictionaryConstructor") + ee('vim.Dictionary("abcI")') +*************** +*** 1043,1049 **** + cb.append(">>> iter") + ee('d.update(FailingMapping())') + ee('d.update([FailingIterNext()])') +! #iter_test('d.update(%s)') + convertfrompyobject_test('d.update(%s)') + stringtochars_test('d.update(((%s, 0),))') + convertfrompyobject_test('d.update((("a", %s),))') +--- 1089,1095 ---- + cb.append(">>> iter") + ee('d.update(FailingMapping())') + ee('d.update([FailingIterNext()])') +! iter_test('d.update(%s)') + convertfrompyobject_test('d.update(%s)') + stringtochars_test('d.update(((%s, 0),))') + convertfrompyobject_test('d.update((("a", %s),))') +*************** +*** 1055,1061 **** + cb.append(">> ListConstructor") + ee('vim.List(1, 2)') + ee('vim.List(a=1)') +! #iter_test('vim.List(%s)') + convertfrompyobject_test('vim.List([%s])') + cb.append(">> ListItem") + ee('l[1000]') +--- 1101,1107 ---- + cb.append(">> ListConstructor") + ee('vim.List(1, 2)') + ee('vim.List(a=1)') +! iter_test('vim.List(%s)') + convertfrompyobject_test('vim.List([%s])') + cb.append(">> ListItem") + ee('l[1000]') +*************** +*** 1064,1073 **** + ee('l[1000] = 3') + cb.append(">> ListAssSlice") + ee('ll[1:100] = "abcJ"') +! #iter_test('l[:] = %s') + convertfrompyobject_test('l[:] = [%s]') + cb.append(">> ListConcatInPlace") +! #iter_test('l.extend(%s)') + convertfrompyobject_test('l.extend([%s])') + cb.append(">> ListSetattr") + ee('del l.locked') +--- 1110,1119 ---- + ee('l[1000] = 3') + cb.append(">> ListAssSlice") + ee('ll[1:100] = "abcJ"') +! iter_test('l[:] = %s') + convertfrompyobject_test('l[:] = [%s]') + cb.append(">> ListConcatInPlace") +! iter_test('l.extend(%s)') + convertfrompyobject_test('l.extend([%s])') + cb.append(">> ListSetattr") + ee('del l.locked') +*************** +*** 1094,1107 **** + ee('vim.current.window.buffer = 0') + ee('vim.current.window.cursor = (100000000, 100000000)') + ee('vim.current.window.cursor = True') +! ee('vim.current.window.height = "abcK"') +! ee('vim.current.window.width = "abcL"') + ee('vim.current.window.xxxxxx = True') + cb.append("> WinList") + cb.append(">> WinListItem") + ee('vim.windows[1000]') + cb.append("> Buffer") + cb.append(">> StringToLine (indirect)") + ee('vim.current.buffer[0] = "\\na"') + cb.append(">> SetBufferLine (indirect)") + ee('vim.current.buffer[0] = True') +--- 1140,1154 ---- + ee('vim.current.window.buffer = 0') + ee('vim.current.window.cursor = (100000000, 100000000)') + ee('vim.current.window.cursor = True') +! number_test('vim.current.window.height = %s', unsigned=True) +! number_test('vim.current.window.width = %s', unsigned=True) + ee('vim.current.window.xxxxxx = True') + cb.append("> WinList") + cb.append(">> WinListItem") + ee('vim.windows[1000]') + cb.append("> Buffer") + cb.append(">> StringToLine (indirect)") ++ ee('vim.current.buffer[0] = u"\\na"') + ee('vim.current.buffer[0] = "\\na"') + cb.append(">> SetBufferLine (indirect)") + ee('vim.current.buffer[0] = True') +*************** +*** 1129,1136 **** + ee('vim.current.buffer.range(1, 2, 3)') + cb.append("> BufMap") + cb.append(">> BufMapItem") +- ee('vim.buffers[None]') + ee('vim.buffers[100000000]') + cb.append("> Current") + cb.append(">> CurrentGetattr") + ee('vim.current.xxx') +--- 1176,1183 ---- + ee('vim.current.buffer.range(1, 2, 3)') + cb.append("> BufMap") + cb.append(">> BufMapItem") + ee('vim.buffers[100000000]') ++ number_test('vim.buffers[%s]', natural=True) + cb.append("> Current") + cb.append(">> CurrentGetattr") + ee('vim.current.xxx') +*************** +*** 1154,1165 **** +--- 1201,1216 ---- + del convertfrompyobject_test + del convertfrompymapping_test + del iter_test ++ del number_test + del FailingTrue + del FailingIter + del FailingIterNext + del FailingMapping + del FailingMappingKey + del FailingList ++ del NoArgsCall ++ del FailingCall ++ del FailingNumber + EOF + :delfunction F + :" +*************** +*** 1168,1173 **** +--- 1219,1234 ---- + sys.path.insert(0, os.path.join(os.getcwd(), 'python_before')) + sys.path.append(os.path.join(os.getcwd(), 'python_after')) + vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\') ++ l = [] ++ def callback(path): ++ l.append(path[-len('/testdir'):]) ++ vim.foreach_rtp(callback) ++ cb.append(repr(l)) ++ del l ++ def callback(path): ++ return path[-len('/testdir'):] ++ cb.append(repr(vim.foreach_rtp(callback))) ++ del callback + from module import dir as d + from modulex import ddir + cb.append(d + ',' + ddir) +*************** +*** 1175,1184 **** +--- 1236,1254 ---- + cb.append(before.dir) + import after + cb.append(after.dir) ++ import topmodule as tm ++ import topmodule.submodule as tms ++ import topmodule.submodule.subsubmodule.subsubsubmodule as tmsss ++ cb.append(tm.__file__.replace('.pyc', '.py')[-len('modulex/topmodule/__init__.py'):]) ++ cb.append(tms.__file__.replace('.pyc', '.py')[-len('modulex/topmodule/submodule/__init__.py'):]) ++ cb.append(tmsss.__file__.replace('.pyc', '.py')[-len('modulex/topmodule/submodule/subsubmodule/subsubsubmodule.py'):]) + del before + del after + del d + del ddir ++ del tm ++ del tms ++ del tmsss + EOF + :" + :" Test exceptions +*************** +*** 1232,1237 **** +--- 1302,1308 ---- + :call garbagecollect(1) + :" + :/^start:/,$wq! test.out ++ :" vim: et ts=4 isk-=\: + :call getchar() + ENDTEST + +*** ../vim-7.3.1235/src/testdir/test86.ok 2013-06-23 14:37:00.000000000 +0200 +--- src/testdir/test86.ok 2013-06-23 16:29:45.000000000 +0200 +*************** +*** 441,468 **** + > Output + >> OutputSetattr + del sys.stdout.softspace:AttributeError:("can't delete OutputObject attributes",) + sys.stdout.softspace = []:TypeError:('expected int(), long() or something supporting coercing to long(), but got list',) + sys.stdout.attr = None:AttributeError:('invalid attribute: attr',) + >> OutputWrite + sys.stdout.write(None):TypeError:('coercing to Unicode: need string or buffer, NoneType found',) + >> OutputWriteLines + sys.stdout.writelines(None):TypeError:("'NoneType' object is not iterable",) + sys.stdout.writelines([1]):TypeError:('coercing to Unicode: need string or buffer, int found',) + > VimCommand + vim.command(1):TypeError:('expected str() or unicode() instance, but got int',) + > VimToPython + > VimEval + vim.eval(1):TypeError:('expected str() or unicode() instance, but got int',) + > VimEvalPy + vim.bindeval(1):TypeError:('expected str() or unicode() instance, but got int',) + > VimStrwidth + vim.strwidth(1):TypeError:('expected str() or unicode() instance, but got int',) + > Dictionary + >> DictionaryConstructor + vim.Dictionary("abcI"):ValueError:('expected sequence element of size 2, but got sequence of size 1',) + >> DictionarySetattr + del d.locked:AttributeError:('cannot delete vim.Dictionary attributes',) +! d.locked = FailingTrue():NotImplementedError:() + vim.vvars.locked = False:TypeError:('cannot modify fixed dictionary',) + d.scope = True:AttributeError:('cannot set attribute scope',) + d.xxx = True:AttributeError:('cannot set attribute xxx',) +--- 441,509 ---- + > Output + >> OutputSetattr + del sys.stdout.softspace:AttributeError:("can't delete OutputObject attributes",) ++ >>> Testing NumberToLong using sys.stdout.softspace = %s + sys.stdout.softspace = []:TypeError:('expected int(), long() or something supporting coercing to long(), but got list',) ++ sys.stdout.softspace = None:TypeError:('expected int(), long() or something supporting coercing to long(), but got NoneType',) ++ sys.stdout.softspace = -1:ValueError:('number must be greater or equal to zero',) ++ <<< Finished ++ >>> Testing NumberToLong using sys.stderr.softspace = %s ++ sys.stderr.softspace = []:TypeError:('expected int(), long() or something supporting coercing to long(), but got list',) ++ sys.stderr.softspace = None:TypeError:('expected int(), long() or something supporting coercing to long(), but got NoneType',) ++ sys.stderr.softspace = -1:ValueError:('number must be greater or equal to zero',) ++ <<< Finished + sys.stdout.attr = None:AttributeError:('invalid attribute: attr',) + >> OutputWrite + sys.stdout.write(None):TypeError:('coercing to Unicode: need string or buffer, NoneType found',) + >> OutputWriteLines + sys.stdout.writelines(None):TypeError:("'NoneType' object is not iterable",) + sys.stdout.writelines([1]):TypeError:('coercing to Unicode: need string or buffer, int found',) ++ >>> Testing *Iter* using sys.stdout.writelines(%s) ++ sys.stdout.writelines(FailingIter()):NotImplementedError:('iter',) ++ sys.stdout.writelines(FailingIterNext()):NotImplementedError:('next',) ++ <<< Finished + > VimCommand ++ >>> Testing StringToChars using vim.command(%s) + vim.command(1):TypeError:('expected str() or unicode() instance, but got int',) ++ vim.command(u"\0"):TypeError:('expected string without null bytes',) ++ vim.command("\0"):TypeError:('expected string without null bytes',) ++ <<< Finished ++ vim.command("", 2):TypeError:('command() takes exactly one argument (2 given)',) + > VimToPython + > VimEval ++ >>> Testing StringToChars using vim.eval(%s) + vim.eval(1):TypeError:('expected str() or unicode() instance, but got int',) ++ vim.eval(u"\0"):TypeError:('expected string without null bytes',) ++ vim.eval("\0"):TypeError:('expected string without null bytes',) ++ <<< Finished ++ vim.eval("", FailingTrue()):TypeError:('function takes exactly 1 argument (2 given)',) + > VimEvalPy ++ >>> Testing StringToChars using vim.bindeval(%s) + vim.bindeval(1):TypeError:('expected str() or unicode() instance, but got int',) ++ vim.bindeval(u"\0"):TypeError:('expected string without null bytes',) ++ vim.bindeval("\0"):TypeError:('expected string without null bytes',) ++ <<< Finished ++ vim.eval("", 2):TypeError:('function takes exactly 1 argument (2 given)',) + > VimStrwidth ++ >>> Testing StringToChars using vim.strwidth(%s) + vim.strwidth(1):TypeError:('expected str() or unicode() instance, but got int',) ++ vim.strwidth(u"\0"):TypeError:('expected string without null bytes',) ++ vim.strwidth("\0"):TypeError:('expected string without null bytes',) ++ <<< Finished ++ > VimForeachRTP ++ vim.foreach_rtp(None):TypeError:("'NoneType' object is not callable",) ++ vim.foreach_rtp(NoArgsCall()):TypeError:('__call__() takes exactly 1 argument (2 given)',) ++ vim.foreach_rtp(FailingCall()):NotImplementedError:('call',) ++ vim.foreach_rtp(int, 2):TypeError:('foreach_rtp() takes exactly one argument (2 given)',) ++ > import ++ import xxx_no_such_module_xxx:ImportError:('No module named xxx_no_such_module_xxx',) ++ import failing_import:ImportError:('No module named failing_import',) ++ import failing:ImportError:('No module named failing',) + > Dictionary + >> DictionaryConstructor + vim.Dictionary("abcI"):ValueError:('expected sequence element of size 2, but got sequence of size 1',) + >> DictionarySetattr + del d.locked:AttributeError:('cannot delete vim.Dictionary attributes',) +! d.locked = FailingTrue():NotImplementedError:('bool',) + vim.vvars.locked = False:TypeError:('cannot modify fixed dictionary',) + d.scope = True:AttributeError:('cannot set attribute scope',) + d.xxx = True:AttributeError:('cannot set attribute xxx',) +*************** +*** 501,514 **** + <<< Finished + >>> Testing *Iter* using d["a"] = {"abcF" : %s} + d["a"] = {"abcF" : FailingIter()}:TypeError:('unable to convert FailingIter to vim structure',) +! d["a"] = {"abcF" : FailingIterNext()}:NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = {"abcF" : %s} + d["a"] = {"abcF" : None}:TypeError:('unable to convert NoneType to vim structure',) + d["a"] = {"abcF" : {"": 1}}:ValueError:('empty keys are not allowed',) + d["a"] = {"abcF" : {u"": 1}}:ValueError:('empty keys are not allowed',) +! d["a"] = {"abcF" : FailingMapping()}:NotImplementedError:() +! d["a"] = {"abcF" : FailingMappingKey()}:NotImplementedError:() + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({%s : 1}) + d["a"] = Mapping({1 : 1}):TypeError:('expected str() or unicode() instance, but got int',) +--- 542,556 ---- + <<< Finished + >>> Testing *Iter* using d["a"] = {"abcF" : %s} + d["a"] = {"abcF" : FailingIter()}:TypeError:('unable to convert FailingIter to vim structure',) +! d["a"] = {"abcF" : FailingIterNext()}:NotImplementedError:('next',) + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = {"abcF" : %s} + d["a"] = {"abcF" : None}:TypeError:('unable to convert NoneType to vim structure',) + d["a"] = {"abcF" : {"": 1}}:ValueError:('empty keys are not allowed',) + d["a"] = {"abcF" : {u"": 1}}:ValueError:('empty keys are not allowed',) +! d["a"] = {"abcF" : FailingMapping()}:NotImplementedError:('keys',) +! d["a"] = {"abcF" : FailingMappingKey()}:NotImplementedError:('getitem:mappingkey',) +! d["a"] = {"abcF" : FailingNumber()}:TypeError:('long() argument must be a string or a number',) + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({%s : 1}) + d["a"] = Mapping({1 : 1}):TypeError:('expected str() or unicode() instance, but got int',) +*************** +*** 527,557 **** + <<< Finished + >>> Testing *Iter* using d["a"] = Mapping({"abcG" : %s}) + d["a"] = Mapping({"abcG" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',) +! d["a"] = Mapping({"abcG" : FailingIterNext()}):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abcG" : %s}) + d["a"] = Mapping({"abcG" : None}):TypeError:('unable to convert NoneType to vim structure',) + d["a"] = Mapping({"abcG" : {"": 1}}):ValueError:('empty keys are not allowed',) + d["a"] = Mapping({"abcG" : {u"": 1}}):ValueError:('empty keys are not allowed',) +! d["a"] = Mapping({"abcG" : FailingMapping()}):NotImplementedError:() +! d["a"] = Mapping({"abcG" : FailingMappingKey()}):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using d["a"] = %s + d["a"] = FailingIter():TypeError:('unable to convert FailingIter to vim structure',) +! d["a"] = FailingIterNext():NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = %s + d["a"] = None:TypeError:('unable to convert NoneType to vim structure',) + d["a"] = {"": 1}:ValueError:('empty keys are not allowed',) + d["a"] = {u"": 1}:ValueError:('empty keys are not allowed',) +! d["a"] = FailingMapping():NotImplementedError:() +! d["a"] = FailingMappingKey():NotImplementedError:() + <<< Finished + >> DictionaryUpdate + >>> kwargs + >>> iter +! d.update(FailingMapping()):NotImplementedError:() +! d.update([FailingIterNext()]):NotImplementedError:() + >>> Testing StringToChars using d.update({%s : 1}) + d.update({1 : 1}):TypeError:('expected str() or unicode() instance, but got int',) + d.update({u"\0" : 1}):TypeError:('expected string without null bytes',) +--- 569,605 ---- + <<< Finished + >>> Testing *Iter* using d["a"] = Mapping({"abcG" : %s}) + d["a"] = Mapping({"abcG" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',) +! d["a"] = Mapping({"abcG" : FailingIterNext()}):NotImplementedError:('next',) + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abcG" : %s}) + d["a"] = Mapping({"abcG" : None}):TypeError:('unable to convert NoneType to vim structure',) + d["a"] = Mapping({"abcG" : {"": 1}}):ValueError:('empty keys are not allowed',) + d["a"] = Mapping({"abcG" : {u"": 1}}):ValueError:('empty keys are not allowed',) +! d["a"] = Mapping({"abcG" : FailingMapping()}):NotImplementedError:('keys',) +! d["a"] = Mapping({"abcG" : FailingMappingKey()}):NotImplementedError:('getitem:mappingkey',) +! d["a"] = Mapping({"abcG" : FailingNumber()}):TypeError:('long() argument must be a string or a number',) + <<< Finished + >>> Testing *Iter* using d["a"] = %s + d["a"] = FailingIter():TypeError:('unable to convert FailingIter to vim structure',) +! d["a"] = FailingIterNext():NotImplementedError:('next',) + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = %s + d["a"] = None:TypeError:('unable to convert NoneType to vim structure',) + d["a"] = {"": 1}:ValueError:('empty keys are not allowed',) + d["a"] = {u"": 1}:ValueError:('empty keys are not allowed',) +! d["a"] = FailingMapping():NotImplementedError:('keys',) +! d["a"] = FailingMappingKey():NotImplementedError:('getitem:mappingkey',) +! d["a"] = FailingNumber():TypeError:('long() argument must be a string or a number',) + <<< Finished + >> DictionaryUpdate + >>> kwargs + >>> iter +! d.update(FailingMapping()):NotImplementedError:('keys',) +! d.update([FailingIterNext()]):NotImplementedError:('next',) +! >>> Testing *Iter* using d.update(%s) +! d.update(FailingIter()):NotImplementedError:('iter',) +! d.update(FailingIterNext()):NotImplementedError:('next',) +! <<< Finished + >>> Testing StringToChars using d.update({%s : 1}) + d.update({1 : 1}):TypeError:('expected str() or unicode() instance, but got int',) + d.update({u"\0" : 1}):TypeError:('expected string without null bytes',) +*************** +*** 569,582 **** + <<< Finished + >>> Testing *Iter* using d.update({"abcF" : %s}) + d.update({"abcF" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',) +! d.update({"abcF" : FailingIterNext()}):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d.update({"abcF" : %s}) + d.update({"abcF" : None}):TypeError:('unable to convert NoneType to vim structure',) + d.update({"abcF" : {"": 1}}):ValueError:('empty keys are not allowed',) + d.update({"abcF" : {u"": 1}}):ValueError:('empty keys are not allowed',) +! d.update({"abcF" : FailingMapping()}):NotImplementedError:() +! d.update({"abcF" : FailingMappingKey()}):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using d.update(Mapping({%s : 1})) + d.update(Mapping({1 : 1})):TypeError:('expected str() or unicode() instance, but got int',) +--- 617,631 ---- + <<< Finished + >>> Testing *Iter* using d.update({"abcF" : %s}) + d.update({"abcF" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',) +! d.update({"abcF" : FailingIterNext()}):NotImplementedError:('next',) + <<< Finished + >>> Testing ConvertFromPyObject using d.update({"abcF" : %s}) + d.update({"abcF" : None}):TypeError:('unable to convert NoneType to vim structure',) + d.update({"abcF" : {"": 1}}):ValueError:('empty keys are not allowed',) + d.update({"abcF" : {u"": 1}}):ValueError:('empty keys are not allowed',) +! d.update({"abcF" : FailingMapping()}):NotImplementedError:('keys',) +! d.update({"abcF" : FailingMappingKey()}):NotImplementedError:('getitem:mappingkey',) +! d.update({"abcF" : FailingNumber()}):TypeError:('long() argument must be a string or a number',) + <<< Finished + >>> Testing StringToChars using d.update(Mapping({%s : 1})) + d.update(Mapping({1 : 1})):TypeError:('expected str() or unicode() instance, but got int',) +*************** +*** 595,619 **** + <<< Finished + >>> Testing *Iter* using d.update(Mapping({"abcG" : %s})) + d.update(Mapping({"abcG" : FailingIter()})):TypeError:('unable to convert FailingIter to vim structure',) +! d.update(Mapping({"abcG" : FailingIterNext()})):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d.update(Mapping({"abcG" : %s})) + d.update(Mapping({"abcG" : None})):TypeError:('unable to convert NoneType to vim structure',) + d.update(Mapping({"abcG" : {"": 1}})):ValueError:('empty keys are not allowed',) + d.update(Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',) +! d.update(Mapping({"abcG" : FailingMapping()})):NotImplementedError:() +! d.update(Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using d.update(%s) +! d.update(FailingIter()):NotImplementedError:() +! d.update(FailingIterNext()):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d.update(%s) + d.update(None):TypeError:("'NoneType' object is not iterable",) + d.update({"": 1}):ValueError:('empty keys are not allowed',) + d.update({u"": 1}):ValueError:('empty keys are not allowed',) +! d.update(FailingMapping()):NotImplementedError:() +! d.update(FailingMappingKey()):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using d.update(((%s, 0),)) + d.update(((1, 0),)):TypeError:('expected str() or unicode() instance, but got int',) +--- 644,670 ---- + <<< Finished + >>> Testing *Iter* using d.update(Mapping({"abcG" : %s})) + d.update(Mapping({"abcG" : FailingIter()})):TypeError:('unable to convert FailingIter to vim structure',) +! d.update(Mapping({"abcG" : FailingIterNext()})):NotImplementedError:('next',) + <<< Finished + >>> Testing ConvertFromPyObject using d.update(Mapping({"abcG" : %s})) + d.update(Mapping({"abcG" : None})):TypeError:('unable to convert NoneType to vim structure',) + d.update(Mapping({"abcG" : {"": 1}})):ValueError:('empty keys are not allowed',) + d.update(Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',) +! d.update(Mapping({"abcG" : FailingMapping()})):NotImplementedError:('keys',) +! d.update(Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:('getitem:mappingkey',) +! d.update(Mapping({"abcG" : FailingNumber()})):TypeError:('long() argument must be a string or a number',) + <<< Finished + >>> Testing *Iter* using d.update(%s) +! d.update(FailingIter()):NotImplementedError:('iter',) +! d.update(FailingIterNext()):NotImplementedError:('next',) + <<< Finished + >>> Testing ConvertFromPyObject using d.update(%s) + d.update(None):TypeError:("'NoneType' object is not iterable",) + d.update({"": 1}):ValueError:('empty keys are not allowed',) + d.update({u"": 1}):ValueError:('empty keys are not allowed',) +! d.update(FailingMapping()):NotImplementedError:('keys',) +! d.update(FailingMappingKey()):NotImplementedError:('getitem:mappingkey',) +! d.update(FailingNumber()):TypeError:("'FailingNumber' object is not iterable",) + <<< Finished + >>> Testing StringToChars using d.update(((%s, 0),)) + d.update(((1, 0),)):TypeError:('expected str() or unicode() instance, but got int',) +*************** +*** 637,650 **** + <<< Finished + >>> Testing *Iter* using d.update((("a", {"abcF" : %s}),)) + d.update((("a", {"abcF" : FailingIter()}),)):TypeError:('unable to convert FailingIter to vim structure',) +! d.update((("a", {"abcF" : FailingIterNext()}),)):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", {"abcF" : %s}),)) + d.update((("a", {"abcF" : None}),)):TypeError:('unable to convert NoneType to vim structure',) + d.update((("a", {"abcF" : {"": 1}}),)):ValueError:('empty keys are not allowed',) + d.update((("a", {"abcF" : {u"": 1}}),)):ValueError:('empty keys are not allowed',) +! d.update((("a", {"abcF" : FailingMapping()}),)):NotImplementedError:() +! d.update((("a", {"abcF" : FailingMappingKey()}),)):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),)) + d.update((("a", Mapping({1 : 1})),)):TypeError:('expected str() or unicode() instance, but got int',) +--- 688,702 ---- + <<< Finished + >>> Testing *Iter* using d.update((("a", {"abcF" : %s}),)) + d.update((("a", {"abcF" : FailingIter()}),)):TypeError:('unable to convert FailingIter to vim structure',) +! d.update((("a", {"abcF" : FailingIterNext()}),)):NotImplementedError:('next',) + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", {"abcF" : %s}),)) + d.update((("a", {"abcF" : None}),)):TypeError:('unable to convert NoneType to vim structure',) + d.update((("a", {"abcF" : {"": 1}}),)):ValueError:('empty keys are not allowed',) + d.update((("a", {"abcF" : {u"": 1}}),)):ValueError:('empty keys are not allowed',) +! d.update((("a", {"abcF" : FailingMapping()}),)):NotImplementedError:('keys',) +! d.update((("a", {"abcF" : FailingMappingKey()}),)):NotImplementedError:('getitem:mappingkey',) +! d.update((("a", {"abcF" : FailingNumber()}),)):TypeError:('long() argument must be a string or a number',) + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),)) + d.update((("a", Mapping({1 : 1})),)):TypeError:('expected str() or unicode() instance, but got int',) +*************** +*** 663,687 **** + <<< Finished + >>> Testing *Iter* using d.update((("a", Mapping({"abcG" : %s})),)) + d.update((("a", Mapping({"abcG" : FailingIter()})),)):TypeError:('unable to convert FailingIter to vim structure',) +! d.update((("a", Mapping({"abcG" : FailingIterNext()})),)):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abcG" : %s})),)) + d.update((("a", Mapping({"abcG" : None})),)):TypeError:('unable to convert NoneType to vim structure',) + d.update((("a", Mapping({"abcG" : {"": 1}})),)):ValueError:('empty keys are not allowed',) + d.update((("a", Mapping({"abcG" : {u"": 1}})),)):ValueError:('empty keys are not allowed',) +! d.update((("a", Mapping({"abcG" : FailingMapping()})),)):NotImplementedError:() +! d.update((("a", Mapping({"abcG" : FailingMappingKey()})),)):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using d.update((("a", %s),)) + d.update((("a", FailingIter()),)):TypeError:('unable to convert FailingIter to vim structure',) +! d.update((("a", FailingIterNext()),)):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", %s),)) + d.update((("a", None),)):TypeError:('unable to convert NoneType to vim structure',) + d.update((("a", {"": 1}),)):ValueError:('empty keys are not allowed',) + d.update((("a", {u"": 1}),)):ValueError:('empty keys are not allowed',) +! d.update((("a", FailingMapping()),)):NotImplementedError:() +! d.update((("a", FailingMappingKey()),)):NotImplementedError:() + <<< Finished + >> DictionaryPopItem + d.popitem(1, 2):TypeError:('popitem() takes no arguments (2 given)',) +--- 715,741 ---- + <<< Finished + >>> Testing *Iter* using d.update((("a", Mapping({"abcG" : %s})),)) + d.update((("a", Mapping({"abcG" : FailingIter()})),)):TypeError:('unable to convert FailingIter to vim structure',) +! d.update((("a", Mapping({"abcG" : FailingIterNext()})),)):NotImplementedError:('next',) + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abcG" : %s})),)) + d.update((("a", Mapping({"abcG" : None})),)):TypeError:('unable to convert NoneType to vim structure',) + d.update((("a", Mapping({"abcG" : {"": 1}})),)):ValueError:('empty keys are not allowed',) + d.update((("a", Mapping({"abcG" : {u"": 1}})),)):ValueError:('empty keys are not allowed',) +! d.update((("a", Mapping({"abcG" : FailingMapping()})),)):NotImplementedError:('keys',) +! d.update((("a", Mapping({"abcG" : FailingMappingKey()})),)):NotImplementedError:('getitem:mappingkey',) +! d.update((("a", Mapping({"abcG" : FailingNumber()})),)):TypeError:('long() argument must be a string or a number',) + <<< Finished + >>> Testing *Iter* using d.update((("a", %s),)) + d.update((("a", FailingIter()),)):TypeError:('unable to convert FailingIter to vim structure',) +! d.update((("a", FailingIterNext()),)):NotImplementedError:('next',) + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", %s),)) + d.update((("a", None),)):TypeError:('unable to convert NoneType to vim structure',) + d.update((("a", {"": 1}),)):ValueError:('empty keys are not allowed',) + d.update((("a", {u"": 1}),)):ValueError:('empty keys are not allowed',) +! d.update((("a", FailingMapping()),)):NotImplementedError:('keys',) +! d.update((("a", FailingMappingKey()),)):NotImplementedError:('getitem:mappingkey',) +! d.update((("a", FailingNumber()),)):TypeError:('long() argument must be a string or a number',) + <<< Finished + >> DictionaryPopItem + d.popitem(1, 2):TypeError:('popitem() takes no arguments (2 given)',) +*************** +*** 691,696 **** +--- 745,754 ---- + >> ListConstructor + vim.List(1, 2):TypeError:('function takes at most 1 argument (2 given)',) + vim.List(a=1):TypeError:('list constructor does not accept keyword arguments',) ++ >>> Testing *Iter* using vim.List(%s) ++ vim.List(FailingIter()):NotImplementedError:('iter',) ++ vim.List(FailingIterNext()):NotImplementedError:('next',) ++ <<< Finished + >>> Testing StringToChars using vim.List([{%s : 1}]) + vim.List([{1 : 1}]):TypeError:('expected str() or unicode() instance, but got int',) + vim.List([{u"\0" : 1}]):TypeError:('expected string without null bytes',) +*************** +*** 708,721 **** + <<< Finished + >>> Testing *Iter* using vim.List([{"abcF" : %s}]) + vim.List([{"abcF" : FailingIter()}]):TypeError:('unable to convert FailingIter to vim structure',) +! vim.List([{"abcF" : FailingIterNext()}]):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([{"abcF" : %s}]) + vim.List([{"abcF" : None}]):TypeError:('unable to convert NoneType to vim structure',) + vim.List([{"abcF" : {"": 1}}]):ValueError:('empty keys are not allowed',) + vim.List([{"abcF" : {u"": 1}}]):ValueError:('empty keys are not allowed',) +! vim.List([{"abcF" : FailingMapping()}]):NotImplementedError:() +! vim.List([{"abcF" : FailingMappingKey()}]):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({%s : 1})]) + vim.List([Mapping({1 : 1})]):TypeError:('expected str() or unicode() instance, but got int',) +--- 766,780 ---- + <<< Finished + >>> Testing *Iter* using vim.List([{"abcF" : %s}]) + vim.List([{"abcF" : FailingIter()}]):TypeError:('unable to convert FailingIter to vim structure',) +! vim.List([{"abcF" : FailingIterNext()}]):NotImplementedError:('next',) + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([{"abcF" : %s}]) + vim.List([{"abcF" : None}]):TypeError:('unable to convert NoneType to vim structure',) + vim.List([{"abcF" : {"": 1}}]):ValueError:('empty keys are not allowed',) + vim.List([{"abcF" : {u"": 1}}]):ValueError:('empty keys are not allowed',) +! vim.List([{"abcF" : FailingMapping()}]):NotImplementedError:('keys',) +! vim.List([{"abcF" : FailingMappingKey()}]):NotImplementedError:('getitem:mappingkey',) +! vim.List([{"abcF" : FailingNumber()}]):TypeError:('long() argument must be a string or a number',) + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({%s : 1})]) + vim.List([Mapping({1 : 1})]):TypeError:('expected str() or unicode() instance, but got int',) +*************** +*** 734,758 **** + <<< Finished + >>> Testing *Iter* using vim.List([Mapping({"abcG" : %s})]) + vim.List([Mapping({"abcG" : FailingIter()})]):TypeError:('unable to convert FailingIter to vim structure',) +! vim.List([Mapping({"abcG" : FailingIterNext()})]):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([Mapping({"abcG" : %s})]) + vim.List([Mapping({"abcG" : None})]):TypeError:('unable to convert NoneType to vim structure',) + vim.List([Mapping({"abcG" : {"": 1}})]):ValueError:('empty keys are not allowed',) + vim.List([Mapping({"abcG" : {u"": 1}})]):ValueError:('empty keys are not allowed',) +! vim.List([Mapping({"abcG" : FailingMapping()})]):NotImplementedError:() +! vim.List([Mapping({"abcG" : FailingMappingKey()})]):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using vim.List([%s]) + vim.List([FailingIter()]):TypeError:('unable to convert FailingIter to vim structure',) +! vim.List([FailingIterNext()]):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([%s]) + vim.List([None]):TypeError:('unable to convert NoneType to vim structure',) + vim.List([{"": 1}]):ValueError:('empty keys are not allowed',) + vim.List([{u"": 1}]):ValueError:('empty keys are not allowed',) +! vim.List([FailingMapping()]):NotImplementedError:() +! vim.List([FailingMappingKey()]):NotImplementedError:() + <<< Finished + >> ListItem + l[1000]:IndexError:('list index out of range',) +--- 793,819 ---- + <<< Finished + >>> Testing *Iter* using vim.List([Mapping({"abcG" : %s})]) + vim.List([Mapping({"abcG" : FailingIter()})]):TypeError:('unable to convert FailingIter to vim structure',) +! vim.List([Mapping({"abcG" : FailingIterNext()})]):NotImplementedError:('next',) + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([Mapping({"abcG" : %s})]) + vim.List([Mapping({"abcG" : None})]):TypeError:('unable to convert NoneType to vim structure',) + vim.List([Mapping({"abcG" : {"": 1}})]):ValueError:('empty keys are not allowed',) + vim.List([Mapping({"abcG" : {u"": 1}})]):ValueError:('empty keys are not allowed',) +! vim.List([Mapping({"abcG" : FailingMapping()})]):NotImplementedError:('keys',) +! vim.List([Mapping({"abcG" : FailingMappingKey()})]):NotImplementedError:('getitem:mappingkey',) +! vim.List([Mapping({"abcG" : FailingNumber()})]):TypeError:('long() argument must be a string or a number',) + <<< Finished + >>> Testing *Iter* using vim.List([%s]) + vim.List([FailingIter()]):TypeError:('unable to convert FailingIter to vim structure',) +! vim.List([FailingIterNext()]):NotImplementedError:('next',) + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([%s]) + vim.List([None]):TypeError:('unable to convert NoneType to vim structure',) + vim.List([{"": 1}]):ValueError:('empty keys are not allowed',) + vim.List([{u"": 1}]):ValueError:('empty keys are not allowed',) +! vim.List([FailingMapping()]):NotImplementedError:('keys',) +! vim.List([FailingMappingKey()]):NotImplementedError:('getitem:mappingkey',) +! vim.List([FailingNumber()]):TypeError:('long() argument must be a string or a number',) + <<< Finished + >> ListItem + l[1000]:IndexError:('list index out of range',) +*************** +*** 761,766 **** +--- 822,831 ---- + l[1000] = 3:IndexError:('list index out of range',) + >> ListAssSlice + ll[1:100] = "abcJ":error:('list is locked',) ++ >>> Testing *Iter* using l[:] = %s ++ l[:] = FailingIter():NotImplementedError:('iter',) ++ l[:] = FailingIterNext():NotImplementedError:('next',) ++ <<< Finished + >>> Testing StringToChars using l[:] = [{%s : 1}] + l[:] = [{1 : 1}]:TypeError:('expected str() or unicode() instance, but got int',) + l[:] = [{u"\0" : 1}]:TypeError:('expected string without null bytes',) +*************** +*** 778,791 **** + <<< Finished + >>> Testing *Iter* using l[:] = [{"abcF" : %s}] + l[:] = [{"abcF" : FailingIter()}]:TypeError:('unable to convert FailingIter to vim structure',) +! l[:] = [{"abcF" : FailingIterNext()}]:NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [{"abcF" : %s}] + l[:] = [{"abcF" : None}]:TypeError:('unable to convert NoneType to vim structure',) + l[:] = [{"abcF" : {"": 1}}]:ValueError:('empty keys are not allowed',) + l[:] = [{"abcF" : {u"": 1}}]:ValueError:('empty keys are not allowed',) +! l[:] = [{"abcF" : FailingMapping()}]:NotImplementedError:() +! l[:] = [{"abcF" : FailingMappingKey()}]:NotImplementedError:() + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({%s : 1})] + l[:] = [Mapping({1 : 1})]:TypeError:('expected str() or unicode() instance, but got int',) +--- 843,857 ---- + <<< Finished + >>> Testing *Iter* using l[:] = [{"abcF" : %s}] + l[:] = [{"abcF" : FailingIter()}]:TypeError:('unable to convert FailingIter to vim structure',) +! l[:] = [{"abcF" : FailingIterNext()}]:NotImplementedError:('next',) + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [{"abcF" : %s}] + l[:] = [{"abcF" : None}]:TypeError:('unable to convert NoneType to vim structure',) + l[:] = [{"abcF" : {"": 1}}]:ValueError:('empty keys are not allowed',) + l[:] = [{"abcF" : {u"": 1}}]:ValueError:('empty keys are not allowed',) +! l[:] = [{"abcF" : FailingMapping()}]:NotImplementedError:('keys',) +! l[:] = [{"abcF" : FailingMappingKey()}]:NotImplementedError:('getitem:mappingkey',) +! l[:] = [{"abcF" : FailingNumber()}]:TypeError:('long() argument must be a string or a number',) + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({%s : 1})] + l[:] = [Mapping({1 : 1})]:TypeError:('expected str() or unicode() instance, but got int',) +*************** +*** 804,830 **** + <<< Finished + >>> Testing *Iter* using l[:] = [Mapping({"abcG" : %s})] + l[:] = [Mapping({"abcG" : FailingIter()})]:TypeError:('unable to convert FailingIter to vim structure',) +! l[:] = [Mapping({"abcG" : FailingIterNext()})]:NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abcG" : %s})] + l[:] = [Mapping({"abcG" : None})]:TypeError:('unable to convert NoneType to vim structure',) + l[:] = [Mapping({"abcG" : {"": 1}})]:ValueError:('empty keys are not allowed',) + l[:] = [Mapping({"abcG" : {u"": 1}})]:ValueError:('empty keys are not allowed',) +! l[:] = [Mapping({"abcG" : FailingMapping()})]:NotImplementedError:() +! l[:] = [Mapping({"abcG" : FailingMappingKey()})]:NotImplementedError:() + <<< Finished + >>> Testing *Iter* using l[:] = [%s] + l[:] = [FailingIter()]:TypeError:('unable to convert FailingIter to vim structure',) +! l[:] = [FailingIterNext()]:NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [%s] + l[:] = [None]:TypeError:('unable to convert NoneType to vim structure',) + l[:] = [{"": 1}]:ValueError:('empty keys are not allowed',) + l[:] = [{u"": 1}]:ValueError:('empty keys are not allowed',) +! l[:] = [FailingMapping()]:NotImplementedError:() +! l[:] = [FailingMappingKey()]:NotImplementedError:() + <<< Finished + >> ListConcatInPlace + >>> Testing StringToChars using l.extend([{%s : 1}]) + l.extend([{1 : 1}]):TypeError:('expected str() or unicode() instance, but got int',) + l.extend([{u"\0" : 1}]):TypeError:('expected string without null bytes',) +--- 870,902 ---- + <<< Finished + >>> Testing *Iter* using l[:] = [Mapping({"abcG" : %s})] + l[:] = [Mapping({"abcG" : FailingIter()})]:TypeError:('unable to convert FailingIter to vim structure',) +! l[:] = [Mapping({"abcG" : FailingIterNext()})]:NotImplementedError:('next',) + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abcG" : %s})] + l[:] = [Mapping({"abcG" : None})]:TypeError:('unable to convert NoneType to vim structure',) + l[:] = [Mapping({"abcG" : {"": 1}})]:ValueError:('empty keys are not allowed',) + l[:] = [Mapping({"abcG" : {u"": 1}})]:ValueError:('empty keys are not allowed',) +! l[:] = [Mapping({"abcG" : FailingMapping()})]:NotImplementedError:('keys',) +! l[:] = [Mapping({"abcG" : FailingMappingKey()})]:NotImplementedError:('getitem:mappingkey',) +! l[:] = [Mapping({"abcG" : FailingNumber()})]:TypeError:('long() argument must be a string or a number',) + <<< Finished + >>> Testing *Iter* using l[:] = [%s] + l[:] = [FailingIter()]:TypeError:('unable to convert FailingIter to vim structure',) +! l[:] = [FailingIterNext()]:NotImplementedError:('next',) + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [%s] + l[:] = [None]:TypeError:('unable to convert NoneType to vim structure',) + l[:] = [{"": 1}]:ValueError:('empty keys are not allowed',) + l[:] = [{u"": 1}]:ValueError:('empty keys are not allowed',) +! l[:] = [FailingMapping()]:NotImplementedError:('keys',) +! l[:] = [FailingMappingKey()]:NotImplementedError:('getitem:mappingkey',) +! l[:] = [FailingNumber()]:TypeError:('long() argument must be a string or a number',) + <<< Finished + >> ListConcatInPlace ++ >>> Testing *Iter* using l.extend(%s) ++ l.extend(FailingIter()):NotImplementedError:('iter',) ++ l.extend(FailingIterNext()):NotImplementedError:('next',) ++ <<< Finished + >>> Testing StringToChars using l.extend([{%s : 1}]) + l.extend([{1 : 1}]):TypeError:('expected str() or unicode() instance, but got int',) + l.extend([{u"\0" : 1}]):TypeError:('expected string without null bytes',) +*************** +*** 842,855 **** + <<< Finished + >>> Testing *Iter* using l.extend([{"abcF" : %s}]) + l.extend([{"abcF" : FailingIter()}]):TypeError:('unable to convert FailingIter to vim structure',) +! l.extend([{"abcF" : FailingIterNext()}]):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([{"abcF" : %s}]) + l.extend([{"abcF" : None}]):TypeError:('unable to convert NoneType to vim structure',) + l.extend([{"abcF" : {"": 1}}]):ValueError:('empty keys are not allowed',) + l.extend([{"abcF" : {u"": 1}}]):ValueError:('empty keys are not allowed',) +! l.extend([{"abcF" : FailingMapping()}]):NotImplementedError:() +! l.extend([{"abcF" : FailingMappingKey()}]):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({%s : 1})]) + l.extend([Mapping({1 : 1})]):TypeError:('expected str() or unicode() instance, but got int',) +--- 914,928 ---- + <<< Finished + >>> Testing *Iter* using l.extend([{"abcF" : %s}]) + l.extend([{"abcF" : FailingIter()}]):TypeError:('unable to convert FailingIter to vim structure',) +! l.extend([{"abcF" : FailingIterNext()}]):NotImplementedError:('next',) + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([{"abcF" : %s}]) + l.extend([{"abcF" : None}]):TypeError:('unable to convert NoneType to vim structure',) + l.extend([{"abcF" : {"": 1}}]):ValueError:('empty keys are not allowed',) + l.extend([{"abcF" : {u"": 1}}]):ValueError:('empty keys are not allowed',) +! l.extend([{"abcF" : FailingMapping()}]):NotImplementedError:('keys',) +! l.extend([{"abcF" : FailingMappingKey()}]):NotImplementedError:('getitem:mappingkey',) +! l.extend([{"abcF" : FailingNumber()}]):TypeError:('long() argument must be a string or a number',) + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({%s : 1})]) + l.extend([Mapping({1 : 1})]):TypeError:('expected str() or unicode() instance, but got int',) +*************** +*** 868,896 **** + <<< Finished + >>> Testing *Iter* using l.extend([Mapping({"abcG" : %s})]) + l.extend([Mapping({"abcG" : FailingIter()})]):TypeError:('unable to convert FailingIter to vim structure',) +! l.extend([Mapping({"abcG" : FailingIterNext()})]):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([Mapping({"abcG" : %s})]) + l.extend([Mapping({"abcG" : None})]):TypeError:('unable to convert NoneType to vim structure',) + l.extend([Mapping({"abcG" : {"": 1}})]):ValueError:('empty keys are not allowed',) + l.extend([Mapping({"abcG" : {u"": 1}})]):ValueError:('empty keys are not allowed',) +! l.extend([Mapping({"abcG" : FailingMapping()})]):NotImplementedError:() +! l.extend([Mapping({"abcG" : FailingMappingKey()})]):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using l.extend([%s]) + l.extend([FailingIter()]):TypeError:('unable to convert FailingIter to vim structure',) +! l.extend([FailingIterNext()]):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([%s]) + l.extend([None]):TypeError:('unable to convert NoneType to vim structure',) + l.extend([{"": 1}]):ValueError:('empty keys are not allowed',) + l.extend([{u"": 1}]):ValueError:('empty keys are not allowed',) +! l.extend([FailingMapping()]):NotImplementedError:() +! l.extend([FailingMappingKey()]):NotImplementedError:() + <<< Finished + >> ListSetattr + del l.locked:AttributeError:('cannot delete vim.List attributes',) +! l.locked = FailingTrue():NotImplementedError:() + l.xxx = True:AttributeError:('cannot set attribute xxx',) + > Function + >> FunctionConstructor +--- 941,971 ---- + <<< Finished + >>> Testing *Iter* using l.extend([Mapping({"abcG" : %s})]) + l.extend([Mapping({"abcG" : FailingIter()})]):TypeError:('unable to convert FailingIter to vim structure',) +! l.extend([Mapping({"abcG" : FailingIterNext()})]):NotImplementedError:('next',) + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([Mapping({"abcG" : %s})]) + l.extend([Mapping({"abcG" : None})]):TypeError:('unable to convert NoneType to vim structure',) + l.extend([Mapping({"abcG" : {"": 1}})]):ValueError:('empty keys are not allowed',) + l.extend([Mapping({"abcG" : {u"": 1}})]):ValueError:('empty keys are not allowed',) +! l.extend([Mapping({"abcG" : FailingMapping()})]):NotImplementedError:('keys',) +! l.extend([Mapping({"abcG" : FailingMappingKey()})]):NotImplementedError:('getitem:mappingkey',) +! l.extend([Mapping({"abcG" : FailingNumber()})]):TypeError:('long() argument must be a string or a number',) + <<< Finished + >>> Testing *Iter* using l.extend([%s]) + l.extend([FailingIter()]):TypeError:('unable to convert FailingIter to vim structure',) +! l.extend([FailingIterNext()]):NotImplementedError:('next',) + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([%s]) + l.extend([None]):TypeError:('unable to convert NoneType to vim structure',) + l.extend([{"": 1}]):ValueError:('empty keys are not allowed',) + l.extend([{u"": 1}]):ValueError:('empty keys are not allowed',) +! l.extend([FailingMapping()]):NotImplementedError:('keys',) +! l.extend([FailingMappingKey()]):NotImplementedError:('getitem:mappingkey',) +! l.extend([FailingNumber()]):TypeError:('long() argument must be a string or a number',) + <<< Finished + >> ListSetattr + del l.locked:AttributeError:('cannot delete vim.List attributes',) +! l.locked = FailingTrue():NotImplementedError:('bool',) + l.xxx = True:AttributeError:('cannot set attribute xxx',) + > Function + >> FunctionConstructor +*************** +*** 915,928 **** + <<< Finished + >>> Testing *Iter* using f({"abcF" : %s}) + f({"abcF" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',) +! f({"abcF" : FailingIterNext()}):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using f({"abcF" : %s}) + f({"abcF" : None}):TypeError:('unable to convert NoneType to vim structure',) + f({"abcF" : {"": 1}}):ValueError:('empty keys are not allowed',) + f({"abcF" : {u"": 1}}):ValueError:('empty keys are not allowed',) +! f({"abcF" : FailingMapping()}):NotImplementedError:() +! f({"abcF" : FailingMappingKey()}):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using f(Mapping({%s : 1})) + f(Mapping({1 : 1})):TypeError:('expected str() or unicode() instance, but got int',) +--- 990,1004 ---- + <<< Finished + >>> Testing *Iter* using f({"abcF" : %s}) + f({"abcF" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',) +! f({"abcF" : FailingIterNext()}):NotImplementedError:('next',) + <<< Finished + >>> Testing ConvertFromPyObject using f({"abcF" : %s}) + f({"abcF" : None}):TypeError:('unable to convert NoneType to vim structure',) + f({"abcF" : {"": 1}}):ValueError:('empty keys are not allowed',) + f({"abcF" : {u"": 1}}):ValueError:('empty keys are not allowed',) +! f({"abcF" : FailingMapping()}):NotImplementedError:('keys',) +! f({"abcF" : FailingMappingKey()}):NotImplementedError:('getitem:mappingkey',) +! f({"abcF" : FailingNumber()}):TypeError:('long() argument must be a string or a number',) + <<< Finished + >>> Testing StringToChars using f(Mapping({%s : 1})) + f(Mapping({1 : 1})):TypeError:('expected str() or unicode() instance, but got int',) +*************** +*** 941,965 **** + <<< Finished + >>> Testing *Iter* using f(Mapping({"abcG" : %s})) + f(Mapping({"abcG" : FailingIter()})):TypeError:('unable to convert FailingIter to vim structure',) +! f(Mapping({"abcG" : FailingIterNext()})):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using f(Mapping({"abcG" : %s})) + f(Mapping({"abcG" : None})):TypeError:('unable to convert NoneType to vim structure',) + f(Mapping({"abcG" : {"": 1}})):ValueError:('empty keys are not allowed',) + f(Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',) +! f(Mapping({"abcG" : FailingMapping()})):NotImplementedError:() +! f(Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using f(%s) + f(FailingIter()):TypeError:('unable to convert FailingIter to vim structure',) +! f(FailingIterNext()):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using f(%s) + f(None):TypeError:('unable to convert NoneType to vim structure',) + f({"": 1}):ValueError:('empty keys are not allowed',) + f({u"": 1}):ValueError:('empty keys are not allowed',) +! f(FailingMapping()):NotImplementedError:() +! f(FailingMappingKey()):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using fd(self={%s : 1}) + fd(self={1 : 1}):TypeError:('expected str() or unicode() instance, but got int',) +--- 1017,1043 ---- + <<< Finished + >>> Testing *Iter* using f(Mapping({"abcG" : %s})) + f(Mapping({"abcG" : FailingIter()})):TypeError:('unable to convert FailingIter to vim structure',) +! f(Mapping({"abcG" : FailingIterNext()})):NotImplementedError:('next',) + <<< Finished + >>> Testing ConvertFromPyObject using f(Mapping({"abcG" : %s})) + f(Mapping({"abcG" : None})):TypeError:('unable to convert NoneType to vim structure',) + f(Mapping({"abcG" : {"": 1}})):ValueError:('empty keys are not allowed',) + f(Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',) +! f(Mapping({"abcG" : FailingMapping()})):NotImplementedError:('keys',) +! f(Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:('getitem:mappingkey',) +! f(Mapping({"abcG" : FailingNumber()})):TypeError:('long() argument must be a string or a number',) + <<< Finished + >>> Testing *Iter* using f(%s) + f(FailingIter()):TypeError:('unable to convert FailingIter to vim structure',) +! f(FailingIterNext()):NotImplementedError:('next',) + <<< Finished + >>> Testing ConvertFromPyObject using f(%s) + f(None):TypeError:('unable to convert NoneType to vim structure',) + f({"": 1}):ValueError:('empty keys are not allowed',) + f({u"": 1}):ValueError:('empty keys are not allowed',) +! f(FailingMapping()):NotImplementedError:('keys',) +! f(FailingMappingKey()):NotImplementedError:('getitem:mappingkey',) +! f(FailingNumber()):TypeError:('long() argument must be a string or a number',) + <<< Finished + >>> Testing StringToChars using fd(self={%s : 1}) + fd(self={1 : 1}):TypeError:('expected str() or unicode() instance, but got int',) +*************** +*** 978,991 **** + <<< Finished + >>> Testing *Iter* using fd(self={"abcF" : %s}) + fd(self={"abcF" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',) +! fd(self={"abcF" : FailingIterNext()}):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using fd(self={"abcF" : %s}) + fd(self={"abcF" : None}):TypeError:('unable to convert NoneType to vim structure',) + fd(self={"abcF" : {"": 1}}):ValueError:('empty keys are not allowed',) + fd(self={"abcF" : {u"": 1}}):ValueError:('empty keys are not allowed',) +! fd(self={"abcF" : FailingMapping()}):NotImplementedError:() +! fd(self={"abcF" : FailingMappingKey()}):NotImplementedError:() + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({%s : 1})) + fd(self=Mapping({1 : 1})):TypeError:('expected str() or unicode() instance, but got int',) +--- 1056,1070 ---- + <<< Finished + >>> Testing *Iter* using fd(self={"abcF" : %s}) + fd(self={"abcF" : FailingIter()}):TypeError:('unable to convert FailingIter to vim structure',) +! fd(self={"abcF" : FailingIterNext()}):NotImplementedError:('next',) + <<< Finished + >>> Testing ConvertFromPyObject using fd(self={"abcF" : %s}) + fd(self={"abcF" : None}):TypeError:('unable to convert NoneType to vim structure',) + fd(self={"abcF" : {"": 1}}):ValueError:('empty keys are not allowed',) + fd(self={"abcF" : {u"": 1}}):ValueError:('empty keys are not allowed',) +! fd(self={"abcF" : FailingMapping()}):NotImplementedError:('keys',) +! fd(self={"abcF" : FailingMappingKey()}):NotImplementedError:('getitem:mappingkey',) +! fd(self={"abcF" : FailingNumber()}):TypeError:('long() argument must be a string or a number',) + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({%s : 1})) + fd(self=Mapping({1 : 1})):TypeError:('expected str() or unicode() instance, but got int',) +*************** +*** 1004,1017 **** + <<< Finished + >>> Testing *Iter* using fd(self=Mapping({"abcG" : %s})) + fd(self=Mapping({"abcG" : FailingIter()})):TypeError:('unable to convert FailingIter to vim structure',) +! fd(self=Mapping({"abcG" : FailingIterNext()})):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyObject using fd(self=Mapping({"abcG" : %s})) + fd(self=Mapping({"abcG" : None})):TypeError:('unable to convert NoneType to vim structure',) + fd(self=Mapping({"abcG" : {"": 1}})):ValueError:('empty keys are not allowed',) + fd(self=Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',) +! fd(self=Mapping({"abcG" : FailingMapping()})):NotImplementedError:() +! fd(self=Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:() + <<< Finished + >>> Testing *Iter* using fd(self=%s) + fd(self=FailingIter()):TypeError:('unable to convert FailingIter to vim dictionary',) +--- 1083,1097 ---- + <<< Finished + >>> Testing *Iter* using fd(self=Mapping({"abcG" : %s})) + fd(self=Mapping({"abcG" : FailingIter()})):TypeError:('unable to convert FailingIter to vim structure',) +! fd(self=Mapping({"abcG" : FailingIterNext()})):NotImplementedError:('next',) + <<< Finished + >>> Testing ConvertFromPyObject using fd(self=Mapping({"abcG" : %s})) + fd(self=Mapping({"abcG" : None})):TypeError:('unable to convert NoneType to vim structure',) + fd(self=Mapping({"abcG" : {"": 1}})):ValueError:('empty keys are not allowed',) + fd(self=Mapping({"abcG" : {u"": 1}})):ValueError:('empty keys are not allowed',) +! fd(self=Mapping({"abcG" : FailingMapping()})):NotImplementedError:('keys',) +! fd(self=Mapping({"abcG" : FailingMappingKey()})):NotImplementedError:('getitem:mappingkey',) +! fd(self=Mapping({"abcG" : FailingNumber()})):TypeError:('long() argument must be a string or a number',) + <<< Finished + >>> Testing *Iter* using fd(self=%s) + fd(self=FailingIter()):TypeError:('unable to convert FailingIter to vim dictionary',) +*************** +*** 1021,1028 **** + fd(self=None):TypeError:('unable to convert NoneType to vim dictionary',) + fd(self={"": 1}):ValueError:('empty keys are not allowed',) + fd(self={u"": 1}):ValueError:('empty keys are not allowed',) +! fd(self=FailingMapping()):NotImplementedError:() +! fd(self=FailingMappingKey()):NotImplementedError:() + <<< Finished + >>> Testing ConvertFromPyMapping using fd(self=%s) + fd(self=[]):TypeError:('unable to convert list to vim dictionary',) +--- 1101,1109 ---- + fd(self=None):TypeError:('unable to convert NoneType to vim dictionary',) + fd(self={"": 1}):ValueError:('empty keys are not allowed',) + fd(self={u"": 1}):ValueError:('empty keys are not allowed',) +! fd(self=FailingMapping()):NotImplementedError:('keys',) +! fd(self=FailingMappingKey()):NotImplementedError:('getitem:mappingkey',) +! fd(self=FailingNumber()):TypeError:('unable to convert FailingNumber to vim dictionary',) + <<< Finished + >>> Testing ConvertFromPyMapping using fd(self=%s) + fd(self=[]):TypeError:('unable to convert list to vim dictionary',) +*************** +*** 1040,1053 **** + vim.current.window.buffer = 0:TypeError:('readonly attribute: buffer',) + vim.current.window.cursor = (100000000, 100000000):error:('cursor position outside buffer',) + vim.current.window.cursor = True:TypeError:('argument must be 2-item sequence, not bool',) +! vim.current.window.height = "abcK":TypeError:('expected int(), long() or something supporting coercing to long(), but got str',) +! vim.current.window.width = "abcL":TypeError:('expected int(), long() or something supporting coercing to long(), but got str',) + vim.current.window.xxxxxx = True:AttributeError:('xxxxxx',) + > WinList + >> WinListItem + vim.windows[1000]:IndexError:('no such window',) + > Buffer + >> StringToLine (indirect) + vim.current.buffer[0] = "\na":error:('string cannot contain newlines',) + >> SetBufferLine (indirect) + vim.current.buffer[0] = True:TypeError:('bad argument type for built-in operation',) +--- 1121,1143 ---- + vim.current.window.buffer = 0:TypeError:('readonly attribute: buffer',) + vim.current.window.cursor = (100000000, 100000000):error:('cursor position outside buffer',) + vim.current.window.cursor = True:TypeError:('argument must be 2-item sequence, not bool',) +! >>> Testing NumberToLong using vim.current.window.height = %s +! vim.current.window.height = []:TypeError:('expected int(), long() or something supporting coercing to long(), but got list',) +! vim.current.window.height = None:TypeError:('expected int(), long() or something supporting coercing to long(), but got NoneType',) +! vim.current.window.height = -1:ValueError:('number must be greater or equal to zero',) +! <<< Finished +! >>> Testing NumberToLong using vim.current.window.width = %s +! vim.current.window.width = []:TypeError:('expected int(), long() or something supporting coercing to long(), but got list',) +! vim.current.window.width = None:TypeError:('expected int(), long() or something supporting coercing to long(), but got NoneType',) +! vim.current.window.width = -1:ValueError:('number must be greater or equal to zero',) +! <<< Finished + vim.current.window.xxxxxx = True:AttributeError:('xxxxxx',) + > WinList + >> WinListItem + vim.windows[1000]:IndexError:('no such window',) + > Buffer + >> StringToLine (indirect) ++ vim.current.buffer[0] = u"\na":error:('string cannot contain newlines',) + vim.current.buffer[0] = "\na":error:('string cannot contain newlines',) + >> SetBufferLine (indirect) + vim.current.buffer[0] = True:TypeError:('bad argument type for built-in operation',) +*************** +*** 1075,1082 **** + vim.current.buffer.range(1, 2, 3):TypeError:('function takes exactly 2 arguments (3 given)',) + > BufMap + >> BufMapItem +- vim.buffers[None]:TypeError:('expected int(), long() or something supporting coercing to long(), but got NoneType',) + vim.buffers[100000000]:KeyError:(100000000,) + > Current + >> CurrentGetattr + vim.current.xxx:AttributeError:('xxx',) +--- 1165,1177 ---- + vim.current.buffer.range(1, 2, 3):TypeError:('function takes exactly 2 arguments (3 given)',) + > BufMap + >> BufMapItem + vim.buffers[100000000]:KeyError:(100000000,) ++ >>> Testing NumberToLong using vim.buffers[%s] ++ vim.buffers[[]]:TypeError:('expected int(), long() or something supporting coercing to long(), but got list',) ++ vim.buffers[None]:TypeError:('expected int(), long() or something supporting coercing to long(), but got NoneType',) ++ vim.buffers[-1]:ValueError:('number must be greater then zero',) ++ vim.buffers[0]:ValueError:('number must be greater then zero',) ++ <<< Finished + > Current + >> CurrentGetattr + vim.current.xxx:AttributeError:('xxx',) +*************** +*** 1086,1094 **** +--- 1181,1194 ---- + vim.current.window = True:TypeError:('expected vim.Window object, but got bool',) + vim.current.tabpage = True:TypeError:('expected vim.TabPage object, but got bool',) + vim.current.xxx = True:AttributeError:('xxx',) ++ ['/testdir'] ++ '/testdir' + 2,xx + before + after ++ pythonx/topmodule/__init__.py ++ pythonx/topmodule/submodule/__init__.py ++ pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py + vim.command("throw 'abcN'"):error:('abcN',) + Exe("throw 'def'"):error:('def',) + vim.eval("Exe('throw ''ghi''')"):error:('ghi',) +*** ../vim-7.3.1235/src/testdir/test87.in 2013-06-23 14:37:00.000000000 +0200 +--- src/testdir/test87.in 2013-06-23 16:26:40.000000000 +0200 +*************** +*** 290,296 **** + :" threading + :let l = [0] + :py3 l=vim.bindeval('l') +! :py3 < Output") + cb.append(">> OutputSetattr") + ee('del sys.stdout.softspace') +! ee('sys.stdout.softspace = []') + ee('sys.stdout.attr = None') + cb.append(">> OutputWrite") + ee('sys.stdout.write(None)') +--- 913,980 ---- + 'FailingIterNext()', + )) + ++ def number_test(expr, natural=False, unsigned=False): ++ if natural: ++ unsigned = True ++ return subexpr_test(expr, 'NumberToLong', ( ++ '[]', ++ 'None', ++ ) + (('-1',) if unsigned else ()) ++ + (('0',) if natural else ())) ++ + class FailingTrue(object): + def __bool__(self): +! raise NotImplementedError('bool') + + class FailingIter(object): + def __iter__(self): +! raise NotImplementedError('iter') + + class FailingIterNext(object): + def __iter__(self): + return self + + def __next__(self): +! raise NotImplementedError('next') + + class FailingMappingKey(object): + def __getitem__(self, item): +! raise NotImplementedError('getitem:mappingkey') + + def keys(self): + return list("abcH") + + class FailingMapping(object): + def __getitem__(self): +! raise NotImplementedError('getitem:mapping') + + def keys(self): +! raise NotImplementedError('keys') + + class FailingList(list): + def __getitem__(self, idx): + if i == 2: +! raise NotImplementedError('getitem:list') + else: + return super(FailingList, self).__getitem__(idx) + ++ class NoArgsCall(object): ++ def __call__(self): ++ pass ++ ++ class FailingCall(object): ++ def __call__(self, path): ++ raise NotImplementedError('call') ++ ++ class FailingNumber(object): ++ def __int__(self): ++ raise NotImplementedError('int') ++ + cb.append("> Output") + cb.append(">> OutputSetattr") + ee('del sys.stdout.softspace') +! number_test('sys.stdout.softspace = %s', unsigned=True) +! number_test('sys.stderr.softspace = %s', unsigned=True) + ee('sys.stdout.attr = None') + cb.append(">> OutputWrite") + ee('sys.stdout.write(None)') +*************** +*** 960,977 **** + ee('sys.stdout.writelines([1])') + iter_test('sys.stdout.writelines(%s)') + cb.append("> VimCommand") +! ee('vim.command(1)') + #! Not checked: vim->python exceptions translating: checked later + cb.append("> VimToPython") + #! Not checked: everything: needs errors in internal python functions + cb.append("> VimEval") +! ee('vim.eval(1)') + #! Not checked: everything: needs errors in internal python functions + cb.append("> VimEvalPy") +! ee('vim.bindeval(1)') + #! Not checked: vim->python exceptions translating: checked later + cb.append("> VimStrwidth") +! ee('vim.strwidth(1)') + cb.append("> Dictionary") + cb.append(">> DictionaryConstructor") + ee('vim.Dictionary("abcI")') +--- 983,1016 ---- + ee('sys.stdout.writelines([1])') + iter_test('sys.stdout.writelines(%s)') + cb.append("> VimCommand") +! stringtochars_test('vim.command(%s)') +! ee('vim.command("", 2)') + #! Not checked: vim->python exceptions translating: checked later + cb.append("> VimToPython") + #! Not checked: everything: needs errors in internal python functions + cb.append("> VimEval") +! stringtochars_test('vim.eval(%s)') +! ee('vim.eval("", FailingTrue())') + #! Not checked: everything: needs errors in internal python functions + cb.append("> VimEvalPy") +! stringtochars_test('vim.bindeval(%s)') +! ee('vim.eval("", 2)') + #! Not checked: vim->python exceptions translating: checked later + cb.append("> VimStrwidth") +! stringtochars_test('vim.strwidth(%s)') +! cb.append("> VimForeachRTP") +! ee('vim.foreach_rtp(None)') +! ee('vim.foreach_rtp(NoArgsCall())') +! ee('vim.foreach_rtp(FailingCall())') +! ee('vim.foreach_rtp(int, 2)') +! cb.append('> import') +! old_rtp = vim.options['rtp'] +! vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\') +! ee('import xxx_no_such_module_xxx') +! ee('import failing_import') +! ee('import failing') +! vim.options['rtp'] = old_rtp +! del old_rtp + cb.append("> Dictionary") + cb.append(">> DictionaryConstructor") + ee('vim.Dictionary("abcI")') +*************** +*** 1050,1057 **** + ee('vim.current.window.buffer = 0') + ee('vim.current.window.cursor = (100000000, 100000000)') + ee('vim.current.window.cursor = True') +! ee('vim.current.window.height = "abcK"') +! ee('vim.current.window.width = "abcL"') + ee('vim.current.window.xxxxxx = True') + cb.append("> WinList") + cb.append(">> WinListItem") +--- 1089,1096 ---- + ee('vim.current.window.buffer = 0') + ee('vim.current.window.cursor = (100000000, 100000000)') + ee('vim.current.window.cursor = True') +! number_test('vim.current.window.height = %s', unsigned=True) +! number_test('vim.current.window.width = %s', unsigned=True) + ee('vim.current.window.xxxxxx = True') + cb.append("> WinList") + cb.append(">> WinListItem") +*************** +*** 1059,1064 **** +--- 1098,1104 ---- + cb.append("> Buffer") + cb.append(">> StringToLine (indirect)") + ee('vim.current.buffer[0] = "\\na"') ++ ee('vim.current.buffer[0] = b"\\na"') + cb.append(">> SetBufferLine (indirect)") + ee('vim.current.buffer[0] = True') + cb.append(">> SetBufferLineList (indirect)") +*************** +*** 1085,1092 **** + ee('vim.current.buffer.range(1, 2, 3)') + cb.append("> BufMap") + cb.append(">> BufMapItem") +- ee('vim.buffers[None]') + ee('vim.buffers[100000000]') + cb.append("> Current") + cb.append(">> CurrentGetattr") + ee('vim.current.xxx') +--- 1125,1132 ---- + ee('vim.current.buffer.range(1, 2, 3)') + cb.append("> BufMap") + cb.append(">> BufMapItem") + ee('vim.buffers[100000000]') ++ number_test('vim.buffers[%s]', natural=True) + cb.append("> Current") + cb.append(">> CurrentGetattr") + ee('vim.current.xxx') +*************** +*** 1110,1121 **** +--- 1150,1165 ---- + del convertfrompyobject_test + del convertfrompymapping_test + del iter_test ++ del number_test + del FailingTrue + del FailingIter + del FailingIterNext + del FailingMapping + del FailingMappingKey + del FailingList ++ del NoArgsCall ++ del FailingCall ++ del FailingNumber + EOF + :delfunction F + :" +*************** +*** 1124,1129 **** +--- 1168,1183 ---- + sys.path.insert(0, os.path.join(os.getcwd(), 'python_before')) + sys.path.append(os.path.join(os.getcwd(), 'python_after')) + vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\') ++ l = [] ++ def callback(path): ++ l.append(os.path.relpath(path)) ++ vim.foreach_rtp(callback) ++ cb.append(repr(l)) ++ del l ++ def callback(path): ++ return os.path.relpath(path) ++ cb.append(repr(vim.foreach_rtp(callback))) ++ del callback + from module import dir as d + from modulex import ddir + cb.append(d + ',' + ddir) +*************** +*** 1131,1140 **** +--- 1185,1203 ---- + cb.append(before.dir) + import after + cb.append(after.dir) ++ import topmodule as tm ++ import topmodule.submodule as tms ++ import topmodule.submodule.subsubmodule.subsubsubmodule as tmsss ++ cb.append(tm.__file__[-len('modulex/topmodule/__init__.py'):]) ++ cb.append(tms.__file__[-len('modulex/topmodule/submodule/__init__.py'):]) ++ cb.append(tmsss.__file__[-len('modulex/topmodule/submodule/subsubmodule/subsubsubmodule.py'):]) + del before + del after + del d + del ddir ++ del tm ++ del tms ++ del tmsss + EOF + :" + :" Test exceptions +*************** +*** 1188,1193 **** +--- 1251,1257 ---- + :call garbagecollect(1) + :" + :/^start:/,$wq! test.out ++ :" vim: et ts=4 isk-=\: + :call getchar() + ENDTEST + +*** ../vim-7.3.1235/src/testdir/test87.ok 2013-06-23 14:37:00.000000000 +0200 +--- src/testdir/test87.ok 2013-06-23 16:26:40.000000000 +0200 +*************** +*** 430,436 **** +--- 430,445 ---- + > Output + >> OutputSetattr + del sys.stdout.softspace:(, AttributeError("can't delete OutputObject attributes",)) ++ >>> Testing NumberToLong using sys.stdout.softspace = %s + sys.stdout.softspace = []:(, TypeError('expected int() or something supporting coercing to int(), but got list',)) ++ sys.stdout.softspace = None:(, TypeError('expected int() or something supporting coercing to int(), but got NoneType',)) ++ sys.stdout.softspace = -1:(, ValueError('number must be greater or equal to zero',)) ++ <<< Finished ++ >>> Testing NumberToLong using sys.stderr.softspace = %s ++ sys.stderr.softspace = []:(, TypeError('expected int() or something supporting coercing to int(), but got list',)) ++ sys.stderr.softspace = None:(, TypeError('expected int() or something supporting coercing to int(), but got NoneType',)) ++ sys.stderr.softspace = -1:(, ValueError('number must be greater or equal to zero',)) ++ <<< Finished + sys.stdout.attr = None:(, AttributeError('invalid attribute: attr',)) + >> OutputWrite + sys.stdout.write(None):(, TypeError("Can't convert 'NoneType' object to str implicitly",)) +*************** +*** 438,461 **** + sys.stdout.writelines(None):(, TypeError("'NoneType' object is not iterable",)) + sys.stdout.writelines([1]):(, TypeError("Can't convert 'int' object to str implicitly",)) + >>> Testing *Iter* using sys.stdout.writelines(%s) +! sys.stdout.writelines(FailingIter()):(, NotImplementedError()) +! sys.stdout.writelines(FailingIterNext()):(, NotImplementedError()) + <<< Finished + > VimCommand + vim.command(1):(, TypeError('expected bytes() or str() instance, but got int',)) + > VimToPython + > VimEval + vim.eval(1):(, TypeError('expected bytes() or str() instance, but got int',)) + > VimEvalPy + vim.bindeval(1):(, TypeError('expected bytes() or str() instance, but got int',)) + > VimStrwidth + vim.strwidth(1):(, TypeError('expected bytes() or str() instance, but got int',)) + > Dictionary + >> DictionaryConstructor + vim.Dictionary("abcI"):(, ValueError('expected sequence element of size 2, but got sequence of size 1',)) + >> DictionarySetattr + del d.locked:(, AttributeError('cannot delete vim.Dictionary attributes',)) +! d.locked = FailingTrue():(, NotImplementedError()) + vim.vvars.locked = False:(, TypeError('cannot modify fixed dictionary',)) + d.scope = True:(, AttributeError('cannot set attribute scope',)) + d.xxx = True:(, AttributeError('cannot set attribute xxx',)) +--- 447,498 ---- + sys.stdout.writelines(None):(, TypeError("'NoneType' object is not iterable",)) + sys.stdout.writelines([1]):(, TypeError("Can't convert 'int' object to str implicitly",)) + >>> Testing *Iter* using sys.stdout.writelines(%s) +! sys.stdout.writelines(FailingIter()):(, NotImplementedError('iter',)) +! sys.stdout.writelines(FailingIterNext()):(, NotImplementedError('next',)) + <<< Finished + > VimCommand ++ >>> Testing StringToChars using vim.command(%s) + vim.command(1):(, TypeError('expected bytes() or str() instance, but got int',)) ++ vim.command(b"\0"):(, TypeError('expected bytes with no null',)) ++ vim.command("\0"):(, TypeError('expected bytes with no null',)) ++ <<< Finished ++ vim.command("", 2):(, TypeError('command() takes exactly one argument (2 given)',)) + > VimToPython + > VimEval ++ >>> Testing StringToChars using vim.eval(%s) + vim.eval(1):(, TypeError('expected bytes() or str() instance, but got int',)) ++ vim.eval(b"\0"):(, TypeError('expected bytes with no null',)) ++ vim.eval("\0"):(, TypeError('expected bytes with no null',)) ++ <<< Finished ++ vim.eval("", FailingTrue()):(, TypeError('function takes exactly 1 argument (2 given)',)) + > VimEvalPy ++ >>> Testing StringToChars using vim.bindeval(%s) + vim.bindeval(1):(, TypeError('expected bytes() or str() instance, but got int',)) ++ vim.bindeval(b"\0"):(, TypeError('expected bytes with no null',)) ++ vim.bindeval("\0"):(, TypeError('expected bytes with no null',)) ++ <<< Finished ++ vim.eval("", 2):(, TypeError('function takes exactly 1 argument (2 given)',)) + > VimStrwidth ++ >>> Testing StringToChars using vim.strwidth(%s) + vim.strwidth(1):(, TypeError('expected bytes() or str() instance, but got int',)) ++ vim.strwidth(b"\0"):(, TypeError('expected bytes with no null',)) ++ vim.strwidth("\0"):(, TypeError('expected bytes with no null',)) ++ <<< Finished ++ > VimForeachRTP ++ vim.foreach_rtp(None):(, TypeError("'NoneType' object is not callable",)) ++ vim.foreach_rtp(NoArgsCall()):(, TypeError('__call__() takes exactly 1 positional argument (2 given)',)) ++ vim.foreach_rtp(FailingCall()):(, NotImplementedError('call',)) ++ vim.foreach_rtp(int, 2):(, TypeError('foreach_rtp() takes exactly one argument (2 given)',)) ++ > import ++ import xxx_no_such_module_xxx:(, ImportError('No module named xxx_no_such_module_xxx',)) ++ import failing_import:(, ImportError('No module named failing_import',)) ++ import failing:(, ImportError('No module named failing',)) + > Dictionary + >> DictionaryConstructor + vim.Dictionary("abcI"):(, ValueError('expected sequence element of size 2, but got sequence of size 1',)) + >> DictionarySetattr + del d.locked:(, AttributeError('cannot delete vim.Dictionary attributes',)) +! d.locked = FailingTrue():(, NotImplementedError('bool',)) + vim.vvars.locked = False:(, TypeError('cannot modify fixed dictionary',)) + d.scope = True:(, AttributeError('cannot set attribute scope',)) + d.xxx = True:(, AttributeError('cannot set attribute xxx',)) +*************** +*** 494,507 **** + <<< Finished + >>> Testing *Iter* using d["a"] = {"abcF" : %s} + d["a"] = {"abcF" : FailingIter()}:(, TypeError('unable to convert FailingIter to vim structure',)) +! d["a"] = {"abcF" : FailingIterNext()}:(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = {"abcF" : %s} + d["a"] = {"abcF" : None}:(, TypeError('unable to convert NoneType to vim structure',)) + d["a"] = {"abcF" : {b"": 1}}:(, ValueError('empty keys are not allowed',)) + d["a"] = {"abcF" : {"": 1}}:(, ValueError('empty keys are not allowed',)) +! d["a"] = {"abcF" : FailingMapping()}:(, NotImplementedError()) +! d["a"] = {"abcF" : FailingMappingKey()}:(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({%s : 1}) + d["a"] = Mapping({1 : 1}):(, TypeError('expected bytes() or str() instance, but got int',)) +--- 531,545 ---- + <<< Finished + >>> Testing *Iter* using d["a"] = {"abcF" : %s} + d["a"] = {"abcF" : FailingIter()}:(, TypeError('unable to convert FailingIter to vim structure',)) +! d["a"] = {"abcF" : FailingIterNext()}:(, NotImplementedError('next',)) + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = {"abcF" : %s} + d["a"] = {"abcF" : None}:(, TypeError('unable to convert NoneType to vim structure',)) + d["a"] = {"abcF" : {b"": 1}}:(, ValueError('empty keys are not allowed',)) + d["a"] = {"abcF" : {"": 1}}:(, ValueError('empty keys are not allowed',)) +! d["a"] = {"abcF" : FailingMapping()}:(, NotImplementedError('keys',)) +! d["a"] = {"abcF" : FailingMappingKey()}:(, NotImplementedError('getitem:mappingkey',)) +! d["a"] = {"abcF" : FailingNumber()}:(, NotImplementedError('int',)) + <<< Finished + >>> Testing StringToChars using d["a"] = Mapping({%s : 1}) + d["a"] = Mapping({1 : 1}):(, TypeError('expected bytes() or str() instance, but got int',)) +*************** +*** 520,553 **** + <<< Finished + >>> Testing *Iter* using d["a"] = Mapping({"abcG" : %s}) + d["a"] = Mapping({"abcG" : FailingIter()}):(, TypeError('unable to convert FailingIter to vim structure',)) +! d["a"] = Mapping({"abcG" : FailingIterNext()}):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abcG" : %s}) + d["a"] = Mapping({"abcG" : None}):(, TypeError('unable to convert NoneType to vim structure',)) + d["a"] = Mapping({"abcG" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) + d["a"] = Mapping({"abcG" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! d["a"] = Mapping({"abcG" : FailingMapping()}):(, NotImplementedError()) +! d["a"] = Mapping({"abcG" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using d["a"] = %s + d["a"] = FailingIter():(, TypeError('unable to convert FailingIter to vim structure',)) +! d["a"] = FailingIterNext():(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = %s + d["a"] = None:(, TypeError('unable to convert NoneType to vim structure',)) + d["a"] = {b"": 1}:(, ValueError('empty keys are not allowed',)) + d["a"] = {"": 1}:(, ValueError('empty keys are not allowed',)) +! d["a"] = FailingMapping():(, NotImplementedError()) +! d["a"] = FailingMappingKey():(, NotImplementedError()) + <<< Finished + >> DictionaryUpdate + >>> kwargs + >>> iter +! d.update(FailingMapping()):(, NotImplementedError()) +! d.update([FailingIterNext()]):(, NotImplementedError()) + >>> Testing *Iter* using d.update(%s) +! d.update(FailingIter()):(, NotImplementedError()) +! d.update(FailingIterNext()):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d.update({%s : 1}) + d.update({1 : 1}):(, TypeError('expected bytes() or str() instance, but got int',)) +--- 558,593 ---- + <<< Finished + >>> Testing *Iter* using d["a"] = Mapping({"abcG" : %s}) + d["a"] = Mapping({"abcG" : FailingIter()}):(, TypeError('unable to convert FailingIter to vim structure',)) +! d["a"] = Mapping({"abcG" : FailingIterNext()}):(, NotImplementedError('next',)) + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = Mapping({"abcG" : %s}) + d["a"] = Mapping({"abcG" : None}):(, TypeError('unable to convert NoneType to vim structure',)) + d["a"] = Mapping({"abcG" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) + d["a"] = Mapping({"abcG" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! d["a"] = Mapping({"abcG" : FailingMapping()}):(, NotImplementedError('keys',)) +! d["a"] = Mapping({"abcG" : FailingMappingKey()}):(, NotImplementedError('getitem:mappingkey',)) +! d["a"] = Mapping({"abcG" : FailingNumber()}):(, NotImplementedError('int',)) + <<< Finished + >>> Testing *Iter* using d["a"] = %s + d["a"] = FailingIter():(, TypeError('unable to convert FailingIter to vim structure',)) +! d["a"] = FailingIterNext():(, NotImplementedError('next',)) + <<< Finished + >>> Testing ConvertFromPyObject using d["a"] = %s + d["a"] = None:(, TypeError('unable to convert NoneType to vim structure',)) + d["a"] = {b"": 1}:(, ValueError('empty keys are not allowed',)) + d["a"] = {"": 1}:(, ValueError('empty keys are not allowed',)) +! d["a"] = FailingMapping():(, NotImplementedError('keys',)) +! d["a"] = FailingMappingKey():(, NotImplementedError('getitem:mappingkey',)) +! d["a"] = FailingNumber():(, NotImplementedError('int',)) + <<< Finished + >> DictionaryUpdate + >>> kwargs + >>> iter +! d.update(FailingMapping()):(, NotImplementedError('keys',)) +! d.update([FailingIterNext()]):(, NotImplementedError('next',)) + >>> Testing *Iter* using d.update(%s) +! d.update(FailingIter()):(, NotImplementedError('iter',)) +! d.update(FailingIterNext()):(, NotImplementedError('next',)) + <<< Finished + >>> Testing StringToChars using d.update({%s : 1}) + d.update({1 : 1}):(, TypeError('expected bytes() or str() instance, but got int',)) +*************** +*** 566,579 **** + <<< Finished + >>> Testing *Iter* using d.update({"abcF" : %s}) + d.update({"abcF" : FailingIter()}):(, TypeError('unable to convert FailingIter to vim structure',)) +! d.update({"abcF" : FailingIterNext()}):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d.update({"abcF" : %s}) + d.update({"abcF" : None}):(, TypeError('unable to convert NoneType to vim structure',)) + d.update({"abcF" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) + d.update({"abcF" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! d.update({"abcF" : FailingMapping()}):(, NotImplementedError()) +! d.update({"abcF" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d.update(Mapping({%s : 1})) + d.update(Mapping({1 : 1})):(, TypeError('expected bytes() or str() instance, but got int',)) +--- 606,620 ---- + <<< Finished + >>> Testing *Iter* using d.update({"abcF" : %s}) + d.update({"abcF" : FailingIter()}):(, TypeError('unable to convert FailingIter to vim structure',)) +! d.update({"abcF" : FailingIterNext()}):(, NotImplementedError('next',)) + <<< Finished + >>> Testing ConvertFromPyObject using d.update({"abcF" : %s}) + d.update({"abcF" : None}):(, TypeError('unable to convert NoneType to vim structure',)) + d.update({"abcF" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) + d.update({"abcF" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! d.update({"abcF" : FailingMapping()}):(, NotImplementedError('keys',)) +! d.update({"abcF" : FailingMappingKey()}):(, NotImplementedError('getitem:mappingkey',)) +! d.update({"abcF" : FailingNumber()}):(, NotImplementedError('int',)) + <<< Finished + >>> Testing StringToChars using d.update(Mapping({%s : 1})) + d.update(Mapping({1 : 1})):(, TypeError('expected bytes() or str() instance, but got int',)) +*************** +*** 592,616 **** + <<< Finished + >>> Testing *Iter* using d.update(Mapping({"abcG" : %s})) + d.update(Mapping({"abcG" : FailingIter()})):(, TypeError('unable to convert FailingIter to vim structure',)) +! d.update(Mapping({"abcG" : FailingIterNext()})):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d.update(Mapping({"abcG" : %s})) + d.update(Mapping({"abcG" : None})):(, TypeError('unable to convert NoneType to vim structure',)) + d.update(Mapping({"abcG" : {b"": 1}})):(, ValueError('empty keys are not allowed',)) + d.update(Mapping({"abcG" : {"": 1}})):(, ValueError('empty keys are not allowed',)) +! d.update(Mapping({"abcG" : FailingMapping()})):(, NotImplementedError()) +! d.update(Mapping({"abcG" : FailingMappingKey()})):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using d.update(%s) +! d.update(FailingIter()):(, NotImplementedError()) +! d.update(FailingIterNext()):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d.update(%s) + d.update(None):(, TypeError("'NoneType' object is not iterable",)) + d.update({b"": 1}):(, ValueError('empty keys are not allowed',)) + d.update({"": 1}):(, ValueError('empty keys are not allowed',)) +! d.update(FailingMapping()):(, NotImplementedError()) +! d.update(FailingMappingKey()):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d.update(((%s, 0),)) + d.update(((1, 0),)):(, TypeError('expected bytes() or str() instance, but got int',)) +--- 633,659 ---- + <<< Finished + >>> Testing *Iter* using d.update(Mapping({"abcG" : %s})) + d.update(Mapping({"abcG" : FailingIter()})):(, TypeError('unable to convert FailingIter to vim structure',)) +! d.update(Mapping({"abcG" : FailingIterNext()})):(, NotImplementedError('next',)) + <<< Finished + >>> Testing ConvertFromPyObject using d.update(Mapping({"abcG" : %s})) + d.update(Mapping({"abcG" : None})):(, TypeError('unable to convert NoneType to vim structure',)) + d.update(Mapping({"abcG" : {b"": 1}})):(, ValueError('empty keys are not allowed',)) + d.update(Mapping({"abcG" : {"": 1}})):(, ValueError('empty keys are not allowed',)) +! d.update(Mapping({"abcG" : FailingMapping()})):(, NotImplementedError('keys',)) +! d.update(Mapping({"abcG" : FailingMappingKey()})):(, NotImplementedError('getitem:mappingkey',)) +! d.update(Mapping({"abcG" : FailingNumber()})):(, NotImplementedError('int',)) + <<< Finished + >>> Testing *Iter* using d.update(%s) +! d.update(FailingIter()):(, NotImplementedError('iter',)) +! d.update(FailingIterNext()):(, NotImplementedError('next',)) + <<< Finished + >>> Testing ConvertFromPyObject using d.update(%s) + d.update(None):(, TypeError("'NoneType' object is not iterable",)) + d.update({b"": 1}):(, ValueError('empty keys are not allowed',)) + d.update({"": 1}):(, ValueError('empty keys are not allowed',)) +! d.update(FailingMapping()):(, NotImplementedError('keys',)) +! d.update(FailingMappingKey()):(, NotImplementedError('getitem:mappingkey',)) +! d.update(FailingNumber()):(, TypeError("'FailingNumber' object is not iterable",)) + <<< Finished + >>> Testing StringToChars using d.update(((%s, 0),)) + d.update(((1, 0),)):(, TypeError('expected bytes() or str() instance, but got int',)) +*************** +*** 634,647 **** + <<< Finished + >>> Testing *Iter* using d.update((("a", {"abcF" : %s}),)) + d.update((("a", {"abcF" : FailingIter()}),)):(, TypeError('unable to convert FailingIter to vim structure',)) +! d.update((("a", {"abcF" : FailingIterNext()}),)):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", {"abcF" : %s}),)) + d.update((("a", {"abcF" : None}),)):(, TypeError('unable to convert NoneType to vim structure',)) + d.update((("a", {"abcF" : {b"": 1}}),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", {"abcF" : {"": 1}}),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", {"abcF" : FailingMapping()}),)):(, NotImplementedError()) +! d.update((("a", {"abcF" : FailingMappingKey()}),)):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),)) + d.update((("a", Mapping({1 : 1})),)):(, TypeError('expected bytes() or str() instance, but got int',)) +--- 677,691 ---- + <<< Finished + >>> Testing *Iter* using d.update((("a", {"abcF" : %s}),)) + d.update((("a", {"abcF" : FailingIter()}),)):(, TypeError('unable to convert FailingIter to vim structure',)) +! d.update((("a", {"abcF" : FailingIterNext()}),)):(, NotImplementedError('next',)) + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", {"abcF" : %s}),)) + d.update((("a", {"abcF" : None}),)):(, TypeError('unable to convert NoneType to vim structure',)) + d.update((("a", {"abcF" : {b"": 1}}),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", {"abcF" : {"": 1}}),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", {"abcF" : FailingMapping()}),)):(, NotImplementedError('keys',)) +! d.update((("a", {"abcF" : FailingMappingKey()}),)):(, NotImplementedError('getitem:mappingkey',)) +! d.update((("a", {"abcF" : FailingNumber()}),)):(, NotImplementedError('int',)) + <<< Finished + >>> Testing StringToChars using d.update((("a", Mapping({%s : 1})),)) + d.update((("a", Mapping({1 : 1})),)):(, TypeError('expected bytes() or str() instance, but got int',)) +*************** +*** 660,684 **** + <<< Finished + >>> Testing *Iter* using d.update((("a", Mapping({"abcG" : %s})),)) + d.update((("a", Mapping({"abcG" : FailingIter()})),)):(, TypeError('unable to convert FailingIter to vim structure',)) +! d.update((("a", Mapping({"abcG" : FailingIterNext()})),)):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abcG" : %s})),)) + d.update((("a", Mapping({"abcG" : None})),)):(, TypeError('unable to convert NoneType to vim structure',)) + d.update((("a", Mapping({"abcG" : {b"": 1}})),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", Mapping({"abcG" : {"": 1}})),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", Mapping({"abcG" : FailingMapping()})),)):(, NotImplementedError()) +! d.update((("a", Mapping({"abcG" : FailingMappingKey()})),)):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using d.update((("a", %s),)) + d.update((("a", FailingIter()),)):(, TypeError('unable to convert FailingIter to vim structure',)) +! d.update((("a", FailingIterNext()),)):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", %s),)) + d.update((("a", None),)):(, TypeError('unable to convert NoneType to vim structure',)) + d.update((("a", {b"": 1}),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", {"": 1}),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", FailingMapping()),)):(, NotImplementedError()) +! d.update((("a", FailingMappingKey()),)):(, NotImplementedError()) + <<< Finished + >> DictionaryPopItem + d.popitem(1, 2):(, TypeError('popitem() takes no arguments (2 given)',)) +--- 704,730 ---- + <<< Finished + >>> Testing *Iter* using d.update((("a", Mapping({"abcG" : %s})),)) + d.update((("a", Mapping({"abcG" : FailingIter()})),)):(, TypeError('unable to convert FailingIter to vim structure',)) +! d.update((("a", Mapping({"abcG" : FailingIterNext()})),)):(, NotImplementedError('next',)) + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", Mapping({"abcG" : %s})),)) + d.update((("a", Mapping({"abcG" : None})),)):(, TypeError('unable to convert NoneType to vim structure',)) + d.update((("a", Mapping({"abcG" : {b"": 1}})),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", Mapping({"abcG" : {"": 1}})),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", Mapping({"abcG" : FailingMapping()})),)):(, NotImplementedError('keys',)) +! d.update((("a", Mapping({"abcG" : FailingMappingKey()})),)):(, NotImplementedError('getitem:mappingkey',)) +! d.update((("a", Mapping({"abcG" : FailingNumber()})),)):(, NotImplementedError('int',)) + <<< Finished + >>> Testing *Iter* using d.update((("a", %s),)) + d.update((("a", FailingIter()),)):(, TypeError('unable to convert FailingIter to vim structure',)) +! d.update((("a", FailingIterNext()),)):(, NotImplementedError('next',)) + <<< Finished + >>> Testing ConvertFromPyObject using d.update((("a", %s),)) + d.update((("a", None),)):(, TypeError('unable to convert NoneType to vim structure',)) + d.update((("a", {b"": 1}),)):(, ValueError('empty keys are not allowed',)) + d.update((("a", {"": 1}),)):(, ValueError('empty keys are not allowed',)) +! d.update((("a", FailingMapping()),)):(, NotImplementedError('keys',)) +! d.update((("a", FailingMappingKey()),)):(, NotImplementedError('getitem:mappingkey',)) +! d.update((("a", FailingNumber()),)):(, NotImplementedError('int',)) + <<< Finished + >> DictionaryPopItem + d.popitem(1, 2):(, TypeError('popitem() takes no arguments (2 given)',)) +*************** +*** 689,696 **** + vim.List(1, 2):(, TypeError('function takes at most 1 argument (2 given)',)) + vim.List(a=1):(, TypeError('list constructor does not accept keyword arguments',)) + >>> Testing *Iter* using vim.List(%s) +! vim.List(FailingIter()):(, NotImplementedError()) +! vim.List(FailingIterNext()):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using vim.List([{%s : 1}]) + vim.List([{1 : 1}]):(, TypeError('expected bytes() or str() instance, but got int',)) +--- 735,742 ---- + vim.List(1, 2):(, TypeError('function takes at most 1 argument (2 given)',)) + vim.List(a=1):(, TypeError('list constructor does not accept keyword arguments',)) + >>> Testing *Iter* using vim.List(%s) +! vim.List(FailingIter()):(, NotImplementedError('iter',)) +! vim.List(FailingIterNext()):(, NotImplementedError('next',)) + <<< Finished + >>> Testing StringToChars using vim.List([{%s : 1}]) + vim.List([{1 : 1}]):(, TypeError('expected bytes() or str() instance, but got int',)) +*************** +*** 709,722 **** + <<< Finished + >>> Testing *Iter* using vim.List([{"abcF" : %s}]) + vim.List([{"abcF" : FailingIter()}]):(, TypeError('unable to convert FailingIter to vim structure',)) +! vim.List([{"abcF" : FailingIterNext()}]):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([{"abcF" : %s}]) + vim.List([{"abcF" : None}]):(, TypeError('unable to convert NoneType to vim structure',)) + vim.List([{"abcF" : {b"": 1}}]):(, ValueError('empty keys are not allowed',)) + vim.List([{"abcF" : {"": 1}}]):(, ValueError('empty keys are not allowed',)) +! vim.List([{"abcF" : FailingMapping()}]):(, NotImplementedError()) +! vim.List([{"abcF" : FailingMappingKey()}]):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({%s : 1})]) + vim.List([Mapping({1 : 1})]):(, TypeError('expected bytes() or str() instance, but got int',)) +--- 755,769 ---- + <<< Finished + >>> Testing *Iter* using vim.List([{"abcF" : %s}]) + vim.List([{"abcF" : FailingIter()}]):(, TypeError('unable to convert FailingIter to vim structure',)) +! vim.List([{"abcF" : FailingIterNext()}]):(, NotImplementedError('next',)) + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([{"abcF" : %s}]) + vim.List([{"abcF" : None}]):(, TypeError('unable to convert NoneType to vim structure',)) + vim.List([{"abcF" : {b"": 1}}]):(, ValueError('empty keys are not allowed',)) + vim.List([{"abcF" : {"": 1}}]):(, ValueError('empty keys are not allowed',)) +! vim.List([{"abcF" : FailingMapping()}]):(, NotImplementedError('keys',)) +! vim.List([{"abcF" : FailingMappingKey()}]):(, NotImplementedError('getitem:mappingkey',)) +! vim.List([{"abcF" : FailingNumber()}]):(, NotImplementedError('int',)) + <<< Finished + >>> Testing StringToChars using vim.List([Mapping({%s : 1})]) + vim.List([Mapping({1 : 1})]):(, TypeError('expected bytes() or str() instance, but got int',)) +*************** +*** 735,759 **** + <<< Finished + >>> Testing *Iter* using vim.List([Mapping({"abcG" : %s})]) + vim.List([Mapping({"abcG" : FailingIter()})]):(, TypeError('unable to convert FailingIter to vim structure',)) +! vim.List([Mapping({"abcG" : FailingIterNext()})]):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([Mapping({"abcG" : %s})]) + vim.List([Mapping({"abcG" : None})]):(, TypeError('unable to convert NoneType to vim structure',)) + vim.List([Mapping({"abcG" : {b"": 1}})]):(, ValueError('empty keys are not allowed',)) + vim.List([Mapping({"abcG" : {"": 1}})]):(, ValueError('empty keys are not allowed',)) +! vim.List([Mapping({"abcG" : FailingMapping()})]):(, NotImplementedError()) +! vim.List([Mapping({"abcG" : FailingMappingKey()})]):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using vim.List([%s]) + vim.List([FailingIter()]):(, TypeError('unable to convert FailingIter to vim structure',)) +! vim.List([FailingIterNext()]):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([%s]) + vim.List([None]):(, TypeError('unable to convert NoneType to vim structure',)) + vim.List([{b"": 1}]):(, ValueError('empty keys are not allowed',)) + vim.List([{"": 1}]):(, ValueError('empty keys are not allowed',)) +! vim.List([FailingMapping()]):(, NotImplementedError()) +! vim.List([FailingMappingKey()]):(, NotImplementedError()) + <<< Finished + >> ListItem + l[1000]:(, IndexError('list index out of range',)) +--- 782,808 ---- + <<< Finished + >>> Testing *Iter* using vim.List([Mapping({"abcG" : %s})]) + vim.List([Mapping({"abcG" : FailingIter()})]):(, TypeError('unable to convert FailingIter to vim structure',)) +! vim.List([Mapping({"abcG" : FailingIterNext()})]):(, NotImplementedError('next',)) + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([Mapping({"abcG" : %s})]) + vim.List([Mapping({"abcG" : None})]):(, TypeError('unable to convert NoneType to vim structure',)) + vim.List([Mapping({"abcG" : {b"": 1}})]):(, ValueError('empty keys are not allowed',)) + vim.List([Mapping({"abcG" : {"": 1}})]):(, ValueError('empty keys are not allowed',)) +! vim.List([Mapping({"abcG" : FailingMapping()})]):(, NotImplementedError('keys',)) +! vim.List([Mapping({"abcG" : FailingMappingKey()})]):(, NotImplementedError('getitem:mappingkey',)) +! vim.List([Mapping({"abcG" : FailingNumber()})]):(, NotImplementedError('int',)) + <<< Finished + >>> Testing *Iter* using vim.List([%s]) + vim.List([FailingIter()]):(, TypeError('unable to convert FailingIter to vim structure',)) +! vim.List([FailingIterNext()]):(, NotImplementedError('next',)) + <<< Finished + >>> Testing ConvertFromPyObject using vim.List([%s]) + vim.List([None]):(, TypeError('unable to convert NoneType to vim structure',)) + vim.List([{b"": 1}]):(, ValueError('empty keys are not allowed',)) + vim.List([{"": 1}]):(, ValueError('empty keys are not allowed',)) +! vim.List([FailingMapping()]):(, NotImplementedError('keys',)) +! vim.List([FailingMappingKey()]):(, NotImplementedError('getitem:mappingkey',)) +! vim.List([FailingNumber()]):(, NotImplementedError('int',)) + <<< Finished + >> ListItem + l[1000]:(, IndexError('list index out of range',)) +*************** +*** 763,770 **** + >> ListAssSlice + ll[1:100] = "abcJ":(, error('list is locked',)) + >>> Testing *Iter* using l[:] = %s +! l[:] = FailingIter():(, NotImplementedError()) +! l[:] = FailingIterNext()::(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using l[:] = [{%s : 1}] + l[:] = [{1 : 1}]:(, TypeError('expected bytes() or str() instance, but got int',)) +--- 812,819 ---- + >> ListAssSlice + ll[1:100] = "abcJ":(, error('list is locked',)) + >>> Testing *Iter* using l[:] = %s +! l[:] = FailingIter():(, NotImplementedError('iter',)) +! l[:] = FailingIterNext():(, NotImplementedError('next',)) + <<< Finished + >>> Testing StringToChars using l[:] = [{%s : 1}] + l[:] = [{1 : 1}]:(, TypeError('expected bytes() or str() instance, but got int',)) +*************** +*** 783,796 **** + <<< Finished + >>> Testing *Iter* using l[:] = [{"abcF" : %s}] + l[:] = [{"abcF" : FailingIter()}]:(, TypeError('unable to convert FailingIter to vim structure',)) +! l[:] = [{"abcF" : FailingIterNext()}]:(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [{"abcF" : %s}] + l[:] = [{"abcF" : None}]:(, TypeError('unable to convert NoneType to vim structure',)) + l[:] = [{"abcF" : {b"": 1}}]:(, ValueError('empty keys are not allowed',)) + l[:] = [{"abcF" : {"": 1}}]:(, ValueError('empty keys are not allowed',)) +! l[:] = [{"abcF" : FailingMapping()}]:(, NotImplementedError()) +! l[:] = [{"abcF" : FailingMappingKey()}]:(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({%s : 1})] + l[:] = [Mapping({1 : 1})]:(, TypeError('expected bytes() or str() instance, but got int',)) +--- 832,846 ---- + <<< Finished + >>> Testing *Iter* using l[:] = [{"abcF" : %s}] + l[:] = [{"abcF" : FailingIter()}]:(, TypeError('unable to convert FailingIter to vim structure',)) +! l[:] = [{"abcF" : FailingIterNext()}]:(, NotImplementedError('next',)) + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [{"abcF" : %s}] + l[:] = [{"abcF" : None}]:(, TypeError('unable to convert NoneType to vim structure',)) + l[:] = [{"abcF" : {b"": 1}}]:(, ValueError('empty keys are not allowed',)) + l[:] = [{"abcF" : {"": 1}}]:(, ValueError('empty keys are not allowed',)) +! l[:] = [{"abcF" : FailingMapping()}]:(, NotImplementedError('keys',)) +! l[:] = [{"abcF" : FailingMappingKey()}]:(, NotImplementedError('getitem:mappingkey',)) +! l[:] = [{"abcF" : FailingNumber()}]:(, NotImplementedError('int',)) + <<< Finished + >>> Testing StringToChars using l[:] = [Mapping({%s : 1})] + l[:] = [Mapping({1 : 1})]:(, TypeError('expected bytes() or str() instance, but got int',)) +*************** +*** 809,838 **** + <<< Finished + >>> Testing *Iter* using l[:] = [Mapping({"abcG" : %s})] + l[:] = [Mapping({"abcG" : FailingIter()})]:(, TypeError('unable to convert FailingIter to vim structure',)) +! l[:] = [Mapping({"abcG" : FailingIterNext()})]:(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abcG" : %s})] + l[:] = [Mapping({"abcG" : None})]:(, TypeError('unable to convert NoneType to vim structure',)) + l[:] = [Mapping({"abcG" : {b"": 1}})]:(, ValueError('empty keys are not allowed',)) + l[:] = [Mapping({"abcG" : {"": 1}})]:(, ValueError('empty keys are not allowed',)) +! l[:] = [Mapping({"abcG" : FailingMapping()})]:(, NotImplementedError()) +! l[:] = [Mapping({"abcG" : FailingMappingKey()})]:(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using l[:] = [%s] + l[:] = [FailingIter()]:(, TypeError('unable to convert FailingIter to vim structure',)) +! l[:] = [FailingIterNext()]:(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [%s] + l[:] = [None]:(, TypeError('unable to convert NoneType to vim structure',)) + l[:] = [{b"": 1}]:(, ValueError('empty keys are not allowed',)) + l[:] = [{"": 1}]:(, ValueError('empty keys are not allowed',)) +! l[:] = [FailingMapping()]:(, NotImplementedError()) +! l[:] = [FailingMappingKey()]:(, NotImplementedError()) + <<< Finished + >> ListConcatInPlace + >>> Testing *Iter* using l.extend(%s) +! l.extend(FailingIter()):(, NotImplementedError()) +! l.extend(FailingIterNext()):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using l.extend([{%s : 1}]) + l.extend([{1 : 1}]):(, TypeError('expected bytes() or str() instance, but got int',)) +--- 859,890 ---- + <<< Finished + >>> Testing *Iter* using l[:] = [Mapping({"abcG" : %s})] + l[:] = [Mapping({"abcG" : FailingIter()})]:(, TypeError('unable to convert FailingIter to vim structure',)) +! l[:] = [Mapping({"abcG" : FailingIterNext()})]:(, NotImplementedError('next',)) + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [Mapping({"abcG" : %s})] + l[:] = [Mapping({"abcG" : None})]:(, TypeError('unable to convert NoneType to vim structure',)) + l[:] = [Mapping({"abcG" : {b"": 1}})]:(, ValueError('empty keys are not allowed',)) + l[:] = [Mapping({"abcG" : {"": 1}})]:(, ValueError('empty keys are not allowed',)) +! l[:] = [Mapping({"abcG" : FailingMapping()})]:(, NotImplementedError('keys',)) +! l[:] = [Mapping({"abcG" : FailingMappingKey()})]:(, NotImplementedError('getitem:mappingkey',)) +! l[:] = [Mapping({"abcG" : FailingNumber()})]:(, NotImplementedError('int',)) + <<< Finished + >>> Testing *Iter* using l[:] = [%s] + l[:] = [FailingIter()]:(, TypeError('unable to convert FailingIter to vim structure',)) +! l[:] = [FailingIterNext()]:(, NotImplementedError('next',)) + <<< Finished + >>> Testing ConvertFromPyObject using l[:] = [%s] + l[:] = [None]:(, TypeError('unable to convert NoneType to vim structure',)) + l[:] = [{b"": 1}]:(, ValueError('empty keys are not allowed',)) + l[:] = [{"": 1}]:(, ValueError('empty keys are not allowed',)) +! l[:] = [FailingMapping()]:(, NotImplementedError('keys',)) +! l[:] = [FailingMappingKey()]:(, NotImplementedError('getitem:mappingkey',)) +! l[:] = [FailingNumber()]:(, NotImplementedError('int',)) + <<< Finished + >> ListConcatInPlace + >>> Testing *Iter* using l.extend(%s) +! l.extend(FailingIter()):(, NotImplementedError('iter',)) +! l.extend(FailingIterNext()):(, NotImplementedError('next',)) + <<< Finished + >>> Testing StringToChars using l.extend([{%s : 1}]) + l.extend([{1 : 1}]):(, TypeError('expected bytes() or str() instance, but got int',)) +*************** +*** 851,864 **** + <<< Finished + >>> Testing *Iter* using l.extend([{"abcF" : %s}]) + l.extend([{"abcF" : FailingIter()}]):(, TypeError('unable to convert FailingIter to vim structure',)) +! l.extend([{"abcF" : FailingIterNext()}]):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([{"abcF" : %s}]) + l.extend([{"abcF" : None}]):(, TypeError('unable to convert NoneType to vim structure',)) + l.extend([{"abcF" : {b"": 1}}]):(, ValueError('empty keys are not allowed',)) + l.extend([{"abcF" : {"": 1}}]):(, ValueError('empty keys are not allowed',)) +! l.extend([{"abcF" : FailingMapping()}]):(, NotImplementedError()) +! l.extend([{"abcF" : FailingMappingKey()}]):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({%s : 1})]) + l.extend([Mapping({1 : 1})]):(, TypeError('expected bytes() or str() instance, but got int',)) +--- 903,917 ---- + <<< Finished + >>> Testing *Iter* using l.extend([{"abcF" : %s}]) + l.extend([{"abcF" : FailingIter()}]):(, TypeError('unable to convert FailingIter to vim structure',)) +! l.extend([{"abcF" : FailingIterNext()}]):(, NotImplementedError('next',)) + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([{"abcF" : %s}]) + l.extend([{"abcF" : None}]):(, TypeError('unable to convert NoneType to vim structure',)) + l.extend([{"abcF" : {b"": 1}}]):(, ValueError('empty keys are not allowed',)) + l.extend([{"abcF" : {"": 1}}]):(, ValueError('empty keys are not allowed',)) +! l.extend([{"abcF" : FailingMapping()}]):(, NotImplementedError('keys',)) +! l.extend([{"abcF" : FailingMappingKey()}]):(, NotImplementedError('getitem:mappingkey',)) +! l.extend([{"abcF" : FailingNumber()}]):(, NotImplementedError('int',)) + <<< Finished + >>> Testing StringToChars using l.extend([Mapping({%s : 1})]) + l.extend([Mapping({1 : 1})]):(, TypeError('expected bytes() or str() instance, but got int',)) +*************** +*** 877,905 **** + <<< Finished + >>> Testing *Iter* using l.extend([Mapping({"abcG" : %s})]) + l.extend([Mapping({"abcG" : FailingIter()})]):(, TypeError('unable to convert FailingIter to vim structure',)) +! l.extend([Mapping({"abcG" : FailingIterNext()})]):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([Mapping({"abcG" : %s})]) + l.extend([Mapping({"abcG" : None})]):(, TypeError('unable to convert NoneType to vim structure',)) + l.extend([Mapping({"abcG" : {b"": 1}})]):(, ValueError('empty keys are not allowed',)) + l.extend([Mapping({"abcG" : {"": 1}})]):(, ValueError('empty keys are not allowed',)) +! l.extend([Mapping({"abcG" : FailingMapping()})]):(, NotImplementedError()) +! l.extend([Mapping({"abcG" : FailingMappingKey()})]):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using l.extend([%s]) + l.extend([FailingIter()]):(, TypeError('unable to convert FailingIter to vim structure',)) +! l.extend([FailingIterNext()]):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([%s]) + l.extend([None]):(, TypeError('unable to convert NoneType to vim structure',)) + l.extend([{b"": 1}]):(, ValueError('empty keys are not allowed',)) + l.extend([{"": 1}]):(, ValueError('empty keys are not allowed',)) +! l.extend([FailingMapping()]):(, NotImplementedError()) +! l.extend([FailingMappingKey()]):(, NotImplementedError()) + <<< Finished + >> ListSetattr + del l.locked:(, AttributeError('cannot delete vim.List attributes',)) +! l.locked = FailingTrue():(, NotImplementedError()) + l.xxx = True:(, AttributeError('cannot set attribute xxx',)) + > Function + >> FunctionConstructor +--- 930,960 ---- + <<< Finished + >>> Testing *Iter* using l.extend([Mapping({"abcG" : %s})]) + l.extend([Mapping({"abcG" : FailingIter()})]):(, TypeError('unable to convert FailingIter to vim structure',)) +! l.extend([Mapping({"abcG" : FailingIterNext()})]):(, NotImplementedError('next',)) + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([Mapping({"abcG" : %s})]) + l.extend([Mapping({"abcG" : None})]):(, TypeError('unable to convert NoneType to vim structure',)) + l.extend([Mapping({"abcG" : {b"": 1}})]):(, ValueError('empty keys are not allowed',)) + l.extend([Mapping({"abcG" : {"": 1}})]):(, ValueError('empty keys are not allowed',)) +! l.extend([Mapping({"abcG" : FailingMapping()})]):(, NotImplementedError('keys',)) +! l.extend([Mapping({"abcG" : FailingMappingKey()})]):(, NotImplementedError('getitem:mappingkey',)) +! l.extend([Mapping({"abcG" : FailingNumber()})]):(, NotImplementedError('int',)) + <<< Finished + >>> Testing *Iter* using l.extend([%s]) + l.extend([FailingIter()]):(, TypeError('unable to convert FailingIter to vim structure',)) +! l.extend([FailingIterNext()]):(, NotImplementedError('next',)) + <<< Finished + >>> Testing ConvertFromPyObject using l.extend([%s]) + l.extend([None]):(, TypeError('unable to convert NoneType to vim structure',)) + l.extend([{b"": 1}]):(, ValueError('empty keys are not allowed',)) + l.extend([{"": 1}]):(, ValueError('empty keys are not allowed',)) +! l.extend([FailingMapping()]):(, NotImplementedError('keys',)) +! l.extend([FailingMappingKey()]):(, NotImplementedError('getitem:mappingkey',)) +! l.extend([FailingNumber()]):(, NotImplementedError('int',)) + <<< Finished + >> ListSetattr + del l.locked:(, AttributeError('cannot delete vim.List attributes',)) +! l.locked = FailingTrue():(, NotImplementedError('bool',)) + l.xxx = True:(, AttributeError('cannot set attribute xxx',)) + > Function + >> FunctionConstructor +*************** +*** 924,937 **** + <<< Finished + >>> Testing *Iter* using f({"abcF" : %s}) + f({"abcF" : FailingIter()}):(, TypeError('unable to convert FailingIter to vim structure',)) +! f({"abcF" : FailingIterNext()}):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using f({"abcF" : %s}) + f({"abcF" : None}):(, TypeError('unable to convert NoneType to vim structure',)) + f({"abcF" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) + f({"abcF" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! f({"abcF" : FailingMapping()}):(, NotImplementedError()) +! f({"abcF" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using f(Mapping({%s : 1})) + f(Mapping({1 : 1})):(, TypeError('expected bytes() or str() instance, but got int',)) +--- 979,993 ---- + <<< Finished + >>> Testing *Iter* using f({"abcF" : %s}) + f({"abcF" : FailingIter()}):(, TypeError('unable to convert FailingIter to vim structure',)) +! f({"abcF" : FailingIterNext()}):(, NotImplementedError('next',)) + <<< Finished + >>> Testing ConvertFromPyObject using f({"abcF" : %s}) + f({"abcF" : None}):(, TypeError('unable to convert NoneType to vim structure',)) + f({"abcF" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) + f({"abcF" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! f({"abcF" : FailingMapping()}):(, NotImplementedError('keys',)) +! f({"abcF" : FailingMappingKey()}):(, NotImplementedError('getitem:mappingkey',)) +! f({"abcF" : FailingNumber()}):(, NotImplementedError('int',)) + <<< Finished + >>> Testing StringToChars using f(Mapping({%s : 1})) + f(Mapping({1 : 1})):(, TypeError('expected bytes() or str() instance, but got int',)) +*************** +*** 950,974 **** + <<< Finished + >>> Testing *Iter* using f(Mapping({"abcG" : %s})) + f(Mapping({"abcG" : FailingIter()})):(, TypeError('unable to convert FailingIter to vim structure',)) +! f(Mapping({"abcG" : FailingIterNext()})):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using f(Mapping({"abcG" : %s})) + f(Mapping({"abcG" : None})):(, TypeError('unable to convert NoneType to vim structure',)) + f(Mapping({"abcG" : {b"": 1}})):(, ValueError('empty keys are not allowed',)) + f(Mapping({"abcG" : {"": 1}})):(, ValueError('empty keys are not allowed',)) +! f(Mapping({"abcG" : FailingMapping()})):(, NotImplementedError()) +! f(Mapping({"abcG" : FailingMappingKey()})):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using f(%s) + f(FailingIter()):(, TypeError('unable to convert FailingIter to vim structure',)) +! f(FailingIterNext()):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using f(%s) + f(None):(, TypeError('unable to convert NoneType to vim structure',)) + f({b"": 1}):(, ValueError('empty keys are not allowed',)) + f({"": 1}):(, ValueError('empty keys are not allowed',)) +! f(FailingMapping()):(, NotImplementedError()) +! f(FailingMappingKey()):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using fd(self={%s : 1}) + fd(self={1 : 1}):(, TypeError('expected bytes() or str() instance, but got int',)) +--- 1006,1032 ---- + <<< Finished + >>> Testing *Iter* using f(Mapping({"abcG" : %s})) + f(Mapping({"abcG" : FailingIter()})):(, TypeError('unable to convert FailingIter to vim structure',)) +! f(Mapping({"abcG" : FailingIterNext()})):(, NotImplementedError('next',)) + <<< Finished + >>> Testing ConvertFromPyObject using f(Mapping({"abcG" : %s})) + f(Mapping({"abcG" : None})):(, TypeError('unable to convert NoneType to vim structure',)) + f(Mapping({"abcG" : {b"": 1}})):(, ValueError('empty keys are not allowed',)) + f(Mapping({"abcG" : {"": 1}})):(, ValueError('empty keys are not allowed',)) +! f(Mapping({"abcG" : FailingMapping()})):(, NotImplementedError('keys',)) +! f(Mapping({"abcG" : FailingMappingKey()})):(, NotImplementedError('getitem:mappingkey',)) +! f(Mapping({"abcG" : FailingNumber()})):(, NotImplementedError('int',)) + <<< Finished + >>> Testing *Iter* using f(%s) + f(FailingIter()):(, TypeError('unable to convert FailingIter to vim structure',)) +! f(FailingIterNext()):(, NotImplementedError('next',)) + <<< Finished + >>> Testing ConvertFromPyObject using f(%s) + f(None):(, TypeError('unable to convert NoneType to vim structure',)) + f({b"": 1}):(, ValueError('empty keys are not allowed',)) + f({"": 1}):(, ValueError('empty keys are not allowed',)) +! f(FailingMapping()):(, NotImplementedError('keys',)) +! f(FailingMappingKey()):(, NotImplementedError('getitem:mappingkey',)) +! f(FailingNumber()):(, NotImplementedError('int',)) + <<< Finished + >>> Testing StringToChars using fd(self={%s : 1}) + fd(self={1 : 1}):(, TypeError('expected bytes() or str() instance, but got int',)) +*************** +*** 987,1000 **** + <<< Finished + >>> Testing *Iter* using fd(self={"abcF" : %s}) + fd(self={"abcF" : FailingIter()}):(, TypeError('unable to convert FailingIter to vim structure',)) +! fd(self={"abcF" : FailingIterNext()}):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using fd(self={"abcF" : %s}) + fd(self={"abcF" : None}):(, TypeError('unable to convert NoneType to vim structure',)) + fd(self={"abcF" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) + fd(self={"abcF" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! fd(self={"abcF" : FailingMapping()}):(, NotImplementedError()) +! fd(self={"abcF" : FailingMappingKey()}):(, NotImplementedError()) + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({%s : 1})) + fd(self=Mapping({1 : 1})):(, TypeError('expected bytes() or str() instance, but got int',)) +--- 1045,1059 ---- + <<< Finished + >>> Testing *Iter* using fd(self={"abcF" : %s}) + fd(self={"abcF" : FailingIter()}):(, TypeError('unable to convert FailingIter to vim structure',)) +! fd(self={"abcF" : FailingIterNext()}):(, NotImplementedError('next',)) + <<< Finished + >>> Testing ConvertFromPyObject using fd(self={"abcF" : %s}) + fd(self={"abcF" : None}):(, TypeError('unable to convert NoneType to vim structure',)) + fd(self={"abcF" : {b"": 1}}):(, ValueError('empty keys are not allowed',)) + fd(self={"abcF" : {"": 1}}):(, ValueError('empty keys are not allowed',)) +! fd(self={"abcF" : FailingMapping()}):(, NotImplementedError('keys',)) +! fd(self={"abcF" : FailingMappingKey()}):(, NotImplementedError('getitem:mappingkey',)) +! fd(self={"abcF" : FailingNumber()}):(, NotImplementedError('int',)) + <<< Finished + >>> Testing StringToChars using fd(self=Mapping({%s : 1})) + fd(self=Mapping({1 : 1})):(, TypeError('expected bytes() or str() instance, but got int',)) +*************** +*** 1013,1026 **** + <<< Finished + >>> Testing *Iter* using fd(self=Mapping({"abcG" : %s})) + fd(self=Mapping({"abcG" : FailingIter()})):(, TypeError('unable to convert FailingIter to vim structure',)) +! fd(self=Mapping({"abcG" : FailingIterNext()})):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyObject using fd(self=Mapping({"abcG" : %s})) + fd(self=Mapping({"abcG" : None})):(, TypeError('unable to convert NoneType to vim structure',)) + fd(self=Mapping({"abcG" : {b"": 1}})):(, ValueError('empty keys are not allowed',)) + fd(self=Mapping({"abcG" : {"": 1}})):(, ValueError('empty keys are not allowed',)) +! fd(self=Mapping({"abcG" : FailingMapping()})):(, NotImplementedError()) +! fd(self=Mapping({"abcG" : FailingMappingKey()})):(, NotImplementedError()) + <<< Finished + >>> Testing *Iter* using fd(self=%s) + fd(self=FailingIter()):(, TypeError('unable to convert FailingIter to vim dictionary',)) +--- 1072,1086 ---- + <<< Finished + >>> Testing *Iter* using fd(self=Mapping({"abcG" : %s})) + fd(self=Mapping({"abcG" : FailingIter()})):(, TypeError('unable to convert FailingIter to vim structure',)) +! fd(self=Mapping({"abcG" : FailingIterNext()})):(, NotImplementedError('next',)) + <<< Finished + >>> Testing ConvertFromPyObject using fd(self=Mapping({"abcG" : %s})) + fd(self=Mapping({"abcG" : None})):(, TypeError('unable to convert NoneType to vim structure',)) + fd(self=Mapping({"abcG" : {b"": 1}})):(, ValueError('empty keys are not allowed',)) + fd(self=Mapping({"abcG" : {"": 1}})):(, ValueError('empty keys are not allowed',)) +! fd(self=Mapping({"abcG" : FailingMapping()})):(, NotImplementedError('keys',)) +! fd(self=Mapping({"abcG" : FailingMappingKey()})):(, NotImplementedError('getitem:mappingkey',)) +! fd(self=Mapping({"abcG" : FailingNumber()})):(, NotImplementedError('int',)) + <<< Finished + >>> Testing *Iter* using fd(self=%s) + fd(self=FailingIter()):(, TypeError('unable to convert FailingIter to vim dictionary',)) +*************** +*** 1030,1037 **** + fd(self=None):(, TypeError('unable to convert NoneType to vim dictionary',)) + fd(self={b"": 1}):(, ValueError('empty keys are not allowed',)) + fd(self={"": 1}):(, ValueError('empty keys are not allowed',)) +! fd(self=FailingMapping()):(, NotImplementedError()) +! fd(self=FailingMappingKey()):(, NotImplementedError()) + <<< Finished + >>> Testing ConvertFromPyMapping using fd(self=%s) + fd(self=[]):(, AttributeError('keys',)) +--- 1090,1098 ---- + fd(self=None):(, TypeError('unable to convert NoneType to vim dictionary',)) + fd(self={b"": 1}):(, ValueError('empty keys are not allowed',)) + fd(self={"": 1}):(, ValueError('empty keys are not allowed',)) +! fd(self=FailingMapping()):(, NotImplementedError('keys',)) +! fd(self=FailingMappingKey()):(, NotImplementedError('getitem:mappingkey',)) +! fd(self=FailingNumber()):(, TypeError('unable to convert FailingNumber to vim dictionary',)) + <<< Finished + >>> Testing ConvertFromPyMapping using fd(self=%s) + fd(self=[]):(, AttributeError('keys',)) +*************** +*** 1049,1056 **** + vim.current.window.buffer = 0:(, TypeError('readonly attribute: buffer',)) + vim.current.window.cursor = (100000000, 100000000):(, error('cursor position outside buffer',)) + vim.current.window.cursor = True:(, TypeError('argument must be 2-item sequence, not bool',)) +! vim.current.window.height = "abcK":(, TypeError('expected int() or something supporting coercing to int(), but got str',)) +! vim.current.window.width = "abcL":(, TypeError('expected int() or something supporting coercing to int(), but got str',)) + vim.current.window.xxxxxx = True:(, AttributeError('xxxxxx',)) + > WinList + >> WinListItem +--- 1110,1125 ---- + vim.current.window.buffer = 0:(, TypeError('readonly attribute: buffer',)) + vim.current.window.cursor = (100000000, 100000000):(, error('cursor position outside buffer',)) + vim.current.window.cursor = True:(, TypeError('argument must be 2-item sequence, not bool',)) +! >>> Testing NumberToLong using vim.current.window.height = %s +! vim.current.window.height = []:(, TypeError('expected int() or something supporting coercing to int(), but got list',)) +! vim.current.window.height = None:(, TypeError('expected int() or something supporting coercing to int(), but got NoneType',)) +! vim.current.window.height = -1:(, ValueError('number must be greater or equal to zero',)) +! <<< Finished +! >>> Testing NumberToLong using vim.current.window.width = %s +! vim.current.window.width = []:(, TypeError('expected int() or something supporting coercing to int(), but got list',)) +! vim.current.window.width = None:(, TypeError('expected int() or something supporting coercing to int(), but got NoneType',)) +! vim.current.window.width = -1:(, ValueError('number must be greater or equal to zero',)) +! <<< Finished + vim.current.window.xxxxxx = True:(, AttributeError('xxxxxx',)) + > WinList + >> WinListItem +*************** +*** 1058,1063 **** +--- 1127,1133 ---- + > Buffer + >> StringToLine (indirect) + vim.current.buffer[0] = "\na":(, error('string cannot contain newlines',)) ++ vim.current.buffer[0] = b"\na":(, error('string cannot contain newlines',)) + >> SetBufferLine (indirect) + vim.current.buffer[0] = True:(, TypeError('bad argument type for built-in operation',)) + >> SetBufferLineList (indirect) +*************** +*** 1084,1091 **** + vim.current.buffer.range(1, 2, 3):(, TypeError('function takes exactly 2 arguments (3 given)',)) + > BufMap + >> BufMapItem +- vim.buffers[None]:(, TypeError('expected int() or something supporting coercing to int(), but got NoneType',)) + vim.buffers[100000000]:(, KeyError(100000000,)) + > Current + >> CurrentGetattr + vim.current.xxx:(, AttributeError("'vim.currentdata' object has no attribute 'xxx'",)) +--- 1154,1166 ---- + vim.current.buffer.range(1, 2, 3):(, TypeError('function takes exactly 2 arguments (3 given)',)) + > BufMap + >> BufMapItem + vim.buffers[100000000]:(, KeyError(100000000,)) ++ >>> Testing NumberToLong using vim.buffers[%s] ++ vim.buffers[[]]:(, TypeError('expected int() or something supporting coercing to int(), but got list',)) ++ vim.buffers[None]:(, TypeError('expected int() or something supporting coercing to int(), but got NoneType',)) ++ vim.buffers[-1]:(, ValueError('number must be greater then zero',)) ++ vim.buffers[0]:(, ValueError('number must be greater then zero',)) ++ <<< Finished + > Current + >> CurrentGetattr + vim.current.xxx:(, AttributeError("'vim.currentdata' object has no attribute 'xxx'",)) +*************** +*** 1095,1103 **** +--- 1170,1183 ---- + vim.current.window = True:(, TypeError('expected vim.Window object, but got bool',)) + vim.current.tabpage = True:(, TypeError('expected vim.TabPage object, but got bool',)) + vim.current.xxx = True:(, AttributeError('xxx',)) ++ ['.'] ++ '.' + 3,xx + before + after ++ pythonx/topmodule/__init__.py ++ pythonx/topmodule/submodule/__init__.py ++ pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py + vim.command("throw 'abcN'"):(, error('abcN',)) + Exe("throw 'def'"):(, error('def',)) + vim.eval("Exe('throw ''ghi''')"):(, error('ghi',)) +*** ../vim-7.3.1235/src/testdir/pythonx/topmodule/__init__.py 1970-01-01 01:00:00.000000000 +0100 +--- src/testdir/pythonx/topmodule/__init__.py 2013-06-23 16:23:50.000000000 +0200 +*************** +*** 0 **** +--- 1 ---- ++ # +*** ../vim-7.3.1235/src/testdir/pythonx/topmodule/submodule/__init__.py 1970-01-01 01:00:00.000000000 +0100 +--- src/testdir/pythonx/topmodule/submodule/__init__.py 2013-06-23 16:23:50.000000000 +0200 +*************** +*** 0 **** +--- 1 ---- ++ # +*** ../vim-7.3.1235/src/testdir/pythonx/topmodule/submodule/subsubmodule/__init__.py 1970-01-01 01:00:00.000000000 +0100 +--- src/testdir/pythonx/topmodule/submodule/subsubmodule/__init__.py 2013-06-23 16:23:51.000000000 +0200 +*************** +*** 0 **** +--- 1 ---- ++ # +*** ../vim-7.3.1235/src/testdir/pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py 1970-01-01 01:00:00.000000000 +0100 +--- src/testdir/pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py 2013-06-23 16:23:51.000000000 +0200 +*************** +*** 0 **** +--- 1 ---- ++ # +*** ../vim-7.3.1235/src/version.c 2013-06-23 16:16:13.000000000 +0200 +--- src/version.c 2013-06-23 16:35:04.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1236, + /**/ + +-- +Microsoft: "Windows NT 4.0 now has the same user-interface as Windows 95" + Windows 95: "Press CTRL-ALT-DEL to reboot" +Windows NT 4.0: "Press CTRL-ALT-DEL to login" + + /// 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 /// diff --git a/7.3.1237 b/7.3.1237 new file mode 100644 index 0000000..bf25740 --- /dev/null +++ b/7.3.1237 @@ -0,0 +1,89 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1237 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1237 +Problem: Python: non-import errors not handled correctly. +Solution: Let non-ImportError exceptions pass the finder. (ZyX) +Files: src/if_py_both.h, src/testdir/test86.ok, src/testdir/test87.ok + + +*** ../vim-7.3.1236/src/if_py_both.h 2013-06-23 16:35:32.000000000 +0200 +--- src/if_py_both.h 2013-06-23 16:38:39.000000000 +0200 +*************** +*** 1199,1204 **** +--- 1199,1212 ---- + + if (!module) + { ++ if (PyErr_Occurred()) ++ { ++ if (PyErr_ExceptionMatches(PyExc_ImportError)) ++ PyErr_Clear(); ++ else ++ return NULL; ++ } ++ + Py_INCREF(Py_None); + return Py_None; + } +*** ../vim-7.3.1236/src/testdir/test86.ok 2013-06-23 16:35:32.000000000 +0200 +--- src/testdir/test86.ok 2013-06-23 16:38:39.000000000 +0200 +*************** +*** 497,503 **** + > import + import xxx_no_such_module_xxx:ImportError:('No module named xxx_no_such_module_xxx',) + import failing_import:ImportError:('No module named failing_import',) +! import failing:ImportError:('No module named failing',) + > Dictionary + >> DictionaryConstructor + vim.Dictionary("abcI"):ValueError:('expected sequence element of size 2, but got sequence of size 1',) +--- 497,503 ---- + > import + import xxx_no_such_module_xxx:ImportError:('No module named xxx_no_such_module_xxx',) + import failing_import:ImportError:('No module named failing_import',) +! import failing:NotImplementedError:() + > Dictionary + >> DictionaryConstructor + vim.Dictionary("abcI"):ValueError:('expected sequence element of size 2, but got sequence of size 1',) +*** ../vim-7.3.1236/src/testdir/test87.ok 2013-06-23 16:35:32.000000000 +0200 +--- src/testdir/test87.ok 2013-06-23 16:38:39.000000000 +0200 +*************** +*** 486,492 **** + > import + import xxx_no_such_module_xxx:(, ImportError('No module named xxx_no_such_module_xxx',)) + import failing_import:(, ImportError('No module named failing_import',)) +! import failing:(, ImportError('No module named failing',)) + > Dictionary + >> DictionaryConstructor + vim.Dictionary("abcI"):(, ValueError('expected sequence element of size 2, but got sequence of size 1',)) +--- 486,492 ---- + > import + import xxx_no_such_module_xxx:(, ImportError('No module named xxx_no_such_module_xxx',)) + import failing_import:(, ImportError('No module named failing_import',)) +! import failing:(, NotImplementedError()) + > Dictionary + >> DictionaryConstructor + vim.Dictionary("abcI"):(, ValueError('expected sequence element of size 2, but got sequence of size 1',)) +*** ../vim-7.3.1236/src/version.c 2013-06-23 16:35:32.000000000 +0200 +--- src/version.c 2013-06-23 16:38:20.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1237, + /**/ + +-- +This is an airconditioned room, do not open Windows. + + /// 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 /// diff --git a/7.3.1238 b/7.3.1238 new file mode 100644 index 0000000..636f0f8 --- /dev/null +++ b/7.3.1238 @@ -0,0 +1,79 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1238 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1238 +Problem: Crash in Python interface on 64 bit machines. +Solution: Change argument type of PyString_AsStringAndSize. (Taro Muraoka, + Jun Takimoto) +Files: src/if_python.c + + +*** ../vim-7.3.1237/src/if_python.c 2013-06-23 16:35:32.000000000 +0200 +--- src/if_python.c 2013-06-24 20:30:38.000000000 +0200 +*************** +*** 329,335 **** + static PyTypeObject* dll_PyLong_Type; + static PyObject*(*dll_PyList_GetItem)(PyObject *, PyInt); + static int(*dll_PyList_Append)(PyObject *, PyObject *); +! static int(*dll_PyList_Insert)(PyObject *, int, PyObject *); + static PyObject*(*dll_PyList_New)(PyInt size); + static int(*dll_PyList_SetItem)(PyObject *, PyInt, PyObject *); + static PyInt(*dll_PyList_Size)(PyObject *); +--- 329,335 ---- + static PyTypeObject* dll_PyLong_Type; + static PyObject*(*dll_PyList_GetItem)(PyObject *, PyInt); + static int(*dll_PyList_Append)(PyObject *, PyObject *); +! static int(*dll_PyList_Insert)(PyObject *, PyInt, PyObject *); + static PyObject*(*dll_PyList_New)(PyInt size); + static int(*dll_PyList_SetItem)(PyObject *, PyInt, PyObject *); + static PyInt(*dll_PyList_Size)(PyObject *); +*************** +*** 365,371 **** + static PyObject* (*dll_PyObject_Call)(PyObject *, PyObject *, PyObject *); + static PyObject* (*dll_PyObject_Repr)(PyObject *); + static char*(*dll_PyString_AsString)(PyObject *); +! static int(*dll_PyString_AsStringAndSize)(PyObject *, char **, int *); + static PyObject*(*dll_PyString_FromString)(const char *); + static PyObject*(*dll_PyString_FromFormat)(const char *, ...); + static PyObject*(*dll_PyString_FromStringAndSize)(const char *, PyInt); +--- 365,371 ---- + static PyObject* (*dll_PyObject_Call)(PyObject *, PyObject *, PyObject *); + static PyObject* (*dll_PyObject_Repr)(PyObject *); + static char*(*dll_PyString_AsString)(PyObject *); +! static int(*dll_PyString_AsStringAndSize)(PyObject *, char **, PyInt *); + static PyObject*(*dll_PyString_FromString)(const char *); + static PyObject*(*dll_PyString_FromFormat)(const char *, ...); + static PyObject*(*dll_PyString_FromStringAndSize)(const char *, PyInt); +*** ../vim-7.3.1237/src/version.c 2013-06-23 16:40:34.000000000 +0200 +--- src/version.c 2013-06-24 20:26:29.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1238, + /**/ + +-- + When danger reared its ugly head, + He bravely turned his tail and fled + Yes, Brave Sir Robin turned about + And gallantly he chickened out + Bravely taking to his feet + He beat a very brave retreat + Bravest of the brave Sir Robin + Petrified of being dead + Soiled his pants then brave Sir Robin + Turned away and fled. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// 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 /// diff --git a/7.3.1239 b/7.3.1239 new file mode 100644 index 0000000..d13654c --- /dev/null +++ b/7.3.1239 @@ -0,0 +1,105 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1239 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1239 +Problem: Can't build with Python and MSVC10. +Solution: Move #if outside of macro. (Taro Muraoka) +Files: src/if_py_both.h + + +*** ../vim-7.3.1238/src/if_py_both.h 2013-06-23 16:40:34.000000000 +0200 +--- src/if_py_both.h 2013-06-24 21:21:03.000000000 +0200 +*************** +*** 139,151 **** + } + else + { +- PyErr_FORMAT(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 +! N_("expected str() or unicode() instance, but got %s") + #else +! N_("expected bytes() or str() instance, but got %s") + #endif +- , Py_TYPE_NAME(obj)); + return NULL; + } + +--- 139,153 ---- + } + else + { + #if PY_MAJOR_VERSION < 3 +! PyErr_FORMAT(PyExc_TypeError, +! N_("expected str() or unicode() instance, but got %s"), +! Py_TYPE_NAME(obj)); + #else +! PyErr_FORMAT(PyExc_TypeError, +! N_("expected bytes() or str() instance, but got %s"), +! Py_TYPE_NAME(obj)); + #endif + return NULL; + } + +*************** +*** 191,205 **** + } + else + { +- PyErr_FORMAT(PyExc_TypeError, + #if PY_MAJOR_VERSION < 3 + N_("expected int(), long() or something supporting " +! "coercing to long(), but got %s") + #else + N_("expected int() or something supporting coercing to int(), " +! "but got %s") + #endif +- , Py_TYPE_NAME(obj)); + return -1; + } + +--- 193,209 ---- + } + else + { + #if PY_MAJOR_VERSION < 3 ++ PyErr_FORMAT(PyExc_TypeError, + N_("expected int(), long() or something supporting " +! "coercing to long(), but got %s"), +! Py_TYPE_NAME(obj)); + #else ++ PyErr_FORMAT(PyExc_TypeError, + N_("expected int() or something supporting coercing to int(), " +! "but got %s"), +! Py_TYPE_NAME(obj)); + #endif + return -1; + } + +*** ../vim-7.3.1238/src/version.c 2013-06-24 20:32:54.000000000 +0200 +--- src/version.c 2013-06-24 21:19:04.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1239, + /**/ + +-- + GALAHAD hurries to the door and pushes through it. As he leaves the room + we CUT TO the reverse to show that he is now in a room full of bathing + and romping GIRLIES, all innocent, wide-eyed and beautiful. They smile + enchantingly at him as he tries to keep walking without being diverted by + the lovely sights assaulting his eyeballs. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// 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 /// diff --git a/7.3.1240 b/7.3.1240 new file mode 100644 index 0000000..003aaf7 --- /dev/null +++ b/7.3.1240 @@ -0,0 +1,56 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1240 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1240 +Problem: Memory leak in findfile(). +Solution: Free the memory. (Christian Brabandt) +Files: src/eval.c + + +*** ../vim-7.3.1239/src/eval.c 2013-06-23 14:30:42.000000000 +0200 +--- src/eval.c 2013-06-24 22:12:41.000000000 +0200 +*************** +*** 10448,10454 **** + { + do + { +! if (rettv->v_type == VAR_STRING) + vim_free(fresult); + fresult = find_file_in_path_option(first ? fname : NULL, + first ? (int)STRLEN(fname) : 0, +--- 10448,10454 ---- + { + do + { +! if (rettv->v_type == VAR_STRING || rettv->v_type == VAR_LIST) + vim_free(fresult); + fresult = find_file_in_path_option(first ? fname : NULL, + first ? (int)STRLEN(fname) : 0, +*** ../vim-7.3.1239/src/version.c 2013-06-24 21:21:52.000000000 +0200 +--- src/version.c 2013-06-24 22:09:30.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1240, + /**/ + +-- +DINGO: You must spank her well and after you have spanked her you + may deal with her as you like and then ... spank me. +AMAZING: And spank me! +STUNNER: And me. +LOVELY: And me. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// 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 /// diff --git a/7.3.1241 b/7.3.1241 new file mode 100644 index 0000000..2af539b --- /dev/null +++ b/7.3.1241 @@ -0,0 +1,51 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1241 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1241 (after 7.3.1236) +Problem: Some test files missing from the distribution. +Solution: Update the list of files. +Files: Filelist + + +*** ../vim-7.3.1240/Filelist 2013-06-12 14:20:15.000000000 +0200 +--- Filelist 2013-06-24 22:21:10.000000000 +0200 +*************** +*** 87,92 **** +--- 87,96 ---- + src/testdir/python2/*.py \ + src/testdir/python3/*.py \ + src/testdir/pythonx/*.py \ ++ src/testdir/pythonx/topmodule/__init__.py \ ++ src/testdir/pythonx/topmodule/submodule/__init__.py \ ++ src/testdir/pythonx/topmodule/submodule/subsubmodule/__init__.py \ ++ src/testdir/pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py \ + src/testdir/python_after/*.py \ + src/testdir/python_before/*.py \ + src/proto.h \ +*** ../vim-7.3.1240/src/version.c 2013-06-24 22:17:27.000000000 +0200 +--- src/version.c 2013-06-24 22:23:24.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1241, + /**/ + +-- +DINGO: And after the spanking ... the oral sex. +GALAHAD: Oh, dear! Well, I... +GIRLS: The oral sex ... The oral sex. +GALAHAD: Well, I suppose I could stay a BIT longer. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// 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 /// diff --git a/7.3.1242 b/7.3.1242 new file mode 100644 index 0000000..025dfff --- /dev/null +++ b/7.3.1242 @@ -0,0 +1,78 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1242 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1242 +Problem: No failure when trying to use a number as a string. +Solution: Give an error when StringToLine() is called with an instance of + the wrong type. (Jun Takimoto) +Files: src/if_py_both.h + + +*** ../vim-7.3.1241/src/if_py_both.h 2013-06-24 21:21:52.000000000 +0200 +--- src/if_py_both.h 2013-06-24 22:30:51.000000000 +0200 +*************** +*** 3549,3561 **** + if (!(bytes = PyUnicode_AsEncodedString(obj, ENC_OPT, NULL))) + return NULL; + +! if(PyBytes_AsStringAndSize(bytes, &str, &len) == -1 + || str == NULL) + { + Py_DECREF(bytes); + return NULL; + } + } + + /* + * Error checking: String must not contain newlines, as we +--- 3549,3574 ---- + if (!(bytes = PyUnicode_AsEncodedString(obj, ENC_OPT, NULL))) + return NULL; + +! if (PyBytes_AsStringAndSize(bytes, &str, &len) == -1 + || str == NULL) + { + Py_DECREF(bytes); + return NULL; + } + } ++ else ++ { ++ #if PY_MAJOR_VERSION < 3 ++ PyErr_FORMAT(PyExc_TypeError, ++ N_("expected str() or unicode() instance, but got %s"), ++ Py_TYPE_NAME(obj)); ++ #else ++ PyErr_FORMAT(PyExc_TypeError, ++ N_("expected bytes() or str() instance, but got %s"), ++ Py_TYPE_NAME(obj)); ++ #endif ++ return NULL; ++ } + + /* + * Error checking: String must not contain newlines, as we +*** ../vim-7.3.1241/src/version.c 2013-06-24 22:23:51.000000000 +0200 +--- src/version.c 2013-06-24 22:32:19.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1242, + /**/ + +-- +A successful man is one who makes more money than his wife can spend. +A successful woman is one who can find such a man. + + /// 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 /// diff --git a/7.3.1243 b/7.3.1243 new file mode 100644 index 0000000..0009e93 --- /dev/null +++ b/7.3.1243 @@ -0,0 +1,156 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1243 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1243 +Problem: New regexp engine: back references in look-behind match don't + work. (Lech Lorens) +Solution: Copy the submatches before a recursive match. Also fix + function prototypes. +Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok + + +*** ../vim-7.3.1242/src/regexp_nfa.c 2013-06-21 18:31:16.000000000 +0200 +--- src/regexp_nfa.c 2013-06-26 12:32:19.000000000 +0200 +*************** +*** 290,299 **** + #endif + static int *re2post __ARGS((void)); + static nfa_state_T *alloc_state __ARGS((int c, nfa_state_T *out, nfa_state_T *out1)); + static nfa_state_T *post2nfa __ARGS((int *postfix, int *end, int nfa_calc_size)); + static void nfa_postprocess __ARGS((nfa_regprog_T *prog)); + static int check_char_class __ARGS((int class, int c)); +- static void st_error __ARGS((int *postfix, int *end, int *p)); + static void nfa_save_listids __ARGS((nfa_regprog_T *prog, int *list)); + static void nfa_restore_listids __ARGS((nfa_regprog_T *prog, int *list)); + static int nfa_re_num_cmp __ARGS((long_u val, int op, long_u pos)); +--- 290,300 ---- + #endif + static int *re2post __ARGS((void)); + static nfa_state_T *alloc_state __ARGS((int c, nfa_state_T *out, nfa_state_T *out1)); ++ static void st_error __ARGS((int *postfix, int *end, int *p)); ++ static int nfa_max_width __ARGS((nfa_state_T *startstate, int depth)); + static nfa_state_T *post2nfa __ARGS((int *postfix, int *end, int nfa_calc_size)); + static void nfa_postprocess __ARGS((nfa_regprog_T *prog)); + static int check_char_class __ARGS((int class, int c)); + static void nfa_save_listids __ARGS((nfa_regprog_T *prog, int *list)); + static void nfa_restore_listids __ARGS((nfa_regprog_T *prog, int *list)); + static int nfa_re_num_cmp __ARGS((long_u val, int op, long_u pos)); +*************** +*** 3469,3474 **** +--- 3470,3476 ---- + #ifdef ENABLE_LOG + static void log_subsexpr __ARGS((regsubs_T *subs)); + static void log_subexpr __ARGS((regsub_T *sub)); ++ static char *pim_info __ARGS((nfa_pim_T *pim)); + + static void + log_subsexpr(subs) +*************** +*** 3508,3514 **** + } + + static char * +! pim_info(nfa_pim_T *pim) + { + static char buf[30]; + +--- 3510,3517 ---- + } + + static char * +! pim_info(pim) +! nfa_pim_T *pim; + { + static char buf[30]; + +*************** +*** 3532,3537 **** +--- 3535,3541 ---- + static void copy_sub __ARGS((regsub_T *to, regsub_T *from)); + static void copy_sub_off __ARGS((regsub_T *to, regsub_T *from)); + static int sub_equal __ARGS((regsub_T *sub1, regsub_T *sub2)); ++ static int match_backref __ARGS((regsub_T *sub, int subidx, int *bytelen)); + static int has_state_with_pos __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs)); + static int state_in_list __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs)); + static void addstate __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs, nfa_pim_T *pim, int off)); +*************** +*** 4319,4326 **** + return FAIL; + } + +- static int match_backref __ARGS((regsub_T *sub, int subidx, int *bytelen)); +- + /* + * Check for a match with subexpression "subidx". + * Return TRUE if it matches. +--- 4323,4328 ---- +*************** +*** 5195,5200 **** +--- 5197,5206 ---- + || t->state->c == NFA_START_INVISIBLE_BEFORE_FIRST + || t->state->c == NFA_START_INVISIBLE_BEFORE_NEG_FIRST) + { ++ /* Copy submatch info for the recursive call, so that ++ * \1 can be matched. */ ++ copy_sub_off(&m->norm, &t->subs.norm); ++ + /* + * First try matching the invisible match, then what + * follows. +*** ../vim-7.3.1242/src/testdir/test64.in 2013-06-17 22:04:34.000000000 +0200 +--- src/testdir/test64.in 2013-06-26 12:31:31.000000000 +0200 +*************** +*** 380,385 **** +--- 380,388 ---- + :call add(tl, [2, '\(a\)\(b\)\(c\)\(dd\)\(e\)\(f\)\(g\)\(h\)\(i\)\1\2\3\4\5\6\7\8\9', 'xabcddefghiabcddefghix', 'abcddefghiabcddefghi', 'a', 'b', 'c', 'dd', 'e', 'f', 'g', 'h', 'i']) + :call add(tl, [2, '\(\d*\)a \1b', ' a b ', 'a b', '']) + :call add(tl, [2, '^.\(.\).\_..\1.', "aaa\naaa\nb", "aaa\naaa", 'a']) ++ :call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@ +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1244 +Problem: MS-Windows: confirm() dialog text may not fit. +Solution: Use GetTextWidthEnc() instead of GetTextWidth(). (Yasuhiro + Matsumoto) +Files: src/gui_w32.c + + +*** ../vim-7.3.1243/src/gui_w32.c 2013-05-06 04:21:35.000000000 +0200 +--- src/gui_w32.c 2013-06-26 12:55:32.000000000 +0200 +*************** +*** 3216,3222 **** + if (l == 1 && vim_iswhite(*pend) + && textWidth > maxDialogWidth * 3 / 4) + last_white = pend; +! textWidth += GetTextWidth(hdc, pend, l); + if (textWidth >= maxDialogWidth) + { + /* Line will wrap. */ +--- 3216,3222 ---- + if (l == 1 && vim_iswhite(*pend) + && textWidth > maxDialogWidth * 3 / 4) + last_white = pend; +! textWidth += GetTextWidthEnc(hdc, pend, l); + if (textWidth >= maxDialogWidth) + { + /* Line will wrap. */ +*** ../vim-7.3.1243/src/version.c 2013-06-26 12:42:38.000000000 +0200 +--- src/version.c 2013-06-26 12:56:47.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1244, + /**/ + +-- +The psychic said, "God bless you." I said, "I didn't sneeze." She +looked deep into my eyes and said, "You will, eventually." And, damn +if she wasn't right. Two days later, I sneezed. --Ellen Degeneres + + /// 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 /// diff --git a/7.3.1245 b/7.3.1245 new file mode 100644 index 0000000..ceef534 --- /dev/null +++ b/7.3.1245 @@ -0,0 +1,70 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1245 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1245 +Problem: MS-Windows: confirm() dialog text may still not fit. +Solution: Use GetTextWidthEnc() instead of GetTextWidth() in two more + places. (Yasuhiro Matsumoto) +Files: src/gui_w32.c + + +*** ../vim-7.3.1244/src/gui_w32.c 2013-06-26 12:58:28.000000000 +0200 +--- src/gui_w32.c 2013-06-26 13:13:43.000000000 +0200 +*************** +*** 3282,3288 **** + pend = vim_strchr(pstart, DLG_BUTTON_SEP); + if (pend == NULL) + pend = pstart + STRLEN(pstart); // Last button name. +! textWidth = GetTextWidth(hdc, pstart, (int)(pend - pstart)); + if (textWidth < minButtonWidth) + textWidth = minButtonWidth; + textWidth += dlgPaddingX; /* Padding within button */ +--- 3282,3288 ---- + pend = vim_strchr(pstart, DLG_BUTTON_SEP); + if (pend == NULL) + pend = pstart + STRLEN(pstart); // Last button name. +! textWidth = GetTextWidthEnc(hdc, pstart, (int)(pend - pstart)); + if (textWidth < minButtonWidth) + textWidth = minButtonWidth; + textWidth += dlgPaddingX; /* Padding within button */ +*************** +*** 3307,3313 **** + pend = vim_strchr(pstart, DLG_BUTTON_SEP); + if (pend == NULL) + pend = pstart + STRLEN(pstart); // Last button name. +! textWidth = GetTextWidth(hdc, pstart, (int)(pend - pstart)); + textWidth += dlgPaddingX; /* Padding within button */ + textWidth += DLG_VERT_PADDING_X * 2; /* Padding around button */ + if (textWidth > dlgwidth) +--- 3307,3313 ---- + pend = vim_strchr(pstart, DLG_BUTTON_SEP); + if (pend == NULL) + pend = pstart + STRLEN(pstart); // Last button name. +! textWidth = GetTextWidthEnc(hdc, pstart, (int)(pend - pstart)); + textWidth += dlgPaddingX; /* Padding within button */ + textWidth += DLG_VERT_PADDING_X * 2; /* Padding around button */ + if (textWidth > dlgwidth) +*** ../vim-7.3.1244/src/version.c 2013-06-26 12:58:28.000000000 +0200 +--- src/version.c 2013-06-26 13:14:19.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1245, + /**/ + +-- +TALL KNIGHT OF NI: Ni! + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// 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 /// diff --git a/7.3.1246 b/7.3.1246 new file mode 100644 index 0000000..22f426b --- /dev/null +++ b/7.3.1246 @@ -0,0 +1,135 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1246 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1246 +Problem: When setting 'winfixheight' and resizing the window causes the + window layout to be wrong. +Solution: Add frame_check_height() and frame_check_width() (Yukihiro + Nakadaira) +Files: src/window.c + + +*** ../vim-7.3.1245/src/window.c 2013-06-16 17:32:33.000000000 +0200 +--- src/window.c 2013-06-26 13:51:25.000000000 +0200 +*************** +*** 66,71 **** +--- 66,76 ---- + static int check_snapshot_rec __ARGS((frame_T *sn, frame_T *fr)); + static win_T *restore_snapshot_rec __ARGS((frame_T *sn, frame_T *fr)); + ++ static int frame_check_height __ARGS((frame_T *topfrp, int height)); ++ #ifdef FEAT_VERTSPLIT ++ static int frame_check_width __ARGS((frame_T *topfrp, int width)); ++ #endif ++ + #endif /* FEAT_WINDOWS */ + + static win_T *win_alloc __ARGS((win_T *after, int hidden)); +*************** +*** 4749,4755 **** + /* First try setting the heights of windows with 'winfixheight'. If + * that doesn't result in the right height, forget about that option. */ + frame_new_height(topframe, h, FALSE, TRUE); +! if (topframe->fr_height != h) + frame_new_height(topframe, h, FALSE, FALSE); + + (void)win_comp_pos(); /* recompute w_winrow and w_wincol */ +--- 4754,4760 ---- + /* First try setting the heights of windows with 'winfixheight'. If + * that doesn't result in the right height, forget about that option. */ + frame_new_height(topframe, h, FALSE, TRUE); +! if (!frame_check_height(topframe, h)) + frame_new_height(topframe, h, FALSE, FALSE); + + (void)win_comp_pos(); /* recompute w_winrow and w_wincol */ +*************** +*** 4783,4789 **** + /* First try setting the widths of windows with 'winfixwidth'. If that + * doesn't result in the right width, forget about that option. */ + frame_new_width(topframe, (int)Columns, FALSE, TRUE); +! if (topframe->fr_width != Columns) + frame_new_width(topframe, (int)Columns, FALSE, FALSE); + + (void)win_comp_pos(); /* recompute w_winrow and w_wincol */ +--- 4788,4794 ---- + /* First try setting the widths of windows with 'winfixwidth'. If that + * doesn't result in the right width, forget about that option. */ + frame_new_width(topframe, (int)Columns, FALSE, TRUE); +! if (!frame_check_width(topframe, Columns)) + frame_new_width(topframe, (int)Columns, FALSE, FALSE); + + (void)win_comp_pos(); /* recompute w_winrow and w_wincol */ +*************** +*** 6922,6924 **** +--- 6927,6974 ---- + return i; + } + #endif ++ ++ /* ++ * Return TRUE if "topfrp" and its children are at the right height. ++ */ ++ static int ++ frame_check_height(topfrp, height) ++ frame_T *topfrp; ++ int height; ++ { ++ frame_T *frp; ++ ++ if (topfrp->fr_height != height) ++ return FALSE; ++ ++ if (topfrp->fr_layout == FR_ROW) ++ for (frp = topfrp->fr_child; frp != NULL; frp = frp->fr_next) ++ if (frp->fr_height != height) ++ return FALSE; ++ ++ return TRUE; ++ } ++ ++ #ifdef FEAT_VERTSPLIT ++ /* ++ * Return TRUE if "topfrp" and its children are at the right width. ++ */ ++ static int ++ frame_check_width(topfrp, width) ++ frame_T *topfrp; ++ int width; ++ { ++ frame_T *frp; ++ ++ if (topfrp->fr_width != width) ++ return FALSE; ++ ++ if (topfrp->fr_layout == FR_COL) ++ for (frp = topfrp->fr_child; frp != NULL; frp = frp->fr_next) ++ if (frp->fr_width != width) ++ return FALSE; ++ ++ return TRUE; ++ } ++ #endif ++ +*** ../vim-7.3.1245/src/version.c 2013-06-26 13:16:13.000000000 +0200 +--- src/version.c 2013-06-26 13:47:56.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1246, + /**/ + +-- +Back up my hard drive? I can't find the reverse switch! + + /// 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 /// diff --git a/7.3.1247 b/7.3.1247 new file mode 100644 index 0000000..83499c7 --- /dev/null +++ b/7.3.1247 @@ -0,0 +1,135 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1247 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1247 +Problem: New regexp engine: '[ ]\@!\p\%([ ]\@!\p\)*:' does not always match. +Solution: When there is a PIM add a duplicate state that starts at another + position. +Files: src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok + + +*** ../vim-7.3.1246/src/regexp_nfa.c 2013-06-26 12:42:38.000000000 +0200 +--- src/regexp_nfa.c 2013-06-26 17:54:31.000000000 +0200 +*************** +*** 3642,3655 **** + if (i < sub1->in_use) + s1 = sub1->list.multi[i].start.lnum; + else +! s1 = 0; + if (i < sub2->in_use) + s2 = sub2->list.multi[i].start.lnum; + else +! s2 = 0; + if (s1 != s2) + return FALSE; +! if (s1 != 0 && sub1->list.multi[i].start.col + != sub2->list.multi[i].start.col) + return FALSE; + } +--- 3642,3655 ---- + if (i < sub1->in_use) + s1 = sub1->list.multi[i].start.lnum; + else +! s1 = -1; + if (i < sub2->in_use) + s2 = sub2->list.multi[i].start.lnum; + else +! s2 = -1; + if (s1 != s2) + return FALSE; +! if (s1 != -1 && sub1->list.multi[i].start.col + != sub2->list.multi[i].start.col) + return FALSE; + } +*************** +*** 3931,3938 **** + if (state->lastlist[nfa_ll_index] == l->id) + { + /* This state is already in the list, don't add it again, +! * unless it is an MOPEN that is used for a backreference. */ +! if (!nfa_has_backref) + { + skip_add: + #ifdef ENABLE_LOG +--- 3931,3939 ---- + if (state->lastlist[nfa_ll_index] == l->id) + { + /* This state is already in the list, don't add it again, +! * unless it is an MOPEN that is used for a backreference or +! * when there is a PIM. */ +! if (!nfa_has_backref && pim == NULL) + { + skip_add: + #ifdef ENABLE_LOG +*************** +*** 3949,3957 **** + goto skip_add; + } + +! /* When there are backreferences the number of states may be (a +! * lot) bigger than anticipated. */ +! if (nfa_has_backref && l->n == l->len) + { + int newlen = l->len * 3 / 2 + 50; + +--- 3950,3958 ---- + goto skip_add; + } + +! /* When there are backreferences or PIMs the number of states may +! * be (a lot) bigger than anticipated. */ +! if (l->n == l->len) + { + int newlen = l->len * 3 / 2 + 50; + +*** ../vim-7.3.1246/src/testdir/test64.in 2013-06-26 12:42:38.000000000 +0200 +--- src/testdir/test64.in 2013-06-26 16:43:19.000000000 +0200 +*************** +*** 338,343 **** +--- 338,344 ---- + :call add(tl, [2, '^\%(.*bar\)\@!.*\zsfoo', ' bar foo ']) + :call add(tl, [2, '^\%(.*bar\)\@!.*\zsfoo', ' foo bar ']) + :call add(tl, [2, '^\%(.*bar\)\@!.*\zsfoo', ' foo xxx ', 'foo']) ++ :call add(tl, [2, '[ ]\@!\p\%([ ]\@!\p\)*:', 'implicit mappings:', 'mappings:']) + :" + :"""" Combining different tests and features + :call add(tl, [2, '[[:alpha:]]\{-2,6}', '787abcdiuhsasiuhb4', 'ab']) +*** ../vim-7.3.1246/src/testdir/test64.ok 2013-06-26 12:42:38.000000000 +0200 +--- src/testdir/test64.ok 2013-06-26 17:33:11.000000000 +0200 +*************** +*** 770,775 **** +--- 770,778 ---- + OK 0 - ^\%(.*bar\)\@!.*\zsfoo + OK 1 - ^\%(.*bar\)\@!.*\zsfoo + OK 2 - ^\%(.*bar\)\@!.*\zsfoo ++ OK 0 - [ ]\@!\p\%([ ]\@!\p\)*: ++ OK 1 - [ ]\@!\p\%([ ]\@!\p\)*: ++ OK 2 - [ ]\@!\p\%([ ]\@!\p\)*: + OK 0 - [[:alpha:]]\{-2,6} + OK 1 - [[:alpha:]]\{-2,6} + OK 2 - [[:alpha:]]\{-2,6} +*** ../vim-7.3.1246/src/version.c 2013-06-26 14:04:37.000000000 +0200 +--- src/version.c 2013-06-26 17:30:26.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1247, + /**/ + +-- +FATHER: One day, lad, all this will be yours ... +PRINCE: What - the curtains? + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// 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 /// diff --git a/7.3.1248 b/7.3.1248 new file mode 100644 index 0000000..dbfeff2 --- /dev/null +++ b/7.3.1248 @@ -0,0 +1,286 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1248 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1248 +Problem: Still have old hacking code for Input Method. +Solution: Add 'imactivatefunc' and 'imstatusfunc' as a generic solution to + Input Method activation. (Yukihiro Nakadaira) +Files: runtime/doc/options.txt, src/fileio.c, src/mbyte.c, src/option.c, + src/option.h, src/proto/fileio.pro + + +*** ../vim-7.3.1247/runtime/doc/options.txt 2013-06-04 22:13:45.000000000 +0200 +--- runtime/doc/options.txt 2013-06-26 19:00:28.000000000 +0200 +*************** +*** 3937,3942 **** +--- 3993,4018 ---- + Can be overruled by using "\c" or "\C" in the pattern, see + |/ignorecase|. + ++ *'imactivatefunc'* *'imaf'* ++ 'imactivatefunc' 'imaf' string (default "") ++ global ++ {not in Vi} ++ {only available when compiled with |+xim| and ++ |+GUI_GTK|} ++ This option specifies a function that will be called to ++ activate/inactivate Input Method. ++ ++ Example: > ++ function ImActivateFunc(active) ++ if a:active ++ ... do something ++ else ++ ... do something ++ endif ++ " return value is not used ++ endfunction ++ set imactivatefunc=ImActivateFunc ++ < + *'imactivatekey'* *'imak'* + 'imactivatekey' 'imak' string (default "") + global +*************** +*** 4033,4038 **** +--- 4109,4132 ---- + The value 0 may not work correctly with Athena and Motif with some XIM + methods. Use 'imdisable' to disable XIM then. + ++ *'imstatusfunc'* *'imsf'* ++ 'imstatusfunc' 'imsf' string (default "") ++ global ++ {not in Vi} ++ {only available when compiled with |+xim| and ++ |+GUI_GTK|} ++ This option specifies a function that is called to obtain the status ++ of Input Method. It must return a positive number when IME is active. ++ ++ Example: > ++ function ImStatusFunc() ++ let is_active = ...do something ++ return is_active ? 1 : 0 ++ endfunction ++ set imstatusfunc=ImStatusFunc ++ < ++ NOTE: This function is invoked very often. Keep it fast. ++ + *'include'* *'inc'* + 'include' 'inc' string (default "^\s*#\s*include") + global or local to buffer |global-local| +*** ../vim-7.3.1247/src/fileio.c 2013-06-12 22:41:30.000000000 +0200 +--- src/fileio.c 2013-06-26 18:41:39.000000000 +0200 +*************** +*** 9572,9577 **** +--- 9572,9583 ---- + # endif + } + ++ int ++ is_autocmd_blocked() ++ { ++ return autocmd_blocked != 0; ++ } ++ + /* + * Find next autocommand pattern that matches. + */ +*** ../vim-7.3.1247/src/mbyte.c 2013-05-06 04:21:35.000000000 +0200 +--- src/mbyte.c 2013-06-26 19:10:41.000000000 +0200 +*************** +*** 4447,4453 **** + { + int was_active; + +! was_active = !!im_is_active; + im_is_active = (active && !p_imdisable); + + if (im_is_active != was_active) +--- 4447,4453 ---- + { + int was_active; + +! was_active = !!im_get_status(); + im_is_active = (active && !p_imdisable); + + if (im_is_active != was_active) +*************** +*** 5071,5114 **** + { + if (xic != NULL) + { +- /* +- * The third-party imhangul module (and maybe others too) ignores +- * gtk_im_context_reset() or at least doesn't reset the active state. +- * Thus sending imactivatekey would turn it off if it was on before, +- * which is clearly not what we want. Fortunately we can work around +- * that for imhangul by sending GDK_Escape, but I don't know if it +- * works with all IM modules that support an activation key :/ +- * +- * An alternative approach would be to destroy the IM context and +- * recreate it. But that means loading/unloading the IM module on +- * every mode switch, which causes a quite noticeable delay even on +- * my rather fast box... +- * * +- * Moreover, there are some XIM which cannot respond to +- * im_synthesize_keypress(). we hope that they reset by +- * xim_shutdown(). +- */ +- if (im_activatekey_keyval != GDK_VoidSymbol && im_is_active) +- im_synthesize_keypress(GDK_Escape, 0U); +- + gtk_im_context_reset(xic); + +- /* +- * HACK for Ami: This sequence of function calls makes Ami handle +- * the IM reset graciously, without breaking loads of other stuff. +- * It seems to force English mode as well, which is exactly what we +- * want because it makes the Ami status display work reliably. +- */ +- gtk_im_context_set_use_preedit(xic, FALSE); +- + if (p_imdisable) + im_shutdown(); + else + { +- gtk_im_context_set_use_preedit(xic, TRUE); + xim_set_focus(gui.in_focus); + +! if (im_activatekey_keyval != GDK_VoidSymbol) + { + if (im_is_active) + { +--- 5071,5095 ---- + { + if (xic != NULL) + { + gtk_im_context_reset(xic); + + if (p_imdisable) + im_shutdown(); + else + { + xim_set_focus(gui.in_focus); + +! if (p_imaf[0] != NUL) +! { +! char_u *argv[1]; +! +! if (im_is_active) +! argv[0] = (char_u *)"1"; +! else +! argv[0] = (char_u *)"0"; +! (void)call_func_retnr(p_imaf, 1, argv, FALSE); +! } +! else if (im_activatekey_keyval != GDK_VoidSymbol) + { + if (im_is_active) + { +*************** +*** 5268,5273 **** +--- 5249,5268 ---- + int + im_get_status(void) + { ++ if (p_imsf[0] != NUL) ++ { ++ int is_active; ++ ++ /* FIXME: Don't execute user function in unsafe situation. */ ++ if (exiting || is_autocmd_blocked()) ++ return FALSE; ++ /* FIXME: :py print 'xxx' is shown duplicate result. ++ * Use silent to avoid it. */ ++ ++msg_silent; ++ is_active = call_func_retnr(p_imsf, 0, NULL, FALSE); ++ --msg_silent; ++ return (is_active > 0); ++ } + return im_is_active; + } + +*** ../vim-7.3.1247/src/option.c 2013-06-16 16:01:20.000000000 +0200 +--- src/option.c 2013-06-26 18:41:39.000000000 +0200 +*************** +*** 1425,1430 **** +--- 1425,1439 ---- + {"ignorecase", "ic", P_BOOL|P_VI_DEF, + (char_u *)&p_ic, PV_NONE, + {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, ++ {"imactivatefunc","imaf",P_STRING|P_VI_DEF|P_SECURE, ++ # if defined(FEAT_EVAL) && defined(FEAT_XIM) && defined(FEAT_GUI_GTK) ++ (char_u *)&p_imaf, PV_NONE, ++ {(char_u *)"", (char_u *)NULL} ++ # else ++ (char_u *)NULL, PV_NONE, ++ {(char_u *)NULL, (char_u *)0L} ++ # endif ++ SCRIPTID_INIT}, + {"imactivatekey","imak",P_STRING|P_VI_DEF, + #if defined(FEAT_XIM) && defined(FEAT_GUI_GTK) + (char_u *)&p_imak, PV_NONE, +*************** +*** 1467,1472 **** +--- 1476,1490 ---- + {(char_u *)B_IMODE_NONE, (char_u *)0L} + #endif + SCRIPTID_INIT}, ++ {"imstatusfunc","imse",P_STRING|P_VI_DEF|P_SECURE, ++ # if defined(FEAT_EVAL) && defined(FEAT_XIM) && defined(FEAT_GUI_GTK) ++ (char_u *)&p_imsf, PV_NONE, ++ {(char_u *)"", (char_u *)NULL} ++ # else ++ (char_u *)NULL, PV_NONE, ++ {(char_u *)NULL, (char_u *)0L} ++ # endif ++ SCRIPTID_INIT}, + {"include", "inc", P_STRING|P_ALLOCED|P_VI_DEF, + #ifdef FEAT_FIND_ID + (char_u *)&p_inc, PV_INC, +*** ../vim-7.3.1247/src/option.h 2013-05-19 19:16:25.000000000 +0200 +--- src/option.h 2013-06-26 18:41:39.000000000 +0200 +*************** +*** 558,563 **** +--- 558,565 ---- + EXTERN int p_ic; /* 'ignorecase' */ + #if defined(FEAT_XIM) && defined(FEAT_GUI_GTK) + EXTERN char_u *p_imak; /* 'imactivatekey' */ ++ EXTERN char_u *p_imaf; /* 'imactivatefunc' */ ++ EXTERN char_u *p_imsf; /* 'imstatusfunc' */ + #endif + #ifdef USE_IM_CONTROL + EXTERN int p_imcmdline; /* 'imcmdline' */ +*** ../vim-7.3.1247/src/proto/fileio.pro 2013-03-19 13:33:18.000000000 +0100 +--- src/proto/fileio.pro 2013-06-26 18:45:49.000000000 +0200 +*************** +*** 49,54 **** +--- 49,55 ---- + int has_insertcharpre __ARGS((void)); + void block_autocmds __ARGS((void)); + void unblock_autocmds __ARGS((void)); ++ int is_autocmd_blocked __ARGS((void)); + char_u *getnextac __ARGS((int c, void *cookie, int indent)); + int has_autocmd __ARGS((event_T event, char_u *sfname, buf_T *buf)); + char_u *get_augroup_name __ARGS((expand_T *xp, int idx)); +*** ../vim-7.3.1247/src/version.c 2013-06-26 18:16:55.000000000 +0200 +--- src/version.c 2013-06-26 19:12:37.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1248, + /**/ + +-- +I'd like to meet the man who invented sex and see what he's working on now. + + /// 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 /// diff --git a/7.3.1249 b/7.3.1249 new file mode 100644 index 0000000..8fcd38f --- /dev/null +++ b/7.3.1249 @@ -0,0 +1,54 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1249 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1249 +Problem: Modeline not recognized when using "Vim" instead of "vim". +Solution: Also accept "Vim". +Files: src/buffer.c + + +*** ../vim-7.3.1248/src/buffer.c 2013-06-16 17:32:33.000000000 +0200 +--- src/buffer.c 2013-06-26 19:52:58.000000000 +0200 +*************** +*** 5096,5102 **** + if ((prev != -1 && STRNCMP(s, "ex:", (size_t)3) == 0) + || STRNCMP(s, "vi:", (size_t)3) == 0) + break; +! if (STRNCMP(s, "vim", 3) == 0) + { + if (s[3] == '<' || s[3] == '=' || s[3] == '>') + e = s + 4; +--- 5096,5103 ---- + if ((prev != -1 && STRNCMP(s, "ex:", (size_t)3) == 0) + || STRNCMP(s, "vi:", (size_t)3) == 0) + break; +! /* Accept both "vim" and "Vim". */ +! if ((s[0] == 'v' || s[0] == 'V') && s[1] == 'i' && s[2] == 'm') + { + if (s[3] == '<' || s[3] == '=' || s[3] == '>') + e = s + 4; +*** ../vim-7.3.1248/src/version.c 2013-06-26 19:17:58.000000000 +0200 +--- src/version.c 2013-06-26 19:53:37.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1249, + /**/ + +-- +CONCORDE: Message for you, sir. + He falls forward revealing the arrow with the note. + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// 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 /// diff --git a/7.3.1250 b/7.3.1250 new file mode 100644 index 0000000..1aa1500 --- /dev/null +++ b/7.3.1250 @@ -0,0 +1,106 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1250 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1250 +Problem: Python tests fail on MS-Windows. +Solution: Change backslashes to slashes. (Taro Muraoka) +Files: src/testdir/test86.in, src/testdir/test87.in + + +*** ../vim-7.3.1249/src/testdir/test86.in 2013-06-23 16:35:32.000000000 +0200 +--- src/testdir/test86.in 2013-06-26 21:43:04.000000000 +0200 +*************** +*** 1221,1232 **** + vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\') + l = [] + def callback(path): +! l.append(path[-len('/testdir'):]) + vim.foreach_rtp(callback) + cb.append(repr(l)) + del l + def callback(path): +! return path[-len('/testdir'):] + cb.append(repr(vim.foreach_rtp(callback))) + del callback + from module import dir as d +--- 1221,1232 ---- + vim.options['rtp'] = os.getcwd().replace(',', '\\,').replace('\\', '\\\\') + l = [] + def callback(path): +! l.append(path[-len('/testdir'):].replace(os.path.sep, '/')) + vim.foreach_rtp(callback) + cb.append(repr(l)) + del l + def callback(path): +! return path[-len('/testdir'):].replace(os.path.sep, '/') + cb.append(repr(vim.foreach_rtp(callback))) + del callback + from module import dir as d +*************** +*** 1239,1247 **** + import topmodule as tm + import topmodule.submodule as tms + import topmodule.submodule.subsubmodule.subsubsubmodule as tmsss +! cb.append(tm.__file__.replace('.pyc', '.py')[-len('modulex/topmodule/__init__.py'):]) +! cb.append(tms.__file__.replace('.pyc', '.py')[-len('modulex/topmodule/submodule/__init__.py'):]) +! cb.append(tmsss.__file__.replace('.pyc', '.py')[-len('modulex/topmodule/submodule/subsubmodule/subsubsubmodule.py'):]) + del before + del after + del d +--- 1239,1247 ---- + import topmodule as tm + import topmodule.submodule as tms + import topmodule.submodule.subsubmodule.subsubsubmodule as tmsss +! cb.append(tm.__file__.replace('.pyc', '.py').replace(os.path.sep, '/')[-len('modulex/topmodule/__init__.py'):]) +! cb.append(tms.__file__.replace('.pyc', '.py').replace(os.path.sep, '/')[-len('modulex/topmodule/submodule/__init__.py'):]) +! cb.append(tmsss.__file__.replace('.pyc', '.py').replace(os.path.sep, '/')[-len('modulex/topmodule/submodule/subsubmodule/subsubsubmodule.py'):]) + del before + del after + del d +*** ../vim-7.3.1249/src/testdir/test87.in 2013-06-23 16:35:32.000000000 +0200 +--- src/testdir/test87.in 2013-06-26 21:44:25.000000000 +0200 +*************** +*** 1188,1196 **** + import topmodule as tm + import topmodule.submodule as tms + import topmodule.submodule.subsubmodule.subsubsubmodule as tmsss +! cb.append(tm.__file__[-len('modulex/topmodule/__init__.py'):]) +! cb.append(tms.__file__[-len('modulex/topmodule/submodule/__init__.py'):]) +! cb.append(tmsss.__file__[-len('modulex/topmodule/submodule/subsubmodule/subsubsubmodule.py'):]) + del before + del after + del d +--- 1188,1196 ---- + import topmodule as tm + import topmodule.submodule as tms + import topmodule.submodule.subsubmodule.subsubsubmodule as tmsss +! cb.append(tm.__file__.replace(os.path.sep, '/')[-len('modulex/topmodule/__init__.py'):]) +! cb.append(tms.__file__.replace(os.path.sep, '/')[-len('modulex/topmodule/submodule/__init__.py'):]) +! cb.append(tmsss.__file__.replace(os.path.sep, '/')[-len('modulex/topmodule/submodule/subsubmodule/subsubsubmodule.py'):]) + del before + del after + del d +*** ../vim-7.3.1249/src/version.c 2013-06-26 20:04:28.000000000 +0200 +--- src/version.c 2013-06-26 21:44:00.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1250, + /**/ + +-- +You were lucky to have a LAKE! There were a hundred and sixty of +us living in a small shoebox in the middle of the road. + + /// 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 /// diff --git a/7.3.1251 b/7.3.1251 new file mode 100644 index 0000000..b3f37cb --- /dev/null +++ b/7.3.1251 @@ -0,0 +1,52 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1251 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1251 +Problem: Test 61 messes up viminfo. +Solution: Specify a separate viminfo file. +Files: src/testdir/test61.in + + +*** ../vim-7.3.1250/src/testdir/test61.in 2013-06-15 17:54:36.000000000 +0200 +--- src/testdir/test61.in 2013-06-26 21:54:00.000000000 +0200 +*************** +*** 85,91 **** + ggO---:0put a + ggO---:w >>test.out + :so small.vim +! :set nocp + :enew! + oa + :set ul=100 +--- 85,91 ---- + ggO---:0put a + ggO---:w >>test.out + :so small.vim +! :set nocp viminfo+=nviminfo + :enew! + oa + :set ul=100 +*** ../vim-7.3.1250/src/version.c 2013-06-26 21:49:46.000000000 +0200 +--- src/version.c 2013-06-26 21:54:43.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1251, + /**/ + +-- +Yah, well, we had to carve our electrons out of driftwood we'd +find. In the winter. Uphill. Both ways. + + /// 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 /// diff --git a/7.3.1252 b/7.3.1252 new file mode 100644 index 0000000..7de9eef --- /dev/null +++ b/7.3.1252 @@ -0,0 +1,55 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1252 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1252 +Problem: Gvim does not find the toolbar bitmap files in ~/vimfiles/bitmaps + if the corresponding menu command contains additional characters + like the shortcut marker '&' or if you use a non-english locale. +Solution: Use menu->en_dname or menu->dname. (Martin Gieseking) +Files: src/gui_w32.c + + +*** ../vim-7.3.1251/src/gui_w32.c 2013-06-26 13:16:13.000000000 +0200 +--- src/gui_w32.c 2013-06-27 22:01:03.000000000 +0200 +*************** +*** 4163,4169 **** + * didn't exist or wasn't specified, try the menu name + */ + if (hbitmap == NULL +! && (gui_find_bitmap(menu->name, fname, "bmp") == OK)) + hbitmap = LoadImage( + NULL, + fname, +--- 4163,4171 ---- + * didn't exist or wasn't specified, try the menu name + */ + if (hbitmap == NULL +! && (gui_find_bitmap(menu->en_dname != NULL +! ? menu->en_dname +! : menu->dname, fname, "bmp") == OK)) + hbitmap = LoadImage( + NULL, + fname, +*** ../vim-7.3.1251/src/version.c 2013-06-26 21:56:33.000000000 +0200 +--- src/version.c 2013-06-27 20:33:18.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1252, + /**/ + +-- +Why doesn't Tarzan have a beard? + + /// 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 /// diff --git a/7.3.1253 b/7.3.1253 new file mode 100644 index 0000000..f7dbf8d --- /dev/null +++ b/7.3.1253 @@ -0,0 +1,74 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1253 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1253 (after 7.3.1200) +Problem: Still undo problem after using CTRL-R = setline(). (Hirohito + Higashi) +Solution: Set the ins_need_undo flag. +Files: src/edit.c + + +*** ../vim-7.3.1252/src/edit.c 2013-06-15 17:54:36.000000000 +0200 +--- src/edit.c 2013-06-27 22:21:08.000000000 +0200 +*************** +*** 8134,8148 **** + # ifdef USE_IM_CONTROL + int im_on = im_get_status(); + # endif + regname = get_expr_register(); + # ifdef USE_IM_CONTROL + /* Restore the Input Method. */ + if (im_on) + im_set_active(TRUE); + # endif +! if (regname == '=') +! /* sync undo, so the effect of e.g., setline() can be undone */ +! u_sync(TRUE); + } + if (regname == NUL || !valid_yank_reg(regname, FALSE)) + { +--- 8134,8150 ---- + # ifdef USE_IM_CONTROL + int im_on = im_get_status(); + # endif ++ /* Sync undo, so the effect of e.g., setline() can be undone. */ ++ u_sync(TRUE); ++ ins_need_undo = TRUE; ++ + regname = get_expr_register(); + # ifdef USE_IM_CONTROL + /* Restore the Input Method. */ + if (im_on) + im_set_active(TRUE); + # endif +! Insstart = curwin->w_cursor; + } + if (regname == NUL || !valid_yank_reg(regname, FALSE)) + { +*** ../vim-7.3.1252/src/version.c 2013-06-27 22:01:56.000000000 +0200 +--- src/version.c 2013-06-27 22:13:02.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1253, + /**/ + +-- + LAUNCELOT leaps into SHOT with a mighty cry and runs the GUARD through and + hacks him to the floor. Blood. Swashbuckling music (perhaps). + LAUNCELOT races through into the castle screaming. +SECOND SENTRY: Hey! + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// 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 /// diff --git a/7.3.1254 b/7.3.1254 new file mode 100644 index 0000000..bcb3005 --- /dev/null +++ b/7.3.1254 @@ -0,0 +1,59 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1254 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1254 (after 7.3.1252) +Problem: Can't build without the multi-lang feature. (John Marriott) +Solution: Add #ifdef. +Files: src/gui_w32.c + + +*** ../vim-7.3.1253/src/gui_w32.c 2013-06-27 22:01:56.000000000 +0200 +--- src/gui_w32.c 2013-06-27 22:26:31.000000000 +0200 +*************** +*** 4163,4171 **** + * didn't exist or wasn't specified, try the menu name + */ + if (hbitmap == NULL +! && (gui_find_bitmap(menu->en_dname != NULL +! ? menu->en_dname +! : menu->dname, fname, "bmp") == OK)) + hbitmap = LoadImage( + NULL, + fname, +--- 4163,4173 ---- + * didn't exist or wasn't specified, try the menu name + */ + if (hbitmap == NULL +! && (gui_find_bitmap( +! #ifdef FEAT_MULTI_LANG +! menu->en_dname != NULL ? menu->en_dname : +! #endif +! menu->dname, fname, "bmp") == OK)) + hbitmap = LoadImage( + NULL, + fname, +*** ../vim-7.3.1253/src/version.c 2013-06-27 22:21:19.000000000 +0200 +--- src/version.c 2013-06-27 22:27:16.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1254, + /**/ + +-- +PRINCE: He's come to rescue me, father. +LAUNCELOT: (embarrassed) Well, let's not jump to conclusions ... + "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD + + /// 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 /// diff --git a/7.3.1255 b/7.3.1255 new file mode 100644 index 0000000..728bb45 --- /dev/null +++ b/7.3.1255 @@ -0,0 +1,69 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1255 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1255 +Problem: Clang warnings when building with Athena. +Solution: Add type casts. (Dominique Pelle) +Files: src/gui_at_fs.c + + +*** ../vim-7.3.1254/src/gui_at_fs.c 2010-08-15 21:57:28.000000000 +0200 +--- src/gui_at_fs.c 2013-06-27 22:31:35.000000000 +0200 +*************** +*** 2591,2597 **** + (XtCallbackProc)SFvFloatSliderMovedCallback, + (XtPointer)(long_u)n); + XtAddCallback(selFileVScrolls[n], XtNscrollProc, +! (XtCallbackProc)SFvAreaSelectedCallback, (XtPointer)n); + + selFileHScrolls[n] = XtVaCreateManagedWidget("selFileHScroll", + #ifdef FEAT_GUI_NEXTAW +--- 2591,2597 ---- + (XtCallbackProc)SFvFloatSliderMovedCallback, + (XtPointer)(long_u)n); + XtAddCallback(selFileVScrolls[n], XtNscrollProc, +! (XtCallbackProc)SFvAreaSelectedCallback, (XtPointer)(long_u)n); + + selFileHScrolls[n] = XtVaCreateManagedWidget("selFileHScroll", + #ifdef FEAT_GUI_NEXTAW +*************** +*** 2616,2622 **** + (XtCallbackProc)SFhSliderMovedCallback, + (XtPointer)(long_u)n); + XtAddCallback(selFileHScrolls[n], XtNscrollProc, +! (XtCallbackProc)SFhAreaSelectedCallback, (XtPointer)n); + } + + selFileOK = XtVaCreateManagedWidget("selFileOK", +--- 2616,2622 ---- + (XtCallbackProc)SFhSliderMovedCallback, + (XtPointer)(long_u)n); + XtAddCallback(selFileHScrolls[n], XtNscrollProc, +! (XtCallbackProc)SFhAreaSelectedCallback, (XtPointer)(long_u)n); + } + + selFileOK = XtVaCreateManagedWidget("selFileOK", +*** ../vim-7.3.1254/src/version.c 2013-06-27 22:29:35.000000000 +0200 +--- src/version.c 2013-06-27 22:32:26.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1255, + /**/ + +-- +A vacation is a period of travel during which you find that you +took twice as many clothes and half as much money as you needed. + + /// 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 /// diff --git a/7.3.1256 b/7.3.1256 new file mode 100644 index 0000000..3cd589c --- /dev/null +++ b/7.3.1256 @@ -0,0 +1,151 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1256 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1256 +Problem: Can't build without eval or autocmd feature. +Solution: Add #ifdefs. +Files: src/mbyte.c, src/window.c + + +*** ../vim-7.3.1255/src/mbyte.c 2013-06-26 19:17:58.000000000 +0200 +--- src/mbyte.c 2013-06-28 19:53:43.000000000 +0200 +*************** +*** 5079,5084 **** +--- 5079,5085 ---- + { + xim_set_focus(gui.in_focus); + ++ # ifdef FEAT_EVAL + if (p_imaf[0] != NUL) + { + char_u *argv[1]; +*************** +*** 5089,5095 **** + argv[0] = (char_u *)"0"; + (void)call_func_retnr(p_imaf, 1, argv, FALSE); + } +! else if (im_activatekey_keyval != GDK_VoidSymbol) + { + if (im_is_active) + { +--- 5090,5098 ---- + argv[0] = (char_u *)"0"; + (void)call_func_retnr(p_imaf, 1, argv, FALSE); + } +! else +! # endif +! if (im_activatekey_keyval != GDK_VoidSymbol) + { + if (im_is_active) + { +*************** +*** 5249,5260 **** + int + im_get_status(void) + { + if (p_imsf[0] != NUL) + { + int is_active; + + /* FIXME: Don't execute user function in unsafe situation. */ +! if (exiting || is_autocmd_blocked()) + return FALSE; + /* FIXME: :py print 'xxx' is shown duplicate result. + * Use silent to avoid it. */ +--- 5252,5268 ---- + int + im_get_status(void) + { ++ # ifdef FEAT_EVAL + if (p_imsf[0] != NUL) + { + int is_active; + + /* FIXME: Don't execute user function in unsafe situation. */ +! if (exiting +! # ifdef FEAT_AUTOCMD +! || is_autocmd_blocked() +! # endif +! ) + return FALSE; + /* FIXME: :py print 'xxx' is shown duplicate result. + * Use silent to avoid it. */ +*************** +*** 5263,5268 **** +--- 5271,5277 ---- + --msg_silent; + return (is_active > 0); + } ++ # endif + return im_is_active; + } + +*** ../vim-7.3.1255/src/window.c 2013-06-26 14:04:37.000000000 +0200 +--- src/window.c 2013-06-28 19:50:44.000000000 +0200 +*************** +*** 53,62 **** + static void frame_append __ARGS((frame_T *after, frame_T *frp)); + static void frame_insert __ARGS((frame_T *before, frame_T *frp)); + static void frame_remove __ARGS((frame_T *frp)); +! #ifdef FEAT_VERTSPLIT + static void win_goto_ver __ARGS((int up, long count)); + static void win_goto_hor __ARGS((int left, long count)); +! #endif + static void frame_add_height __ARGS((frame_T *frp, int n)); + static void last_status_rec __ARGS((frame_T *fr, int statusline)); + +--- 53,62 ---- + static void frame_append __ARGS((frame_T *after, frame_T *frp)); + static void frame_insert __ARGS((frame_T *before, frame_T *frp)); + static void frame_remove __ARGS((frame_T *frp)); +! # ifdef FEAT_VERTSPLIT + static void win_goto_ver __ARGS((int up, long count)); + static void win_goto_hor __ARGS((int left, long count)); +! # endif + static void frame_add_height __ARGS((frame_T *frp, int n)); + static void last_status_rec __ARGS((frame_T *fr, int statusline)); + +*************** +*** 6928,6933 **** +--- 6928,6934 ---- + } + #endif + ++ #ifdef FEAT_WINDOWS + /* + * Return TRUE if "topfrp" and its children are at the right height. + */ +*************** +*** 6948,6953 **** +--- 6949,6955 ---- + + return TRUE; + } ++ #endif + + #ifdef FEAT_VERTSPLIT + /* +*** ../vim-7.3.1255/src/version.c 2013-06-27 22:35:58.000000000 +0200 +--- src/version.c 2013-06-28 19:54:22.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1256, + /**/ + +-- +Q: How does a UNIX Guru do Sex ? +A: unzip;strip;touch;finger;mount;fsck;more;yes;umount;sleep + + /// 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 /// diff --git a/7.3.1257 b/7.3.1257 new file mode 100644 index 0000000..477f4d2 --- /dev/null +++ b/7.3.1257 @@ -0,0 +1,54 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1257 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1257 +Problem: With GNU gettext() ":lang de_DE.utf8" does not always result in + German messages. +Solution: Clear the $LANGUAGE environment variable. +Files: src/ex_cmds2.c + + +*** ../vim-7.3.1256/src/ex_cmds2.c 2013-06-10 21:27:18.000000000 +0200 +--- src/ex_cmds2.c 2013-06-28 20:14:53.000000000 +0200 +*************** +*** 4261,4266 **** +--- 4261,4269 ---- + if (what == LC_ALL) + { + vim_setenv((char_u *)"LANG", name); ++ ++ /* Clear $LANGUAGE because GNU gettext uses it. */ ++ vim_setenv((char_u *)"LANGUAGE", (char_u *)""); + # ifdef WIN32 + /* Apparently MS-Windows printf() may cause a crash when + * we give it 8-bit text while it's expecting text in the +*** ../vim-7.3.1256/src/version.c 2013-06-28 20:16:50.000000000 +0200 +--- src/version.c 2013-06-28 20:18:08.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1257, + /**/ + + +-- + [clop clop] +GUARD #1: Halt! Who goes there? +ARTHUR: It is I, Arthur, son of Uther Pendragon, from the castle of + Camelot. King of the Britons, defeator of the Saxons, sovereign of + all England! +GUARD #1: Pull the other one! + 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 /// diff --git a/7.3.1258 b/7.3.1258 new file mode 100644 index 0000000..e9067ee --- /dev/null +++ b/7.3.1258 @@ -0,0 +1,62 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1258 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1258 +Problem: Using submatch() may crash Vim. (Ingo Karkat) +Solution: Restore the number of subexpressions used. +Files: src/regexp_nfa.c + + +*** ../vim-7.3.1257/src/regexp_nfa.c 2013-06-26 18:16:55.000000000 +0200 +--- src/regexp_nfa.c 2013-06-28 22:59:38.000000000 +0200 +*************** +*** 5198,5203 **** +--- 5198,5205 ---- + || t->state->c == NFA_START_INVISIBLE_BEFORE_FIRST + || t->state->c == NFA_START_INVISIBLE_BEFORE_NEG_FIRST) + { ++ int in_use = m->norm.in_use; ++ + /* Copy submatch info for the recursive call, so that + * \1 can be matched. */ + copy_sub_off(&m->norm, &t->subs.norm); +*************** +*** 5231,5236 **** +--- 5233,5239 ---- + add_here = TRUE; + add_state = t->state->out1->out; + } ++ m->norm.in_use = in_use; + } + else + { +*** ../vim-7.3.1257/src/version.c 2013-06-28 20:36:26.000000000 +0200 +--- src/version.c 2013-06-28 23:00:55.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1258, + /**/ + + +-- +GUARD #1: What, ridden on a horse? +ARTHUR: Yes! +GUARD #1: You're using coconuts! +ARTHUR: What? +GUARD #1: You've got two empty halves of coconut and you're bangin' 'em + together. + 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 /// diff --git a/7.3.1259 b/7.3.1259 new file mode 100644 index 0000000..f1c6a6d --- /dev/null +++ b/7.3.1259 @@ -0,0 +1,86 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1259 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1259 +Problem: No test for patch 7.3.1258 +Solution: Add a test entry. +Files: src/testdir/test64.in, src/testdir/test64.ok + + +*** ../vim-7.3.1258/src/testdir/test64.in 2013-06-26 18:16:55.000000000 +0200 +--- src/testdir/test64.in 2013-06-29 12:02:33.000000000 +0200 +*************** +*** 384,389 **** +--- 384,390 ---- + :call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@ +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1260 +Problem: User completion does not get the whole command line in the command + line window. +Solution: Pass on the whole command line. (Daniel Thau) +Files: src/ex_getln.c, src/structs.h + + +*** ../vim-7.3.1259/src/ex_getln.c 2013-06-23 16:16:13.000000000 +0200 +--- src/ex_getln.c 2013-06-29 12:53:30.000000000 +0200 +*************** +*** 3729,3734 **** +--- 3729,3735 ---- + #if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL) + xp->xp_arg = NULL; + #endif ++ xp->xp_line = NULL; + } + + /* +*************** +*** 4378,4383 **** +--- 4379,4389 ---- + int old_char = NUL; + char_u *nextcomm; + ++ /* Store the string here so that call_user_expand_func() can get to them ++ * easily. */ ++ xp->xp_line = str; ++ xp->xp_col = col; ++ + /* + * Avoid a UMR warning from Purify, only save the character if it has been + * written before. +*************** +*** 4952,4978 **** + void *ret; + struct cmdline_info save_ccline; + +! if (xp->xp_arg == NULL || xp->xp_arg[0] == '\0') + return NULL; + *num_file = 0; + *file = NULL; + +! if (ccline.cmdbuff == NULL) + { +- /* Completion from Insert mode, pass fake arguments. */ +- keep = 0; +- sprintf((char *)num, "%d", (int)STRLEN(xp->xp_pattern)); +- args[1] = xp->xp_pattern; +- } +- else +- { +- /* Completion on the command line, pass real arguments. */ + keep = ccline.cmdbuff[ccline.cmdlen]; + ccline.cmdbuff[ccline.cmdlen] = 0; +- sprintf((char *)num, "%d", ccline.cmdpos); +- args[1] = ccline.cmdbuff; + } + args[0] = vim_strnsave(xp->xp_pattern, xp->xp_pattern_len); + args[2] = num; + + /* Save the cmdline, we don't know what the function may do. */ +--- 4958,4977 ---- + void *ret; + struct cmdline_info save_ccline; + +! if (xp->xp_arg == NULL || xp->xp_arg[0] == '\0' || xp->xp_line == NULL) + return NULL; + *num_file = 0; + *file = NULL; + +! if (ccline.cmdbuff != NULL) + { + keep = ccline.cmdbuff[ccline.cmdlen]; + ccline.cmdbuff[ccline.cmdlen] = 0; + } ++ + args[0] = vim_strnsave(xp->xp_pattern, xp->xp_pattern_len); ++ args[1] = xp->xp_line; ++ sprintf((char *)num, "%d", xp->xp_col); + args[2] = num; + + /* Save the cmdline, we don't know what the function may do. */ +*** ../vim-7.3.1259/src/structs.h 2013-06-12 19:52:11.000000000 +0200 +--- src/structs.h 2013-06-29 12:47:03.000000000 +0200 +*************** +*** 493,498 **** +--- 493,500 ---- + int xp_numfiles; /* number of files found by + file name completion */ + char_u **xp_files; /* list of files */ ++ char_u *xp_line; /* text being completed */ ++ int xp_col; /* cursor position in line */ + } expand_T; + + /* values for xp_backslash */ +*** ../vim-7.3.1259/src/version.c 2013-06-29 12:10:22.000000000 +0200 +--- src/version.c 2013-06-29 12:41:08.000000000 +0200 +*************** +*** 730,731 **** +--- 730,733 ---- + { /* Add new patch number below this line */ ++ /**/ ++ 1260, + /**/ + +-- +This is the polymorph virus! Follow these instructions carefully: +1. Send this message to everybody you know. +2. Format your harddisk. +Thank you for your cooperation in spreading the most powerful virus ever! + + /// 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 /// diff --git a/7.3.1261 b/7.3.1261 new file mode 100644 index 0000000..55f4d77 --- /dev/null +++ b/7.3.1261 @@ -0,0 +1,329 @@ +To: vim_dev@googlegroups.com +Subject: Patch 7.3.1261 +Fcc: outbox +From: Bram Moolenaar +Mime-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +------------ + +Patch 7.3.1261 (after patch 7.3.1179) +Problem: A buffer-local language mapping from a keymap stops a global + insert mode mapping from working. (Ron Aaron) +Solution: Do not wait for more characters to be typed only when the mapping + was defined with . +Files: runtime/doc/map.txt, src/eval.c, src/getchar.c, + src/testdir/test75.in, src/testdir/test75.ok + + +*** ../vim-7.3.1260/runtime/doc/map.txt 2013-06-12 21:00:18.000000000 +0200 +--- runtime/doc/map.txt 2013-06-29 13:55:01.000000000 +0200 +*************** +*** 159,167 **** + + 1.2 SPECIAL ARGUMENTS *:map-arguments* + +! "", "", "", "