summaryrefslogtreecommitdiff
path: root/testsuite/tests/parsing/quotedextensions.ml
blob: 738928949143fa9b242b1f2ad14d4313cc98b08e (plain)
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
(* TEST_BELOW
Filler_text_added_
to_preserve_locations_while_tran
slating_from_old_syntax__Filler_
text_added_to_pre
serve_locations_while_translati
*)

(* Structures *)
{%%M.foo| <hello>{x} |}
{%%M.foo bar| <hello>{|x|} |bar}

(* Signatures *)
module type S = sig
  {%%M.foo| <hello>{x} |}
  {%%M.foo bar| <hello>{|x|} |bar}
end

(* Expressions/Pattern/Types *)
let {%M.foo| <hello>{x} |}
  : {%M.foo| <hello>{x} |}
  = {%M.foo| <hello>{x} |}
let {%M.foo bar| <hello>{|x|} |bar}
  : {%M.foo bar| <hello>{|x|} |bar}
  = {%M.foo bar| <hello>{|x|} |bar}

(* Multiline *)
{%%M.foo|
 <hello>
   {x}
 </hello>
|}

(* Double quotes inside quoted strings inside comments *)
(* {|"|}, and *)
(* [%foo {|"|}], and *)
(* {%foo|"|} should be valid inside comments *)

(* Comment delimiters inside quoted strings inside comments: *)
(* {|*)|}, and *)
(* [%foo {bar|*)|bar}], and *)
(* {%foo bar|*)|bar} should be valid inside comments *)

(* TEST
 flags = "-dparsetree";
 ocamlc_byte_exit_status = "2";
 setup-ocamlc.byte-build-env;
 ocamlc.byte;
 check-ocamlc.byte-output;
*)