mirror of
https://github.com/hanzoai/forge.git
synced 2026-10-30 15:00:39 +00:00
Source files keep their SPDX-License-Identifier and Hanzo copyright line; the Gitea, Gogs and LFS Test Server copyrights they used to repeat now live once in NOTICE, alongside LICENSE. The header lint accepts any copyright line above the SPDX line, so it no longer demands an upstream one. Co-authored-by: Hanzo Dev <[email protected]>
24 lines
723 B
Go
24 lines
723 B
Go
// Copyright 2026 Hanzo AI, Inc. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package charset
|
|
|
|
// EscapeStatus represents the findings of the Unicode escaper
|
|
type EscapeStatus struct {
|
|
Escaped bool // it means that some characters were escaped, and they can also be unescaped back
|
|
HasInvisible bool
|
|
HasAmbiguous bool
|
|
}
|
|
|
|
// Or combines two EscapeStatus structs into one representing the conjunction of the two
|
|
func (status *EscapeStatus) Or(other *EscapeStatus) *EscapeStatus {
|
|
st := status
|
|
if status == nil {
|
|
st = &EscapeStatus{}
|
|
}
|
|
st.Escaped = st.Escaped || other.Escaped
|
|
st.HasAmbiguous = st.HasAmbiguous || other.HasAmbiguous
|
|
st.HasInvisible = st.HasInvisible || other.HasInvisible
|
|
return st
|
|
}
|