Hello Bram,

Bram Moolenaar wrote:
> The plan is to include a new regexp engine in Vim 7.4.  For testing
> I would like to get a lot of files for which we have syntax
> highlighting.  I can then compare the highlighting of these files with
> the old and the new engine to find anything that is not compatible.

Makes sense.

> Please send me a file that exercises most regexp patterns in the syntax
> file.  It doesn't need to be long, but it should be a complex example of
> the language.  Send it as an attachment to avoid the white space being
> messed up by the mail system.

OK, even though it's tough...

> I would prefer one file per syntax, but it must be valid syntax.  If one
> file is problematic (e.g., you can't concatenate small files without
> making it invalid), then a few files would be OK.  A rough goal would be
> 1000 lines.

I made sample files that have valid syntax with the exception of
some extra "*/" in order to demonstrate that the commentError
groups are also matched.

As I am the maintainer of uil.vim and prolog.vim, I have attached
a sample file for both syntax files.

You might want to take into account that I have not been using
any of those two languages since I left university, which I did
almost 10 years ago, plus you might want to take into account
that prolog has several dialects which might have subtle
differences, plus I added some code that demonstrates the
highlightning groups, but doesn't make any sense otherwise: asIs
demonstrates that mistyped operators are not being highlighted as
operators (which is no correct prolog syntax). Something similar
holds true for notaNumber.

For uil, I just invented a small example. It uses correct syntax,
but I didn't provide matching .c and .h files to be able to
compile that - I don't even have a Motif development environment
any more ;)

> IMPORTANT: I will distribute the collection of files, so that others can
> reproduce problems, do performance measurements, etc.  Make sure your
> file has a copyright that permits this.  Don't reveal any secrets,
> patents, trademarks, etc.  A line stating that the Vim license applies
> should be sufficient.

I have just hacked the files together, you can distribute them
together with vim under the same license. I even added this as a
comment at the top of the file. :)

Ciao,
Thomas

-- 
 Thomas Köhler       Email:       [email protected]
     <><             WWW:              http://gott-gehabt.de
                     IRC: tkoehler       Freenode: thkoehler
                     PGP public key available from Homepage!
/* (C) Thomas Koehler
 * distributed under the same license as the vim text editor */
/* a uilComment
 * contains = @Spell
 * contains = uilTodo: TODO
 */
*/

/* keyword uilType: several keywords:

arguments callbacks color
compound_string controls end
exported file include
module object procedure
user_defined xbitmapfile
*/

! another comment, this time single line, can also contain TODO

#include <some/other.uil>
#define SMALL /* we can even have comments here, including commentErrors 
afterwards */ */ 1
#undef SMALL

module link
    names = case_sensitive

procedure
    AbbruchCB;
    SpeedTypeCB;

object
    MainDlg: XmForm 
        {
        arguments
            {
            XmNx = 123;
            XmNy = -123;
            XmNwidth = 123.123;
            XmNheight = .123;
            XmNborderWidth = 1;
            };
        controls
            {
            XmLabel VUITaaaaa;
            XmText ST_Quell;
            XmPushButton VUITaaaag;
            XmFrame 
                {
                arguments
                    {
                    XmNlabelString = 'x'; ! uilCharacter
                    XmNwidth = 25e;
                    XmNheight = 25f;
                    XmNleftAttachment = XmATTACH_FORM;
                    XmNleftOffset = 8ef;
                    XmNtopAttachment = XmATTACH_WIDGET;
                    XmNtopOffset = 6u;
                    XmNtopWidget = XmLabel VUITaaaaa;
                    XmNrightAttachment = XmATTACH_FORM;
                    XmNrightOffset = 6UL;
                    XmNbottomAttachment = XmATTACH_WIDGET;
                    XmNbottomWidget = XmText ST_Quell;
                    };
                controls
                    {
                    XmScrolledList Liste;
                    };
                };
            };
        };
    VUITaaaaa: XmLabel 
        {
        arguments
            {
            XmNlabelString = compound_string("Liste");
            XmNleftAttachment = XmATTACH_FORM;
            XmNleftOffset = 4l;
            XmNtopAttachment = XmATTACH_FORM;
            XmNtopOffset = 7U;
            };
        };
    ST_Quell: XmText 
        {
        arguments
            {
            XmNlabelString = compound_string('String that can contain \123, \x, 
 \' and \\');
            XmNcolumns = 0xDFA;
            XmNleftAttachment = XmATTACH_FORM;
            XmNleftOffset = 8;
            XmNtopAttachment = XmATTACH_NONE;
            XmNy = 364;
            XmNbottomAttachment = XmATTACH_WIDGET;
            XmNbottomWidget = XmPushButton VUITaaaag;
            XmNmaxLength = 5;
            XmNeditable = true;
            XmNeditMode = XmSINGLE_LINE_EDIT;
            XmNwordWrap = true;
            };
        callbacks
            {
            MrmNcreateCallback  = procedure create_callback (0);
            XmNvalueChangedCallback = procedures
                {
                SpeedTypeCB(0);
                };
            };
        };
    VUITaaaag: XmPushButton 
        {
        arguments
            {
            XmNlabelString = compound_string("Abbruch");
            XmNleftAttachment = XmATTACH_NONE;
            XmNtopAttachment = XmATTACH_NONE;
            XmNy = 436;
            XmNbottomAttachment = XmATTACH_FORM;
            XmNx = 416;
            XmNrightAttachment = XmATTACH_FORM;
            XmNrightOffset = 7;
            };
        callbacks
            {
            XmNactivateCallback = procedures
                {
#if 5 > 4
                ExtraCB(0);
#endif
                AbbruchCB(0);
                };
            };
        };
    Liste: XmScrolledList 
        {
        arguments
            {
            XmNlabelString = compound_string("String that contains a uilSpecial 
item \123 and another one \. plus it can contain \" and also \\");
#ifdef SMALL
            XmNwidth = 25;
            XmNheight = 25;
# else
            XmNwidth = 30;
#endif
#ifndef SMALL
            XmNheight = 30;
# endif
            XmNselectionPolicy = XmSINGLE_SELECT;
            };
        };

end module;

/* (C) Thomas Koehler
 * distributed under the same license as the vim text editor */
/* prologCComment
 * is a multiline comment
 */

% prologComment is a single line comment
             % it can also start later in a line

test(1). % this is a fact, which has a prologClauseHeader at the beginning
test(X) --> X > 0, test(X - 1). % a simple rule, with "-->" for deduction

prologClause(X,Y,Z) :- test(X),
                       test(Y), % a multiline prologClause, with highlighted 
prologClauseHead.
                       test(Z).

OK(X). % a simple fact.

/* strings */
prologClause(X) :- OK("prologString, can contain \" and \\"),
                   OK('prologAtom, can contain \' and \\').

/* keywords */
keywords :- module, meta_predicate, multifile, dynamic.

% the keywords in the extrakeywords rule will only be highlighted as keywords 
if the prolog_highlighting_clean variable was not set.
extrakeywords :- abolish, current_output, peek_code, append, current_predicate, 
put_byte, arg, current_prolog_flag, put_char, asserta, fail, put_code, assertz, 
findall, read, at_end_of_stream, float, read_term, atom, flush_output, repeat, 
atom_chars, functor, retract, atom_codes, get_byte, set_input, atom_concat, 
get_char, set_output, atom_length, get_code, set_prolog_flag, atomic, halt, 
set_stream_position, bagof, integer, setof, call, is, stream_property, catch, 
nl, sub_atom, char_code, nonvar, throw, char_conversion, number, true, clause, 
number_chars, unify_with_occurs_check, close, number_codes, var, compound, 
once, write, copy_term, op, write_canonical, current_char_conversion, open, 
write_term, current_input, peek_byte, writeq, current_op, peek_char.

% some more stuff that only matches if prolog_highlighting_clean was not set:
% operators, asIs, prologNumber, specialcharacters, prologQuestion, 
prologCharCode and prologCommentError
operators(X,Y) :- X =\= Y, X =:= Y, X \== Y,
                  X =< Y, X == Y, X >= Y,
                  X \= Y, X \+ Y, X < Y,
                  X > Y, X = Y.

asIs(X,Y) :- X === Y, X \=== Y, X <= Y, X => Y.

prologNumber(X) :- X > 12345678, X >  1.2234, X > 3456456.
notaNumber :- 3124324'.  % '.

specialcharacters(X, Y) :- OK(X) ; OK(Y), !, fail.
specialcharacters(X, Y) --> OK(X).

% the following prologQuestion contains a prologNumber
?-op(5, xfy, ^).

prologCharCode :- 0'\a, 0'a.

/* after this comment, you will find a prologCommentError
*/
*/

Attachment: signature.asc
Description: Digital signature

Raspunde prin e-mail lui