File: prefix_infix.ml.ref

package info (click to toggle)
ocamlformat 0.29.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,820 kB
  • sloc: ml: 65,176; pascal: 4,877; lisp: 229; sh: 217; makefile: 121
file content (65 lines) | stat: -rw-r--r-- 816 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
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
let _ = List.filter (( != ) e) l

let _ = List.map (( != ) x) l

let _ = x != y

let _ = - !e

let _ = - !e.f

let z = (( ! ) ~x:4) 1 2 ~c:3

let z = (( ! ) ~x:4 y z) 1 2 ~c:3

let z = (( ! ) ~x:4 [@attr]) 1 2 ~c:3

let z = (( ! ) [@attr]) 1 2 ~c:3

let z = ( ! ) [@attr]

let i x = (!r [@attr]) x

let _ = ( * ) [@attr]

let _ = f (( * ) [@attr]) ;;

(( * ) [@attr]) (* TEST_BELOW *)
(* Int and float plus and minus operators *)
- 1
;;

1 ;;

-1.0 ;;

1.0 ;;

-1.0 ;;

1.0 ;;

(* Prefix operator *)
~+2 ;;

(* With attributes attached to the argument *)
-(1 [@foo]) ;;

+(1 [@foo]) ;;

-(1.0 [@foo]) ;;

+(1.0 [@foo]) ;;

-.(1.0 [@foo]) ;;

+.(1.0 [@foo]) ;;

~+(2 [@foo])

(* TEST
 flags = "-dparsetree -dno-locations -stop-after parsing";
 setup-ocamlc.byte-build-env;
 ocamlc.byte;
 check-ocamlc.byte-output;
*)