libgo: Update to October 24 version of master library.
From-SVN: r204466
This commit is contained in:
parent
f20f261304
commit
f038dae646
596 changed files with 32029 additions and 7466 deletions
|
@ -56,23 +56,26 @@ const (
|
|||
// Passing r2 == -1 indicates that the position is
|
||||
// at the end of the text.
|
||||
func EmptyOpContext(r1, r2 rune) EmptyOp {
|
||||
var op EmptyOp
|
||||
if r1 < 0 {
|
||||
var op EmptyOp = EmptyNoWordBoundary
|
||||
var boundary byte
|
||||
switch {
|
||||
case IsWordChar(r1):
|
||||
boundary = 1
|
||||
case r1 == '\n':
|
||||
op |= EmptyBeginLine
|
||||
case r1 < 0:
|
||||
op |= EmptyBeginText | EmptyBeginLine
|
||||
}
|
||||
if r1 == '\n' {
|
||||
op |= EmptyBeginLine
|
||||
}
|
||||
if r2 < 0 {
|
||||
switch {
|
||||
case IsWordChar(r2):
|
||||
boundary ^= 1
|
||||
case r2 == '\n':
|
||||
op |= EmptyEndLine
|
||||
case r2 < 0:
|
||||
op |= EmptyEndText | EmptyEndLine
|
||||
}
|
||||
if r2 == '\n' {
|
||||
op |= EmptyEndLine
|
||||
}
|
||||
if IsWordChar(r1) != IsWordChar(r2) {
|
||||
op |= EmptyWordBoundary
|
||||
} else {
|
||||
op |= EmptyNoWordBoundary
|
||||
if boundary != 0 { // IsWordChar(r1) != IsWordChar(r2)
|
||||
op ^= (EmptyWordBoundary | EmptyNoWordBoundary)
|
||||
}
|
||||
return op
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue