caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] line breaking
@ 2021-06-11  6:18 Kenichi Asai
  2021-06-11  6:21 ` Basile Clement
  2021-06-14  0:54 ` Francois Berenger
  0 siblings, 2 replies; 3+ messages in thread
From: Kenichi Asai @ 2021-06-11  6:18 UTC (permalink / raw)
  To: caml-list

Once line breaks are inserted, one can use ocp-indent to properly
indent OCaml code.  Is there a tool to insert line breaks (somehow) to
OCaml code that are written with insufficient (or no) line breaks?

I could think of writing a compiler (using compiler-libs) that parses
the input and immediately pretty print it, but that would remove all
the comments in the program.

-- 
Kenichi Asai

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] line breaking
  2021-06-11  6:18 [Caml-list] line breaking Kenichi Asai
@ 2021-06-11  6:21 ` Basile Clement
  2021-06-14  0:54 ` Francois Berenger
  1 sibling, 0 replies; 3+ messages in thread
From: Basile Clement @ 2021-06-11  6:21 UTC (permalink / raw)
  To: Kenichi Asai, caml-list

https://github.com/ocaml-ppx/ocamlformat is not exactly what you are
asking for but might fit the bill

- Basile

On Fri, 2021-06-11 at 15:18 +0900, Kenichi Asai wrote:
> Once line breaks are inserted, one can use ocp-indent to properly
> indent OCaml code.  Is there a tool to insert line breaks (somehow) to
> OCaml code that are written with insufficient (or no) line breaks?
> 
> I could think of writing a compiler (using compiler-libs) that parses
> the input and immediately pretty print it, but that would remove all
> the comments in the program.
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Caml-list] line breaking
  2021-06-11  6:18 [Caml-list] line breaking Kenichi Asai
  2021-06-11  6:21 ` Basile Clement
@ 2021-06-14  0:54 ` Francois Berenger
  1 sibling, 0 replies; 3+ messages in thread
From: Francois Berenger @ 2021-06-14  0:54 UTC (permalink / raw)
  To: Kenichi Asai; +Cc: caml-list

On 11/06/2021 15:18, Kenichi Asai wrote:
> Once line breaks are inserted, one can use ocp-indent to properly
> indent OCaml code.  Is there a tool to insert line breaks (somehow) to
> OCaml code that are written with insufficient (or no) line breaks?

The unix command 'fmt --width 80' might fill the bill. No?

> I could think of writing a compiler (using compiler-libs) that parses
> the input and immediately pretty print it, but that would remove all
> the comments in the program.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-14  0:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-11  6:18 [Caml-list] line breaking Kenichi Asai
2021-06-11  6:21 ` Basile Clement
2021-06-14  0:54 ` Francois Berenger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).