Talk:Village Pump:Home/Syntax Highlighting ( archived 2009-06-18 )

From Rosetta Code
Revision as of 13:46, 19 July 2009 by rosettacode>Dkf (→‎OCaml for Standard ML?: Here's the exact keyword list.)

Linkage

I noticed the existence of this page by accident when I had a quick glance at the "recent changes". I don't think a link to it exists anywhere on the internet (in particular google (through the search box on the left) doesn't know about it. Can/should/ought there be a mechanism to generate a list of links to Village_Pump:Home/somethingsomething in some kind of automagic fashion?Sgeier 17:44, 10 July 2008 (UTC)

I'm not quite sure what you mean. There is a link to Village Pump:Home in the sidebar. There should have been a link on that page for this topic, but I guess we forgot about it. Also, the google search on the left isn't updated very often. It's only marginally better than the default wiki search. --Mwn3d 17:53, 10 July 2008 (UTC)
There's no link to this page from the main Village Pump page. --Short Circuit 04:39, 12 July 2008 (UTC)

OCaml for Standard ML?

It has been suggested to use the OCaml syntax highlighting for Standard ML, and some SML code has been changed to OCaml highlighting already. While the languages are similar, they have many differences in keywords and stuff, and I feel that Standard ML should have a separate highlighting scheme. For example, SML has "datatype" keyword and OCaml does not; logical operators are "andalso" and "orelse" instead of "&&" and "||"; pattern matching is "case ... of" instead of "match ... with"; the "fn" keyword; and lots of other stuff. If I have time I could try to translate the OCaml GeSHi language file into SML; but I am reluctant to do so as I do not own a copy of the Definition of Standard ML, and so I am not confident I will get everything. --76.91.63.71 08:22, 19 July 2009 (UTC)

Sounds reasonable. Grepping around, I find that the list of keywords is this:
and abstype as case datatype else end eqtype exception do fn fun functor funsig handle if in include infix infixr lazy let local nonfix of op open overload raise rec sharing sig signature struct structure then type val where while with withtype orelse andalso
This list was extracted directly from the lexer's keyword table in the source to the SML/NJ implementation, so it should be complete and accurate. I've not categorized their meaning at all. —Donal Fellows 13:46, 19 July 2009 (UTC)