diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-12 23:45:13 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-12 23:45:13 +0000 |
commit | 92a15e15b276458e10aa05016bf472e8c6dd3eb0 (patch) | |
tree | af0343097e5f497167cefa16ed45c03475b98c37 /Master/texmf-dist/tex/context/base/verb-eif.tex | |
parent | df014cf02a62504f6b3e7a4398fb1e093b84f114 (diff) |
context
git-svn-id: svn://tug.org/texlive/trunk@608 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/verb-eif.tex')
-rw-r--r-- | Master/texmf-dist/tex/context/base/verb-eif.tex | 211 |
1 files changed, 211 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/verb-eif.tex b/Master/texmf-dist/tex/context/base/verb-eif.tex new file mode 100644 index 00000000000..16ee611e1e2 --- /dev/null +++ b/Master/texmf-dist/tex/context/base/verb-eif.tex @@ -0,0 +1,211 @@ +%D \module +%D [ file=verb-eif, +%D version=2000.08.23, +%D title=\CONTEXT\ Verbatim Macros, +%D subtitle=Pretty Eiffel Verbatim, +%D author={Berend de Boer \& Hans Hagen}, +%D date=\currentdate, +%D copyright={Berend de Boer \& Hans Hagen}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% This module will be cleaned up a bit in the process of more +% flexible verbatim options. + +\writestatus{loading}{Context Support Macros / Pretty EIFFEL Verbatim} + +%D \startbuffer +%D \startEIFFEL +%D class TEST +%D +%D creation +%D make +%D +%D feature -- creation +%D +%D make is +%D do +%D print ("hello world") +%D end +%D +%D end +%D \stopEIFFEL +%D \stopbuffer +%D +%D +%D If a variable in a comment is quoted with `..', it is typeset +%D as a variable (common Eiffel convention for pretty typesetters): +%D +%D \startbuffer +%D \startEIFFEL +%D class TEST +%D +%D feature +%D +%D say (something: STRING) is +%D -- say `something' to stdout +%D do +%D print (something) +%D end +%D +%D end -- class TEST +%D \stopEIFFEL +%D \stopbuffer +%D +%D +%D Recommended, OOSC2 style setting is: +%D +%D \setuptyping +%D [EIFFEL] +%D [margin=1em,palet=,color=blue,style=\it,icommand=\bf,ccommand=\tf] +%D + +%D We borrow most of the macros from the \PERL\ driver. + +\ifx\undefined\setupprettyPLtype \input verb-pl \relax \fi + +\unprotect + +%D \EIFFEL\ has only the one line comment sequence \type{--}. + +\gdef\EIFsetspecials% + {\PLsetspecials + \setpretty`\#=32 + \setpretty`\{=33 \setpretty`\}=33 + \setpretty`\[=33 \setpretty`\]=33 \setpretty`\(=33 \setpretty`\)=33 + \setpretty`\;=33 \setpretty`\:=33 + \setpretty`\!=33 \setpretty`\?=33 + \setpretty`\==33 \setpretty`\~=33 \setpretty`\<=33 \setpretty`\>=33 + \setpretty`\-=33 \setpretty`\+=33 \setpretty`\/=33 \setpretty`\*=33 + \setpretty`\^=33 + \setpretty`\%=41 \setpretty`\-=45 + \setpretty`\`=81 \setpretty`\'=82 } + +\gdef\EIFsethandlers% + {\PLsethandlers + \installprettyhandler 33 \EIFtypesymbol + \installprettyhandler 45 \EIFtypefourfive + \installprettyhandler 81 \EIFtypeeightone + \installprettyhandler 82 \EIFtypeeighttwo + \installprettyhandler 90 \EIFtypenine } + +\gdef\EIFsetcontrols% + {\PLsetcontrols + \def\flushrestofverbatimline% + {\endPLtypesix + \inPLcommentfalse + \verbatimfont + \PLverbosefalse + \PLverboseskipped=0}} + +\gdef\EIFsetvariables + {\PLsetvariables} + +\gdef\setupprettyEIFtype% + {\def\prettyidentifier{EIF}% + \let\PLidentifiers=\EIFidentifiers + \let\PLvariables=\EIFvariables + \EIFsetvariables + \EIFsetcontrols + \EIFsethandlers + \EIFsetspecials + \PLsetdiagnostics} + +% symbols should appear in roman + +\gdef\EIFtypesymbol#1% + {\endPLtypesix + \ifinPLcomment + \getpretty{#1}% + \else + {\prettynaturalfont\/% + \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty}% + \fi} + +% recognize comments + +\gdef\EIFtypefourfive% + {\handlenextnextpretty\doEIFtypefourfive\PLtypefourtwo} + +\gdef\doEIFtypefourfive#1#2% + {\endPLtypesix + \getprettydata{#2}% + \ifnum\prettytype=45 + \let\next=\dodoEIFtypefourfive + \else + \let\next=\PLtypefourtwo + \fi + \next{#1}#2} + +\gdef\dodoEIFtypefourfive% #1% + {\endPLtypesix + \handlenextnextpretty\dododoEIFtypefourfive\dodododoPLtypefourfive} + +\gdef\dododoEIFtypefourfive% + {\ifnewpretty\expandafter\handlenewpretty\fi\dodododoEIFtypefourfive} + +\gdef\dodododoEIFtypefourfive#1#2% + {\ifinPLcomment + \getpretties{#1}{#2}% + \else + \ifinPLdouble + \getpretties{#1}{#2}% + \else + \global\inPLcommenttrue + \PLverbosecorrection + \def\next{\beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofpretty\prettynaturalfont}% + \expandafter\next + \fi + \fi} + +% recognize `name' in comments and format them like variables + +\gdef\EIFtypeeightone#1% + {\endPLtypesix + \ifinPLcomment + \verbatimfont + \else + \getpretty{#1}% + \fi} + +\gdef\EIFtypeeighttwo#1% + {\endPLtypesix + \ifinPLcomment + \prettynaturalfont + \else + {\prettynaturalfont\/% + \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty}% + \fi} + +% double quote + +\gdef\EIFtypenine#1% + {\endPLtypesix + \ifinPLcomment + \getpretty{#1}% + \else\ifinPLsingle + \getpretty{#1}% + \else\ifinPLdouble + \global\inPLdoublefalse + {\prettynaturalfont\/% + \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty}% + \else + \global\inPLdoubletrue + {\prettynaturalfont + \beginofpretty[\!!prettythree]\getpretty{#1}\endofpretty}% + \fi\fi\fi} + +\useprettyidentifiers \EIFidentifiers \EIFsetspecials + alias all and as check class create creation debug deferred do else + elseif end ensure expanded export external false feature from frozen + if implies indexing infix inherit inspect invariant is like local + loop not obsolete old once or prefix redefine rename require rescue + precursor retry select separate strip then true undefine unique + until variant when xor + +\useprettyidentifiers \EIFvariables \EIFsetspecials + not-yet-defined + +\protect \endinput |