Owen Leibman wrote:

> > > > > Porting the current source code (latest stable version vim-
> > 7.4.tar.bz2
> > > > > from vim.org download page) to z/OS, I encountered the following
> > > > > problem:
> > > > > ERROR CCN3052 ./regexp_nfa.c:745   Duplicate case label for value
> > 193.
> > > > Labels must be unique.
> > > >
> > > > That version is already quite old.  The switch statement has
> > changed.
> > > > If you can't use git to get the latest version, you can use a
> > snapshot:
> > > > https://github.com/vim/vim/releases
> > >
> > > I have modified a version freshly downloaded from github; patch
> > attached.
> > 
> > Thanks, that looks good.
> > 
> > > > > There were many other messages for similar errors.
> > > > >
> > > > > The cause is similar to an error reported and fixed in 2010
> > > > (http://comments.gmane.org/gmane.editors.vim.devel/28288),
> > > > > although that problem was in regexp.c, not regexp_nfa.c (which is
> > > > > included from regexp.c).
> > > > >
> > > > > I am attaching a patch which allows the compile to proceed in
> > z/OS.
> > > > > The resulting executable appears to function correctly.
> > > > > I have also tested the patch on an ASCII system, where it builds
> > > > > correctly, and "make test" reports no errors.
> > > >
> > > > The method seems OK, although the list of defines is a bit hard to
> > read.
> > > > Why not use some underscores, and ALT instead of ALTERNATE:
> > > >
> > > >         #define A_ALT_1 0x62
> > > >
> > > > And change the octal numbers to hex, the multi-byte numbers are also
> > in
> > > > hex.
> > >
> > > I have given the defines meaningful names, and changed octal to hex.
> > >
> > > > I'm not sure this code is covered by a test.  Would be good to make
> > one,
> > > > so that we can check it still passes after the change (assuming any
> > > > test passes on this system...).
> > > >
> > > > Hmm, test99 is supposed to cover this, but when I try a change in
> > the
> > > > code it doesn't break.  Ah, it only tests [[=A=]], not the other
> > > > equivalence characters.  So only an error in the EMIT entries is
> > found,
> > > > not a mistake in the case list.
> > > >
> > > > If you want to take the time to look into this, please create a new
> > > > style test, it should be much simpler to write and maintain.
> > > >
> > > >
> > > Test99 failed, as it should, in both EBCDIC and ASCII environments,
> > > when I introduced a typo into the new code.
> > 
> > It only tests with the base character, e.g. "[[-A=]]", not with the
> > other equivalent characters.  Thus it tests that the right characters
> > are matched, but not that they match for each character.  When making a
> > typo in the "case" list that won't be noticed.
> > 
> > You now use the defined name in both the case and the code block that
> > follows, so that's already better.  But it's still possible to omit a
> > case.
> > 
> > > It passes correctly in both environments when the typo is corrected.
> > > I understand why you want a newer test; it is easy to make a trivial
> > > addition to the tests, but it will take a while to come up with
> > > something comprehensive. I will continue to look into that.
> > 
> > Please do.  Otherwise I can write one.
> 
> The attached zip file contains 4 new-style test files:
> 1. test_equivclass_mb_re1.vim - tests multi-byte characters in equivalence 
> classes using regexp engine 1 (re=1)
> 2. test_equivclass_mb_re2.vim - same but with re=2
> 3. test_equivclass_sb_re1.vim - tests single-byte characters (ISO-8859-1 or 
> IBM-1047) re=1
> 4. test_equivclass_sb_re2.vim - same but with re=2

Thanks!

> All 4 tests passed on an ASCII system. Only the last 2 can be run in z/OS.
> Test #3 on z/OS indicated a problem, which turned out to be that O with slash
> (upper- and lower-case) was not included in the EBCDIC portion of regexp.c.
> A patch to fix that (regexp.patch) is also included in the zip file.

Is that patch backwards or do I have it included already?  I'll assume
it is backwards, considering your remark.

> I was not sure how to suppress the multi-byte tests on a single-byte system.
> Old-style tests have an easy way of doing so;
> if there is such a method for new-style tests, it would be useful to include 
> with the mb files above.
> 
> I also was not sure if I was supposed to send a patch for the
> makefiles to run these tests automatically. I have not done so.

I'll include this.  I'll take the opportunity to make a group of latin1
and utf-8 tests.  These run with 'encoding' set to a specific value,
thus they can't be mixed with other tests.

I also notice you need to use assert_true() to check if a regexp does
not match.  That works, but if the test fails you don't get a good
message.  Perhaps we should add assert_nomatch()?  And also
assert_notequal() then.

-- 
hundred-and-one symptoms of being an internet addict:
203. You're an active member of more than 20 newsgroups.

 /// Bram Moolenaar -- [email protected] -- 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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui