[mod] tidy
This commit is contained in:
parent
08051d5281
commit
5f094cdd95
1 changed files with 3 additions and 3 deletions
|
@ -48,12 +48,12 @@ as xs:integer
|
|||
};
|
||||
|
||||
(:~ convert index into Position :)
|
||||
declare function pos:toPosition($text as xs:string, $pos as xs:integer)
|
||||
declare function pos:toPosition($text as xs:string, $index as xs:integer)
|
||||
as pos:Position {
|
||||
let $nl:=characters($text)=>index-of(char("\n"))
|
||||
let $predicate:=fn($r, $i){
|
||||
let $next:=$nl[$i=>trace("I ")]
|
||||
return exists($next) and $next < $pos
|
||||
return exists($next) and $next < $index
|
||||
}
|
||||
|
||||
let $s:= while-do(
|
||||
|
@ -61,7 +61,7 @@ as pos:Position {
|
|||
$predicate,
|
||||
fn($r,$i){ let $next:=$nl[$i] return {"off": $next+1,"line":$r?line+1}=>trace("AA ") }
|
||||
)
|
||||
return pos:Position($s?line, $pos - $s?off)
|
||||
return pos:Position($s?line, $index - $s?off)
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue