From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/5448 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: prettyprinting Date: Thu, 30 Aug 2001 18:40:27 +0200 Sender: owner-ntg-context@let.uu.nl Message-ID: <5.1.0.14.1.20010830183746.025cd660@server-1> References: <200108301228.OAA13118@sol.cs.uni-dortmund.de> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Trace: main.gmane.org 1035396041 1705 80.91.224.250 (23 Oct 2002 18:00:41 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 18:00:41 +0000 (UTC) Cc: ntg-context@ntg.nl Original-To: Patrick Gundlach In-Reply-To: <200108301228.OAA13118@sol.cs.uni-dortmund.de> Xref: main.gmane.org gmane.comp.tex.context:5448 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:5448 At 02:28 PM 8/30/2001 +0200, Patrick Gundlach wrote: >Hi, > >I have defined (like verb-jv.tex) a new prettyprinting style. >Everything is fine, except for the / character. > > >inst auth+ myauth { // comment > target = /home/users > subject = /noth/ing > action = open(), close() > } > >is an example of the language. I would like to use the / as a >beginning of a single line comment (//) and for a double line >comment (/*...*/) but also in the language but with the same >appearance as the word home and users (second line). But now the >/ appears as a green / and the other words black. >These are the specials I have now. > >\gdef\PONsetspecials% > {\PLsetspecials > \setpretty`\+=62 > \setpretty`\#=32 > \setpretty`\%=41 > \setpretty`\/=43 > \setpretty`\*=44 } maybe you should copy the verb-JV file and take that one as a starting point since it has a different / handler, the following kind of demos what you should do; make sure you use the proper namespace \gdef\PLtypeWHATEVER#1% {\endPLtypesix \xdef\PLprefix{\getpretty{#1}}% \ifinPLcomment \getpretty{#1}% \else\ifinPLsingle \getpretty{#1}% \else\ifinPLdouble \getprettydata{#1}% \ifnum\prettytype=21 \beginofpretty[\!!prettytwo]\getpretty{#1}\endofpretty \else \getpretty{#1}% \fi \else %\beginofpretty[\!!prettytwo] % THIS IS WHERE THE COLOR IS SET THAT YOU DONT WANT \getpretty{#1}% %\endofpretty \fi\fi\fi} \gdef\doPLtypefourtwo#1#2% {\PLverbosefalse \getprettydata{#2}% \ifnum\prettytype=62 \expandafter\PLtypeWHATEVER \else \expandafter\PLtypefourone \fi {#1}#2} part of the complication has to do with the fact that keywords are parser Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com -------------------------------------------------------------------------