~ubuntu-branches/ubuntu/trusty/mtasc/trusty-proposed

« back to all changes in this revision

Viewing changes to ocaml/mtasc/plugin.ml

  • Committer: Bazaar Package Importer
  • Author(s): Paul Wise
  • Date: 2006-03-25 17:15:45 UTC
  • Revision ID: james.westby@ubuntu.com-20060325171545-zjh6rxeqehxiv4v2
Tags: upstream-1.12
ImportĀ upstreamĀ versionĀ 1.12

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(*
 
2
 *  MTASC - MotionTwin ActionScript2 Compiler
 
3
 *  Copyright (c)2004 Nicolas Cannasse
 
4
 *
 
5
 *  This program is free software; you can redistribute it and/or modify
 
6
 *  it under the terms of the GNU General Public License as published by
 
7
 *  the Free Software Foundation; either version 2 of the License, or
 
8
 *  (at your option) any later version.
 
9
 *
 
10
 *  This program is distributed in the hope that it will be useful,
 
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 *  GNU General Public License for more details.
 
14
 *
 
15
 *  You should have received a copy of the GNU General Public License
 
16
 *  along with this program; if not, write to the Free Software
 
17
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
18
 *)
 
19
 
 
20
let verbose = ref false
 
21
 
 
22
let options = ref ([] : (string * Arg.spec * string) list)
 
23
 
 
24
let calls = ref ([] : (Typer.context -> unit) list)
 
25
 
 
26
let class_path = ref ([] : string list)
 
27
 
 
28
let find_file f =
 
29
        let rec loop = function
 
30
                | [] -> raise Not_found
 
31
                | p :: l ->
 
32
                        let file = p ^ f in
 
33
                        if Sys.file_exists file then
 
34
                                file
 
35
                        else
 
36
                                loop l
 
37
        in
 
38
        loop !class_path
 
39
 
 
40
let add l f = 
 
41
        options := l @ !options;
 
42
        calls := f :: !calls
 
43