pruned unstable/port
This commit is contained in:
parent
fd2554d6fc
commit
a4c6c7cfce
|
@ -22,13 +22,4 @@
|
|||
(parameterize ([current-input-port
|
||||
(open-input-string "1 2 3")])
|
||||
(read-all-syntax)))
|
||||
(list 1 2 3))))
|
||||
|
||||
(test-suite "port->srcloc"
|
||||
(test-ok (define port (open-input-string "\n x "))
|
||||
(port-count-lines! port)
|
||||
(check-equal? (port->srcloc port)
|
||||
(make-srcloc 'string 1 0 1 0))
|
||||
(read port)
|
||||
(check-equal? (port->srcloc port 'here 1)
|
||||
(make-srcloc 'here 2 2 4 1))))))
|
||||
(list 1 2 3))))))
|
||||
|
|
|
@ -33,5 +33,4 @@
|
|||
[read-all (->* [] [(-> any/c) input-port?] list?)]
|
||||
[read-all-syntax
|
||||
(->* [] [(-> (or/c syntax? eof-object?)) input-port?]
|
||||
(syntax/c list?))]
|
||||
[port->srcloc (->* [port?] [any/c exact-nonnegative-integer?] srcloc?)])
|
||||
(syntax/c list?))])
|
||||
|
|
|
@ -51,25 +51,4 @@ of the result spans the entire portion of the port that was read.
|
|||
|
||||
}
|
||||
|
||||
@defproc[(port->srcloc [port port?]
|
||||
[source any/c (object-name port)]
|
||||
[span exact-nonnegative-integer? 0])
|
||||
srcloc?]{
|
||||
|
||||
Produces a @racket[srcloc] structure representing the current position of a
|
||||
port, using the provided @racket[source] and @racket[span] values to fill in
|
||||
missing fields. This function relies on @racket[port-next-location], so line
|
||||
counting must be enabled for @racket[port] to get meaningful results.
|
||||
|
||||
@defexamples[
|
||||
#:eval the-eval
|
||||
(define port (open-input-string "1 2 3"))
|
||||
(port-count-lines! port)
|
||||
(read port)
|
||||
(port->srcloc port)
|
||||
(port->srcloc port "1 2 3" 1)
|
||||
]
|
||||
|
||||
}
|
||||
|
||||
@(close-eval the-eval)
|
||||
|
|
Loading…
Reference in New Issue
Block a user