-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathoptions.go
More file actions
61 lines (54 loc) · 2.04 KB
/
Copy pathoptions.go
File metadata and controls
61 lines (54 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package helium
import (
"github.com/lestrrat-go/helium/internal/bitset"
"github.com/lestrrat-go/helium/internal/parser"
)
// LoadSubsetOption is a bitset of parser tree-building flags governing
// external-DTD-subset loading, DTD-default attribute completion, and
// ID-attribute interning. The parser sets its bits from the configured Parser
// options; the exported constants name the individual bits.
type LoadSubsetOption int
const (
// DetectIDs is the bit the parser sets from the LoadExternalDTD option.
// ID-attribute interning is governed by SkipIDs, not this bit.
DetectIDs LoadSubsetOption = 1 << (iota + 1)
// CompleteAttrs is the bit the parser sets from the DefaultDTDAttributes
// option. It governs adding DTD-declared default attributes that the instance
// omits.
CompleteAttrs // 4
// SkipIDs suppresses ID-attribute interning.
SkipIDs // 8
)
// Set turns on the bits in n.
func (p *LoadSubsetOption) Set(n LoadSubsetOption) {
bitset.Set(p, n)
}
// IsSet reports whether any bit in n is turned on.
func (p LoadSubsetOption) IsSet(n LoadSubsetOption) bool {
return bitset.IsSet(p, n)
}
// parseOption is an alias for parser.Option so that existing code in the
// helium package can continue to use the unexported name unchanged.
type parseOption = parser.Option
const (
parseRecover = parser.Recover
parseNoEnt = parser.NoEnt
parseDTDLoad = parser.DTDLoad
parseDTDAttr = parser.DTDAttr
parseDTDValid = parser.DTDValid
parseNoError = parser.NoError
parseNoWarning = parser.NoWarning
parsePedantic = parser.Pedantic
parseNoBlanks = parser.NoBlanks
parseNoNet = parser.NoNet
parseNsClean = parser.NsClean
parseNoCDATA = parser.NoCDATA
parseNoBaseFix = parser.NoBaseFix
parseIgnoreEnc = parser.IgnoreEnc
parseNoXXE = parser.NoXXE
parseNoUnzip = parser.NoUnzip
parseNoSysCatalog = parser.NoSysCatalog
parseCatalogPI = parser.CatalogPI
parseSkipIDs = parser.SkipIDs
parseLenientXMLDecl = parser.LenientXMLDecl
)