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 NAA16967; Thu, 10 Apr 2003 13:50:24 +0200 (MET DST) 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 NAA17121 for ; Thu, 10 Apr 2003 13:50:22 +0200 (MET DST) Received: from mx01.nexgo.de ([151.189.8.96]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h3ABoM906396 for ; Thu, 10 Apr 2003 13:50:22 +0200 (MET DST) Received: from lindig.dyndns.org (dialin-145-254-152-226.arcor-ip.net [145.254.152.226]) by mx01.nexgo.de (Postfix) with ESMTP id 48E183C4EF for ; Thu, 10 Apr 2003 13:49:02 +0200 (CEST) Received: by lindig.dyndns.org (Postfix, from userid 1002) id 003EF3DBA; Thu, 10 Apr 2003 09:20:28 +0200 (CEST) Date: Thu, 10 Apr 2003 09:20:28 +0200 From: Christian Lindig To: Caml Mailing List Subject: Re: mixing different languages (was: RE: [Caml-list] dynamic HTML pages) Message-ID: <20030410072028.GA634@eecs.harvard.edu> Mail-Followup-To: Christian Lindig , Caml Mailing List References: <036001c2fdc6$522084d0$0a00a8c0@gateway> <20030409170309.GA30017@ontosoft.com> <20030409172438.GA2596@etria.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20030409172438.GA2596@etria.com> X-No-Archive: yes X-URL: http://www.eecs.harvard.edu/~lindig/ User-Agent: Mutt/1.5.3i X-Spam: no; 0.00; lindig:01 caml-list:01 0400,:01 implemented:01 python:01 noweb:01 chunks:01 foo:01 delimiters:01 runtime:01 syn:01 ocaml:01 jsp:98 vim:01 syntax:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wed, Apr 09, 2003 at 01:24:38PM -0400, Brian Skahan wrote: > Vim has a similar feature, though I don't think its implemented for > ocaml at the moment. It works for mixed php/html, python(psp)/html, > and jsp/html. As an example, find below a Vim syntax file for mixing LaTeX and OCaml in NoWEB documents. The OCaml code shows up inline like in [[List.length]] and in named chunks: <>= let f x = x @ Here, LaTeX is on the outer level, and OCaml code is mixed in. I the context discussed, OCaml probably would be on the outer level. It is easy to exchange either LaTeX or OCaml for a different language or define new delimiters. However, I found that using Perl instead of OCaml did not work for some reason. I am not aware of a general framework for mixing languages in Vim. " syntax file for vim: ts=8 sw=4 et: " " Language: NoWEB " Maintainer: Christian Lindig " Last Change: Mon Feb 3 21:42:55 CET 2003 " Remark: Includes tex, ocaml " " A NoWEB file typically uses LaTeX for markup plus a programming " language. " runtime! syntax/tex.vim unlet b:current_syntax syn include @Noweb syntax/ocaml.vim " or any other language syn region nowebTT start="\[\["hs=s+2 end="\]\]"he=e-2 syn region nowebName start="<<" end=">>" oneline contains=nowebTT syn region nowebCode start="^<<.*>>=" end="^@ *$" contains=nowebName, @Noweb hi def link nowebName String hi def link nowebTT Constant " hi def link nowebCode Special " use, if @Noweb undefined let b:current_syntax="noweb" -- Christian -- Christian Lindig http://www.eecs.harvard.edu/~lindig/ ------------------- 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