[mod] symbol opts

This commit is contained in:
Andy Bunce 2025-10-27 23:02:21 +00:00
parent b102be8db6
commit c4d2770bae
3 changed files with 24 additions and 8 deletions

View file

@ -34,10 +34,11 @@ declare function ast:flatten($input as element()) as element() {
(:-------------------------------------------:)
declare function ast:report($el as element(*)) {
<analysis>
<total-elements>{count($el//element())}</total-elements>
<max-depth>{ast:max-node-depth($el)}</max-depth>
</analysis>
{
"total-elements": count($el//element()),
"max-depth": ast:max-node-depth($el),
"char-count": string-length($el)
}
};
declare function ast:max-depth($nodes as node()*) as xs:integer {