From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id MAA30517; Wed, 30 Oct 2002 12:33:28 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id MAA30918 for ; Wed, 30 Oct 2002 12:33:27 +0100 (MET) Received: from pop9.ucdavis.edu (pop9.ucdavis.edu [169.237.105.19]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g9UBXPD03071 for ; Wed, 30 Oct 2002 12:33:26 +0100 (MET) Received: from beech ([128.120.141.217]) by pop9.ucdavis.edu (8.11.6/8.11.0/IT4.6.2) with ESMTP id g9UBXNt28604 for ; Wed, 30 Oct 2002 03:33:23 -0800 (PST) Received: from ijtrotts by beech with local (Exim 3.36 #1 (Debian)) id 186r7A-00050T-00 for ; Wed, 30 Oct 2002 03:34:24 -0800 Date: Wed, 30 Oct 2002 03:34:24 -0800 From: Issac Trotts To: OCaml Mailing List Subject: Re: [Caml-list] revised syntax vim file Message-ID: <20021030113424.GB19224@beech> References: <20021030104917.GA18771@beech> <20021030112122.GA13090@lordsoth.takhisis.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021030112122.GA13090@lordsoth.takhisis.org> User-Agent: Mutt/1.4i Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, Oct 30, 2002 at 12:21:22PM +0100, Stefano Zacchiroli wrote: > On Wed, Oct 30, 2002 at 02:49:17AM -0800, Issac Trotts wrote: > > Here's a patch to Markus Mottl's > > and Karl-Heinz Sylla's vim syntax file so it will work > > a bit better with the revised syntax. > > Thanks for the patch! > > May I forward your patch to the debian vim maintainer so that it can be > included in the debian vim package? Glad to help. Please forward the patch below instead. There is still the issue of how to make it co-exist with the standard OCaml syntax. Probably searching for the regular expressions ^value do { in a .ml or .mli file would be enough to tell which syntax to use. Is there a convention of having some other suffix for revised syntax filenames? Issac --- ocaml.vim 2002-10-30 02:24:10.000000000 -0800 +++ ocamlrev.vim 2002-10-30 03:18:24.000000000 -0800 @@ -1,14 +1,19 @@ " Vim syntax file -" Language: OCaml +" Language: ocaml revised syntax " Filenames: *.ml *.mli *.mll *.mly " Maintainers: Markus Mottl " Karl-Heinz Sylla +" Revised: Issac Trotts " URL: http://www.ai.univie.ac.at/~markus/vim/syntax/ocaml.vim -" Last Change: 2001 Nov 20 - Fixed small bug with modules (MM) +" Last Change: +" 2002 Oct 30 - Bug fixes (IT) +" 2002 Oct 30 - Small tweaks for revised syntax (IT) +" 2001 Nov 20 - Fixed small bug with modules (MM) " 2001 Sep 01 - Fixed small bug with '\'' (MM) " 2001 Aug 29 - Added rules for scripting directives (MM) " 2001 Aug 28 - Upgraded URL & mail address (MM) " 2001 Apr 26 - upgraded for new Vim version (MM) +" " For version 5.x: Clear all syntax items " For version 6.x: Quit when a syntax file was already loaded @@ -33,9 +38,6 @@ syn match ocamlKeyChar "|" " Errors -syn match ocamlBraceErr "}" -syn match ocamlBrackErr "\]" -syn match ocamlParenErr ")" syn match ocamlArrErr "|]" syn match ocamlCommentErr "\*)" @@ -55,17 +57,15 @@ endif " Some convenient clusters -syn cluster ocamlAllErrs contains=ocamlBraceErr,ocamlBrackErr,ocamlParenErr,ocamlCommentErr,ocamlCountErr,ocamlDoErr,ocamlDoneErr,ocamlEndErr,ocamlThenErr +syn cluster ocamlAllErrs contains=ocamlParenErr,ocamlCommentErr,ocamlCountErr,ocamlDoErr,ocamlDoneErr,ocamlEndErr,ocamlThenErr -syn cluster ocamlAENoParen contains=ocamlBraceErr,ocamlBrackErr,ocamlCommentErr,ocamlCountErr,ocamlDoErr,ocamlDoneErr,ocamlEndErr,ocamlThenErr +syn cluster ocamlAENoParen contains=ocamlCommentErr,ocamlCountErr,ocamlDoErr,ocamlDoneErr,ocamlEndErr,ocamlThenErr syn cluster ocamlContained contains=ocamlTodo,ocamlPreDef,ocamlModParam,ocamlModParam1,ocamlPreMPRestr,ocamlMPRestr,ocamlMPRestr1,ocamlMPRestr2,ocamlMPRestr3,ocamlModRHS,ocamlFuncWith,ocamlFuncStruct,ocamlModTypeRestr,ocamlModTRWith,ocamlWith,ocamlWithRest,ocamlModType,ocamlFullMod " Enclosing delimiters syn region ocamlEncl transparent matchgroup=ocamlKeyword start="(" matchgroup=ocamlKeyword end=")" contains=ALLBUT,@ocamlContained,ocamlParenErr -syn region ocamlEncl transparent matchgroup=ocamlKeyword start="{" matchgroup=ocamlKeyword end="}" contains=ALLBUT,@ocamlContained,ocamlBraceErr -syn region ocamlEncl transparent matchgroup=ocamlKeyword start="\[" matchgroup=ocamlKeyword end="\]" contains=ALLBUT,@ocamlContained,ocamlBrackErr syn region ocamlEncl transparent matchgroup=ocamlKeyword start="\[|" matchgroup=ocamlKeyword end="|\]" contains=ALLBUT,@ocamlContained,ocamlArrErr @@ -79,7 +79,7 @@ " Blocks -syn region ocamlEnd matchgroup=ocamlKeyword start="\" matchgroup=ocamlKeyword end="\" contains=ALLBUT,@ocamlContained,ocamlEndErr +"syn region ocamlEnd matchgroup=ocamlKeyword start="\" matchgroup=ocamlKeyword end="\" contains=ALLBUT,@ocamlContained,ocamlEndErr " "for" @@ -139,20 +139,20 @@ syn keyword ocamlKeyword and as assert class syn keyword ocamlKeyword constraint else -syn keyword ocamlKeyword exception external fun function +syn keyword ocamlKeyword exception external fun syn keyword ocamlKeyword in inherit initializer syn keyword ocamlKeyword land lazy let match syn keyword ocamlKeyword method mutable new of syn keyword ocamlKeyword parser private raise rec syn keyword ocamlKeyword try type -syn keyword ocamlKeyword val virtual when while with +syn keyword ocamlKeyword value virtual when while with syn keyword ocamlType array bool char exn float format int syn keyword ocamlType list option string unit -syn keyword ocamlOperator asr lor lsl lsr lxor mod not or +syn keyword ocamlOperator asr lor lsl lsr lxor mod not -syn keyword ocamlBoolean true false +syn keyword ocamlBoolean True False syn match ocamlConstructor "(\s*)" syn match ocamlConstructor "\[\s*\]" syn match ocamlConstructor "\[|\s*>|]" @@ -177,7 +177,7 @@ syn match ocamlOperator "::" syn match ocamlOperator "<-" syn match ocamlAnyVar "\<_\>" -syn match ocamlKeyChar "!" +" syn match ocamlKeyChar "!" syn match ocamlKeyChar "|[^\]]"me=e-1 syn match ocamlKeyChar ";" syn match ocamlKeyChar "\~" @@ -203,7 +203,7 @@ syn sync match ocamlDoSync grouphere ocamlDo "\" syn sync match ocamlDoSync groupthere ocamlDo "\" -syn sync match ocamlEndSync grouphere ocamlEnd "\<\(begin\|object\)\>" +syn sync match ocamlEndSync grouphere ocamlEnd "\" syn sync match ocamlEndSync groupthere ocamlEnd "\" syn sync match ocamlStructSync grouphere ocamlStruct "\" syn sync match ocamlStructSync groupthere ocamlStruct "\" @@ -221,8 +221,6 @@ command -nargs=+ HiLink hi def link endif - HiLink ocamlBraceErr Error - HiLink ocamlBrackErr Error HiLink ocamlParenErr Error HiLink ocamlArrErr Error @@ -282,3 +280,5 @@ let b:current_syntax = "ocaml" " vim: ts=28 + + ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners