texmacs-dev
[Top][All Lists]
Advanced

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

Re: [Texmacs-dev] plugin for Haskell


From: BB
Subject: Re: [Texmacs-dev] plugin for Haskell
Date: Fri, 27 Jul 2018 18:23:22 +0200

Dear All,

For finishing properly the creation of a plugin for Haskell, I need to add the following modifications in a file named init-haskell.scm that I wrote by analogy on what I observed for some other Texmacs plugins (but without having a real understanding of how that works).
I want to modify (haskell-serialize lan t) by adding:

[1]  :  (string-replace s "\"" "''")  "\n")

In order to substitute two simple quotes by on double quote.
With that the plugin can accept the definition of a string like 
name = "blabla"

I also nees the following :

[2]   :  (string-replace s "\n" "~")  "\n")

That is for interpreting multiline expressions, or some code with Haskell indentation.

When only [1] or [2] is introduced, that produces the expected result, but I don’t know how to get both of then.

For example if I try 

(define (haskell-serialize lan t)
  (with u (pre-serialize lan t)
    (with s (texmacs->code (stree->tree u))
       (string-append  (string-replace s "\"" "''")  "\n")
       (string-append  (string-replace s "\n" "~")  "\n")
      )))

, then in that case only the last replacement is implemented...

Greetings,
Bertrand

reply via email to

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