Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Yoann Padioleau <padator@wanadoo.fr>
To: Damien Doligez <Damien.Doligez@inria.fr>
Cc: caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] perfect syntax coloring in emacs
Date: Fri, 9 Dec 2011 10:29:36 -0800	[thread overview]
Message-ID: <4053752C-FA20-4B93-97CC-9B12FA19C7BD@wanadoo.fr> (raw)
In-Reply-To: <6FE3D3B5-3EF3-4B72-B2D0-E068AAA2F397@inria.fr>

There is perfect syntax coloring in Codemap for OCaml :)
https://github.com/facebook/pfff/wiki/CodeMap

It even colorizes differently identifiers for functions, variables, types, etc.

On Dec 9, 2011, at 7:23 AM, Damien Doligez wrote:

> Dear OCaml users,
> 
> I have implemented emacs-lisp code that correctly recognizes all
> comments and strings in OCaml code, and interfaced it with the
> fontification features of Emacs.  The code is committed in the
> SVN repository, but if you want to try it before the next
> release, I'm including it in attachment.
> 
> If you want to know why this is not a trivial problem, consider
> the following OCaml program.
> 
> =======================================================
> let l' _ = ();;
> let _' _ = ();;
> let l' = ();;
> let b2_' = ();;
> let a'a' = ();;
> let f2 _ _ = ();;
> let f3 _ _ _ = ();;
> 
> (* ==== easy stuff ==== *)
> 
> (* a comment *)
> (* "a string" in a comment *)
> (* "another string *)" in a comment *)
> (* not a string '"' in a comment *)
> "a string";;
> '"';;              (* not a string *)
> 
> (* ==== hard stuff ==== *)
> 
> l'"' not not a string ";;
> _'"' also not not a string";;
> f2 0l'"';;            (* not not not a string *)
> f2 0_'"';;            (* also not not not a string *)
> f3 0.0l'"' not not not not a string ";;
> f3 0.0_'"';;          (* not not not not not a string *)
> f2 0b1_'"';;         (* not not not a string *)
> f3 0b2_'"'  not not not not a string ";;
> f3 0b02_'"';;         (* not not not not not a string *)
> '\'';;   (* a char *)
> '
> ';;      (* a char *)
> '^M
> ';;      (* also a char [replace ^M with one CR character] *)
> a'a';;   (* not a char *)
> type '
> a' t = X;;   (* also not a char *)
> =======================================================
> 
> 
> Obligatory troll: try to do the same in vim!
> 
> -- Damien
> 
> 
> -- 
> Caml-list mailing list.  Subscription management and archives:
> https://sympa-roc.inria.fr/wws/info/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
> 
> <caml-font.el>
> 



      reply	other threads:[~2011-12-09 18:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-09 15:23 Damien Doligez
2011-12-09 18:29 ` Yoann Padioleau [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4053752C-FA20-4B93-97CC-9B12FA19C7BD@wanadoo.fr \
    --to=padator@wanadoo.fr \
    --cc=Damien.Doligez@inria.fr \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox