From: Stefan.Lucks@uni-weimar.de
Subject: Re: Pretty printing the pretty print.
Date: Mon, 30 Sep 2013 14:20:29 +0200
Date: 2013-09-30T14:20:29+02:00 [thread overview]
Message-ID: <alpine.DEB.2.10.1309301413460.15810@debian> (raw)
In-Reply-To: <jh5A$9EEzrQSFwlw@ada-augusta.demon.co.uk>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 2523 bytes --]
On Wed, 25 Sep 2013, Mike H wrote:
> For the first time ever, I have needed to print some code fragments. The
> default print file command in the GNAT studio produced black and white plain
> text. Is there something that will produce a more "illuminated" output?
If you really need syntax highlighting, rather than reformatting, then
highlight is a really good choice:
<http://www.andre-simon.de/doku/highlight/en/highlight.html>
The minor issue is that the Ada support of highlight is at the Ada 95
level -- since then, a few new keywords have been added, we have got the
precondition-postcondition-type_invariant aspects, ect. I have recently
revised the language definition to handle Ada 2012, see below.
<revised "ada.lang" from highlight>
Description="ADA2012"
Keywords={
{ Id=1,
List={"abort", "else", "new", "return", "abs", "elsif", "not",
"reverse", "abstract", "end", "null", "accept", "entry", "select",
"access", "exception", "", "separate", "", "aliased", "exit", "of", "",
"subtype", "", "all", "or", "", "and", "", "for", "", "others", "tagged",
"", "array", "function", "out", "task", "", "at", "terminate", "generic",
"package", "then", "", "begin", "goto", "pragma", "type", "", "body",
"private", "if", "procedure", "case", "in", "protected", "", "", "until",
"", "constant", "is", "", "use", "raise", "declare", "", "", "range",
"when", "", "delay", "limited", "record", "while", "", "delta", "loop",
"rem", "", "with", "digits", "renames", "do", "mod", "", "requeue", "xor",
"interface", "overriding", "synchronized",
"some"},
},
{ Id=2,
List={"pre", "post", "type_invariant",
"dynamic_predicate", "static_predicate"},
},
{ Id=4,
Regex=[[''']],
},
{ Id=4,
List={"true", "false"},
},
{ Id=4,
Regex=[[ [\w\)]+('\w+) ]],
}
}
-- Workaround: distinguish string delimiters and event markers
-- (same eymbol: ')
--workaround for special string '''
Strings={
Delimiter=[["|']],
Escape = [[ \\[^'] ]]
}
IgnoreCase=true
Comments={
{ Block=false,
Delimiter= { [[\-\-]] },
},
}
Operators=[[\(|\)|\[|\]|\{|\}|\,|\;|\:|\&|\<|\>|\!|\=|\/|\*|\%|\+|\-|\.]]
</revised "ada.lang" from highlight>
------ I love the taste of Cryptanalysis in the morning! ------
<http://www.uni-weimar.de/cms/medien/mediensicherheit/home.html>
--Stefan.Lucks (at) uni-weimar.de, Bauhaus-Universität Weimar, Germany--
prev parent reply other threads:[~2013-09-30 12:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-25 10:36 Pretty printing the pretty print Mike H
2013-09-25 11:14 ` Georg Bauhaus
2013-09-25 14:27 ` Britt
2013-09-25 14:48 ` Mike H
2013-09-25 15:16 ` gautier_niouzes
2013-09-26 4:30 ` Per Sandberg
2013-09-27 13:25 ` Mike H
2014-01-04 11:13 ` Oliver Kleinke
2014-01-06 16:37 ` Mike H
2013-09-29 21:38 ` Stephen Leake
2013-09-25 14:47 ` Felix Krause
2013-09-26 18:38 ` Manuel Gomez
2013-09-30 12:20 ` Stefan.Lucks [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox