summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2024-01-18 22:22:18 +0100
committerEkaitz Zarraga <ekaitz@elenq.tech>2024-01-18 22:48:57 +0100
commit58acdc6d3a5723bf255c233393640d7f277749d8 (patch)
treee8f81168cb393f3b216a40805ce475fb10d0ad96
parent5f3fea525ded153e2ceb244b14b41bbf2afd5bc5 (diff)
par: piece-table: move utils to the top
-rw-r--r--par/piece-table.scm7
1 files changed, 5 insertions, 2 deletions
diff --git a/par/piece-table.scm b/par/piece-table.scm
index 2892578..0191a1c 100644
--- a/par/piece-table.scm
+++ b/par/piece-table.scm
@@ -17,6 +17,11 @@
;; /REMOVE ME
+;; Utils
+(define (character-newline? ch)
+ (char=? ch #\newline))
+
+
;; Pieces themselves: the buffer is a reference to the buffer they take their
;; data from.
@@ -35,8 +40,6 @@
(linebreaks piece-linebreaks set-piece-linebreaks!))
(define (index-linebreaks buffer start length)
- (define (character-newline? ch)
- (char=? ch #\newline))
(define str (buffer->string buffer))
(define (string-foreach* str f from length)
(let loop ((i 0))