Initial version.
[xavierbot.git] / pa_noexternal.ml
diff --git a/pa_noexternal.ml b/pa_noexternal.ml
new file mode 100644 (file)
index 0000000..07723dd
--- /dev/null
@@ -0,0 +1,21 @@
+(* Delete the "external" word from the language.
+ * $Id: pa_noexternal.ml,v 1.1 2007/06/28 19:47:26 rjones Exp $
+ *)
+
+open Printf
+open Camlp4.PreCast
+open Syntax
+
+(*DELETE_RULE Gram
+  str_item: "external"; LIDENT; ":"; ctyp; "="; LIST0 [ STRING ]
+END;;*)
+
+(* DELETE_RULE above didn't work.  Easier just to overwrite the rule. *)
+EXTEND Gram
+  GLOBAL: str_item;
+
+  str_item: LEVEL "top" [
+    [ "external"; LIDENT; ":"; ctyp; "="; LIST0 [ STRING ] ->
+       <:str_item< print_endline "'external' keyword disabled" >> ]
+  ];
+END;;