Anonymous avatar Anonymous committed cb25868

camlp4 introduction

Comments (0)

Files changed (2)

+let _ = <:expr<[]>>
+
+open Camlp4
+
+module To = struct
+  let name = "pa_to"  (* change *)
+  let version = "0.0.1"  (* change *)
+end
+
+module Make (Syntax : Sig.Camlp4Syntax) = struct
+  open Sig
+  include Syntax
+  open Ast
+
+  (* 文法拡張部 *)
+  let a _loc = <:expr<[]>>;;
+  let b _loc = <:patt<[]>>;;
+(*  let _ = <:ctyp< 'a list >>;;
+  let _ = <:ctyp< ('a, 'b) Hastbl.t>>;;
+  let _ = <:ctyp< int list option>>;;
+*)
+  let f myloc = <:patt@myloc<[], "", wwaasd, asdf>>
+
+end
+
+let module M = Register.OCamlSyntaxExtension(To)(Make) in ()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.