[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-source-highlight] postscript style for source-hightlight
From: |
Lorenzo Bettini |
Subject: |
Re: [Help-source-highlight] postscript style for source-hightlight |
Date: |
Sun, 25 Mar 2007 10:29:01 +0000 |
User-agent: |
Icedove 1.5.0.9 (X11/20061220) |
Hi
this is my attempt, I attach the new postscript.lang definition
The only modification is this one:
environment string delim "(" ")" multiline nested begin
specialchar = '\\.'
end
and an example of output (by the way, emacs does not highlight it
correctly ;-)
hope to hear from you soon
cheers
Lorenzo
--
Lorenzo Bettini, PhD in Computer Science, DSI, Univ. di Firenze
ICQ# lbetto, 16080134 (GNU/Linux User # 158233)
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com
http://www.gnu.org/software/src-highlite
http://www.gnu.org/software/gengetopt
http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net
# by Dirk Jagdmann, http://cubic.org/~doj
vardef ID = '[[:word:]]+'
variable = '/' + $ID
keyword =
"abs|add|aload|anchorsearch|and|arc|arcn|arct|arcto|array|ashow|astore|atan|awidthshow",
"begin|bind|bitshift|bytesavailable",
"cachestatus|ceiling|charpath|clear|cleartomark|cleardictstack|clip|clippath|closefile|closepath|colorimage|concat|concatmatrix|condition|configurationerror|copy|copypage|cos|count|countdictstack|countexecstack|counttomark|cshow|currentblackgeneration|currentcacheparams|currentcmykcolor|currentcolor|currentcolorrendering|currentcolorscreen|currentcolorspace|currentcolortransfer|currentcontext|currentdash|currentdevparams|currentdict|currentfile|currentflat|currentfont|currentglobal|currentgray|currentgstate|currenthalftone|currenthalftonephase|currenthsbcolor|currentlinecap|currentlinejoin|currentlinewidth|currentmatrix|currentmiterlimit|currentobjectformat|currentpacking|currentpagedevice|currentpoint|currentrgbcolor|currentscreen|currentshared|currentstrokeadjust|currentsystemparams|currenttransfer|currentundercolorremoval|currentuserparams|curveto|cvi|cvlit|cvn|cvr|cvrs|cvs|cvx",
"def|defaultmatrix|definefont|defineresource|defineusername|defineuserobject|deletefile|detach|deviceinfo|dict|dictfull|dictstack|dictstackoverflow|dictstackunderflow|div|dtransform|dup",
"echo|eexec|end|eoclip|eofill|eoviewclip|eq|erasepage|errordict|exch|exec|execform|execstack|execstackoverflow|execuserobject|executeonly|executive|exit|exp",
"false|file|filenameforall|fileposition|fill|filter|findencoding|findfont|findresource|flattenpath|floor|flush|flushfile|FontDirectory|for|forall|fork",
"ge|get|getinterval|globaldict|GlobalFontDirectory|glyphshow|grestore|grestoreall|gsave|gstate|gt",
"handleerror",
"identmatrix|idiv|idtransform|if|ifelse|image|imagemask|index|ineofill|infill|initclip|initgraphics|initmatrix|initviewclip|instroke|internaldict|interrupt|inueofill|inufill|inustroke|invalidaccess|invalidcontext|invalidexit|invalidfileaccess|invalidfont|invalidid|invalidrestore|invertmatrix|ioerror|ISOLatin1Encoding|itransform",
"join",
"kshow|known",
"languagelevel|le|length|limitcheck|lineto|ln|load|lock|log|loop|lt",
"makefont|makepattern|mark|matrix|maxlength|mod|monitor|moveto|mul",
"ne|neg|newpath|noaccess|nocurrentpoint|not|notify|null|nulldevice",
"or",
"packedarray|pathbbox|pathforall|pop|print|printobject|product|prompt|pstack|put|putinterval",
"quit",
"rand|rangecheck|rcurveto|read|readhexstring|readline|readonly|readstring|realtime|rectclip|rectfill|rectstroke|rectviewclip|renamefile|repeat|resetfile|resourceforall|resourcestatus|restore|reversepath|revision|rlineto|rmoveto|roll|rootfont|rotate|round|rrand|run",
"save|scale|scalefont|scheck|search|selectfont|serialnumber|setbbox|setblackgeneration|setcachedevice|setcachedevice2|setcachelimit|setcacheparams|setcharwidth|setcmykcolor|setcolor|setcolorrendering|setcolorscreen|setcolorspace|setcolortransfer|setdash|setdevparams|setfileposition|setflat|setfont|setglobal|setgray|setgstate|sethalftone|sethalftonephase|sethsbcolor|setlinecap|setlinejoin|setlinewidth|setmatrix|setmiterlimit|setobjectformat|setoverprint|setpacking|setpagedevice|setpattern|setrgbcolor|setscreen|setshared|setstrokeadjust|setsystemparams|settransfer|setucacheparams|setundercolorremoval|setuserparams|setvmthreshold|shareddict|show|showpage|sin|sqrt|srand|stack|stackoverflow|stackunderflow|StandardEncoding|start|startjob|status|statusdict|stop|stopped|store|string|stringwidth|stroke|strokepath|sub|syntaxerror|systemdict",
"timeout|transform|translate|true|truncate|type|typecheck|token",
"uappend|ucache|ucachestatus|ueofill|ufill|undef|undefined|undefinedfilename|undefineresource|undefinedresult|undefinefont|undefineresource|undefinedresource|undefineuserobject|unmatchedmark|unregistered|upath|userdict|UserObjects|usertime|ustroke|ustrokepath",
"version|viewclip|viewclippath|VMerror|vmreclaim|vmstatus",
"wait|wcheck|where|widthshow|write|writehexstring|writeobject|writestring|wtranslation",
"xcheck|xor|xshow|xyshow",
"yield|yshow"
variable = $ID
environment string delim "(" ")" multiline nested begin
specialchar = '\\.'
end
comment start "%"
include "number.lang"
symbol = "[","]","=","==","{","}","<<",">>"
%!
% a test for highlighting postscript files
% proc dotest => .
/dotest
{
dup
mark
exch
stopped not % False if error, true if no error.
{ (Allowed access: ) print cleartomark == }
if
clear
}
def
0 0 moveto % So the show commands don't bomb because of nocurrentpoint.
{ [1 2] executeonly aload } dotest
{ (string) executeonly (seek) anchorsearch } dotest
{ (string) (seek) executeonly anchorsearch } dotest
(This is % a string)
{ [1 2] executeonly aload }
(This is a string with \( some escapes \( )
{ [1 2] executeonly aload }
(Strings may contain newlines
and such.)
{ [1 2] executeonly aload }
(Strings may contain special characters *!&}^% and
balanced parentheses ( ) (and so on).)
{ [1 2] executeonly aload }
(The following is an empty string.)
{ [1 2] executeonly aload }
()
{ [1 2] executeonly aload }
(It has 0 (zero) length.)
{ [1 2] executeonly aload }