summaryrefslogtreecommitdiffstats
path: root/camlp4/test/fixtures
diff options
context:
space:
mode:
authorNicolas Pouillard <np@nicolaspouillard.fr>2008-09-19 12:56:26 +0000
committerNicolas Pouillard <np@nicolaspouillard.fr>2008-09-19 12:56:26 +0000
commitff4580e3b8f80daf2200ae5db7553a914797d9ef (patch)
tree90e997d5f011fc30a28156944fdf9951df7587f1 /camlp4/test/fixtures
parentf0de463f2879ce16db1f8957e8c17249a32ed5a6 (diff)
camlp4: even more test fixtures
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9034 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'camlp4/test/fixtures')
-rw-r--r--camlp4/test/fixtures/bug_escaping_quot.ml7
-rw-r--r--camlp4/test/fixtures/metalib.ml5
-rw-r--r--camlp4/test/fixtures/pr4452.ml24
3 files changed, 36 insertions, 0 deletions
diff --git a/camlp4/test/fixtures/bug_escaping_quot.ml b/camlp4/test/fixtures/bug_escaping_quot.ml
new file mode 100644
index 000000000..57e5ecdbd
--- /dev/null
+++ b/camlp4/test/fixtures/bug_escaping_quot.ml
@@ -0,0 +1,7 @@
+open Camlp4.PreCast;;
+Camlp4_config.antiquotations := true;;
+let expand_my_quot_expr _loc _loc_name_opt quotation_contents =
+ Printf.eprintf "%S\n%!" quotation_contents;
+ <:expr< dummy >>
+;;
+Syntax.Quotation.add "my" Syntax.Quotation.DynAst.expr_tag expand_my_quot_expr;;
diff --git a/camlp4/test/fixtures/metalib.ml b/camlp4/test/fixtures/metalib.ml
new file mode 100644
index 000000000..22dff11c6
--- /dev/null
+++ b/camlp4/test/fixtures/metalib.ml
@@ -0,0 +1,5 @@
+#load "camlp4of.cma";;
+open Camlp4.PreCast;;
+module M = Ast.Meta.Make(Ast.Meta.MetaGhostLoc);;
+let ghost = Loc.ghost;;
+M.Expr.meta_ctyp ghost <:ctyp@ghost< int >>;;
diff --git a/camlp4/test/fixtures/pr4452.ml b/camlp4/test/fixtures/pr4452.ml
new file mode 100644
index 000000000..bed7db7b7
--- /dev/null
+++ b/camlp4/test/fixtures/pr4452.ml
@@ -0,0 +1,24 @@
+open Camlp4.PreCast
+
+let _loc = Loc.mk "?"
+
+let base base fields ty =
+ let fields = List.fold_right (fun field acc ->
+ let c = <:ctyp< $lid:field$ : $uid:field$.record >> in
+ <:ctyp< $c$ ; $acc$ >>) fields <:ctyp< >>
+ in
+ <:module_binding< $uid:base$ :
+ sig type record = {
+ key : $ty$;
+ $fields$
+ } end = struct
+ type record = {
+ key : $ty$;
+ $fields$
+ } end
+ >>
+
+let _ =
+ let b = base "b" ["f1"; "f2"] <:ctyp< int >> in
+ Camlp4.PreCast.Printers.OCaml.print_implem
+ <:str_item< module rec $b$ >>