From: Chris Hanson Date: Sat, 25 Feb 2017 05:30:54 +0000 (-0800) Subject: Repaginate. X-Git-Tag: mit-scheme-pucked-9.2.12~198^2~22 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=c66fb644684092edc3324f83f4c50151c6e5eb00;p=mit-scheme.git Repaginate. --- 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))))