File: flag.ml

package info (click to toggle)
coccinelle 1.0.8.deb-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 26,148 kB
  • sloc: ml: 136,392; ansic: 23,594; sh: 2,189; makefile: 2,157; perl: 1,576; lisp: 840; python: 823; awk: 70; csh: 12
file content (68 lines) | stat: -rw-r--r-- 2,073 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
(*
 * This file is part of Coccinelle, licensed under the terms of the GPL v2.
 * See copyright.txt in the Coccinelle source code for more information.
 * The Coccinelle source code can be obtained at http://coccinelle.lip6.fr
 *)

let sgrep_mode2 = ref false

let show_misc = ref true

let show_transinfo = ref false

let show_trying = ref false

let track_iso_usage = ref false

let worth_trying_opt = ref true

type scanner = IdUtils | Glimpse | CocciGrep | GitGrep | NoScanner
let scanner = ref NoScanner

let pyoutput = ref "coccilib.output.Console"

let ocamlc = ref Commands.ocamlc_cmd
let ocamlopt = ref Commands.ocamlopt_cmd
let ocamldep = ref Commands.ocamldep_cmd
let ocamlfind = ref Commands.ocamlfind_cmd

(*"Some" value is the path with respect to which the patch should be created*)
let patch = ref (None : string option)

let make_hrule = ref (None : string (*dir*) option)
let hrule_per_file = ref true (* if false, then a rule per function *)

let currentfile = ref (None : string option) (* file of current code *)
let currentfiles = ref ([] : string list) (* starting files of this run *)

let current_element = ref ""
let current_element_pos = ref(lazy((0,0),(0,0)))
let dir = ref ""

let defined_virtual_rules = ref ([] : string list)
let defined_virtual_env = ref ([] : (string*string) list)

let set_defined_virtual_rules s =
  match Str.split_delim (Str.regexp "=") s with
    [_] -> defined_virtual_rules := s :: !defined_virtual_rules
  | name::vl ->
      let vl = String.concat "=" vl in
      defined_virtual_env := (name,vl) :: !defined_virtual_env
  | _ -> failwith "nothing defined"

let c_plus_plus = ref false
let ibm = ref false

(* was in main *)
let include_headers = ref false
let no_include_cache = ref false

let parmap_cores      = ref (None : int option)
let parmap_chunk_size = ref (None : int option)

exception UnreadableFile of string

let cocci_attribute_names = ref ([] : string list)
let add_cocci_attribute_names s =
  if not (List.mem s !cocci_attribute_names)
  then cocci_attribute_names := s :: !cocci_attribute_names