OCaml Forge
SCM

Detail: [#959] interactive mode: eval-phrase determines wrong region for modules with both structure and signature

Bugs: Browse | Download .csv | Monitor

[#959] interactive mode: eval-phrase determines wrong region for modules with both structure and signature

Date:
2011-04-24 06:17
Priority:
3
State:
Open
Submitted by:
Gabriel Scherer (bluestorm)
Assigned to:
Nobody (None)
Hardware:
None
Resolution:
None
Severity:
None
Version:
None
Component:
None
Operating System:
None
Product:
None
 
URL:
Summary:
interactive mode: eval-phrase determines wrong region for modules with both structure and signature

Detailed description
Both the following code snippets fail when I try to send them to the toplevel using `tuareg-eval-phrase` :

module A : sig
val x : int
end = struct
let x = 0
end


module A = (
struct
let x = 0
end
:
sig
val x : int
end)

In both cases, Tuareg only send the phrase upto the first "end", which results in syntax errors.

Followup

Message
Date: 2013-11-27 22:09
Sender: Evgeny Roubinchtein

I hit this also. As a stop-gap measure, I replaced the uses of `tuareg-discover-phrase' with `caml-find-phrase': so far, my experience seems to be an overall improvement ( 'tuareg-eval-phrase' uses `tuareg-discover-pharse' to find the portion of the buffer it needs to send to OCaml toplevel). The specific Elisp code I used appears below:

(defadvice tuareg-discover-phrase (around use-caml-find-phrase)
"Replace uses of `tuareg-discover-phrase' with `caml-find-phrase'"
(save-excursion
(let ((begin (caml-find-phrase)))
(setq ad-return-value (list begin (point) (point))))))
(ad-activate 'tuareg-discover-phrase t)

The above does assume that caml.el is avaliable: I used Emacs package.el to install tuareg, and tuareg package depends on the caml package, so, things "work for me."

Attached Files:

Changes:

No Changes Have Been Made to This Item