1234567891011121314151617181920212223242526272829(*
* Copyright (c) 2014 Jeremy Yallop.
*
* This file is distributed under the terms of the MIT License.
* See the file LICENSE for details.
*)(* Paths (long identifiers) *)typepath=stringlistletis_uidents=Str.(string_match(regexp"[A-Z][a-zA-Z0-9_]*")s0);;letis_idents=Str.(string_match(regexp"[A-Za-z_][a-zA-Z0-9_]*")s0);;letrecis_valid_path=function|[]->false|[l]->is_identl|u::p->is_uidentu&&is_valid_pathpletpath_of_strings=letp=Str.(split(regexp_string".")s)inifis_valid_pathpthenpelseinvalid_arg"Ctypes_ident.path_of_string"letformat_pathfmtp=Format.pp_print_stringfmt(String.concat"."p)