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

caml-list - the Caml user's mailing list

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.vuxu.org/caml-list
	git clone --mirror https://inbox.ocaml.org/caml-list

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 caml-list caml-list/ https://inbox.vuxu.org/caml-list \
		caml-list@inria.fr
	public-inbox-index caml-list

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.caml-list


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git