12345678910111213141516171819202122232425262728293031323334353637383940414243(* Claude Code
*
* Copyright (C) 2026 Yoann Padioleau
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License
* (LGPL) as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*)(* See Sexpr.mli *)typespan={start:int;stop:int}typet={datum:datum;span:span}anddatum=|Intofint|Floatoffloat|Strofstring|Symofstring|Charofint|Boolofbool|Listoftlist*toption|Vectoroftlistletmake(datum:datum)(span:span):t={datum;span}letsym(name:string)(span:span):t={datum=Symname;span}letnowhere={start=0;stop=0}letrecto_string(x:t):string=matchx.datumwith|Intn->string_of_intn|Floatf->Printf.sprintf"%g"f|Strs->Printf.sprintf"%S"s|Syms->s|Charc->Printf.sprintf"#\\%c"(Char.chr(cland255))|Boolb->ifbthen"#t"else"#f"|List([{datum=Sym"quote";_};x],None)->"'"^to_stringx|List(xs,tail)->lettail=matchtailwithSomet->" . "^to_stringt|None->""in"("^String.concat" "(List.mapto_stringxs)^tail^")"|Vectorxs->"#("^String.concat" "(List.mapto_stringxs)^")"