|
|
|
@ -231,7 +231,7 @@
|
|
|
|
|
[pagetree-nodes (pagetree->list (get-pagetree pt-or-path))])
|
|
|
|
|
(case side
|
|
|
|
|
[(right) (match (memq pagenode pagetree-nodes)
|
|
|
|
|
[(list _ rest ...) rest]
|
|
|
|
|
[(list _ rest ..1) rest]
|
|
|
|
|
[_ #false])]
|
|
|
|
|
[else (match (loop 'right pagenode (reverse pagetree-nodes))
|
|
|
|
|
[(? pair? result) (reverse result)]
|
|
|
|
@ -254,11 +254,15 @@
|
|
|
|
|
(check-equal? (previous* 'three test-pagetree) '(foo bar one two))
|
|
|
|
|
(check-false (previous* 'foo test-pagetree)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define+provide/contract (next* pnish [pt-or-path (current-pagetree)])
|
|
|
|
|
(((or/c #f pagenodeish?)) ((or/c pagetree? pathish?)) . ->* . (or/c #f pagenodes?))
|
|
|
|
|
(adjacents 'right pnish pt-or-path))
|
|
|
|
|
|
|
|
|
|
(module-test-external
|
|
|
|
|
(define test-pagetree `(pagetree-main foo bar (one (two three))))
|
|
|
|
|
(check-equal? (next* 'foo test-pagetree) '(bar one two three))
|
|
|
|
|
(check-equal? (next* 'one test-pagetree) '(two three))
|
|
|
|
|
(check-false (next* 'three test-pagetree)))
|
|
|
|
|
|
|
|
|
|
(define+provide/contract (previous pnish [pt-or-path (current-pagetree)])
|
|
|
|
|
(((or/c #f pagenodeish?)) ((or/c pagetree? pathish?)) . ->* . (or/c #f pagenode?))
|
|
|
|
|