|
Karsten Hopp |
252c09 |
To: vim-dev@vim.org
|
|
Karsten Hopp |
252c09 |
Subject: Patch 7.2.336
|
|
Karsten Hopp |
252c09 |
Fcc: outbox
|
|
Karsten Hopp |
252c09 |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
252c09 |
Mime-Version: 1.0
|
|
Karsten Hopp |
252c09 |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
252c09 |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
252c09 |
------------
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
Patch 7.2.336
|
|
Karsten Hopp |
252c09 |
Problem: MzScheme interface can't evaluate an expression.
|
|
Karsten Hopp |
252c09 |
Solution: Add mzeval(). (Sergey Khorev)
|
|
Karsten Hopp |
252c09 |
Files: runtime/doc/eval.txt, runtime/doc/if_mzsch.txt,
|
|
Karsten Hopp |
252c09 |
runtime/doc/usr_41.txt, src/eval.c, src/if_mzsch.c,
|
|
Karsten Hopp |
252c09 |
src/proto/eval.pro, src/proto/if_mzsch.pro,
|
|
Karsten Hopp |
252c09 |
src/testdir/Make_dos.mak, src/testdir/Make_ming.mak,
|
|
Karsten Hopp |
252c09 |
src/testdir/Makefile, src/testdir/main.aap, src/testdir/test1.in,
|
|
Karsten Hopp |
252c09 |
src/testdir/test70.in, src/testdir/test70.ok
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
*** ../vim-7.2.335/runtime/doc/eval.txt 2009-11-17 12:20:30.000000000 +0100
|
|
Karsten Hopp |
252c09 |
--- runtime/doc/eval.txt 2010-01-19 15:30:50.000000000 +0100
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 1815,1825 ****
|
|
Karsten Hopp |
252c09 |
List match and submatches of {pat} in {expr}
|
|
Karsten Hopp |
252c09 |
matchstr( {expr}, {pat}[, {start}[, {count}]])
|
|
Karsten Hopp |
252c09 |
String {count}'th match of {pat} in {expr}
|
|
Karsten Hopp |
252c09 |
! max({list}) Number maximum value of items in {list}
|
|
Karsten Hopp |
252c09 |
! min({list}) Number minimum value of items in {list}
|
|
Karsten Hopp |
252c09 |
! mkdir({name} [, {path} [, {prot}]])
|
|
Karsten Hopp |
252c09 |
Number create directory {name}
|
|
Karsten Hopp |
252c09 |
mode( [expr]) String current editing mode
|
|
Karsten Hopp |
252c09 |
nextnonblank( {lnum}) Number line nr of non-blank line >= {lnum}
|
|
Karsten Hopp |
252c09 |
nr2char( {expr}) String single char with ASCII value {expr}
|
|
Karsten Hopp |
252c09 |
pathshorten( {expr}) String shorten directory names in a path
|
|
Karsten Hopp |
252c09 |
--- 1821,1832 ----
|
|
Karsten Hopp |
252c09 |
List match and submatches of {pat} in {expr}
|
|
Karsten Hopp |
252c09 |
matchstr( {expr}, {pat}[, {start}[, {count}]])
|
|
Karsten Hopp |
252c09 |
String {count}'th match of {pat} in {expr}
|
|
Karsten Hopp |
252c09 |
! max( {list}) Number maximum value of items in {list}
|
|
Karsten Hopp |
252c09 |
! min( {list}) Number minimum value of items in {list}
|
|
Karsten Hopp |
252c09 |
! mkdir( {name} [, {path} [, {prot}]])
|
|
Karsten Hopp |
252c09 |
Number create directory {name}
|
|
Karsten Hopp |
252c09 |
mode( [expr]) String current editing mode
|
|
Karsten Hopp |
252c09 |
+ mzeval( {expr}) any evaluate |MzScheme| expression
|
|
Karsten Hopp |
252c09 |
nextnonblank( {lnum}) Number line nr of non-blank line >= {lnum}
|
|
Karsten Hopp |
252c09 |
nr2char( {expr}) String single char with ASCII value {expr}
|
|
Karsten Hopp |
252c09 |
pathshorten( {expr}) String shorten directory names in a path
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 4090,4095 ****
|
|
Karsten Hopp |
252c09 |
--- 4103,4125 ----
|
|
Karsten Hopp |
252c09 |
"c" or "n".
|
|
Karsten Hopp |
252c09 |
Also see |visualmode()|.
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
+ mzeval({expr}) *mzeval()*
|
|
Karsten Hopp |
252c09 |
+ Evaluate MzScheme expression {expr} and return its result
|
|
Karsten Hopp |
252c09 |
+ convert to Vim data structures.
|
|
Karsten Hopp |
252c09 |
+ Numbers and strings are returned as they are.
|
|
Karsten Hopp |
252c09 |
+ Pairs (including lists and improper lists) and vectors are
|
|
Karsten Hopp |
252c09 |
+ returned as Vim |Lists|.
|
|
Karsten Hopp |
252c09 |
+ Hash tables are represented as Vim |Dictionary| type with keys
|
|
Karsten Hopp |
252c09 |
+ converted to strings.
|
|
Karsten Hopp |
252c09 |
+ All other types are converted to string with display function.
|
|
Karsten Hopp |
252c09 |
+ Examples: >
|
|
Karsten Hopp |
252c09 |
+ :mz (define l (list 1 2 3))
|
|
Karsten Hopp |
252c09 |
+ :mz (define h (make-hash)) (hash-set! h "list" l)
|
|
Karsten Hopp |
252c09 |
+ :echo mzeval("l")
|
|
Karsten Hopp |
252c09 |
+ :echo mzeval("h")
|
|
Karsten Hopp |
252c09 |
+ <
|
|
Karsten Hopp |
252c09 |
+ {only available when compiled with the |+mzscheme| feature}
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
nextnonblank({lnum}) *nextnonblank()*
|
|
Karsten Hopp |
252c09 |
Return the line number of the first line at or below {lnum}
|
|
Karsten Hopp |
252c09 |
that is not blank. Example: >
|
|
Karsten Hopp |
252c09 |
*** ../vim-7.2.335/runtime/doc/if_mzsch.txt 2009-06-24 17:51:01.000000000 +0200
|
|
Karsten Hopp |
252c09 |
--- runtime/doc/if_mzsch.txt 2010-01-19 15:33:00.000000000 +0100
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 1,4 ****
|
|
Karsten Hopp |
252c09 |
! *if_mzsch.txt* For Vim version 7.2. Last change: 2009 Jun 24
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
VIM REFERENCE MANUAL by Sergey Khorev
|
|
Karsten Hopp |
252c09 |
--- 1,4 ----
|
|
Karsten Hopp |
252c09 |
! *if_mzsch.txt* For Vim version 7.2. Last change: 2010 Jan 19
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
VIM REFERENCE MANUAL by Sergey Khorev
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 9,16 ****
|
|
Karsten Hopp |
252c09 |
1. Commands |mzscheme-commands|
|
|
Karsten Hopp |
252c09 |
2. Examples |mzscheme-examples|
|
|
Karsten Hopp |
252c09 |
3. Threads |mzscheme-threads|
|
|
Karsten Hopp |
252c09 |
! 4. The Vim access procedures |mzscheme-vim|
|
|
Karsten Hopp |
252c09 |
! 5. Dynamic loading |mzscheme-dynamic|
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
{Vi does not have any of these commands}
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
--- 9,17 ----
|
|
Karsten Hopp |
252c09 |
1. Commands |mzscheme-commands|
|
|
Karsten Hopp |
252c09 |
2. Examples |mzscheme-examples|
|
|
Karsten Hopp |
252c09 |
3. Threads |mzscheme-threads|
|
|
Karsten Hopp |
252c09 |
! 4. Vim access from MzScheme |mzscheme-vim|
|
|
Karsten Hopp |
252c09 |
! 5. mzeval() Vim function |mzscheme-mzeval|
|
|
Karsten Hopp |
252c09 |
! 6. Dynamic loading |mzscheme-dynamic|
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
{Vi does not have any of these commands}
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 142,148 ****
|
|
Karsten Hopp |
252c09 |
GUI version.
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
==============================================================================
|
|
Karsten Hopp |
252c09 |
! 5. VIM Functions *mzscheme-vim*
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
*mzscheme-vimext*
|
|
Karsten Hopp |
252c09 |
The 'vimext' module provides access to procedures defined in the MzScheme
|
|
Karsten Hopp |
252c09 |
--- 143,149 ----
|
|
Karsten Hopp |
252c09 |
GUI version.
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
==============================================================================
|
|
Karsten Hopp |
252c09 |
! 4. Vim access from MzScheme *mzscheme-vim*
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
*mzscheme-vimext*
|
|
Karsten Hopp |
252c09 |
The 'vimext' module provides access to procedures defined in the MzScheme
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 231,237 ****
|
|
Karsten Hopp |
252c09 |
(set-cursor (line . col) [window]) Set cursor position.
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
==============================================================================
|
|
Karsten Hopp |
252c09 |
! 5. Dynamic loading *mzscheme-dynamic* *E815*
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
On MS-Windows the MzScheme libraries can be loaded dynamically. The |:version|
|
|
Karsten Hopp |
252c09 |
output then includes |+mzscheme/dyn|.
|
|
Karsten Hopp |
252c09 |
--- 232,244 ----
|
|
Karsten Hopp |
252c09 |
(set-cursor (line . col) [window]) Set cursor position.
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
==============================================================================
|
|
Karsten Hopp |
252c09 |
! 5. mzeval() Vim function *mzscheme-mzeval*
|
|
Karsten Hopp |
252c09 |
!
|
|
Karsten Hopp |
252c09 |
! To facilitate bi-directional interface, you can use |mzeval| function to
|
|
Karsten Hopp |
252c09 |
! evaluate MzScheme expressions and pass their values to VimL.
|
|
Karsten Hopp |
252c09 |
!
|
|
Karsten Hopp |
252c09 |
! ==============================================================================
|
|
Karsten Hopp |
252c09 |
! 6. Dynamic loading *mzscheme-dynamic* *E815*
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
On MS-Windows the MzScheme libraries can be loaded dynamically. The |:version|
|
|
Karsten Hopp |
252c09 |
output then includes |+mzscheme/dyn|.
|
|
Karsten Hopp |
252c09 |
*** ../vim-7.2.335/runtime/doc/usr_41.txt 2008-08-09 19:36:54.000000000 +0200
|
|
Karsten Hopp |
252c09 |
--- runtime/doc/usr_41.txt 2010-01-19 15:29:01.000000000 +0100
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 868,873 ****
|
|
Karsten Hopp |
252c09 |
--- 868,875 ----
|
|
Karsten Hopp |
252c09 |
taglist() get list of matching tags
|
|
Karsten Hopp |
252c09 |
tagfiles() get a list of tags files
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
+ mzeval() evaluate |MzScheme| expression
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
==============================================================================
|
|
Karsten Hopp |
252c09 |
*41.7* Defining a function
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
*** ../vim-7.2.335/src/eval.c 2010-01-19 12:46:51.000000000 +0100
|
|
Karsten Hopp |
252c09 |
--- src/eval.c 2010-01-19 15:48:12.000000000 +0100
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 433,439 ****
|
|
Karsten Hopp |
252c09 |
static long list_find_nr __ARGS((list_T *l, long idx, int *errorp));
|
|
Karsten Hopp |
252c09 |
static long list_idx_of_item __ARGS((list_T *l, listitem_T *item));
|
|
Karsten Hopp |
252c09 |
static void list_append __ARGS((list_T *l, listitem_T *item));
|
|
Karsten Hopp |
252c09 |
- static int list_append_tv __ARGS((list_T *l, typval_T *tv));
|
|
Karsten Hopp |
252c09 |
static int list_append_number __ARGS((list_T *l, varnumber_T n));
|
|
Karsten Hopp |
252c09 |
static int list_insert_tv __ARGS((list_T *l, typval_T *tv, listitem_T *item));
|
|
Karsten Hopp |
252c09 |
static int list_extend __ARGS((list_T *l1, list_T *l2, listitem_T *bef));
|
|
Karsten Hopp |
252c09 |
--- 433,438 ----
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 448,459 ****
|
|
Karsten Hopp |
252c09 |
static void set_ref_in_item __ARGS((typval_T *tv, int copyID));
|
|
Karsten Hopp |
252c09 |
static void dict_unref __ARGS((dict_T *d));
|
|
Karsten Hopp |
252c09 |
static void dict_free __ARGS((dict_T *d, int recurse));
|
|
Karsten Hopp |
252c09 |
- static dictitem_T *dictitem_alloc __ARGS((char_u *key));
|
|
Karsten Hopp |
252c09 |
static dictitem_T *dictitem_copy __ARGS((dictitem_T *org));
|
|
Karsten Hopp |
252c09 |
static void dictitem_remove __ARGS((dict_T *dict, dictitem_T *item));
|
|
Karsten Hopp |
252c09 |
- static void dictitem_free __ARGS((dictitem_T *item));
|
|
Karsten Hopp |
252c09 |
static dict_T *dict_copy __ARGS((dict_T *orig, int deep, int copyID));
|
|
Karsten Hopp |
252c09 |
- static int dict_add __ARGS((dict_T *d, dictitem_T *item));
|
|
Karsten Hopp |
252c09 |
static long dict_len __ARGS((dict_T *d));
|
|
Karsten Hopp |
252c09 |
static dictitem_T *dict_find __ARGS((dict_T *d, char_u *key, int len));
|
|
Karsten Hopp |
252c09 |
static char_u *dict2string __ARGS((typval_T *tv, int copyID));
|
|
Karsten Hopp |
252c09 |
--- 447,455 ----
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 628,633 ****
|
|
Karsten Hopp |
252c09 |
--- 624,632 ----
|
|
Karsten Hopp |
252c09 |
static void f_mkdir __ARGS((typval_T *argvars, typval_T *rettv));
|
|
Karsten Hopp |
252c09 |
#endif
|
|
Karsten Hopp |
252c09 |
static void f_mode __ARGS((typval_T *argvars, typval_T *rettv));
|
|
Karsten Hopp |
252c09 |
+ #ifdef FEAT_MZSCHEME
|
|
Karsten Hopp |
252c09 |
+ static void f_mzeval __ARGS((typval_T *argvars, typval_T *rettv));
|
|
Karsten Hopp |
252c09 |
+ #endif
|
|
Karsten Hopp |
252c09 |
static void f_nextnonblank __ARGS((typval_T *argvars, typval_T *rettv));
|
|
Karsten Hopp |
252c09 |
static void f_nr2char __ARGS((typval_T *argvars, typval_T *rettv));
|
|
Karsten Hopp |
252c09 |
static void f_pathshorten __ARGS((typval_T *argvars, typval_T *rettv));
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 764,770 ****
|
|
Karsten Hopp |
252c09 |
static int var_check_ro __ARGS((int flags, char_u *name));
|
|
Karsten Hopp |
252c09 |
static int var_check_fixed __ARGS((int flags, char_u *name));
|
|
Karsten Hopp |
252c09 |
static int tv_check_lock __ARGS((int lock, char_u *name));
|
|
Karsten Hopp |
252c09 |
- static void copy_tv __ARGS((typval_T *from, typval_T *to));
|
|
Karsten Hopp |
252c09 |
static int item_copy __ARGS((typval_T *from, typval_T *to, int deep, int copyID));
|
|
Karsten Hopp |
252c09 |
static char_u *find_option_end __ARGS((char_u **arg, int *opt_flags));
|
|
Karsten Hopp |
252c09 |
static char_u *trans_function_name __ARGS((char_u **pp, int skip, int flags, funcdict_T *fd));
|
|
Karsten Hopp |
252c09 |
--- 763,768 ----
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 6155,6161 ****
|
|
Karsten Hopp |
252c09 |
* Append typval_T "tv" to the end of list "l".
|
|
Karsten Hopp |
252c09 |
* Return FAIL when out of memory.
|
|
Karsten Hopp |
252c09 |
*/
|
|
Karsten Hopp |
252c09 |
! static int
|
|
Karsten Hopp |
252c09 |
list_append_tv(l, tv)
|
|
Karsten Hopp |
252c09 |
list_T *l;
|
|
Karsten Hopp |
252c09 |
typval_T *tv;
|
|
Karsten Hopp |
252c09 |
--- 6153,6159 ----
|
|
Karsten Hopp |
252c09 |
* Append typval_T "tv" to the end of list "l".
|
|
Karsten Hopp |
252c09 |
* Return FAIL when out of memory.
|
|
Karsten Hopp |
252c09 |
*/
|
|
Karsten Hopp |
252c09 |
! int
|
|
Karsten Hopp |
252c09 |
list_append_tv(l, tv)
|
|
Karsten Hopp |
252c09 |
list_T *l;
|
|
Karsten Hopp |
252c09 |
typval_T *tv;
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 6812,6818 ****
|
|
Karsten Hopp |
252c09 |
* Note that the value of the item "di_tv" still needs to be initialized!
|
|
Karsten Hopp |
252c09 |
* Returns NULL when out of memory.
|
|
Karsten Hopp |
252c09 |
*/
|
|
Karsten Hopp |
252c09 |
! static dictitem_T *
|
|
Karsten Hopp |
252c09 |
dictitem_alloc(key)
|
|
Karsten Hopp |
252c09 |
char_u *key;
|
|
Karsten Hopp |
252c09 |
{
|
|
Karsten Hopp |
252c09 |
--- 6810,6816 ----
|
|
Karsten Hopp |
252c09 |
* Note that the value of the item "di_tv" still needs to be initialized!
|
|
Karsten Hopp |
252c09 |
* Returns NULL when out of memory.
|
|
Karsten Hopp |
252c09 |
*/
|
|
Karsten Hopp |
252c09 |
! dictitem_T *
|
|
Karsten Hopp |
252c09 |
dictitem_alloc(key)
|
|
Karsten Hopp |
252c09 |
char_u *key;
|
|
Karsten Hopp |
252c09 |
{
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 6868,6874 ****
|
|
Karsten Hopp |
252c09 |
/*
|
|
Karsten Hopp |
252c09 |
* Free a dict item. Also clears the value.
|
|
Karsten Hopp |
252c09 |
*/
|
|
Karsten Hopp |
252c09 |
! static void
|
|
Karsten Hopp |
252c09 |
dictitem_free(item)
|
|
Karsten Hopp |
252c09 |
dictitem_T *item;
|
|
Karsten Hopp |
252c09 |
{
|
|
Karsten Hopp |
252c09 |
--- 6866,6872 ----
|
|
Karsten Hopp |
252c09 |
/*
|
|
Karsten Hopp |
252c09 |
* Free a dict item. Also clears the value.
|
|
Karsten Hopp |
252c09 |
*/
|
|
Karsten Hopp |
252c09 |
! void
|
|
Karsten Hopp |
252c09 |
dictitem_free(item)
|
|
Karsten Hopp |
252c09 |
dictitem_T *item;
|
|
Karsten Hopp |
252c09 |
{
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 6948,6954 ****
|
|
Karsten Hopp |
252c09 |
* Add item "item" to Dictionary "d".
|
|
Karsten Hopp |
252c09 |
* Returns FAIL when out of memory and when key already existed.
|
|
Karsten Hopp |
252c09 |
*/
|
|
Karsten Hopp |
252c09 |
! static int
|
|
Karsten Hopp |
252c09 |
dict_add(d, item)
|
|
Karsten Hopp |
252c09 |
dict_T *d;
|
|
Karsten Hopp |
252c09 |
dictitem_T *item;
|
|
Karsten Hopp |
252c09 |
--- 6946,6952 ----
|
|
Karsten Hopp |
252c09 |
* Add item "item" to Dictionary "d".
|
|
Karsten Hopp |
252c09 |
* Returns FAIL when out of memory and when key already existed.
|
|
Karsten Hopp |
252c09 |
*/
|
|
Karsten Hopp |
252c09 |
! int
|
|
Karsten Hopp |
252c09 |
dict_add(d, item)
|
|
Karsten Hopp |
252c09 |
dict_T *d;
|
|
Karsten Hopp |
252c09 |
dictitem_T *item;
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 7699,7704 ****
|
|
Karsten Hopp |
252c09 |
--- 7697,7705 ----
|
|
Karsten Hopp |
252c09 |
{"mkdir", 1, 3, f_mkdir},
|
|
Karsten Hopp |
252c09 |
#endif
|
|
Karsten Hopp |
252c09 |
{"mode", 0, 1, f_mode},
|
|
Karsten Hopp |
252c09 |
+ #ifdef FEAT_MZSCHEME
|
|
Karsten Hopp |
252c09 |
+ {"mzeval", 1, 1, f_mzeval},
|
|
Karsten Hopp |
252c09 |
+ #endif
|
|
Karsten Hopp |
252c09 |
{"nextnonblank", 1, 1, f_nextnonblank},
|
|
Karsten Hopp |
252c09 |
{"nr2char", 1, 1, f_nr2char},
|
|
Karsten Hopp |
252c09 |
{"pathshorten", 1, 1, f_pathshorten},
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 13591,13596 ****
|
|
Karsten Hopp |
252c09 |
--- 13592,13614 ----
|
|
Karsten Hopp |
252c09 |
rettv->v_type = VAR_STRING;
|
|
Karsten Hopp |
252c09 |
}
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
+ #ifdef FEAT_MZSCHEME
|
|
Karsten Hopp |
252c09 |
+ /*
|
|
Karsten Hopp |
252c09 |
+ * "mzeval()" function
|
|
Karsten Hopp |
252c09 |
+ */
|
|
Karsten Hopp |
252c09 |
+ static void
|
|
Karsten Hopp |
252c09 |
+ f_mzeval(argvars, rettv)
|
|
Karsten Hopp |
252c09 |
+ typval_T *argvars;
|
|
Karsten Hopp |
252c09 |
+ typval_T *rettv;
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ char_u *str;
|
|
Karsten Hopp |
252c09 |
+ char_u buf[NUMBUFLEN];
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
+ str = get_tv_string_buf(&argvars[0], buf);
|
|
Karsten Hopp |
252c09 |
+ do_mzeval(str, rettv);
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+ #endif
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
/*
|
|
Karsten Hopp |
252c09 |
* "nextnonblank()" function
|
|
Karsten Hopp |
252c09 |
*/
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 19274,19280 ****
|
|
Karsten Hopp |
252c09 |
* It is OK for "from" and "to" to point to the same item. This is used to
|
|
Karsten Hopp |
252c09 |
* make a copy later.
|
|
Karsten Hopp |
252c09 |
*/
|
|
Karsten Hopp |
252c09 |
! static void
|
|
Karsten Hopp |
252c09 |
copy_tv(from, to)
|
|
Karsten Hopp |
252c09 |
typval_T *from;
|
|
Karsten Hopp |
252c09 |
typval_T *to;
|
|
Karsten Hopp |
252c09 |
--- 19292,19298 ----
|
|
Karsten Hopp |
252c09 |
* It is OK for "from" and "to" to point to the same item. This is used to
|
|
Karsten Hopp |
252c09 |
* make a copy later.
|
|
Karsten Hopp |
252c09 |
*/
|
|
Karsten Hopp |
252c09 |
! void
|
|
Karsten Hopp |
252c09 |
copy_tv(from, to)
|
|
Karsten Hopp |
252c09 |
typval_T *from;
|
|
Karsten Hopp |
252c09 |
typval_T *to;
|
|
Karsten Hopp |
252c09 |
*** ../vim-7.2.335/src/if_mzsch.c 2009-12-16 19:02:05.000000000 +0100
|
|
Karsten Hopp |
252c09 |
--- src/if_mzsch.c 2010-01-19 15:43:05.000000000 +0100
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 170,175 ****
|
|
Karsten Hopp |
252c09 |
--- 170,177 ----
|
|
Karsten Hopp |
252c09 |
#ifdef FEAT_EVAL
|
|
Karsten Hopp |
252c09 |
static Scheme_Object *vim_to_mzscheme(typval_T *vim_value, int depth,
|
|
Karsten Hopp |
252c09 |
Scheme_Hash_Table *visited);
|
|
Karsten Hopp |
252c09 |
+ static int mzscheme_to_vim(Scheme_Object *obj, typval_T *tv, int depth,
|
|
Karsten Hopp |
252c09 |
+ Scheme_Hash_Table *visited);
|
|
Karsten Hopp |
252c09 |
#endif
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
#ifdef MZ_PRECISE_GC
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 2733,2738 ****
|
|
Karsten Hopp |
252c09 |
--- 2735,2959 ----
|
|
Karsten Hopp |
252c09 |
MZ_GC_UNREG();
|
|
Karsten Hopp |
252c09 |
return result;
|
|
Karsten Hopp |
252c09 |
}
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
+ static int
|
|
Karsten Hopp |
252c09 |
+ mzscheme_to_vim(Scheme_Object *obj, typval_T *tv, int depth,
|
|
Karsten Hopp |
252c09 |
+ Scheme_Hash_Table *visited)
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ int status = OK;
|
|
Karsten Hopp |
252c09 |
+ typval_T *found;
|
|
Karsten Hopp |
252c09 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
252c09 |
+ if (depth > 100) /* limit the deepest recursion level */
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ tv->v_type = VAR_NUMBER;
|
|
Karsten Hopp |
252c09 |
+ tv->vval.v_number = 0;
|
|
Karsten Hopp |
252c09 |
+ return FAIL;
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
+ found = (typval_T *)scheme_hash_get(visited, obj);
|
|
Karsten Hopp |
252c09 |
+ if (found != NULL)
|
|
Karsten Hopp |
252c09 |
+ copy_tv(found, tv);
|
|
Karsten Hopp |
252c09 |
+ else if (SCHEME_VOIDP(obj))
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ tv->v_type = VAR_NUMBER;
|
|
Karsten Hopp |
252c09 |
+ tv->vval.v_number = 0;
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+ else if (SCHEME_INTP(obj))
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ tv->v_type = VAR_NUMBER;
|
|
Karsten Hopp |
252c09 |
+ tv->vval.v_number = SCHEME_INT_VAL(obj);
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+ else if (SCHEME_BOOLP(obj))
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ tv->v_type = VAR_NUMBER;
|
|
Karsten Hopp |
252c09 |
+ tv->vval.v_number = SCHEME_TRUEP(obj);
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+ # ifdef FEAT_FLOAT
|
|
Karsten Hopp |
252c09 |
+ else if (SCHEME_DBLP(obj))
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ tv->v_type = VAR_FLOAT;
|
|
Karsten Hopp |
252c09 |
+ tv->vval.v_float = SCHEME_DBL_VAL(obj);
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+ # endif
|
|
Karsten Hopp |
252c09 |
+ else if (SCHEME_STRINGP(obj))
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ tv->v_type = VAR_STRING;
|
|
Karsten Hopp |
252c09 |
+ tv->vval.v_string = vim_strsave((char_u *)SCHEME_STR_VAL(obj));
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+ else if (SCHEME_VECTORP(obj) || SCHEME_NULLP(obj)
|
|
Karsten Hopp |
252c09 |
+ || SCHEME_PAIRP(obj) || SCHEME_MUTABLE_PAIRP(obj))
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ list_T *list = list_alloc();
|
|
Karsten Hopp |
252c09 |
+ if (list == NULL)
|
|
Karsten Hopp |
252c09 |
+ status = FAIL;
|
|
Karsten Hopp |
252c09 |
+ else
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ int i;
|
|
Karsten Hopp |
252c09 |
+ Scheme_Object *curr = NULL;
|
|
Karsten Hopp |
252c09 |
+ Scheme_Object *cval = NULL;
|
|
Karsten Hopp |
252c09 |
+ /* temporary var to hold current element of vectors and pairs */
|
|
Karsten Hopp |
252c09 |
+ typval_T *v;
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
+ MZ_GC_DECL_REG(2);
|
|
Karsten Hopp |
252c09 |
+ MZ_GC_VAR_IN_REG(0, curr);
|
|
Karsten Hopp |
252c09 |
+ MZ_GC_VAR_IN_REG(1, cval);
|
|
Karsten Hopp |
252c09 |
+ MZ_GC_REG();
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
+ tv->v_type = VAR_LIST;
|
|
Karsten Hopp |
252c09 |
+ tv->vval.v_list = list;
|
|
Karsten Hopp |
252c09 |
+ ++list->lv_refcount;
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
+ v = (typval_T *)alloc(sizeof(typval_T));
|
|
Karsten Hopp |
252c09 |
+ if (v == NULL)
|
|
Karsten Hopp |
252c09 |
+ status = FAIL;
|
|
Karsten Hopp |
252c09 |
+ else
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ /* add the value in advance to allow handling of self-referencial
|
|
Karsten Hopp |
252c09 |
+ * data structures */
|
|
Karsten Hopp |
252c09 |
+ typval_T *visited_tv = (typval_T *)alloc(sizeof(typval_T));
|
|
Karsten Hopp |
252c09 |
+ copy_tv(tv, visited_tv);
|
|
Karsten Hopp |
252c09 |
+ scheme_hash_set(visited, obj, (Scheme_Object *)visited_tv);
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
+ if (SCHEME_VECTORP(obj))
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ for (i = 0; i < SCHEME_VEC_SIZE(obj); ++i)
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ cval = SCHEME_VEC_ELS(obj)[i];
|
|
Karsten Hopp |
252c09 |
+ status = mzscheme_to_vim(cval, v, depth + 1, visited);
|
|
Karsten Hopp |
252c09 |
+ if (status == FAIL)
|
|
Karsten Hopp |
252c09 |
+ break;
|
|
Karsten Hopp |
252c09 |
+ status = list_append_tv(list, v);
|
|
Karsten Hopp |
252c09 |
+ clear_tv(v);
|
|
Karsten Hopp |
252c09 |
+ if (status == FAIL)
|
|
Karsten Hopp |
252c09 |
+ break;
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+ else if (SCHEME_PAIRP(obj) || SCHEME_MUTABLE_PAIRP(obj))
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ for (curr = obj;
|
|
Karsten Hopp |
252c09 |
+ SCHEME_PAIRP(curr) || SCHEME_MUTABLE_PAIRP(curr);
|
|
Karsten Hopp |
252c09 |
+ curr = SCHEME_CDR(curr))
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ cval = SCHEME_CAR(curr);
|
|
Karsten Hopp |
252c09 |
+ status = mzscheme_to_vim(cval, v, depth + 1, visited);
|
|
Karsten Hopp |
252c09 |
+ if (status == FAIL)
|
|
Karsten Hopp |
252c09 |
+ break;
|
|
Karsten Hopp |
252c09 |
+ status = list_append_tv(list, v);
|
|
Karsten Hopp |
252c09 |
+ clear_tv(v);
|
|
Karsten Hopp |
252c09 |
+ if (status == FAIL)
|
|
Karsten Hopp |
252c09 |
+ break;
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+ /* impoper list not terminated with null
|
|
Karsten Hopp |
252c09 |
+ * need to handle the last element */
|
|
Karsten Hopp |
252c09 |
+ if (status == OK && !SCHEME_NULLP(curr))
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ status = mzscheme_to_vim(cval, v, depth + 1, visited);
|
|
Karsten Hopp |
252c09 |
+ if (status == OK)
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ status = list_append_tv(list, v);
|
|
Karsten Hopp |
252c09 |
+ clear_tv(v);
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+ /* nothing to do for scheme_null */
|
|
Karsten Hopp |
252c09 |
+ vim_free(v);
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+ MZ_GC_UNREG();
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+ else if (SCHEME_HASHTP(obj))
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ int i;
|
|
Karsten Hopp |
252c09 |
+ dict_T *dict;
|
|
Karsten Hopp |
252c09 |
+ Scheme_Object *key = NULL;
|
|
Karsten Hopp |
252c09 |
+ Scheme_Object *val = NULL;
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
+ MZ_GC_DECL_REG(2);
|
|
Karsten Hopp |
252c09 |
+ MZ_GC_VAR_IN_REG(0, key);
|
|
Karsten Hopp |
252c09 |
+ MZ_GC_VAR_IN_REG(1, val);
|
|
Karsten Hopp |
252c09 |
+ MZ_GC_REG();
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
+ dict = dict_alloc();
|
|
Karsten Hopp |
252c09 |
+ if (dict == NULL)
|
|
Karsten Hopp |
252c09 |
+ status = FAIL;
|
|
Karsten Hopp |
252c09 |
+ else
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ typval_T *visited_tv = (typval_T *)alloc(sizeof(typval_T));
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
+ tv->v_type = VAR_DICT;
|
|
Karsten Hopp |
252c09 |
+ tv->vval.v_dict = dict;
|
|
Karsten Hopp |
252c09 |
+ ++dict->dv_refcount;
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
+ copy_tv(tv, visited_tv);
|
|
Karsten Hopp |
252c09 |
+ scheme_hash_set(visited, obj, (Scheme_Object *)visited_tv);
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
+ for (i = 0; i < ((Scheme_Hash_Table *)obj)->size; ++i)
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ if (((Scheme_Hash_Table *) obj)->vals[i] != NULL)
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ /* generate item for `diplay'ed Scheme key */
|
|
Karsten Hopp |
252c09 |
+ dictitem_T *item = dictitem_alloc((char_u *)string_to_line(
|
|
Karsten Hopp |
252c09 |
+ ((Scheme_Hash_Table *) obj)->keys[i]));
|
|
Karsten Hopp |
252c09 |
+ /* convert Scheme val to Vim and add it to the dict */
|
|
Karsten Hopp |
252c09 |
+ if (mzscheme_to_vim(((Scheme_Hash_Table *) obj)->vals[i],
|
|
Karsten Hopp |
252c09 |
+ &item->di_tv, depth + 1, visited) == FAIL
|
|
Karsten Hopp |
252c09 |
+ || dict_add(dict, item) == FAIL)
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ dictitem_free(item);
|
|
Karsten Hopp |
252c09 |
+ status = FAIL;
|
|
Karsten Hopp |
252c09 |
+ break;
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+ MZ_GC_UNREG();
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+ else
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ /* `display' any other value to string */
|
|
Karsten Hopp |
252c09 |
+ tv->v_type = VAR_STRING;
|
|
Karsten Hopp |
252c09 |
+ tv->vval.v_string = (char_u *)string_to_line(obj);
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+ return status;
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
+ void
|
|
Karsten Hopp |
252c09 |
+ do_mzeval(char_u *str, typval_T *rettv)
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ int i;
|
|
Karsten Hopp |
252c09 |
+ Scheme_Object *ret = NULL;
|
|
Karsten Hopp |
252c09 |
+ Scheme_Hash_Table *visited = NULL;
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
+ MZ_GC_DECL_REG(2);
|
|
Karsten Hopp |
252c09 |
+ MZ_GC_VAR_IN_REG(0, ret);
|
|
Karsten Hopp |
252c09 |
+ MZ_GC_VAR_IN_REG(0, visited);
|
|
Karsten Hopp |
252c09 |
+ MZ_GC_REG();
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
+ if (mzscheme_init())
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ MZ_GC_UNREG();
|
|
Karsten Hopp |
252c09 |
+ return;
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
252c09 |
+ visited = scheme_make_hash_table(SCHEME_hash_ptr);
|
|
Karsten Hopp |
252c09 |
+ MZ_GC_CHECK();
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
+ if (eval_with_exn_handling(str, do_eval, &ret) == OK)
|
|
Karsten Hopp |
252c09 |
+ mzscheme_to_vim(ret, rettv, 1, visited);
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
+ for (i = 0; i < visited->size; ++i)
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ /* free up remembered objects */
|
|
Karsten Hopp |
252c09 |
+ if (visited->vals[i] != NULL)
|
|
Karsten Hopp |
252c09 |
+ {
|
|
Karsten Hopp |
252c09 |
+ free_tv((typval_T *)visited->vals[i]);
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
+ MZ_GC_UNREG();
|
|
Karsten Hopp |
252c09 |
+ }
|
|
Karsten Hopp |
252c09 |
#endif
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
/*
|
|
Karsten Hopp |
252c09 |
*** ../vim-7.2.335/src/proto/eval.pro 2009-09-30 15:15:33.000000000 +0200
|
|
Karsten Hopp |
252c09 |
--- src/proto/eval.pro 2010-01-19 15:45:39.000000000 +0100
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 47,56 ****
|
|
Karsten Hopp |
252c09 |
--- 47,60 ----
|
|
Karsten Hopp |
252c09 |
void list_free __ARGS((list_T *l, int recurse));
|
|
Karsten Hopp |
252c09 |
dictitem_T *dict_lookup __ARGS((hashitem_T *hi));
|
|
Karsten Hopp |
252c09 |
char_u *list_find_str __ARGS((list_T *l, long idx));
|
|
Karsten Hopp |
252c09 |
+ int list_append_tv __ARGS((list_T *l, typval_T *tv));
|
|
Karsten Hopp |
252c09 |
int list_append_dict __ARGS((list_T *list, dict_T *dict));
|
|
Karsten Hopp |
252c09 |
int list_append_string __ARGS((list_T *l, char_u *str, int len));
|
|
Karsten Hopp |
252c09 |
int garbage_collect __ARGS((void));
|
|
Karsten Hopp |
252c09 |
dict_T *dict_alloc __ARGS((void));
|
|
Karsten Hopp |
252c09 |
+ dictitem_T *dictitem_alloc __ARGS((char_u *key));
|
|
Karsten Hopp |
252c09 |
+ void dictitem_free __ARGS((dictitem_T *item));
|
|
Karsten Hopp |
252c09 |
+ int dict_add __ARGS((dict_T *d, dictitem_T *item));
|
|
Karsten Hopp |
252c09 |
int dict_add_nr_str __ARGS((dict_T *d, char *key, long nr, char_u *str));
|
|
Karsten Hopp |
252c09 |
char_u *get_dict_string __ARGS((dict_T *d, char_u *key, int save));
|
|
Karsten Hopp |
252c09 |
long get_dict_number __ARGS((dict_T *d, char_u *key));
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 77,82 ****
|
|
Karsten Hopp |
252c09 |
--- 81,87 ----
|
|
Karsten Hopp |
252c09 |
void new_script_vars __ARGS((scid_T id));
|
|
Karsten Hopp |
252c09 |
void init_var_dict __ARGS((dict_T *dict, dictitem_T *dict_var));
|
|
Karsten Hopp |
252c09 |
void vars_clear __ARGS((hashtab_T *ht));
|
|
Karsten Hopp |
252c09 |
+ void copy_tv __ARGS((typval_T *from, typval_T *to));
|
|
Karsten Hopp |
252c09 |
void ex_echo __ARGS((exarg_T *eap));
|
|
Karsten Hopp |
252c09 |
void ex_echohl __ARGS((exarg_T *eap));
|
|
Karsten Hopp |
252c09 |
void ex_execute __ARGS((exarg_T *eap));
|
|
Karsten Hopp |
252c09 |
*** ../vim-7.2.335/src/proto/if_mzsch.pro 2009-12-16 19:02:05.000000000 +0100
|
|
Karsten Hopp |
252c09 |
--- src/proto/if_mzsch.pro 2010-01-19 15:29:01.000000000 +0100
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 15,18 ****
|
|
Karsten Hopp |
252c09 |
--- 15,19 ----
|
|
Karsten Hopp |
252c09 |
void *mzvim_eval_string __ARGS((char_u *str));
|
|
Karsten Hopp |
252c09 |
int mzthreads_allowed __ARGS((void));
|
|
Karsten Hopp |
252c09 |
void mzscheme_main __ARGS((void));
|
|
Karsten Hopp |
252c09 |
+ void do_mzeval __ARGS((char_u *str, typval_T *rettv));
|
|
Karsten Hopp |
252c09 |
/* vim: set ft=c : */
|
|
Karsten Hopp |
252c09 |
*** ../vim-7.2.335/src/testdir/Make_dos.mak 2009-11-17 17:57:10.000000000 +0100
|
|
Karsten Hopp |
252c09 |
--- src/testdir/Make_dos.mak 2010-01-19 15:43:48.000000000 +0100
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 29,35 ****
|
|
Karsten Hopp |
252c09 |
test42.out test52.out test65.out test66.out test67.out \
|
|
Karsten Hopp |
252c09 |
test68.out test69.out
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
! SCRIPTS32 = test50.out
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
SCRIPTS_GUI = test16.out
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
--- 29,35 ----
|
|
Karsten Hopp |
252c09 |
test42.out test52.out test65.out test66.out test67.out \
|
|
Karsten Hopp |
252c09 |
test68.out test69.out
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
! SCRIPTS32 = test50.out test70.out
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
SCRIPTS_GUI = test16.out
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
*** ../vim-7.2.335/src/testdir/Make_ming.mak 2009-11-17 17:57:10.000000000 +0100
|
|
Karsten Hopp |
252c09 |
--- src/testdir/Make_ming.mak 2010-01-19 15:29:01.000000000 +0100
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 48,54 ****
|
|
Karsten Hopp |
252c09 |
test42.out test52.out test65.out test66.out test67.out \
|
|
Karsten Hopp |
252c09 |
test68.out test69.out
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
! SCRIPTS32 = test50.out
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
SCRIPTS_GUI = test16.out
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
--- 48,54 ----
|
|
Karsten Hopp |
252c09 |
test42.out test52.out test65.out test66.out test67.out \
|
|
Karsten Hopp |
252c09 |
test68.out test69.out
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
! SCRIPTS32 = test50.out test70.out
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
SCRIPTS_GUI = test16.out
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 78,83 ****
|
|
Karsten Hopp |
252c09 |
--- 78,84 ----
|
|
Karsten Hopp |
252c09 |
-$(DEL) small.vim
|
|
Karsten Hopp |
252c09 |
-$(DEL) tiny.vim
|
|
Karsten Hopp |
252c09 |
-$(DEL) mbyte.vim
|
|
Karsten Hopp |
252c09 |
+ -$(DEL) mzscheme.vim
|
|
Karsten Hopp |
252c09 |
-$(DEL) X*
|
|
Karsten Hopp |
252c09 |
-$(DEL) viminfo
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
*** ../vim-7.2.335/src/testdir/Makefile 2009-11-17 17:40:34.000000000 +0100
|
|
Karsten Hopp |
252c09 |
--- src/testdir/Makefile 2010-01-19 15:29:01.000000000 +0100
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 23,29 ****
|
|
Karsten Hopp |
252c09 |
test54.out test55.out test56.out test57.out test58.out \
|
|
Karsten Hopp |
252c09 |
test59.out test60.out test61.out test62.out test63.out \
|
|
Karsten Hopp |
252c09 |
test64.out test65.out test66.out test67.out test68.out \
|
|
Karsten Hopp |
252c09 |
! test69.out
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
SCRIPTS_GUI = test16.out
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
--- 23,29 ----
|
|
Karsten Hopp |
252c09 |
test54.out test55.out test56.out test57.out test58.out \
|
|
Karsten Hopp |
252c09 |
test59.out test60.out test61.out test62.out test63.out \
|
|
Karsten Hopp |
252c09 |
test64.out test65.out test66.out test67.out test68.out \
|
|
Karsten Hopp |
252c09 |
! test69.out test70.out
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
SCRIPTS_GUI = test16.out
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 44,53 ****
|
|
Karsten Hopp |
252c09 |
$(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG)
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
clean:
|
|
Karsten Hopp |
252c09 |
! -rm -rf *.out *.failed *.rej *.orig test.log tiny.vim small.vim mbyte.vim test.ok X* valgrind.pid* viminfo
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
test1.out: test1.in
|
|
Karsten Hopp |
252c09 |
! -rm -f $*.failed tiny.vim small.vim mbyte.vim test.ok X* viminfo
|
|
Karsten Hopp |
252c09 |
$(VALGRIND) $(VIMPROG) -u unix.vim -U NONE --noplugin -s dotest.in $*.in
|
|
Karsten Hopp |
252c09 |
@/bin/sh -c "if diff test.out $*.ok; \
|
|
Karsten Hopp |
252c09 |
then mv -f test.out $*.out; \
|
|
Karsten Hopp |
252c09 |
--- 44,53 ----
|
|
Karsten Hopp |
252c09 |
$(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG)
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
clean:
|
|
Karsten Hopp |
252c09 |
! -rm -rf *.out *.failed *.rej *.orig test.log tiny.vim small.vim mbyte.vim mzscheme.vim test.ok X* valgrind.pid* viminfo
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
test1.out: test1.in
|
|
Karsten Hopp |
252c09 |
! -rm -f $*.failed tiny.vim small.vim mbyte.vim mzscheme.vim test.ok X* viminfo
|
|
Karsten Hopp |
252c09 |
$(VALGRIND) $(VIMPROG) -u unix.vim -U NONE --noplugin -s dotest.in $*.in
|
|
Karsten Hopp |
252c09 |
@/bin/sh -c "if diff test.out $*.ok; \
|
|
Karsten Hopp |
252c09 |
then mv -f test.out $*.out; \
|
|
Karsten Hopp |
252c09 |
*** ../vim-7.2.335/src/testdir/main.aap 2004-06-13 21:05:31.000000000 +0200
|
|
Karsten Hopp |
252c09 |
--- src/testdir/main.aap 2010-01-19 15:29:01.000000000 +0100
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 32,42 ****
|
|
Karsten Hopp |
252c09 |
$Scripts $ScriptsGUI: $VimProg
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
clean:
|
|
Karsten Hopp |
252c09 |
! :del {r}{force} *.out test.log tiny.vim small.vim mbyte.vim test.ok X*
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
# test1 is special, it checks for features
|
|
Karsten Hopp |
252c09 |
test1.out: test1.in
|
|
Karsten Hopp |
252c09 |
! :del {force} test1.failed tiny.vim small.vim mbyte.vim
|
|
Karsten Hopp |
252c09 |
:sys {i} $VimProg -u unix.vim -U NONE --noplugin -s dotest.in test1.in
|
|
Karsten Hopp |
252c09 |
@if os.system("diff test.out test1.ok") != 0:
|
|
Karsten Hopp |
252c09 |
:error test1 FAILED - Something basic is wrong
|
|
Karsten Hopp |
252c09 |
--- 32,42 ----
|
|
Karsten Hopp |
252c09 |
$Scripts $ScriptsGUI: $VimProg
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
clean:
|
|
Karsten Hopp |
252c09 |
! :del {r}{force} *.out test.log tiny.vim small.vim mbyte.vim mzscheme.vim test.ok X*
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
# test1 is special, it checks for features
|
|
Karsten Hopp |
252c09 |
test1.out: test1.in
|
|
Karsten Hopp |
252c09 |
! :del {force} test1.failed tiny.vim small.vim mbyte.vim mzscheme.vim
|
|
Karsten Hopp |
252c09 |
:sys {i} $VimProg -u unix.vim -U NONE --noplugin -s dotest.in test1.in
|
|
Karsten Hopp |
252c09 |
@if os.system("diff test.out test1.ok") != 0:
|
|
Karsten Hopp |
252c09 |
:error test1 FAILED - Something basic is wrong
|
|
Karsten Hopp |
252c09 |
*** ../vim-7.2.335/src/testdir/test1.in 2004-06-13 20:19:23.000000000 +0200
|
|
Karsten Hopp |
252c09 |
--- src/testdir/test1.in 2010-01-19 15:38:44.000000000 +0100
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 13,18 ****
|
|
Karsten Hopp |
252c09 |
--- 13,19 ----
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
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
|
|
Karsten Hopp |
252c09 |
+multi_byte feature.
|
|
Karsten Hopp |
252c09 |
+ Similar logic is applied to the +mzscheme feature, using mzscheme.vim.
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
STARTTEST
|
|
Karsten Hopp |
252c09 |
:" Write a single line to test.out to check if testing works at all.
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 25,32 ****
|
|
Karsten Hopp |
252c09 |
--- 26,36 ----
|
|
Karsten Hopp |
252c09 |
w! test.out
|
|
Karsten Hopp |
252c09 |
qa!
|
|
Karsten Hopp |
252c09 |
?:w! mbyte.vim
|
|
Karsten Hopp |
252c09 |
+ :w! mzscheme.vim
|
|
Karsten Hopp |
252c09 |
:" If +multi_byte feature supported, make mbyte.vim empty.
|
|
Karsten Hopp |
252c09 |
:if has("multi_byte") | sp another | w! mbyte.vim | q | endif
|
|
Karsten Hopp |
252c09 |
+ :" If +mzscheme feature supported, make mzscheme.vim empty.
|
|
Karsten Hopp |
252c09 |
+ :if has("mzscheme") | sp another | w! mzscheme.vim | q | endif
|
|
Karsten Hopp |
252c09 |
:" If +eval feature supported quit here, leaving tiny.vim and small.vim empty.
|
|
Karsten Hopp |
252c09 |
:" Otherwise write small.vim to skip the test.
|
|
Karsten Hopp |
252c09 |
:if 1 | q! | endif
|
|
Karsten Hopp |
252c09 |
*** ../vim-7.2.335/src/testdir/test70.in 2010-01-19 15:47:24.000000000 +0100
|
|
Karsten Hopp |
252c09 |
--- src/testdir/test70.in 2010-01-19 15:29:01.000000000 +0100
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 0 ****
|
|
Karsten Hopp |
252c09 |
--- 1,53 ----
|
|
Karsten Hopp |
252c09 |
+ Smoke test for MzScheme interface and mzeval() function
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
+ STARTTEST
|
|
Karsten Hopp |
252c09 |
+ :so mzscheme.vim
|
|
Karsten Hopp |
252c09 |
+ :set nocompatible viminfo+=nviminfo
|
|
Karsten Hopp |
252c09 |
+ :function! MzRequire()
|
|
Karsten Hopp |
252c09 |
+ :redir => l:mzversion
|
|
Karsten Hopp |
252c09 |
+ :mz (version)
|
|
Karsten Hopp |
252c09 |
+ :redir END
|
|
Karsten Hopp |
252c09 |
+ :if strpart(l:mzversion, 1, 1) < "4"
|
|
Karsten Hopp |
252c09 |
+ :" MzScheme versions < 4.x:
|
|
Karsten Hopp |
252c09 |
+ :mz (require (prefix vim- vimext))
|
|
Karsten Hopp |
252c09 |
+ :else
|
|
Karsten Hopp |
252c09 |
+ :" newer versions:
|
|
Karsten Hopp |
252c09 |
+ :mz (require (prefix-in vim- 'vimext))
|
|
Karsten Hopp |
252c09 |
+ :mz (require r5rs)
|
|
Karsten Hopp |
252c09 |
+ :endif
|
|
Karsten Hopp |
252c09 |
+ :endfunction
|
|
Karsten Hopp |
252c09 |
+ :silent call MzRequire()
|
|
Karsten Hopp |
252c09 |
+ :mz (define l '("item0" "dictionary with list OK" "item2"))
|
|
Karsten Hopp |
252c09 |
+ :mz (define h (make-hash))
|
|
Karsten Hopp |
252c09 |
+ :mz (hash-set! h "list" l)
|
|
Karsten Hopp |
252c09 |
+ /^1
|
|
Karsten Hopp |
252c09 |
+ :" change buffer contents
|
|
Karsten Hopp |
252c09 |
+ :mz (vim-set-buff-line (vim-eval "line('.')") "1 changed line 1")
|
|
Karsten Hopp |
252c09 |
+ :" scalar test
|
|
Karsten Hopp |
252c09 |
+ :let tmp_string = mzeval('"string"')
|
|
Karsten Hopp |
252c09 |
+ :let tmp_1000 = mzeval('1000')
|
|
Karsten Hopp |
252c09 |
+ :if tmp_string . tmp_1000 == "string1000"
|
|
Karsten Hopp |
252c09 |
+ :let scalar_res = "OK"
|
|
Karsten Hopp |
252c09 |
+ :else
|
|
Karsten Hopp |
252c09 |
+ :let scalar_res = "FAILED"
|
|
Karsten Hopp |
252c09 |
+ :endif
|
|
Karsten Hopp |
252c09 |
+ :call append(search("^1"), "scalar test " . scalar_res)
|
|
Karsten Hopp |
252c09 |
+ :" dictionary containing a list
|
|
Karsten Hopp |
252c09 |
+ :let tmp = mzeval("h")["list"][1]
|
|
Karsten Hopp |
252c09 |
+ :/^2/put =tmp
|
|
Karsten Hopp |
252c09 |
+ :" circular list (at the same time test lists containing lists)
|
|
Karsten Hopp |
252c09 |
+ :mz (set-car! (cddr l) l)
|
|
Karsten Hopp |
252c09 |
+ :let l2 = mzeval("h")["list"]
|
|
Karsten Hopp |
252c09 |
+ :if l2[2] == l2
|
|
Karsten Hopp |
252c09 |
+ :let res = "OK"
|
|
Karsten Hopp |
252c09 |
+ :else
|
|
Karsten Hopp |
252c09 |
+ :let res = "FAILED"
|
|
Karsten Hopp |
252c09 |
+ :endif
|
|
Karsten Hopp |
252c09 |
+ :call setline(search("^3"), "circular test " . res)
|
|
Karsten Hopp |
252c09 |
+ :?^1?,$w! test.out
|
|
Karsten Hopp |
252c09 |
+ :qa!
|
|
Karsten Hopp |
252c09 |
+ ENDTEST
|
|
Karsten Hopp |
252c09 |
+
|
|
Karsten Hopp |
252c09 |
+ 1 line 1
|
|
Karsten Hopp |
252c09 |
+ 2 line 2
|
|
Karsten Hopp |
252c09 |
+ 3 line 3
|
|
Karsten Hopp |
252c09 |
*** ../vim-7.2.335/src/testdir/test70.ok 2010-01-19 15:47:24.000000000 +0100
|
|
Karsten Hopp |
252c09 |
--- src/testdir/test70.ok 2010-01-19 15:29:01.000000000 +0100
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 0 ****
|
|
Karsten Hopp |
252c09 |
--- 1,5 ----
|
|
Karsten Hopp |
252c09 |
+ 1 changed line 1
|
|
Karsten Hopp |
252c09 |
+ scalar test OK
|
|
Karsten Hopp |
252c09 |
+ 2 line 2
|
|
Karsten Hopp |
252c09 |
+ dictionary with list OK
|
|
Karsten Hopp |
252c09 |
+ circular test OK
|
|
Karsten Hopp |
252c09 |
*** ../vim-7.2.335/src/version.c 2010-01-19 15:23:38.000000000 +0100
|
|
Karsten Hopp |
252c09 |
--- src/version.c 2010-01-19 15:46:44.000000000 +0100
|
|
Karsten Hopp |
252c09 |
***************
|
|
Karsten Hopp |
252c09 |
*** 683,684 ****
|
|
Karsten Hopp |
252c09 |
--- 683,686 ----
|
|
Karsten Hopp |
252c09 |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
252c09 |
+ /**/
|
|
Karsten Hopp |
252c09 |
+ 336,
|
|
Karsten Hopp |
252c09 |
/**/
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
--
|
|
Karsten Hopp |
252c09 |
"Computers in the future may weigh no more than 1.5 tons."
|
|
Karsten Hopp |
252c09 |
Popular Mechanics, 1949
|
|
Karsten Hopp |
252c09 |
|
|
Karsten Hopp |
252c09 |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
252c09 |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
252c09 |
\\\ download, build and distribute -- http://www.A-A-P.org ///
|
|
Karsten Hopp |
252c09 |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|