feat: kubesphere 4.0 (#6115)
* feat: kubesphere 4.0 Signed-off-by: ci-bot <ci-bot@kubesphere.io> * feat: kubesphere 4.0 Signed-off-by: ci-bot <ci-bot@kubesphere.io> --------- Signed-off-by: ci-bot <ci-bot@kubesphere.io> Co-authored-by: ks-ci-bot <ks-ci-bot@example.com> Co-authored-by: joyceliu <joyceliu@yunify.com>
This commit is contained in:
committed by
GitHub
parent
b5015ec7b9
commit
447a51f08b
34
vendor/github.com/open-policy-agent/opa/ast/internal/scanner/scanner.go
generated
vendored
34
vendor/github.com/open-policy-agent/opa/ast/internal/scanner/scanner.go
generated
vendored
@@ -18,14 +18,15 @@ const bom = 0xFEFF
|
||||
// Scanner is used to tokenize an input stream of
|
||||
// Rego source code.
|
||||
type Scanner struct {
|
||||
offset int
|
||||
row int
|
||||
col int
|
||||
bs []byte
|
||||
curr rune
|
||||
width int
|
||||
errors []Error
|
||||
keywords map[string]tokens.Token
|
||||
offset int
|
||||
row int
|
||||
col int
|
||||
bs []byte
|
||||
curr rune
|
||||
width int
|
||||
errors []Error
|
||||
keywords map[string]tokens.Token
|
||||
regoV1Compatible bool
|
||||
}
|
||||
|
||||
// Error represents a scanner error.
|
||||
@@ -102,6 +103,23 @@ func (s *Scanner) AddKeyword(kw string, tok tokens.Token) {
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Scanner) HasKeyword(keywords map[string]tokens.Token) bool {
|
||||
for kw := range s.keywords {
|
||||
if _, ok := keywords[kw]; ok {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (s *Scanner) SetRegoV1Compatible() {
|
||||
s.regoV1Compatible = true
|
||||
}
|
||||
|
||||
func (s *Scanner) RegoV1Compatible() bool {
|
||||
return s.regoV1Compatible
|
||||
}
|
||||
|
||||
// WithKeywords returns a new copy of the Scanner struct `s`, with the set
|
||||
// of known keywords being that of `s` with `kws` added.
|
||||
func (s *Scanner) WithKeywords(kws map[string]tokens.Token) *Scanner {
|
||||
|
||||
2
vendor/github.com/open-policy-agent/opa/ast/internal/tokens/tokens.go
generated
vendored
2
vendor/github.com/open-policy-agent/opa/ast/internal/tokens/tokens.go
generated
vendored
@@ -76,7 +76,7 @@ var strings = [...]string{
|
||||
EOF: "eof",
|
||||
Whitespace: "whitespace",
|
||||
Comment: "comment",
|
||||
Ident: "ident",
|
||||
Ident: "identifier",
|
||||
Package: "package",
|
||||
Import: "import",
|
||||
As: "as",
|
||||
|
||||
Reference in New Issue
Block a user