summaryrefslogtreecommitdiffstats
path: root/otherlibs/labltk/builtin/builtin_FilePattern.ml
diff options
context:
space:
mode:
authorJun FURUSE / 古瀬 淳 <jun.furuse@gmail.com>2002-04-26 12:16:26 +0000
committerJun FURUSE / 古瀬 淳 <jun.furuse@gmail.com>2002-04-26 12:16:26 +0000
commitc54baa5bd6c2a6d8addbea0613998e89d8cf4167 (patch)
treefe926e50c17b7d67fcde37d2ef713bcc896a05e1 /otherlibs/labltk/builtin/builtin_FilePattern.ml
parent82be04fd96c67653a27562c3f157674c99db84c2 (diff)
merge the branch mltk
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4745 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'otherlibs/labltk/builtin/builtin_FilePattern.ml')
-rw-r--r--otherlibs/labltk/builtin/builtin_FilePattern.ml20
1 files changed, 20 insertions, 0 deletions
diff --git a/otherlibs/labltk/builtin/builtin_FilePattern.ml b/otherlibs/labltk/builtin/builtin_FilePattern.ml
new file mode 100644
index 000000000..f7dd1d60e
--- /dev/null
+++ b/otherlibs/labltk/builtin/builtin_FilePattern.ml
@@ -0,0 +1,20 @@
+(* File patterns *)
+(* type *)
+type filePattern = {
+ typename : string;
+ extensions : string list;
+ mactypes : string list
+ }
+(* /type *)
+
+let cCAMLtoTKfilePattern fp =
+ let typename = TkQuote (TkToken fp.typename) in
+ let extensions =
+ TkQuote (TkTokenList (List.map (fun x -> TkToken x) fp.extensions)) in
+ let mactypes =
+ match fp.mactypes with
+ | [] -> []
+ | [s] -> [TkToken s]
+ | _ -> [TkQuote (TkTokenList (List.map (fun x -> TkToken x) fp.mactypes))]
+ in
+ TkQuote (TkTokenList (typename :: extensions :: mactypes))