[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-source-highlight] Outlang for S-expressions

From: Dario Teixeira
Subject: [Help-source-highlight] Outlang for S-expressions
Date: Sun, 1 Jun 2014 03:08:20 -0700 (PDT)


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\")"

"\\"    "\\\\"
"\""    "\\\""

What do you think?

Thanks in advance for your time!
Kind regards,

Dario Teixeira


reply via email to

[Prev in Thread] Current Thread [Next in Thread]