1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253(************************************************************************)(* * The Coq Proof Assistant / The Coq Development Team *)(* v * Copyright INRIA, CNRS and contributors *)(* <O___,, * (see version control and CREDITS file for authors & dates) *)(* \VV/ **************************************************************)(* // * This file is distributed under the terms of the *)(* * GNU Lesser General Public License Version 2.1 *)(* * (see LICENSE file for the text of the license) *)(************************************************************************)openUtilopenGoptionsopenVernacexprletvernac_set_option0~locality~stagekeyopt=matchoptwith|OptionUnset->unset_option_value_gen~locality~stagekey|OptionSetStrings->set_string_option_value_gen~locality~stagekeys|OptionSetIntn->set_int_option_value_gen~locality~stagekey(Somen)|OptionSetTrue->set_bool_option_value_gen~locality~stagekeytrueletvernac_set_append_option~locality~stagekeys=set_string_option_append_value_gen~locality~stagekeysletvernac_set_option~locality~stagetablev=matchvwith|OptionSetStrings->(* We make a special case for warnings and debug flags because appending is
their natural semantics *)ifCString.List.equaltable["Warnings"]||CString.List.equaltable["Debug"]thenvernac_set_append_option~locality~stagetableselselet(last,prefix)=List.sep_lasttableinifString.equallast"Append"&¬(List.is_emptyprefix)thenvernac_set_append_option~locality~stageprefixselsevernac_set_option0~locality~stagetablev|_->vernac_set_option0~locality~stagetablevletiter_tablefkv=Goptions.iter_table(Global.env())fkvletvernac_add_option=iter_table{aux=funtable->table.add}letvernac_remove_option=iter_table{aux=funtable->table.remove}letvernac_mem_option=iter_table{aux=funtable->table.mem}letvernac_print_optionkey=try(get_ref_tablekey).print()withNot_found->try(get_string_tablekey).print()withNot_found->tryprint_option_valuekeywithNot_found->error_undeclared_keykey