-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.go
More file actions
68 lines (55 loc) · 2.38 KB
/
Copy pathtypes.go
File metadata and controls
68 lines (55 loc) · 2.38 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
62
63
64
65
66
67
68
package jsonkit
import (
"github.com/forgemechanic/jsonkit/exp/cst"
"github.com/forgemechanic/jsonkit/exp/diag"
"github.com/forgemechanic/jsonkit/exp/lex"
expparse "github.com/forgemechanic/jsonkit/exp/parse"
"github.com/forgemechanic/jsonkit/exp/profile"
"github.com/forgemechanic/jsonkit/exp/source"
"github.com/forgemechanic/jsonkit/exp/span"
)
// Source is the facade alias for exp/source.Source.
type Source = source.Source
// Span is the facade alias for exp/span.Span.
type Span = span.Span
// Severity is the facade alias for diagnostic severity.
type Severity = diag.Severity
const (
// SeverityError marks diagnostics that indicate parse/validation failure.
SeverityError Severity = diag.SeverityError
// SeverityWarning marks non-fatal diagnostics.
SeverityWarning Severity = diag.SeverityWarning
)
// Diagnostic is the facade alias for exp/diag.Diagnostic.
type Diagnostic = diag.Diagnostic
// Token is the facade alias for exp/lex.Token.
type Token = lex.Token
// TokenKind is the facade alias for exp/lex.Kind.
type TokenKind = lex.Kind
// CST is the facade alias for exp/cst.Tree.
type CST = cst.Tree
// ProfileID identifies a parse/encode profile preset.
type ProfileID = profile.ProfileID
const (
// ProfileStrict enables strict RFC 8259 JSON behavior.
ProfileStrict ProfileID = profile.ProfileStrict
// ProfileJSONC enables JSONC extensions (comments, trailing commas).
ProfileJSONC ProfileID = profile.ProfileJSONC
// ProfileJSON5 enables JSON5 extensions.
ProfileJSON5 ProfileID = profile.ProfileJSON5
)
// RetentionMode controls how much parse structure is retained.
type RetentionMode = expparse.RetentionMode
const (
// RetentionFullCST keeps the full concrete syntax tree and token stream.
RetentionFullCST RetentionMode = expparse.RetentionFullCST
// RetentionTokens keeps tokens without full CST structure.
RetentionTokens RetentionMode = expparse.RetentionTokens
// RetentionStructural keeps structural tokens for fast binding/analysis.
RetentionStructural RetentionMode = expparse.RetentionStructural
// RetentionWindowedCST keeps a full CST for the effective parse window.
// Use with WithEmbeddedBlock to parse/retain only embedded JSON regions.
RetentionWindowedCST RetentionMode = expparse.RetentionWindowedCST
// RetentionValidateOnly performs validation with minimal retained artifacts.
RetentionValidateOnly RetentionMode = expparse.RetentionValidateOnly
)