edward

An extensible POSIX-compatible implementation of the ed(1) text editor

git clone https://git.8pit.net/edward.git

 1;;> This library provides an abstraction for parsing, representing, and
 2;;> operating on [ed addresses][ed addresses]. Conceptually, the library
 3;;> distinguishes single addresses and ranges. The latter consisting of a
 4;;> start and end address as well as a address separator (as defined in
 5;;> POSIX). The [parse-addrs][parse-addrs] procedure returns a list of
 6;;> address ranges.  The editor implementation is capable of converting
 7;;> this list to a pair of line numbers using the [addrlst->lpair][addrlst->lpair]
 8;;> procedure. Command implementations expecting a range address receive
 9;;> this pair, commands which only expect a single address only receive
10;;> the last element of the pair as an argument.
11;;>
12;;> [parse-addrs]: #parse-addrs
13;;> [addrlst->lpair]: edward.ed.editor.html#addrlst->lpair
14;;> [ed addresses]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/ed.html#tag_20_38_13_02
15
16(define-library (edward.ed.addr)
17  (import (scheme base)
18          (scheme case-lambda)
19
20          (srfi 1)
21          (srfi 14)
22
23          (matchable)
24
25          (edward parse))
26
27  (export make-addr make-range range? addr->range range->addr
28          parse-addrs parse-addr-with-off expand-addr address-separator?)
29
30  (include "addr.scm"))