Re: Outlang for S-expressions
Lorenzo Bettini <[email protected]> Sun, 01 Jun 2014 15:11:19 +0200
| Newsgroups | gmane.comp.gnu.source-highlight.general |
|---|---|
| Message-ID | <[email protected]> |
On 01/06/2014 12:08, Dario Teixeira wrote: > Hi, > > I'm the developer of Camlhighlight [1], a small library that uses > GNU Source-highlight to provide syntax highlighting facilities for > Ocsigen applications. (Ocsigen is a web programming framework for > the OCaml language [2,3]). > > The method I'm using to parse Source-highlight's output is a bit > of a hack, but it's simple and it works perfectly. Essentially, > I've defined a new outlang that outputs S-expressions (as in LISP), > which are trivial to convert into OCaml data structures. However, > this approach requires that users install the new outlang file into > their /usr/share/source-highlight directory (perhaps Source-highlight > also supports a home-local installation -- I haven't checked). > > Anyway, since this approach is generic enough and may be useful to > other libraries/applications that rely on Source-highlight, would it > possible for the S-expression outlang to ship with the library by > default? It's contents are really trivial, requiring only special > care to escape the backslash and the double commas: > > ====== sexp.outlang ====== > > > onestyle "($style \"$text\")" > > translations > "\\" "\\\\" > "\"" "\\\"" > end > ========================== > > What do you think? > > Thanks in advance for your time! > Kind regards, > > Dario Teixeira > > > [1] http://camlhighlight.forge.ocamlcore.org/ > [2] http://ocsigen.org/ > [3] http://ocaml.org/ Hi Dario please file a bug/issue request with all the attached information. I'm really busy this period, so I can't promise I'll add this outlang really soon... cheers Lorenzo -- Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino HOME: http://www.lorenzobettini.it Xtext Book: http://www.packtpub.com/implementing-domain-specific-languages-with-xtext-and-xtend/book