Source File
context.go
Belonging Package
golang.org/x/text/cases
package cases
import
func ( *context) bool {
:= .caseType()
if .info&hasMappingMask == 0 || == cLower {
return .copy()
}
if .info&exceptionBit == 0 {
return .copyXOR()
}
:= exceptions[.info>>exceptionShift:]
:= 2 + [0]&lengthMask // size of header + fold string
if := ([1] >> lengthBits) & lengthMask; != noChange {
return .writeString([ : +])
}
return .copy()
}
func ( *context) bool {
:= .caseType()
if .info&hasMappingMask == 0 || == cLower {
return true
}
if .info&exceptionBit == 0 {
.err = transform.ErrEndOfSpan
return false
}
:= exceptions[.info>>exceptionShift:]
if := ([1] >> lengthBits) & lengthMask; != noChange {
.err = transform.ErrEndOfSpan
return false
}
return true
}
func ( *context) bool {
:= .caseType()
if .info&hasMappingMask == 0 || == cUpper {
return .copy()
}
if .info&exceptionBit == 0 {
return .copyXOR()
}
:= exceptions[.info>>exceptionShift:]
:= ([1] >> lengthBits) & lengthMask
if == noChange {
= 0
}
, = [1]&lengthMask, [:]
}
if != noChange {
return .writeString([ : +])
}
return .copy()
}
func ( *context) bool {
:= .caseType()
if .info&hasMappingMask == 0 || == cUpper {
return true
}
if .info&exceptionBit == 0 {
.err = transform.ErrEndOfSpan
return false
}
:= ([1] >> lengthBits) & lengthMask
if == cTitle {
= [1] & lengthMask
}
if != noChange {
.err = transform.ErrEndOfSpan
return false
}
return true
}
:= exceptions[.info>>exceptionShift:]
:= 2 + [0]&lengthMask // size of header + fold string
:= ([1] >> lengthBits) & lengthMask
if := [1] & lengthMask; != noChange {
if != noChange {
= [:]
}
return .writeString([ : +])
}
return .writeString([ : +])
return .copy()
}
func ( *context) bool {
:= .caseType()
if .info&hasMappingMask == 0 || == cTitle {
return true
}
if .info&exceptionBit == 0 {
if == cLower {
.err = transform.ErrEndOfSpan
return false
}
return true
:= exceptions[.info>>exceptionShift:]
if := [1] & lengthMask; != noChange {
.err = transform.ErrEndOfSpan
return false
}
:= ([1] >> lengthBits) & lengthMask
if == cLower && != noChange {
.err = transform.ErrEndOfSpan
return false
}
return true
}
func ( *context) bool {
if .info&hasMappingMask == 0 {
return .copy()
}
:= .caseType()
if .info&exceptionBit == 0 {
if != cLower || .info&inverseFoldBit != 0 {
return .copyXOR()
}
return .copy()
}
:= exceptions[.info>>exceptionShift:]
:= [0] & lengthMask
if == 0 {
if == cLower {
return .copy()
}
= ([1] >> lengthBits) & lengthMask
}
return .writeString([2 : 2+])
}
func ( *context) bool {
if .info&hasMappingMask == 0 {
return true
}
:= .caseType()
if .info&exceptionBit == 0 {
if != cLower || .info&inverseFoldBit != 0 {
.err = transform.ErrEndOfSpan
return false
}
return true
}
:= exceptions[.info>>exceptionShift:]
:= [0] & lengthMask
if == 0 && == cLower {
return true
}
.err = transform.ErrEndOfSpan
return false
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |