[mod] commit
This commit is contained in:
parent
30f913906d
commit
2d0ae19026
8 changed files with 128 additions and 23 deletions
24
test/ast.xq
24
test/ast.xq
|
|
@ -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
|
||||
)
|
||||
}
|
||||
|
|
|
|||
6
test/sample.docs/simple.xq
Normal file
6
test/sample.docs/simple.xq
Normal 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")
|
||||
Loading…
Add table
Add a link
Reference in a new issue