12345678910111213141516171819202122232425262728293031323334353637383940(**************************************************************************)(* -*- tuareg -*- *)(* *)(* Copyright (C) 2017,2018,2019 Yann Régis-Gianas, Nicolas Jeannerod, *)(* Ralf Treinen. *)(* *)(* This is free software: you can redistribute it and/or modify it *)(* under the terms of the GNU General Public License, version 3. *)(* *)(* Additional terms apply, due to the reproduction of portions of *)(* the POSIX standard. Please refer to the file COPYING for details. *)(**************************************************************************)exceptionDuringParsingofLexing.positionexceptionDuringLexingofLexing.position*stringexceptionDuringAliasingofLexing.position*stringexceptionDuringIOofstringletstring_of_error=function|DuringParsingpos->Printf.sprintf"%s: Syntax error."CSTHelpers.(string_of_lexing_positionpos)|DuringLexing(pos,msg)->Printf.sprintf"%s: Lexical error (%s)."CSTHelpers.(string_of_lexing_positionpos)msg|DuringIOmsg->Printf.sprintf"Input/Output error (%s)."msg|DuringAliasing(pos,msg)->Printf.sprintf"%s: Alias handling limitation (%s)."CSTHelpers.(string_of_lexing_positionpos)msg|Failures->"Failure: "^s^"."|Sys_errors->"Error: "^s^"."|e->raisee