[mod] commit

This commit is contained in:
Andy Bunce 2025-10-30 12:51:14 +00:00
parent 30f913906d
commit 2d0ae19026
8 changed files with 128 additions and 23 deletions

View file

@ -1,10 +1,20 @@
import module namespace syms="lsp/symbols" at "../webapp/lsp/ast/ast.xqm";
import module namespace ast="lsp/ast" at "../webapp/lsp/ast/ast.xqm";
declare $file:="C:\Users\mrwhe\git\quodatum\basex-lsp\test\sample.docs\pdfbox.xqm";
(: declare variable $file:="sample.docs/pdfbox.xqm"; :)
declare variable $file:="sample.docs/simple.xq";
declare variable $A:=doc("C:\Users\mrwhe\git\quodatum\basex-lsp\test\sample.docs\parse-pdfbox.xml");
$A update{
for $e in .//element()
declare variable $A:=doc("sample.docs/parse-pdfbox.xml");
unparsed-text($file)
=>ast:build()
update{
for $e in descendant-or-self::element()
let $len:=string-length($e)
return insert node attribute len { $len } into $e
}
let $before:=$e/preceding-sibling::node()/string-length()=>sum()
return (insert node attribute len { $len } into $e,
insert node attribute before { $before } into $e
)
}

View file

@ -0,0 +1,6 @@
(: simple parse test :)
declare function local:print($src as xs:string, $dest as xs:string)
{
concat($src,"->", $dest)
};
local:print("sss","bbb")