File: list_normalized.ml

package info (click to toggle)
ocamlformat 0.28.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,436 kB
  • sloc: ml: 63,321; pascal: 4,769; lisp: 229; sh: 217; makefile: 121
file content (20 lines) | stat: -rw-r--r-- 771 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
let x = 1 :: 2 :: 3 :: 4 :: []

(* comments may move during normalization *)
let x = (* a *) 1 (* b *) :: (* c *) 2 :: 3 :: 4 (* d *) :: (* e *) [] (* f *)

(* comments preserved when the normalization cannot be done (attributes) *)
let x = (* a *) 1 (* b *) :: (* c *) 2 :: 3 :: 4 (* d *) :: (* e *) ([][@attr]) (* f *)

(* comments preserved when no normalization required *)
let x = (* a *) [ (* b *) 1 (* c *) ; (* d *) 2 ; 3 ; 4 (* e *) ] (* f *)

let x :: [] = e
let x :: y = e
let x :: y :: [] = e
let x :: y :: ([][@attr]) = e
let x :: (y[@attr]) :: [] = e
let (*a*)x(*b*) :: (*c*)y(*d*) = e
let (*a*)x(*b*) :: (*c*)y(*d*) :: (*e*)[](*f*) = e
let (*a*)x(*b*) :: (*c*)y(*d*) :: (*e*)([][@attr])(*f*) = e
let (*a*)x(*b*) :: (*c*)(y[@attr])(*d*) :: (*e*)[](*f*) = e