"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "vendor/golang.org/x/text/unicode/bidi/core.go" between
etcd-3.4.12.tar.gz and etcd-3.4.13.tar.gz

About: etcd is a distributed reliable key-value store for the most critical data of a distributed system (written in "Go").

core.go  (etcd-3.4.12):core.go  (etcd-3.4.13)
// Copyright 2015 The Go Authors. All rights reserved. // Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
package bidi package bidi
import "log" import "log"
// This implementation is a port based on the reference implementation found at: // This implementation is a port based on the reference implementation found at:
// http://www.unicode.org/Public/PROGRAMS/BidiReferenceJava/ // https://www.unicode.org/Public/PROGRAMS/BidiReferenceJava/
// //
// described in Unicode Bidirectional Algorithm (UAX #9). // described in Unicode Bidirectional Algorithm (UAX #9).
// //
// Input: // Input:
// There are two levels of input to the algorithm, since clients may prefer to // There are two levels of input to the algorithm, since clients may prefer to
// supply some information from out-of-band sources rather than relying on the // supply some information from out-of-band sources rather than relying on the
// default behavior. // default behavior.
// //
// - Bidi class array // - Bidi class array
// - Bidi class array, with externally supplied base line direction // - Bidi class array, with externally supplied base line direction
skipping to change at line 483 skipping to change at line 483
// //
// Note that some weak types (EN, AN) remain after this processing is // Note that some weak types (EN, AN) remain after this processing is
// complete. // complete.
func (s *isolatingRunSequence) resolveWeakTypes() { func (s *isolatingRunSequence) resolveWeakTypes() {
// on entry, only these types remain // on entry, only these types remain
s.assertOnly(L, R, AL, EN, ES, ET, AN, CS, B, S, WS, ON, NSM, LRI, RLI, F SI, PDI) s.assertOnly(L, R, AL, EN, ES, ET, AN, CS, B, S, WS, ON, NSM, LRI, RLI, F SI, PDI)
// Rule W1. // Rule W1.
// Changes all NSMs. // Changes all NSMs.
preceedingCharacterType := s.sos precedingCharacterType := s.sos
for i, t := range s.types { for i, t := range s.types {
if t == NSM { if t == NSM {
s.types[i] = preceedingCharacterType s.types[i] = precedingCharacterType
} else { } else {
if t.in(LRI, RLI, FSI, PDI) { if t.in(LRI, RLI, FSI, PDI) {
preceedingCharacterType = ON precedingCharacterType = ON
} }
preceedingCharacterType = t precedingCharacterType = t
} }
} }
// Rule W2. // Rule W2.
// EN does not change at the start of the run, because sos != AL. // EN does not change at the start of the run, because sos != AL.
for i, t := range s.types { for i, t := range s.types {
if t == EN { if t == EN {
for j := i - 1; j >= 0; j-- { for j := i - 1; j >= 0; j-- {
if t := s.types[j]; t.in(L, R, AL) { if t := s.types[j]; t.in(L, R, AL) {
if t == AL { if t == AL {
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)