123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103(********************************************************************************)(* crs - A tool for managing code review comments embedded in source code *)(* Copyright (C) 2024-2025 Mathieu Barbin <mathieu.barbin@gmail.com> *)(* *)(* This file is part of crs. *)(* *)(* crs is free software; you can redistribute it and/or modify it under the *)(* terms of the GNU Lesser General Public License as published by the Free *)(* Software Foundation either version 3 of the License, or any later version, *)(* with the LGPL-3.0 Linking Exception. *)(* *)(* crs is distributed in the hope that it will be useful, but WITHOUT ANY *)(* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS *)(* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License and *)(* the file `NOTICE.md` at the root of this repository for more details. *)(* *)(* You should have received a copy of the GNU Lesser General Public License *)(* and the LGPL-3.0 Linking Exception along with this library. If not, see *)(* <http://www.gnu.org/licenses/> and <https://spdx.org>, respectively. *)(********************************************************************************)typet=|All|Invalid|CRs|XCRs|Now|Soon|Someday[@@derivingcompare,equal,enumerate,sexp_of]letto_string=function|(All|Invalid|CRs|XCRs|Now|Soon|Someday)ast->(matchsexp_of_ttwith|Atomstr->String.lowercasestr|List_->assertfalse);;letshorthand=function|All->'a'|Invalid->'i'|CRs->'c'|XCRs->'x'|Now->'w'|Soon->'o'|Someday->'d';;letmatchest~cr=matchtwith|All->true|Invalid->(matchCr_comment0.headercrwith|Error_->true|Ok_->false)|CRs->(matchCr_comment0.headercrwith|Error_->false|Okh->(matchCr_comment0.Header.statushwith|XCR->false|CR->(matchCr_comment0.Header.qualifierhwith|None->true|Soon|Someday->false)))|XCRs->(matchCr_comment0.headercrwith|Error_->false|Okh->(matchCr_comment0.Header.statushwith|CR->false|XCR->true))|Now->(matchCr_comment0.headercrwith|Error_->false|Okh->(matchCr_comment0.Header.statushwith|XCR->true|CR->(matchCr_comment0.Header.qualifierhwith|None->true|Soon|Someday->false)))|Soon->(matchCr_comment0.headercrwith|Error_->false|Okh->(matchCr_comment0.Header.statushwith|XCR->false|CR->(matchCr_comment0.Header.qualifierhwith|Soon->true|None|Someday->false)))|Someday->(matchCr_comment0.headercrwith|Error_->false|Okh->(matchCr_comment0.Header.statushwith|XCR->false|CR->(matchCr_comment0.Header.qualifierhwith|Someday->true|None|Soon->false)));;