"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "vendor/golang.org/x/text/unicode/bidi/bracket.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").

bracket.go  (etcd-3.4.12):bracket.go  (etcd-3.4.13)
skipping to change at line 15 skipping to change at line 15
package bidi package bidi
import ( import (
"container/list" "container/list"
"fmt" "fmt"
"sort" "sort"
) )
// This file contains a port of the reference implementation of the // This file contains a port of the reference implementation of the
// Bidi Parentheses Algorithm: // Bidi Parentheses Algorithm:
// http://www.unicode.org/Public/PROGRAMS/BidiReferenceJava/BidiPBAReference.jav a // https://www.unicode.org/Public/PROGRAMS/BidiReferenceJava/BidiPBAReference.ja va
// //
// The implementation in this file covers definitions BD14-BD16 and rule N0 // The implementation in this file covers definitions BD14-BD16 and rule N0
// of UAX#9. // of UAX#9.
// //
// Some preprocessing is done for each rune before data is passed to this // Some preprocessing is done for each rune before data is passed to this
// algorithm: // algorithm:
// - opening and closing brackets are identified // - opening and closing brackets are identified
// - a bracket pair type, like '(' and ')' is assigned a unique identifier that // - a bracket pair type, like '(' and ')' is assigned a unique identifier that
// is identical for the opening and closing bracket. It is left to do these // is identical for the opening and closing bracket. It is left to do these
// mappings. // mappings.
skipping to change at line 249 skipping to change at line 249
return L return L
default: default:
return ON return ON
} }
} }
// classifyPairContent reports the strong types contained inside a Bracket Pair, // classifyPairContent reports the strong types contained inside a Bracket Pair,
// assuming the given embedding direction. // assuming the given embedding direction.
// //
// It returns ON if no strong type is found. If a single strong type is found, // It returns ON if no strong type is found. If a single strong type is found,
// it returns this this type. Otherwise it returns the embedding direction. // it returns this type. Otherwise it returns the embedding direction.
// //
// TODO: use separate type for "strong" directionality. // TODO: use separate type for "strong" directionality.
func (p *bracketPairer) classifyPairContent(loc bracketPair, dirEmbed Class) Cla ss { func (p *bracketPairer) classifyPairContent(loc bracketPair, dirEmbed Class) Cla ss {
dirOpposite := ON dirOpposite := ON
for i := loc.opener + 1; i < loc.closer; i++ { for i := loc.opener + 1; i < loc.closer; i++ {
dir := p.getStrongTypeN0(i) dir := p.getStrongTypeN0(i)
if dir == ON { if dir == ON {
continue continue
} }
if dir == dirEmbed { if dir == dirEmbed {
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

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