0
0
mirror of https://github.com/vim/vim.git synced 2025-07-26 11:04:33 -04:00

updated for version 7.2-084

This commit is contained in:
Bram Moolenaar 2009-01-13 17:11:05 +00:00
parent 51460cd634
commit d72b386a63
2 changed files with 21 additions and 10 deletions

View File

@ -1151,14 +1151,23 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookupDict)
/* Check if we run into a recursive loop. The item must be in lookupDict /* Check if we run into a recursive loop. The item must be in lookupDict
* then and we can use it again. */ * then and we can use it again. */
sprintf(ptrBuf, PRINTF_DECIMAL_LONG_U, (long_u)our_tv); if ((our_tv->v_type == VAR_LIST && our_tv->vval.v_list != NULL)
result = PyDict_GetItemString(lookupDict, ptrBuf); || (our_tv->v_type == VAR_DICT && our_tv->vval.v_dict != NULL))
if (result != NULL) {
Py_INCREF(result); sprintf(ptrBuf, PRINTF_DECIMAL_LONG_U,
else if (our_tv->v_type == VAR_STRING) our_tv->v_type == VAR_LIST ? (long_u)our_tv->vval.v_list
: (long_u)our_tv->vval.v_dict);
result = PyDict_GetItemString(lookupDict, ptrBuf);
if (result != NULL)
{
Py_INCREF(result);
return result;
}
}
if (our_tv->v_type == VAR_STRING)
{ {
result = Py_BuildValue("s", our_tv->vval.v_string); result = Py_BuildValue("s", our_tv->vval.v_string);
PyDict_SetItemString(lookupDict, ptrBuf, result);
} }
else if (our_tv->v_type == VAR_NUMBER) else if (our_tv->v_type == VAR_NUMBER)
{ {
@ -1167,7 +1176,6 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookupDict)
/* For backwards compatibility numbers are stored as strings. */ /* For backwards compatibility numbers are stored as strings. */
sprintf(buf, "%ld", (long)our_tv->vval.v_number); sprintf(buf, "%ld", (long)our_tv->vval.v_number);
result = Py_BuildValue("s", buf); result = Py_BuildValue("s", buf);
PyDict_SetItemString(lookupDict, ptrBuf, result);
} }
# ifdef FEAT_FLOAT # ifdef FEAT_FLOAT
else if (our_tv->v_type == VAR_FLOAT) else if (our_tv->v_type == VAR_FLOAT)
@ -1176,7 +1184,6 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookupDict)
sprintf(buf, "%f", our_tv->vval.v_float); sprintf(buf, "%f", our_tv->vval.v_float);
result = Py_BuildValue("s", buf); result = Py_BuildValue("s", buf);
PyDict_SetItemString(lookupDict, ptrBuf, result);
} }
# endif # endif
else if (our_tv->v_type == VAR_LIST) else if (our_tv->v_type == VAR_LIST)
@ -1185,10 +1192,11 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookupDict)
listitem_T *curr; listitem_T *curr;
result = PyList_New(0); result = PyList_New(0);
PyDict_SetItemString(lookupDict, ptrBuf, result);
if (list != NULL) if (list != NULL)
{ {
PyDict_SetItemString(lookupDict, ptrBuf, result);
for (curr = list->lv_first; curr != NULL; curr = curr->li_next) for (curr = list->lv_first; curr != NULL; curr = curr->li_next)
{ {
newObj = VimToPython(&curr->li_tv, depth + 1, lookupDict); newObj = VimToPython(&curr->li_tv, depth + 1, lookupDict);
@ -1200,7 +1208,6 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookupDict)
else if (our_tv->v_type == VAR_DICT) else if (our_tv->v_type == VAR_DICT)
{ {
result = PyDict_New(); result = PyDict_New();
PyDict_SetItemString(lookupDict, ptrBuf, result);
if (our_tv->vval.v_dict != NULL) if (our_tv->vval.v_dict != NULL)
{ {
@ -1209,6 +1216,8 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookupDict)
hashitem_T *hi; hashitem_T *hi;
dictitem_T *di; dictitem_T *di;
PyDict_SetItemString(lookupDict, ptrBuf, result);
for (hi = ht->ht_array; todo > 0; ++hi) for (hi = ht->ht_array; todo > 0; ++hi)
{ {
if (!HASHITEM_EMPTY(hi)) if (!HASHITEM_EMPTY(hi))

View File

@ -676,6 +676,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
84,
/**/ /**/
83, 83,
/**/ /**/