| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
type import_status = ImportDefaultBehavior | ImportNeedQualified |
| 14 |
type definition_scope = Discharge | Global of import_status |
| 15 |
|
| 16 |
let default_scope = Global ImportDefaultBehavior |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
let make_non_locality = function Some false -> false | _ -> true |
| 26 |
|
| 27 |
let make_locality = function Some true -> true | _ -> false |
| 28 |
|
| 29 |
let enforce_locality locality_flag = |
| 30 |
make_locality locality_flag |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
let make_section_locality = |
| 37 |
function Some b -> b | None -> Lib.sections_are_opened () |
| 38 |
|
| 39 |
let enforce_section_locality locality_flag = |
| 40 |
make_section_locality locality_flag |
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
let make_module_locality = function |
| 49 |
| Some false -> |
| 50 |
if Lib.sections_are_opened () then |
| 51 |
CErrors.user_err Pp.(str |
| 52 |
"This command does not support the Global option in sections."); |
| 53 |
false |
| 54 |
| Some true -> true |
| 55 |
| None -> false |
| 56 |
|
| 57 |
let enforce_module_locality locality_flag = |
| 58 |
make_module_locality locality_flag |
| 59 |
|
| 60 |
let check_locality_nodischarge : Libobject.locality -> unit = function |
| 61 |
| Local -> () |
| 62 |
| Export -> |
| 63 |
if Lib.sections_are_opened () then |
| 64 |
CErrors.user_err Pp.(str "This command does not support the export attribute in sections.") |
| 65 |
| SuperGlobal -> |
| 66 |
if Lib.sections_are_opened () then |
| 67 |
CErrors.user_err Pp.(str "This command does not support the global attribute in sections.") |