1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556(* TyXML
* http://www.ocsigen.org/tyxml
* Copyright (C) 2016 Anton Bachin
*
* This program 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, with linking exception;
* either version 2.1 of the License, or (at your option) any later version.
*
* This program 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 program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02111-1307, USA.
*)letparse~loc~parent_lang~name:((ns,name)aselement_name)~attributeschildren=letattributes=Attributes.parselocelement_nameattributesinletlang,(moduleReflected)=Namespace.reflectlocnsinletlang=matchparent_lang,langwith|Common.Html,Svg->Common.Html|Html,Html|Svg,Svg->lang|Svg,Html->Common.errorloc"Nesting of Html element inside svg element is not supported"inletname=tryList.assocnameReflected.renamed_elementswithNot_found->Tyxml_name.identnameinletelement_function=Common.make~loclangnameinletassembler=tryList.assocnameReflected.element_assemblerswithNot_found->Common.errorloc"Unknown %s element %s"(Common.langlang)nameinletchildren=assembler~lang~loc~namechildreninAst_helper.Exp.apply~locelement_function(attributes@children)letcomment~loc~langs=lettot=Common.make~loclang"tot"inletcomment=Common.make~loclang"Xml.comment"inlets=Common.stringlocsin(* Using metaquot here avoids fiddling with labels. *)[%expr[%etot]([%ecomment][%es])][@metalocloc]