1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950(*
* BatScanf - Extended Scanf module
* Copyright (C) 2009 David Rajchenbach-Teller, LIFO, Universite d'Orleans
*
* This library 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 2.1 of the License, or (at your option) any later version,
* with the special exception on linking described in file LICENSE.
*
* This library 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 for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*)moduleScanning=structincludeScanf.Scanningletfrom_inputinp=from_function(fun()->tryBatInnerIO.readinpwithBatInnerIO.No_more_input->raiseEnd_of_file)(*$T
bscanf (Scanning.from_input (BatIO.input_string "12 bc" )) "%d %s" (fun d s -> d = 12 && s = "bc")
*)letfrom_channel=from_inputletstdib=from_input(BatInnerIO.stdin)endtype('a,'b,'c,'d)scanner=('a,Scanning.scanbuf,'b,'c,'a->'d,'d)format6->'copenScanf##V<5##let fscanf=fscanfletsscanf=sscanfletscanf=scanfletkscanf=kscanfletbscanf=bscanfletbscanf_format=bscanf_formatletsscanf_format=sscanf_formatletformat_from_string=format_from_stringexceptionScan_failure =Scan_failure