From c66fb644684092edc3324f83f4c50151c6e5eb00 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 24 Feb 2017 21:30:54 -0800 Subject: [PATCH] Repaginate. --- src/runtime/ustring.scm | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/runtime/ustring.scm b/src/runtime/ustring.scm index 82ed9c885..d7c309a0b 100644 --- a/src/runtime/ustring.scm +++ b/src/runtime/ustring.scm @@ -564,6 +564,26 @@ USA. (fix:- breaks 1) breaks))) +(define (find-grapheme-cluster-breaks string initial-ctx break) + (let ((n (string-length string))) + + (define (get-gcb i) + (and (fix:< i n) + (ucd-gcb-value (string-ref string i)))) + + (define (transition gcb i ctx) + (if gcb + (let ((i* (fix:+ i 1))) + ((vector-ref gcb-states gcb) + (get-gcb i*) + (lambda (gcb* break?) + (transition gcb* i* (if break? (break i* ctx) ctx))))) + ctx)) + + (if (fix:> n 0) + (transition (get-gcb 0) 0 (break 0 initial-ctx)) + initial-ctx))) + (define gcb-names '#(control carriage-return @@ -666,26 +686,6 @@ USA. (make-no-breaks '(emoji-base-gaz glue-after-zwj extend spacing-mark zwj))))))) -(define (find-grapheme-cluster-breaks string initial-ctx break) - (let ((n (string-length string))) - - (define (get-gcb i) - (and (fix:< i n) - (ucd-gcb-value (string-ref string i)))) - - (define (transition gcb i ctx) - (if gcb - (let ((i* (fix:+ i 1))) - ((vector-ref gcb-states gcb) - (get-gcb i*) - (lambda (gcb* break?) - (transition gcb* i* (if break? (break i* ctx) ctx))))) - ctx)) - - (if (fix:> n 0) - (transition (get-gcb 0) 0 (break 0 initial-ctx)) - initial-ctx))) - (define (list->string chars) (if (every char-8-bit? chars) (let ((string (legacy-string-allocate (length chars)))) -- 2.25.1