]> git.pld-linux.org Git - packages/vim.git/blob - 7.2.336
- new
[packages/vim.git] / 7.2.336
1 To: vim-dev@vim.org
2 Subject: Patch 7.2.336
3 Fcc: outbox
4 From: Bram Moolenaar <Bram@moolenaar.net>
5 Mime-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8 ------------
9
10 Patch 7.2.336
11 Problem:    MzScheme interface can't evaluate an expression.
12 Solution:   Add mzeval(). (Sergey Khorev)
13 Files:      runtime/doc/eval.txt, runtime/doc/if_mzsch.txt,
14             runtime/doc/usr_41.txt, src/eval.c, src/if_mzsch.c,
15             src/proto/eval.pro, src/proto/if_mzsch.pro,
16             src/testdir/Make_dos.mak, src/testdir/Make_ming.mak,
17             src/testdir/Makefile, src/testdir/main.aap, src/testdir/test1.in,
18             src/testdir/test70.in, src/testdir/test70.ok
19
20
21 *** ../vim-7.2.335/runtime/doc/eval.txt 2009-11-17 12:20:30.000000000 +0100
22 --- runtime/doc/eval.txt        2010-01-19 15:30:50.000000000 +0100
23 ***************
24 *** 1815,1825 ****
25                                 List    match and submatches of {pat} in {expr}
26   matchstr( {expr}, {pat}[, {start}[, {count}]])
27                                 String  {count}'th match of {pat} in {expr}
28 ! max({list})                   Number  maximum value of items in {list}
29 ! min({list})                   Number  minimum value of items in {list}
30 ! mkdir({name} [, {path} [, {prot}]])
31                                 Number  create directory {name}
32   mode( [expr])                 String  current editing mode
33   nextnonblank( {lnum})         Number  line nr of non-blank line >= {lnum}
34   nr2char( {expr})              String  single char with ASCII value {expr}
35   pathshorten( {expr})          String  shorten directory names in a path
36 --- 1821,1832 ----
37                                 List    match and submatches of {pat} in {expr}
38   matchstr( {expr}, {pat}[, {start}[, {count}]])
39                                 String  {count}'th match of {pat} in {expr}
40 ! max( {list})                  Number  maximum value of items in {list}
41 ! min( {list})                  Number  minimum value of items in {list}
42 ! mkdir( {name} [, {path} [, {prot}]])
43                                 Number  create directory {name}
44   mode( [expr])                 String  current editing mode
45 + mzeval( {expr})                       any     evaluate |MzScheme| expression
46   nextnonblank( {lnum})         Number  line nr of non-blank line >= {lnum}
47   nr2char( {expr})              String  single char with ASCII value {expr}
48   pathshorten( {expr})          String  shorten directory names in a path
49 ***************
50 *** 4090,4095 ****
51 --- 4103,4125 ----
52                 "c" or "n".
53                 Also see |visualmode()|.
54   
55 + mzeval({expr})                                                        *mzeval()*
56 +               Evaluate MzScheme expression {expr} and return its result
57 +               convert to Vim data structures.
58 +               Numbers and strings are returned as they are.
59 +               Pairs (including lists and improper lists) and vectors are
60 +               returned as Vim |Lists|.
61 +               Hash tables are represented as Vim |Dictionary| type with keys
62 +               converted to strings.
63 +               All other types are converted to string with display function.
64 +               Examples: >
65 +                   :mz (define l (list 1 2 3))
66 +                   :mz (define h (make-hash)) (hash-set! h "list" l)
67 +                   :echo mzeval("l")
68 +                   :echo mzeval("h")
69 + <
70 +               {only available when compiled with the |+mzscheme| feature}
71
72   nextnonblank({lnum})                                  *nextnonblank()*
73                 Return the line number of the first line at or below {lnum}
74                 that is not blank.  Example: >
75 *** ../vim-7.2.335/runtime/doc/if_mzsch.txt     2009-06-24 17:51:01.000000000 +0200
76 --- runtime/doc/if_mzsch.txt    2010-01-19 15:33:00.000000000 +0100
77 ***************
78 *** 1,4 ****
79 ! *if_mzsch.txt*  For Vim version 7.2.  Last change: 2009 Jun 24
80   
81   
82                   VIM REFERENCE MANUAL    by Sergey Khorev
83 --- 1,4 ----
84 ! *if_mzsch.txt*  For Vim version 7.2.  Last change: 2010 Jan 19
85   
86   
87                   VIM REFERENCE MANUAL    by Sergey Khorev
88 ***************
89 *** 9,16 ****
90   1. Commands                           |mzscheme-commands|
91   2. Examples                           |mzscheme-examples|
92   3. Threads                            |mzscheme-threads|
93 ! 4. The Vim access procedures          |mzscheme-vim|
94 ! 5. Dynamic loading                    |mzscheme-dynamic|
95   
96   {Vi does not have any of these commands}
97   
98 --- 9,17 ----
99   1. Commands                           |mzscheme-commands|
100   2. Examples                           |mzscheme-examples|
101   3. Threads                            |mzscheme-threads|
102 ! 4. Vim access from MzScheme           |mzscheme-vim|
103 ! 5. mzeval() Vim function              |mzscheme-mzeval|
104 ! 6. Dynamic loading                    |mzscheme-dynamic|
105   
106   {Vi does not have any of these commands}
107   
108 ***************
109 *** 142,148 ****
110   GUI version.
111   
112   ==============================================================================
113 ! 5. VIM Functions                                      *mzscheme-vim*
114   
115                                                         *mzscheme-vimext*
116   The 'vimext' module provides access to procedures defined in the MzScheme
117 --- 143,149 ----
118   GUI version.
119   
120   ==============================================================================
121 ! 4. Vim access from MzScheme                           *mzscheme-vim*
122   
123                                                         *mzscheme-vimext*
124   The 'vimext' module provides access to procedures defined in the MzScheme
125 ***************
126 *** 231,237 ****
127       (set-cursor (line . col) [window])  Set cursor position.
128   
129   ==============================================================================
130 ! 5. Dynamic loading                                *mzscheme-dynamic* *E815*
131   
132   On MS-Windows the MzScheme libraries can be loaded dynamically. The |:version|
133   output then includes |+mzscheme/dyn|.
134 --- 232,244 ----
135       (set-cursor (line . col) [window])  Set cursor position.
136   
137   ==============================================================================
138 ! 5. mzeval() Vim function                                  *mzscheme-mzeval*
139
140 ! To facilitate bi-directional interface, you can use |mzeval| function to
141 ! evaluate MzScheme expressions and pass their values to VimL.
142
143 ! ==============================================================================
144 ! 6. Dynamic loading                                *mzscheme-dynamic* *E815*
145   
146   On MS-Windows the MzScheme libraries can be loaded dynamically. The |:version|
147   output then includes |+mzscheme/dyn|.
148 *** ../vim-7.2.335/runtime/doc/usr_41.txt       2008-08-09 19:36:54.000000000 +0200
149 --- runtime/doc/usr_41.txt      2010-01-19 15:29:01.000000000 +0100
150 ***************
151 *** 868,873 ****
152 --- 868,875 ----
153         taglist()               get list of matching tags
154         tagfiles()              get a list of tags files
155   
156 +       mzeval()                evaluate |MzScheme| expression
157
158   ==============================================================================
159   *41.7*        Defining a function
160   
161 *** ../vim-7.2.335/src/eval.c   2010-01-19 12:46:51.000000000 +0100
162 --- src/eval.c  2010-01-19 15:48:12.000000000 +0100
163 ***************
164 *** 433,439 ****
165   static long list_find_nr __ARGS((list_T *l, long idx, int *errorp));
166   static long list_idx_of_item __ARGS((list_T *l, listitem_T *item));
167   static void list_append __ARGS((list_T *l, listitem_T *item));
168 - static int list_append_tv __ARGS((list_T *l, typval_T *tv));
169   static int list_append_number __ARGS((list_T *l, varnumber_T n));
170   static int list_insert_tv __ARGS((list_T *l, typval_T *tv, listitem_T *item));
171   static int list_extend __ARGS((list_T *l1, list_T *l2, listitem_T *bef));
172 --- 433,438 ----
173 ***************
174 *** 448,459 ****
175   static void set_ref_in_item __ARGS((typval_T *tv, int copyID));
176   static void dict_unref __ARGS((dict_T *d));
177   static void dict_free __ARGS((dict_T *d, int recurse));
178 - static dictitem_T *dictitem_alloc __ARGS((char_u *key));
179   static dictitem_T *dictitem_copy __ARGS((dictitem_T *org));
180   static void dictitem_remove __ARGS((dict_T *dict, dictitem_T *item));
181 - static void dictitem_free __ARGS((dictitem_T *item));
182   static dict_T *dict_copy __ARGS((dict_T *orig, int deep, int copyID));
183 - static int dict_add __ARGS((dict_T *d, dictitem_T *item));
184   static long dict_len __ARGS((dict_T *d));
185   static dictitem_T *dict_find __ARGS((dict_T *d, char_u *key, int len));
186   static char_u *dict2string __ARGS((typval_T *tv, int copyID));
187 --- 447,455 ----
188 ***************
189 *** 628,633 ****
190 --- 624,632 ----
191   static void f_mkdir __ARGS((typval_T *argvars, typval_T *rettv));
192   #endif
193   static void f_mode __ARGS((typval_T *argvars, typval_T *rettv));
194 + #ifdef FEAT_MZSCHEME
195 + static void f_mzeval __ARGS((typval_T *argvars, typval_T *rettv));
196 + #endif
197   static void f_nextnonblank __ARGS((typval_T *argvars, typval_T *rettv));
198   static void f_nr2char __ARGS((typval_T *argvars, typval_T *rettv));
199   static void f_pathshorten __ARGS((typval_T *argvars, typval_T *rettv));
200 ***************
201 *** 764,770 ****
202   static int var_check_ro __ARGS((int flags, char_u *name));
203   static int var_check_fixed __ARGS((int flags, char_u *name));
204   static int tv_check_lock __ARGS((int lock, char_u *name));
205 - static void copy_tv __ARGS((typval_T *from, typval_T *to));
206   static int item_copy __ARGS((typval_T *from, typval_T *to, int deep, int copyID));
207   static char_u *find_option_end __ARGS((char_u **arg, int *opt_flags));
208   static char_u *trans_function_name __ARGS((char_u **pp, int skip, int flags, funcdict_T *fd));
209 --- 763,768 ----
210 ***************
211 *** 6155,6161 ****
212    * Append typval_T "tv" to the end of list "l".
213    * Return FAIL when out of memory.
214    */
215 !     static int
216   list_append_tv(l, tv)
217       list_T    *l;
218       typval_T  *tv;
219 --- 6153,6159 ----
220    * Append typval_T "tv" to the end of list "l".
221    * Return FAIL when out of memory.
222    */
223 !     int
224   list_append_tv(l, tv)
225       list_T    *l;
226       typval_T  *tv;
227 ***************
228 *** 6812,6818 ****
229    * Note that the value of the item "di_tv" still needs to be initialized!
230    * Returns NULL when out of memory.
231    */
232 !     static dictitem_T *
233   dictitem_alloc(key)
234       char_u    *key;
235   {
236 --- 6810,6816 ----
237    * Note that the value of the item "di_tv" still needs to be initialized!
238    * Returns NULL when out of memory.
239    */
240 !     dictitem_T *
241   dictitem_alloc(key)
242       char_u    *key;
243   {
244 ***************
245 *** 6868,6874 ****
246   /*
247    * Free a dict item.  Also clears the value.
248    */
249 !     static void
250   dictitem_free(item)
251       dictitem_T *item;
252   {
253 --- 6866,6872 ----
254   /*
255    * Free a dict item.  Also clears the value.
256    */
257 !     void
258   dictitem_free(item)
259       dictitem_T *item;
260   {
261 ***************
262 *** 6948,6954 ****
263    * Add item "item" to Dictionary "d".
264    * Returns FAIL when out of memory and when key already existed.
265    */
266 !     static int
267   dict_add(d, item)
268       dict_T    *d;
269       dictitem_T        *item;
270 --- 6946,6952 ----
271    * Add item "item" to Dictionary "d".
272    * Returns FAIL when out of memory and when key already existed.
273    */
274 !     int
275   dict_add(d, item)
276       dict_T    *d;
277       dictitem_T        *item;
278 ***************
279 *** 7699,7704 ****
280 --- 7697,7705 ----
281       {"mkdir",         1, 3, f_mkdir},
282   #endif
283       {"mode",          0, 1, f_mode},
284 + #ifdef FEAT_MZSCHEME
285 +     {"mzeval",                1, 1, f_mzeval},
286 + #endif
287       {"nextnonblank",  1, 1, f_nextnonblank},
288       {"nr2char",               1, 1, f_nr2char},
289       {"pathshorten",   1, 1, f_pathshorten},
290 ***************
291 *** 13591,13596 ****
292 --- 13592,13614 ----
293       rettv->v_type = VAR_STRING;
294   }
295   
296 + #ifdef FEAT_MZSCHEME
297 + /*
298 +  * "mzeval()" function
299 +  */
300 +     static void
301 + f_mzeval(argvars, rettv)
302 +     typval_T  *argvars;
303 +     typval_T  *rettv;
304 + {
305 +     char_u    *str;
306 +     char_u    buf[NUMBUFLEN];
307
308 +     str = get_tv_string_buf(&argvars[0], buf);
309 +     do_mzeval(str, rettv);
310 + }
311 + #endif
312
313   /*
314    * "nextnonblank()" function
315    */
316 ***************
317 *** 19274,19280 ****
318    * It is OK for "from" and "to" to point to the same item.  This is used to
319    * make a copy later.
320    */
321 !     static void
322   copy_tv(from, to)
323       typval_T *from;
324       typval_T *to;
325 --- 19292,19298 ----
326    * It is OK for "from" and "to" to point to the same item.  This is used to
327    * make a copy later.
328    */
329 !     void
330   copy_tv(from, to)
331       typval_T *from;
332       typval_T *to;
333 *** ../vim-7.2.335/src/if_mzsch.c       2009-12-16 19:02:05.000000000 +0100
334 --- src/if_mzsch.c      2010-01-19 15:43:05.000000000 +0100
335 ***************
336 *** 170,175 ****
337 --- 170,177 ----
338   #ifdef FEAT_EVAL
339   static Scheme_Object *vim_to_mzscheme(typval_T *vim_value, int depth,
340         Scheme_Hash_Table *visited);
341 + static int mzscheme_to_vim(Scheme_Object *obj, typval_T *tv, int depth,
342 +       Scheme_Hash_Table *visited);
343   #endif
344   
345   #ifdef MZ_PRECISE_GC
346 ***************
347 *** 2733,2738 ****
348 --- 2735,2959 ----
349       MZ_GC_UNREG();
350       return result;
351   }
352
353 +     static int
354 + mzscheme_to_vim(Scheme_Object *obj, typval_T *tv, int depth,
355 +       Scheme_Hash_Table *visited)
356 + {
357 +     int               status = OK;
358 +     typval_T  *found;
359 +     MZ_GC_CHECK();
360 +     if (depth > 100) /* limit the deepest recursion level */
361 +     {
362 +       tv->v_type = VAR_NUMBER;
363 +       tv->vval.v_number = 0;
364 +       return FAIL;
365 +     }
366
367 +     found = (typval_T *)scheme_hash_get(visited, obj);
368 +     if (found != NULL)
369 +       copy_tv(found, tv);
370 +     else if (SCHEME_VOIDP(obj))
371 +     {
372 +       tv->v_type = VAR_NUMBER;
373 +       tv->vval.v_number = 0;
374 +     }
375 +     else if (SCHEME_INTP(obj))
376 +     {
377 +       tv->v_type = VAR_NUMBER;
378 +       tv->vval.v_number = SCHEME_INT_VAL(obj);
379 +     }
380 +     else if (SCHEME_BOOLP(obj))
381 +     {
382 +       tv->v_type = VAR_NUMBER;
383 +       tv->vval.v_number = SCHEME_TRUEP(obj);
384 +     }
385 + # ifdef FEAT_FLOAT
386 +     else if (SCHEME_DBLP(obj))
387 +     {
388 +       tv->v_type = VAR_FLOAT;
389 +       tv->vval.v_float = SCHEME_DBL_VAL(obj);
390 +     }
391 + # endif
392 +     else if (SCHEME_STRINGP(obj))
393 +     {
394 +       tv->v_type = VAR_STRING;
395 +       tv->vval.v_string = vim_strsave((char_u *)SCHEME_STR_VAL(obj));
396 +     }
397 +     else if (SCHEME_VECTORP(obj) || SCHEME_NULLP(obj)
398 +           || SCHEME_PAIRP(obj) || SCHEME_MUTABLE_PAIRP(obj))
399 +     {
400 +       list_T  *list = list_alloc();
401 +       if (list == NULL)
402 +           status = FAIL;
403 +       else
404 +       {
405 +           int             i;
406 +           Scheme_Object   *curr = NULL;
407 +           Scheme_Object   *cval = NULL;
408 +           /* temporary var to hold current element of vectors and pairs */
409 +           typval_T        *v;
410
411 +           MZ_GC_DECL_REG(2);
412 +           MZ_GC_VAR_IN_REG(0, curr);
413 +           MZ_GC_VAR_IN_REG(1, cval);
414 +           MZ_GC_REG();
415
416 +           tv->v_type = VAR_LIST;
417 +           tv->vval.v_list = list;
418 +           ++list->lv_refcount;
419
420 +           v = (typval_T *)alloc(sizeof(typval_T));
421 +           if (v == NULL)
422 +               status = FAIL;
423 +           else
424 +           {
425 +               /* add the value in advance to allow handling of self-referencial
426 +                * data structures */
427 +               typval_T    *visited_tv = (typval_T *)alloc(sizeof(typval_T));
428 +               copy_tv(tv, visited_tv);
429 +               scheme_hash_set(visited, obj, (Scheme_Object *)visited_tv);
430
431 +               if (SCHEME_VECTORP(obj))
432 +               {
433 +                   for (i = 0; i < SCHEME_VEC_SIZE(obj); ++i)
434 +                   {
435 +                       cval = SCHEME_VEC_ELS(obj)[i];
436 +                       status = mzscheme_to_vim(cval, v, depth + 1, visited);
437 +                       if (status == FAIL)
438 +                           break;
439 +                       status = list_append_tv(list, v);
440 +                       clear_tv(v);
441 +                       if (status == FAIL)
442 +                           break;
443 +                   }
444 +               }
445 +               else if (SCHEME_PAIRP(obj) || SCHEME_MUTABLE_PAIRP(obj))
446 +               {
447 +                   for (curr = obj;
448 +                           SCHEME_PAIRP(curr) || SCHEME_MUTABLE_PAIRP(curr);
449 +                           curr = SCHEME_CDR(curr))
450 +                   {
451 +                       cval = SCHEME_CAR(curr);
452 +                       status = mzscheme_to_vim(cval, v, depth + 1, visited);
453 +                       if (status == FAIL)
454 +                           break;
455 +                       status = list_append_tv(list, v);
456 +                       clear_tv(v);
457 +                       if (status == FAIL)
458 +                           break;
459 +                   }
460 +                   /* impoper list not terminated with null
461 +                    * need to handle the last element */
462 +                   if (status == OK && !SCHEME_NULLP(curr))
463 +                   {
464 +                       status = mzscheme_to_vim(cval, v, depth + 1, visited);
465 +                       if (status == OK)
466 +                       {
467 +                           status = list_append_tv(list, v);
468 +                           clear_tv(v);
469 +                       }
470 +                   }
471 +               }
472 +               /* nothing to do for scheme_null */
473 +               vim_free(v);
474 +           }
475 +           MZ_GC_UNREG();
476 +       }
477 +     }
478 +     else if (SCHEME_HASHTP(obj))
479 +     {
480 +       int             i;
481 +       dict_T          *dict;
482 +       Scheme_Object   *key = NULL;
483 +       Scheme_Object   *val = NULL;
484
485 +       MZ_GC_DECL_REG(2);
486 +       MZ_GC_VAR_IN_REG(0, key);
487 +       MZ_GC_VAR_IN_REG(1, val);
488 +       MZ_GC_REG();
489
490 +       dict = dict_alloc();
491 +       if (dict == NULL)
492 +           status = FAIL;
493 +       else
494 +       {
495 +           typval_T    *visited_tv = (typval_T *)alloc(sizeof(typval_T));
496
497 +           tv->v_type = VAR_DICT;
498 +           tv->vval.v_dict = dict;
499 +           ++dict->dv_refcount;
500
501 +           copy_tv(tv, visited_tv);
502 +           scheme_hash_set(visited, obj, (Scheme_Object *)visited_tv);
503
504 +           for (i = 0; i < ((Scheme_Hash_Table *)obj)->size; ++i)
505 +           {
506 +               if (((Scheme_Hash_Table *) obj)->vals[i] != NULL)
507 +               {
508 +                   /* generate item for `diplay'ed Scheme key */
509 +                   dictitem_T  *item = dictitem_alloc((char_u *)string_to_line(
510 +                               ((Scheme_Hash_Table *) obj)->keys[i]));
511 +                   /* convert Scheme val to Vim and add it to the dict */
512 +                   if (mzscheme_to_vim(((Scheme_Hash_Table *) obj)->vals[i],
513 +                                   &item->di_tv, depth + 1, visited) == FAIL
514 +                           || dict_add(dict, item) == FAIL)
515 +                   {
516 +                       dictitem_free(item);
517 +                       status = FAIL;
518 +                       break;
519 +                   }
520 +               }
521
522 +           }
523 +       }
524 +       MZ_GC_UNREG();
525 +     }
526 +     else
527 +     {
528 +       /* `display' any other value to string */
529 +       tv->v_type = VAR_STRING;
530 +       tv->vval.v_string = (char_u *)string_to_line(obj);
531 +     }
532 +     return status;
533 + }
534
535 +     void
536 + do_mzeval(char_u *str, typval_T *rettv)
537 + {
538 +     int i;
539 +     Scheme_Object     *ret = NULL;
540 +     Scheme_Hash_Table *visited = NULL;
541
542 +     MZ_GC_DECL_REG(2);
543 +     MZ_GC_VAR_IN_REG(0, ret);
544 +     MZ_GC_VAR_IN_REG(0, visited);
545 +     MZ_GC_REG();
546
547 +     if (mzscheme_init())
548 +     {
549 +       MZ_GC_UNREG();
550 +       return;
551 +     }
552
553 +     MZ_GC_CHECK();
554 +     visited = scheme_make_hash_table(SCHEME_hash_ptr);
555 +     MZ_GC_CHECK();
556
557 +     if (eval_with_exn_handling(str, do_eval, &ret) == OK)
558 +       mzscheme_to_vim(ret, rettv, 1, visited);
559
560 +     for (i = 0; i < visited->size; ++i)
561 +     {
562 +       /* free up remembered objects */
563 +       if (visited->vals[i] != NULL)
564 +       {
565 +           free_tv((typval_T *)visited->vals[i]);
566 +       }
567 +     }
568
569 +     MZ_GC_UNREG();
570 + }
571   #endif
572   
573   /*
574 *** ../vim-7.2.335/src/proto/eval.pro   2009-09-30 15:15:33.000000000 +0200
575 --- src/proto/eval.pro  2010-01-19 15:45:39.000000000 +0100
576 ***************
577 *** 47,56 ****
578 --- 47,60 ----
579   void list_free __ARGS((list_T *l, int recurse));
580   dictitem_T *dict_lookup __ARGS((hashitem_T *hi));
581   char_u *list_find_str __ARGS((list_T *l, long idx));
582 + int list_append_tv __ARGS((list_T *l, typval_T *tv));
583   int list_append_dict __ARGS((list_T *list, dict_T *dict));
584   int list_append_string __ARGS((list_T *l, char_u *str, int len));
585   int garbage_collect __ARGS((void));
586   dict_T *dict_alloc __ARGS((void));
587 + dictitem_T *dictitem_alloc __ARGS((char_u *key));
588 + void dictitem_free __ARGS((dictitem_T *item));
589 + int dict_add __ARGS((dict_T *d, dictitem_T *item));
590   int dict_add_nr_str __ARGS((dict_T *d, char *key, long nr, char_u *str));
591   char_u *get_dict_string __ARGS((dict_T *d, char_u *key, int save));
592   long get_dict_number __ARGS((dict_T *d, char_u *key));
593 ***************
594 *** 77,82 ****
595 --- 81,87 ----
596   void new_script_vars __ARGS((scid_T id));
597   void init_var_dict __ARGS((dict_T *dict, dictitem_T *dict_var));
598   void vars_clear __ARGS((hashtab_T *ht));
599 + void copy_tv __ARGS((typval_T *from, typval_T *to));
600   void ex_echo __ARGS((exarg_T *eap));
601   void ex_echohl __ARGS((exarg_T *eap));
602   void ex_execute __ARGS((exarg_T *eap));
603 *** ../vim-7.2.335/src/proto/if_mzsch.pro       2009-12-16 19:02:05.000000000 +0100
604 --- src/proto/if_mzsch.pro      2010-01-19 15:29:01.000000000 +0100
605 ***************
606 *** 15,18 ****
607 --- 15,19 ----
608   void *mzvim_eval_string __ARGS((char_u *str));
609   int mzthreads_allowed __ARGS((void));
610   void mzscheme_main __ARGS((void));
611 + void do_mzeval __ARGS((char_u *str, typval_T *rettv));
612   /* vim: set ft=c : */
613 *** ../vim-7.2.335/src/testdir/Make_dos.mak     2009-11-17 17:57:10.000000000 +0100
614 --- src/testdir/Make_dos.mak    2010-01-19 15:43:48.000000000 +0100
615 ***************
616 *** 29,35 ****
617                 test42.out test52.out test65.out test66.out test67.out \
618                 test68.out test69.out
619   
620 ! SCRIPTS32 =   test50.out
621   
622   SCRIPTS_GUI = test16.out
623   
624 --- 29,35 ----
625                 test42.out test52.out test65.out test66.out test67.out \
626                 test68.out test69.out
627   
628 ! SCRIPTS32 =   test50.out test70.out
629   
630   SCRIPTS_GUI = test16.out
631   
632 *** ../vim-7.2.335/src/testdir/Make_ming.mak    2009-11-17 17:57:10.000000000 +0100
633 --- src/testdir/Make_ming.mak   2010-01-19 15:29:01.000000000 +0100
634 ***************
635 *** 48,54 ****
636                 test42.out test52.out test65.out test66.out test67.out \
637                 test68.out test69.out
638   
639 ! SCRIPTS32 =   test50.out
640   
641   SCRIPTS_GUI = test16.out
642   
643 --- 48,54 ----
644                 test42.out test52.out test65.out test66.out test67.out \
645                 test68.out test69.out
646   
647 ! SCRIPTS32 =   test50.out test70.out
648   
649   SCRIPTS_GUI = test16.out
650   
651 ***************
652 *** 78,83 ****
653 --- 78,84 ----
654         -$(DEL) small.vim
655         -$(DEL) tiny.vim
656         -$(DEL) mbyte.vim
657 +       -$(DEL) mzscheme.vim
658         -$(DEL) X*
659         -$(DEL) viminfo
660   
661 *** ../vim-7.2.335/src/testdir/Makefile 2009-11-17 17:40:34.000000000 +0100
662 --- src/testdir/Makefile        2010-01-19 15:29:01.000000000 +0100
663 ***************
664 *** 23,29 ****
665                 test54.out test55.out test56.out test57.out test58.out \
666                 test59.out test60.out test61.out test62.out test63.out \
667                 test64.out test65.out test66.out test67.out test68.out \
668 !               test69.out
669   
670   SCRIPTS_GUI = test16.out
671   
672 --- 23,29 ----
673                 test54.out test55.out test56.out test57.out test58.out \
674                 test59.out test60.out test61.out test62.out test63.out \
675                 test64.out test65.out test66.out test67.out test68.out \
676 !               test69.out test70.out
677   
678   SCRIPTS_GUI = test16.out
679   
680 ***************
681 *** 44,53 ****
682   $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG)
683   
684   clean:
685 !       -rm -rf *.out *.failed *.rej *.orig test.log tiny.vim small.vim mbyte.vim test.ok X* valgrind.pid* viminfo
686   
687   test1.out: test1.in
688 !       -rm -f $*.failed tiny.vim small.vim mbyte.vim test.ok X* viminfo
689         $(VALGRIND) $(VIMPROG) -u unix.vim -U NONE --noplugin -s dotest.in $*.in
690         @/bin/sh -c "if diff test.out $*.ok; \
691                 then mv -f test.out $*.out; \
692 --- 44,53 ----
693   $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG)
694   
695   clean:
696 !       -rm -rf *.out *.failed *.rej *.orig test.log tiny.vim small.vim mbyte.vim mzscheme.vim test.ok X* valgrind.pid* viminfo
697   
698   test1.out: test1.in
699 !       -rm -f $*.failed tiny.vim small.vim mbyte.vim mzscheme.vim test.ok X* viminfo
700         $(VALGRIND) $(VIMPROG) -u unix.vim -U NONE --noplugin -s dotest.in $*.in
701         @/bin/sh -c "if diff test.out $*.ok; \
702                 then mv -f test.out $*.out; \
703 *** ../vim-7.2.335/src/testdir/main.aap 2004-06-13 21:05:31.000000000 +0200
704 --- src/testdir/main.aap        2010-01-19 15:29:01.000000000 +0100
705 ***************
706 *** 32,42 ****
707   $Scripts $ScriptsGUI: $VimProg
708   
709   clean:
710 !       :del {r}{force} *.out test.log tiny.vim small.vim mbyte.vim test.ok X*
711   
712   # test1 is special, it checks for features
713   test1.out: test1.in
714 !       :del {force} test1.failed tiny.vim small.vim mbyte.vim
715         :sys {i} $VimProg -u unix.vim -U NONE --noplugin -s dotest.in test1.in
716         @if os.system("diff test.out test1.ok") != 0:
717                 :error test1 FAILED - Something basic is wrong
718 --- 32,42 ----
719   $Scripts $ScriptsGUI: $VimProg
720   
721   clean:
722 !       :del {r}{force} *.out test.log tiny.vim small.vim mbyte.vim mzscheme.vim test.ok X*
723   
724   # test1 is special, it checks for features
725   test1.out: test1.in
726 !       :del {force} test1.failed tiny.vim small.vim mbyte.vim mzscheme.vim
727         :sys {i} $VimProg -u unix.vim -U NONE --noplugin -s dotest.in test1.in
728         @if os.system("diff test.out test1.ok") != 0:
729                 :error test1 FAILED - Something basic is wrong
730 *** ../vim-7.2.335/src/testdir/test1.in 2004-06-13 20:19:23.000000000 +0200
731 --- src/testdir/test1.in        2010-01-19 15:38:44.000000000 +0100
732 ***************
733 *** 13,18 ****
734 --- 13,19 ----
735   
736   If Vim was not compiled with the +multi_byte feature, the mbyte.vim script will be set like small.vim above.  mbyte.vim is sourced by tests that require the
737   +multi_byte feature.
738 + Similar logic is applied to the +mzscheme feature, using mzscheme.vim.
739   
740   STARTTEST
741   :" Write a single line to test.out to check if testing works at all.
742 ***************
743 *** 25,32 ****
744 --- 26,36 ----
745   w! test.out
746   qa!
747   \e:w! mbyte.vim
748 + :w! mzscheme.vim
749   :" If +multi_byte feature supported, make mbyte.vim empty.
750   :if has("multi_byte") | sp another | w! mbyte.vim | q | endif
751 + :" If +mzscheme feature supported, make mzscheme.vim empty.
752 + :if has("mzscheme") | sp another | w! mzscheme.vim | q | endif
753   :" If +eval feature supported quit here, leaving tiny.vim and small.vim empty.
754   :" Otherwise write small.vim to skip the test.
755   :if 1 | q! | endif
756 *** ../vim-7.2.335/src/testdir/test70.in        2010-01-19 15:47:24.000000000 +0100
757 --- src/testdir/test70.in       2010-01-19 15:29:01.000000000 +0100
758 ***************
759 *** 0 ****
760 --- 1,53 ----
761 + Smoke test for MzScheme interface and mzeval() function
762
763 + STARTTEST
764 + :so mzscheme.vim
765 + :set nocompatible viminfo+=nviminfo
766 + :function! MzRequire()
767 + :redir => l:mzversion
768 + :mz (version)
769 + :redir END
770 + :if strpart(l:mzversion, 1, 1) < "4"
771 + :" MzScheme versions < 4.x:
772 + :mz (require (prefix vim- vimext))
773 + :else
774 + :" newer versions:
775 + :mz (require (prefix-in vim- 'vimext))
776 + :mz (require r5rs)
777 + :endif
778 + :endfunction
779 + :silent call MzRequire()
780 + :mz (define l '("item0" "dictionary with list OK" "item2"))
781 + :mz (define h (make-hash))
782 + :mz (hash-set! h "list" l)
783 + /^1
784 + :" change buffer contents
785 + :mz (vim-set-buff-line (vim-eval "line('.')") "1 changed line 1")
786 + :" scalar test
787 + :let tmp_string = mzeval('"string"')
788 + :let tmp_1000 = mzeval('1000')
789 + :if tmp_string . tmp_1000 == "string1000"
790 + :let scalar_res = "OK"
791 + :else
792 + :let scalar_res = "FAILED"
793 + :endif
794 + :call append(search("^1"), "scalar test " . scalar_res)
795 + :" dictionary containing a list
796 + :let tmp = mzeval("h")["list"][1]
797 + :/^2/put =tmp
798 + :" circular list (at the same time test lists containing lists)
799 + :mz (set-car! (cddr l) l)
800 + :let l2 = mzeval("h")["list"]
801 + :if l2[2] == l2
802 + :let res = "OK"
803 + :else
804 + :let res = "FAILED"
805 + :endif
806 + :call setline(search("^3"), "circular test " . res)
807 + :?^1?,$w! test.out
808 + :qa!
809 + ENDTEST
810
811 + 1 line 1
812 + 2 line 2
813 + 3 line 3
814 *** ../vim-7.2.335/src/testdir/test70.ok        2010-01-19 15:47:24.000000000 +0100
815 --- src/testdir/test70.ok       2010-01-19 15:29:01.000000000 +0100
816 ***************
817 *** 0 ****
818 --- 1,5 ----
819 + 1 changed line 1
820 + scalar test OK
821 + 2 line 2
822 + dictionary with list OK
823 + circular test OK
824 *** ../vim-7.2.335/src/version.c        2010-01-19 15:23:38.000000000 +0100
825 --- src/version.c       2010-01-19 15:46:44.000000000 +0100
826 ***************
827 *** 683,684 ****
828 --- 683,686 ----
829   {   /* Add new patch number below this line */
830 + /**/
831 +     336,
832   /**/
833
834 -- 
835 "Computers in the future may weigh no more than 1.5 tons."
836                                    Popular Mechanics, 1949
837
838  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
839 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
840 \\\        download, build and distribute -- http://www.A-A-P.org        ///
841  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
This page took 0.089149 seconds and 3 git commands to generate.