Rosetta Code:Village Pump/Syntax highlighting: Difference between revisions

no edit summary
No edit summary
 
(73 intermediate revisions by 32 users not shown)
Line 1:
{{Vptopic
Discuss issues related to the Syntax Highlighting system here. The old page got huge, and it became hard to discern what problems were current.
|topic=Syntax Highlighting
|summary=Discuss issues related to the Syntax Highlighting system here. The old page got huge, and it became hard to discern what problems were current.
}}
For a prompt reply, please report [http://rosettacode.org/geshi/ AutoGeSHi] issues at [[Rosetta Code:AutoGeSHi]], not here. —[[User:Underscore|Underscore]] ([[User talk:Underscore|Talk]])
 
 
 
=Recent changes=
== 2011/07/17 - Bug fixing and Snippet fetching==
Because of some trouble with notices in one language file (already found to be Pari/GP) there hase been a language file update which besides the PariGP language also included an update to D and some other changes not yet deployed earlier.
 
Also, with the consent of [[User:Short Circuit|Michael Mol]] I added a small snippet within GeSHi to create an sorted dump of all snippets rendered by GeSHi. This is: All source present here on RC will be dumped in plain text into folders named by the language file they were rendered with. The data gathered within this directory only contains the raw source, not the highlighted data and will be used for a script to auto-detect source languages (The results will hopefully be included in one of the next GeSHi releases). This snippet gathering process will probably run for about a week. The data I collect during this time will be available via GFDL v1.2 to comply with the licensing terms of this Wiki.
 
More details on the results will be available on my blog once I'm done with the language detection/processing of the gathered code samples. I'll drop a note here.
 
--[[User:BenBE|BenBE]] 10:00, 17 July 2011 (UTC)
 
:The snippet fetching has been completed and resulted in about 30k of code snippets in all languages used for highlighting on RosettaCode which are about 100 languages. Most samples are highlighted as text (about 70%), but even then this gives a really nice code base for the project I'm working on. The collection will be available soon under the terms of the GFDL v1.2. More information will be available [http://blog.benny-baumann.de/ in my blog] or on the RosettaCode Planet. :There will be a project related to GeSHi which I'll detail there too.
 
:The snippet fetching has been removed from the RC site again as the purpose for which I added it has ben fulfilled. Stay tuned for updates!
 
:--[[User:BenBE|BenBE]] 22:37, 3 August 2011 (UTC)
 
== 2011/07/05 - GeSHi update to GeSHi 1.0.8.11pre1==
Intermediate update of the GeSHi files to include some new languages. Affected languages should include: Haskell, LDIF, MMIX, PHP, Pig, Spark, Stonescript, UPC. Well, and maybe others. I'm not Sure.
 
== 2010/05/23 - GeSHi update to GeSHi 1.0.8.8==
I just updated GeSHi on the server to the latest released version 1.0.8.8. There are some new languages in this release and quite a bunch of changes to other language files. Please check everything and report here as usual. --[[User:BenBE|BenBE]] 17:12, 23 May 2010 (UTC)
 
== 2010/04/25 ==
Uploaded a language file update for Bash, GDB, Icon/Unicon, MagikSF, Matlab, Oz, Powershell, Q and VIM. The language files for E and Algol68 have not been uploaded/updated yet - due to some issues that need to be fixed beforehand. --[[User:BenBE|BenBE]] 21:39, 25 April 2010 (UTC)
 
== 2010/03/01 ==
Uploaded a language file update for J by Ric that changes some behaviour with the way keywords are handled and fixes a bug with some comments being ignored, although they should get highlighted. --[[User:BenBE|BenBE]] 23:31, 1 March 2010 (UTC)
Line 33 ⟶ 63:
Rosetta Code first started using GeSHi for syntax highlighting a long while back, but due to our nature, we quickly discovered, and frequently continue to discover, programming languages which GeSHi does not provide highlighting functionality. Additionally, we've uncovered bugs in various releases of the software, and the GeSHi folks have been welcoming of fixes sent to them.
 
Due to the way language support is managed in GeSHi, it's fairly trivial for someone who can follow PHP syntax to create a PHP file that adds support for the language of their choice. GeSHi's support for [[Oberon-2]], [[Modula-3]] and [[AutoHotKeyAutoHotkey]] is the direct result of contributions by [[User:MBishopMbishop|MBishopMbishop]] and [[User:Tinku99|Tinku99]]. (If you like a language, and it doesn't appear to have syntax highlighting support, I strongly suggest you follow their lead. ;-) )
 
I am now also part of the GeSHi project focusing for now on adding and improving support for programming languages present on Rosetta Code. As a community of language aficionados and enthusiasts, Rosetta Code is a hotbed for opportunities for improving GeSHi, and improvement of GeSHi is extremely helpful for improving the readability code on Rosetta Code. --[[User:Short Circuit|Short Circuit]] 06:43, 18 June 2009 (UTC)
Line 52 ⟶ 82:
Note: AutoHotKey currently has two codes, ahk and autohotkey. When AutoHotKey support was added to GeSHi, it was added with the longer code. (lang codes are derived from the filename.) Since there were already code snippets on RC that used ahk for AutoHotKey, I created a symlink that allowed ahk to be used as a language code as well. This should likely be reversed, meaning instances of the ahk tag need to be replaced with the autohotkey tag. --[[User:Short Circuit|Short Circuit]] 07:01, 18 June 2009 (UTC)
 
'''The list moved to [[Help:Syntax Highlighting]].'''
==Recommended language tag usage==
<div style="clear: both; column-count: 3; -webkit-column-count:3; -moz-column-count:3">
* 4D 4d
 
A
 
* ALGOL 60 algol60
* ALGOL 68 algol68
* APL apl
* AWK '''awk'''
* ActionScript '''actionscript'''
* Ada '''ada'''
* Agda2 agda2
* AmigaE amigae
* AppleScript '''applescript'''
* Assembly '''asm''' (for x86)
* AutoHotkey '''autohotkey'''
 
B
 
* BASIC '''qbasic''' '''freebasic''' '''thinbasic'''
* Bc bc
* Befunge befunge
* Brainf*** '''bf'''
 
C
 
* C '''c'''
* C# '''csharp'''
* C++ '''cpp'''
* Caml caml
* Clean clean
* Clojure '''lisp'''
* Cobol '''cobol'''
* ColdFusion '''cfm'''
* Common Lisp '''lisp'''
* Component Pascal '''pascal'''
* Coq coq
 
D
 
* D '''d'''
* DOS Batch File '''dos''' '''winbatch'''?
* Dc dc
* Delphi '''delphi'''
 
E
 
* E '''e'''
* EC ec
* ELLA ella
* ESQL '''sql'''
* Eiffel '''eiffel'''
* Emacs Lisp lisp
* Erlang erlang
 
F
 
* F f
* F# '''fsharp'''
* FALSE false
* FP fp
* Factor factor
* Fan fan
* Forth forth
* Fortran '''fortran'''
 
G
 
* GAP gap
* Gnuplot '''gnuplot'''
* Groovy '''groovy'''
 
H
 
* HaXe haxe
* Haskell '''haskell'''
 
I
 
* IDL '''idl'''
* Icon icon
* Io '''io'''
 
J
 
* J '''j'''
* JSON json
* JScript.NET jscript
* Java '''java''' '''java5'''
* JavaScript '''javascript'''
* JoCaml jocaml
* Joy joy
* JudoScript judoscript
 
K
 
* Korn Shell korn
 
L
 
* LSE64 lse64
* LaTeX '''latex'''
* LabVIEW labview
* Lisaac lisaac
* Lisp '''lisp'''
* Logo logo
* Logtalk logtalk
* LotusScript '''lotusscript'''
* Lua '''lua'''
* Lucid lucid
 
M
 
* M4 m4
* MAXScript maxscript
* MIRC Scripting Language '''mirc'''
* MS SQL '''sql'''
* Make '''make'''
* Maple maple
* Mathematica mathematica
* MATLAB '''matlab'''
* Maxima maxima
* Metafont metafont
* Modula-3 '''modula3'''
 
N
 
* NewLISP '''lisp'''
* Nial nial
 
O
 
* OCaml '''ocaml'''
* Oberon-2 '''oberon2'''
* Object Pascal '''pascal'''
* Objective-C '''objc'''
* Octave octave
* Omega omega
* OpenEdge/Progress openedge
* Oz oz
 
P
 
* PHP '''php'''
* PL/I pli
* PL/SQL '''plsql'''
* Pascal '''pascal'''
* Perl '''perl'''
* Perl 6 '''perl6'''
* Pike '''pike'''
* PlainTeX tex
* Pop11 pop11
* PostScript postscript
* PowerShell '''powershell'''
* Prolog '''prolog'''
* Python '''python'''
 
Q
 
* Q q
 
R
 
* R r
* REXX rexx
* RapidQ rapidq
* Raven raven
* Rhope rhope
* Ruby '''ruby'''
 
S
 
* SAS '''sas'''
* SETL setl
* SMEQL smeql
* SNUSP snusp
* SQL '''sql'''
* Scala '''scala'''
* Scheme '''scheme'''
* Script3D script3d
* Seed7 seed7
* Self self
* Slate slate
* Smalltalk '''smalltalk'''
* Standard ML sml
 
T
 
* TI-83 BASIC ti83b
* TI-89 BASIC ti89b
* Tcl '''tcl'''
* Toka toka
* Tr tr
* Transact-SQL '''sql'''
* Twelf twelf
 
U
 
* Unicon '''unicon'''
* UNIX Shell '''bash'''
* UnixPipes '''bash'''
* Unlambda unlambda
 
V
 
* V v
* VBScript vbscript
* Vedit macro language vedit
* Visual Basic '''vb'''
* Visual Basic .NET '''vbnet'''
* Visual Objects visobj
 
W
 
* Wrapl wrapl
 
X
 
* XQuery xquery
* XSLT '''xml'''
* XTalk xtalk
</div>
 
== GeSHi extension self-report ==
Here is a list of the codes currently provided by GeSHi.
<div style="clear: both; column-count: 3; -webkit-column-count:3; -moz-column-count:3">
<lang list></lang>
</div>
 
 
= Non-GeSHi-issues to take care of =
Line 396 ⟶ 197:
: I can <em>probably</em> fix that by changing my "not found" code path when it looks at languages. It's using a PHP character-escaping builtin that's not Unicode-safe, as a brute method of guarding against code injection. --[[User:Short Circuit|Michael Mol]] 23:48, 14 November 2009 (UTC)
:For the record, this bug is now fixed. —[[User:Underscore|Underscore]] ([[User talk:Underscore|Talk]]) 01:25, 2 December 2009 (UTC)
 
= Webform-driven language-file generator =
''(Moved from [[Category talk:J]].)''
 
While we're on the subject, I would be interested in a programmatic approach to generating these files. The structure of the GeSHi language files is very, very simple; It's little more than a PHP-native serialization of a few regex setrings and symbol constants. If GeSHi supported JSON for that structure, it would be trivial to import language highlighting as a JSON file, and such a file would be trivial to generate programmatically. But GeSHi doesn't, so I'm stuck with PHP files until I (or someone else) writes a JSON->PHP conversion. That said, a number of folks have sent me language files, and so are familiar with its structure. Would anyone be interested in writing a webform-driven language-file ''generator''? For security's sake, I can't automate the import of the generated files, but it would greatly open up the process of generating the files, and perhaps make maintenance easier. I'd give it a subdomain such as geshi.rosettacode.org. --[[User:Short Circuit|Michael Mol]] 03:33, 10 November 2009 (UTC)
:Hm, I think I could write a CGI script (in Perl 5) to let folks fill out a form, perhaps with some minimal markup, to create a language definition. With careful use of resource limits and sanitization of the input, we could even let the user test the new definition without a local copy of PHP. But I'm not sure how using such a Web application would actually be easier or quicker than writing the literal definition. I mean, one of the things that makes writing new definitions so easy is that you can use a preexisting definition of a similar language as a starting point. Can you describe in more detail the interface you're imagining? —[[User:Underscore|Underscore]] ([[User talk:Underscore|Talk]]) 13:23, 10 November 2009 (UTC)
:: It's been ages since I've had a chance to look at the structure, but an editable list for each of the list-type members would be good. I don't know what to do about the regex-driven ones; A wizard would be sweet, but I don't know that that would be possible.
:: I could provide a MySQL backend for persistence That would make it plausible to tweak existing support.
:: Not sure how far to go as far as sanitation and execution. The more secure I try make it, the more time I'll need to spend responding to problems. --[[User:Short Circuit|Michael Mol]] 16:09, 10 November 2009 (UTC)
::: How about this: sometime in the near future, I'll write the simplest such program that could possibly be useful. Then I'll take feature requests, or anybody who wants to can submit patches. How does that sound? Could you give me FTP access to geshi.rosettacode.org, or some other way of controlling what appears there? —[[User:Underscore|Underscore]] ([[User talk:Underscore|Talk]]) 23:28, 10 November 2009 (UTC)
:::: Sounds like a plan. I'll send you an email regarding connectivity. --[[User:Short Circuit|Michael Mol]] 00:17, 11 November 2009 (UTC)
: Okay, everyone, a basic implementation is up at http://rosettacode.org/geshi. The source is available upon request. —[[User:Underscore|Underscore]] ([[User talk:Underscore|Talk]]) 23:16, 17 November 2009 (UTC)
:: Here are some notes about the current version:
::* You could add some more instructions for filling the field. For example, what is used as separator character (a space?).
::* The current version only has one keyword group. If you could add at least 2nd keyword group, then it would be easier to add more groups by editing the resulting file.
::Will the form be inserted within a normal wiki page so that there will be navigation links?
::--[[User:PauliKL|PauliKL]] 16:04, 16 December 2009 (UTC)
:::* I figured the program would be easier to use if the user could just deduce the syntax from the example input rather than reading a detailed description of it. For instance, I think that the example provided for COMMENTS_MULTI (<code>/* */, {- -}</code>) is much easier to understand than an explanation like "separate the two delimiters of each pair with whitespace and separate each pair with a comma and optionally some whitespace". Tell me if there's a particular detail that you think could use explicit explanation.
:::* Not a bad idea; I think I'll make that change when I get the opportunity. (I'm using a public computer running Windoze at the moment.)
:::* It appears that MediaWiki blithely ignores <code><form></code>, unfortunately. Are there any particular links you'd like to see on <code>rosettacode.org/geshi</code>? —[[User:Underscore|Underscore]] ([[User talk:Underscore|Talk]]) 17:40, 16 December 2009 (UTC)
:::: If it is not possible to embedd the form into Rosetta Code navigation frame, then maybe just add a link to the main page. And maybe a link to GeSHi site page that describes the format of the syntax file (I once found the page but I have lost the link). --[[User:PauliKL|PauliKL]] 12:23, 23 December 2009 (UTC)
::::: Okay, now, there are a few links at the top of the page, and you can define multiple keyword groups. —[[User:Underscore|Underscore]] ([[User talk:Underscore|Talk]]) 14:57, 23 December 2009 (UTC)
::: For the form to be inserted, it would probably best be done as a Special page MediaWiki extension, which would require the extension to be written in PHP. A couple possibilities come to mind for marshalling from PHP to AutoGeSHi (which is Perl). Probably the best (least work for me, least invasiveness to MediaWiki processes) way would be if AutoGeSHi could export a descriptor of the fields, field types, field labels, form target and method, the extension would build the form, and the Submit button would pass the data back to AutoGeSHi. --[[User:Short Circuit|Michael Mol]] 19:49, 16 December 2009 (UTC)
:::: Actually, AutoGeSHi doesn't produce the form; it only processes the input. rosettacode.org/geshi/index.html is a static HTML document that I hand-wrote. —[[User:Underscore|Underscore]] ([[User talk:Underscore|Talk]]) 20:47, 16 December 2009 (UTC)
Currently there's a language file creation tool under construction for GeSHi itself that will be included in upcoming releases and will offer basic support for writing language files. This tool isn't finished yet though. --[[User:BenBE|BenBE]] 13:58, 6 January 2010 (UTC)
 
= Solved issues =
Line 469 ⟶ 245:
= Known bugs with GeSHi Syntax Highlighting =
 
== OCamlHaskell syntax highlighting issues ==
 
* A syntax highlighting issue with single quotes can be seen here: [[Bitmap/Bézier_curves/Quadratic#Haskell]] and there: [[Conway's_Game_of_Life#Haskell]]
:: Thanks a lot, BenBE, for the corrections! [[User:Blue Prawn|Blue Prawn]] 23:04, 28 February 2010 (UTC)
 
== Unix Shell syntax highlighting issues ==
Here are bugs in the ocaml syntax highlighting
* there is a difference between integer arithmetic and float arithmetic, for exemple:
<blockquote>
<lang ocaml>3 + 4 (* integer addition *)
3.4 +. 1.2 (* float addition *)</lang>
the point that indicates the float operation (<code>+. *. /. -.</code>) is caught as the separator between a module name and a function from that module:
<lang ocaml>value_a +. value_b</lang>
here value_a and value_b should have the same color.
</blockquote>
:* What do you need in particular? Different colors for int and float? --[[User:BenBE|BenBE]] 00:29, 18 February 2010 (UTC)
:: No. The issue is now solved. [[User:Blue Prawn|Blue Prawn]] 23:04, 28 February 2010 (UTC)
 
* a problem with escaped backticks in strings appears here: [[Simple_database#UNIX_Shell]]
* This problem also occurs with fields of structures:
<blockquote>
<lang ocaml>type t = { x:int; y:int } ;;
let v = {x=2; y=3} ;;
print_int (v.x + v.y) ;;</lang>
</blockquote>
:* I disabled OOP Language Handling for OCaml for now. I guess there's some issue in how the magic is done inside the parser that needs to be tweaked ... But otherwise having v.x and v.y marked x and y as methods\fields is desired. --[[User:BenBE|BenBE]] 00:29, 18 February 2010 (UTC)
:: About OOP method are accessed with the character '#' like this "my_obj#my_method param1 param2", but ocaml programmers don't use OO a lot ([[Go_Fish/OCaml]] is the only example on RC). Now if fields are not highlighted I don't feel this as annoying. [[User:Blue Prawn|Blue Prawn]] 23:04, 28 February 2010 (UTC)
 
* there is also something that I consider as an issue, when a function or a constructor follows a module name, these two different entities are colored in the same way, example (from [[Determine_if_Only_One_Instance_is_Running#OCaml|there]]):
<blockquote>
<lang ocaml>Unix.sleep (* function *)
Unix.O_CREAT (* constructor *)
Unix.LargeFile (* a sub-module *)
(ref 3).contents (* the field of a structure *)</lang>
also I don't find it very uniform to colorise elements that follow a module name, and not when the module is opened:
<lang ocaml>open Unix
(* equivalent elements, but here with different colors *)
sleep
O_CREAT
open LargeFile
{ contents = 3 }</lang>
so I think GeSHi should not colorise names after a dot.
This would by the way fix the bug with float operations.
</blockquote>
:* Hard to be done right without contextual parsing (which GeSHi 1.0.X currently doesn't). Should be a bit better with the OOLang handling currently being disabled. --[[User:BenBE|BenBE]] 00:29, 18 February 2010 (UTC)
 
== OCaml syntax highlighting issues, '''bis''' ==
* when one open a module, we can open also open a module inside another module
<blockquote>
<lang ocaml>open Ode
open Ode.LowLevel (* LowLevel is a module inside the module Ode *)</lang>
</blockquote>
:* Need contextual parsing, cf. above. --[[User:BenBE|BenBE]] 00:29, 18 February 2010 (UTC)
 
* there is a problem with strings containing double quotes as we can see here [[JSON#OCaml]]
* Modules that are not part of the standard library are not colorised, ''IMHO'' this is not very uniform and relevant. In editors with ocaml syntax-highlight, all modules are highlighted. (modules from the standard lib have a link to the doc, please keep this feature)
* a similar problem occurs with a double quote inside single quotes (the char '"'): [http://rosettacode.org/mw/index.php?title=S-Expressions&oldid=123055#OCaml S-Expressions#OCaml]
** (identifiers (identifiers to values (often called variables) and identifiers to functions) have the first letter lower case or an underscore)
* the same problem affects Pike, but it doesn't affect Python. <lang ocaml>'"' ocaml</lang><lang pike>'"' pike</lang><lang python>'"' python</lang>
** a name that starts with an upper-case letter is a module name or a constructor (they are capitalised)
<blockquote>
we can make the difference between a module name and a constructor when it's followed by a dot it's a module name (maybe I'm wrong, but I can't find an example of a constructor followed by a dot)
<lang ocaml>Unix.sleep (* module *)
Some "text" (* a constructor *)</lang>
when there is no dot after it but the keyword <code>open</code> before it, it is a module name:
<lang ocaml>open Unix</lang>
we can also open a submodule:
<lang ocaml>open ExtString.String (* both modules ExtString and String should have the same color *)</lang>
there can be any depth:
<lang ocaml>open M1.M2.M3.M4.M5.M6.M7.M8</lang>
we can also recognize a module name if there is the keyword <code>module</code> before it:
<lang ocaml>module Attrib</lang>
in all other cases it is a constructor.
</blockquote>
:* Could be done, but produces quite messy language files and mostly isn't worth the drawbacks. --[[User:BenBE|BenBE]] 00:29, 18 February 2010 (UTC)
 
== OCaml syntax highlighting issues ==
* I think constructors should be highlighted too (with another color than modules), (in editors constructors are highlighted).
(see previous paragraph to see when a capitalised word is a module or a constructor)
:* hmmm, I'd like to keep contextual highlighting as much out of the language file as possible. The 1.1.X developement branch can do contextual highlighting\parsing, but this won't work together with the stable 1.0.X branch this site is using. --[[User:BenBE|BenBE]] 00:29, 18 February 2010 (UTC)
 
* [http://caml.inria.fr/pub/docs/manual-ocaml/libref/index_modules.html Modules from the standard library] are not treated the same, some are highlighted with a link to the doc, and some other are not:
<blockquote>
<lang ocaml>Arg
Arith_status
Array
Array1 (* * *)
Array2 (* * *)
Array3 (* * *)
ArrayLabels
Big_int
Bigarray
Buffer
Callback
CamlinternalLazy (* TODO *)
CamlinternalMod (* TODO *)
CamlinternalOO
Char
Complex
Condition
Dbm
Digest
Dynlink
Event
Filename
Format
Gc
Genarray (* * *)
Genlex
Graphics
GraphicsX11
Hashtbl
Int32
Int64
LargeFile (* !!! *)
Lazy
Lexing
List
ListLabels
Make (* !!! *)
Map
Marshal
MoreLabels
Mutex
Nativeint
Num
Obj
Oo
Parsing
Pervasives
Printexc
Printf
Queue
Random
Scanf
Scanning (* * *)
Scanf
Set
MoreLabels
Sort
Stack
State (* * *)
Random
StdLabels
Str
Stream
String
StringLabels
Sys
Thread
ThreadUnix
Tk
Unix (* TODO *)
UnixLabels (* TODO *)
Weak (* TODO *)</lang>
Those tagged with TODO should be added (in particular Unix in priority), the other could be omited, those with a star are modules inside another module for example Array1, Array2, Array3 and Genarray are inside Bigarray, for a root module named Foo the url is <nowiki>http://caml.inria.fr/pub/docs/manual-ocaml/libref/</nowiki>'''Foo'''.html for a module Bar inside Foo the url is <nowiki>http://caml.inria.fr/pub/docs/manual-ocaml/libref/</nowiki>'''Foo'''.'''Bar'''.html
the tags !!! are for modules which url can not be resolved because for example for the module name LargeFile, there are LargeFile modules inside several root modules in Pervasives, in Unix, and in UnixLabels.
</blockquote>
:* I've added some Modules for now. For the star-ed Modules I'd need to have the Parent Module name or the Doc-Link that I should be generating. As each Group requires some overhead I'd suggest linking only those with at least 2 or 3 Submodules in it (e.g. Array) and simply highlighting (without Link) the others. Could you compile me that list? --[[User:BenBE|BenBE]] 00:29, 18 February 2010 (UTC)
:: Here are the full links of the star'ed modules:
Line 627 ⟶ 270:
Scanning => http://caml.inria.fr/pub/docs/manual-ocaml/libref/Scanf.Scanning.html
State => http://caml.inria.fr/pub/docs/manual-ocaml/libref/Random.State.html
:: [[User:Blue Prawn|Blue Prawn]] 23:04, 28 February 2010 (UTC)
 
 
* not a bug nor an issue, but a suggestion: maybe we could highlight the core OCaml types:
 
<blockquote>
* this type is currently linked to the url [1], which is wrong, the right url is [2]
<lang ocaml>list
<lang ocaml>file_descr
array
[1] http://caml.inria.fr/pub/docs/manual-ocaml/libref/Pervasives.html#TYPEfile_descr
int
[2] http://caml.inria.fr/pub/docs/manual-ocaml/libref/Unix.html#TYPEfile_descr
float (* !!! *)
</lang>
bool
 
char
 
string
* I think that some links could be modified:
unit
<lang ocaml>
int32
int64
nativeint
<fun>
in_channel
out_channel
file_descr
exn</lang>
* I have keep in_channel and out_channel in the list because I think we should use the same color.
* float is a type in contexts where ocaml expects a type and a function in contexts where ocaml expects a function. So we could keep it as a function, or convert it to a type. I'm not sure which is best, but in RC context it seems it is most often the function.</blockquote>
:* Added them, left float as function. Left <fun> alone as this requires some special treatment. --[[User:BenBE|BenBE]] 00:29, 18 February 2010 (UTC)
:: I think that some links could be modified:
file_descr => http://caml.inria.fr/pub/docs/manual-ocaml/libref/Unix.html#TYPEfile_descr
int32 => http://caml.inria.fr/pub/docs/manual-ocaml/libref/Int32.html
int64 => http://caml.inria.fr/pub/docs/manual-ocaml/libref/Int64.html
nativeint => http://caml.inria.fr/pub/docs/manual-ocaml/libref/Nativeint.html
</lang>
:: [[User:Blue Prawn|Blue Prawn]] 23:04, 28 February 2010 (UTC)
 
* not a bug nor an issue, but a suggestion: maybe we could highlight labels (names with a tild before it):
<blockquote><lang ocaml>let my_compare ~left ~right =
(* ... *)</lang>
 
I propose this style (<code>font-weight:bold; color:#339933;</code>):
<span style="font-weight: bold; color: #339933;">~left</span>
</blockquote>
:* Included in the language file, but needs a CSS Addition for class re1 (ocaml only) on RC. --[[User:BenBE|BenBE]] 00:29, 18 February 2010 (UTC)
 
* not a bug nor an issue, but a suggestion: maybe we could highlight polymorphic variants (names with a backtick before it):
<blockquote><lang ocaml>`left (* constructor of a polymorphic variant *)
Left (* constructor of a non-polymorphic variant *)</lang>
''IMHO'' these two kinds of constructors should be highlighted with the same color.
 
I suggest this style (<code>font-weight:bold; color:#993399;</code>):
<span style="font-weight: bold; color: #993399;">Left</span>
<span style="font-weight: bold; color: #993399;">`left</span>
(if the highlight for names following a dot is removed as suggested above, because this is the same color)
</blockquote>
:* Included in language file but needs a CSS Addition for class re2 (ocaml only) on RC. --[[User:BenBE|BenBE]] 00:29, 18 February 2010 (UTC)
 
* This bug is not related to the OCaml syntax (but affects ocaml syntax), GeSHi doesn't handle nested comments (see [[Comments]])
<blockquote><lang ocaml>(* This a comment
(* containing nested comment *)
*)</lang>
just a suggestion, maybe an easy way to handle this would be to match <code>*) ... *)</code>?
</blockquote>
:* Fixed. Now uses recursive regular expressions for comments with fallback for simple string search. --[[User:BenBE|BenBE]] 00:29, 18 February 2010 (UTC)
:: This is very nice, thanks!
:: On the [[Comments]] page we can see other languages that use nested comments, here is the list that I can see:
* Clean
* D with /+ +/
* Haskell
* Mathematica
* Modula-3
* Pop11
* Seed7
* Standard ML
* Ursala
:: Also some that are not nested, but where I can see some bug:
* "perl6", see: [[Comments#Perl_6]]
* There is a bug with phpdoc in PHP: [[Comments#PHP]]
* multiline comments are not handled with Rebol: [[Comments#REBOL]]
:: [[User:Blue Prawn|Blue Prawn]] 23:04, 28 February 2010 (UTC)
 
* The parser brackets ('''[<''' and '''>]''') should be completely highlighted:
Line 708 ⟶ 295:
</blockquote>
:* Tweaked in language file but needs CSS class sy0 to be set for this to show. --[[User:BenBE|BenBE]] 00:29, 18 February 2010 (UTC)
:: Unfortunately this sy0 CSS class is the same than when '''<''' appears alone (the ''lower than'' opperator), and here the '''[''' is CSS'ed in the same way than when it appears alone too. A different class for when they appear un pairs would be better ('''[<''' and '''>]'''). [[User:Blue Prawn|Blue Prawn]] 19:54, 18 August 2011 (UTC)
 
 
 
== Comments highlighting issues ==
 
* On the [[Comments]] page we can see some languages that use nested comments, here is the list that I can see:
-- [[User:Blue Prawn|Blue Prawn]] 21:29, 22 January 2010 (UTC)
** [[Comments#AppleScript]]
** [[Comments#Haskell]]
** [[Comments#Lua]]
** [[Comments#Modula-3]]
** [[Comments#Perl_6]]
** [[Comments#PHP]]
** [[Comments#REBOL]]
** [[Comments#REXX]]
** [[Comments#NetRexx]]
** [[Comments#ooRexx]]
 
==Regression in Tcl Syntax Highlighting==
Line 717 ⟶ 319:
MATLAB has HTML leaking into its links. Take a look at [[Ethiopian_multiplication#MATLAB]] for an example. --[[User:Mwn3d|Mwn3d]] 00:29, 1 April 2010 (UTC)
:Should be fixed locally for GeSHi; pending upload to RC server. --[[User:BenBE|BenBE]] 10:43, 24 April 2010 (UTC)
::k, just applied the GeSHi SVN patches on RC. Should take effect soon. --[[User:BenBE|BenBE]] 21:42, 25 April 2010 (UTC)
 
=ALGOL 68, AutoGeSHi, then wait?=
I ran http://rosettacode.org/geshi/ and it generated a script,: whoalgol68.php-v1.0.8.8.4 dois Inow sendin this script to?1.0.8.9.
<lang php><?php
/*************************************************************************************
Line 726 ⟶ 329:
* Author: Neville Dempsey (NevilleD.sourceforge@sgr-a.net)
* Copyright: (c) 2010 Neville Dempsey (https://sourceforge.net/projects/algol68/files/)
* Release Version: v1.v0.v8.v9
* Date Started: 2010/04/24
*
Line 733 ⟶ 336:
* CHANGES
* -------
* yyyy2010/mm04/dd24 (v1.v0.v8.v8.0)
* - First Release - machine generated by http://rosettacode.org/geshi/
* 2010/05/24 (1.0.8.8.1)
* - #2324 - converted comment detection to RegEx
* 2010/06/16 (1.0.8.8.2)
* - separate symbols from keywords - quick fix
* 2010/06/16 (1.0.8.8.3)
* - reverse length order symbols
* - Add RegEx for BITS and REAL literals (INT to do)
* - recognise LONG and SHORT prefixes to literals
* 2010/07/23 (1.0.8.8.4)
* - fix errors detected by langcheck.php, eg rm tab, fix indenting, rm duplicate keywords, fix symbols as keywords etc
* - removed bulk of local variables from name space.
* - unfolded arrays
*
* TODO (updated yyyy/mm/dd)
* -------------------------
* - Use "Parser Control" to fix KEYWORD parsing, eg: (INT minus one= -1; print(ABSminus one))
*
* - Parse $FORMATS$ more fully - if possible.
* - Pull reserved words from the source of A68G and A68RS
* - Pull stdlib PROC/OP/MODE symbols from the soruce of A68G and A68RS
* - Pull PROC/OP/MODE extensions from the soruce of A68G and A68RS
* - Use RegEx to detect extended precision PROC names, eg 'long long sin' etc
* - Use RegEx to detect white space std PROC names, eg 'new line'
* - Use RegEx to detect white space ext PROC names, eg 'cgs speed of light'
* - Use RegEx to detect BOLD symbols, eg userdefined MODEs and OPs
* - Add REgEx for INT literals - Adding INT breaks formatting...
* - Adding PIPE as a key word breaks formatting of "|" symbols!!
*
*************************************************************************************
Line 759 ⟶ 384:
*
************************************************************************************/
 
function a68_vars(){
$pre='(?<![0-9a-z_\.])';
$post='?(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)';
$post=""; # assuming the RegEx is greedy #
$_="\s*";
$srad="Rr"; $rrad="[".$srad."]"; # either one digit, OR opt-space in digits #
$sbin="0-1"; $rbin="[".$sbin."]"; $_bin=$rbin."(?:[".$sbin."\s]*".$rbin."|)";
$snib="0-3"; $rnib="[".$snib."]"; $_nib=$rnib."(?:[".$snib."\s]*".$rnib."|)";
$soct="0-7"; $roct="[".$soct."]"; $_oct=$roct."(?:[".$soct."\s]*".$roct."|)";
$sdec="0-9"; $rdec="[".$sdec."]"; $_dec=$rdec."(?:[".$sdec."\s]*".$rdec."|)";
$shex="0-9A-Fa-f"; $rhex="[".$shex."]"; $_hex=$rhex."(?:[".$shex."\s]*".$rhex."|)";
# Define BITS: #
$prebits=$pre; $postbits=$post;
$bl="2".$_.$rrad.$_.$_bin;
$bl=$bl."|"."2".$_.$rrad.$_.$_bin;
$bl=$bl."|"."4".$_.$rrad.$_.$_nib;
$bl=$bl."|"."8".$_.$rrad.$_.$_oct;
$bl=$bl."|"."1".$_."0".$_.$rrad.$_.$_dec;
$bl=$bl."|"."1".$_."6".$_.$rrad.$_.$_hex;
# Define INT: #
$preint=$pre; $postint=$post;
# for some reason ".0 e - 2" is not recognised, but ".0 e + 2" IS!
# work around: remove spaces between sign and digits! Maybe because
# of the Unary '-' Operator
$sign_="(?:-|\-|[-]|[\-]|\+|)"; # attempts #
$sign_="(?:-\s*|\+\s*|)"; # n.b. sign is followed by white space #
$_int=$sign_.$_dec;
$il= $_int; # +_9 #
$GESHI_NUMBER_INT_BASIC='(?:(?<![0-9a-z_\.%])|(?<=\.\.))(?<![\d\.]e[+\-])([1-9]\d*?|0)(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)';
# Define REAL: #
$prereal=$pre; $postreal=$post;
$sexp="Ee\\\\"; $_exp="(?:⏨|[".$sexp."])".$_.$_int;
$_decimal="[.]".$_.$_dec;
# Add permitted permutations of various parts #
$rl= $_int.$_.$_decimal.$_.$_exp; # +_9_._9_e_+_9 #
$rl=$rl."|".$_int.$_."[.]".$_.$_exp; # +_9_.___e_+_9 #
$rl=$rl."|".$_int.$_.$_exp; # +_9_____e_+_9 #
$rl=$rl."|".$sign_.$_decimal.$_.$_exp; # +___._9_e_+_9 #
$rl=$rl."|".$_int.$_.$_decimal; # +_9_._9 #
$rl=$rl."|".$sign_.$_decimal; # +___._9 #
# The following line damaged formatting...
#$rl=$rl."|".$_int; # +_9 #
# Apparently Algol68 does not support '2.', c.f. Algol 68G
#$rl=$rl."|".$_int.$_."[.]"; # +_9_. #
# Literal prefixes are overridden by KEYWORDS :-(
$LONGS="(?:(?:(LONG\s+)*|(SHORT\s+))*|)";
return array(
"BITS" => $prebits.$LONGS."(?:".$bl.")".$postbits,
"INT" => $preint.$LONGS."(?:".$il.")".$postint,
"REAL" => $prereal.$LONGS."(?:".$rl.")".$postreal,
"BOLD" => 'color: #b1b100; font-weight: bold;',
"ITALIC" => 'color: #b1b100;', # procedures traditionally italic #
"NONSTD" => 'color: #FF0000; font-weight: bold;', # RED #
"COMMENT" => 'color: #666666; font-style: italic;'
);
}
$a68=a68_vars();
 
$language_data = array(
'LANG_NAME' => 'ALGOL 68',
'COMMENT_SINGLE' => array(),
'COMMENT_MULTI' => array(
'COMMENT_MULTI' => array('#' => '#', 'CO' => 'CO', 'COMMENT' => 'COMMENT', '¢' => '¢', '£' => '£', 'PR' => 'PR', 'PRAGMAT' => 'PRAGMAT', 'QUOTE' => 'QUOTE'),
'¢' => '¢',
'£' => '£',
'#' => '#',
),
'COMMENT_REGEXP' => array(
1 => '/\bCO((?:MMENT)?)\b.*?\bCO\\1\b/i',
2 => '/\bPR((?:AGMAT)?)\b.*?\bPR\\1\b/i',
3 => '/\bQUOTE\b.*?\bQUOTE\b/i'
),
'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
'QUOTEMARKS' => array('"'),
'ESCAPE_CHAR' => '""',
'NUMBERS' => GESHI_NUMBER_HEX_SUFFIX, # Warning: Feature!! #
'KEYWORDS' => array(1 => array('KEEP', 'FINISH', 'USE', 'SYSPROCS', 'IOSTATE', 'USING', 'ENVIRON'),
# GESHI_NUMBER_HEX_SUFFIX, # Attempt ignore default #
2 => array('CASE', 'IN', 'OUSE', 'IN', 'OUT', 'ESAC', '(', '|', '|:', ')', 'FOR', 'FROM', 'TO', 'BY', 'WHILE', 'DO', 'OD', 'IF', 'THEN', 'ELIF', 'THEN', 'ELSE', 'FI', 'PAR', 'BEGIN', 'EXIT', 'END', 'GO', 'GOTO', 'FORALL', 'UPTO', 'DOWNTO', 'FOREACH', 'ASSERT'),
'KEYWORDS' => array(
3 => array('BITS', 'BOOL', 'BYTES', 'CHAR', 'COMPL', 'INT', 'REAL', 'SEMA', 'STRING', 'VOID', 'COMPLEX', 'VECTOR'),
# Extensions
4 => array('MODE', 'OP', 'PRIO', 'PROC'),
51 => array('FLEXKEEP', 'HEAPFINISH', 'LOCUSE', 'LONGSYSPROCS', 'REFIOSTATE', 'SHORTUSING', 'EITHERENVIRON', 'PROGRAM', 'CONTEXT'),
# 2 => array('CASE', 'IN', 'OUSE', 'IN', 'OUT', 'ESAC', '(', '|', '|:', ')', 'FOR', 'FROM', 'TO', 'BY', 'WHILE', 'DO', 'OD', 'IF', 'THEN', 'ELIF', 'THEN', 'ELSE', 'FI', 'PAR', 'BEGIN', 'EXIT', 'END', 'GO', 'GOTO', 'FORALL', 'UPTO', 'DOWNTO', 'FOREACH', 'ASSERT'), #
6 => array('CHANNEL', 'FILE', 'FORMAT', 'STRUCT', 'UNION'),
2 => array('CASE', 'IN', 'OUSE', /* 'IN',*/ 7 => array('OFOUT', 'ESAC', 'ATPAR', '@BEGIN', 'ISEXIT', ':=:END', 'ISNTGO TO', ':/=:GOTO', ':≠:FOR', 'CTBFROM', 'CTTO', '::BY', 'CTABWHILE', '::=DO', 'TRUEOD', 'FALSEIF', 'EMPTYTHEN', 'NILELIF', /* 'THEN',*/ 'SKIPELSE', '~FI' ),
83 => array('NOTBITS', 'UPBOOL', 'DOWNBYTES', 'LWBCHAR', 'UPBCOMPL', '-INT', 'ABSREAL', 'ARGSEMA', 'BINSTRING', 'ENTIER', 'LENG', 'LEVEL', 'ODD', 'REPR', 'ROUND', 'SHORTEN', 'CONJ', 'SIGNVOID'),
94 => array('¬MODE', 'OP', 'PRIO', 'PROC', 'FLEX', '~HEAP', 'LOC', 'REF', 'LONG', 'SHORT'), 'EITHER'),
# Extensions or deprecated keywords
10 => array('+*', 'I', '+×', '⊥', '!', '⏨'),
# 'PIPE': keyword somehow interferes with the internal operation of GeSHi
11 => array('SHL', 'SHR', '**', 'UP', 'DOWN', 'LWB', 'UPB', '↑', '↓', '⌊', '⌈', '⎩', '⎧')
5 => array('FORALL', 'UPTO', 'DOWNTO', 'FOREACH', 'ASSERT', 'CTB', 'CT', 'CTAB', 'COMPLEX', 'VECTOR', 'SOUND' /*, 'PIPE'*/),
 
126 => array('*CHANNEL', '/FILE', '%FORMAT', 'OVERSTRUCT', '%*UNION', 'MOD', 'ELEM', '×', '÷', '÷×', '÷*', '%×', '□', '÷:OF'),
# '(', '|', '|:', ')', #
13 => array('-', '+'),
# 7 => array('OF', 'AT', '@', 'IS', ':=:', 'ISNT', ':/=:', ':≠:', 'CTB', 'CT', 14 => array('<::', 'LTCTAB', '<::=', 'LETRUE', '>=FALSE', 'GEEMPTY', '>NIL', 'GT', 'SKIP', '~'),
157 => array('=AT', 'EQIS', '/=ISNT', 'NETRUE', 'FALSE', '~=EMPTY', 'NIL', 'SKIP'),
8 => array('NOT', 'UP', 'DOWN', 'LWB', 'UPB', /* '-',*/ 'ABS', 'ARG', 'BIN', 'ENTIER', 'LENG', 'LEVEL', 'ODD', 16 => array('&REPR', 'ANDROUND', 'SHORTEN', 'ORCONJ', 'SIGN'),
# OPERATORS ordered roughtly by PRIORITY #
17 => array('MINUSAB', 'PLUSAB', 'TIMESAB', 'DIVAB', 'OVERAB', 'MODAB', 'PLUSTO', '-:=', '+:=', '*:=', '/:=', '%:=', '%*:=', '+=:', '×:=', '÷:=', '÷×:=', '÷*:=', '%×:=', '÷::=', 'MINUS', 'PLUS', 'DIV', 'MOD', 'PRUS', '←'),
# 189 => array('THEF¬', 'ANDF', 'ORF', 'ANDTH', 'OREL', 'ANDTHEN~', 'ORELSE⎩', '⎧'),
# 10 => array('+*', 'I', '+×', '⊥', '!', '⏨'),
19 => array('int_lengths', 'intlengths', 'int_shorths', 'intshorths', 'max_int', 'maxint', 'real_lengths', 'reallengths', 'real_shorths', 'realshorths', 'bits_lengths', 'bitslengths', 'bits_shorths', 'bitsshorths', 'bytes_lengths', 'byteslengths', 'bytes_shorths', 'bytesshorths', 'max_abs_char', 'maxabschar', 'int_width', 'intwidth', 'long_int_width', 'longintwidth', 'long_long_int_width', 'longlongintwidth', 'real_width', 'realwidth', 'long_real_width', 'longrealwidth', 'long_long_real_width', 'longlongrealwidth', 'exp_width', 'expwidth', 'long_exp_width', 'longexpwidth', 'long_long_exp_width', 'longlongexpwidth', 'bits_width', 'bitswidth', 'long_bits_width', 'longbitswidth', 'long_long_bits_width', 'longlongbitswidth', 'bytes_width', 'byteswidth', 'long_bytes_width', 'longbyteswidth', 'max_real', 'maxreal', 'small_real', 'smallreal', 'long_max_int', 'longmaxint', 'long_long_max_int', 'longlongmaxint', 'long_max_real', 'longmaxreal', 'long_small_real', 'longsmallreal', 'long_long_max_real', 'longlongmaxreal', 'long_long_small_real', 'longlongsmallreal', 'long_max_bits', 'longmaxbits', 'long_long_max_bits', 'longlongmaxbits', 'null_character', 'nullcharacter', 'blank', 'flip', 'flop', 'error_char', 'errorchar', 'exp_char', 'expchar', 'newline_char', 'newlinechar', 'formfeed_char', 'formfeedchar', 'tab_char', 'tabchar'),
10 => array('I'),
20 => array('stand_in_channel', 'standinchannel', 'stand_out_channel', 'standoutchannel', 'stand_back_channel', 'standbackchannel', 'stand_draw_channel', 'standdrawchannel', 'stand_error_channel', 'standerrorchannel'),
# 11 => array('SHL', 'SHR', '**', 'UP', 'DOWN', 'LWB', 'UPB', '↑', '↓', '⌊', '⌈', '⎩', '⎧'),
21 => array('put_possible', 'putpossible', 'get_possible', 'getpossible', 'bin_possible', 'binpossible', 'set_possible', 'setpossible', 'reset_possible', 'resetpossible', 'reidf_possible', 'reidfpossible', 'draw_possible', 'drawpossible', 'compressible', 'on_logical_file_end', 'onlogicalfileend', 'on_physical_file_end', 'onphysicalfileend', 'on_line_end', 'onlineend', 'on_page_end', 'onpageend', 'on_format_end', 'onformatend', 'on_value_error', 'onvalueerror', 'on_open_error', 'onopenerror', 'on_transput_error', 'ontransputerror', 'on_format_error', 'onformaterror', 'open', 'establish', 'create', 'associate', 'close', 'lock', 'scratch', 'space', 'new_line', 'newline', 'print', 'write_f', 'writef', 'print_f', 'printf', 'write_bin', 'writebin', 'print_bin', 'printbin', 'read_f', 'readf', 'read_bin', 'readbin', 'put_f', 'putf', 'get_f', 'getf', 'make_term', 'maketerm', 'make_device', 'makedevice', 'idf', 'term', 'read_int', 'readint', 'read_long_int', 'readlongint', 'read_long_long_int', 'readlonglongint', 'read_real', 'readreal', 'read_long_real', 'readlongreal', 'read_long_long_real', 'readlonglongreal', 'read_complex', 'readcomplex', 'read_long_complex', 'readlongcomplex', 'read_long_long_complex', 'readlonglongcomplex', 'read_bool', 'readbool', 'read_bits', 'readbits', 'read_long_bits', 'readlongbits', 'read_long_long_bits', 'readlonglongbits', 'read_char', 'readchar', 'read_string', 'readstring', 'print_int', 'printint', 'print_long_int', 'printlongint', 'print_long_long_int', 'printlonglongint', 'print_real', 'printreal', 'print_long_real', 'printlongreal', 'print_long_long_real', 'printlonglongreal', 'print_complex', 'printcomplex', 'print_long_complex', 'printlongcomplex', 'print_long_long_complex', 'printlonglongcomplex', 'print_bool', 'printbool', 'print_bits', 'printbits', 'print_long_bits', 'printlongbits', 'print_long_long_bits', 'printlonglongbits', 'print_char', 'printchar', 'print_string', 'printstring', 'whole', 'fixed', 'float'),
11 => array('SHL', 'SHR', /*'UP', 'DOWN', 'LWB', 'UPB'*/),
22 => array('pi', 'long_pi', 'longpi', 'long_long_pi', 'longlongpi', 'sqrt', 'curt', 'cbrt', 'exp', 'ln', 'log', 'sin', 'arc_sin', 'arcsin', 'cos', 'arc_cos', 'arccos', 'tan', 'arc_tan', 'arctan', 'long_sqrt', 'longsqrt', 'long_curt', 'longcurt', 'long_cbrt', 'longcbrt', 'long_exp', 'longexp', 'long_ln', 'longln', 'long_log', 'longlog', 'long_sin', 'longsin', 'long_arc_sin', 'longarcsin', 'long_cos', 'longcos', 'long_arc_cos', 'longarccos', 'long_tan', 'longtan', 'long_arc_tan', 'longarctan', 'long_long_sqrt', 'longlongsqrt', 'long_long_curt', 'longlongcurt', 'long_long_cbrt', 'longlongcbrt', 'long_long_exp', 'longlongexp', 'long_long_ln', 'longlongln', 'long_long_log', 'longlonglog', 'long_long_sin', 'longlongsin', 'long_long_arc_sin', 'longlongarcsin', 'long_long_cos', 'longlongcos', 'long_long_arc_cos', 'longlongarccos', 'long_long_tan', 'longlongtan', 'long_long_arc_tan', 'longlongarctan', 'sinh', 'long_sinh', 'longsinh', 'long_long_sinh', 'longlongsinh', 'arc_sinh', 'arcsinh', 'long_arc_sinh', 'longarcsinh', 'long_long_arc_sinh', 'longlongarcsinh', 'cosh', 'long_cosh', 'longcosh', 'long_long_cosh', 'longlongcosh', 'arc_cosh', 'arccosh', 'long_arc_cosh', 'longarccosh', 'long_long_arc_cosh', 'longlongarccosh', 'tanh', 'long_tanh', 'longtanh', 'long_long_tanh', 'longlongtanh', 'arc_tanh', 'arctanh', 'long_arc_tanh', 'longarctanh', 'long_long_arc_tanh', 'longlongarctanh', 'arc_tan2', 'arctan2', 'long_arc_tan2', 'longarctan2', 'long_long_arc_tan2', 'longlongarctan2'),
# 12 => array('*', '/', '%', 'OVER', '%*', 'MOD', 23 => array('first_randomELEM', 'firstrandom×', 'next_random÷', 'nextrandom÷×', 'long_next_random÷*', 'longnextrandom', 'long_long_next_random', 'longlongnextrandom÷:'),
12 => array('OVER', 'MOD', 'ELEM'),
24 => array('real', 'bits_pack', 'bitspack', 'long_bits_pack', 'longbitspack', 'long_long_bits_pack', 'longlongbitspack', 'bytes_pack', 'bytespack', 'long_bytes_pack', 'longbytespack', 'char_in_string', 'charinstring', 'last_char_in_string', 'lastcharinstring', 'string_in_string', 'stringinstring'),
# 13 => array('-', '+'),
25 => array('utc_time', 'utctime', 'local_time', 'localtime', 'argc', 'argv', 'get_env', 'getenv', 'reset_errno', 'reseterrno', 'errno', 'strerror'),
# 14 => array('<', 'LT', '<=', 'LE', '>=', 'GE', '>', 'GT', '≤', '≥'),
26 => array('complex_sqrt', 'complexsqrt', 'long_complex_sqrt', 'longcomplexsqrt', 'long_long_complex_sqrt', 'longlongcomplexsqrt', 'complex_exp', 'complexexp', 'long_complex_exp', 'longcomplexexp', 'long_long_complex_exp', 'longlongcomplexexp', 'complex_ln', 'complexln', 'long_complex_ln', 'longcomplexln', 'long_long_complex_ln', 'longlongcomplexln', 'complex_sin', 'complexsin', 'long_complex_sin', 'longcomplexsin', 'long_long_complex_sin', 'longlongcomplexsin', 'complex_arc_sin', 'complexarcsin', 'long_complex_arc_sin', 'longcomplexarcsin', 'long_long_complex_arc_sin', 'longlongcomplexarcsin', 'complex_cos', 'complexcos', 'long_complex_cos', 'longcomplexcos', 'long_long_complex_cos', 'longlongcomplexcos', 'complex_arc_cos', 'complexarccos', 'long_complex_arc_cos', 'longcomplexarccos', 'long_long_complex_arc_cos', 'longlongcomplexarccos', 'complex_tan', 'complextan', 'long_complex_tan', 'longcomplextan', 'long_long_complex_tan', 'longlongcomplextan', 'complex_arc_tan', 'complexarctan', 'long_complex_arc_tan', 'longcomplexarctan', 'long_long_complex_arc_tan', 'longlongcomplexarctan', 'complex_sinh', 'complexsinh', 'complex_arc_sinh', 'complexarcsinh', 'complex_cosh', 'complexcosh', 'complex_arc_cosh', 'complexarccosh', 'complex_tanh', 'complextanh', 'complex_arc_tanh', 'complexarctanh')
14 => array('LT', 'LE', 'GE', 'GT'),
# 15 => array('=', 'EQ', '/=', 'NE', '≠', '~='),
15 => array('EQ', 'NE'),
# 16 => array('&', 'AND', '∧', 'OR', '∨', '/\\', '\\/'),
16 => array('AND', 'OR'),
17 => array('MINUSAB', 'PLUSAB', 'TIMESAB', 'DIVAB', 'OVERAB', 'MODAB', 'PLUSTO'),
# 18 => array('-:=', '+:=', '*:=', '/:=', '%:=', '%*:=', '+=:', '×:=', '÷:=', '÷×:=', '÷*:=', '%×:=', '÷::=', 'MINUS', 'PLUS', 'DIV', 'MOD', 'PRUS'),
# Extensions or deprecated keywords
18 => array('MINUS', 'PLUS', 'DIV', /* 'MOD',*/ 'PRUS', 'IS NOT'),
# Extensions or deprecated keywords
19 => array('THEF', 'ANDF', 'ORF', 'ANDTH', 'OREL', 'ANDTHEN', 'ORELSE'),
# Built in procedures - from standard prelude #
20 => array('int lengths', 'intlengths', 'int shorths', 'intshorths', 'max int', 'maxint', 'real lengths', 'reallengths', 'real shorths', 'realshorths', 'bits lengths', 'bitslengths', 'bits shorths', 'bitsshorths', 'bytes lengths', 'byteslengths', 'bytes shorths', 'bytesshorths', 'max abs char', 'maxabschar', 'int width', 'intwidth', 'long int width', 'longintwidth', 'long long int width', 'longlongintwidth', 'real width', 'realwidth', 'long real width', 'longrealwidth', 'long long real width', 'longlongrealwidth', 'exp width', 'expwidth', 'long exp width', 'longexpwidth', 'long long exp width', 'longlongexpwidth', 'bits width', 'bitswidth', 'long bits width', 'longbitswidth', 'long long bits width', 'longlongbitswidth', 'bytes width', 'byteswidth', 'long bytes width', 'longbyteswidth', 'max real', 'maxreal', 'small real', 'smallreal', 'long max int', 'longmaxint', 'long long max int', 'longlongmaxint', 'long max real', 'longmaxreal', 'long small real', 'longsmallreal', 'long long max real', 'longlongmaxreal', 'long long small real', 'longlongsmallreal', 'long max bits', 'longmaxbits', 'long long max bits', 'longlongmaxbits', 'null character', 'nullcharacter', 'blank', 'flip', 'flop', 'error char', 'errorchar', 'exp char', 'expchar', 'newline char', 'newlinechar', 'formfeed char', 'formfeedchar', 'tab char', 'tabchar'),
21 => array('stand in channel', 'standinchannel', 'stand out channel', 'standoutchannel', 'stand back channel', 'standbackchannel', 'stand draw channel', 'standdrawchannel', 'stand error channel', 'standerrorchannel'),
22 => array('put possible', 'putpossible', 'get possible', 'getpossible', 'bin possible', 'binpossible', 'set possible', 'setpossible', 'reset possible', 'resetpossible', 'reidf possible', 'reidfpossible', 'draw possible', 'drawpossible', 'compressible', 'on logical file end', 'onlogicalfileend', 'on physical file end', 'onphysicalfileend', 'on line end', 'onlineend', 'on page end', 'onpageend', 'on format end', 'onformatend', 'on value error', 'onvalueerror', 'on open error', 'onopenerror', 'on transput error', 'ontransputerror', 'on format error', 'onformaterror', 'open', 'establish', 'create', 'associate', 'close', 'lock', 'scratch', 'space', 'new line', 'newline', 'print', 'write f', 'writef', 'print f', 'printf', 'write bin', 'writebin', 'print bin', 'printbin', 'read f', 'readf', 'read bin', 'readbin', 'put f', 'putf', 'get f', 'getf', 'make term', 'maketerm', 'make device', 'makedevice', 'idf', 'term', 'read int', 'readint', 'read long int', 'readlongint', 'read long long int', 'readlonglongint', 'read real', 'readreal', 'read long real', 'readlongreal', 'read long long real', 'readlonglongreal', 'read complex', 'readcomplex', 'read long complex', 'readlongcomplex', 'read long long complex', 'readlonglongcomplex', 'read bool', 'readbool', 'read bits', 'readbits', 'read long bits', 'readlongbits', 'read long long bits', 'readlonglongbits', 'read char', 'readchar', 'read string', 'readstring', 'print int', 'printint', 'print long int', 'printlongint', 'print long long int', 'printlonglongint', 'print real', 'printreal', 'print long real', 'printlongreal', 'print long long real', 'printlonglongreal', 'print complex', 'printcomplex', 'print long complex', 'printlongcomplex', 'print long long complex', 'printlonglongcomplex', 'print bool', 'printbool', 'print bits', 'printbits', 'print long bits', 'printlongbits', 'print long long bits', 'printlonglongbits', 'print char', 'printchar', 'print string', 'printstring', 'whole', 'fixed', 'float'),
23 => array('pi', 'long pi', 'longpi', 'long long pi', 'longlongpi'),
24 => array('sqrt', 'curt', 'cbrt', 'exp', 'ln', 'log', 'sin', 'arc sin', 'arcsin', 'cos', 'arc cos', 'arccos', 'tan', 'arc tan', 'arctan', 'long sqrt', 'longsqrt', 'long curt', 'longcurt', 'long cbrt', 'longcbrt', 'long exp', 'longexp', 'long ln', 'longln', 'long log', 'longlog', 'long sin', 'longsin', 'long arc sin', 'longarcsin', 'long cos', 'longcos', 'long arc cos', 'longarccos', 'long tan', 'longtan', 'long arc tan', 'longarctan', 'long long sqrt', 'longlongsqrt', 'long long curt', 'longlongcurt', 'long long cbrt', 'longlongcbrt', 'long long exp', 'longlongexp', 'long long ln', 'longlongln', 'long long log', 'longlonglog', 'long long sin', 'longlongsin', 'long long arc sin', 'longlongarcsin', 'long long cos', 'longlongcos', 'long long arc cos', 'longlongarccos', 'long long tan', 'longlongtan', 'long long arc tan', 'longlongarctan'),
25 => array('first random', 'firstrandom', 'next random', 'nextrandom', 'long next random', 'longnextrandom', 'long long next random', 'longlongnextrandom'),
26 => array('real', 'bits pack', 'bitspack', 'long bits pack', 'longbitspack', 'long long bits pack', 'longlongbitspack', 'bytes pack', 'bytespack', 'long bytes pack', 'longbytespack', 'char in string', 'charinstring', 'last char in string', 'lastcharinstring', 'string in string', 'stringinstring'),
27 => array('utc time', 'utctime', 'local time', 'localtime', 'argc', 'argv', 'get env', 'getenv', 'reset errno', 'reseterrno', 'errno', 'strerror'),
28 => array('sinh', 'long sinh', 'longsinh', 'long long sinh', 'longlongsinh', 'arc sinh', 'arcsinh', 'long arc sinh', 'longarcsinh', 'long long arc sinh', 'longlongarcsinh', 'cosh', 'long cosh', 'longcosh', 'long long cosh', 'longlongcosh', 'arc cosh', 'arccosh', 'long arc cosh', 'longarccosh', 'long long arc cosh', 'longlongarccosh', 'tanh', 'long tanh', 'longtanh', 'long long tanh', 'longlongtanh', 'arc tanh', 'arctanh', 'long arc tanh', 'longarctanh', 'long long arc tanh', 'longlongarctanh', 'arc tan2', 'arctan2', 'long arc tan2', 'longarctan2', 'long long arc tan2', 'longlongarctan2'),
29 => array('complex sqrt', 'complexsqrt', 'long complex sqrt', 'longcomplexsqrt', 'long long complex sqrt', 'longlongcomplexsqrt', 'complex exp', 'complexexp', 'long complex exp', 'longcomplexexp', 'long long complex exp', 'longlongcomplexexp', 'complex ln', 'complexln', 'long complex ln', 'longcomplexln', 'long long complex ln', 'longlongcomplexln', 'complex sin', 'complexsin', 'long complex sin', 'longcomplexsin', 'long long complex sin', 'longlongcomplexsin', 'complex arc sin', 'complexarcsin', 'long complex arc sin', 'longcomplexarcsin', 'long long complex arc sin', 'longlongcomplexarcsin', 'complex cos', 'complexcos', 'long complex cos', 'longcomplexcos', 'long long complex cos', 'longlongcomplexcos', 'complex arc cos', 'complexarccos', 'long complex arc cos', 'longcomplexarccos', 'long long complex arc cos', 'longlongcomplexarccos', 'complex tan', 'complextan', 'long complex tan', 'longcomplextan', 'long long complex tan', 'longlongcomplextan', 'complex arc tan', 'complexarctan', 'long complex arc tan', 'longcomplexarctan', 'long long complex arc tan', 'longlongcomplexarctan', 'complex sinh', 'complexsinh', 'complex arc sinh', 'complexarcsinh', 'complex cosh', 'complexcosh', 'complex arc cosh', 'complexarccosh', 'complex tanh', 'complextanh', 'complex arc tanh', 'complexarctanh')
),
'SYMBOLS' => array(
1 => array( /* reverse length sorted... */ '÷×:=', '%×:=', ':≠:', '÷*:=', '÷::=', '%*:=', ':/=:', '×:=', '÷:=', '÷×', '%:=', '%×', '*:=', '+:=', '+=:', '+×', '-:=', '/:=', '::=', ':=:', '÷*', '÷:', '↑', '↓', '∧', '∨', '≠', '≤', '≥', '⊥', '⌈', '⌊', '⎧', '⎩', /* '⏨', */ '□', '○', '%*', '**', '+*', '/=', '::', '/\\', '\\/', '<=', '>=', '|:', '~=', '¬', '×', '÷', '!', '%', '&', '(', ')', '*', '+', ',', '-', '/', ':', ';', '<', '=', '>', '?', '@', '[', ']', '^', '{', '|', '}', '~')
1 => array(
),
'(', ')', '{', '}', '[', ']', '+', '-', '*', '/', '%', '=', '<', '>', '!', '^', '&', '|', '?', ':', ';', ','
)
),
'CASE_SENSITIVE' => array(
GESHI_COMMENTS => false,
1 => true,
1 => true, 2 => true, 3 => true, 4 => true, 5 => true, 6 => true, 7 => true, 8 => true, 9 => true, 10 => true, 11 => true, 12 => true, 13 => true, 14 => true, 15 => true, 16 => true, 17 => true, 18 => true, 19 => true, 20 => true, 21 => true, 22 => true, 23 => true, 24 => true, 25 => true, 26 => true, 27 => true, 28 => true, 29 => true
2 => true,
3 => true,
4 => true,
5 => true,
6 => true,
7 => true,
8 => true,
# 9 => true,
10 => true,
11 => true,
12 => true,
# 13 => true,
14 => true,
15 => true,
16 => true,
17 => true,
18 => true,
19 => true,
20 => true,
21 => true,
22 => true,
23 => true,
24 => true,
25 => true,
26 => true,
27 => true,
28 => true,
29 => true
),
'STYLES' => array(
'KEYWORDS' => array(
'KEYWORDS' => array(1 => 'color: #b1b100;', 2 => 'color: #b1b100;', 3 => 'color: #b1b100;', 4 => 'color: #b1b100;', 5 => 'color: #b1b100;', 6 => 'color: #b1b100;', 7 => 'color: #b1b100;', 8 => 'color: #b1b100;', 9 => 'color: #b1b100;', 10 => 'color: #b1b100;', 11 => 'color: #b1b100;', 12 => 'color: #b1b100;', 13 => 'color: #b1b100;', 14 => 'color: #b1b100;', 15 => 'color: #b1b100;', 16 => 'color: #b1b100;', 17 => 'color: #b1b100;', 18 => 'color: #b1b100;', 19 => 'color: #b1b100;', 20 => 'color: #b1b100;', 21 => 'color: #b1b100;', 22 => 'color: #b1b100;', 23 => 'color: #b1b100;', 24 => 'color: #b1b100;', 25 => 'color: #b1b100;', 26 => 'color: #b1b100;', 27 => 'color: #b1b100;', 28 => 'color: #b1b100;', 29 => 'color: #b1b100;'
1 => $a68['NONSTD'], 2 => $a68['BOLD'], 3 => $a68['BOLD'], 4 => $a68['BOLD'],
5 => $a68['NONSTD'], 6 => $a68['BOLD'], 7 => $a68['BOLD'], 8 => $a68['BOLD'],
/* 9 => $a68['BOLD'],*/ 10 => $a68['BOLD'], 11 => $a68['BOLD'], 12 => $a68['BOLD'],
/* 13 => $a68['BOLD'],*/ 14 => $a68['BOLD'], 15 => $a68['BOLD'], 16 => $a68['BOLD'], 17 => $a68['BOLD'],
18 => $a68['NONSTD'], 19 => $a68['NONSTD'],
20 => $a68['ITALIC'], 21 => $a68['ITALIC'], 22 => $a68['ITALIC'], 23 => $a68['ITALIC'],
24 => $a68['ITALIC'], 25 => $a68['ITALIC'], 26 => $a68['ITALIC'], 27 => $a68['ITALIC'],
28 => $a68['ITALIC'], 29 => $a68['ITALIC']
),
'COMMENTS' => array(
1 => $a68['COMMENT'], 2 => $a68['COMMENT'], 3 => $a68['COMMENT'], /* 4 => $a68['COMMENT'],
,
'MULTI'5 => $a68['color:COMMENT'],*/ #666666;'MULTI' font-style:=> italic;$a68['COMMENT']
),
'ESCAPE_CHAR' => array(
Line 824 ⟶ 587:
),
'METHODS' => array(
0 => 'color: #004000;',
1 => 'color: #004000;'
),
'SYMBOLS' => array(
0 => 'color: #339933;',
1 => 'color: #339933;'
),
'REGEXPS' => array(),
0 => 'color: #cc66cc;', # BITS #
1 => 'color: #cc66cc;', # REAL #
/* 2 => 'color: #cc66cc;', # INT # */
),
'SCRIPT' => array()
),
'URLS' => array(
'URLS' => array(1 => '', 2 => '', 3 => '', 4 => '', 5 => '', 6 => '', 7 => '', 8 => '', 9 => '', 10 => '', 11 => '', 12 => '', 13 => '', 14 => '', 15 => '', 16 => '', 17 => '', 18 => '', 19 => '', 20 => '', 21 => '', 22 => '', 23 => '', 24 => '', 25 => '', 26 => '', 27 => '', 28 => '', 29 => ''),
1 => '',
2 => '',
3 => '',
4 => '',
5 => '',
6 => '',
7 => '',
8 => '',
# 9 => '',
10 => '',
11 => '',
12 => '',
# 13 => '',
14 => '',
15 => '',
16 => '',
17 => '',
18 => '',
19 => '',
20 => '',
21 => '',
22 => '',
23 => '',
24 => '',
25 => '',
26 => '',
27 => '',
28 => '',
29 => ''
),
'OOLANG' => true,
'OBJECT_SPLITTERS' => array(1 => 'OF'),
'REGEXPS' 0 => array()'→',
1 => 'OF'
),
'REGEXPS' => array(
0 => $a68['BITS'],
1 => $a68['REAL']
# 2 => $a68['INT'], # Breaks formatting for some reason #
# 2 => $GESHI_NUMBER_INT_BASIC # Also breaks formatting #
),
'STRICT_MODE_APPLIES' => GESHI_NEVER,
'SCRIPT_DELIMITERS' => array(),
Line 841 ⟶ 648:
);
 
unset($a68);
?>
?></lang>
 
Test ASCII version:
Line 868 ⟶ 675:
BTW: The operators: '&amp;#8804;' and '&amp;#8805;' can be done in html as '&amp;le;' and '&amp;ge;' eg '&le;' and '&ge;';
 
There are a few of others: ne: &ne;, cent: &cent; pound: &pound; deg: &deg;, and: &and;, or: &or;, not: &not;, lceil: &lceil;, lfloor: &lfloor;, times: &times;, divide: &divide; larr: &larr;, rarr: &rarr;, uarr: &uarr;, darr: &darr;, and perp: &perp; <!-- The Algol 68 Report used alefsym: &alefsym;, "&#x226E;", "&#x226F;" and &#x2112; http://en.wikipedia.org/wiki/Van_Wijngaarden_grammar -->. But no HTML entities for □, ○, ⎩, ⎧ (Unicode 5.1) and "⏨" (decimal exponentiation - Unicode 5.2).
 
Detecting all the HTML entity defs (http://php.net/manual/en/function.htmlentities.php) is probably the easiest way of doing things.
 
Trivia: Standard Algol 60 required sup: &sup;, equiv: &equiv;, "&#x2423;" and "&#x23E8;" (decimal exponentiation - Unicode 5.2); The Soviet Algol compiler - used for the Buran Space Shuttle reentry software - even had the character: loz: &loz;, together with support for °&#xB0;, &#x2205;, ±&#xB1; and &#x2207; ... I could never figure out what this [http://en.wikipedia.org/wiki/Behenian_fixed_stars#Table_of_Behenian_Stars diamond &loz;] character was used for!!! The Germans also included the unusual "<font size=5>&#x16ED;</font>" (iron/runic cross), I'm not convinced it was used for multiplication. Probably something used for something mundane like printing train time tables, you would have to be German to understand. :-)
 
More Trivia: Most of the HTML entities appear to have arrived via Adobe fonts from an IBM Selectric typewriter font ball that was popular prior to ASCII 69 becoming a mandated US standard. Some of the HTML entities are fairly weird.
Line 883 ⟶ 690:
 
[[User:NevilleDNZ|NevilleDNZ]] 13:01, 24 April 2010 (UTC)
 
Revised Algol68.php (Quick fix: 1.0.8.8.2) to remove errant ">" that was being injected into in code before some symbols.
 
[[User:NevilleDNZ|NevilleDNZ]] 07:04, 15 June 2010 (UTC)
 
Revised Algol68.php (Better fix: 1.0.8.8.5) to remove errant ">" that was being injected into in code before some symbols. Still some quirks, eg kw6, kw7, kw8 ... highlighting inserted, but not apparent. Mostly OK. Enjoy.
 
[[User:NevilleDNZ|NevilleDNZ]] 14:37, 30 July 2010 (UTC)
 
=F# issue=
Apostrophes (') have three different roles in F#:
* they enclose character literals, like 'A', '\065', '\n' or '\u0041'
* type parameters always begin with an apostrophe
* apostrophes can be part of a normal identifier (but not in the first position)
At the moment, all apostrophes are interpreted as starting a character. See for example here: http://rosettacode.org/wiki/Doubly-linked_list/Definition#F.23
 
Maybe a work-around could be: Ignore apostrophes except
* if followed by exactly one arbitrary character and an additional apostrophe, like 'A'
* or if followed by a backslash, like the other types of char literals
[[User:Wmeyer|Wmeyer]] 18:51, 27 August 2010 (UTC)
 
=PL/I, AutoGeSHi=
 
I ran [http://rosettacode.org/geshi/autogeshi.pl?identifier=pli&LANG_NAME=Programming+Language+One&COMMENT_SINGLE=&COMMENT_MULTI=%2F*+*%2F&QUOTEMARKS=%22+%27&ESCAPE_CHAR=&KEYWORDS=abnormal+abs+acos+acosf+add+addbuff+addr+addrdata+alias+aligned+all+alloc+allocate+allocation+allocn+allocsize+any+anycondition+area+ascii+asin+asinf+asm+asmtdli+assembler+assignable+atan+atand+atanf+atanh+attach+attention+attn+auto+automatic+availablearea+backwards+based+begin+bigendian+bin+binary+binaryvalue+bind+binvalue+bit+bitloc+bitlocation+bkwd+blksize+bool+buf+buffered+buffers+bufnd+bufni+bufoff+bufsp+builtin+bx+by+byaddr+byte+byvalue+b4+call+cast+cds+ceil+center+centerleft+centerright+centre+centreleft+centreright+char+character+charg+chargraphic+charval+check+checkstg+close+cmpat+cobol+col+collate+column+comment+compare+compiledate+compiletime+completion+complex+cond+condition+conjg+conn+connected+consecutive+controlled+conv+conversion+copy+cos+cosd+cosf+cosh+count+counter+cpln+cplx+cs+cstg+ctl+ctlasa+ctl360+currentsize+currentstorage+data+datafield+date+datetime+days+daystodate+daystosecs+db+dcl+dec+decimal+declare+def+default+define+defined+delay+delete+descriptor+descriptors+detach+dft+dim+dimacross+dimension+direct+display+divide+do+downthru+edit+else+empty+end+endfile+endpage+entry+entryaddr+env+environment+epsilon+erf+erfc+error+event+excl+exclusive+exit+exp+expf+exponent+exports+ext+external+fb+fbs+fetch+file+fileddint+fileddtest+fileddword+fileid+fileopen+fileread+fileseek+filetell+filewrite+finish+first+fixed+fixedbin+fixeddec+fixedoverflow+float+floatbin+floatdec+floor+flush+fofl+format+fortran+free+from+fromalien+fs+gamma+generic+genkey+get+getenv+go+goto+graphic+gx+handle+hbound+hex+hexadec+heximage+high+huge+iand+ieee+ieor+if+ignore+imag+in+index+indexarea+indexed+init+initial+inline+inonly+inot+inout+input+int+inter+internal+into+invalidop+ior+irred+irreducible+isfinite+isigned+isinf+isll+ismain+isnan+isnormal+isrl+iszero+iunsigned+key+keyed+keyfrom+keylength+keyloc+keyto+label+last+lbound+leave+left+length+like+limited+line+lineno+linesize+linkage+list+littleendian+loc+locate+location+log+logf+loggamma+log10+log10f+log2+low+lowercase+lower2+maccol+maclmar+macname+macrmar+main+max+maxexp+maxlength+memconvert+memcu12+memcu14+memcu21+memcu24+memcu41+memcu42+memindex+memsearch+memsearchr+memverify+memverifyr+min+minexp+mod+mpstr+multiply+name+native+ncp+new+nocharg+nochargraphic+nocheck+nocmpat+noconv+noconversion+nodescriptor+noexecops+nofixedoverflow+nofofl+noinline+nolock+nomap+nomapin+nomapout+nonasgn+nonassignable+nonconnected+nonnative+noofl+nooverflow+norescan+normal+nosize+nostrg+nostringrange+nostringsize+nostrz+nosubrg+nosubscriptrange+noufl+nounderflow+nowrite+nozdiv+nozerodivide+null+offset+offsetadd+offsetdiff+offsetsubtract+offsetvalue+ofl+omitted+on+onarea+onchar+oncode+oncondcond+oncondid+oncount+onfile+ongsource+onkey+online+onloc+onoffset+onsource+onsubcode+onwchar+onwsource+open+optional+options+order+ordinal+ordinalname+ordinalpred+ordinalsucc+other+otherwise+outonly+output+overflow+package+packagename+page+pageno+pagesize+parameter+parmset+password+pending+pic+picspec+picture+places+pliascii+plicanc+plickpt+plidelete+plidump+pliebcdic+plifill+plifree+plimove+pliover+plirest+pliretc+pliretv+plisaxa+plisaxb+plisaxc+plisaxd+plisrta+plisrtb+plisrtc+plisrtd+plitdli+plitran11+plitran12+plitran21+plitran22+pointer+pointeradd+pointerdiff+pointersubtract+pointervalue+poly+pos+position+prec+precision+pred+present+print+priority+proc+procedure+procedurename+procname+prod+ptr+ptradd+ptrdiff+ptrsubtract+ptrvalue+put+putenv+quote+radix+raise2+random+range+rank+read+real+record+recsize+recursive+red+reducible+reentrant+refer+regional+reg12+release+rem+reorder+repattern+repeat+replaceby2+reply+reread+rescan+reserved+reserves+resignal+respec+retcode+return+returns+reuse+reverse+revert+rewrite+right+round+rounddec+samekey+scalarvarying+scale+search+searchr+secs+secstodate+secstodays+select+seql+sequential+serialize4+set+sign+signal+signed+sin+sind+sinf+sinh+sis+size+skip+snap+sourcefile+sourceline+sqrt+sqrtf+stackaddr+statement+static+status+stg+stmt+stop+storage+stream+strg+string+stringrange+stringsize+structure+strz+subrg+subscriptrange+substr+subtract+succ+sum+suppress+sysin+sysnull+sysparm+sysprint+system+sysversion+tally+tan+tand+tanf+tanh+task+then+thread+threadid+time+tiny+title+to+total+tpk+tpm+transient+translate+transmit+trim+trkofl+trunc+type+ufl+ulength+ulength16+ulength8+unal+unaligned+unallocated+unbuf+unbuffered+undefinedfile+underflow+undf+unlock+unsigned+unspec+until+update+upos+uppercase+upthru+usubstr+usurrogate+uvalid+uwidth+valid+validdate+value+var+varglist+vargsize+variable+varying+varyingz+vb+vbs+verify+verifyr+vs+vsam+wait+wchar+wcharval+weekday+when+whigh+while+widechar+wlow+write+xmlchar+y4date+y4julian+y4year+zdiv+zerodivide%0D%0A&SYMBOLS=%28%29%2B-*%2F%3D%3C%3E%26|%3A%3B%2C&OBJECT_SPLITTERS=.&author=Robert+AH+Prins&email=robert%40prino.org&url=http%3A%2F%2Fhitchwiki.org%2Fen%2FUser%3APrino]
 
And the result was rather sad, the age seems to have a problem with the rather large number of PL/I keywords...
 
Any suggestions on how to proceed? [[User:Prino|Prino]] 12:46, 8 February 2011 (UTC)
: I'll look into it. Won't be able to get to it sooner than Saturday, though. --[[User:Short Circuit|Michael Mol]] 17:29, 5 May 2011 (UTC)
 
: One possibility is to run it with a small number of keywords and edit the others in (not hard). [[User:CRGreathouse|CRGreathouse]] 18:37, 11 May 2011 (UTC)
 
= PARI/GP =
I created a GeSHi file for GP scripts (starting from an [http://rosettacode.org/geshi/ AutoGeSHi] skeleton and modifying as needed). It is in the old 1.0 format rather than the new 1.1 format. (If it's more convenient I can try to make a new format file, but I haven't found any documentation on it.)
 
There are a few things I'd like to iron out, if possible. First of all, \ is an escape character only in special cases: \n, \t, \e, and \", I think. This is important because it must be an escape in \" (or else strings will be mis-terminated) and it must not be an escape outside of strings (or else 5\2 will be misinterpreted as an error or at least something other than a number). In other cases it is integer division.
 
Second, I would like to limit category 2 and 3 keywords. Category 2 is for defaults, which appear only in the context "default(''foo'')" or "default(''foo'', bar)" (with optional spaces*). Category 3 is types, which occur only after a colon following a variable. Any idea on how to code these? Also numeric constants are slightly unusual in GP; 1. is a valid t_REAL (it would be written 1.0 in C). I don't know if that causes problems.
 
<nowiki>*</nowiki> Spaces are very unusual in GP; they're actually entirely ignored -- literally! -- by the parser outside of strings. So <code>foo==f oo</code> is true. I think this issue is best handled by sticking out fingers in our ears and humming loudly.
 
Any advice would be appreciated. I'd prefer to have this fixed before sending it to Michael Mol.
 
[[User:CRGreathouse|CRGreathouse]] 21:54, 11 May 2011 (UTC)
 
<div style="height:30ex;overflow:scroll"><lang PHP><?php
/*************************************************************************************
* parigp.php
* --------
* Author: Charles R Greathouse IV (----)
* Copyright: 2011 Charles R Greathouse IV (http://math.crg4.com/)
* Release Version:
* Date Started: 2011/05/11
*
* PARI/GP language file for GeSHi.
*
* CHANGES
* -------
*
* TODO (updated yyyy/mm/dd)
* -------------------------
*
*
*************************************************************************************
*
* This file is part of GeSHi.
*
* GeSHi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* GeSHi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GeSHi; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
************************************************************************************/
 
$language_data = array(
'LANG_NAME' => 'PARI/GP',
'COMMENT_SINGLE' => array(1 => '\\\\'),
'COMMENT_MULTI' => array('/*' => '*/'),
'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
'QUOTEMARKS' => array('"'),
'ESCAPE_CHAR' => '\\',
'KEYWORDS' => array(
1 => array('addprimes', 'bestappr', 'bezout', 'bezoutres', 'bigomega', 'binomial', 'chinese',
'content', 'contfrac', 'contfracpnqn', 'core', 'coredisc', 'dirdiv', 'direuler', 'dirmul',
'divisors', 'eulerphi', 'factor', 'factorback', 'factorcantor', 'factorff', 'factorial',
'factorint', 'factormod', 'ffgen', 'ffinit', 'fflog', 'fforder', 'ffprimroot', 'fibonacci',
'gcd', 'hilbert', 'isfundamental', 'ispower', 'isprime', 'ispseudoprime', 'issquare',
'issquarefree', 'kronecker', 'lcm', 'moebius', 'nextprime', 'numbpart', 'numdiv', 'omega',
'partitions', 'polrootsff', 'precprime', 'prime', 'primepi', 'primes', 'qfbclassno',
'qfbcompraw', 'qfbhclassno', 'qfbnucomp', 'qfbnupow', 'qfbpowraw', 'qfbprimeform', 'qfbred',
'qfbsolve', 'quadclassunit', 'quaddisc', 'quadgen', 'quadhilbert', 'quadpoly', 'quadray',
'quadregulator', 'quadunit', 'removeprimes', 'sigma', 'sqrtint', 'stirling', 'sumdedekind',
'zncoppersmith', 'znlog', 'znorder', 'znprimroot', 'znstar', 'Col', 'List', 'Mat', 'Mod',
'Pol', 'Polrev', 'Qfb', 'Ser', 'Set', 'Str', 'Strchr', 'Strexpand', 'Strtex', 'Vec', 'Vecrev',
'Vecsmall', 'binary', 'bitand', 'bitneg', 'bitnegimply', 'bitor', 'bittest', 'bitxor', 'ceil',
'centerlift', 'component', 'conj', 'conjvec', 'denominator', 'floor', 'frac', 'imag', 'length',
'lift', 'norm', 'norml2', 'numerator', 'numtoperm', 'padicprec', 'permtonum', 'precision',
'random', 'real', 'round', 'simplify', 'sizebyte', 'sizedigit', 'truncate', 'valuation',
'variable', 'ellL1', 'elladd', 'ellak', 'ellan', 'ellanalyticrank', 'ellap', 'ellbil',
'ellchangecurve', 'ellchangepoint', 'ellconvertname', 'elldivpol', 'elleisnum', 'elleta',
'ellgenerators', 'ellglobalred', 'ellgroup', 'ellheight', 'ellheightmatrix', 'ellidentify',
'ellinit', 'ellisoncurve', 'ellj', 'elllocalred', 'elllog', 'elllseries', 'ellminimalmodel',
'ellmodulareqn', 'ellorder', 'ellordinate', 'ellpointtoz', 'ellpow', 'ellrootno', 'ellsearch',
'ellsigma', 'ellsub', 'elltaniyama', 'elltatepairing', 'elltors', 'ellweilpairing', 'ellwp',
'ellzeta', 'ellztopoint', 'bnfcertify', 'bnfcompress', 'bnfdecodemodule', 'bnfinit',
'bnfisintnorm', 'bnfisnorm', 'bnfisprincipal', 'bnfissunit', 'bnfisunit', 'bnfnarrow',
'bnfsignunit', 'bnfsunit', 'bnrL1', 'bnrclassno', 'bnrclassnolist', 'bnrconductor',
'bnrconductorofchar', 'bnrdisc', 'bnrdisclist', 'bnrinit', 'bnrisconductor', 'bnrisprincipal',
'bnrrootnumber', 'bnrstark', 'dirzetak', 'factornf', 'galoisexport', 'galoisfixedfield',
'galoisgetpol', 'galoisidentify', 'galoisinit', 'galoisisabelian', 'galoisisnormal',
'galoispermtopol', 'galoissubcyclo', 'galoissubfields', 'galoissubgroups', 'idealadd',
'idealaddtoone', 'idealappr', 'idealchinese', 'idealcoprime', 'idealdiv', 'idealfactor',
'idealfactorback', 'idealfrobenius', 'idealhnf', 'idealintersect', 'idealinv', 'ideallist',
'ideallistarch', 'ideallog', 'idealmin', 'idealmul', 'idealnorm', 'idealpow', 'idealprimedec',
'idealramgroups', 'idealred', 'idealstar', 'idealtwoelt', 'idealval', 'matalgtobasis',
'matbasistoalg', 'modreverse', 'newtonpoly', 'nfalgtobasis', 'nfbasis', 'nfbasistoalg',
'nfdetint', 'nfdisc', 'nfeltadd', 'nfeltdiv', 'nfeltdiveuc', 'nfeltdivmodpr', 'nfeltdivrem',
'nfeltmod', 'nfeltmul', 'nfeltmulmodpr', 'nfeltnorm', 'nfeltpow', 'nfeltpowmodpr',
'nfeltreduce', 'nfeltreducemodpr', 'nfelttrace', 'nfeltval', 'nffactor', 'nffactorback',
'nffactormod', 'nfgaloisapply', 'nfgaloisconj', 'nfhilbert', 'nfhnf', 'nfhnfmod', 'nfinit',
'nfisideal', 'nfisincl', 'nfisisom', 'nfkermodpr', 'nfmodprinit', 'nfnewprec', 'nfroots',
'nfrootsof1', 'nfsnf', 'nfsolvemodpr', 'nfsubfields', 'polcompositum', 'polgalois', 'polred',
'polredabs', 'polredord', 'poltschirnhaus', 'rnfalgtobasis', 'rnfbasis', 'rnfbasistoalg',
'rnfcharpoly', 'rnfconductor', 'rnfdedekind', 'rnfdet', 'rnfdisc', 'rnfeltabstorel',
'rnfeltdown', 'rnfeltreltoabs', 'rnfeltup', 'rnfequation', 'rnfhnfbasis', 'rnfidealabstorel',
'rnfidealdown', 'rnfidealhnf', 'rnfidealmul', 'rnfidealnormabs', 'rnfidealnormrel',
'rnfidealreltoabs', 'rnfidealtwoelt', 'rnfidealup', 'rnfinit', 'rnfisabelian', 'rnfisfree',
'rnfisnorm', 'rnfisnorminit', 'rnfkummer', 'rnflllgram', 'rnfnormgroup', 'rnfpolred',
'rnfpolredabs', 'rnfpseudobasis', 'rnfsteinitz', 'subgrouplist', 'zetak', 'zetakinit', 'plot',
'plotbox', 'plotclip', 'plotcolor', 'plotcopy', 'plotcursor', 'plotdraw', 'ploth', 'plothraw',
'plothsizes', 'plotinit', 'plotkill', 'plotlines', 'plotlinetype', 'plotmove', 'plotpoints',
'plotpointsize', 'plotpointtype', 'plotrbox', 'plotrecth', 'plotrecthraw', 'plotrline',
'plotrmove', 'plotrpoint', 'plotscale', 'plotstring', 'psdraw', 'psploth', 'psplothraw', 'O',
'deriv', 'diffop', 'eval', 'factorpadic', 'intformal', 'padicappr', 'padicfields',
'polchebyshev', 'polcoeff', 'polcyclo', 'poldegree', 'poldisc', 'poldiscreduced',
'polhensellift', 'polhermite', 'polinterpolate', 'polisirreducible', 'pollead', 'pollegendre',
'polrecip', 'polresultant', 'polroots', 'polrootsmod', 'polrootspadic', 'polsturm',
'polsubcyclo', 'polsylvestermatrix', 'polsym', 'poltchebi', 'polzagier', 'serconvol',
'serlaplace', 'serreverse', 'subst', 'substpol', 'substvec', 'taylor', 'thue', 'thueinit',
'break', 'for', 'fordiv', 'forell', 'forprime', 'forstep', 'forsubgroup', 'forvec', 'if',
'next', 'return', 'until', 'while', 'Strprintf', 'addhelp', 'alarm', 'alias', 'allocatemem',
'apply', 'default', 'error', 'extern', 'externstr', 'getheap', 'getrand', 'getstack',
'gettime', 'global', 'input', 'install', 'kill', 'print1', 'print', 'printf', 'printtex',
'quit', 'read', 'readvec', 'select', 'setrand', 'system', 'trap', 'type', 'version', 'warning',
'whatnow', 'write1', 'write', 'writebin', 'writetex', 'divrem', 'lex', 'max', 'min', 'shift',
'shiftmul', 'sign', 'vecmax', 'vecmin', 'derivnum', 'intcirc', 'intfouriercos', 'intfourierexp',
'intfouriersin', 'intfuncinit', 'intlaplaceinv', 'intmellininv', 'intmellininvshort', 'intnum',
'intnuminit', 'intnuminitgen', 'intnumromb', 'intnumstep', 'prod', 'prodeuler', 'prodinf',
'solve', 'sum', 'sumalt', 'sumdiv', 'suminf', 'sumnum', 'sumnumalt', 'sumnuminit', 'sumpos',
'Euler', 'I', 'Pi', 'abs', 'acos', 'acosh', 'agm', 'arg', 'asin', 'asinh', 'atan', 'atanh',
'bernfrac', 'bernreal', 'bernvec', 'besselh1', 'besselh2', 'besseli', 'besselj', 'besseljh',
'besselk', 'besseln', 'cos', 'cosh', 'cotan', 'dilog', 'eint1', 'erfc', 'eta', 'exp', 'gamma',
'gammah', 'hyperu', 'incgam', 'incgamc', 'lngamma', 'log', 'polylog', 'psi', 'sin', 'sinh',
'sqr', 'sqrt', 'sqrtn', 'tan', 'tanh', 'teichmuller', 'theta', 'thetanullk', 'weber', 'zeta',
'algdep', 'charpoly', 'concat', 'lindep', 'listcreate', 'listinsert', 'listkill', 'listpop',
'listput', 'listsort', 'matadjoint', 'matcompanion', 'matdet', 'matdetint', 'matdiagonal',
'mateigen', 'matfrobenius', 'mathess', 'mathilbert', 'mathnf', 'mathnfmod', 'mathnfmodid',
'matid', 'matimage', 'matimagecompl', 'matindexrank', 'matintersect', 'matinverseimage',
'matisdiagonal', 'matker', 'matkerint', 'matmuldiagonal', 'matmultodiagonal', 'matpascal',
'matrank', 'matrix', 'matrixqz', 'matsize', 'matsnf', 'matsolve', 'matsolvemod',
'matsupplement', 'mattranspose', 'minpoly', 'qfgaussred', 'qfjacobi', 'qflll', 'qflllgram',
'qfminim', 'qfperfection', 'qfrep', 'qfsign', 'setintersect', 'setisset', 'setminus',
'setsearch', 'setunion', 'trace', 'vecextract', 'vecsort', 'vector', 'vectorsmall', 'vectorv'),
2 => array('TeXstyle', 'breakloop', 'colors', 'compatible', 'datadir', 'debug', 'debugfiles',
'debugmem', 'echo', 'factor_add_primes', 'factor_proven', 'format', 'graphcolormap',
'graphcolors', 'help', 'histfile', 'histsize', 'lines', 'log', 'logfile', 'new_galois_format',
'output', 'parisize', 'path', 'prettyprinter', 'primelimit', 'prompt_cont', 'prompt', 'psfile',
'readline', 'realprecision', 'realprecision', 'recover', 'secure', 'seriesprecision',
'simplify', 'strictmatch', 'timer'),
3 => array('void', 'bool', 'negbool', 'small', 'int', 'real', 'mp', 'var', 'pol', 'vecsmall',
'vec', 'list', 'str', 'genstr', 'gen', 'lg', 'typ')
),
'SYMBOLS' => array(
1 => array(
'(', ')', '{', '}', '[', ']', '+', '-', '*', '/', '%', '=', '<', '>', '!', '^', '&', '|', '?', ';', ':', ','
)
),
'CASE_SENSITIVE' => array(
GESHI_COMMENTS => false,
1 => true, 2 => true
),
'STYLES' => array(
'KEYWORDS' => array(1 => 'color: #0000FF;', 2 => 'color: #00d2d2;', 3 => 'color: #ff8000;'
),
'COMMENTS' => array(
1 => 'color: #008000;',
'MULTI' => 'color: #008000;'
),
'ESCAPE_CHAR' => array(
0 => 'color: #111111; font-weight: bold;'
),
'BRACKETS' => array(
0 => 'color: #009900;'
),
'STRINGS' => array(
0 => 'color: #800080;'
),
'NUMBERS' => array(
0 => 'color: #000000;',
),
'METHODS' => array(
0 => 'color: #004000;'
),
'SYMBOLS' => array(
1 => 'color: #339933;'
),
'REGEXPS' => array(),
'SCRIPT' => array()
),
'URLS' => array(1 => '', 2 => ''),
'OOLANG' => true,
'OBJECT_SPLITTERS' => array(1 => '.'),
'REGEXPS' => array(),
'STRICT_MODE_APPLIES' => GESHI_NEVER,
'SCRIPT_DELIMITERS' => array(),
'HIGHLIGHT_STRICT_BLOCK' => array()
);
 
?></lang></div>
 
: Update: Submitted to the [http://sourceforge.net/tracker/?func=detail&aid=3303485&group_id=114997&atid=670234 GeSHi issue tracker]. [[User:CRGreathouse|CRGreathouse]] 15:50, 18 May 2011 (UTC)
 
= GeShi power appears to be very limited =
 
Look at this: no recogition of embedded command substitution syntax within the string:
 
<lang bash># this is <lang bash>
echo "$(foo "$(bar "asdf\"")")"</lang>
 
Why is the last closing parenthesis green? WTF?
:Because GeSHi doesn't implement recursive matching of strings with nested shell commands (as this would cause quite some trouble with other places. IF you write up some proper PCRE that properly matches such strings, just provide it to me and I'm happy to include it. --[[User:BenBE|BenBE]] 02:38, 28 January 2012 (UTC)
 
Type that same example above into Vim and it's handled perfectly by Vim's recursive, hierarchical language of syntax highlighting regions.
 
Also, what about this:
 
<lang bash>#
cat <<!
echo while true do ; done if fi
what the hell
!</lang>
 
:Use the more common
:<lang bash>#
cat <<HEREDOC
echo while true do ; done if fi
what the hell
HEREDOC</lang>
:and everything is fine. But if you can provide me with a more complete list of allowed characters in the definition of a HEREDOC spec, I'll try to add it. --[[User:BenBE|BenBE]] 01:12, 28 January 2012 (UTC)
 
Keywords are being highlighted inside a here document, which is verbatim text. Shell expressions can occur in a here document, but only as command substitutions $(...).
:GeSHi as used at RC is a mostly context-free parser. If you want something that's context-aware use GeSHi 1.1.X. But unfortunately you can't mix both versions in one script easily. And since GeSHi 1.0.X has a much broader language support, RC is using the stable 1.0.X version. --[[User:BenBE|BenBE]] 01:12, 28 January 2012 (UTC)
 
Sorry, this is not a usable syntax coloring system.
:Write a better one and come back then. --[[User:BenBE|BenBE]] 01:12, 28 January 2012 (UTC)
:: If I write a better one, will Rosetta switch to it? I have absolutely no use for GeShi (and therefore not for any replacement for GeShi, either) except that it's the only system supported in Rosetta. Why would I waste my spare time hacking on this when I can, like, put my spare time programming cycles into something better, like my own project. If we could use some HTML tags, the problem would be solved. Vim does the syntax highlighting perfectly, and can put out HTML that you can cut and paste into a web page or wiki. Say, maybe the HTML put out by Vim can be machine translated into colorized Wikimedia markup [http://en.wikipedia.org/wiki/Help:Wiki_markup#Coloring_text]. This may be the key to a GeShi-free solution, worth looking into.[[Special:Contributions/192.139.122.42|192.139.122.42]] 01:51, 28 January 2012 (UTC)
::: Well, let me thing about this for a moment ... No, you don't really want this. No. You don't! --[[User:BenBE|BenBE]] 02:25, 28 January 2012 (UTC)
::::: Proof of concept:<br><div class="text highlighted_source" style="border:1pt dashed black;white-space:pre;overflow:auto;background:white;color:black;padding:1em;border:1px dashed #2f6fab;color:black;background-color:#f9f9f9;line-height:1.3em"><code><span style="color: #800090; background-color: #f0f0f0">#include </span><span style="color: #077807; background-color: #f0f0f0">&lt;stdio.h&gt;</span><br><br><span style="color: #912f11; background-color: #f0f0f0; font-weight: bold">char</span> input[] =<br>        <span style="color: #077807; background-color: #f0f0f0">&quot;Character,Speech</span><span style="color: #912f11; background-color: #f0f0f0">\n</span><span style="color: #077807; background-color: #f0f0f0">&quot;</span><br>        <span style="color: #077807; background-color: #f0f0f0">&quot;The multitude,The messiah! Show us the messiah!</span><span style="color: #912f11; background-color: #f0f0f0">\n</span><span style="color: #077807; background-color: #f0f0f0">&quot;</span><br>        <span style="color: #077807; background-color: #f0f0f0">&quot;Brians mother,&lt;angry&gt;Now you listen here! He's not the messiah; &quot;</span><br>                <span style="color: #077807; background-color: #f0f0f0">&quot;he's a very naughty boy! Now go away!&lt;/angry&gt;</span><span style="color: #912f11; background-color: #f0f0f0">\n</span><span style="color: #077807; background-color: #f0f0f0">&quot;</span><br>        <span style="color: #077807; background-color: #f0f0f0">&quot;The multitude,Who are you?</span><span style="color: #912f11; background-color: #f0f0f0">\n</span><span style="color: #077807; background-color: #f0f0f0">&quot;</span><br>        <span style="color: #077807; background-color: #f0f0f0">&quot;Brians mother,I'm his mother; that's who!</span><span style="color: #912f11; background-color: #f0f0f0">\n</span><span style="color: #077807; background-color: #f0f0f0">&quot;</span><br>        <span style="color: #077807; background-color: #f0f0f0">&quot;The multitude,Behold his mother! Behold his mother!&quot;</span>;<br><br><span style="color: #912f11; background-color: #f0f0f0; font-weight: bold">int</span> main()<br>{<br>        <span style="color: #912f11; background-color: #f0f0f0; font-weight: bold">char</span> *s = input;<br>        printf(<span style="color: #077807; background-color: #f0f0f0">&quot;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&quot;</span>);<br>        <span style="color: #1f3f81; background-color: #f0f0f0; font-weight: bold">for</span> (s = input; *s; s++) {<br>                <span style="color: #1f3f81; background-color: #f0f0f0; font-weight: bold">switch</span>(*s) {<br>                <span style="color: #1f3f81; background-color: #f0f0f0; font-weight: bold">case</span> <span style="color: #912f11; background-color: #f0f0f0">'\n'</span>: printf(<span style="color: #077807; background-color: #f0f0f0">&quot;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&quot;</span>); <span style="color: #1f3f81; background-color: #f0f0f0; font-weight: bold">break</span>;<br>                <span style="color: #1f3f81; background-color: #f0f0f0; font-weight: bold">case</span> <span style="color: #077807; background-color: #f0f0f0">','</span>:  printf(<span style="color: #077807; background-color: #f0f0f0">&quot;&lt;/td&gt;&lt;td&gt;&quot;</span>); <span style="color: #1f3f81; background-color: #f0f0f0; font-weight: bold">break</span>;<br>                <span style="color: #1f3f81; background-color: #f0f0f0; font-weight: bold">case</span> <span style="color: #077807; background-color: #f0f0f0">'&lt;'</span>:  printf(<span style="color: #077807; background-color: #f0f0f0">&quot;&amp;lt;&quot;</span>); <span style="color: #1f3f81; background-color: #f0f0f0; font-weight: bold">break</span>;<br>                <span style="color: #1f3f81; background-color: #f0f0f0; font-weight: bold">case</span> <span style="color: #077807; background-color: #f0f0f0">'&gt;'</span>:  printf(<span style="color: #077807; background-color: #f0f0f0">&quot;&amp;gt;&quot;</span>); <span style="color: #1f3f81; background-color: #f0f0f0; font-weight: bold">break</span>;<br>                <span style="color: #1f3f81; background-color: #f0f0f0; font-weight: bold">case</span> <span style="color: #077807; background-color: #f0f0f0">'&amp;'</span>:  printf(<span style="color: #077807; background-color: #f0f0f0">&quot;&amp;amp;&quot;</span>); <span style="color: #1f3f81; background-color: #f0f0f0; font-weight: bold">break</span>;<br>                <span style="color: #1f3f81; background-color: #f0f0f0; font-weight: bold">default</span>:   putchar(*s);<br>                }<br>        }<br>        puts(<span style="color: #077807; background-color: #f0f0f0">&quot;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&quot;</span>);<br><br>        <span style="color: #1f3f81; background-color: #f0f0f0; font-weight: bold">return</span> <span style="color: #077807; background-color: #f0f0f0">0</span>;<br>}<br></code></div>[[Special:Contributions/24.85.131.247|24.85.131.247]] 06:59, 28 January 2012 (UTC)
::::::I put <code>text</code> and <code>highlighted_code</code> classes onto the code tag, but nothing. RC's style sheet only asserts this on pre tags. I think that's where the dotted line border style is coming from, without which this is uselessly inconsistent.[[Special:Contributions/24.85.131.247|24.85.131.247]] 07:13, 28 January 2012 (UTC)
::: RC uses GeSHi in part because it's the best out there which can be integrated into PHP (or, at least, has been), and in part because I can trust BenBE enough to ''give him access to the server'', where he handles upgrading GeSHI for me. It reduces my maintenance load. He's also a little easier to work with. Coming in, ranting and raving as you appear to have done, does ''not'' make me want to work with you. --[[User:Short Circuit|Michael Mol]] 03:33, 28 January 2012 (UTC)
 
I'm giving up on defining a syntax coloring scheme for my language, since the official stuff in the GeShi distribution isn't doing the kinds of things that I need to do even a 60% accurate job of it. [[Special:Contributions/192.139.122.42|192.139.122.42]] 23:01, 27 January 2012 (UTC)
: Provide patches upstream and I'm sure to take care of it. Just complaining about the world being stupid doesn't help anyone. --[[User:BenBE|BenBE]] 01:12, 28 January 2012 (UTC)
: GeSHi also has problems with comments in Bash, and with here documents in Ruby. Many of the current syntax-highlighting rules are not correct. --[[User:Kernigh|Kernigh]] 00:32, 28 January 2012 (UTC)
:: And since nobody reported the problems here or upstream its unlikely they will be fixed soon. --[[User:BenBE|BenBE]] 01:12, 28 January 2012 (UTC)
 
= GeShi appears have become 99% transparent =
I just noticed that many code specimen on RC no longer have their Syntax Highlighting apparent. At first I thought it may be just me, but I have the problem in both Firefox and Chrome. So I checked wikipedia and there the Highlighting still appears fine. eg [[wp:ALGOL_68C#The_ENVIRON_and_USING_clauses|ALGOL_68C]], Note the <font color="red">RED</font> where a non standard keyword is used.
By way of contrast <font color="red">ENVIRON</font> in the following is not <font color="red">RED</font> (currently) :
<lang algol68>BEGIN
INT dim = 3; # a constant #
INT a number := 120; # a variable #
ENVIRON EXAMPLE1;
MODE MATRIX = [dim, dim]REAL; # a type definition #
MATRIX m1;
a number := ENVIRON EXAMPLE2;
print((a number))
END</lang>
 
A good place to see the problem is in [[Hello_world]]. eg in [[Hello_world#Python]] & al. I (at least) cannot see any highlighting.
Then when one takes a closer look at the HTML source to the code specimen one finds:
<lang html><pre class="python highlighted_source"><span class="kw1">print</span> <span class="st0">"Goodbye, World!"</span></pre></lang>
 
So it looks like there is a missing style sheet for class="python highlighted_source" & others.
 
Here is the HTML for ALGOL_68:
<lang html><pre class="algol68 highlighted_source">main<span class="sy1">:</span> <span class="br0">(</span><br>
<span class="kw22">printf</span><span class="br0">(</span>$<span class="st0">"Goodbye, World!"</span>l$<span class="br0">)
</span><br><span class="br0">)</span><</pre></lang>
 
A missing style sheet for class="algol68 highlighted_source" maybe?
 
Work around is: think in monochrome! :-)
 
[[User:NevilleDNZ|NevilleDNZ]] 03:49, 20 March 2013 (UTC)
 
Update... today the highlighting is working fine in Algol68 and Python and probably everything else....
 
Problem resolved by some phantom somewhere :-)
 
I note that the wikipedia color schemes are different from rosettacode GeShi color schemes.... Not a big problem, but is there someone somewhere that has proposed a viable "standard" color scheme for syntax highlighting. GeShi itself hints at it, but gedit and vim hint totally different ideas.
 
[[User:NevilleDNZ|NevilleDNZ]] 07:03, 22 March 2013 (UTC)
 
= Highlighting for МК-61 =
I propose to install a syntax highlighting of MK-61/52: [http://pastebin.com/BNByHpac file]. [[User:Русский|Русский]] ([[User talk:Русский|talk]]) 16:02, 11 March 2014 (UTC)
: Or think the highlighting for it is not necessary and the code is clear so? [[User:Русский|Русский]] ([[User talk:Русский|talk]]) 16:09, 12 March 2014 (UTC)
: Do not present the technical opportunities to add new lighting? 19:18, 20 April 2014 (UTC)
:: I think you need to send a pull request if you want to add your language file to GeSHi. The repository is on [https://github.com/GeSHi/geshi-1.0 GitHub]. --[[User:AndiPersti|Andreas Perstinger]] ([[User talk:AndiPersti|talk]]) 06:53, 23 April 2014 (UTC)
::: So, I've finally managed to add a pull request for Phix, any idea how long that will take? [[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 01:00, 25 October 2015 (UTC)
* [https://github.com/GeSHi/geshi-1.0/blob/master/src/geshi/mk-61.php]
*: Is there still someone alive here? When is the update? 14:20, 13 May 2017 (UTC)
 
= AppleScript Comments =
AppleScript '#' comments do not get properly highlighted, nor do nested comments
 
=Tags: lang rsplus vs lang r=
I'm an R user and, like many of the R solutions on this site, when I want to contribute a solution in R, I do what seems to be the natural thing and start my solution with a '''lang r''' tag. This doesn't introduce any special formatting, but I didn't know to expect it to. Recently, I've noticed other R solutions on the site that start their code with '''lang rsplus''' tags and these appear to format the submitted code with nice colours that make R users smile. This raises a few questions that I'd like answered:
 
1) Is there any reason that any one of '''lang r''' or '''lang rsplus''' may be considered the correct option? If so, I'll gladly convert all of my solutions to the correct option.
 
2) Why does '''lang r''' appear to do nothing? Why does it not have the same functionality as '''lang rsplus'''? Is there a template that could be copied to give them the same functionality?
 
3) If the answer to #2 is anything to do with avoiding duplication of work, then is it possible to do a site-wide replacement of one tag for another (e.g. replace all '''lang r''' tags with '''lang rsplus''' tags)? Users would be much less likely to use an incorrect tag if they have never seen it before.
 
As an example of the difference between '''lang r''' and '''lang rsplus''' tags, have a look at the two solutions found at https://rosettacode.org/wiki/Left_factorials#R
--[[User:ReeceGoding|ReeceGoding]] ([[User talk:ReeceGoding|talk]]) 20:03, 18 June 2020 (UTC)
 
= Updating =
Does the site ever update syntax highlighting at all? [[User:Русский|Русский]] ([[User talk:Русский|talk]]) 10:37, 8 March 2021 (UTC)