From d35210b7415d030ae2c99733191e63cdd150009f Mon Sep 17 00:00:00 2001 From: "red-hat-konflux[bot]" <126015336+red-hat-konflux[bot]@users.noreply.github.com> Date: Thu, 26 Nov 2026 02:54:14 +0000 Subject: [PATCH] Update module github.com/argoproj/argo-cd/v3 to v3.6.2 Signed-off-by: red-hat-konflux <126015336+red-hat-konflux[bot]@users.noreply.github.com> --- go.mod | 55 +- go.sum | 136 +- .../pkg/diff/internal/fieldmanager/README | 2 - .../internal/fieldmanager/borrowed_fields.go | 47 - .../fieldmanager/borrowed_managedfields.go | 248 - .../fieldmanager/borrowed_typeconverter.go | 130 - .../fieldmanager/borrowed_versionconverter.go | 101 - .../pkg/diff/internal/fieldmanager/doc.go | 25 - .../pkg/diff/internal/fieldmanager/wrapper.go | 23 - .../pkg/utils/kube/resource_filter.go | 5 - .../argo-cd/gitops-engine/{ => v3}/LICENSE | 0 .../pkg/api/v1/endpoints/util.go | 2 +- .../kubernetes_vendor/pkg/util/hash/hash.go | 0 .../gitops-engine/{ => v3}/pkg/diff/diff.go | 311 +- .../{ => v3}/pkg/diff/diff_options.go | 7 - .../{ => v3}/pkg/health/health.go | 53 +- .../{ => v3}/pkg/health/health_apiservice.go | 2 +- .../{ => v3}/pkg/health/health_argo.go | 0 .../{ => v3}/pkg/health/health_daemonset.go | 2 +- .../{ => v3}/pkg/health/health_deployment.go | 2 +- .../{ => v3}/pkg/health/health_hpa.go | 2 +- .../{ => v3}/pkg/health/health_ingress.go | 0 .../{ => v3}/pkg/health/health_job.go | 4 +- .../{ => v3}/pkg/health/health_pod.go | 27 +- .../{ => v3}/pkg/health/health_pvc.go | 2 +- .../{ => v3}/pkg/health/health_replicaset.go | 2 +- .../{ => v3}/pkg/health/health_service.go | 2 +- .../{ => v3}/pkg/health/health_statefulset.go | 2 +- .../{ => v3}/pkg/sync/common/types.go | 5 +- .../{ => v3}/pkg/sync/hook/delete_policy.go | 6 +- .../pkg/sync/hook/helm/delete_policy.go | 4 +- .../{ => v3}/pkg/sync/hook/helm/hook.go | 0 .../{ => v3}/pkg/sync/hook/helm/type.go | 4 +- .../{ => v3}/pkg/sync/hook/helm/weight.go | 0 .../{ => v3}/pkg/sync/hook/hook.go | 21 +- .../{ => v3}/pkg/sync/resource/annotations.go | 10 +- .../gitops-engine/{ => v3}/pkg/utils/io/io.go | 0 .../{ => v3}/pkg/utils/json/json.go | 0 .../{ => v3}/pkg/utils/kube/convert.go | 2 +- .../{ => v3}/pkg/utils/kube/ctl.go | 37 +- .../{ => v3}/pkg/utils/kube/kube.go | 0 .../v3/pkg/utils/kube/openapi_resources.go | 58 + .../v3/pkg/utils/kube/resource_filter.go | 8 + .../{ => v3}/pkg/utils/kube/resource_ops.go | 41 +- .../{ => v3}/pkg/utils/kube/scheme/parser.go | 1988 ++- .../{ => v3}/pkg/utils/kube/scheme/scheme.go | 0 .../{ => v3}/pkg/utils/kube/scheme/typed.go | 0 .../pkg/utils/kube/uniqueprotomodels.go | 0 .../{ => v3}/pkg/utils/text/text.go | 0 .../{ => v3}/pkg/utils/tracing/api.go | 0 .../{ => v3}/pkg/utils/tracing/logging.go | 0 .../{ => v3}/pkg/utils/tracing/nop.go | 0 .../argo-cd/v3/assets/builtin-policy.csv | 1 + .../argoproj/argo-cd/v3/assets/swagger.json | 273 +- .../argoproj/argo-cd/v3/common/common.go | 10 +- .../application/v1alpha1/app_project_types.go | 14 +- .../v1alpha1/application_annotations.go | 7 + .../v1alpha1/applicationset_types.go | 46 +- .../apis/application/v1alpha1/generated.pb.go | 5085 ++++--- .../apis/application/v1alpha1/generated.proto | 127 +- .../application/v1alpha1/openapi_generated.go | 8 +- .../application/v1alpha1/repository_types.go | 7 +- .../application/v1alpha1/source_integrity.go | 33 + .../v3/pkg/apis/application/v1alpha1/types.go | 136 +- .../v1alpha1/zz_generated.deepcopy.go | 157 +- .../client/clientset/versioned/clientset.go | 4 +- .../versioned/fake/clientset_generated.go | 2 +- .../argoproj/argo-cd/v3/util/cache/cache.go | 45 +- .../argoproj/argo-cd/v3/util/cache/redis.go | 11 +- .../argo-cd/v3/util/cache/twolevelclient.go | 12 + .../argoproj/argo-cd/v3/util/env/env.go | 14 +- .../argoproj/argo-cd/v3/util/exec/exec.go | 6 +- .../argoproj/argo-cd/v3/util/git/OWNERS | 3 - .../argoproj/argo-cd/v3/util/git/client.go | 297 +- .../argoproj/argo-cd/v3/util/git/creds.go | 18 +- .../argoproj/argo-cd/v3/util/git/git.go | 13 +- .../argoproj/argo-cd/v3/util/glob/glob.go | 17 +- .../argoproj/argo-cd/v3/util/glob/list.go | 2 +- .../argoproj/argo-cd/v3/util/hash/hash.go | 38 + .../argoproj/argo-cd/v3/util/helm/OWNERS | 3 - .../argoproj/argo-cd/v3/util/helm/client.go | 91 +- .../argoproj/argo-cd/v3/util/helm/cmd.go | 4 +- .../argoproj/argo-cd/v3/util/helm/creds.go | 2 +- .../argoproj/argo-cd/v3/util/helm/helm.go | 6 +- .../argoproj/argo-cd/v3/util/http/http.go | 41 + .../argoproj/argo-cd/v3/util/io/files/tar.go | 42 +- .../argo-cd/v3/util/io/path/resolved.go | 3 +- .../argoproj/argo-cd/v3/util/rbac/rbac.go | 67 +- .../argoproj/argo-cd/v3/util/regex/regex.go | 4 +- .../bombsimon/logrusr/v4/.golangci.yaml | 118 + .../bombsimon/logrusr/v4/logrusr.go | 32 +- vendor/github.com/dlclark/regexp2/.travis.yml | 7 - vendor/github.com/dlclark/regexp2/README.md | 174 - vendor/github.com/dlclark/regexp2/match.go | 349 - vendor/github.com/dlclark/regexp2/regexp.go | 395 - vendor/github.com/dlclark/regexp2/replace.go | 177 - vendor/github.com/dlclark/regexp2/runner.go | 1614 --- .../dlclark/regexp2/syntax/charclass.go | 865 -- .../github.com/dlclark/regexp2/syntax/code.go | 274 - .../dlclark/regexp2/syntax/replacerdata.go | 87 - .../github.com/dlclark/regexp2/syntax/tree.go | 654 - .../dlclark/regexp2/syntax/writer.go | 500 - vendor/github.com/dlclark/regexp2/testoutput1 | 7061 --------- .../dlclark/regexp2/{ => v2}/.gitignore | 2 + .../dlclark/regexp2/{ => v2}/ATTRIB | 0 .../dlclark/regexp2/{ => v2}/LICENSE | 0 .../github.com/dlclark/regexp2/v2/README.md | 391 + .../dlclark/regexp2/v2/Taskfile.yml | 64 + .../dlclark/regexp2/v2/bufferpool.go | 119 + .../github.com/dlclark/regexp2/v2/decode.go | 175 + .../dlclark/regexp2/{ => v2}/fastclock.go | 9 +- .../dlclark/regexp2/v2/findfirstchar.go | 222 + .../dlclark/regexp2/v2/helpers/ascii.go | 75 + .../dlclark/regexp2/v2/helpers/indexof.go | 471 + .../dlclark/regexp2/v2/helpers/math.go | 15 + .../dlclark/regexp2/v2/helpers/runes.go | 61 + .../regexp2/v2/helpers/searchvalues.go | 209 + vendor/github.com/dlclark/regexp2/v2/match.go | 540 + .../dlclark/regexp2/v2/matchview.go | 95 + .../github.com/dlclark/regexp2/v2/options.go | 170 + .../dlclark/regexp2/v2/prefixsearch.go | 124 + .../github.com/dlclark/regexp2/v2/regexp.go | 763 + .../dlclark/regexp2/v2/regexp_codegen.go | 88 + .../github.com/dlclark/regexp2/v2/replace.go | 383 + .../github.com/dlclark/regexp2/v2/runner.go | 2710 ++++ vendor/github.com/dlclark/regexp2/v2/split.go | 104 + .../dlclark/regexp2/v2/stringprefixfilter.go | 498 + .../dlclark/regexp2/v2/syntax/charclass.go | 1649 +++ .../dlclark/regexp2/v2/syntax/code.go | 393 + .../dlclark/regexp2/v2/syntax/ecma_unicode.go | 216 + .../regexp2/v2/syntax/ecma_unicode_tables.go | 11968 ++++++++++++++++ .../dlclark/regexp2/{ => v2}/syntax/escape.go | 7 +- .../dlclark/regexp2/{ => v2}/syntax/fuzz.go | 3 +- .../dlclark/regexp2/v2/syntax/grapheme.go | 294 + .../regexp2/v2/syntax/optimizations.go | 746 + .../dlclark/regexp2/{ => v2}/syntax/parser.go | 1184 +- .../dlclark/regexp2/{ => v2}/syntax/prefix.go | 288 +- .../regexp2/v2/syntax/prefixanalyzer.go | 1495 ++ .../dlclark/regexp2/v2/syntax/replacerdata.go | 123 + .../dlclark/regexp2/v2/syntax/tree.go | 2511 ++++ .../regexp2/v2/syntax/unicode_alias_tables.go | 6594 +++++++++ .../dlclark/regexp2/v2/syntax/writer.go | 728 + .../go-openapi/jsonpointer/CONTRIBUTORS.md | 4 +- .../go-openapi/jsonpointer/README.md | 4 +- .../go-openapi/jsonpointer/pointer.go | 2 +- .../go-openapi/jsonreference/.golangci.yml | 4 + .../go-openapi/jsonreference/CONTRIBUTORS.md | 4 +- .../go-openapi/jsonreference/README.md | 4 +- .../jsonreference/internal/normalize_url.go | 77 +- .../jsonutils/adapters/stdlib/json/options.go | 5 + vendor/github.com/gobwas/glob/.gitignore | 2 + vendor/github.com/gobwas/glob/.travis.yml | 9 - vendor/github.com/gobwas/glob/bench.sh | 57 +- .../gobwas/glob/compiler/compiler.go | 525 - vendor/github.com/gobwas/glob/glob.go | 164 +- .../glob/internal/debug/debug_disabled.go | 8 + .../glob/internal/debug/debug_enabled.go | 14 + .../gobwas/glob/internal/debug/tree.go | 8 + vendor/github.com/gobwas/glob/match.go | 788 + vendor/github.com/gobwas/glob/match/any.go | 45 - vendor/github.com/gobwas/glob/match/any_of.go | 82 - vendor/github.com/gobwas/glob/match/btree.go | 146 - .../github.com/gobwas/glob/match/contains.go | 58 - .../github.com/gobwas/glob/match/every_of.go | 99 - vendor/github.com/gobwas/glob/match/list.go | 49 - vendor/github.com/gobwas/glob/match/match.go | 81 - vendor/github.com/gobwas/glob/match/max.go | 49 - vendor/github.com/gobwas/glob/match/min.go | 57 - .../github.com/gobwas/glob/match/nothing.go | 27 - vendor/github.com/gobwas/glob/match/prefix.go | 50 - .../gobwas/glob/match/prefix_any.go | 55 - .../gobwas/glob/match/prefix_suffix.go | 62 - vendor/github.com/gobwas/glob/match/range.go | 48 - vendor/github.com/gobwas/glob/match/row.go | 77 - .../github.com/gobwas/glob/match/segments.go | 91 - vendor/github.com/gobwas/glob/match/single.go | 43 - vendor/github.com/gobwas/glob/match/suffix.go | 35 - .../gobwas/glob/match/suffix_any.go | 43 - vendor/github.com/gobwas/glob/match/super.go | 33 - vendor/github.com/gobwas/glob/match/text.go | 45 - vendor/github.com/gobwas/glob/parse.go | 679 + vendor/github.com/gobwas/glob/readme.md | 235 +- .../github.com/gobwas/glob/syntax/ast/ast.go | 122 - .../gobwas/glob/syntax/ast/parser.go | 157 - vendor/github.com/gobwas/glob/syntax/lexer.go | 381 + .../gobwas/glob/syntax/lexer/lexer.go | 273 - .../gobwas/glob/syntax/lexer/token.go | 88 - .../github.com/gobwas/glob/syntax/syntax.go | 14 - .../gobwas/glob/util/runes/runes.go | 154 - .../gobwas/glob/util/strings/strings.go | 39 - .../github.com/redis/go-redis/v9/.gitignore | 9 + vendor/github.com/redis/go-redis/v9/AGENTS.md | 228 + vendor/github.com/redis/go-redis/v9/CLAUDE.md | 19 + .../redis/go-redis/v9/CONTRIBUTING.md | 2 +- vendor/github.com/redis/go-redis/v9/Makefile | 35 +- vendor/github.com/redis/go-redis/v9/README.md | 179 + .../redis/go-redis/v9/RELEASE-NOTES.md | 239 + .../redis/go-redis/v9/autopipeline.go | 2609 ++++ .../go-redis/v9/autopipeline_bench_README.md | 128 + .../github.com/redis/go-redis/v9/command.go | 535 +- .../go-redis/v9/command_policy_resolver.go | 27 + .../github.com/redis/go-redis/v9/commands.go | 104 +- .../redis/go-redis/v9/csc_commands.go | 257 + .../redis/go-redis/v9/csc_integration.go | 922 ++ .../github.com/redis/go-redis/v9/csc_stats.go | 36 + .../redis/go-redis/v9/docker-compose.yml | 2 +- vendor/github.com/redis/go-redis/v9/error.go | 3 + .../redis/go-redis/v9/generic_commands.go | 6 + .../redis/go-redis/v9/hash_commands.go | 5 + .../github.com/redis/go-redis/v9/himport.go | 473 + .../redis/go-redis/v9/himport_cluster.go | 206 + .../redis/go-redis/v9/himport_commands.go | 253 + .../redis/go-redis/v9/internal/once.go | 8 +- .../go-redis/v9/internal/otel/metrics.go | 39 +- .../redis/go-redis/v9/internal/pool/conn.go | 243 +- .../go-redis/v9/internal/pool/conn_check.go | 66 +- .../v9/internal/pool/conn_check_dummy.go | 16 +- .../redis/go-redis/v9/internal/pool/pool.go | 337 +- .../go-redis/v9/internal/pool/pool_sticky.go | 44 +- .../redis/go-redis/v9/internal/pool/pubsub.go | 4 + .../go-redis/v9/internal/proto/reader.go | 175 +- .../go-redis/v9/internal/proto/writer.go | 2 +- .../redis/go-redis/v9/internal/semaphore.go | 54 +- .../github.com/redis/go-redis/v9/iterator.go | 8 + vendor/github.com/redis/go-redis/v9/json.go | 27 +- .../redis/go-redis/v9/list_commands.go | 65 + .../redis/go-redis/v9/local_cache.go | 774 + .../go-redis/v9/maintnotifications/manager.go | 174 +- .../v9/maintnotifications/pool_hook.go | 11 +- .../push_notification_handler.go | 11 +- .../github.com/redis/go-redis/v9/options.go | 202 +- .../redis/go-redis/v9/osscluster.go | 966 +- .../redis/go-redis/v9/osscluster_commands.go | 6 +- .../redis/go-redis/v9/osscluster_router.go | 16 +- .../redis/go-redis/v9/probabilistic.go | 18 + .../redis/go-redis/v9/pubsub_commands.go | 16 +- .../redis/go-redis/v9/push/processor.go | 98 +- vendor/github.com/redis/go-redis/v9/redis.go | 1187 +- vendor/github.com/redis/go-redis/v9/ring.go | 91 +- vendor/github.com/redis/go-redis/v9/script.go | 16 +- .../redis/go-redis/v9/scripting_commands.go | 12 +- .../redis/go-redis/v9/search_builders.go | 25 + .../redis/go-redis/v9/search_collect.go | 235 + .../redis/go-redis/v9/search_commands.go | 124 +- .../github.com/redis/go-redis/v9/sentinel.go | 85 +- .../redis/go-redis/v9/set_commands.go | 64 + .../redis/go-redis/v9/stream_commands.go | 43 +- .../redis/go-redis/v9/string_commands.go | 6 + .../redis/go-redis/v9/timeseries_commands.go | 467 +- vendor/github.com/redis/go-redis/v9/tx.go | 13 +- .../github.com/redis/go-redis/v9/universal.go | 41 + .../github.com/redis/go-redis/v9/version.go | 2 +- vendor/golang.org/x/oauth2/google/default.go | 2 +- vendor/modules.txt | 106 +- 254 files changed, 55498 insertions(+), 19593 deletions(-) delete mode 100644 vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/README delete mode 100644 vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/borrowed_fields.go delete mode 100644 vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/borrowed_managedfields.go delete mode 100644 vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/borrowed_typeconverter.go delete mode 100644 vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/borrowed_versionconverter.go delete mode 100644 vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/doc.go delete mode 100644 vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/wrapper.go delete mode 100644 vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/resource_filter.go rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/LICENSE (100%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/internal/kubernetes_vendor/pkg/api/v1/endpoints/util.go (96%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/internal/kubernetes_vendor/pkg/util/hash/hash.go (100%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/diff/diff.go (82%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/diff/diff_options.go (95%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/health/health.go (68%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/health/health_apiservice.go (97%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/health/health_argo.go (100%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/health/health_daemonset.go (97%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/health/health_deployment.go (97%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/health/health_hpa.go (98%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/health/health_ingress.go (100%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/health/health_job.go (95%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/health/health_pod.go (78%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/health/health_pvc.go (94%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/health/health_replicaset.go (96%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/health/health_service.go (94%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/health/health_statefulset.go (97%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/sync/common/types.go (95%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/sync/hook/delete_policy.go (73%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/sync/hook/helm/delete_policy.go (89%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/sync/hook/helm/hook.go (100%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/sync/hook/helm/type.go (86%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/sync/hook/helm/weight.go (100%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/sync/hook/hook.go (70%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/sync/resource/annotations.go (89%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/utils/io/io.go (100%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/utils/json/json.go (100%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/utils/kube/convert.go (93%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/utils/kube/ctl.go (92%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/utils/kube/kube.go (100%) create mode 100644 vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/openapi_resources.go create mode 100644 vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/resource_filter.go rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/utils/kube/resource_ops.go (93%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/utils/kube/scheme/parser.go (89%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/utils/kube/scheme/scheme.go (100%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/utils/kube/scheme/typed.go (100%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/utils/kube/uniqueprotomodels.go (100%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/utils/text/text.go (100%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/utils/tracing/api.go (100%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/utils/tracing/logging.go (100%) rename vendor/github.com/argoproj/argo-cd/gitops-engine/{ => v3}/pkg/utils/tracing/nop.go (100%) delete mode 100644 vendor/github.com/argoproj/argo-cd/v3/util/git/OWNERS create mode 100644 vendor/github.com/argoproj/argo-cd/v3/util/hash/hash.go delete mode 100644 vendor/github.com/argoproj/argo-cd/v3/util/helm/OWNERS create mode 100644 vendor/github.com/bombsimon/logrusr/v4/.golangci.yaml delete mode 100644 vendor/github.com/dlclark/regexp2/.travis.yml delete mode 100644 vendor/github.com/dlclark/regexp2/README.md delete mode 100644 vendor/github.com/dlclark/regexp2/match.go delete mode 100644 vendor/github.com/dlclark/regexp2/regexp.go delete mode 100644 vendor/github.com/dlclark/regexp2/replace.go delete mode 100644 vendor/github.com/dlclark/regexp2/runner.go delete mode 100644 vendor/github.com/dlclark/regexp2/syntax/charclass.go delete mode 100644 vendor/github.com/dlclark/regexp2/syntax/code.go delete mode 100644 vendor/github.com/dlclark/regexp2/syntax/replacerdata.go delete mode 100644 vendor/github.com/dlclark/regexp2/syntax/tree.go delete mode 100644 vendor/github.com/dlclark/regexp2/syntax/writer.go delete mode 100644 vendor/github.com/dlclark/regexp2/testoutput1 rename vendor/github.com/dlclark/regexp2/{ => v2}/.gitignore (94%) rename vendor/github.com/dlclark/regexp2/{ => v2}/ATTRIB (100%) rename vendor/github.com/dlclark/regexp2/{ => v2}/LICENSE (100%) create mode 100644 vendor/github.com/dlclark/regexp2/v2/README.md create mode 100644 vendor/github.com/dlclark/regexp2/v2/Taskfile.yml create mode 100644 vendor/github.com/dlclark/regexp2/v2/bufferpool.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/decode.go rename vendor/github.com/dlclark/regexp2/{ => v2}/fastclock.go (92%) create mode 100644 vendor/github.com/dlclark/regexp2/v2/findfirstchar.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/helpers/ascii.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/helpers/indexof.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/helpers/math.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/helpers/runes.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/helpers/searchvalues.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/match.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/matchview.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/options.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/prefixsearch.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/regexp.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/regexp_codegen.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/replace.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/runner.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/split.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/stringprefixfilter.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/syntax/charclass.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/syntax/code.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/syntax/ecma_unicode.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/syntax/ecma_unicode_tables.go rename vendor/github.com/dlclark/regexp2/{ => v2}/syntax/escape.go (90%) rename vendor/github.com/dlclark/regexp2/{ => v2}/syntax/fuzz.go (80%) create mode 100644 vendor/github.com/dlclark/regexp2/v2/syntax/grapheme.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/syntax/optimizations.go rename vendor/github.com/dlclark/regexp2/{ => v2}/syntax/parser.go (59%) rename vendor/github.com/dlclark/regexp2/{ => v2}/syntax/prefix.go (71%) create mode 100644 vendor/github.com/dlclark/regexp2/v2/syntax/prefixanalyzer.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/syntax/replacerdata.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/syntax/tree.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/syntax/unicode_alias_tables.go create mode 100644 vendor/github.com/dlclark/regexp2/v2/syntax/writer.go delete mode 100644 vendor/github.com/gobwas/glob/.travis.yml delete mode 100644 vendor/github.com/gobwas/glob/compiler/compiler.go create mode 100644 vendor/github.com/gobwas/glob/internal/debug/debug_disabled.go create mode 100644 vendor/github.com/gobwas/glob/internal/debug/debug_enabled.go create mode 100644 vendor/github.com/gobwas/glob/internal/debug/tree.go create mode 100644 vendor/github.com/gobwas/glob/match.go delete mode 100644 vendor/github.com/gobwas/glob/match/any.go delete mode 100644 vendor/github.com/gobwas/glob/match/any_of.go delete mode 100644 vendor/github.com/gobwas/glob/match/btree.go delete mode 100644 vendor/github.com/gobwas/glob/match/contains.go delete mode 100644 vendor/github.com/gobwas/glob/match/every_of.go delete mode 100644 vendor/github.com/gobwas/glob/match/list.go delete mode 100644 vendor/github.com/gobwas/glob/match/match.go delete mode 100644 vendor/github.com/gobwas/glob/match/max.go delete mode 100644 vendor/github.com/gobwas/glob/match/min.go delete mode 100644 vendor/github.com/gobwas/glob/match/nothing.go delete mode 100644 vendor/github.com/gobwas/glob/match/prefix.go delete mode 100644 vendor/github.com/gobwas/glob/match/prefix_any.go delete mode 100644 vendor/github.com/gobwas/glob/match/prefix_suffix.go delete mode 100644 vendor/github.com/gobwas/glob/match/range.go delete mode 100644 vendor/github.com/gobwas/glob/match/row.go delete mode 100644 vendor/github.com/gobwas/glob/match/segments.go delete mode 100644 vendor/github.com/gobwas/glob/match/single.go delete mode 100644 vendor/github.com/gobwas/glob/match/suffix.go delete mode 100644 vendor/github.com/gobwas/glob/match/suffix_any.go delete mode 100644 vendor/github.com/gobwas/glob/match/super.go delete mode 100644 vendor/github.com/gobwas/glob/match/text.go create mode 100644 vendor/github.com/gobwas/glob/parse.go delete mode 100644 vendor/github.com/gobwas/glob/syntax/ast/ast.go delete mode 100644 vendor/github.com/gobwas/glob/syntax/ast/parser.go create mode 100644 vendor/github.com/gobwas/glob/syntax/lexer.go delete mode 100644 vendor/github.com/gobwas/glob/syntax/lexer/lexer.go delete mode 100644 vendor/github.com/gobwas/glob/syntax/lexer/token.go delete mode 100644 vendor/github.com/gobwas/glob/syntax/syntax.go delete mode 100644 vendor/github.com/gobwas/glob/util/runes/runes.go delete mode 100644 vendor/github.com/gobwas/glob/util/strings/strings.go create mode 100644 vendor/github.com/redis/go-redis/v9/AGENTS.md create mode 100644 vendor/github.com/redis/go-redis/v9/CLAUDE.md create mode 100644 vendor/github.com/redis/go-redis/v9/autopipeline.go create mode 100644 vendor/github.com/redis/go-redis/v9/autopipeline_bench_README.md create mode 100644 vendor/github.com/redis/go-redis/v9/csc_commands.go create mode 100644 vendor/github.com/redis/go-redis/v9/csc_integration.go create mode 100644 vendor/github.com/redis/go-redis/v9/csc_stats.go create mode 100644 vendor/github.com/redis/go-redis/v9/himport.go create mode 100644 vendor/github.com/redis/go-redis/v9/himport_cluster.go create mode 100644 vendor/github.com/redis/go-redis/v9/himport_commands.go create mode 100644 vendor/github.com/redis/go-redis/v9/local_cache.go create mode 100644 vendor/github.com/redis/go-redis/v9/search_collect.go diff --git a/go.mod b/go.mod index 76c6e32ce..58b77bec6 100644 --- a/go.mod +++ b/go.mod @@ -1,11 +1,13 @@ module github.com/hybrid-cloud-patterns/patterns-operator -go 1.26.5 +go 1.27.0 require ( code.gitea.io/sdk/gitea v0.25.1 + dario.cat/mergo v1.0.2 github.com/Masterminds/semver/v3 v3.5.0 github.com/argoproj-labs/argocd-operator v0.20.0-rc1 + github.com/argoproj/argo-cd/v3 v3.6.2 github.com/bradleyfalzon/ghinstallation/v2 v2.19.0 github.com/go-errors/errors v1.5.1 github.com/go-git/go-git/v5 v5.19.3 @@ -25,13 +27,8 @@ require ( k8s.io/api v0.37.1 k8s.io/apimachinery v0.37.1 k8s.io/client-go v12.0.0+incompatible - sigs.k8s.io/controller-runtime v0.24.1 -) - -require ( - dario.cat/mergo v1.0.2 - github.com/argoproj/argo-cd/v3 v3.5.6 k8s.io/utils v0.0.0-20261023123148-ca04ba58ecab + sigs.k8s.io/controller-runtime v0.24.1 sigs.k8s.io/controller-runtime/tools/setup-envtest v0.25.3 sigs.k8s.io/controller-tools v0.23.0 sigs.k8s.io/yaml v1.6.0 @@ -52,12 +49,12 @@ require ( github.com/Masterminds/sprig/v3 v3.3.0 // indirect github.com/Microsoft/go-winio v0.6.4 // indirect github.com/ProtonMail/go-crypto v1.4.1 // indirect - github.com/argoproj/argo-cd/gitops-engine v0.7.1-0.20250908182407-97ad5b59a627 // indirect + github.com/argoproj/argo-cd/gitops-engine/v3 v3.6.2 // indirect github.com/argoproj/pkg/v2 v2.0.1 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/bmatcuk/doublestar/v4 v4.10.4 // indirect - github.com/bombsimon/logrusr/v4 v4.1.0 // indirect + github.com/bombsimon/logrusr/v4 v4.2.0 // indirect github.com/casbin/casbin/v2 v2.135.0 // indirect github.com/casbin/govaluate v1.10.0 // indirect github.com/cenkalti/backoff/v5 v5.0.3 // indirect @@ -69,7 +66,7 @@ require ( github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/davidmz/go-pageant v1.0.2 // indirect github.com/distribution/reference v0.6.0 // indirect - github.com/dlclark/regexp2 v1.12.0 // indirect + github.com/dlclark/regexp2/v2 v2.13.0 // indirect github.com/emicklei/go-restful/v3 v3.13.0 // indirect github.com/emirpasic/gods v1.18.1 // indirect github.com/evanphx/json-patch/v5 v5.9.11 // indirect @@ -82,24 +79,24 @@ require ( github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.9.2 // indirect github.com/go-logr/zapr v1.3.0 // indirect - github.com/go-openapi/jsonpointer v1.0.0 // indirect - github.com/go-openapi/jsonreference v1.0.0 // indirect + github.com/go-openapi/jsonpointer v1.0.1 // indirect + github.com/go-openapi/jsonreference v1.0.2 // indirect github.com/go-openapi/swag v0.28.0 // indirect github.com/go-openapi/swag/cmdutils v0.28.0 // indirect - github.com/go-openapi/swag/conv v0.28.0 // indirect + github.com/go-openapi/swag/conv v0.29.1 // indirect github.com/go-openapi/swag/fileutils v0.28.0 // indirect - github.com/go-openapi/swag/jsonutils v0.28.0 // indirect - github.com/go-openapi/swag/loading v0.28.0 // indirect - github.com/go-openapi/swag/mangling v0.28.0 // indirect + github.com/go-openapi/swag/jsonutils v0.29.1 // indirect + github.com/go-openapi/swag/loading v0.29.1 // indirect + github.com/go-openapi/swag/mangling v0.29.1 // indirect github.com/go-openapi/swag/netutils v0.28.0 // indirect - github.com/go-openapi/swag/pools v0.28.0 // indirect - github.com/go-openapi/swag/stringutils v0.28.0 // indirect - github.com/go-openapi/swag/typeutils v0.28.0 // indirect - github.com/go-openapi/swag/yamlutils v0.28.0 // indirect + github.com/go-openapi/swag/pools v0.29.1 // indirect + github.com/go-openapi/swag/stringutils v0.29.1 // indirect + github.com/go-openapi/swag/typeutils v0.29.1 // indirect + github.com/go-openapi/swag/yamlutils v0.29.1 // indirect github.com/go-redis/cache/v9 v9.0.0 // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/gobuffalo/flect v1.0.3 // indirect - github.com/gobwas/glob v0.2.3 // indirect + github.com/gobwas/glob v1.0.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang-jwt/jwt/v4 v4.5.2 // indirect github.com/golang-jwt/jwt/v5 v5.3.1 // indirect @@ -144,7 +141,7 @@ require ( github.com/prometheus/client_model v0.6.3 // indirect github.com/prometheus/common v0.71.0 // indirect github.com/prometheus/procfs v0.21.1 // indirect - github.com/redis/go-redis/v9 v9.21.0 // indirect + github.com/redis/go-redis/v9 v9.22.0 // indirect github.com/robfig/cron/v3 v3.0.2-0.20210106135023-bc59245fe10e // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect github.com/santhosh-tekuri/jsonschema/v6 v6.0.3 // indirect @@ -171,15 +168,15 @@ require ( go.yaml.in/yaml/v3 v3.0.5 // indirect golang.org/x/mod v0.42.0 // indirect golang.org/x/net v0.62.0 // indirect - golang.org/x/oauth2 v0.36.0 // indirect + golang.org/x/oauth2 v0.37.0 // indirect golang.org/x/sync v0.25.0 // indirect golang.org/x/sys v0.50.0 // indirect golang.org/x/term v0.48.0 // indirect golang.org/x/text v0.44.0 // indirect - golang.org/x/time v0.15.0 // indirect + golang.org/x/time v0.16.0 // indirect golang.org/x/tools v0.52.0 // indirect gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260803160001-6ac0973c030d // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260825221802-da73d73af1c5 // indirect google.golang.org/grpc v1.84.0 // indirect google.golang.org/protobuf v1.36.12 // indirect gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect @@ -191,14 +188,14 @@ require ( k8s.io/cli-runtime v0.37.1 // indirect k8s.io/code-generator v0.37.0 // indirect k8s.io/component-base v0.37.1 // indirect - k8s.io/component-helpers v0.36.6 // indirect - k8s.io/controller-manager v0.36.1 // indirect + k8s.io/component-helpers v0.37.0 // indirect + k8s.io/controller-manager v0.37.0 // indirect k8s.io/gengo/v2 v2.0.0-20260408192533-25e2208e0dc3 // indirect k8s.io/klog/v2 v2.140.0 // indirect - k8s.io/kube-aggregator v0.36.2 // indirect + k8s.io/kube-aggregator v0.37.0 // indirect k8s.io/kube-openapi v0.0.0-20260721132016-d427ff9ee9ad // indirect k8s.io/kubectl v0.37.1 // indirect - k8s.io/kubernetes v1.36.1 // indirect + k8s.io/kubernetes v1.37.0 // indirect oras.land/oras-go/v2 v2.6.2 // indirect sigs.k8s.io/json v0.0.0-20260909141634-11ed52e25bc5 // indirect sigs.k8s.io/kustomize/api v0.21.1 // indirect diff --git a/go.sum b/go.sum index f54f8b7f9..875403575 100644 --- a/go.sum +++ b/go.sum @@ -41,18 +41,18 @@ github.com/Microsoft/go-winio v0.6.4 h1:kJF2pamtYCWXf0xAT8sAkwKC0pMl2HYBrRPHAqyU github.com/Microsoft/go-winio v0.6.4/go.mod h1:1xl5JXG4ze/m74GH6Dc4Mwxfc3VL5siRVQjIAlHH07U= github.com/ProtonMail/go-crypto v1.4.1 h1:9RfcZHqEQUvP8RzecWEUafnZVtEvrBVL9BiF67IQOfM= github.com/ProtonMail/go-crypto v1.4.1/go.mod h1:e1OaTyu5SYVrO9gKOEhTc+5UcXtTUa+P3uLudwcgPqo= -github.com/alicebob/miniredis/v2 v2.38.0 h1:nZAzCR+Lj+Vxk4ZXzm2NuKq2O33RXj1XxJ2e2uP9jiw= -github.com/alicebob/miniredis/v2 v2.38.0/go.mod h1:TcL7YfarKPGDAthEtl5NBeHZfeUQj6OXMm/+iu5cLMM= +github.com/alicebob/miniredis/v2 v2.39.0 h1:M7WbmV5BmV56L8KTG0rw6vEQ+woTOghpDgin2xv4A0g= +github.com/alicebob/miniredis/v2 v2.39.0/go.mod h1:TcL7YfarKPGDAthEtl5NBeHZfeUQj6OXMm/+iu5cLMM= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFIImctFaOjnTIavg87rW78vTPkQqLI8= github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4= github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= github.com/argoproj-labs/argocd-operator v0.20.0-rc1 h1:wdTV72+rurg0a1zu+WZx9GhqkXpI2OLsA/dnqkyzt6Q= github.com/argoproj-labs/argocd-operator v0.20.0-rc1/go.mod h1:a5QbpV5CWplHV3m194Zl1Lq4TOQvbnSUsC+5xLfCZls= -github.com/argoproj/argo-cd/gitops-engine v0.0.0-20260827090335-e258ee23c3e5 h1:8vyBhWiaNxZrYw1jN1Qznp6xOWHUTisseNKUPEV+HXM= -github.com/argoproj/argo-cd/gitops-engine v0.0.0-20260827090335-e258ee23c3e5/go.mod h1:RsOM4gdM/lsvAfIuzAhYrnHDTLA1AGooZRzVyxbVT3A= -github.com/argoproj/argo-cd/v3 v3.5.6 h1:twzdsPiPufKLRtEqD1Jg3FqtuZmSHLTIxs7t6fSkjlk= -github.com/argoproj/argo-cd/v3 v3.5.6/go.mod h1:LJTX+2yLfWvFCK7/wyg+f9KEQ92QBYLtsQiMJ1jEor0= +github.com/argoproj/argo-cd/gitops-engine/v3 v3.6.2 h1:Cj+AKBFtygbVH7hRyF1uT5FtTt4JDVAIH6yehdzatiA= +github.com/argoproj/argo-cd/gitops-engine/v3 v3.6.2/go.mod h1:gu+Web1+g1biU+QlcS+p1sxeL+EMPRlaXVyOqUBBZfI= +github.com/argoproj/argo-cd/v3 v3.6.2 h1:t6RQrVV4hg9M0+lPMsUvi9e4RnYV9dE99/guXGxG6Lc= +github.com/argoproj/argo-cd/v3 v3.6.2/go.mod h1:801WasEAOgOw/wyP/rAbu0aZtFfOJE8jOzeVKlJS0+M= github.com/argoproj/pkg/v2 v2.0.1 h1:O/gCETzB/3+/hyFL/7d/VM/6pSOIRWIiBOTb2xqAHvc= github.com/argoproj/pkg/v2 v2.0.1/go.mod h1:sdifF6sUTx9ifs38ZaiNMRJuMpSCBB9GulHfbPgQeRE= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= @@ -64,8 +64,8 @@ github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2y github.com/bmatcuk/doublestar/v4 v4.6.1/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= github.com/bmatcuk/doublestar/v4 v4.10.4 h1:oTKkRmRuOsKMqFe1AQazd9gGBFNEpOmgKp/xzB97dnA= github.com/bmatcuk/doublestar/v4 v4.10.4/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc= -github.com/bombsimon/logrusr/v4 v4.1.0 h1:uZNPbwusB0eUXlO8hIUwStE6Lr5bLN6IgYgG+75kuh4= -github.com/bombsimon/logrusr/v4 v4.1.0/go.mod h1:pjfHC5e59CvjTBIU3V3sGhFWFAnsnhOR03TRc6im0l8= +github.com/bombsimon/logrusr/v4 v4.2.0 h1:PtF9HJuahhgABQyTLHoWn+ZSAQouOIR2RroymnmCrec= +github.com/bombsimon/logrusr/v4 v4.2.0/go.mod h1:NfKyUyEGfMXCSH4/VU4mtLqP885vHRYBe3xbgamChbA= github.com/bradleyfalzon/ghinstallation/v2 v2.19.0 h1:KQfD+43pRw9NUJhGycGrFr9vF1MubZacksKol1gomFI= github.com/bradleyfalzon/ghinstallation/v2 v2.19.0/go.mod h1:fe5ECIhCdEnxwLiBlNTxx9CP455wt42BELnlDVMvaAA= github.com/bsm/ginkgo/v2 v2.12.0 h1:Ny8MWAHyOepLGlLKYmXG4IEkioBysk6GpaRTLC8zwWs= @@ -109,6 +109,8 @@ github.com/distribution/reference v0.6.0 h1:0IXCQ5g4/QMHHkarYzh5l+u8T3t73zM5Qvfr github.com/distribution/reference v0.6.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E= github.com/dlclark/regexp2 v1.12.0 h1:0j4c5qQmnC6XOWNjP3PIXURXN2gWx76rd3KvgdPkCz8= github.com/dlclark/regexp2 v1.12.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/dlclark/regexp2/v2 v2.13.0 h1:sGPfGE1Bx7H3F9vcCdLrKUFvnau7DGiQZxHPQ6rMMs4= +github.com/dlclark/regexp2/v2 v2.13.0/go.mod h1:avUrQvPaLz2DrFNHJF0taWAFFX2C1GMSSoeiqFjcBmU= github.com/elazarl/goproxy v1.7.2 h1:Y2o6urb7Eule09PjlhQRGNsqRfPmYI3KKQLFpCAV3+o= github.com/elazarl/goproxy v1.7.2/go.mod h1:82vkLNir0ALaW14Rc399OTTjyNREgmdL2cVoIbS6XaE= github.com/emicklei/go-restful/v3 v3.13.0 h1:C4Bl2xDndpU6nJ4bc1jXd+uTmYPVUwkD6bFY/oTyCes= @@ -135,6 +137,8 @@ github.com/fsnotify/fsnotify v1.10.1 h1:b0/UzAf9yR5rhf3RPm9gf3ehBPpf0oZKIjtpKrx5 github.com/fsnotify/fsnotify v1.10.1/go.mod h1:TLheqan6HD6GBK6PrDWyDPBaEV8LspOxvPSjC+bVfgo= github.com/fxamacker/cbor/v2 v2.9.4 h1:xwjVlxEMR3S605oUlgBjKLTTeGFciYPGYCtF/35LKGo= github.com/fxamacker/cbor/v2 v2.9.4/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= +github.com/gfleury/go-bitbucket-v1 v0.0.0-20240917142304-df385efaac68 h1:iJXWkoIPk3e8RVHhQE/gXfP2TP3OLQ9vVPNSJ+oL6mM= +github.com/gfleury/go-bitbucket-v1 v0.0.0-20240917142304-df385efaac68/go.mod h1:bB7XwdZF40tLVnu9n5A9TjI2ddNZtLYImtwYwmcmnRo= github.com/gkampitakis/ciinfo v0.3.2 h1:JcuOPk8ZU7nZQjdUhctuhQofk7BGHuIy0c9Ez8BNhXs= github.com/gkampitakis/ciinfo v0.3.2/go.mod h1:1NIwaOcFChN4fa/B0hEBdAb6npDlFL8Bwx4dfRLRqAo= github.com/gkampitakis/go-diff v1.3.2 h1:Qyn0J9XJSDTgnsgHRdz9Zp24RaJeKMUHg2+PDZZdC4M= @@ -155,8 +159,8 @@ github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399 h1:eMj github.com/go-git/go-git-fixtures/v4 v4.3.2-0.20231010084843-55a94097c399/go.mod h1:1OCfN199q1Jm3HZlxleg+Dw/mwps2Wbk9frAWm+4FII= github.com/go-git/go-git/v5 v5.19.3 h1:qHttbZ+Am7wEjdTpR1XMQ4rl42FK9SIXzZ4o9x7s6M4= github.com/go-git/go-git/v5 v5.19.3/go.mod h1:Ye4C8dVigkqrv9UsB4NMdSLV4yAIkLiIhW61gcOyhl4= -github.com/go-jose/go-jose/v4 v4.1.4 h1:moDMcTHmvE6Groj34emNPLs/qtYXRVcd6S7NHbHz3kA= -github.com/go-jose/go-jose/v4 v4.1.4/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= +github.com/go-jose/go-jose/v4 v4.1.7 h1:Nac/98uT5LPkfbiFuYa8ktf62a2VxwQ4xbq1GK8pV5E= +github.com/go-jose/go-jose/v4 v4.1.7/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8= github.com/go-logr/logr v1.4.4/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= @@ -164,40 +168,40 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ= github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg= -github.com/go-openapi/jsonpointer v1.0.0 h1:kR9tHqY0CtZaOPVFm622dPVNhrvYpwr4uCxgL3h1H8s= -github.com/go-openapi/jsonpointer v1.0.0/go.mod h1:Z3rw7dWu1p9IgitXCFamSlA5lmDiklEB6vkaxcNZW5Y= -github.com/go-openapi/jsonreference v1.0.0 h1:jlmTr6torcd1YgDQvSfNmRtKzYDO4FGBkrAdlAVWnpY= -github.com/go-openapi/jsonreference v1.0.0/go.mod h1:jtwdyGbJk0Xhe5Y+rwtglQP6Sb1WZST4rT32LWB+sv0= +github.com/go-openapi/jsonpointer v1.0.1 h1:2KxywRmNwJkT/FMBa3iRNHEaAxSJvjqoufQZy3au1Mg= +github.com/go-openapi/jsonpointer v1.0.1/go.mod h1:wI7ZYsFmbIi9nBXOZqgDaS/bqOchRGZjqxFli7FBYxY= +github.com/go-openapi/jsonreference v1.0.2 h1:oS4et8FOf3p3UQxEo4Xt0esijmBUM+F259Xl72OSZsc= +github.com/go-openapi/jsonreference v1.0.2/go.mod h1:TbUNSOo+fcorZjFaNoiSDSoaNnnZtqJtLGR1PuvE/Cs= github.com/go-openapi/swag v0.28.0 h1:xkgbOSKj6DZziNpyqRRAOt3GJGtgjgsd2RoyT30VWuw= github.com/go-openapi/swag v0.28.0/go.mod h1:4qYnT3Cqr1p1VknOdPo70evN4rgQnAg6jwApHyxSGIg= github.com/go-openapi/swag/cmdutils v0.28.0 h1:7TOeNtkYru1SG8Y34tDh9WBbLsMqGnptuxWiHREPZ4Q= github.com/go-openapi/swag/cmdutils v0.28.0/go.mod h1:Sm1MVFMkF6guJJ+pQqHnQA3N0j9qALV3NxzDSv6bETM= -github.com/go-openapi/swag/conv v0.28.0 h1:GtqqbyFe7vR5Y7ehxG9W6/OvrSFdf1OLeTGp40TqxH8= -github.com/go-openapi/swag/conv v0.28.0/go.mod h1:mbUE+mzctnhxi864m0Q07SpN8OowD9JhxmxuYvZZD/k= +github.com/go-openapi/swag/conv v0.29.1 h1:AC4Eh/5c/eUDOUCzzsRC9ghmFgOSBHeRMGIngY0ZUGA= +github.com/go-openapi/swag/conv v0.29.1/go.mod h1:S1X7/ZrBEZOC0Wc8AGxjbcGS92l3WEjA7aPtpl+RaqM= github.com/go-openapi/swag/fileutils v0.28.0 h1:Z04XWQD7R8Eq+7GnOrjovBxPPmZzsS4gt2H2GPGIViU= github.com/go-openapi/swag/fileutils v0.28.0/go.mod h1:VvJFZLTZS0AI854gEQz5tk7dBESdLjiNUMSZ/th2ry8= -github.com/go-openapi/swag/jsonutils v0.28.0 h1:YIch6FwO7RXzeAnbO8Tu7dWBZeUEH+4nA0HXltVTnv4= -github.com/go-openapi/swag/jsonutils v0.28.0/go.mod h1:CYM3WlTUcagR2ZoHdz54di/cbBqt82tuxuXgAjxw+mg= -github.com/go-openapi/swag/jsonutils/fixtures_test v0.28.0 h1:qV+VVUAx5Oro8WjVWpZeql7YReTKhT4smR4zhcOQZr0= -github.com/go-openapi/swag/jsonutils/fixtures_test v0.28.0/go.mod h1:mofwUWx70wvskwESqRJ//k/9kURmCgyJl5m5Ppoh5kY= -github.com/go-openapi/swag/loading v0.28.0 h1:td8QZdZC9MIYGGSnSPKShKiK22I2tU5UQvuUhIBPRLU= -github.com/go-openapi/swag/loading v0.28.0/go.mod h1:rXB0QiQX5mMveXEA7ouM4KiiM9jVJe4K6BVbwhD1M4k= -github.com/go-openapi/swag/mangling v0.28.0 h1:pH8eyeNO9SLYsTMWJrurnNfKmDa28XrlA+HePVD53VM= -github.com/go-openapi/swag/mangling v0.28.0/go.mod h1:jtBE2+V+3pILxOR7Vgce+Cwp6A2PgZbvVqfNntbVs0w= +github.com/go-openapi/swag/jsonutils v0.29.1 h1:AFCxs0eQZ24/QyfhVHM2t49rMz7Vv3XCsZQI6yrNy+c= +github.com/go-openapi/swag/jsonutils v0.29.1/go.mod h1:u3+sCfJpttDpcmS5kpm0yxL6GK0eWgODsx8Yw8fcqNM= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.29.1 h1:BiiXE31Bx9SfpsMmOQj5KYpUhTZBpLVriVhJDuLuY2o= +github.com/go-openapi/swag/jsonutils/fixtures_test v0.29.1/go.mod h1:julgTUKZ9/D0j6O7GKajmRs+812FWxQg/mMpGunWSjg= +github.com/go-openapi/swag/loading v0.29.1 h1:FCv5fG8UhTdDJa2R7w+5O9Ekpcbw7tt0nFWvmDKGBjc= +github.com/go-openapi/swag/loading v0.29.1/go.mod h1:N0ESuem4p2oedKal8EJhciqnJ9Q9Wmt83L1CRB3Fouw= +github.com/go-openapi/swag/mangling v0.29.1 h1:lHALtvYCdxVnRl4GrHmFPwfBTZYIObqdGNSKyu/8D6I= +github.com/go-openapi/swag/mangling v0.29.1/go.mod h1:SAop9pB7PUjQ/CGCNf/JmCKTRK+GDO+RqE9UHqC/N6s= github.com/go-openapi/swag/netutils v0.28.0 h1:YXN6TALEi2pzts8/8GNm6T61HTAZsieukGZidap989k= github.com/go-openapi/swag/netutils v0.28.0/go.mod h1:J+WYyFMLtvtCGqa6jLv+YNUmIKI3ZRQRrvfNDMoQoEQ= -github.com/go-openapi/swag/pools v0.28.0 h1:HPMZWSAfce3rdVTFcjFiCIBtDg9h4x2QlRrHipwhxeU= -github.com/go-openapi/swag/pools v0.28.0/go.mod h1:kVQefhSK5RWuRe7BXsL8htgBPAMpN7HDGpGEknqugeE= -github.com/go-openapi/swag/stringutils v0.28.0 h1:ixsc9iYgDPubHL/8nSkbnryEHpD2VRlBMLKpQyPXcDU= -github.com/go-openapi/swag/stringutils v0.28.0/go.mod h1:lzRN95CxXmA03XcDWHLOb6nOMcxCqR5rGY0lOgsfRoM= -github.com/go-openapi/swag/typeutils v0.28.0 h1:nRBKSBXjDgf01VDPB3fWeD9nQuhCOVeIYAkUx2tbkyY= -github.com/go-openapi/swag/typeutils v0.28.0/go.mod h1:Srm0xFNRZ1Y+vCxJclo5qzx8aj+1pAKda/YfFPrG0dQ= -github.com/go-openapi/swag/yamlutils v0.28.0 h1:TV3JXH6DS46KUroDtMLAYHGkdWf5VDq3wVWFirmzROY= -github.com/go-openapi/swag/yamlutils v0.28.0/go.mod h1:x0q/yndZHEgk9Rx3DyDqzFUmHy55KTvIZldvF2dTJXs= -github.com/go-openapi/testify/enable/yaml/v2 v2.6.0 h1:gGHwAJ0R/5jU8BEGDbfRNR3hL68dAVi84WuOApp29B0= -github.com/go-openapi/testify/enable/yaml/v2 v2.6.0/go.mod h1:tY+St1SGq4NFl0QIqdTY4aEdbChAHxhyB77XQi9iJCo= -github.com/go-openapi/testify/v2 v2.6.0 h1:5PKH2HE7YJ/LuRPQGvSxBRlFXNQhSetBLlGAgUEu3ug= -github.com/go-openapi/testify/v2 v2.6.0/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw= +github.com/go-openapi/swag/pools v0.29.1 h1:NRogYxdEW9SjRM4mkAOji9iefO4MRXq3p/ZJcoQbUKg= +github.com/go-openapi/swag/pools v0.29.1/go.mod h1:leDcaghjkRAhCuCRv9NfJU5f0mjoU3cT/XZObhMk3pc= +github.com/go-openapi/swag/stringutils v0.29.1 h1:1ykunK7iJQk1uOO7+oUH1ukbsK85fFCOiCFMOVSY+F0= +github.com/go-openapi/swag/stringutils v0.29.1/go.mod h1:7fSqZ+z8Qc0tOfAAK0jVa5qFGrnIlRi6n7NeGGrr1vc= +github.com/go-openapi/swag/typeutils v0.29.1 h1:Nzv9nhnlLCRBPQqfOX+7lB6Guju370or8StT+lIOf6M= +github.com/go-openapi/swag/typeutils v0.29.1/go.mod h1:hxpgDZJVBkBsi/d3MIUosafoFdE5exaQRmVp0zwu3YE= +github.com/go-openapi/swag/yamlutils v0.29.1 h1:69w3tsBajm7MR/fejLy7HD/3J68Ys1SeeZMEzZ3w2sk= +github.com/go-openapi/swag/yamlutils v0.29.1/go.mod h1:rgsp3vT/QdWzKwn43CigDwjOGIenPyTZMKnxEM8jZOA= +github.com/go-openapi/testify/enable/yaml/v2 v2.6.1 h1:Jm+/ze2rMtbD98yen92AhATGLGREDYXG56Xr4gMjEtE= +github.com/go-openapi/testify/enable/yaml/v2 v2.6.1/go.mod h1:YDPnwCRDu38/oJBVMBVXOUDiJ9cIeBHWvfImHaXqnv4= +github.com/go-openapi/testify/v2 v2.7.0 h1:bycOreEj6wfBvijg3YFogZ/sFjTCDmQnwSodSzHa3X8= +github.com/go-openapi/testify/v2 v2.7.0/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw= github.com/go-playground/webhooks/v6 v6.4.0 h1:KLa6y7bD19N48rxJDHM0DpE3T4grV7GxMy1b/aHMWPY= github.com/go-playground/webhooks/v6 v6.4.0/go.mod h1:5lBxopx+cAJiBI4+kyRbuHrEi+hYRDdRHuRR4Ya5Ums= github.com/go-redis/cache/v9 v9.0.0 h1:0thdtFo0xJi0/WXbRVu8B066z8OvVymXTJGaXrVWnN0= @@ -207,8 +211,8 @@ github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1v github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/gobuffalo/flect v1.0.3 h1:xeWBM2nui+qnVvNM4S3foBhCAL2XgPU+a7FdpelbTq4= github.com/gobuffalo/flect v1.0.3/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs= -github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= -github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= +github.com/gobwas/glob v1.0.0 h1:p+FKbLEIsK1yZ39/OINwFvqNb5oyPY4H8xcy6uYu8dg= +github.com/gobwas/glob v1.0.0/go.mod h1:oWCdo522i2P1n/hMXGNWs7yoV4wy/ciZuUIbvKj5rkc= github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw= github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA= github.com/gogits/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85 h1:04sojTxgYxu1L4Hn7Tgf7UVtIosVa6CuHtvNY+7T1K4= @@ -266,12 +270,12 @@ github.com/google/uuid v1.6.1-0.20241114170450-2d3c2a9cc518 h1:UBg1xk+oAsIVbFuGg github.com/google/uuid v1.6.1-0.20241114170450-2d3c2a9cc518/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo= github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA= -github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3 h1:B+8ClL/kCQkRiU82d9xajRPKYMrB7E0MbtzWVi1K4ns= -github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.3/go.mod h1:NbCUVmiS4foBGBHOYlCT25+YmGpJ32dZPi75pGEUpj4= +github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.4 h1:9ZJYjPEJpcleIKcqysXOo14NLQYwu23fzmKRFpIjPjc= +github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.3.4/go.mod h1:0xydIeg2omQ9DH6zYMP24Kk57793rnLUvP8fwdbFvz8= github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0 h1:5VipnvEpbqr2gA2VbM+nYVbkIF28c5ZQfqCBQ5g2xfk= -github.com/grpc-ecosystem/grpc-gateway/v2 v2.29.0/go.mod h1:Hyl3n6Twe1hvtd9XUXDec4pTvgMSEixRuQKPTMH2bNs= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 h1:/Tnpcb2E0Pz/tN9s3bfEY2Q8ePCEX9iuS+cneUwncnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0/go.mod h1:zOBXOsUaBSjKgmH4OGzV1esUpR3oUSCPYVd2cUBjKYY= github.com/hashicorp/go-version v1.9.0 h1:CeOIz6k+LoN3qX9Z0tyQrPtiB1DFYRPfCIBtaXPSCnA= github.com/hashicorp/go-version v1.9.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= @@ -412,8 +416,8 @@ github.com/prometheus/procfs v0.21.1/go.mod h1:aB55Cww9pdSJVHk0hUf0inxWyyjPogFIj github.com/r3labs/diff/v3 v3.0.2 h1:yVuxAY1V6MeM4+HNur92xkS39kB/N+cFi2hMkY06BbA= github.com/r3labs/diff/v3 v3.0.2/go.mod h1:Cy542hv0BAEmhDYWtGxXRQ4kqRsVIcEjG9gChUlTmkw= github.com/redis/go-redis/v9 v9.0.0-rc.4/go.mod h1:Vo3EsyWnicKnSKCA7HhgnvnyA74wOA69Cd2Meli5mmA= -github.com/redis/go-redis/v9 v9.21.0 h1:FPBE4hhbAke+TLmcY3WkpbDffJEomdqPn3HYiqAtL9E= -github.com/redis/go-redis/v9 v9.21.0/go.mod h1:v/M13XI1PVCDcm01VtPFOADfZtHf8YW3baQf57KlIkA= +github.com/redis/go-redis/v9 v9.22.0 h1:laDvpYXTJtZLloinw1fA5Kqd6HAEH2XKxOkG/PDq2F0= +github.com/redis/go-redis/v9 v9.22.0/go.mod h1:y2g0Wj8rQvuK0ELM+oxSudcLtC09JScs98I/X9gRWY4= github.com/robfig/cron/v3 v3.0.2-0.20210106135023-bc59245fe10e h1:0xChnl3lhHiXbgSJKgChye0D+DvoItkOdkGcwelDXH0= github.com/robfig/cron/v3 v3.0.2-0.20210106135023-bc59245fe10e/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= @@ -446,8 +450,8 @@ github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3A github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= -github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/objx v0.5.3 h1:jmXUvGomnU1o3W/V5h2VEradbpJDwGrzugQQvL0POH4= +github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= @@ -490,22 +494,22 @@ github.com/zeebo/xxh3 v1.1.0 h1:s7DLGDK45Dyfg7++yxI0khrfwq9661w9EN78eP/UZVs= github.com/zeebo/xxh3 v1.1.0/go.mod h1:IisAie1LELR4xhVinxWS5+zf1lA4p0MW4T+w+W07F5s= go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.69.0 h1:2yEATaop1/a1I4psnSLgWVPLWwCzkqWakgJy7xTDVy0= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.69.0/go.mod h1:D7J12YRapIekYyPWgGPlA/23pRmpSEZC5xJC/TTLI9U= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 h1:8tvICD4vSTOOsNrsI4Ljf6C+6UKvpTEH5XY3JMoyPoo= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0/go.mod h1:z9+yiacE0IHRqM4qFfkbt/JYlmYXgss8GY/jXoNuPJI= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.71.0 h1:B2h3uqicet1CT2N5TOFhS+Gq++9i0/CLmaxvhmhtP5s= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.71.0/go.mod h1:dylvB+ZiiwMvsDij9O84Uy7SijLgHMX4mbkncds+4Sw= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.71.0 h1:3g7B90UzBltIDKq1/5mrTGxTnOFDV0ICOhLoxiZ8jlg= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.71.0/go.mod h1:Ef8SuTh59BT7+ofpDxN9z+yOlc4t2GjLmKDgYNJL/NU= go.opentelemetry.io/otel v1.47.0 h1:j7ALJ/zgkS7Z6aeJW09p8VC9804bC+PpeTfCD4XPnOM= go.opentelemetry.io/otel v1.47.0/go.mod h1:8wS9O2qfXrYrzp6hIF/HOYJJf/wIhFPhR2xLuP+iXQU= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.45.0 h1:QRefszxJmfPdjXUUm3j6iDzY03mTPXMjqErFqQ67vUg= -go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.45.0/go.mod h1:Tiz03lTBVBrm7eWZBOidzEaYaJa8tjwGUGv6d8mlTyk= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.45.0 h1:fG5MCxGz8+2VtrN/WgqSpJFctVz24gpxj8CxkKmc8Ww= -go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.45.0/go.mod h1:BmAYTn+3ysbRe+IU2msxmf5Rx3g6DHvex+tWI3LdhYI= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.46.0 h1:OFnwLJr+pF3iHrlGSzbxyuo6/6HyBlnlN1CWEJmBVcw= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.46.0/go.mod h1:716wFneO0ov19A2beH5hjfh9AK5z/VWNAtDijp1Y0/g= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.46.0 h1:w53CDeOA/Kurp7yRsegSr6pbbr759dOvJ+yNmWM6Hxs= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.46.0/go.mod h1:BOmGMCbAtvcJiSJ+hLuhgPLdDbimnraSl8irz3iY8sY= go.opentelemetry.io/otel/log v1.47.0 h1:cOTS1CcLbSQeZKanGJ+0JpF/+t4PELi3O3bbl2lqCcI= go.opentelemetry.io/otel/log v1.47.0/go.mod h1:9byitSQ5pLC6PpqwGXjqdMKya6ZTswHRZh2vvXT33nw= go.opentelemetry.io/otel/metric v1.47.0 h1:4PptaldXx3Eat1XjMZ68pPJEs5wrhlemctZE9a3UdWY= go.opentelemetry.io/otel/metric v1.47.0/go.mod h1:ADGSXxRrXM6bjbvLo535EstVFlPpPYZm4LBKixjDHwU= -go.opentelemetry.io/otel/sdk v1.45.0 h1:4VVSMgQ83dUgW2aoX5f6JgLvHwIvzcuLnF9lUdCSpCw= -go.opentelemetry.io/otel/sdk v1.45.0/go.mod h1:Sr40LgXV7DsKMMJMKOhUWOgMWTfAaqvm2kF0g7ilwuA= +go.opentelemetry.io/otel/sdk v1.46.0 h1:h5CNQQjEbuQXY/JfZtgt3i7HVFV3aHPO2OAwO2eTYPI= +go.opentelemetry.io/otel/sdk v1.46.0/go.mod h1:GAERFXFt5SYCEB+YiKUbMBeza6UaDH7GmGOZEfh2gSM= go.opentelemetry.io/otel/trace v1.47.0 h1:JOjX/Oci8K94QHddo+bbfya/Ai/nf6/dt9ZfrFNWSrM= go.opentelemetry.io/otel/trace v1.47.0/go.mod h1:jNaSLa2PZEYFG6fRjJABAu+bw4FS08uDmPg28lTghu0= go.opentelemetry.io/proto/otlp v1.11.0 h1:5rrYs0Ykyj50sdU/JU0x8etU+LubXWb+gED6TbEdMIk= @@ -564,8 +568,8 @@ golang.org/x/net v0.3.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.62.0 h1:18ELalfM5+XNRwzM2nYqXsZQ9ByS1uhj2O/U7+5jqRY= golang.org/x/net v0.62.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI= -golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= -golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= +golang.org/x/oauth2 v0.37.0 h1:JUlcxA8oAtauLfiH8FX2/FkAWHAdi0QtGCGc+hofE98= +golang.org/x/oauth2 v0.37.0/go.mod h1:IxwZNxUULJmpBFf9K/9NTMSIfZZuvuTy1gGxhigP/58= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -620,8 +624,8 @@ golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.44.0 h1:YItdp/mQNGnsmrgpcdA5yQ3bnRxCfo/Tj/iByGW9GGo= golang.org/x/text v0.44.0/go.mod h1:S4FR1waQ9LbjQTls97SyRjDaUUVkaM+cXwwuG/G+MwY= -golang.org/x/time v0.15.0 h1:bbrp8t3bGUeFOx08pvsMYRTCVSMk89u4tKbNOZbp88U= -golang.org/x/time v0.15.0/go.mod h1:Y4YMaQmXwGQZoFaVFk4YpCt4FLQMYKZe9oeV/f4MSno= +golang.org/x/time v0.16.0 h1:vMb6ptszcQMkcwiRTAuNNU50gom6++Q/6gY2hDM6VDE= +golang.org/x/time v0.16.0/go.mod h1:rVKOqvZeKvrDKTQiAHJ7wmwP0RzleSphoEA9RcdLA0s= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= @@ -646,10 +650,10 @@ gomodules.xyz/jsonpatch/v2 v2.5.0 h1:JELs8RLM12qJGXU4u/TO3V25KW8GreMKl9pdkk14RM0 gomodules.xyz/jsonpatch/v2 v2.5.0/go.mod h1:AH3dM2RI6uoBZxn3LVrfvJ3E0/9dG4cSrbuBJT4moAY= google.golang.org/genproto v0.0.0-20260319201613-d00831a3d3e7 h1:XzmzkmB14QhVhgnawEVsOn6OFsnpyxNPRY9QV01dNB0= google.golang.org/genproto v0.0.0-20260319201613-d00831a3d3e7/go.mod h1:L43LFes82YgSonw6iTXTxXUX1OlULt4AQtkik4ULL/I= -google.golang.org/genproto/googleapis/api v0.0.0-20260803160001-6ac0973c030d h1:FarXi840EJWSHYTN3ERkADbPWjl307+FGrA22KAVjjc= -google.golang.org/genproto/googleapis/api v0.0.0-20260803160001-6ac0973c030d/go.mod h1:K/+WGbmBY7aNW1HDw1fJnKYo10i0DkAX6pows00dLig= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260803160001-6ac0973c030d h1:IL4hdHzcUv2l/gcg98/Rj3FbtE6axwqslOW8SW0C+S0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260803160001-6ac0973c030d/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= +google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 h1:ax2KzoSRIZU/M0cIxri3pKxy99vniH1PVxWC6si/eZI= +google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688/go.mod h1:1RJ9BQGyNdZwkGc1eTqkErfRZ6RJyYPHZo73BZ1vQqI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260825221802-da73d73af1c5 h1:1VUiZAXyC+zmiFYi+WLtBzr68Cj8wOofHjjrA/kkizc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260825221802-da73d73af1c5/go.mod h1:DjtHYE8FKJLivXcBEjGwndXfIC23G0VpXiXKqG179uA= google.golang.org/grpc v1.84.0 h1:soMyaPJ8pAak5PIQ0DGBUir0XRo2fRoMqhNWMLlLxO0= google.golang.org/grpc v1.84.0/go.mod h1:ljCht0DrxQrXBDRTZp52Qxh3Ffk8CdYm2sj4O2QN2C0= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= @@ -722,8 +726,8 @@ k8s.io/kubelet v0.36.6 h1:ZHPXiVvIIW4hAVi8U9xm0pkGZjwXGvmDgjVt/cKA4Yo= k8s.io/kubelet v0.36.6/go.mod h1:auJafwpwbeDvS0lJbglfV9Ho19hNNtsRYwOa7NO03ys= k8s.io/kubernetes v1.36.6 h1:B4yJuZ7z0DckIU9hhE513aDeUw4W9CQLO5Mg+IKN+QA= k8s.io/kubernetes v1.36.6/go.mod h1:ZyLkHB4+fxSZ4LqpShPGJhikj4ngJaYAFlaZKs7goP4= -k8s.io/streaming v0.36.6 h1:cqaB2f/NshA0ldEoab/DLRWP0yz0mB4IvbERHjoEdxs= -k8s.io/streaming v0.36.6/go.mod h1:tJ6S2bZa2HxIBauguBbCWSCYyd93Grfz1+z3tcOvlDE= +k8s.io/streaming v0.37.0 h1:iPBUZLZiKt5bV+lxJurASMOV07VuBhNpiwJt2//AWrM= +k8s.io/streaming v0.37.0/go.mod h1:APlJR26ZWRcVy5bIEj0QRrKUXROtBHPcxl2NT7EAzPU= k8s.io/utils v0.0.0-20261023123148-ca04ba58ecab h1:pjQrNLaF//ytZtWwCAHtW+pqwSKjtWDqzA8+TCX37RI= k8s.io/utils v0.0.0-20261023123148-ca04ba58ecab/go.mod h1:DdQ0BJxlQtuMlKDqdg7X5IMMQCXIk2b3d1/4M9OhUYo= oras.land/oras-go/v2 v2.6.2 h1:N04RXngAp1LJKTG6ifz3xHPipasEkWr+hFmInja5YKo= diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/README b/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/README deleted file mode 100644 index 5efb7278b..000000000 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/README +++ /dev/null @@ -1,2 +0,0 @@ -Please check the doc.go file for more details about -how to use and maintain the code in this package. diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/borrowed_fields.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/borrowed_fields.go deleted file mode 100644 index cc81456b9..000000000 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/borrowed_fields.go +++ /dev/null @@ -1,47 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fieldmanager - -import ( - "bytes" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "sigs.k8s.io/structured-merge-diff/v6/fieldpath" -) - -// EmptyFields represents a set with no paths -// It looks like metav1.Fields{Raw: []byte("{}")} -var EmptyFields = func() metav1.FieldsV1 { - f, err := SetToFields(*fieldpath.NewSet()) - if err != nil { - panic("should never happen") - } - return f -}() - -// FieldsToSet creates a set paths from an input trie of fields -func FieldsToSet(f metav1.FieldsV1) (s fieldpath.Set, err error) { - err = s.FromJSON(bytes.NewReader(f.Raw)) - return s, err -} - -// SetToFields creates a trie of fields from an input set of paths -func SetToFields(s fieldpath.Set) (f metav1.FieldsV1, err error) { - f.Raw, err = s.ToJSON() - return f, err -} diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/borrowed_managedfields.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/borrowed_managedfields.go deleted file mode 100644 index 44d97b5b7..000000000 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/borrowed_managedfields.go +++ /dev/null @@ -1,248 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fieldmanager - -import ( - "encoding/json" - "fmt" - "sort" - - "k8s.io/apimachinery/pkg/api/meta" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/runtime" - "sigs.k8s.io/structured-merge-diff/v6/fieldpath" -) - -// ManagedInterface groups a fieldpath.ManagedFields together with the timestamps associated with each operation. -type ManagedInterface interface { - // Fields gets the fieldpath.ManagedFields. - Fields() fieldpath.ManagedFields - - // Times gets the timestamps associated with each operation. - Times() map[string]*metav1.Time -} - -type managedStruct struct { - fields fieldpath.ManagedFields - times map[string]*metav1.Time -} - -var _ ManagedInterface = &managedStruct{} - -// Fields implements ManagedInterface. -func (m *managedStruct) Fields() fieldpath.ManagedFields { - return m.fields -} - -// Times implements ManagedInterface. -func (m *managedStruct) Times() map[string]*metav1.Time { - return m.times -} - -// NewEmptyManaged creates an empty ManagedInterface. -func NewEmptyManaged() ManagedInterface { - return NewManaged(fieldpath.ManagedFields{}, map[string]*metav1.Time{}) -} - -// NewManaged creates a ManagedInterface from a fieldpath.ManagedFields and the timestamps associated with each operation. -func NewManaged(f fieldpath.ManagedFields, t map[string]*metav1.Time) ManagedInterface { - return &managedStruct{ - fields: f, - times: t, - } -} - -// RemoveObjectManagedFields removes the ManagedFields from the object -// before we merge so that it doesn't appear in the ManagedFields -// recursively. -func RemoveObjectManagedFields(obj runtime.Object) { - accessor, err := meta.Accessor(obj) - if err != nil { - panic(fmt.Sprintf("couldn't get accessor: %v", err)) - } - accessor.SetManagedFields(nil) -} - -// EncodeObjectManagedFields converts and stores the fieldpathManagedFields into the objects ManagedFields -func EncodeObjectManagedFields(obj runtime.Object, managed ManagedInterface) error { - accessor, err := meta.Accessor(obj) - if err != nil { - panic(fmt.Sprintf("couldn't get accessor: %v", err)) - } - - encodedManagedFields, err := encodeManagedFields(managed) - if err != nil { - return fmt.Errorf("failed to convert back managed fields to API: %v", err) - } - accessor.SetManagedFields(encodedManagedFields) - - return nil -} - -// DecodeManagedFields converts ManagedFields from the wire format (api format) -// to the format used by sigs.k8s.io/structured-merge-diff -func DecodeManagedFields(encodedManagedFields []metav1.ManagedFieldsEntry) (ManagedInterface, error) { - managed := managedStruct{} - managed.fields = make(fieldpath.ManagedFields, len(encodedManagedFields)) - managed.times = make(map[string]*metav1.Time, len(encodedManagedFields)) - - for i, encodedVersionedSet := range encodedManagedFields { - switch encodedVersionedSet.Operation { - case metav1.ManagedFieldsOperationApply, metav1.ManagedFieldsOperationUpdate: - default: - return nil, fmt.Errorf("operation must be `Apply` or `Update`") - } - if len(encodedVersionedSet.APIVersion) < 1 { - return nil, fmt.Errorf("apiVersion must not be empty") - } - switch encodedVersionedSet.FieldsType { - case "FieldsV1": - // Valid case. - case "": - return nil, fmt.Errorf("missing fieldsType in managed fields entry %d", i) - default: - return nil, fmt.Errorf("invalid fieldsType %q in managed fields entry %d", encodedVersionedSet.FieldsType, i) - } - manager, err := BuildManagerIdentifier(&encodedVersionedSet) - if err != nil { - return nil, fmt.Errorf("error decoding manager from %v: %v", encodedVersionedSet, err) - } - managed.fields[manager], err = decodeVersionedSet(&encodedVersionedSet) - if err != nil { - return nil, fmt.Errorf("error decoding versioned set from %v: %v", encodedVersionedSet, err) - } - managed.times[manager] = encodedVersionedSet.Time - } - return &managed, nil -} - -// BuildManagerIdentifier creates a manager identifier string from a ManagedFieldsEntry -func BuildManagerIdentifier(encodedManager *metav1.ManagedFieldsEntry) (manager string, err error) { - encodedManagerCopy := *encodedManager - - // Never include fields type in the manager identifier - encodedManagerCopy.FieldsType = "" - - // Never include the fields in the manager identifier - encodedManagerCopy.FieldsV1 = nil - - // Never include the time in the manager identifier - encodedManagerCopy.Time = nil - - // For appliers, don't include the APIVersion in the manager identifier, - // so it will always have the same manager identifier each time it applied. - if encodedManager.Operation == metav1.ManagedFieldsOperationApply { - encodedManagerCopy.APIVersion = "" - } - - // Use the remaining fields to build the manager identifier - b, err := json.Marshal(&encodedManagerCopy) - if err != nil { - return "", fmt.Errorf("error marshalling manager identifier: %v", err) - } - - return string(b), nil -} - -func decodeVersionedSet(encodedVersionedSet *metav1.ManagedFieldsEntry) (versionedSet fieldpath.VersionedSet, err error) { - fields := EmptyFields - if encodedVersionedSet.FieldsV1 != nil { - fields = *encodedVersionedSet.FieldsV1 - } - set, err := FieldsToSet(fields) - if err != nil { - return nil, fmt.Errorf("error decoding set: %v", err) - } - return fieldpath.NewVersionedSet(&set, fieldpath.APIVersion(encodedVersionedSet.APIVersion), encodedVersionedSet.Operation == metav1.ManagedFieldsOperationApply), nil -} - -// encodeManagedFields converts ManagedFields from the format used by -// sigs.k8s.io/structured-merge-diff to the wire format (api format) -func encodeManagedFields(managed ManagedInterface) (encodedManagedFields []metav1.ManagedFieldsEntry, err error) { - if len(managed.Fields()) == 0 { - return nil, nil - } - encodedManagedFields = []metav1.ManagedFieldsEntry{} - for manager := range managed.Fields() { - versionedSet := managed.Fields()[manager] - v, err := encodeManagerVersionedSet(manager, versionedSet) - if err != nil { - return nil, fmt.Errorf("error encoding versioned set for %v: %v", manager, err) - } - if t, ok := managed.Times()[manager]; ok { - v.Time = t - } - encodedManagedFields = append(encodedManagedFields, *v) - } - return sortEncodedManagedFields(encodedManagedFields) -} - -func sortEncodedManagedFields(encodedManagedFields []metav1.ManagedFieldsEntry) (sortedManagedFields []metav1.ManagedFieldsEntry, err error) { - sort.Slice(encodedManagedFields, func(i, j int) bool { - p, q := encodedManagedFields[i], encodedManagedFields[j] - - if p.Operation != q.Operation { - return p.Operation < q.Operation - } - - pSeconds, qSeconds := int64(0), int64(0) - if p.Time != nil { - pSeconds = p.Time.Unix() - } - if q.Time != nil { - qSeconds = q.Time.Unix() - } - if pSeconds != qSeconds { - return pSeconds < qSeconds - } - - if p.Manager != q.Manager { - return p.Manager < q.Manager - } - - if p.APIVersion != q.APIVersion { - return p.APIVersion < q.APIVersion - } - return p.Subresource < q.Subresource - }) - - return encodedManagedFields, nil -} - -func encodeManagerVersionedSet(manager string, versionedSet fieldpath.VersionedSet) (encodedVersionedSet *metav1.ManagedFieldsEntry, err error) { - encodedVersionedSet = &metav1.ManagedFieldsEntry{} - - // Get as many fields as we can from the manager identifier - err = json.Unmarshal([]byte(manager), encodedVersionedSet) - if err != nil { - return nil, fmt.Errorf("error unmarshalling manager identifier %v: %v", manager, err) - } - - // Get the APIVersion, Operation, and Fields from the VersionedSet - encodedVersionedSet.APIVersion = string(versionedSet.APIVersion()) - if versionedSet.Applied() { - encodedVersionedSet.Operation = metav1.ManagedFieldsOperationApply - } - encodedVersionedSet.FieldsType = "FieldsV1" - fields, err := SetToFields(*versionedSet.Set()) - if err != nil { - return nil, fmt.Errorf("error encoding set: %v", err) - } - encodedVersionedSet.FieldsV1 = &fields - - return encodedVersionedSet, nil -} diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/borrowed_typeconverter.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/borrowed_typeconverter.go deleted file mode 100644 index 7801d5dc0..000000000 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/borrowed_typeconverter.go +++ /dev/null @@ -1,130 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fieldmanager - -import ( - "fmt" - - "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/util/managedfields" - "k8s.io/kube-openapi/pkg/util/proto" - "sigs.k8s.io/structured-merge-diff/v6/typed" - "sigs.k8s.io/structured-merge-diff/v6/value" -) - -// TypeConverter allows you to convert from runtime.Object to -// typed.TypedValue and the other way around. -type TypeConverter interface { - ObjectToTyped(runtime.Object) (*typed.TypedValue, error) - TypedToObject(*typed.TypedValue) (runtime.Object, error) -} - -// DeducedTypeConverter is a TypeConverter for CRDs that don't have a -// schema. It does implement the same interface though (and create the -// same types of objects), so that everything can still work the same. -// CRDs are merged with all their fields being "atomic" (lists -// included). -// -// Note that this is not going to be sufficient for converting to/from -// CRDs that have a schema defined (we don't support that schema yet). -// TODO(jennybuckley): Use the schema provided by a CRD if it exists. -type DeducedTypeConverter struct{} - -var _ TypeConverter = DeducedTypeConverter{} - -// ObjectToTyped converts an object into a TypedValue with a "deduced type". -func (DeducedTypeConverter) ObjectToTyped(obj runtime.Object) (*typed.TypedValue, error) { - switch o := obj.(type) { - case *unstructured.Unstructured: - return typed.DeducedParseableType.FromUnstructured(o.UnstructuredContent()) - default: - return typed.DeducedParseableType.FromStructured(obj) - } -} - -// TypedToObject transforms the typed value into a runtime.Object. That -// is not specific to deduced type. -func (DeducedTypeConverter) TypedToObject(value *typed.TypedValue) (runtime.Object, error) { - return valueToObject(value.AsValue()) -} - -type typeConverter struct { - parser *managedfields.GvkParser -} - -var _ TypeConverter = &typeConverter{} - -// NewTypeConverter builds a TypeConverter from a proto.Models. This -// will automatically find the proper version of the object, and the -// corresponding schema information. -func NewTypeConverter(models proto.Models, preserveUnknownFields bool) (TypeConverter, error) { - parser, err := managedfields.NewGVKParser(models, preserveUnknownFields) - if err != nil { - return nil, err - } - return &typeConverter{parser: parser}, nil -} - -func (c *typeConverter) ObjectToTyped(obj runtime.Object) (*typed.TypedValue, error) { - gvk := obj.GetObjectKind().GroupVersionKind() - t := c.parser.Type(gvk) - if t == nil { - return nil, newNoCorrespondingTypeError(gvk) - } - switch o := obj.(type) { - case *unstructured.Unstructured: - return t.FromUnstructured(o.UnstructuredContent()) - default: - return t.FromStructured(obj) - } -} - -func (c *typeConverter) TypedToObject(value *typed.TypedValue) (runtime.Object, error) { - return valueToObject(value.AsValue()) -} - -func valueToObject(val value.Value) (runtime.Object, error) { - vu := val.Unstructured() - switch o := vu.(type) { - case map[string]any: - return &unstructured.Unstructured{Object: o}, nil - default: - return nil, fmt.Errorf("failed to convert value to unstructured for type %T", vu) - } -} - -type noCorrespondingTypeErr struct { - gvk schema.GroupVersionKind -} - -func newNoCorrespondingTypeError(gvk schema.GroupVersionKind) error { - return &noCorrespondingTypeErr{gvk: gvk} -} - -func (k *noCorrespondingTypeErr) Error() string { - return fmt.Sprintf("no corresponding type for %v", k.gvk) -} - -func isNoCorrespondingTypeError(err error) bool { - if err == nil { - return false - } - _, ok := err.(*noCorrespondingTypeErr) - return ok -} diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/borrowed_versionconverter.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/borrowed_versionconverter.go deleted file mode 100644 index 0ac1e1e87..000000000 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/borrowed_versionconverter.go +++ /dev/null @@ -1,101 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package fieldmanager - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "sigs.k8s.io/structured-merge-diff/v6/fieldpath" - "sigs.k8s.io/structured-merge-diff/v6/merge" - "sigs.k8s.io/structured-merge-diff/v6/typed" -) - -// versionConverter is an implementation of -// sigs.k8s.io/structured-merge-diff/merge.Converter -type versionConverter struct { - typeConverter TypeConverter - objectConvertor runtime.ObjectConvertor - hubGetter func(from schema.GroupVersion) schema.GroupVersion -} - -var _ merge.Converter = &versionConverter{} - -// NewVersionConverter builds a VersionConverter from a TypeConverter and an ObjectConvertor. -func newVersionConverter(t TypeConverter, o runtime.ObjectConvertor, h schema.GroupVersion) merge.Converter { - return &versionConverter{ - typeConverter: t, - objectConvertor: o, - hubGetter: func(from schema.GroupVersion) schema.GroupVersion { - return schema.GroupVersion{ - Group: from.Group, - Version: h.Version, - } - }, - } -} - -// NewCRDVersionConverter builds a VersionConverter for CRDs from a TypeConverter and an ObjectConvertor. -func newCRDVersionConverter(t TypeConverter, o runtime.ObjectConvertor, h schema.GroupVersion) merge.Converter { - return &versionConverter{ - typeConverter: t, - objectConvertor: o, - hubGetter: func(from schema.GroupVersion) schema.GroupVersion { - return h - }, - } -} - -// Convert implements sigs.k8s.io/structured-merge-diff/merge.Converter -func (v *versionConverter) Convert(object *typed.TypedValue, version fieldpath.APIVersion) (*typed.TypedValue, error) { - // Convert the smd typed value to a kubernetes object. - objectToConvert, err := v.typeConverter.TypedToObject(object) - if err != nil { - return object, err - } - - // Parse the target groupVersion. - groupVersion, err := schema.ParseGroupVersion(string(version)) - if err != nil { - return object, err - } - - // If attempting to convert to the same version as we already have, just return it. - fromVersion := objectToConvert.GetObjectKind().GroupVersionKind().GroupVersion() - if fromVersion == groupVersion { - return object, nil - } - - // Convert to internal - internalObject, err := v.objectConvertor.ConvertToVersion(objectToConvert, v.hubGetter(fromVersion)) - if err != nil { - return object, err - } - - // Convert the object into the target version - convertedObject, err := v.objectConvertor.ConvertToVersion(internalObject, groupVersion) - if err != nil { - return object, err - } - - // Convert the object back to a smd typed value and return it. - return v.typeConverter.ObjectToTyped(convertedObject) -} - -// IsMissingVersionError -func (v *versionConverter) IsMissingVersionError(err error) bool { - return runtime.IsNotRegisteredError(err) || isNoCorrespondingTypeError(err) -} diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/doc.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/doc.go deleted file mode 100644 index a1bdd5991..000000000 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/doc.go +++ /dev/null @@ -1,25 +0,0 @@ -/* -Package fieldmanager is a special package as its main purpose -is to expose the dependencies required by structured-merge-diff -library to calculate diffs when server-side apply option is enabled. -The dependency tree necessary to have a `merge.Updater` instance -isn't trivial to implement and the strategy used is borrowing a copy -from Kubernetes apiserver codebase in order to expose the required -functionality. - -Below there is a list of borrowed files and a reference to which -package/file in Kubernetes they were copied from: - -- borrowed_fields.go: k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal/fields.go -- borrowed_managedfields.go: k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/internal/managedfields.go -- borrowed_typeconverter.go: k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/typeconverter.go -- borrowed_versionconverter.go: k8s.io/apiserver/pkg/endpoints/handlers/fieldmanager/versionconverter.go - -In order to keep maintenance as minimal as possible the borrowed -files are verbatim copy from Kubernetes. The private objects that -need to be exposed are wrapped in the wrapper.go file. Updating -the borrowed files should be trivial in most cases but must be done -manually as we have no control over future refactorings Kubernetes -might do. -*/ -package fieldmanager diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/wrapper.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/wrapper.go deleted file mode 100644 index e7a76ac52..000000000 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager/wrapper.go +++ /dev/null @@ -1,23 +0,0 @@ -package fieldmanager - -/* -In order to keep maintenance as minimal as possible the borrowed -files in this package are verbatim copy from Kubernetes. The -private objects that need to be exposed are wrapped and exposed -in this file. -*/ - -import ( - "k8s.io/apimachinery/pkg/runtime" - "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/apimachinery/pkg/util/managedfields" - "sigs.k8s.io/structured-merge-diff/v6/merge" -) - -// NewVersionConverter will expose the version converter from the -// borrowed private function from k8s apiserver handler. -func NewVersionConverter(gvkParser *managedfields.GvkParser, o runtime.ObjectConvertor, h schema.GroupVersion) merge.Converter { - tc := &typeConverter{parser: gvkParser} - hub := schema.GroupVersion{Group: h.Group, Version: runtime.APIVersionInternal} - return newVersionConverter(tc, o, hub) -} diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/resource_filter.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/resource_filter.go deleted file mode 100644 index 2a3373178..000000000 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/resource_filter.go +++ /dev/null @@ -1,5 +0,0 @@ -package kube - -type ResourceFilter interface { - IsExcludedResource(group, kind, cluster string) bool -} diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/LICENSE b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/LICENSE similarity index 100% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/LICENSE rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/LICENSE diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/internal/kubernetes_vendor/pkg/api/v1/endpoints/util.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/internal/kubernetes_vendor/pkg/api/v1/endpoints/util.go similarity index 96% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/internal/kubernetes_vendor/pkg/api/v1/endpoints/util.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/internal/kubernetes_vendor/pkg/api/v1/endpoints/util.go index dc75dcbfb..f8043cb75 100644 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/internal/kubernetes_vendor/pkg/api/v1/endpoints/util.go +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/internal/kubernetes_vendor/pkg/api/v1/endpoints/util.go @@ -22,7 +22,7 @@ import ( "hash" "sort" - hashutil "github.com/argoproj/argo-cd/gitops-engine/internal/kubernetes_vendor/pkg/util/hash" + hashutil "github.com/argoproj/argo-cd/gitops-engine/v3/internal/kubernetes_vendor/pkg/util/hash" v1 "k8s.io/api/core/v1" ) diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/internal/kubernetes_vendor/pkg/util/hash/hash.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/internal/kubernetes_vendor/pkg/util/hash/hash.go similarity index 100% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/internal/kubernetes_vendor/pkg/util/hash/hash.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/internal/kubernetes_vendor/pkg/util/hash/hash.go diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/diff.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/diff/diff.go similarity index 82% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/diff.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/diff/diff.go index 6d17f625b..68e7e854e 100644 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/diff.go +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/diff/diff.go @@ -23,14 +23,12 @@ import ( "k8s.io/apimachinery/pkg/util/strategicpatch" "k8s.io/client-go/kubernetes/scheme" "sigs.k8s.io/structured-merge-diff/v6/fieldpath" - "sigs.k8s.io/structured-merge-diff/v6/merge" "sigs.k8s.io/structured-merge-diff/v6/typed" - "github.com/argoproj/argo-cd/gitops-engine/internal/kubernetes_vendor/pkg/api/v1/endpoints" - "github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager" - "github.com/argoproj/argo-cd/gitops-engine/pkg/sync/resource" - jsonutil "github.com/argoproj/argo-cd/gitops-engine/pkg/utils/json" - gescheme "github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/scheme" + "github.com/argoproj/argo-cd/gitops-engine/v3/internal/kubernetes_vendor/pkg/api/v1/endpoints" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/resource" + jsonutil "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/json" + gescheme "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/scheme" ) const ( @@ -73,12 +71,42 @@ func GetNoopNormalizer() Normalizer { // Diff performs a diff on two unstructured objects. If the live object happens to have a // "kubectl.kubernetes.io/last-applied-configuration", then perform a three way diff. -func Diff(config, live *unstructured.Unstructured, opts ...Option) (*DiffResult, error) { +func Diff(ctx context.Context, config, live *unstructured.Unstructured, opts ...Option) (*DiffResult, error) { preDiffOpts := opts o := applyOptions(opts) - // If server-side diff is enabled, we need to skip full normalization (including ignore differences) - // when pre-processing the config and live objects. - if o.serverSideDiff { + + // TODO The two variables bellow are necessary because there is a cyclic + // dependency with the kube package that blocks the usage of constants + // from common package. common package needs to be refactored and exclude + // dependency from kube. + syncOptAnnotation := "argocd.argoproj.io/sync-options" + ssaAnnotation := "ServerSideApply=true" + + // Server-Side Diff should be used when syncing with Server-Side Apply. It is + // enabled either explicitly via the serverSideDiff option or implicitly when + // the desired state resource has the Server-Side Apply sync option enabled. + // This supersedes the now-discontinued structured-merge-diff strategy that was + // previously selected for Server-Side Apply enabled resources. + serverSideDiff := o.serverSideDiff || + (config != nil && resource.HasAnnotationOption(config, syncOptAnnotation, ssaAnnotation)) + + // Server-Side Diff requires a dry-run runner to execute the Server-Side Apply + // against the kube-apiserver. It can only actually run when it was explicitly + // requested via the serverSideDiff option (in which case a missing runner is a + // hard error, see serverSideDiff) or when a dry-run runner is configured. When + // server-side diff is only implied by the Server-Side Apply annotation and no + // runner is available, the caller is a client-side-only consumer (e.g. + // `argocd app diff` without server-side generation) and we fall back to the + // regular three-way / two-way client-side diff. + willUseSSD := serverSideDiff && (o.serverSideDiff || o.serverSideDryRunner != nil) + + // Full normalization (including ignore differences and known-type normalization) + // must only be skipped when server-side diff will actually run, since it performs + // its own normalization after the dry-run apply. Skipping it on the client-side + // fallback path would drop ignore-differences/known-type normalization and produce + // noisy or incorrect diffs, so this is gated on willUseSSD rather than the bare + // serverSideDiff intent. + if willUseSSD { preDiffOpts = append(preDiffOpts, WithSkipFullNormalize(true)) } if config != nil { @@ -90,35 +118,14 @@ func Diff(config, live *unstructured.Unstructured, opts ...Option) (*DiffResult, Normalize(live, preDiffOpts...) } - if o.serverSideDiff { - r, err := ServerSideDiff(config, live, opts...) + if willUseSSD { + r, err := ServerSideDiff(ctx, config, live, opts...) if err != nil { return nil, fmt.Errorf("error calculating server side diff: %w", err) } return r, nil } - // TODO The two variables bellow are necessary because there is a cyclic - // dependency with the kube package that blocks the usage of constants - // from common package. common package needs to be refactored and exclude - // dependency from kube. - syncOptAnnotation := "argocd.argoproj.io/sync-options" - ssaAnnotation := "ServerSideApply=true" - - // structuredMergeDiff is mainly used as a feature flag to enable - // calculating diffs using the structured-merge-diff library - // used in k8s while performing server-side applies. It checks the - // given diff Option or if the desired state resource has the - // Server-Side apply sync option annotation enabled. - structuredMergeDiff := o.structuredMergeDiff || - (config != nil && resource.HasAnnotationOption(config, syncOptAnnotation, ssaAnnotation)) - if structuredMergeDiff { - r, err := StructuredMergeDiff(config, live, o.gvkParser, o.manager) - if err != nil { - return nil, fmt.Errorf("error calculating structured merge diff: %w", err) - } - return r, nil - } orig, err := GetLastAppliedConfigAnnotation(live) if err != nil { o.log.V(1).Info(fmt.Sprintf("Failed to get last applied configuration: %v", err)) @@ -137,9 +144,9 @@ func Diff(config, live *unstructured.Unstructured, opts ...Option) (*DiffResult, // given config. The result will be compared with given live resource to determine // diff. If config or live are nil it means resource creation or deletion. In this // no call will be made to kube-api and a simple diff will be returned. -func ServerSideDiff(config, live *unstructured.Unstructured, opts ...Option) (*DiffResult, error) { +func ServerSideDiff(ctx context.Context, config, live *unstructured.Unstructured, opts ...Option) (*DiffResult, error) { if live != nil && config != nil { - result, err := serverSideDiff(config, live, opts...) + result, err := serverSideDiff(ctx, config, live, opts...) if err != nil { return nil, fmt.Errorf("serverSideDiff error: %w", err) } @@ -162,12 +169,12 @@ func ServerSideDiff(config, live *unstructured.Unstructured, opts ...Option) (*D // given config. The result will be compared with given live resource to determine // diff. Modifications done by mutation webhooks are removed from the diff by default. // This behaviour can be customized with Option.WithIgnoreMutationWebhook. -func serverSideDiff(config, live *unstructured.Unstructured, opts ...Option) (*DiffResult, error) { +func serverSideDiff(ctx context.Context, config, live *unstructured.Unstructured, opts ...Option) (*DiffResult, error) { o := applyOptions(opts) if o.serverSideDryRunner == nil { return nil, errors.New("serverSideDryRunner is null") } - predictedLiveStr, err := o.serverSideDryRunner.Run(context.Background(), config, o.manager) + predictedLiveStr, err := o.serverSideDryRunner.Run(ctx, config, o.manager) if err != nil { return nil, fmt.Errorf("error running server side apply in dryrun mode for resource %s/%s: %w", config.GetKind(), config.GetName(), err) } @@ -189,11 +196,13 @@ func serverSideDiff(config, live *unstructured.Unstructured, opts ...Option) (*D Normalize(predictedLive, opts...) unstructured.RemoveNestedField(predictedLive.Object, "metadata", "managedFields") unstructured.RemoveNestedField(predictedLive.Object, "metadata", "resourceVersion") + unstructured.RemoveNestedField(predictedLive.Object, "metadata", "generation") unstructured.RemoveNestedField(predictedLive.Object, "metadata", "annotations", AnnotationLastAppliedConfig) Normalize(live, opts...) unstructured.RemoveNestedField(live.Object, "metadata", "managedFields") unstructured.RemoveNestedField(live.Object, "metadata", "resourceVersion") + unstructured.RemoveNestedField(live.Object, "metadata", "generation") unstructured.RemoveNestedField(live.Object, "metadata", "annotations", AnnotationLastAppliedConfig) predictedLiveBytes, err := json.Marshal(predictedLive) @@ -235,20 +244,9 @@ func removeWebhookMutation(predictedLive, live *unstructured.Unstructured, gvkPa return nil, fmt.Errorf("error converting live state from unstructured to %s: %w", gvk, err) } - // Initialize an empty fieldpath.Set to aggregate managed fields for the specified manager - managerFieldsSet := &fieldpath.Set{} - - // Iterate over all ManagedFields entries in predictedLive - for _, mfEntry := range plManagedFields { - managedFieldsSet := &fieldpath.Set{} - err := managedFieldsSet.FromJSON(bytes.NewReader(mfEntry.FieldsV1.Raw)) - if err != nil { - return nil, fmt.Errorf("error building managedFields set: %w", err) - } - if mfEntry.Manager == manager { - // Union the fields with the aggregated set - managerFieldsSet = managerFieldsSet.Union(managedFieldsSet) - } + managerFieldsSet, err := managerFieldSet(plManagedFields, manager) + if err != nil { + return nil, err } if managerFieldsSet.Empty() { @@ -280,6 +278,16 @@ func removeWebhookMutation(predictedLive, live *unstructured.Unstructured, gvkPa if comparison.Removed != nil && !comparison.Removed.Empty() { // exclude the removed fields not owned by this manager from the comparison comparison.Removed = comparison.Removed.Difference(nonArgoFieldsSet) + + // SSA only removes fields the applier owned. Anything else missing from predictedLive was + // removed by another actor after live was read from the cache, so it is not a diff. + liveManagerFieldsSet, err := managerFieldSet(live.GetManagedFields(), manager) + if err != nil { + return nil, err + } + // A path counts as owned if it or a descendant is owned (see excludeManagerOwnedAncestors). + notOwned := excludeManagerOwnedAncestors(comparison.Removed.Difference(liveManagerFieldsSet), liveManagerFieldsSet) + comparison.Removed = comparison.Removed.Difference(notOwned) } // In case any of the removed fields cause schema violations, we will keep those fields @@ -305,6 +313,22 @@ func removeWebhookMutation(predictedLive, live *unstructured.Unstructured, gvkPa return &unstructured.Unstructured{Object: pl}, nil } +// managerFieldSet returns the union of the fields owned by manager across entries. +func managerFieldSet(entries []metav1.ManagedFieldsEntry, manager string) (*fieldpath.Set, error) { + managerFieldsSet := &fieldpath.Set{} + for _, mfEntry := range entries { + if mfEntry.Manager != manager { + continue + } + managedFieldsSet := &fieldpath.Set{} + if err := managedFieldsSet.FromJSON(bytes.NewReader(mfEntry.FieldsV1.Raw)); err != nil { + return nil, fmt.Errorf("error building managedFields set: %w", err) + } + managerFieldsSet = managerFieldsSet.Union(managedFieldsSet) + } + return managerFieldsSet, nil +} + // excludeManagerOwnedAncestors removes any path from toRemove that has at // least one strict descendant present in managerFieldsSet, i.e. owned by the // manager. This is needed because a *fieldpath.Set can contain a path as a @@ -394,154 +418,6 @@ func jsonStrToUnstructured(jsonString string) (*unstructured.Unstructured, error return &unstructured.Unstructured{Object: res}, nil } -// StructuredMergeDiff will calculate the diff using the structured-merge-diff -// k8s library (https://github.com/kubernetes-sigs/structured-merge-diff). -func StructuredMergeDiff(config, live *unstructured.Unstructured, gvkParser *managedfields.GvkParser, manager string) (*DiffResult, error) { - if live != nil && config != nil { - params := &SMDParams{ - config: config, - live: live, - gvkParser: gvkParser, - manager: manager, - } - return structuredMergeDiff(params) - } - return handleResourceCreateOrDeleteDiff(config, live) -} - -// SMDParams defines the parameters required by the structuredMergeDiff -// function -type SMDParams struct { - config *unstructured.Unstructured - live *unstructured.Unstructured - gvkParser *managedfields.GvkParser - manager string -} - -func structuredMergeDiff(p *SMDParams) (*DiffResult, error) { - gvk := p.config.GetObjectKind().GroupVersionKind() - pt := gescheme.ResolveParseableType(gvk, p.gvkParser) - if pt == nil { - return nil, fmt.Errorf("unable to resolve parseableType for GroupVersionKind: %s", gvk) - } - - // Build typed value from live and config unstructures - tvLive, err := pt.FromUnstructured(p.live.Object) - if err != nil { - return nil, fmt.Errorf("error building typed value from live resource: %w", err) - } - tvConfig, err := pt.FromUnstructured(p.config.Object) - if err != nil { - return nil, fmt.Errorf("error building typed value from config resource: %w", err) - } - - // Invoke the apply function to calculate the diff using - // the structured-merge-diff library - mergedLive, err := apply(tvConfig, tvLive, p) - if err != nil { - return nil, fmt.Errorf("error calculating diff: %w", err) - } - - // When mergedLive is nil it means that there is no change - if mergedLive == nil { - liveBytes, err := json.Marshal(p.live) - if err != nil { - return nil, fmt.Errorf("error marshaling live resource: %w", err) - } - // In this case diff result will have live state for both, - // predicted and live. - return buildDiffResult(liveBytes, liveBytes), nil - } - - // Normalize merged live - predictedLive, err := normalizeTypedValue(mergedLive) - if err != nil { - return nil, fmt.Errorf("error applying default values in predicted live: %w", err) - } - - // Normalize live - taintedLive, err := normalizeTypedValue(tvLive) - if err != nil { - return nil, fmt.Errorf("error applying default values in live: %w", err) - } - - return buildDiffResult(predictedLive, taintedLive), nil -} - -// apply will build all the dependency required to invoke the smd.merge.updater.Apply -// to correctly calculate the diff with the same logic used in k8s with server-side -// apply. -func apply(tvConfig, tvLive *typed.TypedValue, p *SMDParams) (*typed.TypedValue, error) { - // Build the structured-merge-diff Updater - updater := merge.Updater{ - Converter: fieldmanager.NewVersionConverter(p.gvkParser, scheme.Scheme, p.config.GroupVersionKind().GroupVersion()), - } - - // Build a list of managers and which API version they own - managed, err := fieldmanager.DecodeManagedFields(p.live.GetManagedFields()) - if err != nil { - return nil, fmt.Errorf("error decoding managed fields: %w", err) - } - - // Use the desired manifest to extract the target resource version - version := fieldpath.APIVersion(p.config.GetAPIVersion()) - - // The manager string needs to be converted to the internal manager - // key used inside structured-merge-diff apply logic - managerKey, err := buildManagerInfoForApply(p.manager) - if err != nil { - return nil, fmt.Errorf("error building manager info: %w", err) - } - - // Finally invoke Apply to execute the same function used in k8s - // server-side applies - mergedLive, _, err := updater.Apply(tvLive, tvConfig, version, managed.Fields(), managerKey, true) - if err != nil { - return nil, fmt.Errorf("error while running updater.Apply: %w", err) - } - return mergedLive, nil -} - -func buildManagerInfoForApply(manager string) (string, error) { - managerInfo := metav1.ManagedFieldsEntry{ - Manager: manager, - Operation: metav1.ManagedFieldsOperationApply, - } - //nolint:wrapcheck // trivial function, wrapped nicely by the caller - return fieldmanager.BuildManagerIdentifier(&managerInfo) -} - -// normalizeTypedValue will prepare the given tv so it can be used in diffs by: -// - removing last-applied-configuration annotation -// - applying default values -func normalizeTypedValue(tv *typed.TypedValue) ([]byte, error) { - ru := tv.AsValue().Unstructured() - r, ok := ru.(map[string]any) - if !ok { - return nil, fmt.Errorf("error converting result typedValue: expected map got %T", ru) - } - resultUn := &unstructured.Unstructured{Object: r} - unstructured.RemoveNestedField(resultUn.Object, "metadata", "annotations", AnnotationLastAppliedConfig) - - resultBytes, err := json.Marshal(resultUn) - if err != nil { - return nil, fmt.Errorf("error while marshaling merged unstructured: %w", err) - } - - obj, err := scheme.Scheme.New(resultUn.GroupVersionKind()) - if err == nil { - err := json.Unmarshal(resultBytes, &obj) - if err != nil { - return nil, fmt.Errorf("error unmarshaling merged bytes into object: %w", err) - } - resultBytes, err = patchDefaultValues(resultBytes, obj) - if err != nil { - return nil, fmt.Errorf("error applying defaults: %w", err) - } - } - return resultBytes, nil -} - func buildDiffResult(predictedBytes []byte, liveBytes []byte) *DiffResult { return &DiffResult{ Modified: !bytes.Equal(liveBytes, predictedBytes), @@ -692,39 +568,6 @@ func applyPatch(liveBytes []byte, patchBytes []byte, newVersionedObject func() ( return liveBytes, predictedLiveBytes, nil } -// patchDefaultValues will calculate the default values patch based on the -// given obj. It will apply the patch using the given objBytes and return -// the new patched object. -func patchDefaultValues(objBytes []byte, obj runtime.Object) ([]byte, error) { - // 1) Call 'kubescheme.Scheme.Default(obj)' to generate a patch containing - // the default values for the given scheme. - patch, err := generateSchemeDefaultPatch(obj) - if err != nil { - return nil, fmt.Errorf("error generating patch for default values: %w", err) - } - - // 2) Apply the patch with default values in objBytes. - patchedBytes, err := strategicpatch.StrategicMergePatch(objBytes, patch, obj) - if err != nil { - return nil, fmt.Errorf("error applying patch for default values: %w", err) - } - - // 3) Unmarshall into a map[string]any, then back into byte[], to - // ensure the fields are sorted in a consistent order (we do the same below, - // so that they can be lexicographically compared with one another). - var result map[string]any - err = json.Unmarshal([]byte(patchedBytes), &result) - if err != nil { - return nil, fmt.Errorf("error unmarshaling patched bytes: %w", err) - } - patchedBytes, err = json.Marshal(result) - if err != nil { - return nil, fmt.Errorf("error marshaling patched bytes: %w", err) - } - - return patchedBytes, nil -} - // ThreeWayDiff performs a diff with the understanding of how to incorporate the // last-applied-configuration annotation in the diff. // Inputs are assumed to be stripped of type information @@ -878,7 +721,7 @@ func GetLastAppliedConfigAnnotation(live *unstructured.Unstructured) (*unstructu // DiffArray performs a diff on a list of unstructured objects. Objects are expected to match // environments -func DiffArray(configArray, liveArray []*unstructured.Unstructured, opts ...Option) (*DiffResultList, error) { +func DiffArray(ctx context.Context, configArray, liveArray []*unstructured.Unstructured, opts ...Option) (*DiffResultList, error) { numItems := len(configArray) if len(liveArray) != numItems { return nil, errors.New("left and right arrays have mismatched lengths") @@ -890,7 +733,7 @@ func DiffArray(configArray, liveArray []*unstructured.Unstructured, opts ...Opti for i := range numItems { config := configArray[i] live := liveArray[i] - diffRes, err := Diff(config, live, opts...) + diffRes, err := Diff(ctx, config, live, opts...) if err != nil { return nil, err } diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/diff_options.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/diff/diff_options.go similarity index 95% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/diff_options.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/diff/diff_options.go index 1d5f12a51..c253ebebe 100644 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/diff/diff_options.go +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/diff/diff_options.go @@ -19,7 +19,6 @@ type options struct { normalizer Normalizer skipFullNormalize bool log logr.Logger - structuredMergeDiff bool gvkParser *managedfields.GvkParser manager string serverSideDiff bool @@ -96,12 +95,6 @@ func WithLogr(log logr.Logger) Option { } } -func WithStructuredMergeDiff(smd bool) Option { - return func(o *options) { - o.structuredMergeDiff = smd - } -} - func WithGVKParser(parser *managedfields.GvkParser) Option { return func(o *options) { o.gvkParser = parser diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health.go similarity index 68% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health.go index 58800cf79..fe29df65f 100644 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health.go +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health.go @@ -2,12 +2,13 @@ package health import ( "fmt" + "strings" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" - "github.com/argoproj/argo-cd/gitops-engine/pkg/sync/hook" - "github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/hook" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube" ) // Represents resource health status @@ -39,6 +40,9 @@ type HealthOverride interface { type HealthStatus struct { Status HealthStatusCode `json:"status,omitempty"` Message string `json:"message,omitempty"` + // DeletionMessage is set by custom Lua health checks to override the default + // terminating-resource message. It is not exposed on the final health result returned to callers. + DeletionMessage string `json:"deletionMessage,omitempty"` } // healthOrder is a list of health codes in order of most healthy to least healthy @@ -66,15 +70,35 @@ func IsWorse(current, new HealthStatusCode) bool { return newIndex > currentIndex } -// GetResourceHealth returns the health of a k8s resource -func GetResourceHealth(obj *unstructured.Unstructured, healthOverride HealthOverride) (health *HealthStatus, err error) { - if obj.GetDeletionTimestamp() != nil && !hook.HasHookFinalizer(obj) { +// pendingDeletionHealth returns health for terminating resources that are not blocked on the +// Argo CD hook finalizer. When health sets DeletionMessage, the check has opted in to custom +// deletion handling and its status and DeletionMessage are used. Otherwise the default is +// Progressing / Pending deletion. Returns nil when the resource is not terminating or when +// the hook finalizer is present. +func pendingDeletionHealth(obj *unstructured.Unstructured, health *HealthStatus) *HealthStatus { + if obj.GetDeletionTimestamp() == nil || hook.HasHookFinalizer(obj) { + return nil + } + if health != nil && health.DeletionMessage != "" { + // Health script overrides the default terminating health. return &HealthStatus{ - Status: HealthStatusProgressing, - Message: "Pending deletion", - }, nil + Status: health.Status, + Message: health.DeletionMessage, + } } + // Fall back to default. + msg := "Pending deletion" + if finalizers := obj.GetFinalizers(); len(finalizers) > 0 { + msg = "Pending deletion; blocked by finalizers: " + strings.Join(finalizers, ", ") + } + return &HealthStatus{ + Status: HealthStatusProgressing, + Message: msg, + } +} +// GetResourceHealth returns the health of a k8s resource +func GetResourceHealth(obj *unstructured.Unstructured, healthOverride HealthOverride) (health *HealthStatus, err error) { if healthOverride != nil { health, err := healthOverride.GetResourceHealth(obj) if err != nil { @@ -85,6 +109,9 @@ func GetResourceHealth(obj *unstructured.Unstructured, healthOverride HealthOver return health, fmt.Errorf("failed to get resource health for %s/%s: %w", obj.GetNamespace(), obj.GetName(), err) } if health != nil { + if deletionHealth := pendingDeletionHealth(obj, health); deletionHealth != nil { + return deletionHealth, nil + } return health, nil } } @@ -95,7 +122,17 @@ func GetResourceHealth(obj *unstructured.Unstructured, healthOverride HealthOver Status: HealthStatusUnknown, Message: err.Error(), } + return health, err } + if deletionHealth := pendingDeletionHealth(obj, health); deletionHealth != nil { + return deletionHealth, err + } + return health, err + } + + // No health check matched. Preserve the historical "Pending deletion" behavior for terminating resources. + if deletionHealth := pendingDeletionHealth(obj, nil); deletionHealth != nil { + return deletionHealth, nil } return health, err } diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_apiservice.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_apiservice.go similarity index 97% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_apiservice.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_apiservice.go index c83cc119d..96bf35cee 100644 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_apiservice.go +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_apiservice.go @@ -8,7 +8,7 @@ import ( apiregistrationv1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1" apiregistrationv1beta1 "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1beta1" - "github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube" ) func getAPIServiceHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_argo.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_argo.go similarity index 100% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_argo.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_argo.go diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_daemonset.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_daemonset.go similarity index 97% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_daemonset.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_daemonset.go index 39336c6f2..9488f7376 100644 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_daemonset.go +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_daemonset.go @@ -7,7 +7,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" - "github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube" ) func getDaemonSetHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_deployment.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_deployment.go similarity index 97% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_deployment.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_deployment.go index b3aaa91df..6a9d3c375 100644 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_deployment.go +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_deployment.go @@ -7,7 +7,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" - "github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube" ) func getDeploymentHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_hpa.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_hpa.go similarity index 98% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_hpa.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_hpa.go index ac060f0f1..ce4113d06 100644 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_hpa.go +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_hpa.go @@ -9,7 +9,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" - "github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube" ) var progressingStatus = &HealthStatus{ diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_ingress.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_ingress.go similarity index 100% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_ingress.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_ingress.go diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_job.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_job.go similarity index 95% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_job.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_job.go index 8b277226a..2b4ad0dea 100644 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_job.go +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_job.go @@ -9,7 +9,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" - "github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube" ) func getJobHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { @@ -64,7 +64,7 @@ func getBatchv1JobHealth(job *batchv1.Job) (*HealthStatus, error) { case isSuspended: return &HealthStatus{ Status: HealthStatusSuspended, - Message: failMsg, + Message: message, }, nil default: return &HealthStatus{ diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_pod.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_pod.go similarity index 78% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_pod.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_pod.go index 74c9dfcec..a6bd84fde 100644 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_pod.go +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_pod.go @@ -9,7 +9,9 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/kubectl/pkg/util/podutils" - "github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/common" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/hook" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube" ) func getPodHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { @@ -21,20 +23,25 @@ func getPodHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { if err != nil { return nil, fmt.Errorf("failed to convert unstructured Pod to typed: %w", err) } - return getCorev1PodHealth(&pod) + return getCorev1PodHealth(&pod, hook.IsHook(obj)) default: return nil, fmt.Errorf("unsupported Pod GVK: %s", gvk) } } -func getCorev1PodHealth(pod *corev1.Pod) (*HealthStatus, error) { +func getCorev1PodHealth(pod *corev1.Pod, isHook bool) (*HealthStatus, error) { + // The AnnotationIgnoreRestartPolicy annotation makes a running pod with a restart policy + // of OnFailure or Never be assessed like a long-running pod. The annotation is not honored + // on hook pods. + hasIgnoreRestartPolicy := pod.GetAnnotations() != nil && pod.GetAnnotations()[common.AnnotationIgnoreRestartPolicy] == "true" + // This logic cannot be applied when the pod.Spec.RestartPolicy is: corev1.RestartPolicyOnFailure, // corev1.RestartPolicyNever, otherwise it breaks the resource hook logic. // The issue is, if we mark a pod with ImagePullBackOff as Degraded, and the pod is used as a resource hook, // then we will prematurely fail the PreSync/PostSync hook. Meanwhile, when that error condition is resolved // (e.g. the image is available), the resource hook pod will unexpectedly be executed even though the sync has // completed. - if pod.Spec.RestartPolicy == corev1.RestartPolicyAlways { + if pod.Spec.RestartPolicy == corev1.RestartPolicyAlways || (hasIgnoreRestartPolicy && !isHook) { var status HealthStatusCode var messages []string @@ -94,8 +101,9 @@ func getCorev1PodHealth(pod *corev1.Pod) (*HealthStatus, error) { return &HealthStatus{Status: HealthStatusDegraded, Message: ""}, nil case corev1.PodRunning: - switch pod.Spec.RestartPolicy { - case corev1.RestartPolicyAlways: + policy := pod.Spec.RestartPolicy + switch { + case policy == corev1.RestartPolicyAlways || (hasIgnoreRestartPolicy && !isHook): // if pod is ready, it is automatically healthy if podutils.IsPodReady(pod) { return &HealthStatus{ @@ -117,10 +125,11 @@ func getCorev1PodHealth(pod *corev1.Pod) (*HealthStatus, error) { Status: HealthStatusProgressing, Message: pod.Status.Message, }, nil - case corev1.RestartPolicyOnFailure, corev1.RestartPolicyNever: - // pods set with a restart policy of OnFailure or Never, have a finite life. + case policy == corev1.RestartPolicyOnFailure || policy == corev1.RestartPolicyNever: + // Pods set with a restart policy of OnFailure or Never have a finite life. // These pods are typically resource hooks. Thus, we consider these as Progressing - // instead of healthy. + // instead of healthy. If this is unwanted, use the AnnotationIgnoreRestartPolicy + // annotation. return &HealthStatus{ Status: HealthStatusProgressing, Message: pod.Status.Message, diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_pvc.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_pvc.go similarity index 94% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_pvc.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_pvc.go index 5d05141f3..49ad8885d 100644 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_pvc.go +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_pvc.go @@ -7,7 +7,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" - "github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube" ) func getPVCHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_replicaset.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_replicaset.go similarity index 96% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_replicaset.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_replicaset.go index d67c51889..446ee814c 100644 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_replicaset.go +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_replicaset.go @@ -8,7 +8,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" - "github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube" ) func getReplicaSetHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_service.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_service.go similarity index 94% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_service.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_service.go index 9383f90eb..762d2e9dc 100644 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_service.go +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_service.go @@ -7,7 +7,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" - "github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube" ) func getServiceHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_statefulset.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_statefulset.go similarity index 97% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_statefulset.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_statefulset.go index dfea2f169..36db5a93f 100644 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/health/health_statefulset.go +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health/health_statefulset.go @@ -7,7 +7,7 @@ import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" - "github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube" ) func getStatefulSetHealth(obj *unstructured.Unstructured) (*HealthStatus, error) { diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/sync/common/types.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/common/types.go similarity index 95% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/sync/common/types.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/common/types.go index fc37a7428..d58e2083c 100644 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/sync/common/types.go +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/common/types.go @@ -4,7 +4,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube" ) const ( @@ -17,6 +17,9 @@ const ( // AnnotationKeyHookDeletePolicy is the policy of deleting a hook AnnotationKeyHookDeletePolicy = "argocd.argoproj.io/hook-delete-policy" AnnotationDeletionApproved = "argocd.argoproj.io/deletion-approved" + // AnnotationIgnoreRestartPolicy makes health assessment of Pods with restartPolicy + // Never/OnFailure treat them as long-running pods (ignored for hook Pods) + AnnotationIgnoreRestartPolicy = "argocd.argoproj.io/ignore-restart-policy" // Sync option that disables dry run in resource is missing in the cluster SyncOptionSkipDryRunOnMissingResource = "SkipDryRunOnMissingResource=true" diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/sync/hook/delete_policy.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/hook/delete_policy.go similarity index 73% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/sync/hook/delete_policy.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/hook/delete_policy.go index 0934af165..f97b8f587 100644 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/sync/hook/delete_policy.go +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/hook/delete_policy.go @@ -3,9 +3,9 @@ package hook import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "github.com/argoproj/argo-cd/gitops-engine/pkg/sync/common" - helmhook "github.com/argoproj/argo-cd/gitops-engine/pkg/sync/hook/helm" - resourceutil "github.com/argoproj/argo-cd/gitops-engine/pkg/sync/resource" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/common" + helmhook "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/hook/helm" + resourceutil "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/resource" ) func DeletePolicies(obj *unstructured.Unstructured) []common.HookDeletePolicy { diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/sync/hook/helm/delete_policy.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/hook/helm/delete_policy.go similarity index 89% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/sync/hook/helm/delete_policy.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/hook/helm/delete_policy.go index bde4d42cc..848ac7f4e 100644 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/sync/hook/helm/delete_policy.go +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/hook/helm/delete_policy.go @@ -1,8 +1,8 @@ package helm import ( - "github.com/argoproj/argo-cd/gitops-engine/pkg/sync/common" - resourceutil "github.com/argoproj/argo-cd/gitops-engine/pkg/sync/resource" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/common" + resourceutil "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/resource" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" ) diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/sync/hook/helm/hook.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/hook/helm/hook.go similarity index 100% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/sync/hook/helm/hook.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/hook/helm/hook.go diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/sync/hook/helm/type.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/hook/helm/type.go similarity index 86% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/sync/hook/helm/type.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/hook/helm/type.go index 9ce8e7060..0aca60daa 100644 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/sync/hook/helm/type.go +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/hook/helm/type.go @@ -3,8 +3,8 @@ package helm import ( "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "github.com/argoproj/argo-cd/gitops-engine/pkg/sync/common" - resourceutil "github.com/argoproj/argo-cd/gitops-engine/pkg/sync/resource" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/common" + resourceutil "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/resource" ) type Type string diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/sync/hook/helm/weight.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/hook/helm/weight.go similarity index 100% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/sync/hook/helm/weight.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/hook/helm/weight.go diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/sync/hook/hook.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/hook/hook.go similarity index 70% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/sync/hook/hook.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/hook/hook.go index c0fe71a21..dab9a99e8 100644 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/sync/hook/hook.go +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/hook/hook.go @@ -1,11 +1,13 @@ package hook import ( + "slices" + "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" - "github.com/argoproj/argo-cd/gitops-engine/pkg/sync/common" - helmhook "github.com/argoproj/argo-cd/gitops-engine/pkg/sync/hook/helm" - resourceutil "github.com/argoproj/argo-cd/gitops-engine/pkg/sync/resource" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/common" + helmhook "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/hook/helm" + resourceutil "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/resource" ) const ( @@ -15,12 +17,7 @@ const ( func HasHookFinalizer(obj *unstructured.Unstructured) bool { finalizers := obj.GetFinalizers() - for _, finalizer := range finalizers { - if finalizer == HookFinalizer { - return true - } - } - return false + return slices.Contains(finalizers, HookFinalizer) } func IsHook(obj *unstructured.Unstructured) bool { @@ -32,10 +29,8 @@ func IsHook(obj *unstructured.Unstructured) bool { } func Skip(obj *unstructured.Unstructured) bool { - for _, hookType := range Types(obj) { - if hookType == common.HookTypeSkip { - return len(Types(obj)) == 1 - } + if slices.Contains(Types(obj), common.HookTypeSkip) { + return len(Types(obj)) == 1 } return false } diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/sync/resource/annotations.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/resource/annotations.go similarity index 89% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/sync/resource/annotations.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/resource/annotations.go index 8c8ade513..4ed311a5f 100644 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/sync/resource/annotations.go +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/resource/annotations.go @@ -1,6 +1,7 @@ package resource import ( + "slices" "strings" ) @@ -17,7 +18,7 @@ func GetAnnotationCSVs(obj AnnotationGetter, key string) []string { // map for de-duping seen := make(map[string]bool) var values []string - for _, item := range strings.Split(obj.GetAnnotations()[key], ",") { + for item := range strings.SplitSeq(obj.GetAnnotations()[key], ",") { val := strings.TrimSpace(item) if val == "" { continue @@ -34,12 +35,7 @@ func GetAnnotationCSVs(obj AnnotationGetter, key string) []string { // HasAnnotationOption will return if the given obj has an annotation defined // as the given key and has in its values, the occurrence of val. func HasAnnotationOption(obj AnnotationGetter, key, val string) bool { - for _, item := range GetAnnotationCSVs(obj, key) { - if item == val { - return true - } - } - return false + return slices.Contains(GetAnnotationCSVs(obj, key), val) } // GetAnnotationOptionValue will return the value of an option inside the diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/io/io.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/io/io.go similarity index 100% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/io/io.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/io/io.go diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/json/json.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/json/json.go similarity index 100% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/json/json.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/json/json.go diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/convert.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/convert.go similarity index 93% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/convert.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/convert.go index d0d34c2c6..d48d4159b 100644 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/convert.go +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/convert.go @@ -7,7 +7,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - "github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/scheme" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/scheme" ) func convertToVersionWithScheme(obj *unstructured.Unstructured, group string, version string) (*unstructured.Unstructured, error) { diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/ctl.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/ctl.go similarity index 92% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/ctl.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/ctl.go index 06c5efbcf..6a99d0adf 100644 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/ctl.go +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/ctl.go @@ -21,9 +21,9 @@ import ( "k8s.io/kube-openapi/pkg/util/proto" "k8s.io/kubectl/pkg/util/openapi" - "github.com/argoproj/argo-cd/gitops-engine/pkg/diff" - utils "github.com/argoproj/argo-cd/gitops-engine/pkg/utils/io" - "github.com/argoproj/argo-cd/gitops-engine/pkg/utils/tracing" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/diff" + utils "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/io" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/tracing" ) type CleanupFunc func() @@ -55,6 +55,9 @@ type APIResourceInfo struct { GroupKind schema.GroupKind Meta metav1.APIResource GroupVersionResource schema.GroupVersionResource + // LabelSelector holds the label selector that must be applied to the list/watch calls of the + // resource. An empty string means that every object of the resource must be listed. + LabelSelector string } type filterFunc func(apiResource *metav1.APIResource) bool @@ -99,6 +102,7 @@ func (k *KubectlCmd) filterAPIResources(config *rest.Config, preferred bool, res GroupKind: schema.GroupKind{Group: gv.Group, Kind: apiResource.Kind}, Meta: apiResource, GroupVersionResource: resource, + LabelSelector: resourceFilter.GetLabelSelector(gv.Group, apiResource.Kind, config.Host), } apiResIfs = append(apiResIfs, apiResIf) } @@ -132,27 +136,30 @@ func (k *KubectlCmd) LoadOpenAPISchema(config *rest.Config) (openapi.Resources, return nil, nil, fmt.Errorf("failed to create discovery client: %w", err) } - oapiGetter := openapi.NewOpenAPIGetter(disco) - oapiResources, err := openapi.NewOpenAPIParser(oapiGetter).Parse() + return k.loadOpenAPISchema(disco) +} + +// loadOpenAPISchema parses the OpenAPI document once and builds both the openapi.Resources and the +// GVK parser from the same models. Neither keeps a reference to the decoded document, so it can be +// garbage collected as soon as this returns. +func (k *KubectlCmd) loadOpenAPISchema(oapiGetter discovery.OpenAPISchemaInterface) (openapi.Resources, *managedfields.GvkParser, error) { + doc, err := oapiGetter.OpenAPISchema() + if err != nil { + return nil, nil, fmt.Errorf("error getting openapi schema: %w", err) + } + models, err := proto.NewOpenAPIData(doc) if err != nil { return nil, nil, fmt.Errorf("error getting openapi resources: %w", err) } - gvkParser, err := k.newGVKParser(oapiGetter) + oapiResources := newOpenAPIResources(models) + gvkParser, err := k.newGVKParser(models) if err != nil { return oapiResources, nil, fmt.Errorf("error getting gvk parser: %w", err) } return oapiResources, gvkParser, nil } -func (k *KubectlCmd) newGVKParser(oapiGetter discovery.OpenAPISchemaInterface) (*managedfields.GvkParser, error) { - doc, err := oapiGetter.OpenAPISchema() - if err != nil { - return nil, fmt.Errorf("error getting openapi schema: %w", err) - } - models, err := proto.NewOpenAPIData(doc) - if err != nil { - return nil, fmt.Errorf("error getting openapi data: %w", err) - } +func (k *KubectlCmd) newGVKParser(models proto.Models) (*managedfields.GvkParser, error) { var taintedGVKs []schema.GroupVersionKind models, taintedGVKs = newUniqueModels(models) if len(taintedGVKs) > 0 { diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/kube.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/kube.go similarity index 100% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/kube.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/kube.go diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/openapi_resources.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/openapi_resources.go new file mode 100644 index 000000000..cab1eac15 --- /dev/null +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/openapi_resources.go @@ -0,0 +1,58 @@ +package kube + +import ( + "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/kube-openapi/pkg/util/proto" + "k8s.io/kubectl/pkg/util/openapi" +) + +// openAPIResources implements openapi.Resources using only the parsed OpenAPI models. +// +// kubectl's implementation (openapi.NewOpenAPIData) also keeps the decoded *openapi_v2.Document, +// only so that GetConsumes can scan its paths. The cluster cache keeps one openapi.Resources per +// cluster for as long as the cluster is cached, and the decoded document is several times larger +// than the parsed models, so retaining it costs a lot of memory for a method nothing calls. +type openAPIResources struct { + // resources maps each GVK to the name of its model. + resources map[schema.GroupVersionKind]string + models proto.Models +} + +var _ openapi.Resources = &openAPIResources{} + +// newOpenAPIResources indexes models by GVK. It maps GVKs to model names the same way +// openapi.NewOpenAPIData does, so LookupResource returns the same schemas. +func newOpenAPIResources(models proto.Models) *openAPIResources { + resources := map[schema.GroupVersionKind]string{} + for _, modelName := range models.ListModels() { + model := models.LookupModel(modelName) + if model == nil { + continue + } + for _, gvk := range parseGroupVersionKind(model) { + if gvk.Kind != "" { + resources[gvk] = modelName + } + } + } + return &openAPIResources{resources: resources, models: models} +} + +// LookupResource returns the schema of the model for gvk, or nil if there isn't one. +func (r *openAPIResources) LookupResource(gvk schema.GroupVersionKind) proto.Schema { + modelName, found := r.resources[gvk] + if !found { + return nil + } + return r.models.LookupModel(modelName) +} + +// GetConsumes always returns nil, because answering it requires keeping the whole OpenAPI document. +// +// kubectl's client-side apply calls GetConsumes to choose between a strategic merge patch and a +// JSON merge patch, but Argo CD's apply gets its OpenAPI data from the kubectl factory, not from +// this type. Do not pass this type to kubectl's apply Patcher: it would fall back to a JSON merge +// patch for every resource. +func (*openAPIResources) GetConsumes(schema.GroupVersionKind, string) []string { + return nil +} diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/resource_filter.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/resource_filter.go new file mode 100644 index 000000000..e196cac21 --- /dev/null +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/resource_filter.go @@ -0,0 +1,8 @@ +package kube + +type ResourceFilter interface { + IsExcludedResource(group, kind, cluster string) bool + // GetLabelSelector returns the label selector that must be applied to list/watch calls of the + // given resource. An empty string means that every object of the resource must be listed. + GetLabelSelector(group, kind, cluster string) string +} diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/resource_ops.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/resource_ops.go similarity index 93% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/resource_ops.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/resource_ops.go index 7415b59c9..c21dca82b 100644 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/resource_ops.go +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/resource_ops.go @@ -32,9 +32,9 @@ import ( cmdutil "k8s.io/kubectl/pkg/cmd/util" "k8s.io/kubectl/pkg/scheme" - "github.com/argoproj/argo-cd/gitops-engine/pkg/diff" - "github.com/argoproj/argo-cd/gitops-engine/pkg/utils/io" - "github.com/argoproj/argo-cd/gitops-engine/pkg/utils/tracing" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/diff" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/io" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/tracing" ) type outputMode int @@ -55,7 +55,10 @@ type ResourceOperations interface { // KubectlOptionsRunner defines the operations to run kubectl commands based on provided options type KubectlOptionsRunner interface { Apply(opts *apply.ApplyOptions) error - Create(opts *create.CreateOptions, fact cmdutil.Factory, cmd *cobra.Command) error + // Since k8s client 0.37.0 the underlying function [k8s.io/kubectl/pkg/cmd/create.CreateOptions.RunCreate] does + // not accept cmd parameter, so the third argument of Create() is not used any more by the Gitops Engine built-in + // implementation of the [KubectlOptionsRunner] interface and will be removed in the next major version + Create(opts *create.CreateOptions, fact cmdutil.Factory, ignoredCmd *cobra.Command) error Replace(opts *replace.ReplaceOptions, fact cmdutil.Factory) error AuthReconcile(opts *auth.ReconcileOptions) error } @@ -76,13 +79,13 @@ func (f *realKubectlOptionsRunner) Apply(opts *apply.ApplyOptions) error { } // Create will perform https://kubernetes.io/docs/reference/kubectl/generated/kubectl_create/ -func (f *realKubectlOptionsRunner) Create(opts *create.CreateOptions, fact cmdutil.Factory, cmd *cobra.Command) error { +func (f *realKubectlOptionsRunner) Create(opts *create.CreateOptions, fact cmdutil.Factory, _ *cobra.Command) error { cleanup, err := f.processKubectlRun("create") if err != nil { return err } defer cleanup() - return opts.RunCreate(fact, cmd) + return opts.RunCreate(fact) } // Replace will perform https://kubernetes.io/docs/reference/kubectl/generated/kubectl_replace/ @@ -111,9 +114,26 @@ func (f *realKubectlOptionsRunner) AuthReconcile(opts *auth.ReconcileOptions) (r retErr = fmt.Errorf("error running kubectl auth reconcile: %v", r) } }() + // TODO(#29484): Remove this wrapper after the upstream kubectl panic fix is available in Argo CD. + opts.Visitor = panicRecoveringVisitor{Visitor: opts.Visitor} return opts.RunReconcile() } +type panicRecoveringVisitor struct { + resource.Visitor +} + +func (v panicRecoveringVisitor) Visit(fn resource.VisitorFunc) error { + return v.Visitor.Visit(func(info *resource.Info, err error) (retErr error) { + defer func() { + if r := recover(); r != nil { + retErr = fmt.Errorf("error running kubectl auth reconcile: %v", r) + } + }() + return fn(info, err) + }) +} + func (f *realKubectlOptionsRunner) processKubectlRun(cmd string) (CleanupFunc, error) { if f.onKubectlRun != nil { return f.onKubectlRun(cmd) @@ -326,6 +346,11 @@ func (k *kubectlResourceOperations) CreateResource(ctx context.Context, obj *uns if err != nil { return err } + if validate { + createOptions.ValidationDirective = metav1.FieldValidationStrict + } else { + createOptions.ValidationDirective = metav1.FieldValidationIgnore + } command := &cobra.Command{} saveConfig := false command.Flags().BoolVar(&saveConfig, "save-config", false, "") @@ -465,7 +490,9 @@ func (k *kubectlResourceOperations) newApplyOptions(ioStreams genericiooptions.I o.Namespace = obj.GetNamespace() o.DeleteOptions.Filenames = []string{fileName} - o.DeleteOptions.ForceDeletion = force + // kubectl rejects --force together with --server-side; conflicts are already + // forced via --force-conflicts, so the force flag has no meaning under SSA. + o.DeleteOptions.ForceDeletion = force && !serverSideApply o.ForceConflicts = serverSideApply o.ToPrinter = func(operation string) (printers.ResourcePrinter, error) { diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/scheme/parser.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/scheme/parser.go similarity index 89% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/scheme/parser.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/scheme/parser.go index a46e6f6c9..5a801c506 100644 --- a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/scheme/parser.go +++ b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/scheme/parser.go @@ -3191,6 +3191,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: message type: scalar: string + - name: observedGeneration + type: + scalar: numeric - name: reason type: scalar: string @@ -3520,6 +3523,26 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" +- name: io.k8s.api.batch.v1.JobSchedulingConfiguration + map: + fields: + - name: disruptionMode + type: + namedType: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupDisruptionMode + - name: resourceClaims + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupResourceClaim + elementRelationship: associative + keys: + - name + - name: schedulingConstraints + type: + namedType: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupSchedulingConstraints + - name: schedulingPolicy + type: + namedType: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupSchedulingPolicy - name: io.k8s.api.batch.v1.JobSpec map: fields: @@ -3556,6 +3579,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: podReplacementPolicy type: scalar: string + - name: scheduling + type: + namedType: io.k8s.api.batch.v1.JobSchedulingConfiguration - name: selector type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector @@ -3880,6 +3906,120 @@ var schemaYAML = typed.YAMLObject(`types: elementRelationship: associative keys: - type +- name: io.k8s.api.certificates.v1.ClusterTrustBundle + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.certificates.v1.ClusterTrustBundleSpec + default: {} +- name: io.k8s.api.certificates.v1.ClusterTrustBundleSpec + map: + fields: + - name: signerName + type: + scalar: string + - name: trustBundle + type: + scalar: string + default: "" +- name: io.k8s.api.certificates.v1.PodCertificateRequest + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.certificates.v1.PodCertificateRequestSpec + default: {} + - name: status + type: + namedType: io.k8s.api.certificates.v1.PodCertificateRequestStatus + default: {} +- name: io.k8s.api.certificates.v1.PodCertificateRequestSpec + map: + fields: + - name: maxExpirationSeconds + type: + scalar: numeric + default: 86400 + - name: nodeName + type: + scalar: string + default: "" + - name: nodeUID + type: + scalar: string + default: "" + - name: podName + type: + scalar: string + default: "" + - name: podUID + type: + scalar: string + default: "" + - name: serviceAccountName + type: + scalar: string + default: "" + - name: serviceAccountUID + type: + scalar: string + default: "" + - name: signerName + type: + scalar: string + default: "" + - name: stubPKCS10Request + type: + scalar: string + - name: unverifiedUserAnnotations + type: + map: + elementType: + scalar: string +- name: io.k8s.api.certificates.v1.PodCertificateRequestStatus + map: + fields: + - name: beginRefreshAt + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: certificateChain + type: + scalar: string + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type + - name: notAfter + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: notBefore + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time - name: io.k8s.api.certificates.v1alpha1.ClusterTrustBundle map: fields: @@ -4575,6 +4715,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: signerName type: scalar: string + - name: user + type: + scalar: numeric - name: io.k8s.api.core.v1.ComponentCondition map: fields: @@ -4707,6 +4850,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: defaultMode type: scalar: numeric + - name: defaultUser + type: + scalar: numeric - name: items type: list: @@ -5072,12 +5218,18 @@ var schemaYAML = typed.YAMLObject(`types: - name: resourceFieldRef type: namedType: io.k8s.api.core.v1.ResourceFieldSelector + - name: user + type: + scalar: numeric - name: io.k8s.api.core.v1.DownwardAPIVolumeSource map: fields: - name: defaultMode type: scalar: numeric + - name: defaultUser + type: + scalar: numeric - name: items type: list: @@ -5090,6 +5242,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: medium type: scalar: string + - name: mode + type: + scalar: numeric - name: sizeLimit type: namedType: io.k8s.apimachinery.pkg.api.resource.Quantity @@ -5412,6 +5567,17 @@ var schemaYAML = typed.YAMLObject(`types: - name: host type: scalar: string +- name: io.k8s.api.core.v1.EvictionResponder + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: priority + type: + scalar: numeric + elementRelationship: atomic - name: io.k8s.api.core.v1.ExecAction map: fields: @@ -5535,6 +5701,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.core.v1.GRPCAction map: fields: + - name: mode + type: + scalar: string - name: port type: scalar: numeric @@ -5605,6 +5774,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: port type: namedType: io.k8s.apimachinery.pkg.util.intstr.IntOrString + - name: protocol + type: + scalar: string - name: scheme type: scalar: string @@ -5764,6 +5936,9 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" + - name: user + type: + scalar: numeric - name: io.k8s.api.core.v1.Lifecycle map: fields: @@ -6043,6 +6218,29 @@ var schemaYAML = typed.YAMLObject(`types: - name: requiredDuringSchedulingIgnoredDuringExecution type: namedType: io.k8s.api.core.v1.NodeSelector +- name: io.k8s.api.core.v1.NodeAllocatableMappedResources + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: quantity + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.core.v1.NodeAllocatableOverheadResources + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: perContainer + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: perPod + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: io.k8s.api.core.v1.NodeAllocatableResourceClaimStatus map: fields: @@ -6052,15 +6250,26 @@ var schemaYAML = typed.YAMLObject(`types: elementType: scalar: string elementRelationship: associative + - name: mapping + type: + list: + elementType: + namedType: io.k8s.api.core.v1.NodeAllocatableMappedResources + elementRelationship: associative + keys: + - name + - name: overhead + type: + list: + elementType: + namedType: io.k8s.api.core.v1.NodeAllocatableOverheadResources + elementRelationship: associative + keys: + - name - name: resourceClaimName type: scalar: string default: "" - - name: resources - type: - map: - elementType: - namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: io.k8s.api.core.v1.NodeCondition map: fields: @@ -6118,6 +6327,15 @@ var schemaYAML = typed.YAMLObject(`types: - name: supplementalGroupsPolicy type: scalar: boolean +- name: io.k8s.api.core.v1.NodePodPreemptionPolicy + map: + fields: + - name: disableResizePreemption + type: + list: + elementType: + scalar: string + elementRelationship: associative - name: io.k8s.api.core.v1.NodeRuntimeHandler map: fields: @@ -6198,6 +6416,9 @@ var schemaYAML = typed.YAMLObject(`types: elementType: scalar: string elementRelationship: associative + - name: podPreemptionPolicy + type: + namedType: io.k8s.api.core.v1.NodePodPreemptionPolicy - name: providerID type: scalar: string @@ -6331,6 +6552,9 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" + - name: runningInUserNamespace + type: + scalar: boolean - name: swap type: namedType: io.k8s.api.core.v1.NodeSwapStatus @@ -6509,6 +6733,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: currentVolumeAttributesClassName type: scalar: string + - name: healthStatus + type: + namedType: io.k8s.api.core.v1.VolumeHealthStatus - name: modifyVolumeStatus type: namedType: io.k8s.api.core.v1.ModifyVolumeStatus @@ -6769,6 +6996,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: signerName type: scalar: string + - name: user + type: + scalar: numeric - name: userAnnotations type: map: @@ -6989,6 +7219,14 @@ var schemaYAML = typed.YAMLObject(`types: elementRelationship: associative keys: - name + - name: evictionResponders + type: + list: + elementType: + namedType: io.k8s.api.core.v1.EvictionResponder + elementRelationship: associative + keys: + - name - name: hostAliases type: list: @@ -7192,7 +7430,9 @@ var schemaYAML = typed.YAMLObject(`types: list: elementType: namedType: io.k8s.api.core.v1.NodeAllocatableResourceClaimStatus - elementRelationship: atomic + elementRelationship: associative + keys: + - resourceClaimName - name: nominatedNodeName type: scalar: string @@ -7236,6 +7476,14 @@ var schemaYAML = typed.YAMLObject(`types: - name: startTime type: namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: volumeHealth + type: + list: + elementType: + namedType: io.k8s.api.core.v1.PodVolumeHealth + elementRelationship: associative + keys: + - name - name: io.k8s.api.core.v1.PodTemplate map: fields: @@ -7264,6 +7512,25 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: io.k8s.api.core.v1.PodSpec default: {} +- name: io.k8s.api.core.v1.PodVolumeHealth + map: + fields: + - name: healthConditions + type: + list: + elementType: + namedType: io.k8s.api.core.v1.VolumeHealthCondition + elementRelationship: associative + keys: + - status + - reason + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: name + type: + scalar: string + default: "" - name: io.k8s.api.core.v1.PortStatus map: fields: @@ -7341,6 +7608,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: defaultMode type: scalar: numeric + - name: defaultUser + type: + scalar: numeric - name: sources type: list: @@ -7867,6 +8137,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: defaultMode type: scalar: numeric + - name: defaultUser + type: + scalar: numeric - name: items type: list: @@ -7982,6 +8255,9 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" + - name: user + type: + scalar: numeric - name: io.k8s.api.core.v1.ServicePort map: fields: @@ -8404,21 +8680,56 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" -- name: io.k8s.api.core.v1.VolumeMount +- name: io.k8s.api.core.v1.VolumeHealthCondition map: fields: - - name: mountPath + - name: message type: scalar: string - default: "" - - name: mountPropagation + - name: reason type: scalar: string - - name: name + default: "" + - name: status type: scalar: string default: "" - - name: readOnly +- name: io.k8s.api.core.v1.VolumeHealthStatus + map: + fields: + - name: healthConditions + type: + list: + elementType: + namedType: io.k8s.api.core.v1.VolumeHealthCondition + elementRelationship: associative + keys: + - status + - reason + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time +- name: io.k8s.api.core.v1.VolumeMount + map: + fields: + - name: bindMountOptions + type: + list: + elementType: + scalar: string + elementRelationship: associative + - name: mountPath + type: + scalar: string + default: "" + - name: mountPropagation + type: + scalar: string + - name: name + type: + scalar: string + default: "" + - name: readOnly type: scalar: boolean - name: recursiveReadOnly @@ -10865,6 +11176,214 @@ var schemaYAML = typed.YAMLObject(`types: - name: reason type: scalar: string +- name: io.k8s.api.lifecycle.v1alpha1.Eviction + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.lifecycle.v1alpha1.EvictionSpec + default: {} + - name: status + type: + namedType: io.k8s.api.lifecycle.v1alpha1.EvictionStatus + default: {} +- name: io.k8s.api.lifecycle.v1alpha1.EvictionPodReference + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: uid + type: + scalar: string + default: "" +- name: io.k8s.api.lifecycle.v1alpha1.EvictionRequest + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.lifecycle.v1alpha1.EvictionRequestSpec + default: {} + - name: status + type: + namedType: io.k8s.api.lifecycle.v1alpha1.EvictionRequestStatus + default: {} +- name: io.k8s.api.lifecycle.v1alpha1.EvictionRequestPodReference + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: uid + type: + scalar: string + default: "" +- name: io.k8s.api.lifecycle.v1alpha1.EvictionRequestSpec + map: + fields: + - name: intent + type: + scalar: string + default: "" + - name: requester + type: + scalar: string + default: "" + - name: target + type: + namedType: io.k8s.api.lifecycle.v1alpha1.EvictionRequestTarget + default: {} +- name: io.k8s.api.lifecycle.v1alpha1.EvictionRequestStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type + - name: observedGeneration + type: + scalar: numeric +- name: io.k8s.api.lifecycle.v1alpha1.EvictionRequestTarget + map: + fields: + - name: pod + type: + namedType: io.k8s.api.lifecycle.v1alpha1.EvictionRequestPodReference + unions: + - fields: + - fieldName: pod + discriminatorValue: Pod +- name: io.k8s.api.lifecycle.v1alpha1.EvictionSpec + map: + fields: + - name: target + type: + namedType: io.k8s.api.lifecycle.v1alpha1.EvictionTarget + default: {} +- name: io.k8s.api.lifecycle.v1alpha1.EvictionStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type + - name: observedGeneration + type: + scalar: numeric + - name: requesters + type: + list: + elementType: + namedType: io.k8s.api.lifecycle.v1alpha1.Requester + elementRelationship: associative + keys: + - name + - name: responders + type: + list: + elementType: + namedType: io.k8s.api.lifecycle.v1alpha1.ResponderStatus + elementRelationship: associative + keys: + - name + - name: targetResponders + type: + list: + elementType: + namedType: io.k8s.api.lifecycle.v1alpha1.TargetResponder + elementRelationship: associative + keys: + - name +- name: io.k8s.api.lifecycle.v1alpha1.EvictionTarget + map: + fields: + - name: pod + type: + namedType: io.k8s.api.lifecycle.v1alpha1.EvictionPodReference + unions: + - fields: + - fieldName: pod + discriminatorValue: Pod +- name: io.k8s.api.lifecycle.v1alpha1.Requester + map: + fields: + - name: intent + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" + elementRelationship: atomic +- name: io.k8s.api.lifecycle.v1alpha1.ResponderStatus + map: + fields: + - name: completionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: expectedCompletionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: heartbeatTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: message + type: + scalar: string + - name: name + type: + scalar: string + default: "" + - name: startTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + elementRelationship: separable +- name: io.k8s.api.lifecycle.v1alpha1.TargetResponder + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: priority + type: + scalar: numeric + - name: state + type: + scalar: string + default: "" + elementRelationship: atomic - name: io.k8s.api.networking.v1.HTTPIngressPath map: fields: @@ -12479,11 +12998,11 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" - - name: nodeAllocatableResourceMappings + - name: nodeAllocatableResources type: map: elementType: - namedType: io.k8s.api.resource.v1.NodeAllocatableResourceMapping + namedType: io.k8s.api.resource.v1.NodeAllocatableResource - name: nodeName type: scalar: string @@ -12667,6 +13186,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.resource.v1.DeviceCounterConsumption map: fields: + - name: compatibilityGroups + type: + list: + elementType: + scalar: string + elementRelationship: atomic - name: counterSet type: scalar: string @@ -12676,6 +13201,17 @@ var schemaYAML = typed.YAMLObject(`types: map: elementType: namedType: io.k8s.api.resource.v1.Counter +- name: io.k8s.api.resource.v1.DeviceDerivedAttribute + map: + fields: + - name: expression + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" - name: io.k8s.api.resource.v1.DeviceRequest map: fields: @@ -12734,6 +13270,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: shareID type: scalar: string + - name: skipNodeOperations + type: + list: + elementType: + scalar: string + elementRelationship: associative - name: tolerations type: list: @@ -12758,6 +13300,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: count type: scalar: numeric + - name: derivedAttributes + type: + list: + elementType: + namedType: io.k8s.api.resource.v1.DeviceDerivedAttribute + elementRelationship: atomic - name: deviceClassName type: scalar: string @@ -12795,40 +13343,100 @@ var schemaYAML = typed.YAMLObject(`types: - name: value type: scalar: string -- name: io.k8s.api.resource.v1.DeviceToleration +- name: io.k8s.api.resource.v1.DeviceTaintRule map: fields: - - name: effect + - name: apiVersion type: scalar: string - - name: key + - name: kind type: scalar: string - - name: operator + - name: metadata type: - scalar: string - default: Equal - - name: tolerationSeconds + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec type: - scalar: numeric - - name: value + namedType: io.k8s.api.resource.v1.DeviceTaintRuleSpec + default: {} + - name: status type: - scalar: string -- name: io.k8s.api.resource.v1.ExactDeviceRequest + namedType: io.k8s.api.resource.v1.DeviceTaintRuleStatus + default: {} +- name: io.k8s.api.resource.v1.DeviceTaintRuleSpec map: fields: - - name: adminAccess - type: - scalar: boolean - - name: allocationMode + - name: deviceSelector type: - scalar: string - - name: capacity + namedType: io.k8s.api.resource.v1.DeviceTaintSelector + - name: taint type: - namedType: io.k8s.api.resource.v1.CapacityRequirements - - name: count + namedType: io.k8s.api.resource.v1.DeviceTaint + default: {} +- name: io.k8s.api.resource.v1.DeviceTaintRuleStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type +- name: io.k8s.api.resource.v1.DeviceTaintSelector + map: + fields: + - name: device + type: + scalar: string + - name: driver + type: + scalar: string + - name: pool + type: + scalar: string +- name: io.k8s.api.resource.v1.DeviceToleration + map: + fields: + - name: effect + type: + scalar: string + - name: key + type: + scalar: string + - name: operator + type: + scalar: string + default: Equal + - name: tolerationSeconds type: scalar: numeric + - name: value + type: + scalar: string +- name: io.k8s.api.resource.v1.ExactDeviceRequest + map: + fields: + - name: adminAccess + type: + scalar: boolean + - name: allocationMode + type: + scalar: string + - name: capacity + type: + namedType: io.k8s.api.resource.v1.CapacityRequirements + - name: count + type: + scalar: numeric + - name: derivedAttributes + type: + list: + elementType: + namedType: io.k8s.api.resource.v1.DeviceDerivedAttribute + elementRelationship: atomic - name: deviceClassName type: scalar: string @@ -12860,15 +13468,36 @@ var schemaYAML = typed.YAMLObject(`types: elementType: scalar: string elementRelationship: atomic -- name: io.k8s.api.resource.v1.NodeAllocatableResourceMapping +- name: io.k8s.api.resource.v1.NodeAllocatableMapping map: fields: - - name: allocationMultiplier - type: - namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: capacityKey type: scalar: string + - name: capacityMultiplier + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: deviceMultiplier + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.resource.v1.NodeAllocatableOverhead + map: + fields: + - name: perContainer + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: perPod + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.resource.v1.NodeAllocatableResource + map: + fields: + - name: mapping + type: + namedType: io.k8s.api.resource.v1.NodeAllocatableMapping + - name: overhead + type: + namedType: io.k8s.api.resource.v1.NodeAllocatableOverhead - name: io.k8s.api.resource.v1.OpaqueDeviceConfiguration map: fields: @@ -13032,6 +13661,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: nodeSelector type: namedType: io.k8s.api.core.v1.NodeSelector + - name: partitionTypeAttribute + type: + scalar: string - name: perDeviceNodeSelection type: scalar: boolean @@ -13045,6 +13677,12 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.api.resource.v1.CounterSet elementRelationship: atomic + - name: skipNodeOperations + type: + list: + elementType: + scalar: string + elementRelationship: associative - name: io.k8s.api.resource.v1alpha3.DeviceTaint map: fields: @@ -13116,6 +13754,21 @@ var schemaYAML = typed.YAMLObject(`types: - name: pool type: scalar: string +- name: io.k8s.api.resource.v1alpha3.PartitionTypeStatus + map: + fields: + - name: allocatable + type: + scalar: numeric + - name: attribute + type: + scalar: string + - name: total + type: + scalar: numeric + - name: type + type: + scalar: string - name: io.k8s.api.resource.v1alpha3.PoolStatus map: fields: @@ -13135,12 +13788,21 @@ var schemaYAML = typed.YAMLObject(`types: - name: nodeName type: scalar: string + - name: partitionSummary + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.PartitionTypeStatus + elementRelationship: atomic - name: poolName type: scalar: string - name: resourceSliceCount type: scalar: numeric + - name: shareableSummary + type: + namedType: io.k8s.api.resource.v1alpha3.ShareableSummaryStatus - name: totalDevices type: scalar: numeric @@ -13173,6 +13835,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.resource.v1alpha3.ResourcePoolStatusRequestSpec map: fields: + - name: defaultPartitionTypeAttribute + type: + scalar: string - name: driver type: scalar: string @@ -13204,6 +13869,36 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.api.resource.v1alpha3.PoolStatus elementRelationship: atomic +- name: io.k8s.api.resource.v1alpha3.ShareableCapacityStatus + map: + fields: + - name: available + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: consumed + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: name + type: + scalar: string + - name: total + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.resource.v1alpha3.ShareableSummaryStatus + map: + fields: + - name: capacity + type: + list: + elementType: + namedType: io.k8s.api.resource.v1alpha3.ShareableCapacityStatus + elementRelationship: atomic + - name: fullyAvailableDevices + type: + scalar: numeric + - name: partiallyAvailableDevices + type: + scalar: numeric - name: io.k8s.api.resource.v1beta1.AllocatedDeviceStatus map: fields: @@ -13289,11 +13984,11 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.api.resource.v1beta1.DeviceCounterConsumption elementRelationship: atomic - - name: nodeAllocatableResourceMappings + - name: nodeAllocatableResources type: map: elementType: - namedType: io.k8s.api.resource.v1beta1.NodeAllocatableResourceMapping + namedType: io.k8s.api.resource.v1beta1.NodeAllocatableResource - name: nodeName type: scalar: string @@ -13547,6 +14242,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.resource.v1beta1.DeviceCounterConsumption map: fields: + - name: compatibilityGroups + type: + list: + elementType: + scalar: string + elementRelationship: atomic - name: counterSet type: scalar: string @@ -13556,6 +14257,17 @@ var schemaYAML = typed.YAMLObject(`types: map: elementType: namedType: io.k8s.api.resource.v1beta1.Counter +- name: io.k8s.api.resource.v1beta1.DeviceDerivedAttribute + map: + fields: + - name: expression + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" - name: io.k8s.api.resource.v1beta1.DeviceRequest map: fields: @@ -13571,6 +14283,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: count type: scalar: numeric + - name: derivedAttributes + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta1.DeviceDerivedAttribute + elementRelationship: atomic - name: deviceClassName type: scalar: string @@ -13639,6 +14357,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: shareID type: scalar: string + - name: skipNodeOperations + type: + list: + elementType: + scalar: string + elementRelationship: associative - name: tolerations type: list: @@ -13663,6 +14387,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: count type: scalar: numeric + - name: derivedAttributes + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta1.DeviceDerivedAttribute + elementRelationship: atomic - name: deviceClassName type: scalar: string @@ -13734,15 +14464,36 @@ var schemaYAML = typed.YAMLObject(`types: elementType: scalar: string elementRelationship: atomic -- name: io.k8s.api.resource.v1beta1.NodeAllocatableResourceMapping +- name: io.k8s.api.resource.v1beta1.NodeAllocatableMapping map: fields: - - name: allocationMultiplier - type: - namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: capacityKey type: scalar: string + - name: capacityMultiplier + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: deviceMultiplier + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.resource.v1beta1.NodeAllocatableOverhead + map: + fields: + - name: perContainer + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: perPod + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.resource.v1beta1.NodeAllocatableResource + map: + fields: + - name: mapping + type: + namedType: io.k8s.api.resource.v1beta1.NodeAllocatableMapping + - name: overhead + type: + namedType: io.k8s.api.resource.v1beta1.NodeAllocatableOverhead - name: io.k8s.api.resource.v1beta1.OpaqueDeviceConfiguration map: fields: @@ -13906,6 +14657,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: nodeSelector type: namedType: io.k8s.api.core.v1.NodeSelector + - name: partitionTypeAttribute + type: + scalar: string - name: perDeviceNodeSelection type: scalar: boolean @@ -13919,6 +14673,12 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.api.resource.v1beta1.CounterSet elementRelationship: atomic + - name: skipNodeOperations + type: + list: + elementType: + scalar: string + elementRelationship: associative - name: io.k8s.api.resource.v1beta2.AllocatedDeviceStatus map: fields: @@ -14068,11 +14828,11 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" - - name: nodeAllocatableResourceMappings + - name: nodeAllocatableResources type: map: elementType: - namedType: io.k8s.api.resource.v1beta2.NodeAllocatableResourceMapping + namedType: io.k8s.api.resource.v1beta2.NodeAllocatableResource - name: nodeName type: scalar: string @@ -14256,6 +15016,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: io.k8s.api.resource.v1beta2.DeviceCounterConsumption map: fields: + - name: compatibilityGroups + type: + list: + elementType: + scalar: string + elementRelationship: atomic - name: counterSet type: scalar: string @@ -14265,6 +15031,17 @@ var schemaYAML = typed.YAMLObject(`types: map: elementType: namedType: io.k8s.api.resource.v1beta2.Counter +- name: io.k8s.api.resource.v1beta2.DeviceDerivedAttribute + map: + fields: + - name: expression + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" - name: io.k8s.api.resource.v1beta2.DeviceRequest map: fields: @@ -14323,6 +15100,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: shareID type: scalar: string + - name: skipNodeOperations + type: + list: + elementType: + scalar: string + elementRelationship: associative - name: tolerations type: list: @@ -14347,6 +15130,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: count type: scalar: numeric + - name: derivedAttributes + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta2.DeviceDerivedAttribute + elementRelationship: atomic - name: deviceClassName type: scalar: string @@ -14472,6 +15261,12 @@ var schemaYAML = typed.YAMLObject(`types: - name: count type: scalar: numeric + - name: derivedAttributes + type: + list: + elementType: + namedType: io.k8s.api.resource.v1beta2.DeviceDerivedAttribute + elementRelationship: atomic - name: deviceClassName type: scalar: string @@ -14503,15 +15298,36 @@ var schemaYAML = typed.YAMLObject(`types: elementType: scalar: string elementRelationship: atomic -- name: io.k8s.api.resource.v1beta2.NodeAllocatableResourceMapping +- name: io.k8s.api.resource.v1beta2.NodeAllocatableMapping map: fields: - - name: allocationMultiplier - type: - namedType: io.k8s.apimachinery.pkg.api.resource.Quantity - name: capacityKey type: scalar: string + - name: capacityMultiplier + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: deviceMultiplier + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.resource.v1beta2.NodeAllocatableOverhead + map: + fields: + - name: perContainer + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity + - name: perPod + type: + namedType: io.k8s.apimachinery.pkg.api.resource.Quantity +- name: io.k8s.api.resource.v1beta2.NodeAllocatableResource + map: + fields: + - name: mapping + type: + namedType: io.k8s.api.resource.v1beta2.NodeAllocatableMapping + - name: overhead + type: + namedType: io.k8s.api.resource.v1beta2.NodeAllocatableOverhead - name: io.k8s.api.resource.v1beta2.OpaqueDeviceConfiguration map: fields: @@ -14675,6 +15491,9 @@ var schemaYAML = typed.YAMLObject(`types: - name: nodeSelector type: namedType: io.k8s.api.core.v1.NodeSelector + - name: partitionTypeAttribute + type: + scalar: string - name: perDeviceNodeSelection type: scalar: boolean @@ -14688,6 +15507,12 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: io.k8s.api.resource.v1beta2.CounterSet elementRelationship: atomic + - name: skipNodeOperations + type: + list: + elementType: + scalar: string + elementRelationship: associative - name: io.k8s.api.scheduling.v1.PriorityClass map: fields: @@ -14714,7 +15539,7 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: numeric default: 0 -- name: io.k8s.api.scheduling.v1alpha2.BasicSchedulingPolicy +- name: io.k8s.api.scheduling.v1alpha3.AllCompositeDisruptionMode map: elementType: scalar: untyped @@ -14726,35 +15551,742 @@ var schemaYAML = typed.YAMLObject(`types: elementType: namedType: __untyped_deduced_ elementRelationship: separable -- name: io.k8s.api.scheduling.v1alpha2.GangSchedulingPolicy - map: - fields: - - name: minCount - type: - scalar: numeric - default: 0 -- name: io.k8s.api.scheduling.v1alpha2.PodGroup +- name: io.k8s.api.scheduling.v1alpha3.AllDisruptionMode map: - fields: - - name: apiVersion - type: - scalar: string - - name: kind - type: - scalar: string - - name: metadata - type: - namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta - default: {} - - name: spec - type: - namedType: io.k8s.api.scheduling.v1alpha2.PodGroupSpec - default: {} - - name: status - type: - namedType: io.k8s.api.scheduling.v1alpha2.PodGroupStatus - default: {} -- name: io.k8s.api.scheduling.v1alpha2.PodGroupResourceClaim + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1alpha3.BasicSchedulingPolicy + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1alpha3.CompositeBasicSchedulingPolicy + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1alpha3.CompositeDisruptionMode + map: + fields: + - name: all + type: + namedType: io.k8s.api.scheduling.v1alpha3.AllCompositeDisruptionMode + - name: single + type: + namedType: io.k8s.api.scheduling.v1alpha3.SingleCompositeDisruptionMode + unions: + - fields: + - fieldName: all + discriminatorValue: All + - fieldName: single + discriminatorValue: Single +- name: io.k8s.api.scheduling.v1alpha3.CompositeGangSchedulingPolicy + map: + fields: + - name: minGroupCount + type: + scalar: numeric + default: 0 +- name: io.k8s.api.scheduling.v1alpha3.CompositePodGroup + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.scheduling.v1alpha3.CompositePodGroupSpec + default: {} + - name: status + type: + namedType: io.k8s.api.scheduling.v1alpha3.CompositePodGroupStatus + default: {} +- name: io.k8s.api.scheduling.v1alpha3.CompositePodGroupSchedulingConstraints + map: + fields: + - name: topology + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1alpha3.TopologyConstraint + elementRelationship: atomic +- name: io.k8s.api.scheduling.v1alpha3.CompositePodGroupSchedulingPolicy + map: + fields: + - name: basic + type: + namedType: io.k8s.api.scheduling.v1alpha3.CompositeBasicSchedulingPolicy + - name: gang + type: + namedType: io.k8s.api.scheduling.v1alpha3.CompositeGangSchedulingPolicy + unions: + - fields: + - fieldName: basic + discriminatorValue: Basic + - fieldName: gang + discriminatorValue: Gang +- name: io.k8s.api.scheduling.v1alpha3.CompositePodGroupSpec + map: + fields: + - name: disruptionMode + type: + namedType: io.k8s.api.scheduling.v1alpha3.CompositeDisruptionMode + default: + single: {} + - name: parentCompositePodGroupName + type: + scalar: string + - name: preemptionPolicy + type: + scalar: string + - name: priority + type: + scalar: numeric + - name: priorityClassName + type: + scalar: string + - name: schedulingConstraints + type: + namedType: io.k8s.api.scheduling.v1alpha3.CompositePodGroupSchedulingConstraints + - name: schedulingPolicy + type: + namedType: io.k8s.api.scheduling.v1alpha3.CompositePodGroupSchedulingPolicy + default: {} + - name: workloadRef + type: + namedType: io.k8s.api.scheduling.v1alpha3.WorkloadReference +- name: io.k8s.api.scheduling.v1alpha3.CompositePodGroupStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type +- name: io.k8s.api.scheduling.v1alpha3.CompositePodGroupTemplate + map: + fields: + - name: compositePodGroupTemplates + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1alpha3.CompositePodGroupTemplate + elementRelationship: associative + keys: + - name + - name: disruptionMode + type: + namedType: io.k8s.api.scheduling.v1alpha3.CompositeDisruptionMode + - name: name + type: + scalar: string + default: "" + - name: podGroupTemplates + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1alpha3.PodGroupTemplate + elementRelationship: associative + keys: + - name + - name: preemptionPolicy + type: + scalar: string + - name: priority + type: + scalar: numeric + - name: priorityClassName + type: + scalar: string + - name: schedulingConstraints + type: + namedType: io.k8s.api.scheduling.v1alpha3.CompositePodGroupSchedulingConstraints + - name: schedulingPolicy + type: + namedType: io.k8s.api.scheduling.v1alpha3.CompositePodGroupSchedulingPolicy + default: {} +- name: io.k8s.api.scheduling.v1alpha3.DisruptionMode + map: + fields: + - name: all + type: + namedType: io.k8s.api.scheduling.v1alpha3.AllDisruptionMode + - name: single + type: + namedType: io.k8s.api.scheduling.v1alpha3.SingleDisruptionMode + unions: + - fields: + - fieldName: all + discriminatorValue: All + - fieldName: single + discriminatorValue: Single +- name: io.k8s.api.scheduling.v1alpha3.GangSchedulingPolicy + map: + fields: + - name: minCount + type: + scalar: numeric + default: 0 +- name: io.k8s.api.scheduling.v1alpha3.PodGroup + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.scheduling.v1alpha3.PodGroupSpec + default: {} + - name: status + type: + namedType: io.k8s.api.scheduling.v1alpha3.PodGroupStatus + default: {} +- name: io.k8s.api.scheduling.v1alpha3.PodGroupResourceClaim + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: resourceClaimName + type: + scalar: string + - name: resourceClaimTemplateName + type: + scalar: string +- name: io.k8s.api.scheduling.v1alpha3.PodGroupResourceClaimStatus + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: resourceClaimName + type: + scalar: string +- name: io.k8s.api.scheduling.v1alpha3.PodGroupSchedulingConstraints + map: + fields: + - name: topology + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1alpha3.TopologyConstraint + elementRelationship: atomic +- name: io.k8s.api.scheduling.v1alpha3.PodGroupSchedulingPolicy + map: + fields: + - name: basic + type: + namedType: io.k8s.api.scheduling.v1alpha3.BasicSchedulingPolicy + - name: gang + type: + namedType: io.k8s.api.scheduling.v1alpha3.GangSchedulingPolicy + unions: + - fields: + - fieldName: basic + discriminatorValue: Basic + - fieldName: gang + discriminatorValue: Gang +- name: io.k8s.api.scheduling.v1alpha3.PodGroupSpec + map: + fields: + - name: disruptionMode + type: + namedType: io.k8s.api.scheduling.v1alpha3.DisruptionMode + default: + single: {} + - name: parentCompositePodGroupName + type: + scalar: string + - name: preemptionPolicy + type: + scalar: string + - name: priority + type: + scalar: numeric + - name: priorityClassName + type: + scalar: string + - name: resourceClaims + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1alpha3.PodGroupResourceClaim + elementRelationship: associative + keys: + - name + - name: schedulingConstraints + type: + namedType: io.k8s.api.scheduling.v1alpha3.PodGroupSchedulingConstraints + - name: schedulingPolicy + type: + namedType: io.k8s.api.scheduling.v1alpha3.PodGroupSchedulingPolicy + default: {} + - name: workloadRef + type: + namedType: io.k8s.api.scheduling.v1alpha3.WorkloadReference +- name: io.k8s.api.scheduling.v1alpha3.PodGroupStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type + - name: resourceClaimStatuses + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1alpha3.PodGroupResourceClaimStatus + elementRelationship: associative + keys: + - name +- name: io.k8s.api.scheduling.v1alpha3.PodGroupTemplate + map: + fields: + - name: disruptionMode + type: + namedType: io.k8s.api.scheduling.v1alpha3.DisruptionMode + - name: name + type: + scalar: string + default: "" + - name: preemptionPolicy + type: + scalar: string + - name: priority + type: + scalar: numeric + - name: priorityClassName + type: + scalar: string + - name: resourceClaims + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1alpha3.PodGroupResourceClaim + elementRelationship: associative + keys: + - name + - name: schedulingConstraints + type: + namedType: io.k8s.api.scheduling.v1alpha3.PodGroupSchedulingConstraints + - name: schedulingPolicy + type: + namedType: io.k8s.api.scheduling.v1alpha3.PodGroupSchedulingPolicy + default: {} +- name: io.k8s.api.scheduling.v1alpha3.SingleCompositeDisruptionMode + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1alpha3.SingleDisruptionMode + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1alpha3.TopologyConstraint + map: + fields: + - name: key + type: + scalar: string + default: "" +- name: io.k8s.api.scheduling.v1alpha3.TypedLocalObjectReference + map: + fields: + - name: apiGroup + type: + scalar: string + - name: kind + type: + scalar: string + default: "" + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.scheduling.v1alpha3.Workload + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.scheduling.v1alpha3.WorkloadSpec + default: {} +- name: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupAllDisruptionMode + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupBasicSchedulingPolicy + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupDisruptionMode + map: + fields: + - name: all + type: + namedType: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupAllDisruptionMode + - name: single + type: + namedType: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupSingleDisruptionMode + unions: + - fields: + - fieldName: all + discriminatorValue: All + - fieldName: single + discriminatorValue: Single +- name: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupGangSchedulingPolicy + map: + fields: + - name: minCount + type: + scalar: numeric +- name: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupResourceClaim + map: + fields: + - name: name + type: + scalar: string + default: "" + - name: resourceClaimName + type: + scalar: string + - name: resourceClaimTemplateName + type: + scalar: string +- name: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupSchedulingConstraints + map: + fields: + - name: topology + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1alpha3.TopologyConstraint + elementRelationship: atomic +- name: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupSchedulingPolicy + map: + fields: + - name: basic + type: + namedType: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupBasicSchedulingPolicy + - name: gang + type: + namedType: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupGangSchedulingPolicy + unions: + - fields: + - fieldName: basic + discriminatorValue: Basic + - fieldName: gang + discriminatorValue: Gang +- name: io.k8s.api.scheduling.v1alpha3.WorkloadPodGroupSingleDisruptionMode + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1alpha3.WorkloadReference + map: + fields: + - name: templateName + type: + scalar: string + default: "" + - name: workloadName + type: + scalar: string + default: "" +- name: io.k8s.api.scheduling.v1alpha3.WorkloadSpec + map: + fields: + - name: compositePodGroupTemplates + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1alpha3.CompositePodGroupTemplate + elementRelationship: associative + keys: + - name + - name: controllerRef + type: + namedType: io.k8s.api.scheduling.v1alpha3.TypedLocalObjectReference + - name: podGroupTemplates + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1alpha3.PodGroupTemplate + elementRelationship: associative + keys: + - name +- name: io.k8s.api.scheduling.v1beta1.AllCompositeDisruptionMode + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1beta1.AllDisruptionMode + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1beta1.BasicSchedulingPolicy + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1beta1.CompositeBasicSchedulingPolicy + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1beta1.CompositeDisruptionMode + map: + fields: + - name: all + type: + namedType: io.k8s.api.scheduling.v1beta1.AllCompositeDisruptionMode + - name: single + type: + namedType: io.k8s.api.scheduling.v1beta1.SingleCompositeDisruptionMode + unions: + - fields: + - fieldName: all + discriminatorValue: All + - fieldName: single + discriminatorValue: Single +- name: io.k8s.api.scheduling.v1beta1.CompositeGangSchedulingPolicy + map: + fields: + - name: minGroupCount + type: + scalar: numeric + default: 0 +- name: io.k8s.api.scheduling.v1beta1.CompositePodGroupSchedulingConstraints + map: + fields: + - name: topology + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1beta1.TopologyConstraint + elementRelationship: atomic +- name: io.k8s.api.scheduling.v1beta1.CompositePodGroupSchedulingPolicy + map: + fields: + - name: basic + type: + namedType: io.k8s.api.scheduling.v1beta1.CompositeBasicSchedulingPolicy + - name: gang + type: + namedType: io.k8s.api.scheduling.v1beta1.CompositeGangSchedulingPolicy + unions: + - fields: + - fieldName: basic + discriminatorValue: Basic + - fieldName: gang + discriminatorValue: Gang +- name: io.k8s.api.scheduling.v1beta1.CompositePodGroupTemplate + map: + fields: + - name: compositePodGroupTemplates + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1beta1.CompositePodGroupTemplate + elementRelationship: associative + keys: + - name + - name: disruptionMode + type: + namedType: io.k8s.api.scheduling.v1beta1.CompositeDisruptionMode + - name: name + type: + scalar: string + default: "" + - name: podGroupTemplates + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1beta1.PodGroupTemplate + elementRelationship: associative + keys: + - name + - name: preemptionPolicy + type: + scalar: string + - name: priority + type: + scalar: numeric + - name: priorityClassName + type: + scalar: string + - name: schedulingConstraints + type: + namedType: io.k8s.api.scheduling.v1beta1.CompositePodGroupSchedulingConstraints + - name: schedulingPolicy + type: + namedType: io.k8s.api.scheduling.v1beta1.CompositePodGroupSchedulingPolicy + default: {} +- name: io.k8s.api.scheduling.v1beta1.DisruptionMode + map: + fields: + - name: all + type: + namedType: io.k8s.api.scheduling.v1beta1.AllDisruptionMode + - name: single + type: + namedType: io.k8s.api.scheduling.v1beta1.SingleDisruptionMode + unions: + - fields: + - fieldName: all + discriminatorValue: All + - fieldName: single + discriminatorValue: Single +- name: io.k8s.api.scheduling.v1beta1.GangSchedulingPolicy + map: + fields: + - name: minCount + type: + scalar: numeric + default: 0 +- name: io.k8s.api.scheduling.v1beta1.PodGroup + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.scheduling.v1beta1.PodGroupSpec + default: {} + - name: status + type: + namedType: io.k8s.api.scheduling.v1beta1.PodGroupStatus + default: {} +- name: io.k8s.api.scheduling.v1beta1.PodGroupResourceClaim map: fields: - name: name @@ -14767,7 +16299,7 @@ var schemaYAML = typed.YAMLObject(`types: - name: resourceClaimTemplateName type: scalar: string -- name: io.k8s.api.scheduling.v1alpha2.PodGroupResourceClaimStatus +- name: io.k8s.api.scheduling.v1beta1.PodGroupResourceClaimStatus map: fields: - name: name @@ -14777,40 +16309,44 @@ var schemaYAML = typed.YAMLObject(`types: - name: resourceClaimName type: scalar: string -- name: io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingConstraints +- name: io.k8s.api.scheduling.v1beta1.PodGroupSchedulingConstraints map: fields: - name: topology type: list: elementType: - namedType: io.k8s.api.scheduling.v1alpha2.TopologyConstraint + namedType: io.k8s.api.scheduling.v1beta1.TopologyConstraint elementRelationship: atomic -- name: io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingPolicy +- name: io.k8s.api.scheduling.v1beta1.PodGroupSchedulingPolicy map: fields: - name: basic type: - namedType: io.k8s.api.scheduling.v1alpha2.BasicSchedulingPolicy + namedType: io.k8s.api.scheduling.v1beta1.BasicSchedulingPolicy - name: gang type: - namedType: io.k8s.api.scheduling.v1alpha2.GangSchedulingPolicy + namedType: io.k8s.api.scheduling.v1beta1.GangSchedulingPolicy unions: - fields: - fieldName: basic discriminatorValue: Basic - fieldName: gang discriminatorValue: Gang -- name: io.k8s.api.scheduling.v1alpha2.PodGroupSpec +- name: io.k8s.api.scheduling.v1beta1.PodGroupSpec map: fields: - name: disruptionMode + type: + namedType: io.k8s.api.scheduling.v1beta1.DisruptionMode + default: + single: {} + - name: parentCompositePodGroupName type: scalar: string - default: Pod - - name: podGroupTemplateRef + - name: preemptionPolicy type: - namedType: io.k8s.api.scheduling.v1alpha2.PodGroupTemplateReference + scalar: string - name: priority type: scalar: numeric @@ -14821,18 +16357,21 @@ var schemaYAML = typed.YAMLObject(`types: type: list: elementType: - namedType: io.k8s.api.scheduling.v1alpha2.PodGroupResourceClaim + namedType: io.k8s.api.scheduling.v1beta1.PodGroupResourceClaim elementRelationship: associative keys: - name - name: schedulingConstraints type: - namedType: io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingConstraints + namedType: io.k8s.api.scheduling.v1beta1.PodGroupSchedulingConstraints - name: schedulingPolicy type: - namedType: io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingPolicy + namedType: io.k8s.api.scheduling.v1beta1.PodGroupSchedulingPolicy default: {} -- name: io.k8s.api.scheduling.v1alpha2.PodGroupStatus + - name: workloadRef + type: + namedType: io.k8s.api.scheduling.v1beta1.WorkloadReference +- name: io.k8s.api.scheduling.v1beta1.PodGroupStatus map: fields: - name: conditions @@ -14847,20 +16386,23 @@ var schemaYAML = typed.YAMLObject(`types: type: list: elementType: - namedType: io.k8s.api.scheduling.v1alpha2.PodGroupResourceClaimStatus + namedType: io.k8s.api.scheduling.v1beta1.PodGroupResourceClaimStatus elementRelationship: associative keys: - name -- name: io.k8s.api.scheduling.v1alpha2.PodGroupTemplate +- name: io.k8s.api.scheduling.v1beta1.PodGroupTemplate map: fields: - name: disruptionMode type: - scalar: string + namedType: io.k8s.api.scheduling.v1beta1.DisruptionMode - name: name type: scalar: string default: "" + - name: preemptionPolicy + type: + scalar: string - name: priority type: scalar: numeric @@ -14871,35 +16413,75 @@ var schemaYAML = typed.YAMLObject(`types: type: list: elementType: - namedType: io.k8s.api.scheduling.v1alpha2.PodGroupResourceClaim + namedType: io.k8s.api.scheduling.v1beta1.PodGroupResourceClaim elementRelationship: associative keys: - name - name: schedulingConstraints type: - namedType: io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingConstraints + namedType: io.k8s.api.scheduling.v1beta1.PodGroupSchedulingConstraints - name: schedulingPolicy type: - namedType: io.k8s.api.scheduling.v1alpha2.PodGroupSchedulingPolicy + namedType: io.k8s.api.scheduling.v1beta1.PodGroupSchedulingPolicy default: {} -- name: io.k8s.api.scheduling.v1alpha2.PodGroupTemplateReference +- name: io.k8s.api.scheduling.v1beta1.PriorityClass map: fields: - - name: workload + - name: apiVersion type: - namedType: io.k8s.api.scheduling.v1alpha2.WorkloadPodGroupTemplateReference - unions: - - fields: - - fieldName: workload - discriminatorValue: Workload -- name: io.k8s.api.scheduling.v1alpha2.TopologyConstraint + scalar: string + - name: description + type: + scalar: string + - name: globalDefault + type: + scalar: boolean + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: preemptionPolicy + type: + scalar: string + - name: value + type: + scalar: numeric + default: 0 +- name: io.k8s.api.scheduling.v1beta1.SingleCompositeDisruptionMode + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1beta1.SingleDisruptionMode + map: + elementType: + scalar: untyped + list: + elementType: + namedType: __untyped_atomic_ + elementRelationship: atomic + map: + elementType: + namedType: __untyped_deduced_ + elementRelationship: separable +- name: io.k8s.api.scheduling.v1beta1.TopologyConstraint map: fields: - name: key type: scalar: string default: "" -- name: io.k8s.api.scheduling.v1alpha2.TypedLocalObjectReference +- name: io.k8s.api.scheduling.v1beta1.TypedLocalObjectReference map: fields: - name: apiGroup @@ -14913,7 +16495,7 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" -- name: io.k8s.api.scheduling.v1alpha2.Workload +- name: io.k8s.api.scheduling.v1beta1.Workload map: fields: - name: apiVersion @@ -14928,12 +16510,12 @@ var schemaYAML = typed.YAMLObject(`types: default: {} - name: spec type: - namedType: io.k8s.api.scheduling.v1alpha2.WorkloadSpec + namedType: io.k8s.api.scheduling.v1beta1.WorkloadSpec default: {} -- name: io.k8s.api.scheduling.v1alpha2.WorkloadPodGroupTemplateReference +- name: io.k8s.api.scheduling.v1beta1.WorkloadReference map: fields: - - name: podGroupTemplateName + - name: templateName type: scalar: string default: "" @@ -14941,46 +16523,28 @@ var schemaYAML = typed.YAMLObject(`types: type: scalar: string default: "" -- name: io.k8s.api.scheduling.v1alpha2.WorkloadSpec +- name: io.k8s.api.scheduling.v1beta1.WorkloadSpec map: fields: + - name: compositePodGroupTemplates + type: + list: + elementType: + namedType: io.k8s.api.scheduling.v1beta1.CompositePodGroupTemplate + elementRelationship: associative + keys: + - name - name: controllerRef type: - namedType: io.k8s.api.scheduling.v1alpha2.TypedLocalObjectReference + namedType: io.k8s.api.scheduling.v1beta1.TypedLocalObjectReference - name: podGroupTemplates type: list: elementType: - namedType: io.k8s.api.scheduling.v1alpha2.PodGroupTemplate + namedType: io.k8s.api.scheduling.v1beta1.PodGroupTemplate elementRelationship: associative keys: - name -- name: io.k8s.api.scheduling.v1beta1.PriorityClass - map: - fields: - - name: apiVersion - type: - scalar: string - - name: description - type: - scalar: string - - name: globalDefault - type: - scalar: boolean - - name: kind - type: - scalar: string - - name: metadata - type: - namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta - default: {} - - name: preemptionPolicy - type: - scalar: string - - name: value - type: - scalar: numeric - default: 0 - name: io.k8s.api.storage.v1.CSIDriver map: fields: @@ -15057,6 +16621,10 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: io.k8s.api.storage.v1.CSINodeSpec default: {} + - name: status + type: + namedType: io.k8s.api.storage.v1.CSINodeStatus + default: {} - name: io.k8s.api.storage.v1.CSINodeDriver map: fields: @@ -15088,6 +16656,17 @@ var schemaYAML = typed.YAMLObject(`types: elementRelationship: associative keys: - name +- name: io.k8s.api.storage.v1.CSINodeStatus + map: + fields: + - name: storageHealth + type: + list: + elementType: + namedType: io.k8s.api.storage.v1.StorageHealth + elementRelationship: associative + keys: + - name - name: io.k8s.api.storage.v1.CSIStorageCapacity map: fields: @@ -15157,6 +16736,42 @@ var schemaYAML = typed.YAMLObject(`types: - name: volumeBindingMode type: scalar: string +- name: io.k8s.api.storage.v1.StorageHealth + map: + fields: + - name: healthConditions + type: + list: + elementType: + namedType: io.k8s.api.storage.v1.StorageHealthCondition + elementRelationship: atomic + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.storage.v1.StorageHealthCondition + map: + fields: + - name: accessMode + type: + scalar: string + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + default: "" + - name: status + type: + scalar: string + default: "" + - name: volumeMode + type: + scalar: string - name: io.k8s.api.storage.v1.TokenRequest map: fields: @@ -15469,6 +17084,10 @@ var schemaYAML = typed.YAMLObject(`types: type: namedType: io.k8s.api.storage.v1beta1.CSINodeSpec default: {} + - name: status + type: + namedType: io.k8s.api.storage.v1beta1.CSINodeStatus + default: {} - name: io.k8s.api.storage.v1beta1.CSINodeDriver map: fields: @@ -15500,6 +17119,17 @@ var schemaYAML = typed.YAMLObject(`types: elementRelationship: associative keys: - name +- name: io.k8s.api.storage.v1beta1.CSINodeStatus + map: + fields: + - name: storageHealth + type: + list: + elementType: + namedType: io.k8s.api.storage.v1beta1.StorageHealth + elementRelationship: associative + keys: + - name - name: io.k8s.api.storage.v1beta1.CSIStorageCapacity map: fields: @@ -15569,6 +17199,42 @@ var schemaYAML = typed.YAMLObject(`types: - name: volumeBindingMode type: scalar: string +- name: io.k8s.api.storage.v1beta1.StorageHealth + map: + fields: + - name: healthConditions + type: + list: + elementType: + namedType: io.k8s.api.storage.v1beta1.StorageHealthCondition + elementRelationship: atomic + - name: name + type: + scalar: string + default: "" +- name: io.k8s.api.storage.v1beta1.StorageHealthCondition + map: + fields: + - name: accessMode + type: + scalar: string + - name: lastTransitionTime + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Time + - name: message + type: + scalar: string + - name: reason + type: + scalar: string + default: "" + - name: status + type: + scalar: string + default: "" + - name: volumeMode + type: + scalar: string - name: io.k8s.api.storage.v1beta1.TokenRequest map: fields: @@ -15682,6 +17348,48 @@ var schemaYAML = typed.YAMLObject(`types: - name: count type: scalar: numeric +- name: io.k8s.api.storagemigration.v1.StorageVersionMigration + map: + fields: + - name: apiVersion + type: + scalar: string + - name: kind + type: + scalar: string + - name: metadata + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.ObjectMeta + default: {} + - name: spec + type: + namedType: io.k8s.api.storagemigration.v1.StorageVersionMigrationSpec + default: {} + - name: status + type: + namedType: io.k8s.api.storagemigration.v1.StorageVersionMigrationStatus + default: {} +- name: io.k8s.api.storagemigration.v1.StorageVersionMigrationSpec + map: + fields: + - name: resource + type: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.GroupResource + default: {} +- name: io.k8s.api.storagemigration.v1.StorageVersionMigrationStatus + map: + fields: + - name: conditions + type: + list: + elementType: + namedType: io.k8s.apimachinery.pkg.apis.meta.v1.Condition + elementRelationship: associative + keys: + - type + - name: resourceVersion + type: + scalar: string - name: io.k8s.api.storagemigration.v1beta1.StorageVersionMigration map: fields: diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/scheme/scheme.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/scheme/scheme.go similarity index 100% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/scheme/scheme.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/scheme/scheme.go diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/scheme/typed.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/scheme/typed.go similarity index 100% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/scheme/typed.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/scheme/typed.go diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/uniqueprotomodels.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/uniqueprotomodels.go similarity index 100% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/uniqueprotomodels.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/uniqueprotomodels.go diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/text/text.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/text/text.go similarity index 100% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/text/text.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/text/text.go diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/tracing/api.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/tracing/api.go similarity index 100% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/tracing/api.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/tracing/api.go diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/tracing/logging.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/tracing/logging.go similarity index 100% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/tracing/logging.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/tracing/logging.go diff --git a/vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/tracing/nop.go b/vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/tracing/nop.go similarity index 100% rename from vendor/github.com/argoproj/argo-cd/gitops-engine/pkg/utils/tracing/nop.go rename to vendor/github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/tracing/nop.go diff --git a/vendor/github.com/argoproj/argo-cd/v3/assets/builtin-policy.csv b/vendor/github.com/argoproj/argo-cd/v3/assets/builtin-policy.csv index adc8be17c..fb2b0e712 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/assets/builtin-policy.csv +++ b/vendor/github.com/argoproj/argo-cd/v3/assets/builtin-policy.csv @@ -23,6 +23,7 @@ p, role:admin, applications, update/*, */*, allow p, role:admin, applications, delete, */*, allow p, role:admin, applications, delete/*, */*, allow p, role:admin, applications, sync, */*, allow +p, role:admin, applications, rollback, */*, allow p, role:admin, applications, override, */*, allow p, role:admin, applications, action/*, */*, allow p, role:admin, applicationsets, get, */*, allow diff --git a/vendor/github.com/argoproj/argo-cd/v3/assets/swagger.json b/vendor/github.com/argoproj/argo-cd/v3/assets/swagger.json index 977bd3ed6..9d4c2bb68 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/assets/swagger.json +++ b/vendor/github.com/argoproj/argo-cd/v3/assets/swagger.json @@ -281,6 +281,16 @@ "description": "the project names to restrict returned list applications (legacy name for backwards-compatibility).", "name": "project", "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "description": "the application names to restrict returned list applications (used by the UI favorites filter). An entry may be qualified as 'namespace/name' to match only the application in that namespace.", + "name": "names", + "in": "query" } ], "responses": { @@ -670,6 +680,16 @@ "description": "the project names to restrict returned list applications (legacy name for backwards-compatibility).", "name": "project", "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "description": "the application names to restrict returned list applications (used by the UI favorites filter). An entry may be qualified as 'namespace/name' to match only the application in that namespace.", + "name": "names", + "in": "query" } ], "responses": { @@ -4307,6 +4327,16 @@ "description": "the project names to restrict returned list applications (legacy name for backwards-compatibility).", "name": "project", "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "description": "the application names to restrict returned list applications (used by the UI favorites filter). An entry may be qualified as 'namespace/name' to match only the application in that namespace.", + "name": "names", + "in": "query" } ], "responses": { @@ -5596,6 +5626,9 @@ "clusterConnector": { "type": "object", "properties": { + "id": { + "type": "string" + }, "name": { "type": "string" }, @@ -5612,6 +5645,10 @@ "items": { "$ref": "#/definitions/clusterConnector" } + }, + "dexAuthConnectorID": { + "type": "string", + "title": "dexAuthConnectorID is the connector ID that the login screen should redirect to directly, bypassing the connector selection screen" } } }, @@ -5762,6 +5799,9 @@ "$ref": "#/definitions/v1alpha1ResourceOverride" } }, + "resourceViewEnabled": { + "type": "boolean" + }, "statusBadgeEnabled": { "type": "boolean" }, @@ -5789,6 +5829,9 @@ "uiCssURL": { "type": "string" }, + "uiLoginButtonText": { + "type": "string" + }, "url": { "type": "string" }, @@ -6155,7 +6198,7 @@ "windows": { "type": "array", "items": { - "$ref": "#/definitions/v1alpha1SyncWindow" + "$ref": "#/definitions/v1alpha1InlineSyncWindow" } } } @@ -6461,7 +6504,7 @@ } }, "runtimeRawExtension": { - "description": "RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned\nstruct, and Object in your internal struct. You also need to register your\nvarious plugin types.\n\n// Internal package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.Object `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// External package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\",inline\"`\n\t\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// On the wire, the JSON will look something like this:\n\n\t{\n\t\t\"kind\":\"MyAPIObject\",\n\t\t\"apiVersion\":\"v1\",\n\t\t\"myPlugin\": {\n\t\t\t\"kind\":\"PluginA\",\n\t\t\t\"aOption\":\"foo\",\n\t\t},\n\t}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into\nyour external MyAPIObject. That causes the raw JSON to be stored, but not unpacked.\nThe next step is to copy (using pkg/conversion) into the internal struct. The runtime\npackage's DefaultScheme has conversion functions installed which will unpack the\nJSON stored in RawExtension, turning it into the correct object type, and storing it\nin the Object. (TODO: In the case where the object is of an unknown type, a\nruntime.Unknown object will be created and stored.)\n\n+k8s:deepcopy-gen=true\n+protobuf=true\n+k8s:openapi-gen=true", + "description": "RawExtension is used to hold extensions in external versions.\n\nTo use this, make a field which has RawExtension as its type in your external, versioned\nstruct, and Object in your internal struct. You also need to register your\nvarious plugin types.\n\n// Internal package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\"\"`\n\t\tMyPlugin runtime.Object `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// External package:\n\n\ttype MyAPIObject struct {\n\t\truntime.TypeMeta `json:\"\"`\n\t\tMyPlugin runtime.RawExtension `json:\"myPlugin\"`\n\t}\n\n\ttype PluginA struct {\n\t\tAOption string `json:\"aOption\"`\n\t}\n\n// On the wire, the JSON will look something like this:\n\n\t{\n\t\t\"kind\":\"MyAPIObject\",\n\t\t\"apiVersion\":\"v1\",\n\t\t\"myPlugin\": {\n\t\t\t\"kind\":\"PluginA\",\n\t\t\t\"aOption\":\"foo\",\n\t\t},\n\t}\n\nSo what happens? Decode first uses json or yaml to unmarshal the serialized data into\nyour external MyAPIObject. That causes the raw JSON to be stored, but not unpacked.\nThe next step is to copy (using pkg/conversion) into the internal struct. The runtime\npackage's DefaultScheme has conversion functions installed which will unpack the\nJSON stored in RawExtension, turning it into the correct object type, and storing it\nin the Object. (TODO: In the case where the object is of an unknown type, a\nruntime.Unknown object will be created and stored.)\n\n+k8s:deepcopy-gen=true\n+protobuf=true\n+k8s:openapi-gen=true", "type": "object", "properties": { "raw": { @@ -6687,8 +6730,8 @@ "type": "string" }, "operation": { - "description": "Operation is the type of operation which lead to this ManagedFieldsEntry being created.\nThe only valid values for this field are 'Apply' and 'Update'.", - "type": "string" + "type": "string", + "title": "Operation is the type of operation which lead to this ManagedFieldsEntry being created.\nThe only valid values for this field are 'Apply' and 'Update'.\n+k8s:alpha(since: \"1.37\")=+k8s:required" }, "subresource": { "description": "Subresource is the name of the subresource used to update that object, or\nempty string if the object was updated through the main resource. The\nvalue of this field is used to distinguish between managers, even if they\nshare the same name. For example, a status update will be distinct from a\nregular update using the same manager name.\nNote that the APIVersion field is not related to the Subresource field and\nit always corresponds to the version of the main resource.", @@ -6766,6 +6809,10 @@ "description": "OS Image reported by the node from /etc/os-release (e.g. Debian GNU/Linux 7 (wheezy)).", "type": "string" }, + "runningInUserNamespace": { + "type": "boolean", + "title": "Whether the node is running in a user namespace.\n+featureGate=KubeletInUserNamespace\n+optional" + }, "swap": { "$ref": "#/definitions/v1NodeSwapStatus" }, @@ -6792,7 +6839,7 @@ "deletionGracePeriodSeconds": { "type": "integer", "format": "int64", - "title": "Number of seconds allowed for this object to gracefully terminate before\nit will be removed from the system. Only set when deletionTimestamp is also set.\nMay only be shortened.\nRead-only.\n+optional" + "title": "Number of seconds allowed for this object to gracefully terminate before\nit will be removed from the system. Only set when deletionTimestamp is also set.\nMay only be shortened.\nRead-only.\n+optional\n+k8s:alpha(since: \"1.37\")=+k8s:optional\n+k8s:alpha(since: \"1.37\")=+k8s:immutable" }, "deletionTimestamp": { "$ref": "#/definitions/v1Time" @@ -6811,7 +6858,7 @@ "generation": { "type": "integer", "format": "int64", - "title": "A sequence number representing a specific generation of the desired state.\nPopulated by the system. Read-only.\n+optional" + "title": "A sequence number representing a specific generation of the desired state.\nPopulated by the system. Read-only.\n+optional\n+k8s:alpha(since: \"1.37\")=+k8s:optional\n+k8s:alpha(since: \"1.37\")=+k8s:minimum=0" }, "labels": { "type": "object", @@ -6821,7 +6868,7 @@ } }, "managedFields": { - "description": "ManagedFields maps workflow-id and version to the set of fields\nthat are managed by that workflow. This is mostly for internal\nhousekeeping, and users typically shouldn't need to set or\nunderstand this field. A workflow can be the user's name, a\ncontroller's name, or the name of a specific apply path like\n\"ci-cd\". The set of fields is always in the version that the\nworkflow used when modifying the object.\n\n+optional\n+listType=atomic", + "description": "ManagedFields maps workflow-id and version to the set of fields\nthat are managed by that workflow. This is mostly for internal\nhousekeeping, and users typically shouldn't need to set or\nunderstand this field. A workflow can be the user's name, a\ncontroller's name, or the name of a specific apply path like\n\"ci-cd\". The set of fields is always in the version that the\nworkflow used when modifying the object.\n\n+optional\n+listType=atomic\n+k8s:alpha(since: \"1.37\")=+k8s:optional", "type": "array", "items": { "$ref": "#/definitions/v1ManagedFieldsEntry" @@ -6837,7 +6884,7 @@ }, "ownerReferences": { "type": "array", - "title": "List of objects depended by this object. If ALL objects in the list have\nbeen deleted, this object will be garbage collected. If this object is managed by a controller,\nthen an entry in this list will point to this controller, with the controller field set to true.\nThere cannot be more than one managing controller.\n+optional\n+patchMergeKey=uid\n+patchStrategy=merge\n+listType=map\n+listMapKey=uid", + "title": "List of objects depended by this object. If ALL objects in the list have\nbeen deleted, this object will be garbage collected. If this object is managed by a controller,\nthen an entry in this list will point to this controller, with the controller field set to true.\nThere cannot be more than one managing controller.\n+optional\n+patchMergeKey=uid\n+patchStrategy=merge\n+listType=map\n+listMapKey=uid\n+k8s:alpha(since:\"1.37\")=+k8s:optional", "items": { "$ref": "#/definitions/v1OwnerReference" } @@ -6851,7 +6898,7 @@ "title": "Deprecated: selfLink is a legacy read-only field that is no longer populated by the system.\n+optional" }, "uid": { - "description": "UID is the unique in time and space value for this object. It is typically generated by\nthe server on successful creation of a resource and is not allowed to change on PUT\noperations.\n\nPopulated by the system.\nRead-only.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids\n+optional", + "description": "UID is the unique in time and space value for this object. It is typically generated by\nthe server on successful creation of a resource and is not allowed to change on PUT\noperations.\n\nPopulated by the system.\nRead-only.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids\n+optional\n+k8s:alpha(since: \"1.37\")=+k8s:optional\n+k8s:alpha(since: \"1.37\")=+k8s:immutable", "type": "string" } } @@ -6861,8 +6908,8 @@ "title": "OwnerReference contains enough information to let you identify an owning\nobject. An owning object must be in the same namespace as the dependent, or\nbe cluster-scoped, so there is no namespace field.\n+structType=atomic", "properties": { "apiVersion": { - "description": "API version of the referent.", - "type": "string" + "type": "string", + "title": "API version of the referent.\n+k8s:alpha(since:\"1.37\")=+k8s:required" }, "blockOwnerDeletion": { "type": "boolean", @@ -6874,15 +6921,15 @@ }, "kind": { "type": "string", - "title": "Kind of the referent.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds" + "title": "Kind of the referent.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds\n+k8s:alpha(since:\"1.37\")=+k8s:required" }, "name": { "type": "string", - "title": "Name of the referent.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names" + "title": "Name of the referent.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names\n+k8s:alpha(since:\"1.37\")=+k8s:required" }, "uid": { "type": "string", - "title": "UID of the referent.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids" + "title": "UID of the referent.\nMore info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids\n+k8s:alpha(since:\"1.37\")=+k8s:required" } } }, @@ -6946,7 +6993,6 @@ "$ref": "#/definitions/v1Time" }, "message": { - "description": "Deprecated: this field is not used and will be removed in a future release.", "type": "string", "title": "Message is a human-readable informational message describing the health status" }, @@ -7079,7 +7125,7 @@ "type": "array", "title": "SyncWindows controls when syncs can be run for apps in this project", "items": { - "$ref": "#/definitions/v1alpha1SyncWindow" + "$ref": "#/definitions/v1alpha1InlineSyncWindow" } } } @@ -7311,6 +7357,9 @@ "merge": { "$ref": "#/definitions/v1alpha1MergeGenerator" }, + "oci": { + "$ref": "#/definitions/v1alpha1OciGenerator" + }, "plugin": { "$ref": "#/definitions/v1alpha1PluginGenerator" }, @@ -7362,6 +7411,9 @@ "merge": { "$ref": "#/definitions/v1JSON" }, + "oci": { + "$ref": "#/definitions/v1alpha1OciGenerator" + }, "plugin": { "$ref": "#/definitions/v1alpha1PluginGenerator" }, @@ -7653,6 +7705,10 @@ "type": "object", "title": "ApplicationSourceDirectory holds options for applications of type plain YAML or Jsonnet", "properties": { + "disableExtensionFilter": { + "description": "DisableExtensionFilter controls whether the built-in file-extension filter is skipped during\nmanifest generation. When false (the default), only files with a .yaml, .yml, .json, or\n.jsonnet extension are considered as potential manifests. Set it to true to disable the filter\nso that files with custom extensions (e.g. *.yaml.sealed) can be matched by the include/exclude\nglob patterns instead.", + "type": "boolean" + }, "exclude": { "type": "string", "title": "Exclude contains a glob pattern to match paths against that should be explicitly excluded from being used during manifest generation" @@ -8192,6 +8248,11 @@ "config": { "$ref": "#/definitions/v1alpha1ClusterConfig" }, + "configHash": { + "type": "string", + "format": "uint64", + "title": "ConfigHash is an opaque value which tracks changes to the desired configuration of a Cluster" + }, "connectionState": { "$ref": "#/definitions/v1alpha1ConnectionState" }, @@ -8867,6 +8928,65 @@ } } }, + "v1alpha1InlineSyncWindow": { + "type": "object", + "title": "InlineSyncWindow contains the kind, time, duration and attributes that are used to assign the syncWindows to apps", + "properties": { + "andOperator": { + "type": "boolean", + "title": "UseAndOperator use AND operator for matching applications, namespaces and clusters instead of the default OR operator" + }, + "applications": { + "type": "array", + "title": "Applications contains a list of applications that the window will apply to", + "items": { + "type": "string" + } + }, + "clusters": { + "type": "array", + "title": "Clusters contains a list of clusters that the window will apply to", + "items": { + "type": "string" + } + }, + "description": { + "type": "string", + "title": "Description of the sync that will be applied to the schedule, can be used to add any information such as a ticket number for example" + }, + "duration": { + "type": "string", + "title": "Duration is the amount of time the sync window will be open" + }, + "kind": { + "type": "string", + "title": "Kind defines if the window allows or blocks syncs" + }, + "manualSync": { + "type": "boolean", + "title": "ManualSync enables manual syncs when they would otherwise be blocked" + }, + "namespaces": { + "type": "array", + "title": "Namespaces contains a list of namespaces that the window will apply to", + "items": { + "type": "string" + } + }, + "schedule": { + "type": "string", + "title": "Schedule is the time the window will begin, specified in cron format" + }, + "syncOverrun": { + "type": "boolean", + "title": "SyncOverrun allows ongoing syncs to continue in two scenarios:\nFor deny windows: allows syncs that started before the deny window became active to continue running\nFor allow windows: allows syncs that started during the allow window to continue after the window ends" + }, + "timeZone": { + "type": "string", + "title": "TimeZone of the sync that will be applied to the schedule" + } + } + }, "v1alpha1JWTToken": { "type": "object", "title": "JWTToken holds the issuedAt and expiresAt values of a token", @@ -9138,6 +9258,68 @@ } } }, + "v1alpha1OciDirectoryGeneratorItem": { + "type": "object", + "properties": { + "exclude": { + "type": "boolean" + }, + "path": { + "type": "string" + } + } + }, + "v1alpha1OciFileGeneratorItem": { + "type": "object", + "properties": { + "exclude": { + "type": "boolean" + }, + "path": { + "type": "string" + } + } + }, + "v1alpha1OciGenerator": { + "type": "object", + "properties": { + "directories": { + "type": "array", + "items": { + "$ref": "#/definitions/v1alpha1OciDirectoryGeneratorItem" + } + }, + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/v1alpha1OciFileGeneratorItem" + } + }, + "pathParamPrefix": { + "type": "string" + }, + "repoURL": { + "type": "string" + }, + "requeueAfterSeconds": { + "type": "integer", + "format": "int64" + }, + "revision": { + "type": "string" + }, + "template": { + "$ref": "#/definitions/v1alpha1ApplicationSetTemplate" + }, + "values": { + "type": "object", + "title": "Values contains key/value pairs which are passed directly as parameters to the template", + "additionalProperties": { + "type": "string" + } + } + } + }, "v1alpha1Operation": { "type": "object", "title": "Operation contains information about a requested or running operation", @@ -11021,65 +11203,6 @@ } } }, - "v1alpha1SyncWindow": { - "type": "object", - "title": "SyncWindow contains the kind, time, duration and attributes that are used to assign the syncWindows to apps", - "properties": { - "andOperator": { - "type": "boolean", - "title": "UseAndOperator use AND operator for matching applications, namespaces and clusters instead of the default OR operator" - }, - "applications": { - "type": "array", - "title": "Applications contains a list of applications that the window will apply to", - "items": { - "type": "string" - } - }, - "clusters": { - "type": "array", - "title": "Clusters contains a list of clusters that the window will apply to", - "items": { - "type": "string" - } - }, - "description": { - "type": "string", - "title": "Description of the sync that will be applied to the schedule, can be used to add any information such as a ticket number for example" - }, - "duration": { - "type": "string", - "title": "Duration is the amount of time the sync window will be open" - }, - "kind": { - "type": "string", - "title": "Kind defines if the window allows or blocks syncs" - }, - "manualSync": { - "type": "boolean", - "title": "ManualSync enables manual syncs when they would otherwise be blocked" - }, - "namespaces": { - "type": "array", - "title": "Namespaces contains a list of namespaces that the window will apply to", - "items": { - "type": "string" - } - }, - "schedule": { - "type": "string", - "title": "Schedule is the time the window will begin, specified in cron format" - }, - "syncOverrun": { - "type": "boolean", - "title": "SyncOverrun allows ongoing syncs to continue in two scenarios:\nFor deny windows: allows syncs that started before the deny window became active to continue running\nFor allow windows: allows syncs that started during the allow window to continue after the window ends" - }, - "timeZone": { - "type": "string", - "title": "TimeZone of the sync that will be applied to the schedule" - } - } - }, "v1alpha1TLSClientConfig": { "type": "object", "title": "TLSClientConfig contains settings to enable transport layer security", diff --git a/vendor/github.com/argoproj/argo-cd/v3/common/common.go b/vendor/github.com/argoproj/argo-cd/v3/common/common.go index 4406da6ef..c208eab99 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/common/common.go +++ b/vendor/github.com/argoproj/argo-cd/v3/common/common.go @@ -141,7 +141,7 @@ const ( // SP tokens are valid for 60 minutes, so cache for 59 minutes to avoid issues with token expiration when taking the cleanup interval of 1 minute into account AzureServicePrincipalCredsExpirationDuration = time.Minute * 59 - // PasswordPatten is the default password patten + // PasswordPatten is the default password pattern PasswordPatten = `^.{8,32}$` // LegacyShardingAlgorithm is the default value for Sharding Algorithm it uses an `uid` based distribution (non-uniform) @@ -248,6 +248,14 @@ const ( // Skip reconcile when the value is "true" or any other string values that can be strconv.ParseBool() to be true. AnnotationKeyAppSkipReconcile = "argocd.argoproj.io/skip-reconcile" + // AnnotationKeyIgnoreDifferences allows resources to specify ignore-differences rules as inline YAML. + // The value must be a YAML list, currently only supports jsonPointers key listing RFC6901 JSON Pointer paths. + // Example: + // argocd.argoproj.io/ignore-differences: |- + // jsonPointers: + // - /spec/replicas + AnnotationKeyIgnoreDifferences = "argocd.argoproj.io/ignore-differences" + // LabelKeyComponentRepoServer is the label key to identify the component as repo-server LabelKeyComponentRepoServer = "app.kubernetes.io/component" // LabelValueComponentRepoServer is the label value for the repo-server component diff --git a/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/app_project_types.go b/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/app_project_types.go index 0f2d268a8..0b33c7590 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/app_project_types.go +++ b/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/app_project_types.go @@ -512,11 +512,23 @@ func (proj AppProject) isDestinationMatched(dst ApplicationDestination) bool { dstServerMatched := dst.Server != "" && globMatch(item.Server, dst.Server, true) dstNamespaceMatched := globMatch(item.Namespace, dst.Namespace, true) + // A deny pattern that positively matches the cluster's name or server + // vetoes this entry, even when the entry's other identifier matches. + // Otherwise the allow case below silently overrides the deny. + if dstNamespaceMatched { + if isDenyPattern(item.Name) && dst.Name != "" && glob.Match(item.Name[1:], dst.Name) { + return false + } + if isDenyPattern(item.Server) && dst.Server != "" && glob.Match(item.Server[1:], dst.Server) { + return false + } + } + matched := (dstServerMatched || dstNameMatched) && dstNamespaceMatched switch { case matched: anyDestinationMatched = true - case (!dstNameMatched && isDenyPattern(item.Name)) || (!dstServerMatched && isDenyPattern(item.Server)) && dstNamespaceMatched: + case ((!dstNameMatched && isDenyPattern(item.Name)) || (!dstServerMatched && isDenyPattern(item.Server))) && dstNamespaceMatched: return false case !dstNamespaceMatched && isDenyPattern(item.Namespace) && dstServerMatched: return false diff --git a/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/application_annotations.go b/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/application_annotations.go index ffd6ffa6e..fa2e78602 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/application_annotations.go +++ b/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/application_annotations.go @@ -4,8 +4,15 @@ const ( // AnnotationKeyRefresh is the annotation key which indicates that app needs to be refreshed. Removed by application controller after app is refreshed. // Might take values 'normal'/'hard'. Value 'hard' means manifest cache and target cluster state cache should be invalidated before refresh. AnnotationKeyRefresh string = "argocd.argoproj.io/refresh" + // AnnotationKeyRefreshTimestamp is set to a unique timestamp identifying a specific refresh request. Removed by application controller after app is refreshed. + AnnotationKeyRefreshTimestamp string = "argocd.argoproj.io/refresh-timestamp" + // AnnotationKeyHydrate is the annotation key which indicates that app needs to be hydrated. Removed by application controller after app is hydrated. AnnotationKeyHydrate string = "argocd.argoproj.io/hydrate" + // AnnotationKeyHydrateTimestamp is set to a unique timestamp identifying a specific hydration request. Removed by application controller after + // app is hydrated. + AnnotationKeyHydrateTimestamp string = "argocd.argoproj.io/hydrate-timestamp" + // AnnotationKeyManifestGeneratePaths is an annotation that contains a list of semicolon-separated paths in the // manifests repository that affects the manifest generation. Paths might be either relative or absolute. The // absolute path means an absolute path within the repository and the relative path is relative to the application diff --git a/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/applicationset_types.go b/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/applicationset_types.go index 0dd3c3c27..b6cdc8bdf 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/applicationset_types.go +++ b/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/applicationset_types.go @@ -20,7 +20,7 @@ import ( "encoding/json" "sort" - "github.com/argoproj/argo-cd/gitops-engine/pkg/health" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/intstr" @@ -208,6 +208,8 @@ type ApplicationSetGenerator struct { Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,9,name=selector"` Plugin *PluginGenerator `json:"plugin,omitempty" protobuf:"bytes,10,name=plugin"` + + Oci *OciGenerator `json:"oci,omitempty" protobuf:"bytes,11,name=oci"` } // ApplicationSetNestedGenerator represents a generator nested within a combination-type generator (MatrixGenerator or @@ -230,6 +232,8 @@ type ApplicationSetNestedGenerator struct { Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,9,name=selector"` Plugin *PluginGenerator `json:"plugin,omitempty" protobuf:"bytes,10,name=plugin"` + + Oci *OciGenerator `json:"oci,omitempty" protobuf:"bytes,11,name=oci"` } type ApplicationSetNestedGenerators []ApplicationSetNestedGenerator @@ -249,6 +253,8 @@ type ApplicationSetTerminalGenerator struct { // Selector allows to post-filter all generator. Selector *metav1.LabelSelector `json:"selector,omitempty" protobuf:"bytes,8,name=selector"` + + Oci *OciGenerator `json:"oci,omitempty" protobuf:"bytes,9,name=oci"` } type ApplicationSetTerminalGenerators []ApplicationSetTerminalGenerator @@ -268,6 +274,7 @@ func (g ApplicationSetTerminalGenerators) toApplicationSetNestedGenerators() []A PullRequest: terminalGenerator.PullRequest, Plugin: terminalGenerator.Plugin, Selector: terminalGenerator.Selector, + Oci: terminalGenerator.Oci, } } return nestedGenerators @@ -432,6 +439,29 @@ type GitFileGeneratorItem struct { Exclude bool `json:"exclude,omitempty" protobuf:"bytes,2,name=exclude"` } +type OciGenerator struct { + RepoURL string `json:"repoURL" protobuf:"bytes,1,name=repoURL"` + Directories []OciDirectoryGeneratorItem `json:"directories,omitempty" protobuf:"bytes,2,name=directories"` + Files []OciFileGeneratorItem `json:"files,omitempty" protobuf:"bytes,3,name=files"` + Revision string `json:"revision" protobuf:"bytes,4,name=revision"` + RequeueAfterSeconds *int64 `json:"requeueAfterSeconds,omitempty" protobuf:"bytes,5,name=requeueAfterSeconds"` + Template ApplicationSetTemplate `json:"template,omitempty" protobuf:"bytes,6,name=template"` + PathParamPrefix string `json:"pathParamPrefix,omitempty" protobuf:"bytes,7,name=pathParamPrefix"` + + // Values contains key/value pairs which are passed directly as parameters to the template + Values map[string]string `json:"values,omitempty" protobuf:"bytes,8,name=values"` +} + +type OciDirectoryGeneratorItem struct { + Path string `json:"path" protobuf:"bytes,1,name=path"` + Exclude bool `json:"exclude,omitempty" protobuf:"bytes,2,name=exclude"` +} + +type OciFileGeneratorItem struct { + Path string `json:"path" protobuf:"bytes,1,name=path"` + Exclude bool `json:"exclude,omitempty" protobuf:"bytes,2,name=exclude"` +} + // SCMProviderGenerator defines a generator that scrapes a SCMaaS API to find candidate repos. type SCMProviderGenerator struct { // Which provider to use and config for it. @@ -859,10 +889,11 @@ type ApplicationSetConditionType string // ErrorOccurred / ParametersGenerated / TemplateRendered / ResourcesUpToDate const ( - ApplicationSetConditionErrorOccurred ApplicationSetConditionType = "ErrorOccurred" - ApplicationSetConditionParametersGenerated ApplicationSetConditionType = "ParametersGenerated" - ApplicationSetConditionResourcesUpToDate ApplicationSetConditionType = "ResourcesUpToDate" - ApplicationSetConditionRolloutProgressing ApplicationSetConditionType = "RolloutProgressing" + ApplicationSetConditionErrorOccurred ApplicationSetConditionType = "ErrorOccurred" + ApplicationSetConditionParametersGenerated ApplicationSetConditionType = "ParametersGenerated" + ApplicationSetConditionResourcesUpToDate ApplicationSetConditionType = "ResourcesUpToDate" + ApplicationSetConditionRolloutProgressing ApplicationSetConditionType = "RolloutProgressing" + ApplicationSetConditionInvalidRolloutConfig ApplicationSetConditionType = "InvalidRolloutConfig" ) type ApplicationSetReasonType string @@ -871,7 +902,6 @@ const ( ApplicationSetReasonErrorOccurred = "ErrorOccurred" ApplicationSetReasonApplicationSetUpToDate = "ApplicationSetUpToDate" ApplicationSetReasonParametersGenerated = "ParametersGenerated" - ApplicationSetReasonApplicationGenerated = "ApplicationGeneratedSuccessfully" ApplicationSetReasonUpdateApplicationError = "UpdateApplicationError" ApplicationSetReasonApplicationParamsGenerationError = "ApplicationGenerationFromParamsError" ApplicationSetReasonRenderTemplateParamsError = "RenderTemplateParamsError" @@ -881,7 +911,9 @@ const ( ApplicationSetReasonApplicationValidationError = "ApplicationValidationError" ApplicationSetReasonApplicationSetModified = "ApplicationSetModified" ApplicationSetReasonApplicationSetRolloutComplete = "ApplicationSetRolloutComplete" - ApplicationSetReasonSyncApplicationError = "SyncApplicationError" + ApplicationSetReasonApplicationSetRolloutError = "ApplicationSetRolloutError" + ApplicationSetReasonInvalidRolloutConfig = "ApplicationSetInvalidRolloutConfig" + ApplicationSetReasonValidRolloutConfig = "ApplicationSetValidRolloutConfig" ) // Represents resource health status diff --git a/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/generated.pb.go b/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/generated.pb.go index 3e5295ccc..60ea59eeb 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/generated.pb.go +++ b/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/generated.pb.go @@ -6,8 +6,8 @@ package v1alpha1 import ( fmt "fmt" - github_com_argoproj_argo_cd_gitops_engine_pkg_health "github.com/argoproj/argo-cd/gitops-engine/pkg/health" - github_com_argoproj_argo_cd_gitops_engine_pkg_sync_common "github.com/argoproj/argo-cd/gitops-engine/pkg/sync/common" + github_com_argoproj_argo_cd_gitops_engine_v3_pkg_health "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health" + github_com_argoproj_argo_cd_gitops_engine_v3_pkg_sync_common "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/common" io "io" @@ -2309,10 +2309,38 @@ func (m *InfoItem) XXX_DiscardUnknown() { var xxx_messageInfo_InfoItem proto.InternalMessageInfo +func (m *InlineSyncWindow) Reset() { *m = InlineSyncWindow{} } +func (*InlineSyncWindow) ProtoMessage() {} +func (*InlineSyncWindow) Descriptor() ([]byte, []int) { + return fileDescriptor_c078c3c476799f44, []int{81} +} +func (m *InlineSyncWindow) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *InlineSyncWindow) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *InlineSyncWindow) XXX_Merge(src proto.Message) { + xxx_messageInfo_InlineSyncWindow.Merge(m, src) +} +func (m *InlineSyncWindow) XXX_Size() int { + return m.Size() +} +func (m *InlineSyncWindow) XXX_DiscardUnknown() { + xxx_messageInfo_InlineSyncWindow.DiscardUnknown(m) +} + +var xxx_messageInfo_InlineSyncWindow proto.InternalMessageInfo + func (m *JWTToken) Reset() { *m = JWTToken{} } func (*JWTToken) ProtoMessage() {} func (*JWTToken) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{81} + return fileDescriptor_c078c3c476799f44, []int{82} } func (m *JWTToken) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2340,7 +2368,7 @@ var xxx_messageInfo_JWTToken proto.InternalMessageInfo func (m *JWTTokens) Reset() { *m = JWTTokens{} } func (*JWTTokens) ProtoMessage() {} func (*JWTTokens) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{82} + return fileDescriptor_c078c3c476799f44, []int{83} } func (m *JWTTokens) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2368,7 +2396,7 @@ var xxx_messageInfo_JWTTokens proto.InternalMessageInfo func (m *JsonnetVar) Reset() { *m = JsonnetVar{} } func (*JsonnetVar) ProtoMessage() {} func (*JsonnetVar) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{83} + return fileDescriptor_c078c3c476799f44, []int{84} } func (m *JsonnetVar) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2396,7 +2424,7 @@ var xxx_messageInfo_JsonnetVar proto.InternalMessageInfo func (m *KnownTypeField) Reset() { *m = KnownTypeField{} } func (*KnownTypeField) ProtoMessage() {} func (*KnownTypeField) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{84} + return fileDescriptor_c078c3c476799f44, []int{85} } func (m *KnownTypeField) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2424,7 +2452,7 @@ var xxx_messageInfo_KnownTypeField proto.InternalMessageInfo func (m *KustomizeGvk) Reset() { *m = KustomizeGvk{} } func (*KustomizeGvk) ProtoMessage() {} func (*KustomizeGvk) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{85} + return fileDescriptor_c078c3c476799f44, []int{86} } func (m *KustomizeGvk) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2452,7 +2480,7 @@ var xxx_messageInfo_KustomizeGvk proto.InternalMessageInfo func (m *KustomizeOptions) Reset() { *m = KustomizeOptions{} } func (*KustomizeOptions) ProtoMessage() {} func (*KustomizeOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{86} + return fileDescriptor_c078c3c476799f44, []int{87} } func (m *KustomizeOptions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2480,7 +2508,7 @@ var xxx_messageInfo_KustomizeOptions proto.InternalMessageInfo func (m *KustomizePatch) Reset() { *m = KustomizePatch{} } func (*KustomizePatch) ProtoMessage() {} func (*KustomizePatch) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{87} + return fileDescriptor_c078c3c476799f44, []int{88} } func (m *KustomizePatch) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2508,7 +2536,7 @@ var xxx_messageInfo_KustomizePatch proto.InternalMessageInfo func (m *KustomizeReplica) Reset() { *m = KustomizeReplica{} } func (*KustomizeReplica) ProtoMessage() {} func (*KustomizeReplica) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{88} + return fileDescriptor_c078c3c476799f44, []int{89} } func (m *KustomizeReplica) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2536,7 +2564,7 @@ var xxx_messageInfo_KustomizeReplica proto.InternalMessageInfo func (m *KustomizeResId) Reset() { *m = KustomizeResId{} } func (*KustomizeResId) ProtoMessage() {} func (*KustomizeResId) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{89} + return fileDescriptor_c078c3c476799f44, []int{90} } func (m *KustomizeResId) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2564,7 +2592,7 @@ var xxx_messageInfo_KustomizeResId proto.InternalMessageInfo func (m *KustomizeSelector) Reset() { *m = KustomizeSelector{} } func (*KustomizeSelector) ProtoMessage() {} func (*KustomizeSelector) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{90} + return fileDescriptor_c078c3c476799f44, []int{91} } func (m *KustomizeSelector) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2592,7 +2620,7 @@ var xxx_messageInfo_KustomizeSelector proto.InternalMessageInfo func (m *KustomizeVersion) Reset() { *m = KustomizeVersion{} } func (*KustomizeVersion) ProtoMessage() {} func (*KustomizeVersion) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{91} + return fileDescriptor_c078c3c476799f44, []int{92} } func (m *KustomizeVersion) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2620,7 +2648,7 @@ var xxx_messageInfo_KustomizeVersion proto.InternalMessageInfo func (m *ListGenerator) Reset() { *m = ListGenerator{} } func (*ListGenerator) ProtoMessage() {} func (*ListGenerator) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{92} + return fileDescriptor_c078c3c476799f44, []int{93} } func (m *ListGenerator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2648,7 +2676,7 @@ var xxx_messageInfo_ListGenerator proto.InternalMessageInfo func (m *ManagedNamespaceMetadata) Reset() { *m = ManagedNamespaceMetadata{} } func (*ManagedNamespaceMetadata) ProtoMessage() {} func (*ManagedNamespaceMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{93} + return fileDescriptor_c078c3c476799f44, []int{94} } func (m *ManagedNamespaceMetadata) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2676,7 +2704,7 @@ var xxx_messageInfo_ManagedNamespaceMetadata proto.InternalMessageInfo func (m *MatrixGenerator) Reset() { *m = MatrixGenerator{} } func (*MatrixGenerator) ProtoMessage() {} func (*MatrixGenerator) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{94} + return fileDescriptor_c078c3c476799f44, []int{95} } func (m *MatrixGenerator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2704,7 +2732,7 @@ var xxx_messageInfo_MatrixGenerator proto.InternalMessageInfo func (m *MergeGenerator) Reset() { *m = MergeGenerator{} } func (*MergeGenerator) ProtoMessage() {} func (*MergeGenerator) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{95} + return fileDescriptor_c078c3c476799f44, []int{96} } func (m *MergeGenerator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2732,7 +2760,7 @@ var xxx_messageInfo_MergeGenerator proto.InternalMessageInfo func (m *NestedMatrixGenerator) Reset() { *m = NestedMatrixGenerator{} } func (*NestedMatrixGenerator) ProtoMessage() {} func (*NestedMatrixGenerator) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{96} + return fileDescriptor_c078c3c476799f44, []int{97} } func (m *NestedMatrixGenerator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2760,7 +2788,7 @@ var xxx_messageInfo_NestedMatrixGenerator proto.InternalMessageInfo func (m *NestedMergeGenerator) Reset() { *m = NestedMergeGenerator{} } func (*NestedMergeGenerator) ProtoMessage() {} func (*NestedMergeGenerator) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{97} + return fileDescriptor_c078c3c476799f44, []int{98} } func (m *NestedMergeGenerator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2788,7 +2816,7 @@ var xxx_messageInfo_NestedMergeGenerator proto.InternalMessageInfo func (m *OCIMetadata) Reset() { *m = OCIMetadata{} } func (*OCIMetadata) ProtoMessage() {} func (*OCIMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{98} + return fileDescriptor_c078c3c476799f44, []int{99} } func (m *OCIMetadata) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2813,10 +2841,94 @@ func (m *OCIMetadata) XXX_DiscardUnknown() { var xxx_messageInfo_OCIMetadata proto.InternalMessageInfo +func (m *OciDirectoryGeneratorItem) Reset() { *m = OciDirectoryGeneratorItem{} } +func (*OciDirectoryGeneratorItem) ProtoMessage() {} +func (*OciDirectoryGeneratorItem) Descriptor() ([]byte, []int) { + return fileDescriptor_c078c3c476799f44, []int{100} +} +func (m *OciDirectoryGeneratorItem) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OciDirectoryGeneratorItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *OciDirectoryGeneratorItem) XXX_Merge(src proto.Message) { + xxx_messageInfo_OciDirectoryGeneratorItem.Merge(m, src) +} +func (m *OciDirectoryGeneratorItem) XXX_Size() int { + return m.Size() +} +func (m *OciDirectoryGeneratorItem) XXX_DiscardUnknown() { + xxx_messageInfo_OciDirectoryGeneratorItem.DiscardUnknown(m) +} + +var xxx_messageInfo_OciDirectoryGeneratorItem proto.InternalMessageInfo + +func (m *OciFileGeneratorItem) Reset() { *m = OciFileGeneratorItem{} } +func (*OciFileGeneratorItem) ProtoMessage() {} +func (*OciFileGeneratorItem) Descriptor() ([]byte, []int) { + return fileDescriptor_c078c3c476799f44, []int{101} +} +func (m *OciFileGeneratorItem) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OciFileGeneratorItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *OciFileGeneratorItem) XXX_Merge(src proto.Message) { + xxx_messageInfo_OciFileGeneratorItem.Merge(m, src) +} +func (m *OciFileGeneratorItem) XXX_Size() int { + return m.Size() +} +func (m *OciFileGeneratorItem) XXX_DiscardUnknown() { + xxx_messageInfo_OciFileGeneratorItem.DiscardUnknown(m) +} + +var xxx_messageInfo_OciFileGeneratorItem proto.InternalMessageInfo + +func (m *OciGenerator) Reset() { *m = OciGenerator{} } +func (*OciGenerator) ProtoMessage() {} +func (*OciGenerator) Descriptor() ([]byte, []int) { + return fileDescriptor_c078c3c476799f44, []int{102} +} +func (m *OciGenerator) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *OciGenerator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil +} +func (m *OciGenerator) XXX_Merge(src proto.Message) { + xxx_messageInfo_OciGenerator.Merge(m, src) +} +func (m *OciGenerator) XXX_Size() int { + return m.Size() +} +func (m *OciGenerator) XXX_DiscardUnknown() { + xxx_messageInfo_OciGenerator.DiscardUnknown(m) +} + +var xxx_messageInfo_OciGenerator proto.InternalMessageInfo + func (m *Operation) Reset() { *m = Operation{} } func (*Operation) ProtoMessage() {} func (*Operation) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{99} + return fileDescriptor_c078c3c476799f44, []int{103} } func (m *Operation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2844,7 +2956,7 @@ var xxx_messageInfo_Operation proto.InternalMessageInfo func (m *OperationInitiator) Reset() { *m = OperationInitiator{} } func (*OperationInitiator) ProtoMessage() {} func (*OperationInitiator) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{100} + return fileDescriptor_c078c3c476799f44, []int{104} } func (m *OperationInitiator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2872,7 +2984,7 @@ var xxx_messageInfo_OperationInitiator proto.InternalMessageInfo func (m *OperationState) Reset() { *m = OperationState{} } func (*OperationState) ProtoMessage() {} func (*OperationState) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{101} + return fileDescriptor_c078c3c476799f44, []int{105} } func (m *OperationState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2900,7 +3012,7 @@ var xxx_messageInfo_OperationState proto.InternalMessageInfo func (m *OptionalArray) Reset() { *m = OptionalArray{} } func (*OptionalArray) ProtoMessage() {} func (*OptionalArray) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{102} + return fileDescriptor_c078c3c476799f44, []int{106} } func (m *OptionalArray) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2928,7 +3040,7 @@ var xxx_messageInfo_OptionalArray proto.InternalMessageInfo func (m *OptionalMap) Reset() { *m = OptionalMap{} } func (*OptionalMap) ProtoMessage() {} func (*OptionalMap) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{103} + return fileDescriptor_c078c3c476799f44, []int{107} } func (m *OptionalMap) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2956,7 +3068,7 @@ var xxx_messageInfo_OptionalMap proto.InternalMessageInfo func (m *OrphanedResourceKey) Reset() { *m = OrphanedResourceKey{} } func (*OrphanedResourceKey) ProtoMessage() {} func (*OrphanedResourceKey) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{104} + return fileDescriptor_c078c3c476799f44, []int{108} } func (m *OrphanedResourceKey) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2984,7 +3096,7 @@ var xxx_messageInfo_OrphanedResourceKey proto.InternalMessageInfo func (m *OrphanedResourcesMonitorSettings) Reset() { *m = OrphanedResourcesMonitorSettings{} } func (*OrphanedResourcesMonitorSettings) ProtoMessage() {} func (*OrphanedResourcesMonitorSettings) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{105} + return fileDescriptor_c078c3c476799f44, []int{109} } func (m *OrphanedResourcesMonitorSettings) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3012,7 +3124,7 @@ var xxx_messageInfo_OrphanedResourcesMonitorSettings proto.InternalMessageInfo func (m *OverrideIgnoreDiff) Reset() { *m = OverrideIgnoreDiff{} } func (*OverrideIgnoreDiff) ProtoMessage() {} func (*OverrideIgnoreDiff) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{106} + return fileDescriptor_c078c3c476799f44, []int{110} } func (m *OverrideIgnoreDiff) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3040,7 +3152,7 @@ var xxx_messageInfo_OverrideIgnoreDiff proto.InternalMessageInfo func (m *PluginConfigMapRef) Reset() { *m = PluginConfigMapRef{} } func (*PluginConfigMapRef) ProtoMessage() {} func (*PluginConfigMapRef) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{107} + return fileDescriptor_c078c3c476799f44, []int{111} } func (m *PluginConfigMapRef) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3068,7 +3180,7 @@ var xxx_messageInfo_PluginConfigMapRef proto.InternalMessageInfo func (m *PluginGenerator) Reset() { *m = PluginGenerator{} } func (*PluginGenerator) ProtoMessage() {} func (*PluginGenerator) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{108} + return fileDescriptor_c078c3c476799f44, []int{112} } func (m *PluginGenerator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3096,7 +3208,7 @@ var xxx_messageInfo_PluginGenerator proto.InternalMessageInfo func (m *PluginInput) Reset() { *m = PluginInput{} } func (*PluginInput) ProtoMessage() {} func (*PluginInput) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{109} + return fileDescriptor_c078c3c476799f44, []int{113} } func (m *PluginInput) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3124,7 +3236,7 @@ var xxx_messageInfo_PluginInput proto.InternalMessageInfo func (m *ProjectRole) Reset() { *m = ProjectRole{} } func (*ProjectRole) ProtoMessage() {} func (*ProjectRole) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{110} + return fileDescriptor_c078c3c476799f44, []int{114} } func (m *ProjectRole) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3152,7 +3264,7 @@ var xxx_messageInfo_ProjectRole proto.InternalMessageInfo func (m *PullRequestGenerator) Reset() { *m = PullRequestGenerator{} } func (*PullRequestGenerator) ProtoMessage() {} func (*PullRequestGenerator) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{111} + return fileDescriptor_c078c3c476799f44, []int{115} } func (m *PullRequestGenerator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3180,7 +3292,7 @@ var xxx_messageInfo_PullRequestGenerator proto.InternalMessageInfo func (m *PullRequestGeneratorAzureDevOps) Reset() { *m = PullRequestGeneratorAzureDevOps{} } func (*PullRequestGeneratorAzureDevOps) ProtoMessage() {} func (*PullRequestGeneratorAzureDevOps) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{112} + return fileDescriptor_c078c3c476799f44, []int{116} } func (m *PullRequestGeneratorAzureDevOps) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3208,7 +3320,7 @@ var xxx_messageInfo_PullRequestGeneratorAzureDevOps proto.InternalMessageInfo func (m *PullRequestGeneratorBitbucket) Reset() { *m = PullRequestGeneratorBitbucket{} } func (*PullRequestGeneratorBitbucket) ProtoMessage() {} func (*PullRequestGeneratorBitbucket) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{113} + return fileDescriptor_c078c3c476799f44, []int{117} } func (m *PullRequestGeneratorBitbucket) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3236,7 +3348,7 @@ var xxx_messageInfo_PullRequestGeneratorBitbucket proto.InternalMessageInfo func (m *PullRequestGeneratorBitbucketServer) Reset() { *m = PullRequestGeneratorBitbucketServer{} } func (*PullRequestGeneratorBitbucketServer) ProtoMessage() {} func (*PullRequestGeneratorBitbucketServer) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{114} + return fileDescriptor_c078c3c476799f44, []int{118} } func (m *PullRequestGeneratorBitbucketServer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3264,7 +3376,7 @@ var xxx_messageInfo_PullRequestGeneratorBitbucketServer proto.InternalMessageInf func (m *PullRequestGeneratorFilter) Reset() { *m = PullRequestGeneratorFilter{} } func (*PullRequestGeneratorFilter) ProtoMessage() {} func (*PullRequestGeneratorFilter) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{115} + return fileDescriptor_c078c3c476799f44, []int{119} } func (m *PullRequestGeneratorFilter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3292,7 +3404,7 @@ var xxx_messageInfo_PullRequestGeneratorFilter proto.InternalMessageInfo func (m *PullRequestGeneratorGitLab) Reset() { *m = PullRequestGeneratorGitLab{} } func (*PullRequestGeneratorGitLab) ProtoMessage() {} func (*PullRequestGeneratorGitLab) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{116} + return fileDescriptor_c078c3c476799f44, []int{120} } func (m *PullRequestGeneratorGitLab) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3320,7 +3432,7 @@ var xxx_messageInfo_PullRequestGeneratorGitLab proto.InternalMessageInfo func (m *PullRequestGeneratorGitea) Reset() { *m = PullRequestGeneratorGitea{} } func (*PullRequestGeneratorGitea) ProtoMessage() {} func (*PullRequestGeneratorGitea) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{117} + return fileDescriptor_c078c3c476799f44, []int{121} } func (m *PullRequestGeneratorGitea) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3348,7 +3460,7 @@ var xxx_messageInfo_PullRequestGeneratorGitea proto.InternalMessageInfo func (m *PullRequestGeneratorGithub) Reset() { *m = PullRequestGeneratorGithub{} } func (*PullRequestGeneratorGithub) ProtoMessage() {} func (*PullRequestGeneratorGithub) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{118} + return fileDescriptor_c078c3c476799f44, []int{122} } func (m *PullRequestGeneratorGithub) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3376,7 +3488,7 @@ var xxx_messageInfo_PullRequestGeneratorGithub proto.InternalMessageInfo func (m *RefTarget) Reset() { *m = RefTarget{} } func (*RefTarget) ProtoMessage() {} func (*RefTarget) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{119} + return fileDescriptor_c078c3c476799f44, []int{123} } func (m *RefTarget) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3404,7 +3516,7 @@ var xxx_messageInfo_RefTarget proto.InternalMessageInfo func (m *RepoCreds) Reset() { *m = RepoCreds{} } func (*RepoCreds) ProtoMessage() {} func (*RepoCreds) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{120} + return fileDescriptor_c078c3c476799f44, []int{124} } func (m *RepoCreds) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3432,7 +3544,7 @@ var xxx_messageInfo_RepoCreds proto.InternalMessageInfo func (m *RepoCredsList) Reset() { *m = RepoCredsList{} } func (*RepoCredsList) ProtoMessage() {} func (*RepoCredsList) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{121} + return fileDescriptor_c078c3c476799f44, []int{125} } func (m *RepoCredsList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3460,7 +3572,7 @@ var xxx_messageInfo_RepoCredsList proto.InternalMessageInfo func (m *Repository) Reset() { *m = Repository{} } func (*Repository) ProtoMessage() {} func (*Repository) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{122} + return fileDescriptor_c078c3c476799f44, []int{126} } func (m *Repository) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3488,7 +3600,7 @@ var xxx_messageInfo_Repository proto.InternalMessageInfo func (m *RepositoryCertificate) Reset() { *m = RepositoryCertificate{} } func (*RepositoryCertificate) ProtoMessage() {} func (*RepositoryCertificate) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{123} + return fileDescriptor_c078c3c476799f44, []int{127} } func (m *RepositoryCertificate) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3516,7 +3628,7 @@ var xxx_messageInfo_RepositoryCertificate proto.InternalMessageInfo func (m *RepositoryCertificateList) Reset() { *m = RepositoryCertificateList{} } func (*RepositoryCertificateList) ProtoMessage() {} func (*RepositoryCertificateList) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{124} + return fileDescriptor_c078c3c476799f44, []int{128} } func (m *RepositoryCertificateList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3544,7 +3656,7 @@ var xxx_messageInfo_RepositoryCertificateList proto.InternalMessageInfo func (m *RepositoryList) Reset() { *m = RepositoryList{} } func (*RepositoryList) ProtoMessage() {} func (*RepositoryList) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{125} + return fileDescriptor_c078c3c476799f44, []int{129} } func (m *RepositoryList) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3572,7 +3684,7 @@ var xxx_messageInfo_RepositoryList proto.InternalMessageInfo func (m *ResourceAction) Reset() { *m = ResourceAction{} } func (*ResourceAction) ProtoMessage() {} func (*ResourceAction) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{126} + return fileDescriptor_c078c3c476799f44, []int{130} } func (m *ResourceAction) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3600,7 +3712,7 @@ var xxx_messageInfo_ResourceAction proto.InternalMessageInfo func (m *ResourceActionDefinition) Reset() { *m = ResourceActionDefinition{} } func (*ResourceActionDefinition) ProtoMessage() {} func (*ResourceActionDefinition) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{127} + return fileDescriptor_c078c3c476799f44, []int{131} } func (m *ResourceActionDefinition) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3628,7 +3740,7 @@ var xxx_messageInfo_ResourceActionDefinition proto.InternalMessageInfo func (m *ResourceActionParam) Reset() { *m = ResourceActionParam{} } func (*ResourceActionParam) ProtoMessage() {} func (*ResourceActionParam) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{128} + return fileDescriptor_c078c3c476799f44, []int{132} } func (m *ResourceActionParam) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3656,7 +3768,7 @@ var xxx_messageInfo_ResourceActionParam proto.InternalMessageInfo func (m *ResourceActions) Reset() { *m = ResourceActions{} } func (*ResourceActions) ProtoMessage() {} func (*ResourceActions) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{129} + return fileDescriptor_c078c3c476799f44, []int{133} } func (m *ResourceActions) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3684,7 +3796,7 @@ var xxx_messageInfo_ResourceActions proto.InternalMessageInfo func (m *ResourceDiff) Reset() { *m = ResourceDiff{} } func (*ResourceDiff) ProtoMessage() {} func (*ResourceDiff) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{130} + return fileDescriptor_c078c3c476799f44, []int{134} } func (m *ResourceDiff) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3712,7 +3824,7 @@ var xxx_messageInfo_ResourceDiff proto.InternalMessageInfo func (m *ResourceIgnoreDifferences) Reset() { *m = ResourceIgnoreDifferences{} } func (*ResourceIgnoreDifferences) ProtoMessage() {} func (*ResourceIgnoreDifferences) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{131} + return fileDescriptor_c078c3c476799f44, []int{135} } func (m *ResourceIgnoreDifferences) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3740,7 +3852,7 @@ var xxx_messageInfo_ResourceIgnoreDifferences proto.InternalMessageInfo func (m *ResourceNetworkingInfo) Reset() { *m = ResourceNetworkingInfo{} } func (*ResourceNetworkingInfo) ProtoMessage() {} func (*ResourceNetworkingInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{132} + return fileDescriptor_c078c3c476799f44, []int{136} } func (m *ResourceNetworkingInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3768,7 +3880,7 @@ var xxx_messageInfo_ResourceNetworkingInfo proto.InternalMessageInfo func (m *ResourceNode) Reset() { *m = ResourceNode{} } func (*ResourceNode) ProtoMessage() {} func (*ResourceNode) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{133} + return fileDescriptor_c078c3c476799f44, []int{137} } func (m *ResourceNode) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3796,7 +3908,7 @@ var xxx_messageInfo_ResourceNode proto.InternalMessageInfo func (m *ResourceOverride) Reset() { *m = ResourceOverride{} } func (*ResourceOverride) ProtoMessage() {} func (*ResourceOverride) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{134} + return fileDescriptor_c078c3c476799f44, []int{138} } func (m *ResourceOverride) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3824,7 +3936,7 @@ var xxx_messageInfo_ResourceOverride proto.InternalMessageInfo func (m *ResourceRef) Reset() { *m = ResourceRef{} } func (*ResourceRef) ProtoMessage() {} func (*ResourceRef) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{135} + return fileDescriptor_c078c3c476799f44, []int{139} } func (m *ResourceRef) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3852,7 +3964,7 @@ var xxx_messageInfo_ResourceRef proto.InternalMessageInfo func (m *ResourceResult) Reset() { *m = ResourceResult{} } func (*ResourceResult) ProtoMessage() {} func (*ResourceResult) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{136} + return fileDescriptor_c078c3c476799f44, []int{140} } func (m *ResourceResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3880,7 +3992,7 @@ var xxx_messageInfo_ResourceResult proto.InternalMessageInfo func (m *ResourceStatus) Reset() { *m = ResourceStatus{} } func (*ResourceStatus) ProtoMessage() {} func (*ResourceStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{137} + return fileDescriptor_c078c3c476799f44, []int{141} } func (m *ResourceStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3908,7 +4020,7 @@ var xxx_messageInfo_ResourceStatus proto.InternalMessageInfo func (m *RetryStrategy) Reset() { *m = RetryStrategy{} } func (*RetryStrategy) ProtoMessage() {} func (*RetryStrategy) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{138} + return fileDescriptor_c078c3c476799f44, []int{142} } func (m *RetryStrategy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3936,7 +4048,7 @@ var xxx_messageInfo_RetryStrategy proto.InternalMessageInfo func (m *RevisionHistory) Reset() { *m = RevisionHistory{} } func (*RevisionHistory) ProtoMessage() {} func (*RevisionHistory) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{139} + return fileDescriptor_c078c3c476799f44, []int{143} } func (m *RevisionHistory) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3964,7 +4076,7 @@ var xxx_messageInfo_RevisionHistory proto.InternalMessageInfo func (m *RevisionMetadata) Reset() { *m = RevisionMetadata{} } func (*RevisionMetadata) ProtoMessage() {} func (*RevisionMetadata) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{140} + return fileDescriptor_c078c3c476799f44, []int{144} } func (m *RevisionMetadata) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -3992,7 +4104,7 @@ var xxx_messageInfo_RevisionMetadata proto.InternalMessageInfo func (m *RevisionReference) Reset() { *m = RevisionReference{} } func (*RevisionReference) ProtoMessage() {} func (*RevisionReference) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{141} + return fileDescriptor_c078c3c476799f44, []int{145} } func (m *RevisionReference) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4020,7 +4132,7 @@ var xxx_messageInfo_RevisionReference proto.InternalMessageInfo func (m *SCMProviderGenerator) Reset() { *m = SCMProviderGenerator{} } func (*SCMProviderGenerator) ProtoMessage() {} func (*SCMProviderGenerator) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{142} + return fileDescriptor_c078c3c476799f44, []int{146} } func (m *SCMProviderGenerator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4048,7 +4160,7 @@ var xxx_messageInfo_SCMProviderGenerator proto.InternalMessageInfo func (m *SCMProviderGeneratorAWSCodeCommit) Reset() { *m = SCMProviderGeneratorAWSCodeCommit{} } func (*SCMProviderGeneratorAWSCodeCommit) ProtoMessage() {} func (*SCMProviderGeneratorAWSCodeCommit) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{143} + return fileDescriptor_c078c3c476799f44, []int{147} } func (m *SCMProviderGeneratorAWSCodeCommit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4076,7 +4188,7 @@ var xxx_messageInfo_SCMProviderGeneratorAWSCodeCommit proto.InternalMessageInfo func (m *SCMProviderGeneratorAzureDevOps) Reset() { *m = SCMProviderGeneratorAzureDevOps{} } func (*SCMProviderGeneratorAzureDevOps) ProtoMessage() {} func (*SCMProviderGeneratorAzureDevOps) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{144} + return fileDescriptor_c078c3c476799f44, []int{148} } func (m *SCMProviderGeneratorAzureDevOps) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4104,7 +4216,7 @@ var xxx_messageInfo_SCMProviderGeneratorAzureDevOps proto.InternalMessageInfo func (m *SCMProviderGeneratorBitbucket) Reset() { *m = SCMProviderGeneratorBitbucket{} } func (*SCMProviderGeneratorBitbucket) ProtoMessage() {} func (*SCMProviderGeneratorBitbucket) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{145} + return fileDescriptor_c078c3c476799f44, []int{149} } func (m *SCMProviderGeneratorBitbucket) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4132,7 +4244,7 @@ var xxx_messageInfo_SCMProviderGeneratorBitbucket proto.InternalMessageInfo func (m *SCMProviderGeneratorBitbucketServer) Reset() { *m = SCMProviderGeneratorBitbucketServer{} } func (*SCMProviderGeneratorBitbucketServer) ProtoMessage() {} func (*SCMProviderGeneratorBitbucketServer) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{146} + return fileDescriptor_c078c3c476799f44, []int{150} } func (m *SCMProviderGeneratorBitbucketServer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4160,7 +4272,7 @@ var xxx_messageInfo_SCMProviderGeneratorBitbucketServer proto.InternalMessageInf func (m *SCMProviderGeneratorFilter) Reset() { *m = SCMProviderGeneratorFilter{} } func (*SCMProviderGeneratorFilter) ProtoMessage() {} func (*SCMProviderGeneratorFilter) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{147} + return fileDescriptor_c078c3c476799f44, []int{151} } func (m *SCMProviderGeneratorFilter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4188,7 +4300,7 @@ var xxx_messageInfo_SCMProviderGeneratorFilter proto.InternalMessageInfo func (m *SCMProviderGeneratorGitea) Reset() { *m = SCMProviderGeneratorGitea{} } func (*SCMProviderGeneratorGitea) ProtoMessage() {} func (*SCMProviderGeneratorGitea) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{148} + return fileDescriptor_c078c3c476799f44, []int{152} } func (m *SCMProviderGeneratorGitea) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4216,7 +4328,7 @@ var xxx_messageInfo_SCMProviderGeneratorGitea proto.InternalMessageInfo func (m *SCMProviderGeneratorGithub) Reset() { *m = SCMProviderGeneratorGithub{} } func (*SCMProviderGeneratorGithub) ProtoMessage() {} func (*SCMProviderGeneratorGithub) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{149} + return fileDescriptor_c078c3c476799f44, []int{153} } func (m *SCMProviderGeneratorGithub) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4244,7 +4356,7 @@ var xxx_messageInfo_SCMProviderGeneratorGithub proto.InternalMessageInfo func (m *SCMProviderGeneratorGitlab) Reset() { *m = SCMProviderGeneratorGitlab{} } func (*SCMProviderGeneratorGitlab) ProtoMessage() {} func (*SCMProviderGeneratorGitlab) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{150} + return fileDescriptor_c078c3c476799f44, []int{154} } func (m *SCMProviderGeneratorGitlab) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4272,7 +4384,7 @@ var xxx_messageInfo_SCMProviderGeneratorGitlab proto.InternalMessageInfo func (m *SecretRef) Reset() { *m = SecretRef{} } func (*SecretRef) ProtoMessage() {} func (*SecretRef) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{151} + return fileDescriptor_c078c3c476799f44, []int{155} } func (m *SecretRef) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4300,7 +4412,7 @@ var xxx_messageInfo_SecretRef proto.InternalMessageInfo func (m *SignatureKey) Reset() { *m = SignatureKey{} } func (*SignatureKey) ProtoMessage() {} func (*SignatureKey) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{152} + return fileDescriptor_c078c3c476799f44, []int{156} } func (m *SignatureKey) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4328,7 +4440,7 @@ var xxx_messageInfo_SignatureKey proto.InternalMessageInfo func (m *SourceHydrator) Reset() { *m = SourceHydrator{} } func (*SourceHydrator) ProtoMessage() {} func (*SourceHydrator) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{153} + return fileDescriptor_c078c3c476799f44, []int{157} } func (m *SourceHydrator) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4356,7 +4468,7 @@ var xxx_messageInfo_SourceHydrator proto.InternalMessageInfo func (m *SourceHydratorStatus) Reset() { *m = SourceHydratorStatus{} } func (*SourceHydratorStatus) ProtoMessage() {} func (*SourceHydratorStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{154} + return fileDescriptor_c078c3c476799f44, []int{158} } func (m *SourceHydratorStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4384,7 +4496,7 @@ var xxx_messageInfo_SourceHydratorStatus proto.InternalMessageInfo func (m *SourceIntegrity) Reset() { *m = SourceIntegrity{} } func (*SourceIntegrity) ProtoMessage() {} func (*SourceIntegrity) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{155} + return fileDescriptor_c078c3c476799f44, []int{159} } func (m *SourceIntegrity) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4412,7 +4524,7 @@ var xxx_messageInfo_SourceIntegrity proto.InternalMessageInfo func (m *SourceIntegrityCheckResult) Reset() { *m = SourceIntegrityCheckResult{} } func (*SourceIntegrityCheckResult) ProtoMessage() {} func (*SourceIntegrityCheckResult) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{156} + return fileDescriptor_c078c3c476799f44, []int{160} } func (m *SourceIntegrityCheckResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4440,7 +4552,7 @@ var xxx_messageInfo_SourceIntegrityCheckResult proto.InternalMessageInfo func (m *SourceIntegrityCheckResultItem) Reset() { *m = SourceIntegrityCheckResultItem{} } func (*SourceIntegrityCheckResultItem) ProtoMessage() {} func (*SourceIntegrityCheckResultItem) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{157} + return fileDescriptor_c078c3c476799f44, []int{161} } func (m *SourceIntegrityCheckResultItem) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4468,7 +4580,7 @@ var xxx_messageInfo_SourceIntegrityCheckResultItem proto.InternalMessageInfo func (m *SourceIntegrityGit) Reset() { *m = SourceIntegrityGit{} } func (*SourceIntegrityGit) ProtoMessage() {} func (*SourceIntegrityGit) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{158} + return fileDescriptor_c078c3c476799f44, []int{162} } func (m *SourceIntegrityGit) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4496,7 +4608,7 @@ var xxx_messageInfo_SourceIntegrityGit proto.InternalMessageInfo func (m *SourceIntegrityGitPolicy) Reset() { *m = SourceIntegrityGitPolicy{} } func (*SourceIntegrityGitPolicy) ProtoMessage() {} func (*SourceIntegrityGitPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{159} + return fileDescriptor_c078c3c476799f44, []int{163} } func (m *SourceIntegrityGitPolicy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4524,7 +4636,7 @@ var xxx_messageInfo_SourceIntegrityGitPolicy proto.InternalMessageInfo func (m *SourceIntegrityGitPolicyGPG) Reset() { *m = SourceIntegrityGitPolicyGPG{} } func (*SourceIntegrityGitPolicyGPG) ProtoMessage() {} func (*SourceIntegrityGitPolicyGPG) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{160} + return fileDescriptor_c078c3c476799f44, []int{164} } func (m *SourceIntegrityGitPolicyGPG) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4552,7 +4664,7 @@ var xxx_messageInfo_SourceIntegrityGitPolicyGPG proto.InternalMessageInfo func (m *SourceIntegrityGitPolicyRepo) Reset() { *m = SourceIntegrityGitPolicyRepo{} } func (*SourceIntegrityGitPolicyRepo) ProtoMessage() {} func (*SourceIntegrityGitPolicyRepo) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{161} + return fileDescriptor_c078c3c476799f44, []int{165} } func (m *SourceIntegrityGitPolicyRepo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4580,7 +4692,7 @@ var xxx_messageInfo_SourceIntegrityGitPolicyRepo proto.InternalMessageInfo func (m *SuccessfulHydrateOperation) Reset() { *m = SuccessfulHydrateOperation{} } func (*SuccessfulHydrateOperation) ProtoMessage() {} func (*SuccessfulHydrateOperation) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{162} + return fileDescriptor_c078c3c476799f44, []int{166} } func (m *SuccessfulHydrateOperation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4608,7 +4720,7 @@ var xxx_messageInfo_SuccessfulHydrateOperation proto.InternalMessageInfo func (m *SyncOperation) Reset() { *m = SyncOperation{} } func (*SyncOperation) ProtoMessage() {} func (*SyncOperation) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{163} + return fileDescriptor_c078c3c476799f44, []int{167} } func (m *SyncOperation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4636,7 +4748,7 @@ var xxx_messageInfo_SyncOperation proto.InternalMessageInfo func (m *SyncOperationResource) Reset() { *m = SyncOperationResource{} } func (*SyncOperationResource) ProtoMessage() {} func (*SyncOperationResource) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{164} + return fileDescriptor_c078c3c476799f44, []int{168} } func (m *SyncOperationResource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4664,7 +4776,7 @@ var xxx_messageInfo_SyncOperationResource proto.InternalMessageInfo func (m *SyncOperationResult) Reset() { *m = SyncOperationResult{} } func (*SyncOperationResult) ProtoMessage() {} func (*SyncOperationResult) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{165} + return fileDescriptor_c078c3c476799f44, []int{169} } func (m *SyncOperationResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4692,7 +4804,7 @@ var xxx_messageInfo_SyncOperationResult proto.InternalMessageInfo func (m *SyncPolicy) Reset() { *m = SyncPolicy{} } func (*SyncPolicy) ProtoMessage() {} func (*SyncPolicy) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{166} + return fileDescriptor_c078c3c476799f44, []int{170} } func (m *SyncPolicy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4720,7 +4832,7 @@ var xxx_messageInfo_SyncPolicy proto.InternalMessageInfo func (m *SyncPolicyAutomated) Reset() { *m = SyncPolicyAutomated{} } func (*SyncPolicyAutomated) ProtoMessage() {} func (*SyncPolicyAutomated) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{167} + return fileDescriptor_c078c3c476799f44, []int{171} } func (m *SyncPolicyAutomated) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4748,7 +4860,7 @@ var xxx_messageInfo_SyncPolicyAutomated proto.InternalMessageInfo func (m *SyncSource) Reset() { *m = SyncSource{} } func (*SyncSource) ProtoMessage() {} func (*SyncSource) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{168} + return fileDescriptor_c078c3c476799f44, []int{172} } func (m *SyncSource) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4776,7 +4888,7 @@ var xxx_messageInfo_SyncSource proto.InternalMessageInfo func (m *SyncStatus) Reset() { *m = SyncStatus{} } func (*SyncStatus) ProtoMessage() {} func (*SyncStatus) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{169} + return fileDescriptor_c078c3c476799f44, []int{173} } func (m *SyncStatus) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4804,7 +4916,7 @@ var xxx_messageInfo_SyncStatus proto.InternalMessageInfo func (m *SyncStrategy) Reset() { *m = SyncStrategy{} } func (*SyncStrategy) ProtoMessage() {} func (*SyncStrategy) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{170} + return fileDescriptor_c078c3c476799f44, []int{174} } func (m *SyncStrategy) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4832,7 +4944,7 @@ var xxx_messageInfo_SyncStrategy proto.InternalMessageInfo func (m *SyncStrategyApply) Reset() { *m = SyncStrategyApply{} } func (*SyncStrategyApply) ProtoMessage() {} func (*SyncStrategyApply) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{171} + return fileDescriptor_c078c3c476799f44, []int{175} } func (m *SyncStrategyApply) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4860,7 +4972,7 @@ var xxx_messageInfo_SyncStrategyApply proto.InternalMessageInfo func (m *SyncStrategyHook) Reset() { *m = SyncStrategyHook{} } func (*SyncStrategyHook) ProtoMessage() {} func (*SyncStrategyHook) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{172} + return fileDescriptor_c078c3c476799f44, []int{176} } func (m *SyncStrategyHook) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4885,38 +4997,10 @@ func (m *SyncStrategyHook) XXX_DiscardUnknown() { var xxx_messageInfo_SyncStrategyHook proto.InternalMessageInfo -func (m *SyncWindow) Reset() { *m = SyncWindow{} } -func (*SyncWindow) ProtoMessage() {} -func (*SyncWindow) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{173} -} -func (m *SyncWindow) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *SyncWindow) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil -} -func (m *SyncWindow) XXX_Merge(src proto.Message) { - xxx_messageInfo_SyncWindow.Merge(m, src) -} -func (m *SyncWindow) XXX_Size() int { - return m.Size() -} -func (m *SyncWindow) XXX_DiscardUnknown() { - xxx_messageInfo_SyncWindow.DiscardUnknown(m) -} - -var xxx_messageInfo_SyncWindow proto.InternalMessageInfo - func (m *TLSClientConfig) Reset() { *m = TLSClientConfig{} } func (*TLSClientConfig) ProtoMessage() {} func (*TLSClientConfig) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{174} + return fileDescriptor_c078c3c476799f44, []int{177} } func (m *TLSClientConfig) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -4944,7 +5028,7 @@ var xxx_messageInfo_TLSClientConfig proto.InternalMessageInfo func (m *TagFilter) Reset() { *m = TagFilter{} } func (*TagFilter) ProtoMessage() {} func (*TagFilter) Descriptor() ([]byte, []int) { - return fileDescriptor_c078c3c476799f44, []int{175} + return fileDescriptor_c078c3c476799f44, []int{178} } func (m *TagFilter) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -5063,6 +5147,7 @@ func init() { proto.RegisterType((*HydrateTo)(nil), "github.com.argoproj.argo_cd.v3.pkg.apis.application.v1alpha1.HydrateTo") proto.RegisterType((*Info)(nil), "github.com.argoproj.argo_cd.v3.pkg.apis.application.v1alpha1.Info") proto.RegisterType((*InfoItem)(nil), "github.com.argoproj.argo_cd.v3.pkg.apis.application.v1alpha1.InfoItem") + proto.RegisterType((*InlineSyncWindow)(nil), "github.com.argoproj.argo_cd.v3.pkg.apis.application.v1alpha1.InlineSyncWindow") proto.RegisterType((*JWTToken)(nil), "github.com.argoproj.argo_cd.v3.pkg.apis.application.v1alpha1.JWTToken") proto.RegisterType((*JWTTokens)(nil), "github.com.argoproj.argo_cd.v3.pkg.apis.application.v1alpha1.JWTTokens") proto.RegisterType((*JsonnetVar)(nil), "github.com.argoproj.argo_cd.v3.pkg.apis.application.v1alpha1.JsonnetVar") @@ -5084,6 +5169,10 @@ func init() { proto.RegisterType((*NestedMatrixGenerator)(nil), "github.com.argoproj.argo_cd.v3.pkg.apis.application.v1alpha1.NestedMatrixGenerator") proto.RegisterType((*NestedMergeGenerator)(nil), "github.com.argoproj.argo_cd.v3.pkg.apis.application.v1alpha1.NestedMergeGenerator") proto.RegisterType((*OCIMetadata)(nil), "github.com.argoproj.argo_cd.v3.pkg.apis.application.v1alpha1.OCIMetadata") + proto.RegisterType((*OciDirectoryGeneratorItem)(nil), "github.com.argoproj.argo_cd.v3.pkg.apis.application.v1alpha1.OciDirectoryGeneratorItem") + proto.RegisterType((*OciFileGeneratorItem)(nil), "github.com.argoproj.argo_cd.v3.pkg.apis.application.v1alpha1.OciFileGeneratorItem") + proto.RegisterType((*OciGenerator)(nil), "github.com.argoproj.argo_cd.v3.pkg.apis.application.v1alpha1.OciGenerator") + proto.RegisterMapType((map[string]string)(nil), "github.com.argoproj.argo_cd.v3.pkg.apis.application.v1alpha1.OciGenerator.ValuesEntry") proto.RegisterType((*Operation)(nil), "github.com.argoproj.argo_cd.v3.pkg.apis.application.v1alpha1.Operation") proto.RegisterType((*OperationInitiator)(nil), "github.com.argoproj.argo_cd.v3.pkg.apis.application.v1alpha1.OperationInitiator") proto.RegisterType((*OperationState)(nil), "github.com.argoproj.argo_cd.v3.pkg.apis.application.v1alpha1.OperationState") @@ -5165,7 +5254,6 @@ func init() { proto.RegisterType((*SyncStrategy)(nil), "github.com.argoproj.argo_cd.v3.pkg.apis.application.v1alpha1.SyncStrategy") proto.RegisterType((*SyncStrategyApply)(nil), "github.com.argoproj.argo_cd.v3.pkg.apis.application.v1alpha1.SyncStrategyApply") proto.RegisterType((*SyncStrategyHook)(nil), "github.com.argoproj.argo_cd.v3.pkg.apis.application.v1alpha1.SyncStrategyHook") - proto.RegisterType((*SyncWindow)(nil), "github.com.argoproj.argo_cd.v3.pkg.apis.application.v1alpha1.SyncWindow") proto.RegisterType((*TLSClientConfig)(nil), "github.com.argoproj.argo_cd.v3.pkg.apis.application.v1alpha1.TLSClientConfig") proto.RegisterType((*TagFilter)(nil), "github.com.argoproj.argo_cd.v3.pkg.apis.application.v1alpha1.TagFilter") } @@ -5175,831 +5263,836 @@ func init() { } var fileDescriptor_c078c3c476799f44 = []byte{ - // 13179 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0xbd, 0x7d, 0x70, 0x64, 0xd9, - 0x55, 0x18, 0xbe, 0xaf, 0x5b, 0x2d, 0x75, 0x1f, 0x7d, 0x8d, 0xee, 0xce, 0xec, 0x6a, 0x66, 0x67, - 0x47, 0xe3, 0xb7, 0x78, 0xbd, 0xfc, 0xbc, 0x96, 0xd8, 0xb1, 0xd7, 0xec, 0x8f, 0x05, 0xf3, 0x53, - 0x4b, 0x33, 0x1a, 0xcd, 0x48, 0x23, 0xf9, 0xb6, 0x66, 0xc6, 0xbb, 0xf6, 0xda, 0x7e, 0xea, 0xbe, - 0x6a, 0xbd, 0xd1, 0xeb, 0xf7, 0x7a, 0xdf, 0x7b, 0xad, 0x99, 0x5e, 0x8c, 0xb1, 0x31, 0x06, 0x1b, - 0x1b, 0xdb, 0xe0, 0x5f, 0xc5, 0x4b, 0x12, 0x3b, 0x26, 0x40, 0x3e, 0x2a, 0x45, 0x20, 0x49, 0x85, - 0x50, 0x01, 0x8a, 0x0a, 0x50, 0x14, 0x54, 0x3e, 0x20, 0x14, 0x01, 0x12, 0x40, 0xb1, 0x27, 0x95, - 0x82, 0xca, 0x1f, 0xa4, 0x48, 0x52, 0xa9, 0xd4, 0x86, 0x50, 0xa9, 0xfb, 0x7d, 0xdf, 0xeb, 0xd7, - 0x52, 0x6b, 0xf4, 0x34, 0x33, 0x86, 0xfd, 0xaf, 0xfb, 0x9e, 0x73, 0xcf, 0xb9, 0xef, 0xbe, 0xfb, - 0xce, 0x39, 0xf7, 0xdc, 0x73, 0xce, 0x85, 0x95, 0xa6, 0x1b, 0x6f, 0x77, 0x36, 0x67, 0xeb, 0x41, - 0x6b, 0xce, 0x09, 0x9b, 0x41, 0x3b, 0x0c, 0x6e, 0xb1, 0x1f, 0xef, 0xa8, 0x37, 0xe6, 0x76, 0xdf, - 0x39, 0xd7, 0xde, 0x69, 0xce, 0x39, 0x6d, 0x37, 0x9a, 0x73, 0xda, 0x6d, 0xcf, 0xad, 0x3b, 0xb1, - 0x1b, 0xf8, 0x73, 0xbb, 0xcf, 0x39, 0x5e, 0x7b, 0xdb, 0x79, 0x6e, 0xae, 0x49, 0x7c, 0x12, 0x3a, - 0x31, 0x69, 0xcc, 0xb6, 0xc3, 0x20, 0x0e, 0xd0, 0xb7, 0x6b, 0x6a, 0xb3, 0x92, 0x1a, 0xfb, 0xf1, - 0xa1, 0x7a, 0x63, 0x76, 0xf7, 0x9d, 0xb3, 0xed, 0x9d, 0xe6, 0x2c, 0xa5, 0x36, 0x6b, 0x50, 0x9b, - 0x95, 0xd4, 0xce, 0xbc, 0xc3, 0x18, 0x4b, 0x33, 0x68, 0x06, 0x73, 0x8c, 0xe8, 0x66, 0x67, 0x8b, - 0xfd, 0x63, 0x7f, 0xd8, 0x2f, 0xce, 0xec, 0x8c, 0xbd, 0xf3, 0x42, 0x34, 0xeb, 0x06, 0x74, 0x78, - 0x73, 0xf5, 0x20, 0x24, 0x73, 0xbb, 0x3d, 0x03, 0x3a, 0x73, 0x59, 0xe3, 0x90, 0x3b, 0x31, 0xf1, - 0x23, 0x37, 0xf0, 0xa3, 0x77, 0xd0, 0x21, 0x90, 0x70, 0x97, 0x84, 0xe6, 0xe3, 0x19, 0x08, 0x59, - 0x94, 0xde, 0xa5, 0x29, 0xb5, 0x9c, 0xfa, 0xb6, 0xeb, 0x93, 0xb0, 0xab, 0xbb, 0xb7, 0x48, 0xec, - 0x64, 0xf5, 0x9a, 0xeb, 0xd7, 0x2b, 0xec, 0xf8, 0xb1, 0xdb, 0x22, 0x3d, 0x1d, 0xde, 0x7d, 0x50, - 0x87, 0xa8, 0xbe, 0x4d, 0x5a, 0x4e, 0x4f, 0xbf, 0x77, 0xf6, 0xeb, 0xd7, 0x89, 0x5d, 0x6f, 0xce, - 0xf5, 0xe3, 0x28, 0x0e, 0xd3, 0x9d, 0xec, 0xbf, 0x69, 0xc1, 0xf8, 0xfc, 0xcd, 0xda, 0x7c, 0x27, - 0xde, 0x5e, 0x08, 0xfc, 0x2d, 0xb7, 0x89, 0x9e, 0x87, 0xd1, 0xba, 0xd7, 0x89, 0x62, 0x12, 0x5e, - 0x73, 0x5a, 0x64, 0xda, 0x3a, 0x6f, 0x3d, 0x53, 0xa9, 0x3e, 0xfa, 0xeb, 0x7b, 0x33, 0x8f, 0xdc, - 0xdd, 0x9b, 0x19, 0x5d, 0xd0, 0x20, 0x6c, 0xe2, 0xa1, 0x6f, 0x86, 0x91, 0x30, 0xf0, 0xc8, 0x3c, - 0xbe, 0x36, 0x5d, 0x60, 0x5d, 0x26, 0x45, 0x97, 0x11, 0xcc, 0x9b, 0xb1, 0x84, 0x53, 0xd4, 0x76, - 0x18, 0x6c, 0xb9, 0x1e, 0x99, 0x2e, 0x26, 0x51, 0xd7, 0x79, 0x33, 0x96, 0x70, 0xfb, 0xc7, 0x0a, - 0x30, 0x39, 0xdf, 0x6e, 0x5f, 0x26, 0x8e, 0x17, 0x6f, 0xd7, 0x62, 0x27, 0xee, 0x44, 0x28, 0x80, - 0xe1, 0x88, 0xfd, 0x12, 0x63, 0xbb, 0x29, 0x7a, 0x0f, 0x73, 0xf8, 0x1b, 0x7b, 0x33, 0x17, 0xf7, - 0x5b, 0xd1, 0x4d, 0x37, 0x0e, 0xda, 0xd1, 0x3b, 0x88, 0xdf, 0x74, 0x7d, 0xc2, 0xe6, 0x67, 0x9b, - 0x51, 0x9f, 0x35, 0x99, 0x2c, 0x04, 0x0d, 0x82, 0x05, 0x1b, 0x3a, 0xde, 0x16, 0x89, 0x22, 0xa7, - 0x49, 0xd2, 0x8f, 0xb6, 0xca, 0x9b, 0xb1, 0x84, 0xa3, 0x10, 0x90, 0xe7, 0x44, 0xf1, 0x46, 0xe8, - 0xf8, 0x91, 0x4b, 0x97, 0xf6, 0x86, 0xdb, 0xe2, 0x4f, 0x39, 0x7a, 0xe1, 0xff, 0x99, 0xe5, 0x2f, - 0x68, 0xd6, 0x7c, 0x41, 0xfa, 0x7b, 0xa0, 0xeb, 0x67, 0x76, 0xf7, 0xb9, 0x59, 0xda, 0xa3, 0xfa, - 0xd8, 0xdd, 0xbd, 0x19, 0xb4, 0xd2, 0x43, 0x09, 0x67, 0x50, 0xb7, 0x7f, 0xb7, 0x00, 0x30, 0xdf, - 0x6e, 0xaf, 0x87, 0xc1, 0x2d, 0x52, 0x8f, 0xd1, 0x87, 0xa1, 0x4c, 0x49, 0x35, 0x9c, 0xd8, 0x61, - 0x13, 0x34, 0x7a, 0xe1, 0x5b, 0x06, 0x63, 0xbc, 0xb6, 0x49, 0xfb, 0xaf, 0x92, 0xd8, 0xa9, 0x22, - 0xf1, 0x80, 0xa0, 0xdb, 0xb0, 0xa2, 0x8a, 0x7c, 0x18, 0x8a, 0xda, 0xa4, 0xce, 0x26, 0x63, 0xf4, - 0xc2, 0xca, 0xec, 0x51, 0xbe, 0xf8, 0x59, 0x3d, 0xf2, 0x5a, 0x9b, 0xd4, 0xab, 0x63, 0x82, 0xf3, - 0x10, 0xfd, 0x87, 0x19, 0x1f, 0xb4, 0xab, 0x5e, 0x38, 0x9f, 0xc8, 0x6b, 0xb9, 0x71, 0x64, 0x54, - 0xab, 0x13, 0xc9, 0x05, 0x24, 0xdf, 0xbb, 0xfd, 0x47, 0x16, 0x4c, 0x68, 0xe4, 0x15, 0x37, 0x8a, - 0xd1, 0x07, 0x7a, 0x26, 0x77, 0x76, 0xb0, 0xc9, 0xa5, 0xbd, 0xd9, 0xd4, 0x9e, 0x10, 0xcc, 0xca, - 0xb2, 0xc5, 0x98, 0xd8, 0x16, 0x94, 0xdc, 0x98, 0xb4, 0xa2, 0xe9, 0xc2, 0xf9, 0xe2, 0x33, 0xa3, - 0x17, 0x2e, 0xe7, 0xf5, 0x9c, 0xd5, 0x71, 0xc1, 0xb4, 0xb4, 0x4c, 0xc9, 0x63, 0xce, 0xc5, 0xfe, - 0x83, 0x49, 0xf3, 0xf9, 0xe8, 0x84, 0xa3, 0xe7, 0x60, 0x34, 0x0a, 0x3a, 0x61, 0x9d, 0x60, 0xd2, - 0x0e, 0xe8, 0x07, 0x56, 0xa4, 0xcb, 0x9d, 0x7e, 0xf8, 0x35, 0xdd, 0x8c, 0x4d, 0x1c, 0xf4, 0x39, - 0x0b, 0xc6, 0x1a, 0x24, 0x8a, 0x5d, 0x9f, 0xf1, 0x97, 0x83, 0xdf, 0x38, 0xf2, 0xe0, 0x65, 0xe3, - 0xa2, 0x26, 0x5e, 0x3d, 0x29, 0x1e, 0x64, 0xcc, 0x68, 0x8c, 0x70, 0x82, 0x3f, 0x15, 0x60, 0x0d, - 0x12, 0xd5, 0x43, 0xb7, 0x4d, 0xff, 0x0b, 0x11, 0xa3, 0x04, 0xd8, 0xa2, 0x06, 0x61, 0x13, 0x0f, - 0xf9, 0x50, 0xa2, 0x02, 0x2a, 0x9a, 0x1e, 0x62, 0xe3, 0x5f, 0x3e, 0xda, 0xf8, 0xc5, 0xa4, 0x52, - 0xd9, 0xa7, 0x67, 0x9f, 0xfe, 0x8b, 0x30, 0x67, 0x83, 0xfe, 0xb9, 0x05, 0xd3, 0x42, 0x80, 0x62, - 0xc2, 0x27, 0xf4, 0xe6, 0xb6, 0x1b, 0x13, 0xcf, 0x8d, 0xe2, 0xe9, 0x12, 0x1b, 0xc3, 0x07, 0x8e, - 0x36, 0x86, 0x85, 0x24, 0x75, 0x4c, 0xa2, 0x38, 0x74, 0xeb, 0x14, 0x87, 0x2e, 0x83, 0xea, 0x79, - 0x31, 0xac, 0xe9, 0x85, 0x3e, 0xa3, 0xc0, 0x7d, 0xc7, 0x87, 0xbe, 0x68, 0xc1, 0x19, 0xdf, 0x69, - 0x91, 0xa8, 0xed, 0x30, 0xc2, 0x0c, 0x5c, 0xf5, 0x9c, 0xfa, 0x0e, 0x1b, 0xfe, 0x30, 0x1b, 0xfe, - 0xdc, 0x60, 0x9f, 0xc6, 0x52, 0x18, 0x74, 0xda, 0x57, 0x5d, 0xbf, 0x51, 0xb5, 0xc5, 0x88, 0xce, - 0x5c, 0xeb, 0x4b, 0x1a, 0xef, 0xc3, 0x16, 0xfd, 0xb8, 0x05, 0x53, 0x41, 0xd8, 0xde, 0x76, 0x7c, - 0xd2, 0x90, 0xd0, 0x68, 0x7a, 0x84, 0x7d, 0xa7, 0x1f, 0x3c, 0xda, 0x5c, 0xae, 0xa5, 0xc9, 0xae, - 0x06, 0xbe, 0x1b, 0x07, 0x61, 0x8d, 0xc4, 0xb1, 0xeb, 0x37, 0xa3, 0xea, 0xa9, 0xbb, 0x7b, 0x33, - 0x53, 0x3d, 0x58, 0xb8, 0x77, 0x3c, 0xe8, 0xbb, 0x60, 0x34, 0xea, 0xfa, 0xf5, 0x9b, 0xae, 0xdf, - 0x08, 0x6e, 0x47, 0xd3, 0xe5, 0x3c, 0xbe, 0xf5, 0x9a, 0x22, 0x28, 0xbe, 0x56, 0xcd, 0x00, 0x9b, - 0xdc, 0xb2, 0x5f, 0x9c, 0x5e, 0x77, 0x95, 0xbc, 0x5f, 0x9c, 0x5e, 0x4c, 0xfb, 0xb0, 0x45, 0x3f, - 0x60, 0xc1, 0x78, 0xe4, 0x36, 0x7d, 0x27, 0xee, 0x84, 0xe4, 0x2a, 0xe9, 0x46, 0xd3, 0xc0, 0x06, - 0x72, 0xe5, 0x88, 0xb3, 0x62, 0x90, 0xac, 0x9e, 0x12, 0x63, 0x1c, 0x37, 0x5b, 0x23, 0x9c, 0xe4, - 0x9b, 0xf5, 0x55, 0xea, 0x65, 0x3d, 0xfa, 0x00, 0xbf, 0x4a, 0xfd, 0x05, 0xf4, 0x1d, 0x1f, 0xfa, - 0xff, 0xe0, 0x04, 0x6f, 0x52, 0xaf, 0x21, 0x9a, 0x1e, 0x63, 0x22, 0xfc, 0xe4, 0xdd, 0xbd, 0x99, - 0x13, 0xb5, 0x14, 0x0c, 0xf7, 0x60, 0xa3, 0x57, 0x61, 0xa6, 0x4d, 0xc2, 0x96, 0x1b, 0xaf, 0xf9, - 0x5e, 0x57, 0x2a, 0x86, 0x7a, 0xd0, 0x26, 0x0d, 0x31, 0x9c, 0x68, 0x7a, 0xfc, 0xbc, 0xf5, 0x4c, - 0xb9, 0xfa, 0x36, 0x31, 0xcc, 0x99, 0xf5, 0xfd, 0xd1, 0xf1, 0x41, 0xf4, 0xd0, 0xaf, 0x59, 0x70, - 0xc6, 0x90, 0xdf, 0x35, 0x12, 0xee, 0xba, 0x75, 0x32, 0x5f, 0xaf, 0x07, 0x1d, 0x3f, 0x8e, 0xa6, - 0x27, 0xd8, 0x9c, 0x6f, 0x1e, 0x87, 0x36, 0x49, 0xb2, 0xd2, 0x8b, 0xb8, 0x2f, 0x4a, 0x84, 0xf7, - 0x19, 0x29, 0xfa, 0xac, 0x05, 0x93, 0x7c, 0x42, 0x97, 0xfd, 0x98, 0x34, 0x43, 0x37, 0xee, 0x4e, - 0x4f, 0x32, 0xd9, 0xb3, 0x7a, 0xc4, 0x65, 0x9c, 0x24, 0x5a, 0x7d, 0xf4, 0xee, 0xde, 0xcc, 0x64, - 0xaa, 0x11, 0xa7, 0x59, 0xdb, 0xbf, 0x51, 0x80, 0x13, 0x69, 0x53, 0x07, 0xfd, 0x1d, 0x0b, 0x26, - 0x6f, 0xdd, 0x8e, 0x37, 0x82, 0x1d, 0xe2, 0x47, 0xd5, 0x2e, 0x55, 0x48, 0x4c, 0xc9, 0x8f, 0x5e, - 0xa8, 0xe7, 0x6b, 0x54, 0xcd, 0x5e, 0x49, 0x72, 0xb9, 0xe8, 0xc7, 0x61, 0xb7, 0xfa, 0xb8, 0x98, - 0xe2, 0xc9, 0x2b, 0x37, 0x37, 0x4c, 0x28, 0x4e, 0x0f, 0xea, 0xcc, 0x67, 0x2c, 0x38, 0x99, 0x45, - 0x02, 0x9d, 0x80, 0xe2, 0x0e, 0xe9, 0x72, 0xd3, 0x1f, 0xd3, 0x9f, 0xe8, 0x15, 0x28, 0xed, 0x3a, - 0x5e, 0x87, 0x08, 0x7b, 0x74, 0xe9, 0x68, 0x0f, 0xa2, 0x46, 0x86, 0x39, 0xd5, 0x6f, 0x2b, 0xbc, - 0x60, 0xd9, 0xbf, 0x59, 0x84, 0x51, 0x63, 0x0d, 0xdd, 0x07, 0x1b, 0x3b, 0x48, 0xd8, 0xd8, 0xab, - 0xb9, 0x2d, 0xff, 0xbe, 0x46, 0xf6, 0xed, 0x94, 0x91, 0xbd, 0x96, 0x1f, 0xcb, 0x7d, 0xad, 0x6c, - 0x14, 0x43, 0x25, 0x68, 0xd3, 0x3d, 0x29, 0x35, 0xd6, 0x86, 0xf2, 0x78, 0x85, 0x6b, 0x92, 0x5c, - 0x75, 0xfc, 0xee, 0xde, 0x4c, 0x45, 0xfd, 0xc5, 0x9a, 0x91, 0xfd, 0x7b, 0x16, 0x9c, 0x34, 0xc6, - 0xb8, 0x10, 0xf8, 0x0d, 0xb6, 0xa3, 0x42, 0xe7, 0x61, 0x28, 0xee, 0xb6, 0xe5, 0xbe, 0x57, 0xcd, - 0xd4, 0x46, 0xb7, 0x4d, 0x30, 0x83, 0x3c, 0xec, 0xdb, 0xc1, 0x2f, 0x5a, 0xf0, 0x58, 0xb6, 0xbc, - 0x43, 0x4f, 0xc3, 0x30, 0x77, 0x7a, 0x88, 0xa7, 0xd3, 0xaf, 0x84, 0xb5, 0x62, 0x01, 0x45, 0x73, - 0x50, 0x51, 0xca, 0x5a, 0x3c, 0xe3, 0x94, 0x40, 0xad, 0x68, 0x0d, 0xaf, 0x71, 0xe8, 0xa4, 0xd1, - 0x3f, 0xc2, 0xd6, 0x56, 0x93, 0xc6, 0xbc, 0x04, 0x0c, 0x62, 0xff, 0x8e, 0x05, 0xdf, 0x34, 0x88, - 0x14, 0x3e, 0xbe, 0x31, 0xd6, 0xe0, 0x54, 0x83, 0x6c, 0x39, 0x1d, 0x2f, 0x4e, 0x72, 0x14, 0x83, - 0x7e, 0x52, 0x74, 0x3e, 0xb5, 0x98, 0x85, 0x84, 0xb3, 0xfb, 0xda, 0xff, 0xd1, 0x62, 0xfe, 0x09, - 0xf9, 0x58, 0xf7, 0x61, 0x8f, 0xe8, 0x27, 0xf7, 0x88, 0xcb, 0xb9, 0x7d, 0xa6, 0x7d, 0x36, 0x89, - 0x3f, 0x64, 0xc1, 0x19, 0x03, 0x6b, 0xd5, 0x89, 0xeb, 0xdb, 0x17, 0xef, 0xb4, 0x43, 0x12, 0x45, - 0x74, 0x49, 0x3d, 0x69, 0x88, 0xe3, 0xea, 0xa8, 0xa0, 0x50, 0xbc, 0x4a, 0xba, 0x5c, 0x36, 0x3f, - 0x0b, 0x65, 0xfe, 0xcd, 0x05, 0xa1, 0x78, 0x49, 0xea, 0xd9, 0xd6, 0x44, 0x3b, 0x56, 0x18, 0xc8, - 0x86, 0x61, 0x26, 0x73, 0xa9, 0x0c, 0xa2, 0x56, 0x0b, 0xd0, 0xf7, 0x7e, 0x83, 0xb5, 0x60, 0x01, - 0xb1, 0xa3, 0xc4, 0x70, 0xd6, 0x43, 0xc2, 0xd6, 0x43, 0xe3, 0x92, 0x4b, 0xbc, 0x46, 0x44, 0xf7, - 0xaf, 0x8e, 0xef, 0x07, 0xb1, 0xd8, 0x8a, 0x1a, 0xfb, 0xd7, 0x79, 0xdd, 0x8c, 0x4d, 0x1c, 0xca, - 0xd4, 0x73, 0x36, 0x89, 0xc7, 0x67, 0x54, 0x30, 0x5d, 0x61, 0x2d, 0x58, 0x40, 0xec, 0xbb, 0x05, - 0xb6, 0x53, 0x56, 0x12, 0x8d, 0xdc, 0x0f, 0x37, 0x4b, 0x98, 0x50, 0x01, 0xeb, 0xf9, 0xc9, 0x63, - 0xd2, 0xdf, 0xd5, 0xf2, 0x5a, 0x4a, 0x0b, 0xe0, 0x5c, 0xb9, 0xee, 0xef, 0x6e, 0xf9, 0x72, 0x11, - 0x66, 0x92, 0x1d, 0x7a, 0x94, 0x08, 0xdd, 0xdb, 0x1b, 0x8c, 0xd2, 0xce, 0x49, 0x03, 0x1f, 0x9b, - 0x78, 0x7d, 0xe4, 0x70, 0xe1, 0x38, 0xe5, 0xb0, 0xa9, 0x26, 0x8a, 0x07, 0xa8, 0x89, 0x05, 0x35, - 0xeb, 0x43, 0x0c, 0xf3, 0xed, 0x3d, 0x1e, 0xcd, 0xd3, 0xeb, 0x61, 0xd0, 0x64, 0xdf, 0xdc, 0x2e, - 0xa1, 0x7b, 0xbb, 0x0c, 0x2f, 0xe5, 0x79, 0x18, 0x8a, 0x62, 0xd2, 0x9e, 0x2e, 0x25, 0x65, 0x70, - 0x2d, 0x26, 0x6d, 0xcc, 0x20, 0xe8, 0x3b, 0x60, 0x32, 0x76, 0xc2, 0x26, 0x89, 0x43, 0xb2, 0xeb, - 0x32, 0x2f, 0x37, 0xdb, 0xa8, 0x57, 0xb8, 0x41, 0xb9, 0xc1, 0x40, 0x58, 0x82, 0x70, 0x1a, 0xd7, - 0xfe, 0x2f, 0x05, 0x78, 0x3c, 0xf9, 0x7e, 0xb4, 0xd6, 0xfc, 0xce, 0x84, 0xd6, 0x7c, 0xbb, 0xa9, - 0x35, 0xdf, 0xd8, 0x9b, 0x79, 0xa2, 0x4f, 0xb7, 0x6f, 0x18, 0xa5, 0x8a, 0x96, 0x52, 0x6f, 0x68, - 0xae, 0xe7, 0x0d, 0x3d, 0xd9, 0xe7, 0x19, 0x53, 0xd6, 0xce, 0xd3, 0x30, 0x1c, 0x12, 0x27, 0x0a, - 0x7c, 0xf1, 0x9e, 0xd4, 0xc7, 0x80, 0x59, 0x2b, 0x16, 0x50, 0xfb, 0xb7, 0x2b, 0xe9, 0xc9, 0x5e, - 0xe2, 0x9e, 0xfb, 0x20, 0x44, 0x2e, 0x0c, 0xb1, 0xed, 0x28, 0x17, 0x3b, 0x57, 0x8f, 0xf6, 0x89, - 0x52, 0x15, 0xa3, 0x48, 0x57, 0xcb, 0xf4, 0xad, 0xd1, 0x26, 0xcc, 0x58, 0xa0, 0x3b, 0x50, 0xae, - 0xcb, 0x8d, 0x5f, 0x21, 0x0f, 0xe7, 0xab, 0xd8, 0xf6, 0x69, 0x8e, 0x63, 0x54, 0x17, 0xa8, 0xdd, - 0xa2, 0xe2, 0x86, 0x08, 0x14, 0x9b, 0x6e, 0x2c, 0x5e, 0xeb, 0x11, 0xfd, 0x00, 0x4b, 0xae, 0xf1, - 0x88, 0x23, 0x54, 0x41, 0x2d, 0xb9, 0x31, 0xa6, 0xf4, 0xd1, 0x27, 0x2d, 0x18, 0x8d, 0xea, 0xad, - 0xf5, 0x30, 0xd8, 0x75, 0x1b, 0x24, 0x14, 0x06, 0xe8, 0x11, 0xc5, 0x5e, 0x6d, 0x61, 0x55, 0x12, - 0xd4, 0x7c, 0xb9, 0x5f, 0x46, 0x43, 0xb0, 0xc9, 0x97, 0x6e, 0xcc, 0x1e, 0x17, 0xcf, 0xbe, 0x48, - 0xea, 0xec, 0x8b, 0x93, 0xfb, 0x7b, 0xb6, 0x52, 0x8e, 0x6c, 0x90, 0x2f, 0x76, 0xea, 0x3b, 0xf4, - 0x7b, 0xd3, 0x03, 0x7a, 0xe2, 0xee, 0xde, 0xcc, 0xe3, 0x0b, 0xd9, 0x3c, 0x71, 0xbf, 0xc1, 0xb0, - 0x09, 0x6b, 0x77, 0x3c, 0x0f, 0x93, 0x57, 0x3b, 0x84, 0xb9, 0xfa, 0x72, 0x98, 0xb0, 0x75, 0x4d, - 0x30, 0x35, 0x61, 0x06, 0x04, 0x9b, 0x7c, 0xd1, 0xab, 0x30, 0xdc, 0x72, 0xe2, 0xd0, 0xbd, 0x23, - 0xfc, 0x7b, 0x47, 0xdc, 0x22, 0xad, 0x32, 0x5a, 0x9a, 0x39, 0xb3, 0x02, 0x78, 0x23, 0x16, 0x8c, - 0x50, 0x0b, 0x4a, 0x2d, 0x12, 0x36, 0xc9, 0x74, 0x39, 0x8f, 0x83, 0x8f, 0x55, 0x4a, 0x4a, 0x33, - 0xac, 0x50, 0xcb, 0x8b, 0xb5, 0x61, 0xce, 0x05, 0xbd, 0x02, 0xe5, 0x88, 0x78, 0xa4, 0x4e, 0x6d, - 0xa7, 0x0a, 0xe3, 0xf8, 0xce, 0x01, 0xed, 0x48, 0x6a, 0xb4, 0xd4, 0x44, 0x57, 0xfe, 0x81, 0xc9, - 0x7f, 0x58, 0x91, 0xa4, 0x13, 0xd8, 0xf6, 0x3a, 0x4d, 0xd7, 0x9f, 0x86, 0x3c, 0x26, 0x70, 0x9d, - 0xd1, 0x4a, 0x4d, 0x20, 0x6f, 0xc4, 0x82, 0x91, 0xfd, 0x9f, 0x2d, 0x40, 0x49, 0xa1, 0x76, 0x1f, - 0x0c, 0xe6, 0x57, 0x93, 0x06, 0xf3, 0x4a, 0x9e, 0x16, 0x4d, 0x1f, 0x9b, 0xf9, 0xe7, 0x2b, 0x90, - 0x52, 0x07, 0xd7, 0x48, 0x14, 0x93, 0xc6, 0x9b, 0x22, 0xfc, 0x4d, 0x11, 0xfe, 0xa6, 0x08, 0x57, - 0x22, 0x7c, 0x33, 0x25, 0xc2, 0xdf, 0x63, 0x7c, 0xf5, 0x3a, 0x12, 0xe3, 0x43, 0x2a, 0x54, 0xc3, - 0x1c, 0x81, 0x81, 0x40, 0x25, 0xc1, 0x95, 0xda, 0xda, 0xb5, 0x4c, 0x99, 0xfd, 0xa1, 0xa4, 0xcc, - 0x3e, 0x2a, 0x8b, 0xbf, 0x0a, 0x52, 0xfa, 0xd7, 0x2c, 0x78, 0x5b, 0x52, 0x7a, 0xc9, 0x95, 0xb3, - 0xdc, 0xf4, 0x83, 0x90, 0x2c, 0xba, 0x5b, 0x5b, 0x24, 0x24, 0x7e, 0x9d, 0x44, 0xca, 0xf1, 0x63, - 0xf5, 0x73, 0xfc, 0xa0, 0x77, 0xc1, 0xd8, 0xad, 0x28, 0xf0, 0xd7, 0x03, 0xd7, 0x17, 0x22, 0x88, - 0xee, 0x38, 0x4e, 0xdc, 0xdd, 0x9b, 0x19, 0xa3, 0x33, 0x2a, 0xdb, 0x71, 0x02, 0x0b, 0x2d, 0xc0, - 0xd4, 0xad, 0x57, 0xd7, 0x9d, 0xd8, 0x70, 0x35, 0x48, 0xa7, 0x00, 0x3b, 0x68, 0xbb, 0xf2, 0xde, - 0x14, 0x10, 0xf7, 0xe2, 0xdb, 0x7f, 0xa3, 0x00, 0xa7, 0x53, 0x0f, 0x12, 0x78, 0x5e, 0xd0, 0x89, - 0xe9, 0x9e, 0x08, 0x7d, 0xc5, 0x82, 0x13, 0xad, 0xa4, 0x37, 0x23, 0x12, 0xbe, 0xf0, 0xf7, 0xe5, - 0xa6, 0x23, 0x52, 0xee, 0x92, 0xea, 0xb4, 0x98, 0xa1, 0x13, 0x29, 0x40, 0x84, 0x7b, 0xc6, 0x82, - 0x5e, 0x81, 0x4a, 0xcb, 0xb9, 0x73, 0xbd, 0xdd, 0x70, 0x62, 0xb9, 0x57, 0xed, 0xef, 0x62, 0xe8, - 0xc4, 0xae, 0x37, 0xcb, 0x63, 0x7c, 0x66, 0x97, 0xfd, 0x78, 0x2d, 0xac, 0xc5, 0xa1, 0xeb, 0x37, - 0xb9, 0x07, 0x74, 0x55, 0x92, 0xc1, 0x9a, 0xa2, 0xfd, 0x65, 0x2b, 0xad, 0xa4, 0xd4, 0xec, 0x84, - 0x4e, 0x4c, 0x9a, 0x5d, 0xf4, 0x11, 0x28, 0xd1, 0x7d, 0xa3, 0x9c, 0x95, 0x9b, 0x79, 0x6a, 0x4e, - 0xe3, 0x4d, 0x68, 0x25, 0x4a, 0xff, 0x45, 0x98, 0x33, 0xb5, 0xbf, 0x52, 0x49, 0x1b, 0x0b, 0x2c, - 0x42, 0xe1, 0x02, 0x40, 0x33, 0xd8, 0x20, 0xad, 0xb6, 0x47, 0xa7, 0xc5, 0x62, 0x87, 0x51, 0xca, - 0x8f, 0xb2, 0xa4, 0x20, 0xd8, 0xc0, 0x42, 0x9f, 0xb6, 0x00, 0x9a, 0x72, 0xcd, 0x4b, 0x43, 0xe0, - 0x7a, 0x9e, 0x8f, 0xa3, 0xbf, 0x28, 0x3d, 0x16, 0xc5, 0x10, 0x1b, 0xcc, 0xd1, 0xf7, 0x5a, 0x50, - 0x8e, 0xe5, 0xf0, 0xb9, 0x6a, 0xdc, 0xc8, 0x73, 0x24, 0xf2, 0xa1, 0xb5, 0x4d, 0xa4, 0xa6, 0x44, - 0xf1, 0x45, 0xdf, 0x6f, 0x01, 0x44, 0x5d, 0xbf, 0xbe, 0x1e, 0x78, 0x6e, 0xbd, 0x2b, 0x34, 0xe6, - 0x8d, 0x5c, 0x7d, 0x3d, 0x8a, 0x7a, 0x75, 0x82, 0xce, 0x86, 0xfe, 0x8f, 0x0d, 0xce, 0xe8, 0xa3, - 0x50, 0x8e, 0xc4, 0x72, 0x13, 0x3a, 0x72, 0x23, 0x5f, 0x8f, 0x13, 0xa7, 0x2d, 0xc4, 0xab, 0xf8, - 0x87, 0x15, 0x4f, 0xf4, 0x25, 0x0b, 0x26, 0xdb, 0x49, 0x1f, 0xa2, 0x50, 0x87, 0xf9, 0xc9, 0x80, - 0x94, 0x8f, 0x92, 0x7b, 0x5b, 0x52, 0x8d, 0x38, 0x3d, 0x0a, 0x2a, 0x01, 0xf5, 0x0a, 0x5e, 0x6b, - 0x73, 0x7f, 0xe6, 0x88, 0x96, 0x80, 0x4b, 0x69, 0x20, 0xee, 0xc5, 0x47, 0xeb, 0x70, 0x92, 0x8e, - 0xae, 0xcb, 0xcd, 0x4f, 0xa9, 0x5e, 0x22, 0xa6, 0x0c, 0xcb, 0xd5, 0xb3, 0x62, 0x85, 0xb0, 0x83, - 0x90, 0x34, 0x0e, 0xce, 0xec, 0x89, 0x7e, 0xd3, 0x82, 0xb3, 0x2e, 0x53, 0x03, 0xa6, 0x37, 0x5f, - 0x6b, 0x04, 0x11, 0x41, 0x40, 0x72, 0x95, 0x15, 0xfd, 0xd4, 0x4f, 0xf5, 0x9b, 0xc4, 0x13, 0x9c, - 0x5d, 0xde, 0x67, 0x48, 0x78, 0xdf, 0x01, 0xa3, 0x6f, 0x85, 0x71, 0xf9, 0x5d, 0xac, 0x53, 0x11, - 0xcc, 0x14, 0x6d, 0xa5, 0x3a, 0x75, 0x77, 0x6f, 0x66, 0x7c, 0xc3, 0x04, 0xe0, 0x24, 0x9e, 0xfd, - 0x17, 0x43, 0x89, 0x23, 0x24, 0xe5, 0xe0, 0x64, 0xe2, 0xa6, 0x2e, 0xfd, 0x3f, 0x52, 0x7a, 0xe6, - 0x2a, 0x6e, 0x94, 0x77, 0x49, 0x8b, 0x1b, 0xd5, 0x14, 0x61, 0x83, 0x39, 0x35, 0x4a, 0xa7, 0x9c, - 0xb4, 0x1b, 0x55, 0x48, 0xc0, 0x57, 0xf2, 0x1c, 0x52, 0xef, 0x81, 0xdf, 0x69, 0x31, 0xb4, 0xa9, - 0x1e, 0x10, 0xee, 0x1d, 0x12, 0xfa, 0x6e, 0xa8, 0x84, 0x2a, 0x64, 0xa7, 0x98, 0xc7, 0x56, 0x4d, - 0x2e, 0x1b, 0x31, 0x1c, 0x75, 0x3a, 0xa4, 0x83, 0x73, 0x34, 0x47, 0xf4, 0x1e, 0x98, 0x50, 0x7f, - 0x16, 0xd8, 0xb1, 0x10, 0x15, 0x8a, 0xc5, 0xea, 0x63, 0xa2, 0xd7, 0x04, 0x4e, 0x40, 0x71, 0x0a, - 0x1b, 0x85, 0x30, 0xcc, 0xc3, 0x48, 0x85, 0x18, 0x3b, 0xe2, 0x76, 0xc7, 0x8c, 0x45, 0xd5, 0x3e, - 0x42, 0xde, 0x8a, 0x05, 0x27, 0xfb, 0x53, 0x85, 0xc4, 0x49, 0x9f, 0x21, 0xef, 0x06, 0x38, 0xc5, - 0xfc, 0x9c, 0x05, 0xa3, 0x61, 0xe0, 0x79, 0xae, 0xdf, 0xa4, 0xb2, 0x59, 0x18, 0x18, 0xef, 0x3f, - 0x16, 0x1d, 0x2f, 0x84, 0x30, 0xdb, 0x0d, 0x60, 0xcd, 0x13, 0x9b, 0x03, 0x40, 0x2f, 0xc2, 0x78, - 0x83, 0x78, 0x84, 0xf6, 0x5d, 0x0b, 0xe9, 0x3e, 0x8e, 0x7b, 0xcd, 0x55, 0xd8, 0xce, 0xa2, 0x09, - 0xc4, 0x49, 0x5c, 0xfb, 0x8f, 0x2c, 0x98, 0xee, 0xa7, 0x80, 0x10, 0x81, 0x27, 0xa4, 0x74, 0x55, - 0x6f, 0x71, 0xcd, 0x97, 0xf4, 0x84, 0x0d, 0xf1, 0x94, 0xe0, 0xf3, 0xc4, 0x7a, 0x7f, 0x54, 0xbc, - 0x1f, 0x1d, 0xf4, 0x32, 0x9c, 0x30, 0x26, 0x25, 0x52, 0xb3, 0x5a, 0xa9, 0xce, 0x52, 0x8b, 0x6f, - 0x3e, 0x05, 0x7b, 0x63, 0x6f, 0xe6, 0xb1, 0x74, 0x9b, 0xd0, 0x90, 0x3d, 0x74, 0xec, 0x9f, 0xe8, - 0x79, 0xd5, 0xca, 0xb8, 0x79, 0xdd, 0xea, 0x71, 0x9f, 0xbc, 0xef, 0x38, 0x0c, 0x0a, 0xe6, 0x68, - 0x51, 0x31, 0x32, 0xfd, 0x71, 0x1e, 0x60, 0x10, 0x83, 0xfd, 0xaf, 0x86, 0x60, 0x9f, 0x91, 0x0d, - 0xb0, 0x5b, 0x39, 0xf4, 0xa9, 0xf2, 0x67, 0x2d, 0x75, 0x7c, 0xc8, 0x85, 0x56, 0xe3, 0xb8, 0xe6, - 0x9e, 0x6f, 0x18, 0x23, 0x1e, 0x48, 0xa3, 0x44, 0x42, 0xf2, 0xa0, 0x12, 0x7d, 0xd5, 0x4a, 0x1e, - 0x80, 0xf2, 0x58, 0x56, 0xf7, 0xd8, 0xc6, 0x64, 0x9c, 0xaa, 0xf2, 0x81, 0xe9, 0xb3, 0xb8, 0x7e, - 0xe7, 0xad, 0xb3, 0x00, 0x5b, 0xae, 0xef, 0x78, 0xee, 0x6b, 0x74, 0x3b, 0x58, 0x62, 0x16, 0x0d, - 0x33, 0x11, 0x2f, 0xa9, 0x56, 0x6c, 0x60, 0x9c, 0xf9, 0x7f, 0x61, 0xd4, 0x78, 0xf2, 0x8c, 0xf8, - 0x9f, 0x93, 0x66, 0xfc, 0x4f, 0xc5, 0x08, 0xdb, 0x39, 0xf3, 0x1e, 0x38, 0x91, 0x1e, 0xe0, 0x61, - 0xfa, 0xdb, 0xff, 0x6b, 0x24, 0x7d, 0x22, 0xb9, 0x41, 0xc2, 0x16, 0x1d, 0xda, 0x9b, 0x9e, 0xbc, - 0x37, 0x3d, 0x79, 0x6f, 0x7a, 0xf2, 0xcc, 0xc3, 0x18, 0xe1, 0xa5, 0x1a, 0xb9, 0x4f, 0x5e, 0xaa, - 0x84, 0xdf, 0xad, 0x9c, 0xbb, 0xdf, 0xcd, 0xfe, 0x64, 0xcf, 0x51, 0xc5, 0x46, 0x48, 0x08, 0x0a, - 0xa0, 0xe4, 0x07, 0x0d, 0x22, 0x8d, 0xfa, 0x2b, 0xf9, 0x58, 0xa8, 0xd7, 0x82, 0x86, 0x91, 0x25, - 0x40, 0xff, 0x45, 0x98, 0xf3, 0xb1, 0xff, 0x67, 0x8f, 0x61, 0x73, 0x93, 0xf9, 0x89, 0x76, 0x89, - 0x1f, 0xa3, 0xab, 0x09, 0x2b, 0xef, 0x5b, 0x53, 0xa7, 0xee, 0x6f, 0xeb, 0x97, 0x0f, 0x76, 0x9b, - 0x52, 0x98, 0x65, 0x24, 0x0c, 0x83, 0xf0, 0xb3, 0x16, 0x4c, 0x38, 0x09, 0x4e, 0xb9, 0x25, 0xf8, - 0x98, 0x27, 0x26, 0xca, 0xa0, 0x4e, 0xd9, 0x8a, 0x29, 0xde, 0xf6, 0x3f, 0x1d, 0x86, 0xc4, 0xc6, - 0x81, 0x2f, 0xf8, 0x6f, 0x86, 0x91, 0x90, 0xb4, 0x83, 0xeb, 0x78, 0x45, 0x3c, 0xb4, 0xce, 0x32, - 0xe3, 0xcd, 0x58, 0xc2, 0xa9, 0xb2, 0x6f, 0x3b, 0xf1, 0xb6, 0xd0, 0xe2, 0x4a, 0xd9, 0xaf, 0x3b, - 0xf1, 0x36, 0x66, 0x10, 0x6a, 0xf3, 0xc7, 0x89, 0xa0, 0x07, 0x71, 0xb8, 0xaf, 0x86, 0x98, 0x0c, - 0x89, 0xc0, 0x29, 0x6c, 0xf4, 0x2a, 0x0c, 0x6d, 0x13, 0xaf, 0x25, 0xd6, 0x7c, 0x2d, 0xbf, 0x69, - 0x62, 0xcf, 0x7a, 0x99, 0x78, 0x2d, 0xae, 0x02, 0xe8, 0x2f, 0xcc, 0x58, 0xd1, 0x0f, 0xbe, 0xb2, - 0xd3, 0x89, 0xe2, 0xa0, 0xe5, 0xbe, 0x26, 0x7d, 0xda, 0xef, 0xcb, 0x99, 0xf1, 0x55, 0x49, 0x9f, - 0x3b, 0x0f, 0xd5, 0x5f, 0xac, 0x39, 0xb3, 0x71, 0x34, 0xdc, 0x90, 0x7d, 0x2b, 0x5d, 0xe1, 0x9a, - 0xce, 0x7b, 0x1c, 0x8b, 0x92, 0x3e, 0x1f, 0x87, 0xfa, 0x8b, 0x35, 0x67, 0xd4, 0x55, 0x82, 0x67, - 0x94, 0x8d, 0xe1, 0x7a, 0xce, 0x63, 0xe0, 0x42, 0x27, 0x53, 0x00, 0x3d, 0x05, 0xa5, 0xfa, 0xb6, - 0x13, 0xc6, 0xd3, 0x63, 0x6c, 0xd1, 0xa8, 0xcf, 0x77, 0x81, 0x36, 0x62, 0x0e, 0x43, 0x4f, 0x42, - 0x31, 0x24, 0x5b, 0x2c, 0x66, 0xde, 0x08, 0x8f, 0xc3, 0x64, 0x0b, 0xd3, 0x76, 0x65, 0x90, 0x4e, - 0xec, 0x67, 0x90, 0xc6, 0x4e, 0x73, 0x3d, 0x24, 0x5b, 0xee, 0x1d, 0x16, 0x4d, 0x6e, 0x18, 0xa4, - 0x1b, 0x12, 0x80, 0x35, 0x8e, 0xfd, 0x63, 0x85, 0xa4, 0x09, 0x9c, 0x9c, 0x4a, 0xfe, 0x01, 0xd5, - 0x3b, 0x61, 0x24, 0x7d, 0xa7, 0xc6, 0x07, 0xc4, 0x9a, 0xb1, 0x84, 0xa3, 0x8f, 0x5b, 0x30, 0x72, - 0x2b, 0x0a, 0x7c, 0x5f, 0x49, 0x82, 0x1b, 0x39, 0xcf, 0xee, 0x15, 0x4e, 0x5d, 0x8f, 0x41, 0x34, - 0x60, 0xc9, 0x97, 0x0e, 0x97, 0xdc, 0xa9, 0x7b, 0x9d, 0x46, 0x4f, 0x10, 0xd5, 0x45, 0xde, 0x8c, - 0x25, 0x9c, 0xa2, 0xba, 0x3e, 0x47, 0x1d, 0x4a, 0xa2, 0x2e, 0xfb, 0x02, 0x55, 0xc0, 0xed, 0x5f, - 0x2c, 0xc3, 0xa9, 0xcc, 0xef, 0x8d, 0x1a, 0xa7, 0xcc, 0xfc, 0xbb, 0xe4, 0x7a, 0x44, 0x86, 0x0f, - 0x32, 0xe3, 0xf4, 0x86, 0x6a, 0xc5, 0x06, 0x06, 0xfa, 0x1e, 0x80, 0xb6, 0x13, 0x3a, 0x2d, 0xa2, - 0xce, 0x36, 0x8e, 0x6c, 0x03, 0xd2, 0x71, 0xac, 0x4b, 0x9a, 0xda, 0xbf, 0xa3, 0x9a, 0x22, 0x6c, - 0xb0, 0x44, 0xcf, 0xc3, 0x68, 0x48, 0x3c, 0xe2, 0x44, 0x2c, 0x8b, 0x23, 0x9d, 0xec, 0x86, 0x35, - 0x08, 0x9b, 0x78, 0xe8, 0x69, 0x15, 0x69, 0x39, 0x94, 0x0c, 0x43, 0x4a, 0x46, 0x5b, 0xa2, 0xcf, - 0x5b, 0x30, 0xb1, 0xe5, 0x7a, 0x44, 0x73, 0x17, 0xa9, 0x69, 0x6b, 0x47, 0x7f, 0xc8, 0x4b, 0x26, - 0x5d, 0x2d, 0x74, 0x13, 0xcd, 0x11, 0x4e, 0xb1, 0xa7, 0xaf, 0x79, 0x97, 0x84, 0x4c, 0x5a, 0x0f, - 0x27, 0x5f, 0xf3, 0x0d, 0xde, 0x8c, 0x25, 0x1c, 0xcd, 0xc3, 0x64, 0xdb, 0x89, 0xa2, 0x85, 0x90, - 0x34, 0x88, 0x1f, 0xbb, 0x8e, 0xc7, 0x73, 0xc1, 0xca, 0x3a, 0x0d, 0x61, 0x3d, 0x09, 0xc6, 0x69, - 0x7c, 0xf4, 0x12, 0x3c, 0xce, 0x9d, 0x87, 0xab, 0x6e, 0x14, 0xb9, 0x7e, 0x53, 0x2f, 0x03, 0xe1, - 0x43, 0x9d, 0x11, 0xa4, 0x1e, 0x5f, 0xce, 0x46, 0xc3, 0xfd, 0xfa, 0xa3, 0x67, 0xa1, 0x1c, 0xed, - 0xb8, 0xed, 0x85, 0xb0, 0x11, 0xb1, 0x83, 0xc3, 0xb2, 0xf6, 0xd8, 0xd7, 0x44, 0x3b, 0x56, 0x18, - 0xa8, 0x0e, 0x63, 0xfc, 0x95, 0xf0, 0x50, 0x51, 0x21, 0x72, 0xdf, 0xd1, 0xd7, 0xe4, 0x11, 0xb9, - 0xe2, 0xb3, 0xd8, 0xb9, 0x7d, 0x51, 0x1e, 0x63, 0xf2, 0x53, 0xb7, 0x1b, 0x06, 0x19, 0x9c, 0x20, - 0x9a, 0xdc, 0xfd, 0x8e, 0x0e, 0xb0, 0xfb, 0x7d, 0x1e, 0x46, 0x77, 0x3a, 0x9b, 0x44, 0xcc, 0xbc, - 0x90, 0x84, 0x6a, 0xf5, 0x5d, 0xd5, 0x20, 0x6c, 0xe2, 0xb1, 0x28, 0xdd, 0xb6, 0x2b, 0xfe, 0x45, - 0xd3, 0xe3, 0x46, 0x94, 0xee, 0xfa, 0xb2, 0x6c, 0xc6, 0x26, 0x0e, 0x1d, 0x1a, 0x9d, 0x8b, 0x0d, - 0x12, 0xb1, 0x9c, 0x20, 0x3a, 0x5d, 0x6a, 0x68, 0x35, 0x09, 0xc0, 0x1a, 0x07, 0xad, 0xc3, 0x49, - 0xfa, 0xa7, 0xc6, 0x72, 0xe5, 0x6f, 0x38, 0x9e, 0xdb, 0xe0, 0x21, 0xa3, 0x93, 0x49, 0xd7, 0x77, - 0x2d, 0x03, 0x07, 0x67, 0xf6, 0xfc, 0xb6, 0xf2, 0xeb, 0x5f, 0x9d, 0x79, 0xe4, 0x63, 0x7f, 0x78, - 0xfe, 0x11, 0xfb, 0x47, 0x0b, 0x49, 0xa3, 0xcc, 0x14, 0x66, 0x28, 0xa2, 0x22, 0x2b, 0xbe, 0xe1, - 0x84, 0xd2, 0x48, 0x3c, 0x62, 0x6a, 0x9f, 0xa0, 0x7b, 0xc3, 0x09, 0x4d, 0xe1, 0xc7, 0x18, 0x60, - 0xc9, 0x09, 0xdd, 0x82, 0xa1, 0xd8, 0x73, 0x72, 0x4a, 0x1c, 0x36, 0x38, 0x6a, 0xcf, 0xe1, 0xca, - 0x7c, 0x84, 0x19, 0x0f, 0x74, 0x96, 0xee, 0x78, 0x37, 0xe5, 0x71, 0xac, 0xd8, 0xa4, 0x6e, 0x46, - 0x98, 0xb5, 0xda, 0xff, 0xff, 0x78, 0x86, 0xfe, 0x51, 0x36, 0x04, 0xba, 0x00, 0x40, 0x97, 0x8f, - 0x50, 0x68, 0xdc, 0x86, 0x53, 0x32, 0xee, 0x9a, 0x82, 0x60, 0x03, 0x4b, 0xf6, 0xa9, 0x75, 0xb6, - 0x68, 0x9f, 0x42, 0x6f, 0x1f, 0x0e, 0xc1, 0x06, 0x16, 0x7a, 0x17, 0x0c, 0xbb, 0x2d, 0xa7, 0xa9, - 0x42, 0xc9, 0xcf, 0x52, 0xe1, 0xb6, 0xcc, 0x5a, 0xde, 0xd8, 0x9b, 0x99, 0x50, 0x03, 0x62, 0x4d, - 0x58, 0xe0, 0xa2, 0x9f, 0xb0, 0x60, 0xac, 0x1e, 0xb4, 0x5a, 0x81, 0xcf, 0x5d, 0x0e, 0xc2, 0x7f, - 0x72, 0xeb, 0xb8, 0x2c, 0xac, 0xd9, 0x05, 0x83, 0x19, 0x77, 0xa0, 0xa8, 0x0c, 0x67, 0x13, 0x84, - 0x13, 0xa3, 0x32, 0x65, 0x60, 0xe9, 0x00, 0x19, 0xf8, 0x73, 0x16, 0x4c, 0xf1, 0xbe, 0x86, 0x27, - 0x44, 0xe4, 0xe7, 0x06, 0xc7, 0xfc, 0x58, 0x3d, 0xce, 0x21, 0x75, 0x22, 0xd0, 0x03, 0xc7, 0xbd, - 0x83, 0x44, 0x4b, 0x30, 0xb5, 0x15, 0x84, 0x75, 0x62, 0x4e, 0x84, 0x10, 0xe0, 0x8a, 0xd0, 0xa5, - 0x34, 0x02, 0xee, 0xed, 0x83, 0x6e, 0xc0, 0x63, 0x46, 0xa3, 0x39, 0x0f, 0x5c, 0x86, 0x9f, 0x13, - 0xd4, 0x1e, 0xbb, 0x94, 0x89, 0x85, 0xfb, 0xf4, 0x4e, 0x8a, 0xcb, 0xca, 0x00, 0xe2, 0xf2, 0x43, - 0x70, 0xba, 0xde, 0x3b, 0x33, 0xbb, 0x51, 0x67, 0x33, 0xe2, 0x12, 0xbd, 0x5c, 0x7d, 0x8b, 0x20, - 0x70, 0x7a, 0xa1, 0x1f, 0x22, 0xee, 0x4f, 0x03, 0x7d, 0x04, 0xca, 0x21, 0x61, 0x6f, 0x25, 0x12, - 0xc9, 0xaa, 0x47, 0xf4, 0x10, 0x69, 0xe3, 0x9f, 0x93, 0xd5, 0x3a, 0x4a, 0x34, 0x44, 0x58, 0x71, - 0x44, 0xb7, 0x61, 0xa4, 0x4d, 0xb7, 0x96, 0x22, 0xeb, 0xf4, 0xc8, 0x3b, 0x47, 0xc5, 0x9c, 0x9d, - 0xb7, 0x19, 0x55, 0x42, 0x38, 0x13, 0x2c, 0xb9, 0x51, 0xab, 0xad, 0x1e, 0xb4, 0xda, 0x81, 0x4f, - 0xfc, 0x58, 0xaa, 0x93, 0x09, 0x7e, 0x28, 0x26, 0x5b, 0xb1, 0x81, 0xd1, 0xa3, 0xd5, 0x35, 0xda, - 0xf4, 0xd4, 0x3e, 0x5a, 0xdd, 0xa0, 0xd6, 0xaf, 0x3f, 0x55, 0x3b, 0xcc, 0x15, 0x7b, 0xd3, 0x8d, - 0xb7, 0x83, 0x4e, 0x2c, 0x3d, 0x0b, 0x42, 0x65, 0x29, 0xb5, 0xb3, 0x92, 0x81, 0x83, 0x33, 0x7b, - 0xa6, 0x75, 0xec, 0xe4, 0xbd, 0xe9, 0xd8, 0x13, 0x03, 0xe8, 0xd8, 0x1a, 0x9c, 0x62, 0x23, 0x10, - 0xf6, 0xb2, 0x74, 0xf4, 0x46, 0xd3, 0x88, 0x0d, 0x5e, 0x65, 0x48, 0xad, 0x64, 0x21, 0xe1, 0xec, - 0xbe, 0x67, 0xbe, 0x13, 0xa6, 0x7a, 0x84, 0xdc, 0xa1, 0x9c, 0xb8, 0x8b, 0xf0, 0x58, 0xb6, 0x38, - 0x39, 0x94, 0x2b, 0xf7, 0x9f, 0xa4, 0x92, 0x17, 0x8c, 0xdd, 0xdd, 0x00, 0xc7, 0x02, 0x0e, 0x14, - 0x89, 0xbf, 0x2b, 0xb4, 0xeb, 0xa5, 0xa3, 0xad, 0xea, 0x8b, 0xfe, 0x2e, 0x97, 0x86, 0xcc, 0xf7, - 0x79, 0xd1, 0xdf, 0xc5, 0x94, 0x36, 0xfa, 0x11, 0x2b, 0xb1, 0x95, 0xe0, 0x87, 0x09, 0x1f, 0x3c, - 0x96, 0xed, 0xec, 0xc0, 0xbb, 0x0b, 0xfb, 0x5f, 0x17, 0xe0, 0xfc, 0x41, 0x44, 0x06, 0x98, 0xbe, - 0xa7, 0x60, 0x38, 0x62, 0xe1, 0x48, 0x42, 0x5d, 0x8d, 0xd2, 0xaf, 0x98, 0x07, 0x28, 0x7d, 0x08, - 0x0b, 0x10, 0xf2, 0xa0, 0xd8, 0x72, 0xda, 0xc2, 0xc7, 0xbc, 0x7c, 0xd4, 0x0c, 0x50, 0xfa, 0xdf, - 0xf1, 0x56, 0x9d, 0x36, 0x5f, 0xf3, 0x46, 0x03, 0xa6, 0x6c, 0x50, 0x0c, 0x25, 0x27, 0x0c, 0x1d, - 0x19, 0xfb, 0x72, 0x35, 0x1f, 0x7e, 0xf3, 0x94, 0x24, 0x0f, 0x1d, 0x48, 0x34, 0x61, 0xce, 0xcc, - 0xfe, 0x52, 0x39, 0x91, 0x2e, 0xc8, 0x02, 0x9a, 0x22, 0x18, 0x16, 0xae, 0x65, 0x2b, 0xef, 0xc4, - 0x5b, 0x5e, 0x1e, 0x80, 0x39, 0x2f, 0x44, 0xf9, 0x16, 0xc1, 0x0a, 0x7d, 0xc6, 0x62, 0x45, 0x52, - 0x64, 0x0e, 0xa6, 0xd8, 0xdf, 0x1f, 0x4f, 0xcd, 0x16, 0xb3, 0xf4, 0x8a, 0x6c, 0xc4, 0x26, 0x77, - 0x51, 0x10, 0x8a, 0xed, 0x6b, 0x7a, 0x0b, 0x42, 0xb1, 0x7d, 0x8a, 0x84, 0xa3, 0x3b, 0x19, 0x81, - 0x4b, 0x39, 0xd4, 0xce, 0x18, 0x20, 0x54, 0xe9, 0xab, 0x16, 0x4c, 0xb9, 0xe9, 0x08, 0x14, 0xb1, - 0x1b, 0xbe, 0x99, 0x8f, 0x1f, 0xb8, 0x37, 0xc0, 0x45, 0x19, 0x3a, 0x3d, 0x20, 0xdc, 0x3b, 0x18, - 0xd4, 0x80, 0x21, 0xd7, 0xdf, 0x0a, 0x84, 0x79, 0x57, 0x3d, 0xda, 0xa0, 0x96, 0xfd, 0xad, 0x40, - 0x7f, 0xcd, 0xf4, 0x1f, 0x66, 0xd4, 0xd1, 0x0a, 0x9c, 0x94, 0x49, 0x61, 0x97, 0xdd, 0x28, 0x0e, - 0xc2, 0xee, 0x8a, 0xdb, 0x72, 0x63, 0x66, 0x9a, 0x15, 0xab, 0xd3, 0x54, 0xbd, 0xe1, 0x0c, 0x38, - 0xce, 0xec, 0x85, 0x5e, 0x83, 0x11, 0x19, 0xf5, 0x51, 0xce, 0xc3, 0xb3, 0xd0, 0xbb, 0xfe, 0xd5, - 0x62, 0xaa, 0x89, 0xb0, 0x0f, 0xc9, 0x10, 0x7d, 0xca, 0x82, 0x09, 0xfe, 0xfb, 0x72, 0xb7, 0xc1, - 0x93, 0x54, 0x2b, 0x79, 0xb8, 0xbc, 0x6b, 0x09, 0x9a, 0x55, 0x74, 0x77, 0x6f, 0x66, 0x22, 0xd9, - 0x86, 0x53, 0x7c, 0xed, 0xbf, 0x3b, 0x06, 0xbd, 0x71, 0x32, 0xc9, 0xa0, 0x18, 0xeb, 0xbe, 0x07, - 0xc5, 0xdc, 0x82, 0xa1, 0x48, 0xc7, 0x86, 0xe4, 0xf0, 0x99, 0x09, 0xae, 0xfa, 0xe8, 0xbe, 0xeb, - 0xd7, 0x31, 0xe3, 0x81, 0x3a, 0x2a, 0x80, 0xa6, 0x98, 0x53, 0xb4, 0xc0, 0x20, 0x31, 0x34, 0xe8, - 0x0e, 0x8c, 0x6c, 0xf3, 0xe5, 0x28, 0xf6, 0x7a, 0xab, 0x47, 0x9d, 0xdf, 0xc4, 0x1a, 0xd7, 0x8b, - 0x4f, 0x34, 0x60, 0xc9, 0x8e, 0xc5, 0x60, 0x1a, 0x51, 0x62, 0x5c, 0x90, 0xe4, 0x97, 0x6f, 0x3b, - 0x78, 0x88, 0xd8, 0x87, 0x61, 0x2c, 0x24, 0xf5, 0xc0, 0xaf, 0xbb, 0x1e, 0x69, 0xcc, 0xcb, 0x43, - 0xc4, 0xc3, 0x64, 0x52, 0x32, 0xbf, 0x12, 0x36, 0x68, 0xe0, 0x04, 0x45, 0xf6, 0x9d, 0xa9, 0xd2, - 0x0b, 0xf4, 0x85, 0x10, 0x71, 0x66, 0xb2, 0x92, 0x53, 0xa1, 0x07, 0x46, 0x93, 0x7f, 0x67, 0xc9, - 0x36, 0x9c, 0xe2, 0x8b, 0x5e, 0x06, 0x08, 0x36, 0x79, 0xa0, 0xe5, 0x7c, 0x2c, 0x0e, 0x50, 0x0e, - 0xf3, 0xa8, 0x13, 0x3c, 0x5d, 0x5b, 0x52, 0xc0, 0x06, 0x35, 0x74, 0x15, 0x80, 0x7f, 0x39, 0x1b, - 0xdd, 0xb6, 0xdc, 0x10, 0xca, 0x54, 0x58, 0xa8, 0x29, 0xc8, 0x1b, 0x7b, 0x33, 0xbd, 0xde, 0x67, - 0x76, 0x10, 0x67, 0x74, 0x47, 0xdf, 0x05, 0x23, 0x51, 0xa7, 0xd5, 0x72, 0xd4, 0xf1, 0x4a, 0x8e, - 0x09, 0xe0, 0x9c, 0xae, 0x21, 0x18, 0x79, 0x03, 0x96, 0x1c, 0xd1, 0x2d, 0x2a, 0xe2, 0x85, 0x84, - 0xe2, 0x5f, 0x11, 0xb7, 0x50, 0xb8, 0x4f, 0xf0, 0xdd, 0x72, 0x17, 0x83, 0x33, 0x70, 0xde, 0xd8, - 0x9b, 0x79, 0x2c, 0xd9, 0xbe, 0x12, 0x88, 0x94, 0xec, 0x4c, 0x9a, 0xe8, 0x8a, 0x2c, 0x39, 0x47, - 0x1f, 0x5b, 0xd6, 0x2b, 0x7a, 0x46, 0x97, 0x9c, 0x63, 0xcd, 0xfd, 0xe7, 0xcc, 0xec, 0x8c, 0x56, - 0xe1, 0xd1, 0x7a, 0xe0, 0xc7, 0x61, 0xe0, 0x79, 0xbc, 0x2c, 0x25, 0xdf, 0x9b, 0xf3, 0xe3, 0x97, - 0x27, 0xc4, 0xb0, 0x1f, 0x5d, 0xe8, 0x45, 0xc1, 0x59, 0xfd, 0xa8, 0x4d, 0x9e, 0xd6, 0x0f, 0x13, - 0xb9, 0x84, 0x24, 0x24, 0x68, 0x0a, 0x09, 0xa5, 0x1c, 0xe0, 0x07, 0x68, 0x8a, 0x9f, 0x4c, 0x9d, - 0x4c, 0x8b, 0x57, 0xf6, 0x2e, 0x18, 0x23, 0x77, 0x62, 0x12, 0xfa, 0x8e, 0x77, 0x1d, 0xaf, 0xc8, - 0xb3, 0x0b, 0xf6, 0x65, 0x5e, 0x34, 0xda, 0x71, 0x02, 0x0b, 0xd9, 0xca, 0x4d, 0x66, 0x14, 0x3f, - 0xe0, 0x6e, 0x32, 0xe5, 0x14, 0x7b, 0x1e, 0x46, 0xdd, 0x68, 0xbe, 0xdd, 0x5e, 0xdb, 0x9a, 0x6f, - 0xb7, 0x79, 0x61, 0x80, 0xb2, 0x36, 0xea, 0x96, 0x35, 0x08, 0x9b, 0x78, 0xf6, 0xcf, 0x14, 0x13, - 0xb6, 0xee, 0x03, 0x39, 0x3e, 0x67, 0x85, 0xc5, 0x64, 0x05, 0x36, 0x06, 0x10, 0x7b, 0xb8, 0x3c, - 0x39, 0xab, 0x08, 0xc5, 0x35, 0x93, 0x11, 0x4e, 0xf2, 0x45, 0x3b, 0x50, 0xda, 0x0e, 0xa2, 0x58, - 0xee, 0xec, 0x8e, 0xb8, 0x89, 0xbc, 0x1c, 0x44, 0x31, 0x33, 0xd0, 0xd4, 0x63, 0xd3, 0x96, 0x08, - 0x73, 0x1e, 0xf4, 0x95, 0x45, 0xdb, 0x4e, 0xd8, 0x48, 0x84, 0xb2, 0xaa, 0x57, 0x56, 0xd3, 0x20, - 0x6c, 0xe2, 0xd9, 0x7f, 0x6c, 0x25, 0xce, 0xc5, 0x8e, 0x2b, 0xd2, 0xe0, 0x63, 0x56, 0xb2, 0x8a, - 0x43, 0x21, 0x8f, 0x2d, 0x9f, 0x59, 0xc9, 0xe4, 0xc0, 0x82, 0x10, 0xf6, 0x8f, 0x58, 0x30, 0x52, - 0x75, 0xea, 0x3b, 0xc1, 0xd6, 0x16, 0x7a, 0x16, 0xca, 0x8d, 0x4e, 0x68, 0x16, 0x94, 0x50, 0x4e, - 0xae, 0x45, 0xd1, 0x8e, 0x15, 0x06, 0xfd, 0x62, 0xb6, 0x9c, 0xba, 0xac, 0x67, 0x52, 0xe4, 0x5f, - 0xcc, 0x25, 0xd6, 0x82, 0x05, 0x84, 0x4e, 0x7f, 0xcb, 0xb9, 0x23, 0x3b, 0xa7, 0x0f, 0xe5, 0x56, - 0x35, 0x08, 0x9b, 0x78, 0xf6, 0xaf, 0x5a, 0x30, 0x5d, 0x75, 0x22, 0xb7, 0x3e, 0xdf, 0x89, 0xb7, - 0xab, 0x6e, 0xbc, 0xd9, 0xa9, 0xef, 0x90, 0x98, 0xd7, 0xbd, 0xa1, 0xa3, 0xec, 0x44, 0xf4, 0xc3, - 0x55, 0x3b, 0x6d, 0x35, 0xca, 0xeb, 0xa2, 0x1d, 0x2b, 0x0c, 0xf4, 0x1a, 0x8c, 0xb6, 0x9d, 0x28, - 0xba, 0x1d, 0x84, 0x0d, 0x4c, 0xb6, 0xf2, 0xa9, 0x8c, 0x55, 0x23, 0xf5, 0x90, 0xc4, 0x98, 0x6c, - 0x89, 0x60, 0x20, 0x4d, 0x1f, 0x9b, 0xcc, 0xec, 0x4f, 0x5b, 0x70, 0xb2, 0x4a, 0x9c, 0x90, 0x84, - 0xac, 0x90, 0x96, 0x7a, 0x10, 0xf4, 0x2a, 0x94, 0x63, 0xda, 0x42, 0x47, 0x64, 0xe5, 0x3b, 0x22, - 0x16, 0xc6, 0xb3, 0x21, 0x88, 0x63, 0xc5, 0xc6, 0xfe, 0x9c, 0x05, 0xa7, 0xb3, 0xc6, 0xb2, 0xe0, - 0x05, 0x9d, 0xc6, 0x83, 0x18, 0xd0, 0x5f, 0xb7, 0x60, 0x8c, 0x45, 0x08, 0x2c, 0x92, 0xd8, 0x71, - 0xbd, 0x9e, 0x6a, 0xa5, 0xd6, 0x80, 0xd5, 0x4a, 0xcf, 0xc3, 0xd0, 0x76, 0xd0, 0x22, 0xe9, 0xe8, - 0x96, 0xcb, 0x41, 0x8b, 0x60, 0x06, 0x41, 0xcf, 0xd1, 0x45, 0xe8, 0xfa, 0xb1, 0x43, 0x3f, 0x47, - 0x79, 0x0c, 0x32, 0xc9, 0x17, 0xa0, 0x6a, 0xc6, 0x26, 0x8e, 0xfd, 0x2f, 0x2a, 0x30, 0x22, 0x62, - 0xd0, 0x06, 0xae, 0xc3, 0x24, 0xbd, 0x3f, 0x85, 0xbe, 0xde, 0x9f, 0x08, 0x86, 0xeb, 0xac, 0xb4, - 0xb4, 0xb0, 0xec, 0xaf, 0xe6, 0x12, 0xb4, 0xc8, 0xab, 0x55, 0xeb, 0x61, 0xf1, 0xff, 0x58, 0xb0, - 0x42, 0x5f, 0xb0, 0x60, 0xb2, 0x1e, 0xf8, 0x3e, 0xa9, 0x6b, 0x9b, 0x73, 0x28, 0x8f, 0x8d, 0xc5, - 0x42, 0x92, 0xa8, 0x3e, 0x4b, 0x4e, 0x01, 0x70, 0x9a, 0x3d, 0x7a, 0x11, 0xc6, 0xf9, 0x9c, 0xdd, - 0x48, 0x9c, 0xdd, 0xe8, 0xba, 0x94, 0x26, 0x10, 0x27, 0x71, 0xd1, 0x2c, 0x3f, 0x03, 0x13, 0x45, - 0x1d, 0x87, 0xb5, 0x8b, 0xdb, 0x28, 0xe7, 0x68, 0x60, 0xa0, 0x10, 0x50, 0x48, 0xb6, 0x42, 0x12, - 0x6d, 0x8b, 0x18, 0x3d, 0x66, 0xef, 0x8e, 0xdc, 0x5b, 0x91, 0x14, 0xdc, 0x43, 0x09, 0x67, 0x50, - 0x47, 0x3b, 0xc2, 0xfd, 0x50, 0xce, 0x43, 0x9e, 0x8b, 0xd7, 0xdc, 0xd7, 0x0b, 0x31, 0x03, 0x25, - 0xa6, 0xba, 0x98, 0x9d, 0x5d, 0xe4, 0x89, 0xb9, 0x4c, 0xb1, 0x61, 0xde, 0x8e, 0x16, 0xe1, 0x44, - 0xaa, 0x50, 0x66, 0x24, 0xce, 0x58, 0x54, 0x12, 0x66, 0xaa, 0xc4, 0x66, 0x84, 0x7b, 0x7a, 0x98, - 0xae, 0xa9, 0xd1, 0x03, 0x5c, 0x53, 0x5d, 0x15, 0x09, 0xce, 0x4f, 0x3f, 0xde, 0x9b, 0xcb, 0x04, - 0x0c, 0x14, 0xf6, 0xfd, 0x43, 0xa9, 0xb0, 0xef, 0x71, 0x36, 0x80, 0x1b, 0xf9, 0x0c, 0xe0, 0xf0, - 0x31, 0xde, 0x0f, 0x32, 0x66, 0xfb, 0x7f, 0x58, 0x20, 0xdf, 0xeb, 0x82, 0x53, 0xdf, 0x26, 0x74, - 0xc9, 0x64, 0x64, 0xf7, 0x58, 0x87, 0xca, 0xee, 0x99, 0x83, 0x0a, 0x9d, 0x27, 0xde, 0x95, 0xeb, - 0x7d, 0xe5, 0x39, 0x99, 0x5f, 0x5f, 0x16, 0xbd, 0x34, 0x0e, 0x0a, 0x60, 0xca, 0x73, 0xa2, 0x98, - 0x8d, 0xa0, 0xd6, 0xf5, 0xeb, 0xf7, 0x58, 0xa2, 0x88, 0x65, 0xfa, 0xad, 0xa4, 0x09, 0xe1, 0x5e, - 0xda, 0xf6, 0xbf, 0x2d, 0xc1, 0x78, 0x42, 0x32, 0x1e, 0xd2, 0x60, 0x78, 0x16, 0xca, 0x52, 0x87, - 0xa7, 0x0b, 0xb5, 0x29, 0x45, 0xaf, 0x30, 0xa8, 0xd2, 0xda, 0xd4, 0x5a, 0x35, 0x6d, 0xe0, 0x18, - 0x0a, 0x17, 0x9b, 0x78, 0x4c, 0x28, 0xc7, 0x5e, 0xb4, 0xe0, 0xb9, 0xc4, 0x8f, 0xf9, 0x30, 0xf3, - 0x11, 0xca, 0x1b, 0x2b, 0x35, 0x93, 0xa8, 0x16, 0xca, 0x29, 0x00, 0x4e, 0xb3, 0x47, 0xdf, 0x67, - 0xc1, 0xb8, 0x73, 0x3b, 0xd2, 0xf7, 0x1f, 0x88, 0x00, 0xef, 0x23, 0x2a, 0xa9, 0xc4, 0x95, 0x0a, - 0xfc, 0x40, 0x20, 0xd1, 0x84, 0x93, 0x4c, 0xd1, 0xeb, 0x16, 0x20, 0x72, 0x87, 0xd4, 0x65, 0x08, - 0xba, 0x18, 0xcb, 0x70, 0x1e, 0x3b, 0xff, 0x8b, 0x3d, 0x74, 0xb9, 0x54, 0xef, 0x6d, 0xc7, 0x19, - 0x63, 0x40, 0x57, 0x00, 0x35, 0xdc, 0xc8, 0xd9, 0xf4, 0xc8, 0x42, 0xd0, 0x92, 0xd9, 0xe9, 0xe2, - 0x1c, 0xfe, 0x8c, 0x98, 0x67, 0xb4, 0xd8, 0x83, 0x81, 0x33, 0x7a, 0xb1, 0x55, 0x16, 0x06, 0x77, - 0xba, 0xd7, 0x43, 0x8f, 0x69, 0x09, 0x73, 0x95, 0x89, 0x76, 0xac, 0x30, 0xec, 0x3f, 0x29, 0xaa, - 0x4f, 0x59, 0xe7, 0x5b, 0x38, 0x46, 0xdc, 0xb7, 0x75, 0xef, 0x71, 0xdf, 0x3a, 0xd6, 0xaa, 0xb7, - 0xe6, 0x42, 0x22, 0x45, 0xbb, 0xf0, 0x80, 0x52, 0xb4, 0xbf, 0xd7, 0x4a, 0x14, 0x43, 0x1c, 0xbd, - 0xf0, 0x72, 0xbe, 0xb9, 0x1e, 0xb3, 0x3c, 0x0e, 0x2c, 0xa5, 0x57, 0x52, 0xe1, 0x7f, 0xcf, 0x42, - 0x79, 0xcb, 0x73, 0x58, 0x95, 0x1e, 0xf6, 0xa1, 0x1a, 0x31, 0x6a, 0x97, 0x44, 0x3b, 0x56, 0x18, - 0x54, 0xea, 0x1b, 0x44, 0x0f, 0x25, 0xb5, 0xff, 0x43, 0x11, 0x46, 0x0d, 0x8d, 0x9f, 0x69, 0xbe, - 0x59, 0x0f, 0x99, 0xf9, 0x56, 0x38, 0x84, 0xf9, 0xf6, 0x3d, 0x50, 0xa9, 0x4b, 0x6d, 0x94, 0xcf, - 0x2d, 0x16, 0x69, 0x1d, 0xa7, 0x15, 0x92, 0x6a, 0xc2, 0x9a, 0x27, 0x5a, 0x4a, 0xa4, 0x01, 0x27, - 0xfc, 0x02, 0x59, 0x79, 0xba, 0x42, 0xa3, 0xf5, 0xf6, 0x49, 0xc7, 0x15, 0x94, 0x0e, 0x8e, 0x2b, - 0xb0, 0x7f, 0xcf, 0x52, 0x2f, 0xf7, 0x3e, 0xd4, 0x7b, 0xba, 0x95, 0xac, 0xf7, 0x74, 0x31, 0x97, - 0x69, 0xee, 0x53, 0xe8, 0xe9, 0xd3, 0x16, 0x9c, 0xdb, 0xbf, 0x9e, 0x3b, 0x7a, 0x0a, 0x4a, 0xcd, - 0x30, 0xe8, 0xb4, 0x85, 0x0e, 0x56, 0x74, 0x58, 0xf1, 0x7c, 0xcc, 0x61, 0x74, 0x13, 0xb5, 0xe3, - 0xfa, 0x8d, 0xf4, 0x26, 0xea, 0xaa, 0xeb, 0x37, 0x30, 0x83, 0x0c, 0x50, 0x61, 0xf7, 0x1a, 0x8c, - 0x2c, 0x04, 0xad, 0x96, 0xe3, 0x37, 0xd0, 0x5b, 0x61, 0xa4, 0xce, 0x7f, 0x0a, 0x37, 0x20, 0x3b, - 0x70, 0x17, 0x50, 0x2c, 0x61, 0xe8, 0x2c, 0x0c, 0x39, 0x61, 0x53, 0xba, 0xfe, 0x58, 0x20, 0xdf, - 0x7c, 0xd8, 0x8c, 0x30, 0x6b, 0xb5, 0xff, 0xcc, 0x82, 0x09, 0xda, 0xc5, 0x65, 0x13, 0xcc, 0xa6, - 0xf6, 0x69, 0x18, 0x76, 0x3a, 0xf1, 0x76, 0xd0, 0xb3, 0x27, 0x9c, 0x67, 0xad, 0x58, 0x40, 0xe9, - 0x60, 0x55, 0xd1, 0x12, 0x63, 0xb0, 0x8b, 0xf4, 0xbb, 0x62, 0x10, 0x6a, 0x56, 0x47, 0x9d, 0xcd, - 0xac, 0x13, 0xdf, 0x1a, 0x6f, 0xc6, 0x12, 0x4e, 0x89, 0x6d, 0x06, 0x8d, 0xae, 0x08, 0x54, 0x56, - 0xc4, 0xaa, 0x41, 0xa3, 0x8b, 0x19, 0x04, 0x3d, 0x09, 0xc5, 0x68, 0xdb, 0x91, 0xb1, 0x05, 0x32, - 0xc8, 0xbe, 0x76, 0x79, 0x1e, 0xd3, 0x76, 0x95, 0x33, 0x12, 0x7a, 0xe9, 0x88, 0xe1, 0x64, 0xce, - 0x48, 0xe8, 0xd9, 0xff, 0x78, 0x08, 0x58, 0xcc, 0x90, 0x13, 0x92, 0xc6, 0x46, 0xc0, 0x6a, 0x62, - 0x1f, 0xeb, 0xd1, 0xbc, 0xde, 0x54, 0x3f, 0xcc, 0xc7, 0xf3, 0xc6, 0x11, 0x6d, 0xf1, 0x7e, 0x1f, - 0xd1, 0x66, 0x9f, 0xba, 0x0f, 0x3d, 0x44, 0xa7, 0xee, 0xf6, 0x67, 0x2d, 0x40, 0x2a, 0x02, 0x4c, - 0x87, 0xc5, 0xcc, 0x41, 0x45, 0x85, 0x9c, 0x89, 0xef, 0x45, 0x8b, 0x68, 0x09, 0xc0, 0x1a, 0x67, - 0x00, 0x4f, 0xca, 0x53, 0x52, 0x7f, 0x16, 0x93, 0xb2, 0x84, 0x69, 0x5d, 0xa1, 0x4e, 0xed, 0x5f, - 0x2e, 0xc0, 0x63, 0xdc, 0x74, 0x5b, 0x75, 0x7c, 0xa7, 0x49, 0x5a, 0x74, 0x54, 0x83, 0x06, 0x3a, - 0xd5, 0xe9, 0x16, 0xde, 0x95, 0xf9, 0x1e, 0x47, 0x95, 0x9d, 0x5c, 0xce, 0x70, 0xc9, 0xb2, 0xec, - 0xbb, 0x31, 0x66, 0xc4, 0x51, 0x04, 0x65, 0x79, 0x0d, 0x99, 0xd0, 0x85, 0x39, 0x31, 0x52, 0x6a, - 0x41, 0x58, 0x39, 0x04, 0x2b, 0x46, 0xd4, 0x94, 0xf1, 0x82, 0xfa, 0x0e, 0xfd, 0xe4, 0xd3, 0xa6, - 0xcc, 0x8a, 0x68, 0xc7, 0x0a, 0xc3, 0x6e, 0xc1, 0xa4, 0x9c, 0xc3, 0xf6, 0x55, 0xd2, 0xc5, 0x64, - 0x8b, 0xea, 0xff, 0xba, 0x6c, 0x32, 0x6e, 0x46, 0x53, 0xfa, 0x7f, 0xc1, 0x04, 0xe2, 0x24, 0xae, - 0x2c, 0x93, 0x5d, 0xc8, 0x2e, 0x93, 0x6d, 0xff, 0xb2, 0x05, 0x69, 0x03, 0x84, 0x39, 0xe0, 0xcc, - 0x6b, 0xce, 0xfa, 0xd5, 0xcf, 0x3f, 0x44, 0xe5, 0xdc, 0x0f, 0xc0, 0xa8, 0x13, 0x53, 0x0b, 0x93, - 0x7b, 0x83, 0x8a, 0xf7, 0x76, 0xfa, 0xb9, 0x1a, 0x34, 0xdc, 0x2d, 0x97, 0x79, 0x81, 0x4c, 0x72, - 0xf6, 0x5f, 0x2b, 0x41, 0x65, 0x31, 0xec, 0x1e, 0x3e, 0x53, 0xaf, 0x37, 0x0f, 0xaf, 0x70, 0xa8, - 0x3c, 0x3c, 0x99, 0xe9, 0x57, 0xec, 0x9b, 0xe9, 0x27, 0x33, 0xf5, 0x86, 0x1e, 0x54, 0xa6, 0x5e, - 0xe9, 0x21, 0xc9, 0xd4, 0x1b, 0x7e, 0x08, 0x32, 0xf5, 0x46, 0xee, 0x73, 0xa6, 0x9e, 0xfd, 0xdf, - 0x86, 0x60, 0xaa, 0x27, 0xe3, 0x1a, 0xbd, 0x00, 0x63, 0xea, 0x1b, 0x95, 0x07, 0x00, 0x15, 0x33, - 0xfc, 0x5e, 0xc3, 0x70, 0x02, 0x73, 0x00, 0x41, 0xbd, 0x0c, 0x8f, 0x86, 0xe4, 0xd5, 0x0e, 0xe9, - 0x90, 0xf9, 0xad, 0x98, 0x84, 0x35, 0x52, 0x0f, 0xfc, 0x06, 0x3f, 0x3a, 0x2d, 0x56, 0x1f, 0xbf, - 0xbb, 0x37, 0xf3, 0x28, 0xee, 0x05, 0xe3, 0xac, 0x3e, 0xa8, 0x0d, 0xe3, 0x9e, 0xb9, 0x73, 0x15, - 0x6b, 0xf8, 0x9e, 0x36, 0xbd, 0x4a, 0x56, 0x25, 0x9a, 0x71, 0x92, 0x41, 0x72, 0xfb, 0x5b, 0x7a, - 0x40, 0xdb, 0xdf, 0x4f, 0xe8, 0xed, 0x2f, 0x8f, 0x66, 0x7b, 0x7f, 0xce, 0x19, 0xf7, 0x83, 0xec, - 0x7f, 0x8f, 0xb2, 0xa3, 0x7d, 0x2f, 0x94, 0x65, 0xa4, 0xef, 0x40, 0x11, 0xb2, 0x26, 0x9d, 0x3e, - 0x9a, 0xfd, 0x47, 0x87, 0x20, 0xc3, 0x69, 0x43, 0x25, 0xad, 0xb6, 0xf6, 0x13, 0x92, 0xf6, 0x70, - 0x16, 0x3f, 0xba, 0xc3, 0xa3, 0x9c, 0xb9, 0x8d, 0xf7, 0x52, 0xde, 0x4e, 0x27, 0x1d, 0xf8, 0xac, - 0xf4, 0x9f, 0x0a, 0x7e, 0xbe, 0x00, 0xa0, 0x37, 0x8c, 0xc2, 0xd2, 0x57, 0x61, 0x4b, 0x7a, 0x5f, - 0x89, 0x0d, 0x2c, 0x16, 0x96, 0xe0, 0x47, 0xb1, 0xe3, 0x79, 0x97, 0x5d, 0x3f, 0x16, 0xd6, 0xbf, - 0x0e, 0x4b, 0xd0, 0x20, 0x6c, 0xe2, 0xa1, 0x2b, 0x80, 0xda, 0x7c, 0x5c, 0x86, 0xbf, 0x81, 0xc9, - 0x45, 0xc3, 0x9d, 0xb5, 0xde, 0x83, 0x81, 0x33, 0x7a, 0xa1, 0xf7, 0xaa, 0x93, 0xad, 0x91, 0x7b, - 0x49, 0xc7, 0x83, 0xde, 0x73, 0xab, 0x33, 0xef, 0x36, 0x96, 0xcd, 0x61, 0x96, 0xdb, 0x36, 0x9c, - 0x5e, 0x72, 0x63, 0x25, 0x79, 0xd5, 0x32, 0x67, 0x7b, 0x50, 0xa9, 0x20, 0xad, 0xbe, 0x0a, 0xd2, - 0xc8, 0xb3, 0x2d, 0x24, 0xd3, 0x82, 0xd3, 0x79, 0xb6, 0x76, 0x1d, 0x4e, 0x2e, 0xb9, 0xf1, 0x25, - 0xd7, 0x23, 0xc7, 0xc8, 0xe4, 0x97, 0x86, 0x61, 0xcc, 0x2c, 0x14, 0x72, 0x18, 0x73, 0xe2, 0x73, - 0x74, 0xf3, 0x24, 0x26, 0xc2, 0x55, 0x11, 0x1f, 0x37, 0x8f, 0x5c, 0xb5, 0x24, 0x7b, 0x72, 0x8d, - 0xfd, 0x93, 0xe6, 0x89, 0xcd, 0x01, 0xa0, 0xdb, 0x50, 0xda, 0x62, 0x29, 0xa3, 0xc5, 0x3c, 0x62, - 0xfc, 0xb2, 0x26, 0x5f, 0x0b, 0x0c, 0x9e, 0x74, 0xca, 0xf9, 0x51, 0x9b, 0x37, 0x4c, 0x96, 0x36, - 0x30, 0xd2, 0x77, 0x84, 0x31, 0xa5, 0x30, 0xfa, 0x29, 0xad, 0xd2, 0x3d, 0x28, 0xad, 0x84, 0x0a, - 0x19, 0x7e, 0x40, 0x2a, 0x84, 0xa5, 0xff, 0xc6, 0xdb, 0x6c, 0x47, 0x26, 0xf2, 0x0d, 0x47, 0xd8, - 0x24, 0x18, 0xe9, 0xbf, 0x09, 0x30, 0x4e, 0xe3, 0xa3, 0x8f, 0x2a, 0x25, 0x54, 0xce, 0xe3, 0x44, - 0xcd, 0x5c, 0xd1, 0xc7, 0xad, 0x7f, 0x3e, 0x5b, 0x80, 0x89, 0x25, 0xbf, 0xb3, 0xbe, 0xb4, 0xde, - 0xd9, 0xf4, 0xdc, 0xfa, 0x55, 0xd2, 0xa5, 0x4a, 0x66, 0x87, 0x74, 0x97, 0x17, 0xd3, 0xae, 0xa8, - 0xab, 0xb4, 0x11, 0x73, 0x18, 0x15, 0xab, 0x5b, 0xae, 0xdf, 0x24, 0x61, 0x3b, 0x74, 0xc5, 0x61, - 0x97, 0x21, 0x56, 0x2f, 0x69, 0x10, 0x36, 0xf1, 0x28, 0xed, 0xe0, 0xb6, 0xaf, 0xaa, 0xb6, 0x29, - 0xda, 0x6b, 0xb4, 0x11, 0x73, 0x18, 0x45, 0x8a, 0xc3, 0x8e, 0xf0, 0x25, 0x1b, 0x48, 0x1b, 0xb4, - 0x11, 0x73, 0x98, 0x70, 0x0d, 0xb1, 0x10, 0xca, 0x52, 0x8f, 0x6b, 0x88, 0x45, 0x11, 0x49, 0x38, - 0x45, 0xdd, 0x21, 0xdd, 0x45, 0x27, 0x76, 0xd2, 0x9e, 0x9d, 0xab, 0xbc, 0x19, 0x4b, 0x38, 0x2b, - 0x3d, 0x9f, 0x9c, 0x8e, 0x6f, 0xb8, 0xd2, 0xf3, 0xc9, 0xe1, 0xf7, 0xf1, 0x48, 0x7e, 0xa5, 0x00, - 0x63, 0x6f, 0xde, 0x96, 0xbd, 0xcf, 0xf5, 0x68, 0x37, 0x61, 0xaa, 0xa7, 0xf8, 0xc0, 0x00, 0x06, - 0xda, 0x81, 0xd5, 0x64, 0x6c, 0x0c, 0xa3, 0x94, 0xb0, 0x2c, 0xbd, 0xba, 0x00, 0x53, 0xfc, 0x23, - 0xa6, 0x9c, 0x58, 0x2e, 0xb9, 0x2a, 0x28, 0xc1, 0x4e, 0x75, 0x6f, 0xa4, 0x81, 0xb8, 0x17, 0xdf, - 0xfe, 0x21, 0x0b, 0xc6, 0x13, 0xf5, 0x20, 0x72, 0x32, 0x25, 0xd9, 0x57, 0x1e, 0xb0, 0x34, 0x00, - 0x96, 0x96, 0x95, 0x8a, 0xe9, 0xbc, 0xa4, 0x41, 0xd8, 0xc4, 0xb3, 0x7f, 0xa3, 0x08, 0x65, 0x19, - 0x7a, 0x38, 0xc0, 0x50, 0x3e, 0x63, 0xc1, 0xb8, 0x3a, 0x49, 0x67, 0x76, 0x56, 0x21, 0x8f, 0xa4, - 0x54, 0x3a, 0x02, 0xe5, 0xbc, 0xf3, 0xb7, 0x02, 0xbd, 0xaf, 0xc1, 0x26, 0x33, 0x9c, 0xe4, 0x8d, - 0x6e, 0x00, 0x44, 0xdd, 0x28, 0x26, 0x2d, 0xe3, 0x10, 0xc6, 0x36, 0x56, 0xd9, 0x6c, 0x3d, 0x08, - 0x09, 0x5d, 0x53, 0xd7, 0x82, 0x06, 0xa9, 0x29, 0x4c, 0x6d, 0x88, 0xea, 0x36, 0x6c, 0x50, 0x42, - 0xaf, 0xa9, 0xb8, 0x8f, 0xa1, 0x3c, 0xf4, 0xbb, 0x9c, 0xdf, 0x41, 0x02, 0x3f, 0x8e, 0x10, 0x68, - 0x61, 0xff, 0x74, 0x01, 0x4e, 0xa4, 0x67, 0x12, 0xbd, 0x1f, 0xc6, 0xe4, 0xa4, 0x19, 0x3e, 0x2e, - 0x19, 0xef, 0x39, 0x86, 0x0d, 0xd8, 0x1b, 0x7b, 0x33, 0x33, 0x3a, 0xee, 0x73, 0x8e, 0x4e, 0xde, - 0xdc, 0xae, 0x11, 0x1a, 0x4b, 0x97, 0x41, 0x82, 0x18, 0x8f, 0xc2, 0x10, 0xe1, 0x42, 0xd5, 0xee, - 0x7c, 0xbb, 0x2d, 0x42, 0x29, 0x8c, 0x28, 0x0c, 0x13, 0x8a, 0x53, 0xd8, 0x68, 0x1d, 0x4e, 0x1a, - 0x2d, 0xd7, 0x88, 0xdb, 0xdc, 0xde, 0x0c, 0x42, 0xb9, 0xad, 0x3e, 0xab, 0xa3, 0xd2, 0x7b, 0x71, - 0x70, 0x66, 0x4f, 0x6a, 0x20, 0xd5, 0x9d, 0xb6, 0x53, 0x77, 0xe3, 0xae, 0x38, 0x0c, 0x53, 0xe2, - 0x7c, 0x41, 0xb4, 0x63, 0x85, 0x61, 0xff, 0xed, 0x21, 0x38, 0xc1, 0xc3, 0xb0, 0x89, 0xca, 0x32, - 0x40, 0xef, 0x87, 0x4a, 0x14, 0x3b, 0x21, 0xf7, 0xa8, 0x59, 0x87, 0x16, 0x5d, 0xba, 0x88, 0x85, - 0x24, 0x82, 0x35, 0x3d, 0xf4, 0x32, 0xab, 0x95, 0xe8, 0x46, 0xdb, 0x8c, 0x7a, 0xe1, 0xde, 0xfc, - 0x75, 0x97, 0x14, 0x05, 0x6c, 0x50, 0x43, 0xdf, 0x0e, 0xa5, 0xf6, 0xb6, 0x13, 0x49, 0x67, 0xf2, - 0xd3, 0x52, 0x4e, 0xac, 0xd3, 0xc6, 0x37, 0xf6, 0x66, 0x4e, 0xa5, 0x1f, 0x95, 0x01, 0x30, 0xef, - 0x64, 0x4a, 0xf9, 0xa1, 0x03, 0xa4, 0xfc, 0xd3, 0x30, 0xdc, 0x08, 0xbb, 0xb5, 0xcb, 0xf3, 0xe9, - 0x2b, 0xaf, 0x16, 0x59, 0x2b, 0x16, 0x50, 0x2a, 0x93, 0xb6, 0x39, 0xcb, 0x06, 0x45, 0x1e, 0x4e, - 0x5a, 0x1e, 0x97, 0x35, 0x08, 0x9b, 0x78, 0xac, 0x6e, 0x59, 0x2a, 0x48, 0x7f, 0xe4, 0x18, 0x92, - 0xb8, 0x06, 0x0d, 0xcf, 0xbf, 0x08, 0x15, 0x31, 0xd4, 0x8d, 0x00, 0xbd, 0x00, 0x63, 0xdc, 0x57, - 0x59, 0x0d, 0x1d, 0xbf, 0xbe, 0x9d, 0xf6, 0x31, 0x6d, 0x18, 0x30, 0x9c, 0xc0, 0xb4, 0x57, 0x61, - 0x68, 0x40, 0x21, 0x3b, 0x90, 0xeb, 0xe0, 0xbd, 0x50, 0xa6, 0xe4, 0xe4, 0x46, 0x2d, 0x0f, 0x92, - 0x01, 0x94, 0xe5, 0x5d, 0xb9, 0xc8, 0x86, 0xa2, 0xeb, 0xc8, 0xa0, 0x2a, 0xf5, 0x09, 0x2d, 0x47, - 0x51, 0x87, 0x2d, 0x3b, 0x0a, 0x44, 0x4f, 0x41, 0x91, 0xdc, 0x69, 0xa7, 0xa3, 0xa7, 0x2e, 0xde, - 0x69, 0xbb, 0x21, 0x89, 0x28, 0x12, 0xb9, 0xd3, 0x46, 0x67, 0xa0, 0xe0, 0x36, 0xc4, 0x8a, 0x04, - 0x81, 0x53, 0x58, 0x5e, 0xc4, 0x05, 0xb7, 0x61, 0xdf, 0x81, 0x8a, 0xba, 0x9c, 0x17, 0xed, 0x48, - 0xd3, 0xca, 0xca, 0x23, 0x9c, 0x5e, 0xd2, 0xed, 0x63, 0x54, 0x75, 0x00, 0x74, 0x4d, 0x94, 0xbc, - 0x54, 0xf0, 0x79, 0x18, 0xaa, 0x07, 0xa2, 0xae, 0x55, 0x59, 0x93, 0x61, 0xb6, 0x14, 0x83, 0xd8, - 0x37, 0x61, 0xe2, 0xaa, 0x1f, 0xdc, 0x66, 0xd7, 0xe4, 0xb1, 0xaa, 0xf0, 0x94, 0xf0, 0x16, 0xfd, - 0x91, 0xb6, 0xe0, 0x19, 0x14, 0x73, 0x98, 0xaa, 0xfd, 0x5c, 0xe8, 0x57, 0xfb, 0xd9, 0xfe, 0x98, - 0x05, 0x63, 0xca, 0x59, 0xbc, 0xb4, 0xbb, 0x33, 0xd8, 0x21, 0xb5, 0x51, 0x75, 0xa4, 0x70, 0x40, - 0xd5, 0x11, 0x79, 0x9e, 0x5d, 0xec, 0x77, 0x9e, 0x6d, 0xff, 0x85, 0x05, 0x27, 0xd4, 0x10, 0xa4, - 0xcd, 0xf4, 0x02, 0x8c, 0x6d, 0x76, 0x5c, 0xaf, 0x21, 0xcb, 0xdd, 0xa7, 0x3e, 0x97, 0xaa, 0x01, - 0xc3, 0x09, 0x4c, 0x74, 0x01, 0x60, 0xd3, 0xf5, 0x9d, 0xb0, 0xbb, 0xae, 0x8d, 0x34, 0xa5, 0xb7, - 0xab, 0x0a, 0x82, 0x0d, 0x2c, 0xf4, 0x11, 0x28, 0xef, 0xca, 0x30, 0x86, 0x62, 0xae, 0xc5, 0x32, - 0xc4, 0x7c, 0xe8, 0x2f, 0x41, 0xc5, 0x45, 0x28, 0x8e, 0xf6, 0xe7, 0x8b, 0x30, 0x91, 0x2c, 0x70, - 0x31, 0x80, 0x07, 0xe5, 0x29, 0x28, 0xb1, 0x9a, 0x17, 0xe9, 0x85, 0xc5, 0xeb, 0xd3, 0x73, 0x18, - 0x8a, 0x60, 0x98, 0x8b, 0x92, 0x7c, 0x6e, 0x72, 0x56, 0x83, 0x54, 0x6e, 0x64, 0xe6, 0xb7, 0x12, - 0x67, 0x32, 0x82, 0x15, 0xfa, 0x3e, 0x0b, 0x46, 0x82, 0xb6, 0x59, 0x74, 0xf8, 0xa5, 0x3c, 0x8b, - 0x7f, 0x88, 0x0c, 0x7b, 0x61, 0x0d, 0xa9, 0x85, 0x27, 0x17, 0x83, 0x64, 0x7d, 0xe6, 0xdb, 0x60, - 0xcc, 0xc4, 0x3c, 0xc8, 0x20, 0x2a, 0x9b, 0x06, 0xd1, 0x67, 0xcc, 0x25, 0x29, 0xca, 0x9b, 0x0c, - 0xf0, 0xb1, 0x5f, 0x87, 0x52, 0x5d, 0xc5, 0x85, 0xde, 0xd3, 0x15, 0x2d, 0xaa, 0x72, 0x20, 0x8b, - 0xb9, 0xe1, 0xd4, 0xec, 0xdf, 0xb3, 0x8c, 0xf5, 0x81, 0x49, 0xb4, 0xdc, 0x40, 0x21, 0x14, 0x9b, - 0xbb, 0x3b, 0xc2, 0xc8, 0xb8, 0x92, 0xd3, 0xf4, 0x2e, 0xed, 0xee, 0xe8, 0x2f, 0xcc, 0x6c, 0xc5, - 0x94, 0xd9, 0x00, 0x67, 0x1d, 0x89, 0x2a, 0x38, 0xc5, 0x83, 0xab, 0xe0, 0xd8, 0xaf, 0x17, 0x60, - 0xaa, 0x67, 0x51, 0xa1, 0xd7, 0xa0, 0x14, 0xd2, 0xa7, 0x14, 0x8f, 0xb7, 0x92, 0x5b, 0xdd, 0x9a, - 0x68, 0xb9, 0xa1, 0x95, 0x77, 0xb2, 0x1d, 0x73, 0x96, 0xe8, 0x0a, 0x20, 0x1d, 0xbd, 0xac, 0x0e, - 0x5a, 0xf8, 0x23, 0x2b, 0x9f, 0xf0, 0x7c, 0x0f, 0x06, 0xce, 0xe8, 0x85, 0x5e, 0x4c, 0x9f, 0xd7, - 0xa4, 0xca, 0xd8, 0xef, 0x77, 0xf4, 0x62, 0x7f, 0xc1, 0x5c, 0x82, 0x37, 0xb4, 0x30, 0x3d, 0xea, - 0xe6, 0xb4, 0x47, 0xb2, 0x16, 0x07, 0x95, 0xac, 0xf6, 0x2f, 0x14, 0x60, 0x3c, 0x51, 0x96, 0x1a, - 0x79, 0x50, 0x26, 0x1e, 0x0b, 0x2b, 0x90, 0xda, 0xf7, 0xa8, 0xb7, 0x6a, 0x29, 0x39, 0x79, 0x51, - 0xd0, 0xc5, 0x8a, 0xc3, 0xc3, 0x11, 0x8c, 0xf9, 0x02, 0x8c, 0xc9, 0x01, 0xbd, 0xe4, 0xb4, 0xbc, - 0xf4, 0xf4, 0x5d, 0x34, 0x60, 0x38, 0x81, 0x69, 0xff, 0x4a, 0x11, 0xa6, 0x79, 0x1c, 0x46, 0x43, - 0x7d, 0x0c, 0x2a, 0x9e, 0xea, 0x07, 0x75, 0xf1, 0x78, 0x3e, 0x91, 0x9b, 0x47, 0xbd, 0xc4, 0x32, - 0x9b, 0xd1, 0x40, 0x39, 0x04, 0x5f, 0x49, 0xe5, 0x10, 0xf0, 0xad, 0x7a, 0xf3, 0x98, 0x46, 0xf4, - 0x8d, 0x95, 0x54, 0xf0, 0xf7, 0x0a, 0x30, 0x99, 0xba, 0x21, 0x14, 0x7d, 0x3e, 0x79, 0xa9, 0x94, - 0x95, 0xc7, 0x29, 0xe5, 0xbe, 0x97, 0x46, 0x1e, 0xee, 0x6a, 0xa9, 0x07, 0xf4, 0xa9, 0xd8, 0xbf, - 0x53, 0x80, 0x89, 0xe4, 0xd5, 0xa6, 0x0f, 0xe1, 0x4c, 0xbd, 0x1d, 0x2a, 0xec, 0xf6, 0xbe, 0xab, - 0xa4, 0x2b, 0x0f, 0x43, 0xf9, 0x45, 0x69, 0xb2, 0x11, 0x6b, 0xf8, 0x43, 0x71, 0x63, 0x97, 0xfd, - 0x0f, 0x2c, 0x38, 0xc5, 0x9f, 0x32, 0xbd, 0x0e, 0x7f, 0x38, 0x6b, 0x76, 0x5f, 0xc9, 0x77, 0x80, - 0xa9, 0x4b, 0x0f, 0x0e, 0x9a, 0x5f, 0x6a, 0xbc, 0x9c, 0x14, 0xa3, 0x4d, 0x2e, 0x85, 0x87, 0x70, - 0xb0, 0x87, 0x5a, 0x0c, 0xf6, 0xbf, 0x2b, 0xc0, 0xe8, 0xda, 0xc2, 0xb2, 0x12, 0xe1, 0x73, 0x50, - 0xa9, 0x87, 0xc4, 0xd1, 0xee, 0x1f, 0x33, 0xca, 0x4f, 0x02, 0xb0, 0xc6, 0xa1, 0xbb, 0x28, 0x1e, - 0x25, 0x1b, 0xa5, 0x77, 0x51, 0x3c, 0x88, 0x36, 0xc2, 0x12, 0x8e, 0x9e, 0x85, 0x32, 0x4b, 0xc1, - 0xbf, 0x1e, 0x4a, 0x8d, 0xa3, 0xb7, 0xd6, 0xac, 0x1d, 0xaf, 0x60, 0x85, 0x41, 0x09, 0x37, 0x82, - 0x7a, 0x44, 0x91, 0x53, 0x1e, 0x99, 0x45, 0xda, 0x8c, 0x57, 0xb0, 0x84, 0xb3, 0x62, 0xaa, 0xcc, - 0x6b, 0x41, 0x91, 0x4b, 0xc9, 0x41, 0x73, 0xf7, 0x06, 0x45, 0xd7, 0x38, 0x87, 0x29, 0xba, 0x9b, - 0xca, 0x67, 0x1d, 0x19, 0x2c, 0x9f, 0xd5, 0xfe, 0x9d, 0x22, 0x54, 0xb4, 0x53, 0xcd, 0x15, 0x85, - 0x67, 0x72, 0xb9, 0x54, 0xa3, 0xd6, 0xf5, 0xeb, 0x8a, 0x34, 0x0f, 0x7a, 0x30, 0xea, 0xce, 0xfc, - 0x80, 0x05, 0xa3, 0xae, 0xef, 0xc6, 0xae, 0xc3, 0x7c, 0x83, 0x42, 0x6e, 0xae, 0xe7, 0x54, 0x98, - 0x64, 0x99, 0x53, 0x0e, 0x42, 0x33, 0x32, 0x41, 0x31, 0xc3, 0x26, 0x67, 0xf4, 0x61, 0x91, 0x3e, - 0x59, 0xcc, 0xad, 0x7a, 0x53, 0x39, 0x95, 0x33, 0xd9, 0xa6, 0x36, 0x76, 0x1c, 0xe6, 0x54, 0xf4, - 0x0c, 0x53, 0x52, 0xea, 0x72, 0x27, 0xb5, 0x8b, 0x61, 0xcd, 0x98, 0x33, 0xb2, 0x23, 0x40, 0xbd, - 0x73, 0x71, 0xc8, 0xd4, 0xb4, 0x39, 0xa8, 0x38, 0x9d, 0x38, 0x68, 0xd1, 0x69, 0x12, 0x81, 0x03, - 0x3a, 0xf9, 0x4e, 0x02, 0xb0, 0xc6, 0xb1, 0xbf, 0x54, 0x82, 0x54, 0x19, 0x18, 0x74, 0x07, 0x2a, - 0xaa, 0x10, 0x4c, 0x3e, 0xa9, 0xde, 0x7a, 0x45, 0xa9, 0xc1, 0xa8, 0x26, 0xac, 0x99, 0xa1, 0x40, - 0xba, 0x59, 0xf9, 0xd7, 0xfe, 0x52, 0xda, 0xcd, 0x7a, 0xf9, 0x70, 0xa7, 0x6f, 0x74, 0xcd, 0xce, - 0xf1, 0x02, 0xa0, 0xb3, 0x07, 0x7a, 0x66, 0x8b, 0x07, 0x78, 0x66, 0x3f, 0x2e, 0xae, 0x81, 0xc4, - 0x24, 0xea, 0x78, 0xb1, 0x58, 0x15, 0xef, 0xcd, 0xf1, 0x6b, 0xe3, 0x84, 0x75, 0x59, 0x35, 0xfe, - 0x1f, 0x1b, 0x4c, 0x93, 0xfe, 0xf3, 0xe1, 0x63, 0xf5, 0x9f, 0x8f, 0xe4, 0xea, 0x3f, 0xbf, 0x00, - 0xc0, 0xd6, 0x38, 0x4f, 0xa5, 0x29, 0x33, 0xb7, 0xa6, 0x52, 0x35, 0x58, 0x41, 0xb0, 0x81, 0x65, - 0x7f, 0x0b, 0x24, 0xeb, 0x02, 0xa2, 0x19, 0x59, 0x86, 0x90, 0x9f, 0x0c, 0xb2, 0x2c, 0xe6, 0x44, - 0xc5, 0xc0, 0x9f, 0xb3, 0xc0, 0x2c, 0x5e, 0x88, 0x5e, 0xe5, 0x55, 0x12, 0xad, 0x3c, 0x4e, 0x9a, - 0x0c, 0xba, 0xb3, 0xab, 0x4e, 0x3b, 0x15, 0x9c, 0x25, 0x4b, 0x25, 0x9e, 0x79, 0x37, 0x94, 0x25, - 0xf4, 0x50, 0x46, 0xf3, 0x47, 0xe1, 0x51, 0x59, 0x11, 0x45, 0x1e, 0x0a, 0x89, 0x28, 0x84, 0xfb, - 0x93, 0x10, 0xf3, 0xf3, 0x16, 0x9c, 0x4f, 0x0f, 0x20, 0x5a, 0x0d, 0x7c, 0x37, 0x0e, 0xc2, 0x1a, - 0x89, 0x63, 0xd7, 0x6f, 0xb2, 0x62, 0xd6, 0xb7, 0x9d, 0x50, 0x5e, 0x02, 0xc7, 0x04, 0xe6, 0x4d, - 0x27, 0xf4, 0x31, 0x6b, 0x45, 0x5d, 0x18, 0xe6, 0xf1, 0xfe, 0x62, 0x37, 0x74, 0xc4, 0x6f, 0x23, - 0x63, 0x3a, 0xf4, 0x76, 0x8c, 0xe7, 0x1a, 0x60, 0xc1, 0xd0, 0xfe, 0x9a, 0x05, 0x68, 0x6d, 0x97, - 0x84, 0xa1, 0xdb, 0x30, 0x32, 0x14, 0xd8, 0x75, 0xca, 0xc6, 0xb5, 0xc9, 0x66, 0x99, 0x9f, 0xd4, - 0x75, 0xca, 0xc6, 0xbf, 0xec, 0xeb, 0x94, 0x0b, 0x87, 0xbb, 0x4e, 0x19, 0xad, 0xc1, 0xa9, 0x16, - 0xdf, 0xce, 0xf1, 0x2b, 0x4a, 0xf9, 0xde, 0x4e, 0x95, 0x96, 0x38, 0x7d, 0x77, 0x6f, 0xe6, 0xd4, - 0x6a, 0x16, 0x02, 0xce, 0xee, 0x67, 0xbf, 0x1b, 0x10, 0x8f, 0xd4, 0x5d, 0xc8, 0x8a, 0xae, 0xed, - 0xeb, 0xee, 0xb0, 0xbf, 0x5c, 0x82, 0xc9, 0xd4, 0x15, 0x41, 0x74, 0x2b, 0xdd, 0x1b, 0xce, 0x7b, - 0x64, 0x3d, 0xde, 0x3b, 0xbc, 0x81, 0x02, 0x84, 0x7d, 0x28, 0xb9, 0x7e, 0xbb, 0x13, 0xe7, 0x53, - 0xd9, 0x86, 0x0f, 0x62, 0x99, 0x12, 0x34, 0xce, 0x27, 0xe8, 0x5f, 0xcc, 0xd9, 0xe4, 0x19, 0x6e, - 0x9c, 0xd8, 0xec, 0x0c, 0x3d, 0x20, 0x77, 0xcb, 0xc7, 0x75, 0xf0, 0x6f, 0x29, 0x0f, 0x5f, 0x72, - 0x6a, 0xb1, 0x1c, 0x77, 0xe8, 0xd5, 0xcf, 0x14, 0x60, 0xd4, 0x78, 0x69, 0xe8, 0xc7, 0x92, 0xa5, - 0x7d, 0xad, 0xfc, 0x1e, 0x89, 0xd1, 0x9f, 0xd5, 0xc5, 0x7b, 0xf9, 0x23, 0x3d, 0xdd, 0x5b, 0xd5, - 0xf7, 0x8d, 0xbd, 0x99, 0x13, 0xa9, 0xba, 0xbd, 0x89, 0x4a, 0xbf, 0x67, 0xbe, 0x1b, 0x26, 0x53, - 0x64, 0x32, 0x1e, 0x79, 0xc3, 0x7c, 0xe4, 0x23, 0xbb, 0xfd, 0xcc, 0x29, 0xfb, 0x29, 0x3a, 0x65, - 0xa2, 0xa0, 0x46, 0xe0, 0x91, 0x01, 0x7c, 0x9e, 0xa9, 0x7d, 0x46, 0x61, 0xc0, 0xba, 0x39, 0xcf, - 0x40, 0xb9, 0x1d, 0x78, 0x6e, 0xdd, 0x55, 0x37, 0x03, 0xb0, 0x4a, 0x3d, 0xeb, 0xa2, 0x0d, 0x2b, - 0x28, 0xba, 0x0d, 0x95, 0x5b, 0xb7, 0x63, 0x7e, 0xdc, 0x28, 0x8e, 0x34, 0xf2, 0x3a, 0x65, 0x54, - 0x46, 0x8b, 0x3a, 0xcf, 0xc4, 0x9a, 0x17, 0xb2, 0x61, 0x98, 0x29, 0x41, 0x99, 0x5c, 0xcb, 0x8e, - 0x5b, 0x98, 0x76, 0x8c, 0xb0, 0x80, 0xd8, 0xff, 0x66, 0x14, 0x4e, 0x66, 0xdd, 0xd3, 0x86, 0x3e, - 0x02, 0xc3, 0x7c, 0x8c, 0xf9, 0x5c, 0x05, 0x9a, 0xc5, 0x63, 0x89, 0x11, 0x14, 0xc3, 0x62, 0xbf, - 0xb1, 0xe0, 0x29, 0xb8, 0x7b, 0xce, 0xa6, 0x58, 0x21, 0xc7, 0xc3, 0x7d, 0xc5, 0xd1, 0xdc, 0x57, - 0x1c, 0xce, 0xdd, 0x73, 0x36, 0xd1, 0x1d, 0x28, 0x35, 0xdd, 0x98, 0x38, 0xc2, 0x49, 0x73, 0xf3, - 0x58, 0x98, 0x13, 0x87, 0x5b, 0x69, 0xec, 0x27, 0xe6, 0x0c, 0xd1, 0x57, 0x2d, 0x98, 0xdc, 0x4c, - 0x16, 0xec, 0x12, 0xc2, 0xd3, 0x39, 0x86, 0xbb, 0xf8, 0x92, 0x8c, 0xf8, 0x7d, 0xe2, 0xa9, 0x46, - 0x9c, 0x1e, 0x0e, 0xfa, 0x84, 0x05, 0x23, 0x5b, 0xae, 0x67, 0x5c, 0xe1, 0x73, 0x0c, 0x2f, 0xe7, - 0x12, 0x63, 0xa0, 0x77, 0x1c, 0xfc, 0x7f, 0x84, 0x25, 0xe7, 0x7e, 0x9a, 0x6a, 0xf8, 0xa8, 0x9a, - 0x6a, 0xe4, 0x01, 0x69, 0xaa, 0x4f, 0x59, 0x50, 0x51, 0x33, 0x2d, 0x0a, 0x1f, 0xbd, 0xff, 0x18, - 0x5f, 0x39, 0xf7, 0x4c, 0xa9, 0xbf, 0x58, 0x33, 0x47, 0x5f, 0xb0, 0x60, 0xd4, 0x79, 0xad, 0x13, - 0x92, 0x06, 0xd9, 0x0d, 0xda, 0x91, 0xa8, 0x64, 0xfc, 0x4a, 0xfe, 0x83, 0x99, 0xa7, 0x4c, 0x16, - 0xc9, 0xee, 0x5a, 0x3b, 0x12, 0x89, 0xff, 0xba, 0x01, 0x9b, 0x43, 0x40, 0xdf, 0xaf, 0xf5, 0x38, - 0xe4, 0x51, 0xcf, 0x3e, 0x6b, 0x34, 0x03, 0xd5, 0xb1, 0x20, 0xf0, 0x44, 0x3d, 0xf0, 0x63, 0xd7, - 0xef, 0x90, 0x35, 0x1f, 0x93, 0x76, 0x70, 0x2d, 0x88, 0x2f, 0x05, 0x1d, 0xbf, 0x71, 0x31, 0x0c, - 0x83, 0x90, 0x55, 0x76, 0x32, 0x6e, 0x80, 0x5e, 0xe8, 0x8f, 0x8a, 0xf7, 0xa3, 0x73, 0x14, 0x9b, - 0x61, 0xaf, 0x00, 0x33, 0x07, 0x4c, 0x36, 0x7a, 0x01, 0xc6, 0x82, 0xb0, 0xe9, 0xf8, 0xee, 0x6b, - 0x66, 0xb1, 0x42, 0x65, 0x90, 0xae, 0x19, 0x30, 0x9c, 0xc0, 0x34, 0xab, 0x58, 0x15, 0x0e, 0xa8, - 0x62, 0x75, 0x1e, 0x86, 0x42, 0xd2, 0x0e, 0xd2, 0xfb, 0x2a, 0x96, 0x1f, 0xcb, 0x20, 0xe8, 0x49, - 0x28, 0x3a, 0x6d, 0x57, 0x38, 0x19, 0xd5, 0x76, 0x71, 0x7e, 0x7d, 0x19, 0xd3, 0xf6, 0x44, 0x51, - 0xbd, 0xd2, 0x7d, 0x29, 0xaa, 0x47, 0x35, 0xa6, 0x38, 0x46, 0x1b, 0xd6, 0x1a, 0x33, 0x79, 0xbc, - 0x65, 0xbf, 0x5e, 0x84, 0x27, 0xf7, 0xfd, 0xb4, 0x74, 0x08, 0xbb, 0xb5, 0x4f, 0x08, 0xbb, 0x9c, - 0x9e, 0xc2, 0x41, 0xd3, 0x53, 0xec, 0x33, 0x3d, 0x9f, 0xa0, 0x12, 0x43, 0x16, 0x79, 0x14, 0x4a, - 0xe2, 0x88, 0x69, 0x05, 0xfd, 0x6a, 0x46, 0x0a, 0x61, 0x21, 0xa1, 0x58, 0xf3, 0xa5, 0xdb, 0xa5, - 0x44, 0x05, 0xa7, 0x52, 0x1e, 0x1a, 0xb3, 0x6f, 0xa1, 0x45, 0x2e, 0x26, 0xfa, 0x95, 0x85, 0xb2, - 0x7f, 0x71, 0x08, 0x9e, 0x1a, 0x40, 0xd1, 0x99, 0xab, 0xd8, 0x1a, 0x70, 0x15, 0x7f, 0x83, 0xbf, - 0xa6, 0x4f, 0x66, 0xbe, 0x26, 0x9c, 0xff, 0x6b, 0xda, 0xff, 0x0d, 0xb1, 0x93, 0x08, 0x3f, 0x22, - 0xf5, 0x4e, 0x48, 0x44, 0xaa, 0x9c, 0x3e, 0x89, 0x10, 0xed, 0x58, 0x61, 0xd0, 0xed, 0x6f, 0xdd, - 0xa1, 0x9f, 0xff, 0x48, 0x4e, 0x15, 0x7b, 0xcc, 0x3c, 0x7c, 0x6e, 0x7d, 0x2d, 0xcc, 0x53, 0x09, - 0xc0, 0xd9, 0xd8, 0xbf, 0x6a, 0xc1, 0x99, 0xfe, 0xd6, 0x08, 0x7a, 0x0e, 0x46, 0x37, 0x59, 0x50, - 0xe5, 0x2a, 0x0b, 0x9d, 0x12, 0x4b, 0x87, 0x3d, 0xaf, 0x6e, 0xc6, 0x26, 0x0e, 0x5a, 0x80, 0x29, - 0x33, 0x1a, 0x73, 0xd5, 0x88, 0xb9, 0x62, 0xfe, 0x92, 0x8d, 0x34, 0x10, 0xf7, 0xe2, 0xa3, 0x59, - 0x80, 0xd8, 0x8d, 0x3d, 0xc2, 0x7b, 0xf3, 0x85, 0xc6, 0x1c, 0x8a, 0x1b, 0xaa, 0x15, 0x1b, 0x18, - 0xf6, 0xd7, 0x8b, 0xd9, 0x8f, 0xc1, 0xad, 0xdc, 0xc3, 0xac, 0x7e, 0xb1, 0xb6, 0x0b, 0x03, 0x48, - 0xe8, 0xe2, 0xfd, 0x96, 0xd0, 0x43, 0xfd, 0x24, 0x34, 0x5a, 0x84, 0x13, 0xc6, 0x9d, 0xd2, 0xbc, - 0xe6, 0x13, 0x3f, 0x9c, 0x52, 0x05, 0x1b, 0xd7, 0x53, 0x70, 0xdc, 0xd3, 0xe3, 0x21, 0x5f, 0xaa, - 0xbf, 0x56, 0x80, 0xd3, 0x7d, 0x37, 0x16, 0xf7, 0x49, 0x03, 0x99, 0xaf, 0x7f, 0xe8, 0xfe, 0xbc, - 0x7e, 0xf3, 0xa5, 0x94, 0x0e, 0x7c, 0x29, 0x83, 0xa8, 0xf3, 0xdf, 0x2d, 0xf4, 0xfd, 0x58, 0xe8, - 0x46, 0xf4, 0x2f, 0xed, 0x4c, 0xbe, 0x08, 0xe3, 0x4e, 0xbb, 0xcd, 0xf1, 0x58, 0x86, 0x46, 0xaa, - 0x88, 0xec, 0xbc, 0x09, 0xc4, 0x49, 0xdc, 0x81, 0x26, 0xf6, 0x0f, 0x2d, 0xa8, 0x60, 0xb2, 0xc5, - 0x25, 0x1c, 0xba, 0x25, 0xa6, 0xc8, 0xca, 0xe3, 0x06, 0x10, 0x3a, 0xb1, 0x91, 0xcb, 0xea, 0x44, - 0x64, 0x4d, 0xf6, 0x51, 0xcb, 0x80, 0xa8, 0x0b, 0x99, 0x8b, 0xfd, 0x2f, 0x64, 0xb6, 0xff, 0x7c, - 0x8c, 0x3e, 0x5e, 0x3b, 0x58, 0x08, 0x49, 0x23, 0xa2, 0xef, 0xb7, 0x13, 0x7a, 0x62, 0x91, 0xa8, - 0xf7, 0x7b, 0x1d, 0xaf, 0x60, 0xda, 0x9e, 0x38, 0xa7, 0x2c, 0x1c, 0xaa, 0x84, 0x66, 0xf1, 0xc0, - 0x12, 0x9a, 0x2f, 0xc2, 0x78, 0x14, 0x6d, 0xaf, 0x87, 0xee, 0xae, 0x13, 0x93, 0xab, 0x44, 0xd6, - 0xb7, 0xd2, 0xe5, 0xe4, 0x6a, 0x97, 0x35, 0x10, 0x27, 0x71, 0xd1, 0x12, 0x4c, 0xe9, 0x42, 0x96, - 0x24, 0x8c, 0x59, 0x0a, 0x24, 0x5f, 0x09, 0xaa, 0x76, 0x91, 0x2e, 0x7d, 0x29, 0x10, 0x70, 0x6f, - 0x1f, 0x2a, 0x73, 0x13, 0x8d, 0x74, 0x20, 0xc3, 0x49, 0x99, 0x9b, 0xa0, 0x43, 0xc7, 0xd2, 0xd3, - 0x03, 0xad, 0xc2, 0xa3, 0x7c, 0x61, 0xcc, 0xb7, 0xdb, 0xc6, 0x13, 0x8d, 0x24, 0xaf, 0x5d, 0x58, - 0xea, 0x45, 0xc1, 0x59, 0xfd, 0xd0, 0xf3, 0x30, 0xaa, 0x9a, 0x97, 0x17, 0xc5, 0xd1, 0x9a, 0x72, - 0xed, 0x29, 0x32, 0xcb, 0x0d, 0x6c, 0xe2, 0xa1, 0x97, 0xe0, 0x71, 0xfd, 0x97, 0x67, 0xfc, 0xf3, - 0x73, 0xe7, 0x45, 0x51, 0x23, 0x58, 0xdd, 0xea, 0xb7, 0x94, 0x89, 0xd6, 0xc0, 0xfd, 0xfa, 0xa3, - 0x4d, 0x38, 0xa3, 0x40, 0x17, 0xfd, 0x98, 0x25, 0xbd, 0x46, 0xa4, 0xea, 0x44, 0x2c, 0x82, 0x02, - 0xd8, 0x73, 0xda, 0x82, 0xfa, 0x99, 0x25, 0x37, 0xbe, 0x9c, 0x85, 0x89, 0x57, 0xf0, 0x3e, 0x54, - 0xd0, 0x1c, 0x54, 0x88, 0xef, 0x6c, 0x7a, 0x64, 0x6d, 0x61, 0x59, 0xec, 0x48, 0x75, 0x96, 0x84, - 0x04, 0x60, 0x8d, 0xa3, 0xe2, 0xfc, 0xc7, 0xfa, 0xc5, 0xf9, 0xa3, 0x75, 0x38, 0xd9, 0xac, 0xb7, - 0xa9, 0x95, 0xe9, 0xd6, 0xc9, 0x7c, 0x9d, 0x05, 0x16, 0xd3, 0x17, 0xc3, 0xef, 0xc3, 0x50, 0x09, - 0x53, 0x4b, 0x0b, 0xeb, 0x3d, 0x38, 0x38, 0xb3, 0x27, 0x0b, 0x40, 0x0f, 0x83, 0x3b, 0xdd, 0xe9, - 0x47, 0x53, 0x01, 0xe8, 0xb4, 0x11, 0x73, 0x18, 0xba, 0x02, 0x88, 0x25, 0x0d, 0x5e, 0x8e, 0xe3, - 0xb6, 0x32, 0x6b, 0xa7, 0x4f, 0x26, 0x4b, 0x2c, 0x5c, 0xea, 0xc1, 0xc0, 0x19, 0xbd, 0xa8, 0xd5, - 0xe3, 0x07, 0x8c, 0xfa, 0xf4, 0xe3, 0x49, 0xab, 0xe7, 0x1a, 0x6f, 0xc6, 0x12, 0x8e, 0x3e, 0x00, - 0xd3, 0x9d, 0x88, 0xb0, 0x0d, 0xf3, 0xcd, 0x20, 0xdc, 0xf1, 0x02, 0xa7, 0xb1, 0xcc, 0x2e, 0x72, - 0x8e, 0xbb, 0xd3, 0xd3, 0x8c, 0xf9, 0x79, 0xd1, 0x77, 0xfa, 0x7a, 0x1f, 0x3c, 0xdc, 0x97, 0x42, - 0xba, 0xe4, 0xed, 0xe9, 0x01, 0x4b, 0xde, 0xae, 0xc3, 0x49, 0xa9, 0xd7, 0xd6, 0x16, 0x96, 0xd5, - 0x43, 0x4f, 0x9f, 0x49, 0xde, 0x07, 0xb9, 0x9c, 0x81, 0x83, 0x33, 0x7b, 0xa2, 0x1d, 0x78, 0x92, - 0xf9, 0x58, 0xc4, 0xcb, 0x59, 0x0f, 0x5d, 0xbf, 0xee, 0xb6, 0x1d, 0x8f, 0x7f, 0x92, 0xcb, 0x8d, - 0xe9, 0x27, 0xd9, 0xd0, 0xde, 0x2a, 0x48, 0x3f, 0x39, 0xbf, 0x1f, 0x32, 0xde, 0x9f, 0x16, 0xba, - 0x0d, 0x6f, 0xd9, 0x07, 0x81, 0xab, 0x96, 0xe9, 0x73, 0x8c, 0xe1, 0x37, 0x0b, 0x86, 0x6f, 0x99, - 0x3f, 0xa8, 0x03, 0x3e, 0x98, 0x66, 0xdf, 0xa7, 0xdc, 0x20, 0xbe, 0xc3, 0x9e, 0x72, 0x66, 0x80, - 0xa7, 0x94, 0xc8, 0x78, 0x7f, 0x5a, 0x68, 0x1b, 0xce, 0x32, 0x84, 0xf9, 0x7a, 0xec, 0xee, 0xea, - 0x6a, 0x46, 0x17, 0xfd, 0x46, 0x3b, 0x70, 0xfd, 0x78, 0xfa, 0x3c, 0xe3, 0xf5, 0x4d, 0x82, 0xd7, - 0xd9, 0xf9, 0x7d, 0x70, 0xf1, 0xbe, 0x94, 0xec, 0x3f, 0xb0, 0x60, 0x5c, 0xa9, 0x9f, 0xfb, 0x90, - 0x81, 0xee, 0x25, 0x33, 0xd0, 0x97, 0x8e, 0xae, 0xc0, 0xd9, 0xc8, 0xfb, 0xe4, 0x49, 0xfd, 0xd7, - 0x29, 0x00, 0xad, 0xe4, 0x95, 0x7d, 0x65, 0xf5, 0xb5, 0xaf, 0x1e, 0x5a, 0x05, 0x9b, 0x55, 0x7f, - 0xb6, 0xf4, 0x60, 0xeb, 0xcf, 0xd6, 0xe0, 0x94, 0x94, 0x07, 0x3c, 0x1e, 0xe0, 0x72, 0x10, 0x29, - 0x7d, 0x6d, 0xdc, 0xce, 0xba, 0x9c, 0x85, 0x84, 0xb3, 0xfb, 0x26, 0x0c, 0xf3, 0x91, 0x03, 0x0d, - 0x73, 0xa5, 0xa2, 0x56, 0xb6, 0xe4, 0xdd, 0xc9, 0x29, 0x15, 0xb5, 0x72, 0xa9, 0x86, 0x35, 0x4e, - 0xb6, 0x9d, 0x52, 0xc9, 0xc9, 0x4e, 0x81, 0x43, 0xdb, 0x29, 0x52, 0x63, 0x8e, 0xf6, 0xd5, 0x98, - 0xf2, 0xdc, 0x71, 0xac, 0xef, 0xb9, 0xe3, 0x7b, 0x60, 0xc2, 0xf5, 0xb7, 0x49, 0xe8, 0xc6, 0xa4, - 0xc1, 0xbe, 0x05, 0xa6, 0x4d, 0xcb, 0xda, 0x4a, 0x5d, 0x4e, 0x40, 0x71, 0x0a, 0x3b, 0xa9, 0xe6, - 0x27, 0x06, 0x50, 0xf3, 0x7d, 0x8c, 0xab, 0xc9, 0x7c, 0x8c, 0xab, 0x13, 0x47, 0x37, 0xae, 0xa6, - 0x8e, 0xd5, 0xb8, 0x42, 0xb9, 0x18, 0x57, 0x03, 0xd9, 0x2d, 0x86, 0x87, 0xe5, 0xe4, 0x01, 0x1e, - 0x96, 0x7e, 0x96, 0xd5, 0xa9, 0x7b, 0xb6, 0xac, 0xb2, 0x8d, 0xa6, 0xc7, 0xde, 0x34, 0x9a, 0x72, - 0x31, 0x9a, 0x9e, 0x82, 0x52, 0x83, 0xb4, 0xe3, 0xed, 0xe9, 0x27, 0xd8, 0x62, 0x55, 0xef, 0x7f, - 0x91, 0x36, 0x62, 0x0e, 0x43, 0x31, 0x9c, 0xbf, 0x4d, 0x36, 0xb7, 0x83, 0x60, 0x67, 0xd5, 0xf1, - 0xdd, 0x2d, 0x22, 0xee, 0x58, 0xb8, 0xe9, 0x84, 0x2d, 0x51, 0xdf, 0xbe, 0x31, 0x7d, 0x96, 0x0d, - 0xe1, 0x19, 0xd1, 0xff, 0xfc, 0xcd, 0x03, 0xf0, 0xf1, 0x81, 0x14, 0xdf, 0xb4, 0xe7, 0xbe, 0x91, - 0xed, 0xb9, 0x4f, 0x15, 0xe0, 0x94, 0xb6, 0x78, 0xa8, 0x9e, 0x71, 0xb7, 0xa8, 0xce, 0x27, 0xe8, - 0x02, 0x00, 0x8f, 0x82, 0x31, 0xea, 0x68, 0xe8, 0x4a, 0x22, 0x0a, 0x82, 0x0d, 0x2c, 0x56, 0x8e, - 0x82, 0x84, 0xec, 0xaa, 0xb4, 0xb4, 0x39, 0xb4, 0x20, 0xda, 0xb1, 0xc2, 0xa0, 0x1f, 0x17, 0xfd, - 0x2d, 0xaa, 0x22, 0xa5, 0x2f, 0xe1, 0x58, 0xd0, 0x20, 0x6c, 0xe2, 0xa1, 0x67, 0x38, 0x13, 0xa6, - 0x8a, 0xa9, 0x49, 0x34, 0xc6, 0x7d, 0x4d, 0x4a, 0xfb, 0x2a, 0xa8, 0x1c, 0x0e, 0x2b, 0x97, 0x52, - 0xea, 0x1d, 0x0e, 0x0b, 0x2c, 0x57, 0x18, 0xf6, 0x7f, 0xb7, 0xe0, 0x74, 0xe6, 0x54, 0xdc, 0x07, - 0x33, 0xf7, 0x4e, 0xd2, 0xcc, 0xad, 0xe5, 0xe5, 0xa7, 0x32, 0x9e, 0xa2, 0x8f, 0xc9, 0xfb, 0xef, - 0x2d, 0x98, 0xd0, 0xf8, 0xf7, 0xe1, 0x51, 0xdd, 0xe4, 0xa3, 0xe6, 0xe7, 0x92, 0xab, 0xf4, 0x3c, - 0xdb, 0xaf, 0x14, 0x40, 0x5d, 0x8c, 0x33, 0x5f, 0x8f, 0x07, 0xcb, 0x45, 0xed, 0xc2, 0x30, 0x0b, - 0x2b, 0x8b, 0xf2, 0x09, 0x99, 0x4d, 0xf2, 0x67, 0x21, 0x6a, 0xfa, 0x94, 0x9f, 0xfd, 0x8d, 0xb0, - 0x60, 0xc8, 0x2e, 0xf2, 0x93, 0x72, 0xba, 0x98, 0x34, 0x66, 0x95, 0x3c, 0x56, 0x18, 0xd4, 0x10, - 0x73, 0xeb, 0x81, 0xbf, 0xe0, 0x39, 0x51, 0x24, 0xf6, 0x06, 0xca, 0x10, 0x5b, 0x96, 0x00, 0xac, - 0x71, 0x58, 0xc4, 0x99, 0x1b, 0xb5, 0x3d, 0xa7, 0x6b, 0x38, 0x5e, 0x8d, 0xea, 0x7f, 0x0a, 0x84, - 0x4d, 0x3c, 0xbb, 0x05, 0xd3, 0xc9, 0x87, 0x58, 0x24, 0x5b, 0x2c, 0xed, 0x63, 0xa0, 0xe9, 0x9c, - 0x83, 0x8a, 0xc3, 0x7a, 0xad, 0x74, 0x1c, 0x21, 0x13, 0x74, 0xf2, 0x83, 0x04, 0x60, 0x8d, 0x63, - 0x7f, 0x2b, 0x3c, 0x9a, 0x31, 0x67, 0x03, 0x44, 0xd5, 0xfe, 0x42, 0x01, 0x26, 0x93, 0x3d, 0x23, - 0x96, 0x18, 0xcd, 0xc7, 0xec, 0x46, 0xf5, 0x60, 0x97, 0x84, 0x5d, 0x3a, 0x0c, 0x2b, 0x95, 0x18, - 0xdd, 0x83, 0x81, 0x33, 0x7a, 0xb1, 0x3b, 0xaa, 0x1a, 0xea, 0xd1, 0xe5, 0xf2, 0xb8, 0x91, 0xe7, - 0xf2, 0xd0, 0x33, 0x6b, 0x46, 0x02, 0x2a, 0x96, 0xd8, 0xe4, 0x4f, 0xed, 0x6a, 0x96, 0xd6, 0x55, - 0xed, 0xb8, 0x5e, 0xec, 0xfa, 0xe2, 0x91, 0xc5, 0xc2, 0x51, 0x76, 0xf5, 0x6a, 0x2f, 0x0a, 0xce, - 0xea, 0x67, 0x7f, 0x6d, 0x08, 0x54, 0x79, 0x24, 0x16, 0xa9, 0x9d, 0x53, 0x9c, 0xfb, 0x61, 0xd3, - 0xeb, 0xd5, 0x9b, 0x1e, 0xda, 0x2f, 0x74, 0x92, 0xbb, 0xce, 0xcd, 0x33, 0x36, 0x35, 0x61, 0x1b, - 0x1a, 0x84, 0x4d, 0x3c, 0x3a, 0x12, 0xcf, 0xdd, 0x25, 0xbc, 0xd3, 0x70, 0x72, 0x24, 0x2b, 0x12, - 0x80, 0x35, 0x0e, 0xbb, 0x06, 0xc2, 0xdd, 0xda, 0x12, 0x7e, 0x60, 0x7d, 0x0d, 0x84, 0xbb, 0xb5, - 0x85, 0x19, 0x84, 0xdf, 0x62, 0x18, 0xec, 0x88, 0xbd, 0xa4, 0x71, 0x8b, 0x61, 0xb0, 0x83, 0x19, - 0x84, 0xbe, 0x25, 0x3f, 0x08, 0x5b, 0x8e, 0xe7, 0xbe, 0x46, 0x1a, 0x8a, 0x8b, 0xd8, 0x43, 0xaa, - 0xb7, 0x74, 0xad, 0x17, 0x05, 0x67, 0xf5, 0xe3, 0xd5, 0x5f, 0x49, 0xc3, 0xad, 0xc7, 0x26, 0x35, - 0x48, 0x2e, 0xe8, 0xf5, 0x1e, 0x0c, 0x9c, 0xd1, 0x0b, 0xcd, 0xc3, 0xa4, 0x2c, 0x6f, 0x25, 0x2b, - 0xd7, 0x8e, 0x26, 0xeb, 0x4b, 0xe2, 0x24, 0x18, 0xa7, 0xf1, 0xa9, 0xc4, 0x6a, 0x89, 0x6a, 0xea, - 0x6c, 0xcb, 0x69, 0x48, 0x2c, 0x59, 0x65, 0x1d, 0x2b, 0x0c, 0xfb, 0xe3, 0x45, 0xaa, 0x61, 0xfb, - 0x5c, 0x5a, 0x70, 0xdf, 0xf2, 0x2a, 0x92, 0x2b, 0x72, 0x68, 0x80, 0x15, 0xf9, 0x2e, 0x18, 0xbb, - 0x15, 0x05, 0xbe, 0xca, 0x59, 0x28, 0xf5, 0xcd, 0x59, 0x30, 0xb0, 0xb2, 0x73, 0x16, 0x86, 0xf3, - 0xca, 0x59, 0x18, 0xb9, 0xc7, 0x9c, 0x85, 0x7f, 0x59, 0x02, 0x75, 0xbd, 0xf5, 0x35, 0x12, 0xdf, - 0x0e, 0xc2, 0x1d, 0xd7, 0x6f, 0xb2, 0x52, 0x4d, 0x5f, 0xb5, 0x64, 0xb5, 0xa7, 0x15, 0x33, 0xa7, - 0x7f, 0x2b, 0xa7, 0xab, 0x86, 0x13, 0xcc, 0x66, 0x37, 0x0c, 0x46, 0x3c, 0xf6, 0x2d, 0x55, 0x55, - 0x4a, 0x1c, 0xeb, 0x25, 0x46, 0x84, 0xbe, 0x1b, 0x40, 0x1e, 0x9a, 0x6d, 0x49, 0x09, 0xbc, 0x9c, - 0xcf, 0xf8, 0x30, 0xd9, 0xd2, 0xf6, 0xed, 0x86, 0x62, 0x82, 0x0d, 0x86, 0xe8, 0x53, 0xba, 0xde, - 0x01, 0x4f, 0x72, 0xfc, 0xf0, 0xb1, 0xcc, 0xcd, 0x20, 0xd5, 0x0e, 0x30, 0x8c, 0xb8, 0x7e, 0x93, - 0xae, 0x13, 0x11, 0xdb, 0xfd, 0xb6, 0xac, 0x4a, 0x80, 0x2b, 0x81, 0xd3, 0xa8, 0x3a, 0x9e, 0xe3, - 0xd7, 0x49, 0xb8, 0xcc, 0xd1, 0xf5, 0x5e, 0x5a, 0x34, 0x60, 0x49, 0xa8, 0xe7, 0x0a, 0xee, 0xd2, - 0x20, 0x57, 0x70, 0x9f, 0xf9, 0x4e, 0x98, 0xea, 0x79, 0x99, 0x87, 0x2a, 0x6e, 0x70, 0x84, 0x1a, - 0x80, 0xbf, 0x38, 0xac, 0x95, 0xd6, 0xb5, 0xa0, 0xc1, 0xaf, 0x66, 0x0e, 0xf5, 0x1b, 0x15, 0xf6, - 0x6b, 0x8e, 0x4b, 0x44, 0xa9, 0x19, 0xa3, 0x11, 0x9b, 0x2c, 0xe9, 0x1a, 0x6d, 0x3b, 0x21, 0xf1, - 0x8f, 0x7b, 0x8d, 0xae, 0x2b, 0x26, 0xd8, 0x60, 0x88, 0xb6, 0x13, 0x59, 0xb8, 0x97, 0x8e, 0x9e, - 0x85, 0xcb, 0xea, 0x33, 0x67, 0xdd, 0x60, 0xfa, 0x05, 0x0b, 0x26, 0xfc, 0xc4, 0xca, 0xcd, 0x27, - 0xe1, 0x26, 0xfb, 0xab, 0xa8, 0xa2, 0xbb, 0x7b, 0x33, 0x13, 0xc9, 0x36, 0x9c, 0xe2, 0x9f, 0xa5, - 0xd2, 0x4a, 0x87, 0x54, 0x69, 0xfa, 0x46, 0xf9, 0xe1, 0xbe, 0x37, 0xca, 0xfb, 0x30, 0xcc, 0xab, - 0xc8, 0x8a, 0xb0, 0x9b, 0x23, 0xd6, 0x32, 0x32, 0x4b, 0xd1, 0x72, 0x7e, 0xbc, 0x05, 0x0b, 0x2e, - 0xe8, 0xa6, 0x99, 0xa4, 0x5f, 0x3e, 0x74, 0x16, 0xe8, 0x78, 0xbf, 0x64, 0x7e, 0xfb, 0x7f, 0x0f, - 0xc1, 0x09, 0x39, 0x23, 0x32, 0x59, 0x8f, 0xea, 0x47, 0xce, 0x57, 0xdb, 0xca, 0x4a, 0x3f, 0x5e, - 0x96, 0x00, 0xac, 0x71, 0xa8, 0x3d, 0xd6, 0x89, 0xc8, 0x5a, 0x9b, 0xf8, 0x2b, 0xee, 0x66, 0x24, - 0x02, 0x64, 0xd4, 0x87, 0x72, 0x5d, 0x83, 0xb0, 0x89, 0xc7, 0x2a, 0x09, 0xd4, 0xcd, 0x72, 0x3e, - 0xba, 0x92, 0x80, 0x30, 0x54, 0x25, 0x1c, 0xfd, 0x68, 0xe6, 0x2d, 0x4a, 0xf9, 0xa4, 0xba, 0xf7, - 0xe4, 0x28, 0x1e, 0xee, 0xfa, 0x24, 0xf4, 0x93, 0x16, 0x9c, 0xe2, 0xad, 0x72, 0x26, 0xaf, 0xb7, - 0x1b, 0x4e, 0x4c, 0xa2, 0x7c, 0x6e, 0xbf, 0xcc, 0x18, 0x9f, 0x3e, 0x2a, 0xc9, 0x62, 0x8b, 0xb3, - 0x47, 0x83, 0x3e, 0x6f, 0xc1, 0xe4, 0x4e, 0xa2, 0x1c, 0x9f, 0x54, 0x1d, 0x47, 0xad, 0x55, 0x95, - 0x20, 0xaa, 0x3f, 0xb5, 0x64, 0x7b, 0x84, 0xd3, 0xdc, 0xed, 0x3f, 0xb3, 0xc0, 0x14, 0xa3, 0xf7, - 0xbf, 0x8a, 0xdf, 0xe1, 0x4d, 0x41, 0x69, 0x5d, 0x96, 0xfa, 0x5a, 0x97, 0x4f, 0x42, 0xb1, 0xe3, - 0x36, 0xc4, 0xfe, 0x42, 0x87, 0xe4, 0x2c, 0x2f, 0x62, 0xda, 0x6e, 0xff, 0x9f, 0x92, 0xf6, 0x49, - 0x88, 0x0c, 0xf2, 0xbf, 0x14, 0x8f, 0xed, 0xab, 0x32, 0xdd, 0xfc, 0xc9, 0x6f, 0xf4, 0x94, 0xe9, - 0x5e, 0xbc, 0xf7, 0x42, 0x01, 0x7c, 0xa2, 0xfa, 0x55, 0xe9, 0x1e, 0x39, 0xb0, 0x4a, 0x77, 0x99, - 0x6e, 0xc5, 0x98, 0x93, 0xb1, 0x9c, 0x18, 0x5c, 0xf9, 0xb2, 0x68, 0x7f, 0x63, 0x6f, 0xa6, 0x7a, - 0xef, 0xc3, 0x93, 0x54, 0xb0, 0xe2, 0x83, 0xbe, 0x0b, 0x2a, 0xf4, 0x37, 0x2b, 0x6c, 0x20, 0x36, - 0x7b, 0xaf, 0x28, 0x19, 0x2a, 0x01, 0xb9, 0x56, 0x4f, 0xd0, 0xfc, 0xd0, 0x2e, 0x54, 0x28, 0x22, - 0x67, 0xce, 0xf7, 0x86, 0xef, 0x53, 0x65, 0x06, 0x24, 0xe0, 0x8d, 0xbd, 0x99, 0x85, 0x7b, 0x67, - 0xae, 0xc8, 0x60, 0xcd, 0xca, 0x50, 0x9d, 0xa3, 0xfd, 0x54, 0xa7, 0xfd, 0xe7, 0x43, 0x7a, 0xfd, - 0x8b, 0x0a, 0xef, 0x7f, 0x29, 0xd6, 0xff, 0x0b, 0xa9, 0xf5, 0x7f, 0xbe, 0x67, 0xfd, 0x4f, 0xd0, - 0x39, 0xcb, 0xa8, 0x37, 0x7f, 0xbf, 0x8d, 0x89, 0x83, 0x7d, 0x16, 0xcc, 0x8a, 0x7a, 0xb5, 0xe3, - 0x86, 0x24, 0x5a, 0x0f, 0x3b, 0xbe, 0xeb, 0x37, 0xd9, 0x12, 0x2e, 0x9b, 0x56, 0x54, 0x02, 0x8c, - 0xd3, 0xf8, 0xe8, 0x59, 0x28, 0xd3, 0x75, 0x71, 0xd3, 0xd9, 0xe5, 0x2b, 0xd0, 0xa8, 0xaa, 0x5b, - 0x13, 0xed, 0x58, 0x61, 0xa0, 0x6d, 0x38, 0x2b, 0x09, 0x2c, 0x12, 0x8f, 0xd0, 0x07, 0x62, 0xa1, - 0xc8, 0x61, 0x8b, 0x27, 0x0a, 0xf1, 0x68, 0x32, 0x75, 0xde, 0x81, 0xf7, 0xc1, 0xc5, 0xfb, 0x52, - 0xb2, 0x7f, 0x9f, 0xc5, 0xaf, 0x18, 0x75, 0x5f, 0xe8, 0xea, 0xf3, 0xdc, 0x96, 0x2b, 0x8b, 0xff, - 0xaa, 0xd5, 0xb7, 0x42, 0x1b, 0x31, 0x87, 0xa1, 0xdb, 0x30, 0xb2, 0xe9, 0xd4, 0x77, 0x82, 0xad, - 0xad, 0x7c, 0x6e, 0x16, 0xac, 0x72, 0x62, 0xac, 0xf0, 0xff, 0x88, 0xf8, 0xf3, 0x86, 0xfe, 0x89, - 0x25, 0x37, 0x7e, 0x6d, 0xcc, 0x56, 0x48, 0xa2, 0x6d, 0xe1, 0xd8, 0x33, 0xae, 0x8d, 0x61, 0xcd, - 0x58, 0xc2, 0xed, 0xdf, 0x2e, 0xc1, 0xa4, 0x8c, 0x25, 0xbd, 0xec, 0x46, 0x2c, 0x82, 0xc5, 0xbc, - 0x40, 0xa5, 0x70, 0xe0, 0x05, 0x2a, 0x1f, 0x04, 0x68, 0x90, 0xb6, 0x17, 0x74, 0x99, 0x9d, 0x39, - 0x74, 0x68, 0x3b, 0x53, 0x6d, 0x4d, 0x16, 0x15, 0x15, 0x6c, 0x50, 0x14, 0xc5, 0x91, 0xf9, 0x7d, - 0x2c, 0xa9, 0xe2, 0xc8, 0xc6, 0x55, 0xa5, 0xc3, 0xf7, 0xf7, 0xaa, 0x52, 0x17, 0x26, 0xf9, 0x10, - 0x55, 0x01, 0x96, 0x7b, 0xa8, 0xb3, 0xc2, 0x52, 0x58, 0x17, 0x93, 0x64, 0x70, 0x9a, 0xae, 0x79, - 0x0f, 0x69, 0xf9, 0x7e, 0xdf, 0x43, 0xfa, 0x76, 0xa8, 0xc8, 0xf7, 0x1c, 0x4d, 0x57, 0x74, 0x91, - 0x30, 0xb9, 0x0c, 0x22, 0xac, 0xe1, 0x3d, 0x35, 0xa5, 0xe0, 0x41, 0xd5, 0x94, 0xb2, 0x7f, 0x81, - 0x6d, 0x50, 0xf8, 0xb8, 0x0e, 0x7d, 0x8d, 0xef, 0x65, 0xe3, 0x1a, 0xdf, 0xc3, 0xbd, 0xcf, 0x72, - 0xea, 0xba, 0xdf, 0xb3, 0x30, 0x14, 0x3b, 0x4d, 0x99, 0x71, 0xcf, 0xa0, 0x1b, 0x4e, 0x33, 0xc2, - 0xac, 0xf5, 0x30, 0xb5, 0xe4, 0x5f, 0x84, 0xf1, 0xc8, 0x6d, 0xfa, 0x4e, 0xdc, 0x09, 0x89, 0x71, - 0x2e, 0xa9, 0x83, 0xba, 0x4c, 0x20, 0x4e, 0xe2, 0xa2, 0x4f, 0x58, 0x00, 0x21, 0x51, 0xdb, 0x9f, - 0xe1, 0x3c, 0xd6, 0x90, 0x12, 0x03, 0x92, 0xae, 0x59, 0x03, 0x48, 0x6d, 0x7b, 0x0c, 0xb6, 0xe8, - 0xef, 0x5b, 0x70, 0x4a, 0xde, 0xb8, 0x10, 0x93, 0x66, 0xe8, 0xc6, 0x5d, 0x51, 0x7f, 0x69, 0x24, - 0x8f, 0x9c, 0xf9, 0x5a, 0x92, 0xf4, 0xc2, 0x36, 0xa9, 0xef, 0x88, 0x32, 0x4c, 0xcc, 0xdb, 0x59, - 0xcb, 0x62, 0x8d, 0xb3, 0x47, 0x64, 0x7f, 0xd2, 0x82, 0xa9, 0x9e, 0x27, 0x44, 0x6d, 0x18, 0xae, - 0xb3, 0x8b, 0xa1, 0xf3, 0xa9, 0xd5, 0x9b, 0xbc, 0x64, 0x5a, 0xde, 0x8a, 0x46, 0xdb, 0xb0, 0xe0, - 0x63, 0xff, 0xd2, 0x18, 0x9c, 0xac, 0x2d, 0xac, 0xca, 0x0b, 0xe5, 0x8e, 0xad, 0xdc, 0x41, 0x16, - 0x8f, 0xfb, 0x57, 0xee, 0xa0, 0x0f, 0x77, 0xcf, 0x28, 0x77, 0xe0, 0x19, 0xe5, 0x0e, 0x92, 0xb9, - 0xe7, 0xc5, 0x3c, 0x72, 0xcf, 0xb3, 0x46, 0x30, 0x48, 0xee, 0xf9, 0xb1, 0xd5, 0x3f, 0xd8, 0x77, - 0x40, 0x87, 0xaa, 0x7f, 0xa0, 0x8a, 0x43, 0xe4, 0x92, 0xea, 0xda, 0xe7, 0x55, 0x65, 0x16, 0x87, - 0x50, 0x89, 0xf9, 0x3c, 0x8d, 0x5b, 0x28, 0xe8, 0x57, 0xf2, 0x1f, 0xc0, 0x00, 0x89, 0xf9, 0x22, - 0x93, 0xdc, 0x2c, 0x06, 0x31, 0x92, 0x47, 0x31, 0x88, 0xac, 0xe1, 0x1c, 0x58, 0x0c, 0xe2, 0x45, - 0x18, 0xaf, 0x7b, 0x81, 0x4f, 0xd6, 0xc3, 0x20, 0x0e, 0xea, 0x81, 0x27, 0x76, 0x97, 0xfa, 0x46, - 0x65, 0x13, 0x88, 0x93, 0xb8, 0xfd, 0x2a, 0x49, 0x54, 0x8e, 0x5a, 0x49, 0x02, 0x1e, 0x50, 0x25, - 0x09, 0xa3, 0x56, 0xc2, 0x68, 0x1e, 0xb5, 0x12, 0xb2, 0xde, 0xc8, 0x40, 0xb5, 0x12, 0x5e, 0xb7, - 0x60, 0xdc, 0xb9, 0xcd, 0xf6, 0x58, 0x5c, 0x0a, 0xb3, 0x93, 0xc9, 0xd1, 0x0b, 0x1f, 0x3a, 0x86, - 0x05, 0x7b, 0xb3, 0xa6, 0xd9, 0x54, 0xa7, 0x58, 0xfe, 0x9a, 0xd9, 0x84, 0x93, 0x03, 0x39, 0x4a, - 0x7d, 0x85, 0x2f, 0x17, 0xe0, 0x2d, 0x07, 0x0e, 0x01, 0xdd, 0x06, 0x88, 0x9d, 0xa6, 0x58, 0xa8, - 0xe2, 0xfc, 0xee, 0x88, 0x31, 0xf3, 0x1b, 0x92, 0x9e, 0xc8, 0xfd, 0x55, 0xe4, 0xb1, 0xc1, 0x8a, - 0x85, 0xca, 0x07, 0x5e, 0x4f, 0x99, 0x7d, 0x1c, 0x78, 0x04, 0x33, 0x08, 0x35, 0xda, 0x42, 0xd2, - 0xa4, 0x1b, 0x91, 0x62, 0xd2, 0x68, 0xc3, 0xac, 0x15, 0x0b, 0x28, 0x7a, 0x1e, 0x46, 0x1d, 0xcf, - 0xe3, 0x79, 0xc8, 0x24, 0x12, 0x57, 0x9d, 0xeb, 0xe2, 0xda, 0x1a, 0x84, 0x4d, 0x3c, 0xfb, 0x4f, - 0x0b, 0x30, 0x73, 0x80, 0x4c, 0xe9, 0xa9, 0x3f, 0x51, 0x1a, 0xb8, 0xfe, 0x84, 0xc8, 0xa3, 0x1c, - 0xee, 0x93, 0x47, 0xf9, 0x3c, 0x8c, 0xc6, 0xc4, 0x69, 0x89, 0x28, 0xdb, 0x74, 0xcd, 0xd8, 0x0d, - 0x0d, 0xc2, 0x26, 0x1e, 0x95, 0x62, 0x13, 0x4e, 0xbd, 0x4e, 0xa2, 0x48, 0x26, 0x4a, 0x0a, 0xe7, - 0x7e, 0x6e, 0x59, 0x98, 0xec, 0xcc, 0x64, 0x3e, 0xc1, 0x02, 0xa7, 0x58, 0xa6, 0x27, 0xbc, 0x32, - 0xe0, 0x84, 0xff, 0x78, 0x01, 0x9e, 0xdc, 0x57, 0xbb, 0x0d, 0x9c, 0xc3, 0xda, 0x89, 0x48, 0x98, - 0x5e, 0x38, 0xd7, 0x23, 0x12, 0x62, 0x06, 0xe1, 0xb3, 0xd4, 0x6e, 0xab, 0x0c, 0x89, 0xfc, 0x93, - 0xbe, 0xf9, 0x2c, 0x25, 0x58, 0xe0, 0x14, 0xcb, 0x7b, 0x5d, 0x96, 0xbf, 0x3d, 0x04, 0x4f, 0x0d, - 0x60, 0x03, 0xe4, 0x98, 0x1c, 0x9f, 0x2c, 0xfc, 0x50, 0x7c, 0x40, 0x85, 0x1f, 0xee, 0x6d, 0xba, - 0xde, 0xac, 0x17, 0x31, 0x50, 0x12, 0xfe, 0x4f, 0x15, 0xe0, 0x4c, 0x7f, 0x83, 0x05, 0x7d, 0x07, - 0x4c, 0x86, 0x2a, 0x2c, 0xd2, 0xac, 0x19, 0xf1, 0x28, 0x77, 0xdd, 0x25, 0x40, 0x38, 0x8d, 0x8b, - 0x66, 0x01, 0xda, 0x4e, 0xbc, 0x1d, 0x5d, 0xbc, 0xe3, 0x46, 0xb1, 0x28, 0xb2, 0x39, 0xc1, 0x0f, - 0x9c, 0x65, 0x2b, 0x36, 0x30, 0x28, 0x3b, 0xf6, 0x6f, 0x31, 0xb8, 0x16, 0xc4, 0xbc, 0x13, 0xdf, - 0x26, 0x3f, 0x2a, 0xaf, 0xa8, 0x35, 0x40, 0x38, 0x8d, 0x4b, 0xd9, 0xb1, 0x90, 0x06, 0x3e, 0xd0, - 0x21, 0x5d, 0x65, 0x62, 0x45, 0xb5, 0x62, 0x03, 0x23, 0x5d, 0x0d, 0xa3, 0x74, 0x70, 0x35, 0x0c, - 0xfb, 0xd3, 0x45, 0x38, 0xdd, 0xd7, 0xe0, 0x1d, 0x4c, 0x4c, 0x3d, 0x7c, 0x15, 0x29, 0xee, 0xf1, - 0x0b, 0x3b, 0x5c, 0x25, 0x83, 0x75, 0x38, 0x29, 0x6e, 0xb4, 0x9e, 0x0f, 0xeb, 0xdb, 0xee, 0x2e, - 0x69, 0xb0, 0xe5, 0x23, 0xbe, 0x09, 0x95, 0xc8, 0x70, 0x31, 0x03, 0x07, 0x67, 0xf6, 0xb4, 0xff, - 0x61, 0x31, 0x7b, 0xed, 0x8a, 0xba, 0x07, 0xf7, 0x5e, 0x22, 0xea, 0xe1, 0x7b, 0x43, 0x3d, 0xa5, - 0x0e, 0x86, 0x0e, 0x51, 0xea, 0x20, 0xf5, 0x7a, 0x4b, 0x03, 0xbe, 0xde, 0xfc, 0x5f, 0xd8, 0xcf, - 0x96, 0xfa, 0xbe, 0x30, 0xba, 0x89, 0x1f, 0xe8, 0xf0, 0x66, 0x11, 0x4e, 0xb8, 0x3e, 0xa3, 0x5d, - 0xeb, 0x6c, 0x8a, 0xda, 0x90, 0xbc, 0x10, 0xba, 0xca, 0x7e, 0x5b, 0x4e, 0xc1, 0x71, 0x4f, 0x8f, - 0x87, 0xb0, 0x98, 0xc5, 0x3d, 0xbe, 0xa4, 0xc3, 0x69, 0x97, 0x35, 0x38, 0x25, 0xa7, 0x62, 0xdb, - 0x09, 0x49, 0x43, 0x18, 0x04, 0x91, 0xc8, 0x77, 0x3c, 0xcd, 0x73, 0x26, 0x33, 0x10, 0x70, 0x76, - 0x3f, 0x76, 0x8b, 0x75, 0xd0, 0x76, 0xeb, 0x62, 0xbb, 0xaa, 0x6f, 0xb1, 0xa6, 0x8d, 0x98, 0xc3, - 0xb4, 0x4e, 0xab, 0xdc, 0x17, 0x9d, 0xc6, 0x53, 0xa6, 0x32, 0x16, 0x2e, 0xa4, 0x53, 0xa6, 0xb2, - 0x16, 0x6e, 0x56, 0x4f, 0xfb, 0x83, 0x50, 0x51, 0x6f, 0x90, 0x67, 0xb3, 0xa8, 0x0f, 0xb1, 0x27, - 0x9b, 0x45, 0x7d, 0x85, 0x06, 0x16, 0x5d, 0x6f, 0x74, 0x7b, 0x96, 0x92, 0x28, 0xf4, 0x09, 0x68, - 0xbb, 0xfd, 0x4e, 0x18, 0x53, 0xde, 0xda, 0x41, 0x6f, 0x27, 0xb7, 0xff, 0xa2, 0x00, 0xa9, 0x0b, - 0x38, 0xd1, 0x1d, 0xa8, 0x34, 0xc2, 0x2e, 0x6f, 0xcc, 0xa7, 0xb4, 0xff, 0xa2, 0x24, 0xa7, 0x4f, - 0x35, 0x55, 0x13, 0xd6, 0xcc, 0xd0, 0x47, 0x78, 0xf5, 0x7c, 0xc1, 0xba, 0x90, 0x47, 0x89, 0x94, - 0x9a, 0xa2, 0x67, 0x5e, 0x3b, 0x2c, 0xdb, 0xb0, 0xc1, 0x0f, 0xc5, 0x50, 0xd9, 0x96, 0x17, 0x8d, - 0xe6, 0x23, 0x92, 0xd5, 0xbd, 0xa5, 0xdc, 0x30, 0x55, 0x7f, 0xb1, 0x66, 0x64, 0xff, 0x6c, 0x11, - 0x4e, 0x26, 0x5f, 0x80, 0x38, 0x85, 0xfe, 0x69, 0x0b, 0x1e, 0xf7, 0x9c, 0x28, 0xae, 0x75, 0xd8, - 0xf6, 0x68, 0xab, 0xe3, 0xad, 0xa5, 0x2e, 0x5c, 0x38, 0xaa, 0x8b, 0x49, 0x11, 0x4e, 0x5f, 0x4c, - 0x5b, 0x7d, 0xe2, 0xee, 0xde, 0xcc, 0xe3, 0x2b, 0xd9, 0xcc, 0x71, 0xbf, 0x51, 0xa1, 0x2f, 0x58, - 0x70, 0xa2, 0xde, 0x09, 0x43, 0xe2, 0xc7, 0x7a, 0xa8, 0xfc, 0x2d, 0x5e, 0xcb, 0x65, 0x22, 0xf5, - 0x00, 0x4f, 0x52, 0x11, 0xbd, 0x90, 0xe2, 0x85, 0x7b, 0xb8, 0xa3, 0x97, 0xf8, 0x1c, 0x2e, 0x04, - 0xad, 0x36, 0x15, 0x39, 0x8b, 0x61, 0x57, 0xd5, 0xc2, 0xe1, 0x62, 0x5b, 0x65, 0xd9, 0xae, 0x64, - 0xa3, 0xe1, 0x7e, 0xfd, 0xed, 0x8f, 0xc2, 0x64, 0xca, 0xf5, 0x8f, 0x76, 0xa0, 0xd8, 0x54, 0x4e, - 0xfc, 0xf5, 0x5c, 0x8f, 0x1d, 0x96, 0xdc, 0xb8, 0x3a, 0x42, 0x3f, 0xf7, 0x25, 0x37, 0xc6, 0x94, - 0x8b, 0xfd, 0xe3, 0x16, 0x9c, 0xe9, 0x7f, 0x36, 0x81, 0xbe, 0xcf, 0x82, 0xe1, 0x3a, 0xfd, 0x2f, - 0xdd, 0x2e, 0x1f, 0x38, 0xae, 0x63, 0x10, 0x16, 0x8f, 0xa9, 0xbc, 0x27, 0x0c, 0x10, 0x61, 0xc1, - 0xdb, 0xf6, 0xe0, 0xdc, 0xfe, 0x3d, 0x07, 0x48, 0xd9, 0x79, 0x06, 0xca, 0xed, 0x30, 0xd8, 0xf4, - 0x64, 0x92, 0x96, 0x2c, 0x31, 0x2d, 0xda, 0xb0, 0x82, 0xda, 0x5f, 0xb2, 0x00, 0xf5, 0x4e, 0x1c, - 0xfa, 0x98, 0x65, 0x14, 0xa9, 0xb6, 0xf2, 0x48, 0x93, 0xe9, 0x65, 0xc2, 0x0a, 0x5e, 0x77, 0xfb, - 0x15, 0xbf, 0xb6, 0x7f, 0xb8, 0x00, 0xd3, 0xfd, 0x3a, 0xa1, 0xef, 0x81, 0x12, 0xdb, 0xf4, 0x88, - 0xb1, 0xbd, 0x7c, 0x3c, 0x63, 0xa3, 0x5a, 0xc8, 0xbc, 0x55, 0x86, 0x6a, 0x2a, 0xce, 0x17, 0xc5, - 0x50, 0x6c, 0xb6, 0x9b, 0xe2, 0x5b, 0x7d, 0xe9, 0x78, 0xd8, 0x2f, 0xad, 0x2f, 0x89, 0x15, 0xbc, - 0xbe, 0x84, 0x29, 0x3b, 0xfb, 0x63, 0x16, 0x3c, 0xb1, 0x0f, 0x36, 0x5a, 0x80, 0xa1, 0x56, 0xd0, - 0x90, 0x2b, 0x63, 0x4e, 0xae, 0x8c, 0xd5, 0xa0, 0xc1, 0xee, 0x4a, 0xdf, 0xa7, 0xeb, 0x2a, 0xbb, - 0xf3, 0x97, 0x76, 0x46, 0x67, 0x61, 0x68, 0x87, 0x74, 0x13, 0x27, 0xa5, 0xec, 0x0a, 0x2a, 0xd6, - 0x6a, 0x7f, 0x07, 0x9c, 0xdd, 0x6f, 0xba, 0x0e, 0xa8, 0x67, 0x65, 0xff, 0x20, 0xdd, 0xf8, 0xf6, - 0x15, 0xa3, 0x7f, 0xc5, 0x2e, 0xea, 0xfe, 0xe3, 0x61, 0x18, 0x4f, 0x5c, 0x56, 0x93, 0x88, 0xf6, - 0xb0, 0x0e, 0x8c, 0xf6, 0x60, 0x25, 0x05, 0x3a, 0xbe, 0xb8, 0x48, 0xd6, 0x2c, 0x29, 0xd0, 0xf1, - 0x09, 0xe6, 0x30, 0x31, 0xa5, 0xb8, 0xe3, 0x8b, 0xf0, 0x13, 0x73, 0x4a, 0x71, 0xc7, 0xc7, 0x02, - 0x4a, 0x3f, 0xf9, 0x31, 0xa6, 0xdb, 0x45, 0x58, 0x8d, 0xb0, 0xc0, 0xaf, 0xe4, 0x60, 0x4d, 0xc8, - 0x0b, 0x9a, 0x58, 0x1e, 0x82, 0xd9, 0x82, 0x13, 0x1c, 0xa9, 0x04, 0xae, 0xc8, 0x60, 0x6e, 0x79, - 0x38, 0x5e, 0xcb, 0xf7, 0x2e, 0xa0, 0x94, 0x51, 0xa5, 0x2e, 0x65, 0xc1, 0x9a, 0x31, 0x8a, 0x54, - 0x20, 0xcb, 0xc8, 0xf1, 0x04, 0xb2, 0x40, 0x46, 0x10, 0xcb, 0xdb, 0xa1, 0xd2, 0x12, 0x09, 0xfa, - 0x3c, 0xb6, 0x44, 0x5e, 0x01, 0x27, 0x1b, 0xb1, 0x86, 0xa3, 0xe7, 0x60, 0x34, 0x62, 0x0f, 0x16, - 0x1b, 0xc1, 0x20, 0xcc, 0x83, 0x52, 0xd3, 0xcd, 0xd8, 0xc4, 0x31, 0x23, 0x57, 0xe0, 0x81, 0x46, - 0xae, 0x8c, 0x1e, 0x10, 0xb9, 0x52, 0x83, 0x53, 0x4e, 0x27, 0x0e, 0x2e, 0x13, 0xc7, 0x9b, 0x8f, - 0x63, 0xd2, 0x6a, 0xc7, 0x11, 0xbf, 0xdf, 0x68, 0x8c, 0x9d, 0xab, 0xa9, 0xc8, 0xe9, 0x1a, 0xf1, - 0xb6, 0x7a, 0x90, 0x70, 0x76, 0x5f, 0xfb, 0x1f, 0x59, 0x70, 0x2a, 0x73, 0x29, 0x3c, 0xbc, 0x39, - 0x6b, 0xf6, 0x17, 0x4b, 0xf0, 0x68, 0xc6, 0x55, 0x56, 0xa8, 0x6b, 0x7e, 0x24, 0x56, 0x1e, 0xe1, - 0xdf, 0xc9, 0x68, 0x66, 0xf9, 0x6e, 0x32, 0xbe, 0x8c, 0xc3, 0x05, 0xa3, 0xe9, 0x80, 0xb0, 0xe2, - 0xfd, 0x0d, 0x08, 0x33, 0xd6, 0xfa, 0xd0, 0x03, 0x5d, 0xeb, 0xa5, 0x03, 0xd6, 0xfa, 0xcf, 0x58, - 0x30, 0xdd, 0xea, 0x73, 0x3f, 0xad, 0x38, 0xa4, 0xbf, 0x71, 0x3c, 0xb7, 0xdf, 0x56, 0xcf, 0xde, - 0xdd, 0x9b, 0xe9, 0x7b, 0x2d, 0x30, 0xee, 0x3b, 0x2a, 0xfb, 0x6b, 0x45, 0x60, 0xdb, 0x41, 0x61, - 0x88, 0x7d, 0xd4, 0xbc, 0x19, 0xcf, 0xca, 0xeb, 0xf6, 0x36, 0x4e, 0x5c, 0xdd, 0xac, 0xc7, 0x67, - 0x30, 0xeb, 0xa2, 0xbd, 0xb4, 0x24, 0x2c, 0x0c, 0x20, 0x09, 0x3d, 0x79, 0x05, 0x61, 0x31, 0xff, - 0x2b, 0x08, 0x2b, 0xe9, 0xeb, 0x07, 0xf7, 0x7f, 0xc5, 0x43, 0x0f, 0xe5, 0x2b, 0xfe, 0x67, 0x16, - 0x17, 0x3c, 0xa9, 0xb7, 0x80, 0x66, 0xa4, 0xb9, 0xc1, 0x6f, 0x2a, 0xab, 0xf4, 0x98, 0x1a, 0xcf, - 0x40, 0x39, 0x12, 0x52, 0x59, 0x98, 0x24, 0xcc, 0xb8, 0x97, 0x92, 0x1a, 0x2b, 0x28, 0x9a, 0x05, - 0x70, 0x3c, 0x2f, 0xb8, 0x7d, 0xb1, 0xd5, 0x8e, 0xbb, 0xd2, 0x30, 0xb9, 0xbb, 0x37, 0x03, 0xf3, - 0xaa, 0x15, 0x1b, 0x18, 0xe8, 0xad, 0x30, 0xc2, 0xcb, 0x51, 0x35, 0x84, 0x9b, 0x7c, 0x94, 0x7e, - 0x7c, 0xbc, 0x58, 0x55, 0x03, 0x4b, 0x98, 0xfd, 0x45, 0x0b, 0x0c, 0x5f, 0x05, 0x7a, 0x41, 0x66, - 0xc3, 0x72, 0xbf, 0x5d, 0xda, 0x15, 0x6d, 0x96, 0xd0, 0xc6, 0x09, 0xcc, 0x01, 0xae, 0x33, 0x67, - 0x61, 0xbd, 0xed, 0xe0, 0x3a, 0x5e, 0x49, 0xa7, 0x3e, 0x61, 0xde, 0x8c, 0x25, 0xdc, 0xfe, 0x5b, - 0x05, 0x31, 0x2a, 0xee, 0xa6, 0xd0, 0x71, 0xe6, 0xd6, 0x21, 0xe3, 0xcc, 0x3f, 0x02, 0x50, 0x17, - 0xfb, 0xea, 0x8d, 0x20, 0x1f, 0x6f, 0xcf, 0x82, 0xa2, 0xa7, 0xbd, 0x3d, 0xba, 0x0d, 0x1b, 0xfc, - 0x12, 0xc2, 0xbf, 0x78, 0xa0, 0xf0, 0x4f, 0xc8, 0xc1, 0xa1, 0xfd, 0xe5, 0xa0, 0xfd, 0xa7, 0x16, - 0x24, 0xec, 0x42, 0xd4, 0x86, 0x12, 0x1d, 0x6e, 0x57, 0x88, 0x94, 0xb5, 0xfc, 0x8c, 0x50, 0x2a, - 0xcb, 0xc5, 0x77, 0xca, 0x7e, 0x62, 0xce, 0x08, 0x79, 0x22, 0xa6, 0x3e, 0x17, 0xef, 0x8b, 0xc9, - 0xf0, 0x72, 0x10, 0xec, 0xf0, 0x5d, 0x94, 0x8e, 0xcf, 0xb7, 0x5f, 0x80, 0xa9, 0x9e, 0x41, 0x51, - 0x53, 0x84, 0x55, 0xd2, 0x12, 0xdf, 0x97, 0x32, 0x45, 0x58, 0x0d, 0x29, 0xcc, 0x61, 0xf6, 0x4f, - 0x59, 0x70, 0x22, 0x4d, 0x1e, 0xbd, 0x6e, 0xc1, 0x54, 0x94, 0xa6, 0x77, 0x5c, 0x73, 0xa7, 0x72, - 0xeb, 0x7a, 0x40, 0xb8, 0x77, 0x10, 0xf6, 0x4f, 0x0c, 0xf1, 0xc5, 0x7f, 0xd3, 0xf5, 0x1b, 0xc1, - 0x6d, 0x65, 0x49, 0x59, 0x7d, 0x2d, 0xa9, 0x67, 0xa1, 0x1c, 0xd5, 0xb7, 0x49, 0xa3, 0xe3, 0xf5, - 0x54, 0x20, 0xaa, 0x89, 0x76, 0xac, 0x30, 0x58, 0xc1, 0x95, 0x8e, 0x70, 0x9c, 0xa5, 0x16, 0xe5, - 0xa2, 0x68, 0xc7, 0x0a, 0x03, 0xbd, 0x0b, 0xc6, 0x8c, 0x87, 0x94, 0xeb, 0x92, 0x6d, 0x4b, 0x0c, - 0x1d, 0x1f, 0xe1, 0x04, 0x16, 0x15, 0x56, 0xca, 0x2a, 0x93, 0x3a, 0x9d, 0x09, 0x2b, 0x25, 0x3a, - 0x23, 0x6c, 0x60, 0xb0, 0xf2, 0x46, 0x5e, 0x27, 0x62, 0x01, 0x3c, 0xc3, 0xda, 0xfb, 0xb2, 0x20, - 0xda, 0xb0, 0x82, 0xa2, 0x0b, 0x00, 0x2d, 0xc7, 0xef, 0x38, 0x1e, 0x9d, 0x21, 0x71, 0x1a, 0xa0, - 0x3e, 0xc3, 0x55, 0x05, 0xc1, 0x06, 0x16, 0x7d, 0xe2, 0xd8, 0x6d, 0x91, 0x97, 0x03, 0x5f, 0xe6, - 0x42, 0xe9, 0x98, 0x2e, 0xd1, 0x8e, 0x15, 0x06, 0x7a, 0x01, 0x46, 0x1d, 0xbf, 0xc1, 0x4d, 0xc8, - 0x20, 0x14, 0xa1, 0x21, 0x6a, 0x7f, 0x7a, 0x3d, 0x22, 0xf3, 0x1a, 0x8a, 0x4d, 0xd4, 0xf4, 0xed, - 0x66, 0x30, 0xe0, 0xed, 0x66, 0xcf, 0x0b, 0x85, 0xbc, 0x4b, 0xc2, 0xb0, 0x23, 0xf3, 0x3e, 0x54, - 0xb7, 0x9a, 0x06, 0x61, 0x13, 0xcf, 0xfe, 0x13, 0x0b, 0x26, 0x75, 0xf9, 0x44, 0x76, 0xd6, 0x90, - 0x38, 0x64, 0xb1, 0x0e, 0x3c, 0x64, 0x49, 0x56, 0xbb, 0x2a, 0x0c, 0x54, 0xed, 0xca, 0x2c, 0x44, - 0x55, 0xdc, 0xb7, 0x10, 0xd5, 0x5b, 0x61, 0x64, 0x87, 0x74, 0x8d, 0x8a, 0x55, 0x4c, 0x01, 0x5d, - 0xe5, 0x4d, 0x58, 0xc2, 0x90, 0x0d, 0xc3, 0x75, 0x47, 0x95, 0xc2, 0x1e, 0x13, 0x91, 0xc4, 0xf3, - 0x0c, 0x49, 0x40, 0xec, 0x35, 0xa8, 0xa8, 0x10, 0x2c, 0x79, 0x42, 0x61, 0x65, 0x9f, 0x50, 0x50, - 0x91, 0x60, 0x44, 0x93, 0x69, 0x91, 0xc0, 0x62, 0xd0, 0x44, 0x70, 0x59, 0x75, 0xf3, 0xd7, 0xbf, - 0x7e, 0xee, 0x91, 0xdf, 0xfa, 0xfa, 0xb9, 0x47, 0x7e, 0xff, 0xeb, 0xe7, 0x1e, 0xf9, 0xd8, 0xdd, - 0x73, 0xd6, 0xaf, 0xdf, 0x3d, 0x67, 0xfd, 0xd6, 0xdd, 0x73, 0xd6, 0xef, 0xdf, 0x3d, 0x67, 0x7d, - 0xed, 0xee, 0x39, 0xeb, 0x0b, 0xff, 0xe9, 0xdc, 0x23, 0x2f, 0x7f, 0xfb, 0x7e, 0xa9, 0x62, 0xbb, - 0xef, 0x64, 0xf9, 0x61, 0x54, 0x0c, 0xcc, 0x19, 0x6b, 0x7f, 0x4e, 0x8a, 0x81, 0xff, 0x1b, 0x00, - 0x00, 0xff, 0xff, 0xef, 0xee, 0x23, 0x25, 0xa2, 0x11, 0x01, 0x00, + // 13259 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0xbd, 0x6b, 0x70, 0x1c, 0xd9, + 0x75, 0x1f, 0xae, 0x9e, 0x07, 0x30, 0xb8, 0x00, 0x01, 0xb2, 0x97, 0xdc, 0x1d, 0x72, 0x77, 0x09, + 0xaa, 0xd7, 0x92, 0xd6, 0x7f, 0x59, 0xa0, 0xb5, 0x92, 0xe5, 0xfd, 0xfb, 0x21, 0x07, 0x03, 0x90, + 0x20, 0x96, 0x00, 0x81, 0x3d, 0x03, 0x92, 0xd6, 0xea, 0xd9, 0x98, 0xb9, 0x18, 0x34, 0xd1, 0xd3, + 0x3d, 0xdb, 0xdd, 0x03, 0x12, 0x1b, 0x59, 0x96, 0xec, 0x28, 0x96, 0x2c, 0xd9, 0x96, 0xad, 0x54, + 0x2c, 0x3b, 0x91, 0x23, 0xbf, 0xf2, 0x2c, 0xc7, 0x4e, 0x52, 0x71, 0x9c, 0xc4, 0x2e, 0x57, 0xd9, + 0x29, 0x97, 0x5d, 0x79, 0xd8, 0x71, 0x39, 0x8e, 0x93, 0x38, 0xb4, 0xc4, 0x54, 0xca, 0xae, 0x7c, + 0x70, 0xca, 0x49, 0x2a, 0x55, 0xd9, 0xb8, 0x5c, 0xa9, 0x73, 0xdf, 0xdd, 0xd3, 0x03, 0x0c, 0x88, + 0x06, 0x48, 0xb9, 0xf6, 0x13, 0x30, 0xf7, 0x9c, 0x7b, 0xcf, 0xed, 0xfb, 0x3c, 0xf7, 0xdc, 0x73, + 0x7e, 0x97, 0xac, 0x74, 0xbc, 0x64, 0xbb, 0xbf, 0x39, 0xd7, 0x0a, 0xbb, 0x97, 0xdd, 0xa8, 0x13, + 0xf6, 0xa2, 0xf0, 0x0e, 0xfb, 0xe7, 0x1d, 0xad, 0xf6, 0xe5, 0xdd, 0x77, 0x5d, 0xee, 0xed, 0x74, + 0x2e, 0xbb, 0x3d, 0x2f, 0xbe, 0xec, 0xf6, 0x7a, 0xbe, 0xd7, 0x72, 0x13, 0x2f, 0x0c, 0x2e, 0xef, + 0xbe, 0xd3, 0xf5, 0x7b, 0xdb, 0xee, 0x3b, 0x2f, 0x77, 0x68, 0x40, 0x23, 0x37, 0xa1, 0xed, 0xb9, + 0x5e, 0x14, 0x26, 0xa1, 0xfd, 0x2d, 0xba, 0xb4, 0x39, 0x59, 0x1a, 0xfb, 0xe7, 0xc3, 0xad, 0xf6, + 0xdc, 0xee, 0xbb, 0xe6, 0x7a, 0x3b, 0x9d, 0x39, 0x2c, 0x6d, 0xce, 0x28, 0x6d, 0x4e, 0x96, 0x76, + 0xe1, 0x1d, 0x46, 0x5d, 0x3a, 0x61, 0x27, 0xbc, 0xcc, 0x0a, 0xdd, 0xec, 0x6f, 0xb1, 0x5f, 0xec, + 0x07, 0xfb, 0x8f, 0x0b, 0xbb, 0xe0, 0xec, 0xbc, 0x18, 0xcf, 0x79, 0x21, 0x56, 0xef, 0x72, 0x2b, + 0x8c, 0xe8, 0xe5, 0xdd, 0x81, 0x0a, 0x5d, 0xb8, 0xa6, 0x79, 0xe8, 0xbd, 0x84, 0x06, 0xb1, 0x17, + 0x06, 0xf1, 0x3b, 0xb0, 0x0a, 0x34, 0xda, 0xa5, 0x91, 0xf9, 0x79, 0x06, 0x43, 0x5e, 0x49, 0xef, + 0xd6, 0x25, 0x75, 0xdd, 0xd6, 0xb6, 0x17, 0xd0, 0x68, 0x4f, 0x67, 0xef, 0xd2, 0xc4, 0xcd, 0xcb, + 0x75, 0x79, 0x58, 0xae, 0xa8, 0x1f, 0x24, 0x5e, 0x97, 0x0e, 0x64, 0x78, 0xcf, 0x41, 0x19, 0xe2, + 0xd6, 0x36, 0xed, 0xba, 0x03, 0xf9, 0xde, 0x35, 0x2c, 0x5f, 0x3f, 0xf1, 0xfc, 0xcb, 0x5e, 0x90, + 0xc4, 0x49, 0x94, 0xcd, 0xe4, 0xfc, 0x75, 0x8b, 0x9c, 0x9a, 0xbf, 0xdd, 0x9c, 0xef, 0x27, 0xdb, + 0x0b, 0x61, 0xb0, 0xe5, 0x75, 0xec, 0x6f, 0x20, 0x93, 0x2d, 0xbf, 0x1f, 0x27, 0x34, 0xba, 0xe1, + 0x76, 0x69, 0xdd, 0xba, 0x64, 0x3d, 0x3f, 0xd1, 0x78, 0xe2, 0xd7, 0xef, 0xcf, 0xbe, 0xe9, 0xc1, + 0xfd, 0xd9, 0xc9, 0x05, 0x4d, 0x02, 0x93, 0xcf, 0xfe, 0x5a, 0x32, 0x1e, 0x85, 0x3e, 0x9d, 0x87, + 0x1b, 0xf5, 0x12, 0xcb, 0x32, 0x23, 0xb2, 0x8c, 0x03, 0x4f, 0x06, 0x49, 0x47, 0xd6, 0x5e, 0x14, + 0x6e, 0x79, 0x3e, 0xad, 0x97, 0xd3, 0xac, 0xeb, 0x3c, 0x19, 0x24, 0xdd, 0xf9, 0xa9, 0x12, 0x99, + 0x99, 0xef, 0xf5, 0xae, 0x51, 0xd7, 0x4f, 0xb6, 0x9b, 0x89, 0x9b, 0xf4, 0x63, 0x3b, 0x22, 0x63, + 0x31, 0xfb, 0x4f, 0xd4, 0xed, 0x15, 0x91, 0x7b, 0x8c, 0xd3, 0x5f, 0xbf, 0x3f, 0x7b, 0x6d, 0xbf, + 0x11, 0xdd, 0xf1, 0x92, 0xb0, 0x17, 0xbf, 0x83, 0x06, 0x1d, 0x2f, 0xa0, 0x72, 0x7c, 0x6f, 0x33, + 0x01, 0x73, 0xa6, 0x9c, 0x85, 0xb0, 0x4d, 0x41, 0x48, 0xc2, 0x2a, 0x77, 0x69, 0x1c, 0xbb, 0x1d, + 0x9a, 0xfd, 0xba, 0x55, 0x9e, 0x0c, 0x92, 0x6e, 0x47, 0xc4, 0xf6, 0xdd, 0x38, 0xd9, 0x88, 0xdc, + 0x20, 0xf6, 0x70, 0x74, 0x6f, 0x78, 0x5d, 0xfe, 0xa1, 0x93, 0x2f, 0xfc, 0x7f, 0x73, 0xbc, 0x8f, + 0xe6, 0xcc, 0x3e, 0xd2, 0x53, 0x02, 0x87, 0xd0, 0xdc, 0xee, 0x3b, 0xe7, 0x30, 0x47, 0xe3, 0xc9, + 0x07, 0xf7, 0x67, 0xed, 0x95, 0x81, 0x92, 0x20, 0xa7, 0x74, 0xe7, 0x77, 0x4b, 0x84, 0xcc, 0xf7, + 0x7a, 0xeb, 0x51, 0x78, 0x87, 0xb6, 0x12, 0xfb, 0x23, 0xa4, 0x86, 0x45, 0xb5, 0xdd, 0xc4, 0x65, + 0x6d, 0x34, 0xf9, 0xc2, 0xd7, 0x8f, 0x26, 0x78, 0x6d, 0x13, 0xf3, 0xaf, 0xd2, 0xc4, 0x6d, 0xd8, + 0xe2, 0x03, 0x89, 0x4e, 0x03, 0x55, 0xaa, 0x1d, 0x90, 0x4a, 0xdc, 0xa3, 0x2d, 0xd6, 0x18, 0x93, + 0x2f, 0xac, 0xcc, 0x1d, 0x65, 0xd2, 0xcf, 0xe9, 0x9a, 0x37, 0x7b, 0xb4, 0xd5, 0x98, 0x12, 0x92, + 0x2b, 0xf8, 0x0b, 0x98, 0x1c, 0x7b, 0x57, 0xf5, 0x39, 0x6f, 0xc8, 0x1b, 0x85, 0x49, 0x64, 0xa5, + 0x36, 0xa6, 0xd3, 0x63, 0x48, 0xf6, 0xbb, 0xf3, 0x9f, 0x2d, 0x32, 0xad, 0x99, 0x57, 0xbc, 0x38, + 0xb1, 0x3f, 0x30, 0xd0, 0xb8, 0x73, 0xa3, 0x35, 0x2e, 0xe6, 0x66, 0x4d, 0x7b, 0x5a, 0x08, 0xab, + 0xc9, 0x14, 0xa3, 0x61, 0xbb, 0xa4, 0xea, 0x25, 0xb4, 0x1b, 0xd7, 0x4b, 0x97, 0xca, 0xcf, 0x4f, + 0xbe, 0x70, 0xad, 0xa8, 0xef, 0x6c, 0x9c, 0x12, 0x42, 0xab, 0xcb, 0x58, 0x3c, 0x70, 0x29, 0xce, + 0x83, 0x19, 0xf3, 0xfb, 0xb0, 0xc1, 0xed, 0x77, 0x92, 0xc9, 0x38, 0xec, 0x47, 0x2d, 0x0a, 0xb4, + 0x17, 0xe2, 0x1c, 0x2b, 0xe3, 0x70, 0xc7, 0xb9, 0xdf, 0xd4, 0xc9, 0x60, 0xf2, 0xd8, 0xdf, 0x6f, + 0x91, 0xa9, 0x36, 0x8d, 0x13, 0x2f, 0x60, 0xf2, 0x65, 0xe5, 0x37, 0x8e, 0x5c, 0x79, 0x99, 0xb8, + 0xa8, 0x0b, 0x6f, 0x9c, 0x15, 0x1f, 0x32, 0x65, 0x24, 0xc6, 0x90, 0x92, 0x8f, 0x6b, 0x58, 0x9b, + 0xc6, 0xad, 0xc8, 0xeb, 0xe1, 0xef, 0x7a, 0x39, 0xbd, 0x86, 0x2d, 0x6a, 0x12, 0x98, 0x7c, 0x76, + 0x40, 0xaa, 0xb8, 0x46, 0xc5, 0xf5, 0x0a, 0xab, 0xff, 0xf2, 0xd1, 0xea, 0x2f, 0x1a, 0x15, 0x97, + 0x3f, 0xdd, 0xfa, 0xf8, 0x2b, 0x06, 0x2e, 0xc6, 0xfe, 0x67, 0x16, 0xa9, 0x8b, 0x35, 0x14, 0x28, + 0x6f, 0xd0, 0xdb, 0xdb, 0x5e, 0x42, 0x7d, 0x2f, 0x4e, 0xea, 0x55, 0x56, 0x87, 0x0f, 0x1c, 0xad, + 0x0e, 0x0b, 0xe9, 0xd2, 0x81, 0xc6, 0x49, 0xe4, 0xb5, 0x90, 0x07, 0x87, 0x41, 0xe3, 0x92, 0xa8, + 0x56, 0x7d, 0x61, 0x48, 0x2d, 0x60, 0x68, 0xfd, 0xec, 0xcf, 0x5b, 0xe4, 0x42, 0xe0, 0x76, 0x69, + 0xdc, 0x73, 0x5b, 0x54, 0x92, 0x1b, 0xbe, 0xdb, 0xda, 0x61, 0xd5, 0x1f, 0x63, 0xd5, 0xbf, 0x3c, + 0xda, 0xd4, 0x58, 0x8a, 0xc2, 0x7e, 0xef, 0xba, 0x17, 0xb4, 0x1b, 0x8e, 0xa8, 0xd1, 0x85, 0x1b, + 0x43, 0x8b, 0x86, 0x7d, 0xc4, 0xda, 0x3f, 0x69, 0x91, 0x33, 0x61, 0xd4, 0xdb, 0x76, 0x03, 0xda, + 0x96, 0xd4, 0xb8, 0x3e, 0xce, 0xe6, 0xe9, 0x87, 0x8e, 0xd6, 0x96, 0x6b, 0xd9, 0x62, 0x57, 0xc3, + 0xc0, 0x4b, 0xc2, 0xa8, 0x49, 0x93, 0xc4, 0x0b, 0x3a, 0x71, 0xe3, 0xdc, 0x83, 0xfb, 0xb3, 0x67, + 0x06, 0xb8, 0x60, 0xb0, 0x3e, 0xf6, 0x27, 0x2c, 0x32, 0x19, 0xef, 0x05, 0xad, 0xdb, 0x5e, 0xd0, + 0x0e, 0xef, 0xc6, 0xf5, 0xda, 0xa5, 0xf2, 0xd1, 0x17, 0xb5, 0xe5, 0xc0, 0xf7, 0x02, 0xda, 0x54, + 0xc5, 0x8a, 0x49, 0xab, 0xc5, 0x80, 0x29, 0x33, 0xbf, 0xff, 0xf4, 0xf0, 0x9b, 0x28, 0xba, 0xff, + 0xf4, 0x98, 0xda, 0x47, 0xac, 0xfd, 0x3d, 0x16, 0x39, 0x15, 0x7b, 0x9d, 0xc0, 0x4d, 0xfa, 0x11, + 0xbd, 0x4e, 0xf7, 0xe2, 0x3a, 0x61, 0x15, 0x79, 0xe9, 0x68, 0x6d, 0xd3, 0x34, 0x8a, 0x6c, 0x9c, + 0x13, 0x75, 0x3c, 0x65, 0xa6, 0xc6, 0x90, 0x96, 0x9b, 0x37, 0x39, 0xf5, 0xe8, 0x9e, 0x7c, 0x84, + 0x93, 0x53, 0x4f, 0x84, 0xa1, 0xf5, 0xb3, 0xff, 0x02, 0x39, 0xcd, 0x93, 0x54, 0x37, 0xc4, 0xf5, + 0x29, 0xb6, 0x92, 0x9f, 0x7d, 0x70, 0x7f, 0xf6, 0x74, 0x33, 0x43, 0x83, 0x01, 0x6e, 0xfb, 0x55, + 0x32, 0xdb, 0xa3, 0x51, 0xd7, 0x4b, 0xd6, 0x02, 0x7f, 0x4f, 0xee, 0x0f, 0xad, 0xb0, 0x47, 0xdb, + 0xa2, 0x3a, 0x71, 0xfd, 0xd4, 0x25, 0xeb, 0xf9, 0x5a, 0xe3, 0x6d, 0xa2, 0x9a, 0xb3, 0xeb, 0xfb, + 0xb3, 0xc3, 0x41, 0xe5, 0xd9, 0xbf, 0x66, 0x91, 0x0b, 0xc6, 0x32, 0xde, 0xa4, 0xd1, 0xae, 0xd7, + 0xa2, 0xf3, 0xad, 0x56, 0xd8, 0x0f, 0x92, 0xb8, 0x3e, 0xcd, 0xda, 0x7c, 0xf3, 0x38, 0x36, 0x95, + 0xb4, 0x28, 0x3d, 0x88, 0x87, 0xb2, 0xc4, 0xb0, 0x4f, 0x4d, 0xed, 0xcf, 0x5a, 0x64, 0x86, 0x37, + 0xe8, 0x72, 0x90, 0xd0, 0x4e, 0xe4, 0x25, 0x7b, 0xf5, 0x19, 0xb6, 0x04, 0xad, 0x1e, 0x71, 0x18, + 0xa7, 0x0b, 0x6d, 0x3c, 0xf1, 0xe0, 0xfe, 0xec, 0x4c, 0x26, 0x11, 0xb2, 0xa2, 0x9d, 0xdf, 0x28, + 0x91, 0xd3, 0x59, 0x8d, 0xc7, 0xfe, 0x9b, 0x16, 0x99, 0xb9, 0x73, 0x37, 0xd9, 0x08, 0x77, 0x68, + 0x10, 0x37, 0xf6, 0x70, 0x5f, 0x62, 0x7b, 0xfd, 0xe4, 0x0b, 0xad, 0x62, 0x75, 0xab, 0xb9, 0x97, + 0xd2, 0x52, 0xae, 0x04, 0x49, 0xb4, 0xd7, 0x78, 0x4a, 0x34, 0xf1, 0xcc, 0x4b, 0xb7, 0x37, 0x4c, + 0x2a, 0x64, 0x2b, 0x75, 0xe1, 0x33, 0x16, 0x39, 0x9b, 0x57, 0x84, 0x7d, 0x9a, 0x94, 0x77, 0xe8, + 0x1e, 0x3f, 0x04, 0x00, 0xfe, 0x6b, 0x7f, 0x90, 0x54, 0x77, 0x5d, 0xbf, 0x4f, 0x85, 0x5a, 0xba, + 0x74, 0xb4, 0x0f, 0x51, 0x35, 0x03, 0x5e, 0xea, 0x37, 0x95, 0x5e, 0xb4, 0x9c, 0xdf, 0x2c, 0x93, + 0x49, 0x63, 0x0c, 0x9d, 0x80, 0xaa, 0x1d, 0xa6, 0x54, 0xed, 0xd5, 0xc2, 0x86, 0xff, 0x50, 0x5d, + 0xfb, 0x6e, 0x46, 0xd7, 0x5e, 0x2b, 0x4e, 0xe4, 0xbe, 0xca, 0xb6, 0x9d, 0x90, 0x89, 0xb0, 0x47, + 0x23, 0xc6, 0x5a, 0xaf, 0x14, 0xd1, 0x85, 0x6b, 0xb2, 0xb8, 0xc6, 0xa9, 0x07, 0xf7, 0x67, 0x27, + 0xd4, 0x4f, 0xd0, 0x82, 0x9c, 0x7f, 0x6f, 0x91, 0xb3, 0x46, 0x1d, 0x17, 0xc2, 0xa0, 0xcd, 0x0e, + 0x56, 0xf6, 0x25, 0x52, 0x49, 0xf6, 0x7a, 0xf2, 0x04, 0xac, 0x5a, 0x6a, 0x63, 0xaf, 0x47, 0x81, + 0x51, 0x1e, 0xf7, 0x53, 0xe1, 0xe7, 0x2d, 0xf2, 0x64, 0xfe, 0x7a, 0x67, 0xbf, 0x95, 0x8c, 0x71, + 0xf3, 0x87, 0xf8, 0x3a, 0xdd, 0x25, 0x2c, 0x15, 0x04, 0xd5, 0xbe, 0x4c, 0x26, 0xd4, 0x66, 0x2d, + 0xbe, 0xf1, 0x8c, 0x60, 0x9d, 0xd0, 0x3b, 0xbc, 0xe6, 0xc1, 0x46, 0x0b, 0x5c, 0xf1, 0x65, 0x46, + 0xa3, 0x21, 0x2f, 0x30, 0x8a, 0xf3, 0x3b, 0x16, 0xf9, 0x9a, 0x51, 0x56, 0xe1, 0xe3, 0xab, 0x63, + 0x93, 0x9c, 0x6b, 0xd3, 0x2d, 0xb7, 0xef, 0x27, 0x69, 0x89, 0xa2, 0xd2, 0xcf, 0x8a, 0xcc, 0xe7, + 0x16, 0xf3, 0x98, 0x20, 0x3f, 0xaf, 0xf3, 0x07, 0x16, 0x99, 0x31, 0x3e, 0xeb, 0x04, 0x8e, 0x8a, + 0x41, 0xfa, 0xa8, 0xb8, 0x5c, 0xd8, 0x34, 0x1d, 0x72, 0x56, 0xfc, 0x3e, 0x8b, 0x5c, 0x30, 0xb8, + 0x56, 0xdd, 0xa4, 0xb5, 0x7d, 0xe5, 0x5e, 0x2f, 0xa2, 0x71, 0x8c, 0x43, 0xea, 0x59, 0x63, 0x39, + 0x6e, 0x4c, 0x8a, 0x12, 0xca, 0xd7, 0xe9, 0x1e, 0x5f, 0x9b, 0xbf, 0x8e, 0xd4, 0xf8, 0x9c, 0x0b, + 0x23, 0xd1, 0x49, 0xea, 0xdb, 0xd6, 0x44, 0x3a, 0x28, 0x0e, 0xdb, 0x21, 0x63, 0x6c, 0xcd, 0xc5, + 0x35, 0x08, 0xb5, 0x16, 0x82, 0xfd, 0x7e, 0x8b, 0xa5, 0x80, 0xa0, 0x38, 0x71, 0xaa, 0x3a, 0xeb, + 0x11, 0x65, 0xe3, 0xa1, 0x7d, 0xd5, 0xa3, 0x7e, 0x3b, 0xc6, 0x63, 0xac, 0x1b, 0x04, 0x61, 0x22, + 0x4e, 0xa4, 0xc6, 0x31, 0x76, 0x5e, 0x27, 0x83, 0xc9, 0x83, 0x42, 0x7d, 0x77, 0x93, 0xfa, 0xbc, + 0x45, 0x85, 0xd0, 0x15, 0x96, 0x02, 0x82, 0xe2, 0x3c, 0x28, 0x91, 0x69, 0x43, 0x6a, 0x93, 0x9e, + 0x84, 0xb5, 0x25, 0x4a, 0x6d, 0x01, 0xeb, 0xc5, 0xad, 0xc7, 0x74, 0xb8, 0xc5, 0xe5, 0xb5, 0xcc, + 0x2e, 0x00, 0x85, 0x4a, 0xdd, 0xdf, 0xea, 0xf2, 0xc5, 0x32, 0x99, 0x4d, 0x67, 0x18, 0xd8, 0x44, + 0xf0, 0x88, 0x6f, 0x08, 0xca, 0x9a, 0x29, 0x0d, 0x7e, 0x30, 0xf9, 0x86, 0xac, 0xc3, 0xa5, 0xe3, + 0x5c, 0x87, 0xcd, 0x6d, 0xa2, 0x7c, 0xc0, 0x36, 0xb1, 0xa0, 0x5a, 0xbd, 0xc2, 0x38, 0xdf, 0x3e, + 0x60, 0xdb, 0x3c, 0xbf, 0x1e, 0x85, 0x1d, 0x36, 0xe7, 0x76, 0xd9, 0x59, 0x2f, 0xc7, 0x58, 0x79, + 0x89, 0x54, 0xe2, 0x84, 0xf6, 0xea, 0xd5, 0xf4, 0x1a, 0xdc, 0x4c, 0x68, 0x0f, 0x18, 0xc5, 0xfe, + 0x56, 0x32, 0x93, 0xb8, 0x51, 0x87, 0x26, 0x11, 0xdd, 0xf5, 0x98, 0xbd, 0x9b, 0x9d, 0xd7, 0x27, + 0xb8, 0x42, 0xb9, 0xc1, 0x48, 0x20, 0x49, 0x90, 0xe5, 0x75, 0xfe, 0x5b, 0x89, 0x3c, 0x95, 0xee, + 0x1f, 0xbd, 0x6b, 0x7e, 0x5b, 0x6a, 0xd7, 0x7c, 0xbb, 0xb9, 0x6b, 0xbe, 0x7e, 0x7f, 0xf6, 0xe9, + 0x21, 0xd9, 0xbe, 0x6a, 0x36, 0x55, 0x7b, 0x29, 0xd3, 0x43, 0x97, 0x07, 0x7a, 0xe8, 0xd9, 0x21, + 0xdf, 0x98, 0xd1, 0x76, 0xde, 0x4a, 0xc6, 0x22, 0xea, 0xc6, 0x61, 0x20, 0xfa, 0x49, 0x4d, 0x06, + 0x60, 0xa9, 0x20, 0xa8, 0xce, 0x3f, 0x25, 0xd9, 0xc6, 0x5e, 0xe2, 0x36, 0xfc, 0x30, 0xb2, 0x3d, + 0x52, 0x61, 0xc7, 0x51, 0xbe, 0xec, 0x5c, 0x3f, 0xda, 0x14, 0xc5, 0x2d, 0x46, 0x15, 0xdd, 0xa8, + 0x61, 0xaf, 0x61, 0x12, 0x30, 0x11, 0xf6, 0x3d, 0x52, 0x6b, 0xc9, 0x83, 0x5f, 0xa9, 0x08, 0x1b, + 0xac, 0x38, 0xf6, 0x69, 0x89, 0x53, 0xb8, 0x17, 0xa8, 0xd3, 0xa2, 0x92, 0x66, 0x53, 0x52, 0xee, + 0x78, 0x89, 0xe8, 0xd6, 0x23, 0xda, 0x01, 0x96, 0x3c, 0xe3, 0x13, 0xc7, 0x71, 0x83, 0x5a, 0xf2, + 0x12, 0xc0, 0xf2, 0xed, 0x4f, 0xa2, 0x4d, 0xa6, 0xd5, 0x5d, 0x8f, 0xc2, 0x5d, 0xaf, 0x4d, 0xa3, + 0x7a, 0xa5, 0x88, 0x65, 0xaf, 0xb9, 0xb0, 0x2a, 0x0b, 0xd4, 0x72, 0xb9, 0x5d, 0x46, 0x53, 0xc0, + 0x94, 0x8b, 0x07, 0xb3, 0xa7, 0xc4, 0xb7, 0x2f, 0xd2, 0x16, 0x9b, 0x71, 0xf2, 0x7c, 0x5f, 0xaf, + 0x16, 0xa1, 0x90, 0x2f, 0xf6, 0x5b, 0x3b, 0x38, 0xdf, 0x74, 0x85, 0x9e, 0x7e, 0x70, 0x7f, 0xf6, + 0xa9, 0x85, 0x7c, 0x99, 0x30, 0xac, 0x32, 0xac, 0xc1, 0x7a, 0x7d, 0xdf, 0x07, 0xfa, 0x6a, 0x9f, + 0x32, 0x8b, 0x5f, 0x01, 0x0d, 0xb6, 0xae, 0x0b, 0xcc, 0x34, 0x98, 0x41, 0x01, 0x53, 0xae, 0xfd, + 0x2a, 0x19, 0xeb, 0xba, 0x49, 0xe4, 0xdd, 0xab, 0x8f, 0x17, 0x71, 0x44, 0x5a, 0x65, 0x65, 0x69, + 0xe1, 0x4c, 0x0b, 0xe0, 0x89, 0x20, 0x04, 0xa1, 0x95, 0xbe, 0x4b, 0xa3, 0x0e, 0xad, 0xd7, 0x8a, + 0xb8, 0xff, 0x58, 0xc5, 0xa2, 0xb4, 0xc0, 0x09, 0xd4, 0xbc, 0x58, 0x1a, 0x70, 0x29, 0xf6, 0x07, + 0x49, 0x2d, 0xa6, 0x3e, 0x6d, 0xa1, 0xee, 0x34, 0xc1, 0x24, 0xbe, 0x6b, 0x44, 0x3d, 0x12, 0x95, + 0x96, 0xa6, 0xc8, 0xca, 0x27, 0x98, 0xfc, 0x05, 0xaa, 0x48, 0x6c, 0xc0, 0x9e, 0xdf, 0xef, 0x78, + 0x41, 0x9d, 0x14, 0xd1, 0x80, 0xeb, 0xac, 0xac, 0x4c, 0x03, 0xf2, 0x44, 0x10, 0x82, 0x70, 0x4e, + 0x87, 0x2d, 0xaf, 0x3e, 0x59, 0xc4, 0x9c, 0x5e, 0x6b, 0x79, 0x99, 0x39, 0xbd, 0xd6, 0xf2, 0x00, + 0xcb, 0x77, 0xfe, 0xab, 0x45, 0xec, 0xf4, 0xda, 0x79, 0x02, 0x7a, 0xf9, 0xab, 0x69, 0xbd, 0x7c, + 0xa5, 0x48, 0xc5, 0x69, 0x88, 0x6a, 0xfe, 0x13, 0x84, 0x64, 0x76, 0x9d, 0x1b, 0x34, 0x4e, 0x68, + 0xfb, 0x8d, 0x9d, 0xe2, 0x8d, 0x9d, 0xe2, 0x8d, 0x9d, 0x42, 0xfe, 0xb0, 0x37, 0x33, 0x3b, 0xc5, + 0x7b, 0x8d, 0x59, 0xaf, 0x5d, 0x3f, 0x3e, 0xac, 0x7c, 0x43, 0xcc, 0x1a, 0x18, 0x0c, 0xb8, 0x12, + 0xbc, 0xd4, 0x5c, 0xbb, 0x91, 0xbb, 0x35, 0x7c, 0x38, 0xbd, 0x35, 0x1c, 0x55, 0xc4, 0x1b, 0x9b, + 0x41, 0x61, 0x9b, 0xc1, 0xaf, 0x59, 0xe4, 0x6d, 0xe9, 0x45, 0x52, 0x0e, 0xd0, 0xe5, 0x4e, 0x10, + 0x46, 0x74, 0xd1, 0xdb, 0xda, 0xa2, 0x11, 0x0d, 0xf0, 0xf6, 0x43, 0x9a, 0xb1, 0xac, 0x61, 0x66, + 0x2c, 0xfb, 0xdd, 0x64, 0xea, 0x4e, 0x1c, 0x06, 0xeb, 0xa1, 0x17, 0x88, 0x95, 0x0e, 0xcf, 0x4f, + 0xa7, 0xf1, 0x62, 0x1a, 0x3b, 0x4e, 0xa6, 0x43, 0x8a, 0xcb, 0x5e, 0x20, 0x67, 0xee, 0xbc, 0xba, + 0xee, 0x26, 0x86, 0xe1, 0x44, 0x9a, 0x38, 0xd8, 0xed, 0xe1, 0x4b, 0x2f, 0x67, 0x88, 0x30, 0xc8, + 0xef, 0xfc, 0xb5, 0x12, 0x39, 0x9f, 0xf9, 0x90, 0xd0, 0xf7, 0xc3, 0x7e, 0x82, 0x27, 0x3c, 0xfb, + 0xc7, 0x2c, 0x72, 0xba, 0x9b, 0xb6, 0xcd, 0xc4, 0xc2, 0xb2, 0xff, 0xed, 0x85, 0x6d, 0x45, 0x19, + 0xe3, 0x4f, 0xa3, 0x2e, 0x5a, 0xe8, 0x74, 0x86, 0x10, 0xc3, 0x40, 0x5d, 0xec, 0x0f, 0x92, 0x89, + 0xae, 0x7b, 0xef, 0x66, 0xaf, 0xed, 0x26, 0xf2, 0xe4, 0x3d, 0xdc, 0x60, 0xd2, 0x4f, 0x3c, 0x7f, + 0x8e, 0xfb, 0x2e, 0xcd, 0x2d, 0x07, 0xc9, 0x5a, 0xd4, 0x4c, 0x22, 0x2f, 0xe8, 0x70, 0x7b, 0xee, + 0xaa, 0x2c, 0x06, 0x74, 0x89, 0xce, 0x17, 0x2d, 0xf2, 0xec, 0x90, 0xd6, 0x89, 0xdc, 0x84, 0x76, + 0xf6, 0xec, 0x8f, 0x92, 0x2a, 0x9e, 0x82, 0x65, 0xab, 0xdc, 0x2e, 0x72, 0x83, 0x36, 0x7a, 0x42, + 0xef, 0xd5, 0xf8, 0x2b, 0x06, 0x2e, 0xd4, 0xf9, 0xb1, 0x89, 0xac, 0x4e, 0xc2, 0xdc, 0x2e, 0x5e, + 0x20, 0xa4, 0x13, 0x6e, 0xd0, 0x6e, 0xcf, 0x77, 0x13, 0x3e, 0xee, 0x6a, 0xda, 0x2a, 0xb4, 0xa4, + 0x28, 0x60, 0x70, 0xd9, 0x9f, 0xb6, 0x08, 0xe9, 0xc8, 0xd1, 0x2e, 0xf5, 0x8d, 0x9b, 0x45, 0x7e, + 0x8e, 0x9e, 0x4b, 0xba, 0x2e, 0x4a, 0x20, 0x18, 0xc2, 0xed, 0xef, 0xb2, 0x48, 0x2d, 0x91, 0xd5, + 0xe7, 0x3b, 0xf0, 0x46, 0x91, 0x35, 0x91, 0x1f, 0xad, 0x55, 0x2f, 0xd5, 0x24, 0x4a, 0xae, 0xfd, + 0x97, 0x2d, 0x42, 0xf0, 0x8e, 0x7b, 0x3d, 0xf4, 0xbd, 0xd6, 0x9e, 0xd8, 0x98, 0x6f, 0x15, 0x6a, + 0xb9, 0x52, 0xa5, 0x37, 0xa6, 0xb1, 0x35, 0xf4, 0x6f, 0x30, 0x24, 0xdb, 0x1f, 0x23, 0xb5, 0x58, + 0x0c, 0xb7, 0x7a, 0xb5, 0xf8, 0xc6, 0x90, 0x43, 0x59, 0xac, 0xe2, 0xe2, 0x17, 0x28, 0x99, 0xf6, + 0x0f, 0x5b, 0x64, 0xa6, 0x97, 0xb6, 0x88, 0x8a, 0x5d, 0xb7, 0xb8, 0x35, 0x20, 0x63, 0x71, 0xe5, + 0xb6, 0xa3, 0x4c, 0x22, 0x64, 0x6b, 0x81, 0x2b, 0xa0, 0x1e, 0xc1, 0x6b, 0x3d, 0x6e, 0x9d, 0x1d, + 0xd7, 0x2b, 0xe0, 0x52, 0x96, 0x08, 0x83, 0xfc, 0xf6, 0x3a, 0x39, 0x8b, 0xb5, 0xdb, 0xe3, 0x5a, + 0xae, 0xdc, 0xc5, 0x62, 0xb6, 0xe7, 0xd6, 0x1a, 0xcf, 0x88, 0x11, 0x72, 0x76, 0x3e, 0x87, 0x07, + 0x72, 0x73, 0xda, 0xbf, 0x69, 0x91, 0x67, 0x3c, 0xb6, 0x0d, 0x98, 0x77, 0x13, 0x7a, 0x47, 0x10, + 0xfe, 0x10, 0xb4, 0xd0, 0xb5, 0x62, 0xd8, 0xf6, 0xd3, 0xf8, 0x1a, 0xf1, 0x05, 0xcf, 0x2c, 0xef, + 0x53, 0x25, 0xd8, 0xb7, 0xc2, 0xf6, 0x37, 0x92, 0x53, 0x72, 0x5e, 0xac, 0xe3, 0x12, 0xcc, 0xf6, + 0xf3, 0x89, 0xc6, 0x19, 0x74, 0x7c, 0xd8, 0x30, 0x09, 0x90, 0xe6, 0x73, 0xfe, 0xac, 0x42, 0xce, + 0x66, 0x87, 0x1b, 0xb3, 0x58, 0xe1, 0x72, 0xd3, 0x92, 0xd6, 0x2c, 0xb9, 0x7a, 0x16, 0xba, 0xdc, + 0x28, 0x5b, 0x99, 0x5e, 0x6e, 0x54, 0x52, 0x0c, 0x86, 0x70, 0xd4, 0x7d, 0xcf, 0xb8, 0x59, 0xa3, + 0xb0, 0x58, 0x01, 0x3f, 0x58, 0x64, 0x95, 0x06, 0xaf, 0x2f, 0xcf, 0x8b, 0xaa, 0x9d, 0x19, 0x20, + 0xc1, 0x60, 0x95, 0xec, 0xef, 0x20, 0x13, 0x91, 0xf2, 0x43, 0x2a, 0x17, 0x71, 0x22, 0x94, 0xc3, + 0x46, 0x54, 0x47, 0xdd, 0x75, 0x69, 0x8f, 0x23, 0x2d, 0xd1, 0x7e, 0x2f, 0x99, 0x56, 0x3f, 0x16, + 0xd8, 0x25, 0x17, 0x2e, 0x8a, 0xe5, 0xc6, 0x93, 0x22, 0xd7, 0x34, 0xa4, 0xa8, 0x90, 0xe1, 0x46, + 0x67, 0x5b, 0xee, 0x1b, 0x5b, 0xaf, 0x16, 0xa1, 0x9e, 0x99, 0x0e, 0xb6, 0xda, 0xe2, 0xc9, 0x53, + 0x41, 0x48, 0x72, 0x3e, 0x55, 0x22, 0x4f, 0x66, 0x07, 0xa0, 0x58, 0xd7, 0x0e, 0xbe, 0x93, 0xfd, + 0x7e, 0x8b, 0x4c, 0x46, 0xa1, 0xef, 0x7b, 0x41, 0x07, 0xd7, 0x66, 0xa1, 0x60, 0xbc, 0xff, 0x58, + 0xf6, 0x78, 0xb1, 0x08, 0xb3, 0x43, 0x07, 0x68, 0x99, 0x60, 0x56, 0xc0, 0xfe, 0x66, 0x72, 0xaa, + 0x4d, 0x7d, 0x8a, 0x79, 0xd7, 0x22, 0x3c, 0x2e, 0xf2, 0x3b, 0x00, 0xe5, 0x84, 0xb4, 0x68, 0x12, + 0x21, 0xcd, 0x8b, 0xfe, 0xa7, 0xf5, 0x61, 0x1b, 0x90, 0x4d, 0xc9, 0xd3, 0x72, 0x75, 0x55, 0xbd, + 0xb8, 0x16, 0xc8, 0xf2, 0x84, 0x0e, 0xf1, 0x9c, 0x90, 0xf3, 0xf4, 0xfa, 0x70, 0x56, 0xd8, 0xaf, + 0x1c, 0xfb, 0x15, 0x72, 0xda, 0x68, 0x94, 0x58, 0xb5, 0xea, 0x44, 0x63, 0x0e, 0x35, 0xbe, 0xf9, + 0x0c, 0xed, 0xf5, 0xfb, 0xb3, 0x4f, 0x66, 0xd3, 0xc4, 0x0e, 0x39, 0x50, 0x0e, 0xfa, 0x77, 0x3f, + 0x99, 0xbf, 0xcf, 0xdb, 0x5f, 0xb0, 0x06, 0xac, 0x34, 0xdf, 0x7e, 0x1c, 0x0a, 0x05, 0xb3, 0xe7, + 0x28, 0x8f, 0x9f, 0xe1, 0x3c, 0x8f, 0xd0, 0x25, 0xc3, 0xf9, 0x57, 0x15, 0xb2, 0x4f, 0xcd, 0x46, + 0x38, 0xad, 0x1c, 0xfa, 0x8e, 0xfc, 0xb3, 0x96, 0xba, 0x0c, 0xe5, 0x8b, 0x56, 0xfb, 0xb8, 0xda, + 0x9e, 0x9f, 0x4b, 0x63, 0xee, 0x16, 0xa4, 0x96, 0x84, 0xf4, 0xb5, 0xab, 0xfd, 0x25, 0x2b, 0x7d, + 0x9d, 0xcb, 0x1d, 0x74, 0xbd, 0x63, 0xab, 0x93, 0x71, 0x47, 0xcc, 0x2b, 0xa6, 0x6f, 0x16, 0x87, + 0xdd, 0x1e, 0xcf, 0x11, 0xb2, 0xe5, 0x05, 0xae, 0xef, 0xbd, 0x86, 0xc7, 0xc1, 0x2a, 0xd3, 0x68, + 0x98, 0x8a, 0x78, 0x55, 0xa5, 0x82, 0xc1, 0x71, 0xe1, 0xff, 0x27, 0x93, 0xc6, 0x97, 0xe7, 0x78, + 0x33, 0x9d, 0x35, 0xbd, 0x99, 0x26, 0x0c, 0x27, 0xa4, 0x0b, 0xef, 0x25, 0xa7, 0xb3, 0x15, 0x3c, + 0x4c, 0x7e, 0xe7, 0x0f, 0x6a, 0xd9, 0xfb, 0xd5, 0x0d, 0x1a, 0x75, 0xb1, 0x6a, 0x6f, 0x18, 0x0c, + 0xdf, 0x30, 0x18, 0xbe, 0x61, 0x30, 0x34, 0xaf, 0x96, 0x84, 0x31, 0x6c, 0xfc, 0xa4, 0x8c, 0x61, + 0xa6, 0x79, 0xaf, 0x56, 0xbc, 0x79, 0x4f, 0xd8, 0xda, 0x26, 0x8e, 0xd9, 0xd6, 0xf6, 0xc9, 0x81, + 0x8b, 0x97, 0x8d, 0x88, 0x52, 0x3b, 0x24, 0xd5, 0x20, 0x6c, 0x53, 0x79, 0x76, 0x78, 0xa9, 0x18, + 0x45, 0xf8, 0x46, 0xd8, 0x36, 0x22, 0x2c, 0xf0, 0x57, 0x0c, 0x5c, 0x8e, 0xf3, 0xbf, 0x07, 0xf4, + 0xa7, 0xdb, 0xcc, 0x1c, 0xb5, 0x4b, 0x83, 0xc4, 0xbe, 0x9e, 0x52, 0x26, 0xbf, 0x31, 0xe3, 0xaa, + 0xf0, 0xb6, 0x61, 0xe1, 0x74, 0x77, 0xb1, 0x84, 0x39, 0x56, 0x84, 0xa1, 0x77, 0x7e, 0xd6, 0x22, + 0xd3, 0x6e, 0x4a, 0x52, 0x61, 0xc1, 0x51, 0xe6, 0xfd, 0x8f, 0xd2, 0xdb, 0xd3, 0xe9, 0x90, 0x91, + 0xed, 0xfc, 0xe3, 0x31, 0x92, 0x3a, 0x9f, 0xf0, 0x79, 0x85, 0x41, 0x7a, 0xb4, 0x17, 0xde, 0x84, + 0x95, 0xba, 0x95, 0xf6, 0xad, 0x00, 0x9e, 0x0c, 0x92, 0x8e, 0x3a, 0x45, 0xcf, 0x4d, 0xb6, 0xeb, + 0xa5, 0xb4, 0x4e, 0x81, 0xb6, 0x48, 0x60, 0x14, 0x3c, 0x5a, 0x24, 0x29, 0x4f, 0x11, 0xe1, 0x11, + 0xa1, 0xaa, 0x98, 0xf6, 0x23, 0x81, 0x0c, 0xb7, 0xfd, 0x2a, 0xa9, 0x6c, 0x53, 0xbf, 0x2b, 0xa6, + 0x56, 0xb3, 0xb8, 0x66, 0x62, 0xdf, 0x7a, 0x8d, 0xfa, 0x5d, 0xbe, 0xd3, 0xe0, 0x7f, 0xc0, 0x44, + 0xe1, 0xba, 0x32, 0xb1, 0xd3, 0x8f, 0x93, 0xb0, 0xeb, 0xbd, 0x26, 0x2d, 0xf4, 0xdf, 0x5e, 0xb0, + 0xe0, 0xeb, 0xb2, 0x7c, 0x6e, 0xa3, 0x54, 0x3f, 0x41, 0x4b, 0x66, 0xf5, 0x68, 0x7b, 0x11, 0x9b, + 0x92, 0x7b, 0x75, 0x72, 0x2c, 0xf5, 0x58, 0x94, 0xe5, 0xf3, 0x7a, 0xa8, 0x9f, 0xa0, 0x25, 0xdb, + 0x7b, 0x6a, 0x7d, 0xe3, 0xc6, 0xf7, 0x9b, 0x05, 0xd7, 0x81, 0xaf, 0x6d, 0xb9, 0xeb, 0xdc, 0x73, + 0xa4, 0xda, 0xda, 0x76, 0xa3, 0xa4, 0x3e, 0xc5, 0x06, 0x8d, 0x9a, 0xbe, 0x0b, 0x98, 0x08, 0x9c, + 0x86, 0x3e, 0x85, 0x11, 0xdd, 0xaa, 0x9f, 0x4a, 0xfb, 0x14, 0x02, 0xdd, 0x02, 0x4c, 0x57, 0x7a, + 0xef, 0xf4, 0x7e, 0x7a, 0x6f, 0xe2, 0x76, 0xd6, 0x23, 0xba, 0xe5, 0xdd, 0xab, 0xcf, 0xa4, 0xf5, + 0xde, 0x0d, 0x49, 0x00, 0xcd, 0xe3, 0xfc, 0x9f, 0x12, 0xb9, 0x30, 0xf0, 0x19, 0xaa, 0xed, 0xf8, + 0x04, 0x6a, 0xf5, 0xa3, 0x58, 0x9a, 0x68, 0x8d, 0x09, 0xc4, 0x92, 0x41, 0xd2, 0x31, 0xc6, 0x67, + 0x1c, 0x6d, 0xff, 0x81, 0x5a, 0x09, 0x6e, 0x15, 0xdc, 0xba, 0x2f, 0xf1, 0xd2, 0x75, 0x1d, 0x44, + 0x02, 0x48, 0xb9, 0x58, 0x5d, 0x7a, 0xaf, 0xe5, 0xf7, 0xdb, 0x03, 0x9e, 0x67, 0x57, 0x78, 0x32, + 0x48, 0x3a, 0xb2, 0x7a, 0x01, 0x67, 0xad, 0xa4, 0x59, 0x97, 0x03, 0xc1, 0x2a, 0xe8, 0xf6, 0x2d, + 0xf2, 0x64, 0xdb, 0x8b, 0xdd, 0x4d, 0x9f, 0x5e, 0x91, 0x17, 0x56, 0x57, 0x3d, 0x3f, 0xa1, 0x11, + 0x53, 0x22, 0x6a, 0x8d, 0x8b, 0x22, 0xe7, 0x93, 0x8b, 0xb9, 0x5c, 0x30, 0x24, 0xb7, 0xf3, 0x4b, + 0x35, 0x72, 0x2e, 0x77, 0x1e, 0xa3, 0x6e, 0xcd, 0xb4, 0xd7, 0xab, 0x9e, 0x4f, 0xa5, 0x2f, 0x27, + 0xd3, 0xad, 0x6f, 0xa9, 0x54, 0x30, 0x38, 0xec, 0xef, 0x24, 0xa4, 0xe7, 0x46, 0x6e, 0x97, 0xaa, + 0xab, 0x99, 0x23, 0xab, 0xb0, 0x58, 0x8f, 0x75, 0x59, 0xa6, 0x36, 0x4f, 0xa9, 0xa4, 0x18, 0x0c, + 0x91, 0xe8, 0x9d, 0x18, 0x51, 0x9f, 0xba, 0x31, 0x0b, 0xa9, 0xc9, 0x06, 0x20, 0x82, 0x26, 0x81, + 0xc9, 0x87, 0x3e, 0x61, 0xc2, 0xed, 0xb5, 0x92, 0xf6, 0x09, 0x4b, 0xbb, 0xbe, 0xda, 0x3f, 0x60, + 0x91, 0x69, 0x8c, 0x8f, 0xd6, 0xd2, 0x45, 0xb8, 0xe0, 0xda, 0xd1, 0x3f, 0xf2, 0xaa, 0x59, 0xae, + 0x5e, 0xcc, 0x53, 0xc9, 0x31, 0x64, 0xc4, 0xe3, 0xf0, 0xd9, 0xa5, 0x11, 0xdb, 0x05, 0xc6, 0xd2, + 0xc3, 0xe7, 0x16, 0x4f, 0x06, 0x49, 0xb7, 0xe7, 0xc9, 0x4c, 0xcf, 0x8d, 0xe3, 0x85, 0x88, 0xb6, + 0x69, 0x90, 0x78, 0xae, 0xcf, 0xe3, 0xf3, 0x6a, 0x3a, 0x26, 0x64, 0x3d, 0x4d, 0x86, 0x2c, 0xbf, + 0xfd, 0x3e, 0xf2, 0x14, 0xb7, 0x7d, 0xae, 0x7a, 0x71, 0xec, 0x05, 0x1d, 0x3d, 0x0c, 0x84, 0x09, + 0x78, 0x56, 0x14, 0xf5, 0xd4, 0x72, 0x3e, 0x1b, 0x0c, 0xcb, 0x8f, 0x7e, 0xca, 0xf1, 0x8e, 0xd7, + 0x5b, 0x88, 0xda, 0x31, 0xd3, 0x92, 0x6a, 0xfa, 0xc2, 0xa1, 0x29, 0xd2, 0x41, 0x71, 0xd8, 0x2d, + 0x32, 0xc5, 0xbb, 0x84, 0xfb, 0xed, 0x8a, 0xa5, 0xfc, 0x1d, 0x43, 0x35, 0x36, 0x11, 0xc2, 0x3f, + 0x07, 0xee, 0x5d, 0x35, 0xfa, 0xf9, 0xa5, 0xe1, 0x2d, 0xa3, 0x18, 0x48, 0x15, 0x9a, 0x3e, 0xbc, + 0x4f, 0x8e, 0x70, 0x78, 0xff, 0x06, 0x32, 0xb9, 0xd3, 0xdf, 0xa4, 0xa2, 0xe5, 0xeb, 0x53, 0xe9, + 0xd1, 0x77, 0x5d, 0x93, 0xc0, 0xe4, 0x63, 0x2e, 0xd3, 0x3d, 0x4f, 0xfc, 0xc2, 0xf0, 0x2e, 0xed, + 0x32, 0xbd, 0xbe, 0x2c, 0x93, 0xc1, 0xe4, 0xc1, 0xaa, 0x61, 0x5b, 0x6c, 0xd0, 0x98, 0x05, 0x68, + 0x61, 0x73, 0xa9, 0xaa, 0x35, 0x25, 0x01, 0x34, 0x0f, 0x5a, 0xee, 0xf1, 0x47, 0x93, 0x41, 0x18, + 0xdc, 0x72, 0x7d, 0xaf, 0xcd, 0xfd, 0x77, 0x67, 0xd2, 0x96, 0xfb, 0x66, 0x0e, 0x0f, 0xe4, 0xe6, + 0xfc, 0xa6, 0xda, 0x17, 0xbe, 0x34, 0xfb, 0xa6, 0x8f, 0xff, 0xfe, 0xa5, 0x37, 0x39, 0x3f, 0x52, + 0x22, 0xf5, 0x81, 0xf5, 0x43, 0xac, 0x89, 0x76, 0x8c, 0x4b, 0x61, 0x72, 0xcb, 0x8d, 0xa4, 0xf2, + 0x79, 0xc4, 0xd0, 0x6a, 0x51, 0xee, 0x2d, 0x37, 0x32, 0x17, 0x55, 0x26, 0x00, 0xa4, 0x24, 0xfb, + 0x0e, 0xa9, 0x24, 0xbe, 0x5b, 0x50, 0x30, 0xb7, 0x21, 0x51, 0x1b, 0x3e, 0x57, 0xe6, 0x63, 0x60, + 0x32, 0xec, 0x67, 0xf0, 0xc0, 0xbe, 0x29, 0x6f, 0x93, 0xc5, 0x19, 0x7b, 0x33, 0x06, 0x96, 0xea, + 0xfc, 0x95, 0x53, 0x39, 0xfb, 0x9a, 0xd2, 0x4d, 0xf0, 0xf6, 0x11, 0x87, 0x8f, 0xd8, 0x28, 0xb9, + 0x6e, 0xa8, 0xd6, 0xb8, 0x1b, 0x8a, 0x02, 0x06, 0x97, 0xcc, 0xd3, 0xec, 0x6f, 0x61, 0x9e, 0xd2, + 0x60, 0x1e, 0x4e, 0x01, 0x83, 0xcb, 0x7e, 0x37, 0x19, 0xf3, 0xba, 0x6e, 0x47, 0xf9, 0xf5, 0x3f, + 0x83, 0x8b, 0xdb, 0x32, 0x4b, 0x79, 0xfd, 0xfe, 0xec, 0xb4, 0xaa, 0x10, 0x4b, 0x02, 0xc1, 0x6b, + 0xff, 0x94, 0x45, 0xa6, 0x5a, 0x61, 0xb7, 0x1b, 0x06, 0xdc, 0x62, 0x22, 0xcc, 0x3f, 0x77, 0x8e, + 0x4b, 0x73, 0x9b, 0x5b, 0x30, 0x84, 0x71, 0xfb, 0x8f, 0x8a, 0x3a, 0x37, 0x49, 0x90, 0xaa, 0x95, + 0xb9, 0x06, 0x56, 0x0f, 0x58, 0x03, 0x7f, 0xc1, 0x22, 0x67, 0x78, 0x5e, 0xc3, 0x90, 0x23, 0x62, + 0xa6, 0xc3, 0x63, 0xfe, 0xac, 0x01, 0xdb, 0x96, 0xba, 0xd0, 0x18, 0xa0, 0xc3, 0x60, 0x25, 0xed, + 0x25, 0x72, 0x66, 0x2b, 0x8c, 0x5a, 0xd4, 0x6c, 0x08, 0xb1, 0x80, 0xab, 0x82, 0xae, 0x66, 0x19, + 0x60, 0x30, 0x0f, 0xaa, 0x11, 0x46, 0xa2, 0xd9, 0x0e, 0xb5, 0xb4, 0x1a, 0x71, 0x35, 0x97, 0x0b, + 0x86, 0xe4, 0x4e, 0x2f, 0x97, 0x13, 0x23, 0x2c, 0x97, 0x1f, 0x26, 0xe7, 0x5b, 0x83, 0x2d, 0xb3, + 0x1b, 0xf7, 0x37, 0x63, 0xbe, 0xa2, 0xd7, 0x1a, 0x6f, 0x16, 0x05, 0x9c, 0x5f, 0x18, 0xc6, 0x08, + 0xc3, 0xcb, 0xb0, 0x3f, 0x4a, 0x6a, 0x11, 0x65, 0xbd, 0x12, 0x8b, 0xc8, 0xe1, 0x23, 0x1a, 0xb8, + 0xf4, 0xa1, 0x82, 0x17, 0xab, 0xf7, 0x28, 0x91, 0x10, 0x83, 0x92, 0x68, 0xdf, 0x25, 0xe3, 0x3d, + 0x3c, 0xb2, 0x8a, 0x10, 0xe0, 0x23, 0x9f, 0x48, 0x95, 0x70, 0x76, 0x5d, 0x68, 0x80, 0xb7, 0x70, + 0x21, 0x20, 0xa5, 0xa1, 0xd6, 0xd6, 0x0a, 0xbb, 0xbd, 0x30, 0xa0, 0x41, 0x22, 0xb7, 0x93, 0x69, + 0x7e, 0xa7, 0x27, 0x53, 0xc1, 0xe0, 0x18, 0xd8, 0xd5, 0x35, 0x5b, 0xfd, 0xcc, 0x3e, 0xbb, 0xba, + 0x51, 0xda, 0xb0, 0xfc, 0xb8, 0xed, 0x30, 0x4b, 0xf2, 0x6d, 0x2f, 0xd9, 0xc6, 0xab, 0x1b, 0x69, + 0x61, 0x99, 0x4e, 0x6f, 0x3b, 0x2b, 0x39, 0x3c, 0x90, 0x9b, 0x33, 0xbb, 0xc7, 0xce, 0x3c, 0xdc, + 0x1e, 0x7b, 0x7a, 0x84, 0x3d, 0xb6, 0x49, 0xce, 0xb1, 0x1a, 0x08, 0x3d, 0x5c, 0xda, 0xa9, 0xe3, + 0xba, 0xcd, 0x2a, 0xaf, 0xc2, 0xd5, 0x56, 0xf2, 0x98, 0x20, 0x3f, 0xef, 0x85, 0x6f, 0x23, 0x67, + 0x06, 0x16, 0xb9, 0x43, 0xd9, 0xa0, 0x17, 0xc9, 0x93, 0xf9, 0xcb, 0xc9, 0xa1, 0x2c, 0xd1, 0xff, + 0x28, 0x13, 0x49, 0x62, 0x9c, 0x1a, 0x47, 0xb8, 0xd5, 0x70, 0x49, 0x99, 0x06, 0xbb, 0x62, 0x77, + 0xbd, 0x7a, 0xb4, 0x51, 0x7d, 0x25, 0xd8, 0xe5, 0xab, 0x21, 0x33, 0x64, 0x5d, 0x09, 0x76, 0x01, + 0xcb, 0xb6, 0x7f, 0xc8, 0x4a, 0x1d, 0x25, 0xf8, 0x5d, 0xc8, 0x87, 0x8e, 0xe5, 0x98, 0x3c, 0xf2, + 0xe9, 0xc2, 0xf9, 0xd7, 0x25, 0x72, 0xe9, 0xa0, 0x42, 0x46, 0x68, 0xbe, 0xe7, 0x30, 0x94, 0x25, + 0xf2, 0x82, 0x8e, 0xd8, 0xae, 0x26, 0x71, 0x16, 0x73, 0xff, 0xaa, 0x0f, 0x83, 0x20, 0xd9, 0x3e, + 0x29, 0x77, 0xdd, 0x9e, 0x30, 0x91, 0x2f, 0x1f, 0x35, 0x1c, 0x17, 0x7f, 0xbb, 0xfe, 0xaa, 0xdb, + 0xe3, 0x63, 0xde, 0x48, 0x00, 0x14, 0x63, 0x27, 0xa4, 0xea, 0x46, 0x91, 0x2b, 0x5d, 0x77, 0xae, + 0x17, 0x23, 0x6f, 0x1e, 0x8b, 0xe4, 0x9e, 0x0f, 0xa9, 0x24, 0xe0, 0xc2, 0x9c, 0x1f, 0xae, 0xa5, + 0x62, 0x37, 0x99, 0x3f, 0x56, 0x4c, 0xc6, 0x84, 0x65, 0xdc, 0x2a, 0x3a, 0x0a, 0x9a, 0x15, 0xcb, + 0x8d, 0x22, 0xfc, 0x7f, 0x10, 0xa2, 0xec, 0xcf, 0x58, 0x0c, 0xb8, 0x46, 0x06, 0xc4, 0xd6, 0x4b, + 0x05, 0xbb, 0x0e, 0x99, 0x38, 0x3a, 0x26, 0x1c, 0x8e, 0x4c, 0x04, 0x53, 0xba, 0xc0, 0xe9, 0x62, + 0xe7, 0x9a, 0x41, 0x9c, 0x2e, 0x4c, 0x06, 0x49, 0xb7, 0xef, 0xe5, 0xf8, 0x5d, 0x1d, 0x51, 0xdd, + 0x1d, 0xd1, 0xd3, 0xea, 0x4b, 0x16, 0x39, 0xe3, 0x65, 0x1d, 0x68, 0xea, 0xd5, 0x22, 0x3c, 0xfb, + 0x86, 0xfb, 0xe7, 0x28, 0x45, 0x67, 0x80, 0x04, 0x83, 0x95, 0xb1, 0xdb, 0xa4, 0xe2, 0x05, 0x5b, + 0xa1, 0x50, 0xef, 0x1a, 0x47, 0x45, 0x79, 0xd9, 0x0a, 0xf5, 0x6c, 0xc6, 0x5f, 0xc0, 0x4a, 0xb7, + 0x57, 0xc8, 0x59, 0x19, 0xa1, 0x77, 0xcd, 0x8b, 0xd1, 0x5a, 0xb5, 0xe2, 0x75, 0xbd, 0x84, 0xa9, + 0x66, 0xe5, 0x46, 0x1d, 0xb7, 0x37, 0xc8, 0xa1, 0x43, 0x6e, 0x2e, 0xfb, 0x35, 0x32, 0x2e, 0x9d, + 0x56, 0x6a, 0x45, 0x58, 0x16, 0x06, 0xc7, 0xbf, 0x1a, 0x4c, 0xfc, 0x77, 0x0c, 0x52, 0xa0, 0xfd, + 0x29, 0x8b, 0x4c, 0xf3, 0xff, 0xaf, 0xed, 0xb5, 0x79, 0xc4, 0xf0, 0x44, 0x11, 0xa6, 0xf4, 0x66, + 0xaa, 0xcc, 0x86, 0x8d, 0x66, 0x8d, 0x74, 0x1a, 0x64, 0xe4, 0x3a, 0x7f, 0x6b, 0x8a, 0x9c, 0x99, + 0xdf, 0xdf, 0xa7, 0xc7, 0x3a, 0x71, 0x9f, 0x9e, 0x3b, 0xa4, 0x12, 0x6b, 0xd7, 0x96, 0x02, 0xa6, + 0x99, 0x90, 0xaa, 0x3d, 0x0f, 0xd0, 0x89, 0x85, 0xc9, 0xb0, 0xfb, 0xca, 0xff, 0xa7, 0x5c, 0x90, + 0xb3, 0xc3, 0x28, 0x2e, 0x40, 0xf6, 0x3d, 0x32, 0xbe, 0xcd, 0x87, 0xa3, 0x38, 0xeb, 0xad, 0x1e, + 0xb5, 0x7d, 0x53, 0x63, 0x5c, 0x0f, 0x3e, 0x91, 0x00, 0x52, 0x1c, 0x73, 0x21, 0x35, 0x9c, 0xdc, + 0xf8, 0x42, 0x52, 0x5c, 0xf0, 0xf3, 0xe8, 0x1e, 0x6e, 0x1f, 0x21, 0x53, 0x11, 0x6d, 0x85, 0x41, + 0xcb, 0xf3, 0x69, 0x7b, 0x5e, 0xde, 0x81, 0x1e, 0x26, 0xac, 0x95, 0xd9, 0x95, 0xc0, 0x28, 0x03, + 0x52, 0x25, 0xb2, 0x79, 0xa6, 0x70, 0x30, 0xb0, 0x43, 0xa8, 0xb8, 0x8b, 0x59, 0x29, 0x08, 0x75, + 0x83, 0x95, 0xc9, 0xe7, 0x59, 0x3a, 0x0d, 0x32, 0x72, 0xed, 0x57, 0x08, 0x09, 0x37, 0xb9, 0x9f, + 0xe8, 0x7c, 0x52, 0xaf, 0x1d, 0xfa, 0x53, 0xa7, 0x79, 0xec, 0xbc, 0x2c, 0x01, 0x8c, 0xd2, 0xec, + 0xeb, 0x84, 0xf0, 0x99, 0x83, 0xb7, 0x75, 0xf5, 0x89, 0x54, 0x5c, 0x32, 0x69, 0x2a, 0xca, 0xeb, + 0xf7, 0x67, 0x07, 0xad, 0xcf, 0x48, 0x00, 0x23, 0xbb, 0xfd, 0x17, 0xc9, 0x78, 0xdc, 0xef, 0x76, + 0x5d, 0x75, 0x6d, 0x53, 0x60, 0x34, 0x3e, 0x2f, 0xd7, 0x58, 0x18, 0x79, 0x02, 0x48, 0x89, 0xf6, + 0x1d, 0x5c, 0xe2, 0xc5, 0x0a, 0xc5, 0x67, 0x11, 0xfb, 0x5f, 0xd8, 0x04, 0xdf, 0x23, 0x4f, 0x31, + 0x90, 0xc3, 0x83, 0x5e, 0x59, 0xe9, 0xf4, 0x95, 0xb0, 0x25, 0xcc, 0x6a, 0x79, 0x65, 0xda, 0x2f, + 0x91, 0x49, 0xfd, 0xd9, 0x12, 0x3c, 0xea, 0x79, 0x0d, 0x03, 0xc8, 0x92, 0x87, 0xb7, 0x99, 0x99, + 0xd9, 0x5e, 0x25, 0x4f, 0xb4, 0xc2, 0x20, 0x89, 0x42, 0xdf, 0xe7, 0x68, 0xa1, 0xfc, 0x6c, 0xce, + 0xaf, 0x75, 0x9e, 0x16, 0xd5, 0x7e, 0x62, 0x61, 0x90, 0x05, 0xf2, 0xf2, 0xa1, 0x4e, 0x9e, 0xdd, + 0x1f, 0xa6, 0x0b, 0xf1, 0xa8, 0x48, 0x95, 0x29, 0x56, 0x28, 0x65, 0x00, 0x3f, 0x60, 0xa7, 0xf8, + 0xe9, 0xcc, 0x8d, 0xb7, 0xe8, 0xb2, 0x77, 0x93, 0x29, 0x8c, 0xea, 0x89, 0x02, 0xd7, 0xbf, 0x09, + 0x2b, 0xf2, 0xee, 0x82, 0xcd, 0xcc, 0x2b, 0x46, 0x3a, 0xa4, 0xb8, 0x10, 0x89, 0x42, 0x98, 0xc9, + 0x0c, 0x24, 0x0a, 0x6e, 0x26, 0x53, 0x46, 0xb1, 0x6f, 0x20, 0x93, 0x5e, 0x3c, 0xdf, 0xeb, 0xad, + 0x6d, 0xcd, 0xf7, 0x7a, 0x1c, 0xa5, 0xa1, 0xa6, 0x95, 0xba, 0x65, 0x4d, 0x02, 0x93, 0xcf, 0xf9, + 0xb9, 0x72, 0x4a, 0xd7, 0x7d, 0x24, 0xd7, 0xf2, 0x0c, 0xe5, 0x4d, 0xa2, 0xe2, 0x31, 0x42, 0xbd, + 0x54, 0xb8, 0x64, 0xe5, 0x60, 0xb9, 0x66, 0x0a, 0x82, 0xb4, 0x5c, 0x7b, 0x87, 0x54, 0xb7, 0xc3, + 0x38, 0x91, 0x27, 0xbb, 0x23, 0x1e, 0x22, 0xaf, 0x85, 0x71, 0xc2, 0x14, 0x34, 0xf5, 0xd9, 0x98, + 0x12, 0x03, 0x97, 0x81, 0x5d, 0x16, 0x6f, 0xbb, 0x51, 0x3b, 0xe5, 0x89, 0xab, 0xba, 0xac, 0xa9, + 0x49, 0x60, 0xf2, 0x39, 0x7f, 0x68, 0xa5, 0xee, 0xc5, 0x8e, 0xcb, 0x83, 0xe1, 0xe3, 0x56, 0x1a, + 0x52, 0xa3, 0x54, 0xc4, 0x91, 0xcf, 0xa8, 0xf7, 0xc1, 0xe8, 0x1c, 0xce, 0x0f, 0x59, 0x64, 0xbc, + 0xe1, 0xb6, 0x76, 0xc2, 0xad, 0x2d, 0xbc, 0x88, 0x69, 0xf7, 0x23, 0x13, 0xdd, 0x43, 0x19, 0xb9, + 0x16, 0x45, 0x3a, 0x28, 0x0e, 0x9c, 0x31, 0x5b, 0x6e, 0x4b, 0x82, 0xcb, 0x94, 0xf9, 0x8c, 0xb9, + 0xca, 0x52, 0x40, 0x50, 0xb0, 0xf9, 0xbb, 0xee, 0x3d, 0x99, 0x39, 0x7b, 0x29, 0xb7, 0xaa, 0x49, + 0x60, 0xf2, 0x39, 0xff, 0xc2, 0x22, 0xf5, 0x86, 0x1b, 0x7b, 0x2d, 0x04, 0x49, 0x6e, 0x78, 0xc9, + 0x66, 0xbf, 0xb5, 0x43, 0x13, 0x0e, 0x42, 0x84, 0xb5, 0xec, 0xc7, 0x34, 0x32, 0x4e, 0xda, 0xaa, + 0x96, 0x37, 0x45, 0x3a, 0x28, 0x0e, 0xfb, 0x35, 0x32, 0x89, 0x57, 0x59, 0x77, 0xc3, 0xa8, 0x0d, + 0x74, 0xab, 0x18, 0x98, 0xb2, 0x26, 0x6d, 0x45, 0x34, 0x01, 0xba, 0x25, 0x7c, 0x99, 0x74, 0xf9, + 0x60, 0x0a, 0x73, 0x3e, 0x6d, 0x91, 0xb3, 0x0d, 0xea, 0x46, 0x34, 0x62, 0xa8, 0x66, 0xea, 0x43, + 0xec, 0x57, 0x49, 0x2d, 0xc1, 0x14, 0xac, 0x91, 0x55, 0x6c, 0x8d, 0x98, 0x17, 0xd2, 0x86, 0x28, + 0x1c, 0x94, 0x18, 0xe7, 0xfb, 0x2d, 0x72, 0x3e, 0xaf, 0x2e, 0x0b, 0x7e, 0xd8, 0x6f, 0x3f, 0x8a, + 0x0a, 0xfd, 0xa8, 0x45, 0xa6, 0x98, 0xe7, 0xc1, 0x22, 0x4d, 0x5c, 0xcf, 0x1f, 0x40, 0x90, 0xb5, + 0x46, 0x44, 0x90, 0xbd, 0x44, 0x2a, 0xdb, 0x61, 0x97, 0x66, 0xbd, 0x66, 0xae, 0x85, 0x68, 0x74, + 0x41, 0x0a, 0x1a, 0x00, 0xbb, 0xae, 0x17, 0x24, 0x2e, 0x4e, 0x47, 0x79, 0x0d, 0x32, 0xc3, 0x07, + 0xa0, 0x4a, 0x06, 0x93, 0xc7, 0xf9, 0x93, 0x09, 0x32, 0x2e, 0x5c, 0xe8, 0x46, 0x06, 0xc5, 0x92, + 0xd6, 0x9f, 0xd2, 0x50, 0xeb, 0x4f, 0x4c, 0xc6, 0x5a, 0x0c, 0xf1, 0xbb, 0x5e, 0x2e, 0xc2, 0xd6, + 0x22, 0x2a, 0xc8, 0x41, 0xc4, 0x75, 0xb5, 0xf8, 0x6f, 0x10, 0xa2, 0xec, 0xcf, 0x59, 0x64, 0xa6, + 0x15, 0x06, 0x01, 0x6d, 0x69, 0x9d, 0xb3, 0x52, 0xc4, 0xc1, 0x62, 0x21, 0x5d, 0xa8, 0xbe, 0x4b, + 0xce, 0x10, 0x20, 0x2b, 0x1e, 0xfd, 0xf3, 0x79, 0x9b, 0xdd, 0x4a, 0xdd, 0xdd, 0x68, 0x90, 0x50, + 0x93, 0x08, 0x69, 0x5e, 0x34, 0x71, 0x07, 0x1a, 0x61, 0x73, 0x4c, 0x9b, 0xb8, 0x0d, 0x6c, 0x4d, + 0x83, 0x03, 0x11, 0x6b, 0x22, 0xba, 0x15, 0xd1, 0x78, 0x5b, 0xb8, 0x18, 0x32, 0x7d, 0x77, 0xfc, + 0xe1, 0x10, 0x6b, 0x60, 0xa0, 0x24, 0xc8, 0x29, 0xdd, 0xde, 0x11, 0xe6, 0x87, 0x5a, 0x11, 0xeb, + 0xb9, 0xe8, 0xe6, 0xa1, 0x56, 0x88, 0x59, 0x52, 0x65, 0x5b, 0x17, 0xd3, 0xb3, 0xcb, 0x3c, 0x7c, + 0x99, 0x6d, 0x6c, 0xc0, 0xd3, 0xed, 0x45, 0x72, 0x3a, 0x83, 0x5a, 0x1a, 0x8b, 0x3b, 0x16, 0x15, + 0x43, 0x9a, 0xc1, 0x3b, 0x8d, 0x61, 0x20, 0x87, 0x69, 0x9a, 0x9a, 0x3c, 0xc0, 0x34, 0xb5, 0xa7, + 0x1c, 0xd9, 0xf9, 0xed, 0xc7, 0xcb, 0x85, 0x34, 0xc0, 0x48, 0x5e, 0xeb, 0xdf, 0x97, 0xf1, 0x5a, + 0x3f, 0x75, 0xa9, 0x7c, 0x74, 0x37, 0x20, 0x59, 0x81, 0x87, 0x73, 0x51, 0xe7, 0xf3, 0xf0, 0x9a, + 0x1b, 0x6f, 0x33, 0x9d, 0xb9, 0x22, 0x2f, 0x64, 0x64, 0x2a, 0x18, 0x1c, 0x8f, 0xd2, 0x45, 0xfd, + 0x7f, 0x59, 0x44, 0x8e, 0x83, 0x05, 0xb7, 0xb5, 0x4d, 0x71, 0x88, 0xe5, 0x04, 0x33, 0x59, 0x87, + 0x0a, 0x66, 0xba, 0x4c, 0x26, 0xb0, 0x5d, 0x79, 0x56, 0xae, 0x27, 0x28, 0x4b, 0xcb, 0xfc, 0xfa, + 0xb2, 0xc8, 0xa5, 0x79, 0xec, 0x90, 0x9c, 0xf1, 0xdd, 0x38, 0x61, 0x35, 0x40, 0xa3, 0xc8, 0x43, + 0xe2, 0x4b, 0xb1, 0xc0, 0xc6, 0x95, 0x6c, 0x41, 0x30, 0x58, 0xb6, 0xf3, 0x6f, 0xab, 0xe4, 0x54, + 0x6a, 0x25, 0x3d, 0xa4, 0x82, 0xf1, 0x75, 0xa4, 0x26, 0xf7, 0xfc, 0x2c, 0xca, 0x9e, 0x52, 0x0c, + 0x14, 0x07, 0x6e, 0x72, 0x9b, 0x7a, 0x17, 0xce, 0x2a, 0x44, 0xc6, 0x06, 0x0d, 0x26, 0x1f, 0x5b, + 0xc4, 0x13, 0x3f, 0x5e, 0xf0, 0x3d, 0x1a, 0x24, 0xbc, 0x9a, 0xc5, 0x2c, 0xe2, 0x1b, 0x2b, 0x4d, + 0xb3, 0x50, 0xbd, 0x88, 0x67, 0x08, 0x90, 0x15, 0x6f, 0xff, 0x25, 0x8b, 0x9c, 0x72, 0xef, 0xc6, + 0xfa, 0x19, 0x8b, 0x7a, 0xb5, 0x88, 0x4d, 0x2d, 0xf5, 0x32, 0x06, 0xbf, 0x40, 0x48, 0x25, 0x41, + 0x5a, 0x28, 0xc6, 0x2c, 0xd9, 0xf4, 0x1e, 0x6d, 0x49, 0x8f, 0x7b, 0x51, 0x97, 0xb1, 0x22, 0x2c, + 0x05, 0x57, 0x06, 0xca, 0xe5, 0xbb, 0xc0, 0x60, 0x3a, 0xe4, 0xd4, 0xc1, 0x7e, 0x89, 0xd8, 0xc2, + 0xed, 0x0e, 0xaf, 0x45, 0x45, 0x30, 0xbe, 0xb8, 0xb7, 0xbf, 0x20, 0xda, 0xd9, 0x5e, 0x1c, 0xe0, + 0x80, 0x9c, 0x5c, 0x6c, 0x94, 0x45, 0xe1, 0xbd, 0xbd, 0x9b, 0x91, 0x5f, 0xaf, 0x65, 0x46, 0x99, + 0x48, 0x07, 0xc5, 0xe1, 0xfc, 0x51, 0x59, 0x4d, 0x65, 0x1d, 0x5e, 0xe2, 0x1a, 0x6e, 0xee, 0xd6, + 0xc3, 0xbb, 0xb9, 0x2b, 0xb9, 0x39, 0xae, 0xee, 0xa9, 0x88, 0xf4, 0xd2, 0x23, 0x8a, 0x48, 0xff, + 0x2e, 0x2b, 0x85, 0x64, 0x39, 0xf9, 0xc2, 0x2b, 0xc5, 0x86, 0xb6, 0xcc, 0x71, 0xbf, 0xb1, 0xcc, + 0x3e, 0x94, 0x71, 0x17, 0xfc, 0x3a, 0x52, 0xdb, 0xf2, 0x5d, 0x86, 0x7d, 0x54, 0xaf, 0xa4, 0x7d, + 0xda, 0xae, 0x8a, 0x74, 0x50, 0x1c, 0xb8, 0xea, 0x1b, 0x85, 0x1e, 0x6a, 0xd5, 0xfe, 0x8f, 0x65, + 0x32, 0x69, 0x68, 0x08, 0xb9, 0xea, 0x9e, 0xf5, 0x98, 0xa9, 0x7b, 0xa5, 0x43, 0xa8, 0x7b, 0xdf, + 0x49, 0x26, 0x5a, 0x72, 0x37, 0x2a, 0xe6, 0x25, 0x92, 0xec, 0x1e, 0xa7, 0x37, 0x24, 0x95, 0x04, + 0x5a, 0x26, 0x3a, 0xdf, 0x18, 0xc5, 0xa4, 0xec, 0x08, 0x79, 0x61, 0xc9, 0x62, 0x47, 0x1b, 0xcc, + 0x93, 0xf5, 0x43, 0xa8, 0x1e, 0xec, 0x87, 0x80, 0x40, 0xc9, 0xb2, 0x73, 0x4f, 0x00, 0x45, 0xeb, + 0x4e, 0x1a, 0x45, 0xeb, 0x4a, 0x21, 0xcd, 0x3c, 0x04, 0x3e, 0xeb, 0xd3, 0x16, 0xb9, 0xb8, 0x3f, + 0x18, 0x3f, 0xba, 0xab, 0x77, 0xa2, 0xb0, 0xdf, 0x13, 0x7b, 0xb0, 0x2a, 0x87, 0xbd, 0x7c, 0x00, + 0x9c, 0x86, 0x87, 0xae, 0x1d, 0x2f, 0x68, 0x67, 0x0f, 0x5d, 0xf8, 0x30, 0x02, 0x30, 0xca, 0x08, + 0xf0, 0xc8, 0x37, 0xc8, 0x38, 0xfa, 0x55, 0xb8, 0x41, 0xdb, 0x7e, 0x0b, 0x19, 0x6f, 0xf1, 0x7f, + 0x85, 0xd9, 0x90, 0x5d, 0xd0, 0x0b, 0x2a, 0x48, 0x1a, 0x3a, 0xfe, 0xb9, 0x51, 0x47, 0x9a, 0x0a, + 0x99, 0xe3, 0xdf, 0x7c, 0xd4, 0x89, 0x81, 0xa5, 0x3a, 0x7f, 0x62, 0x91, 0x69, 0xcc, 0xe2, 0x25, + 0xab, 0xb2, 0x69, 0xdf, 0x4a, 0xc6, 0xdc, 0x7e, 0xb2, 0x1d, 0x0e, 0x9c, 0x21, 0xe7, 0x59, 0x2a, + 0x08, 0x2a, 0x56, 0x56, 0x61, 0xb4, 0x18, 0x95, 0x5d, 0xc4, 0x79, 0xc5, 0x28, 0xa8, 0x86, 0xc7, + 0xfd, 0xcd, 0xbc, 0x1b, 0xe2, 0x26, 0x4f, 0x06, 0x49, 0xc7, 0xc2, 0x36, 0xc3, 0xf6, 0x5e, 0xbd, + 0x92, 0x2e, 0xac, 0x11, 0xb6, 0xf7, 0x80, 0x51, 0xd0, 0xd9, 0x3f, 0xde, 0x76, 0xa5, 0x2f, 0x82, + 0x60, 0x28, 0x37, 0xaf, 0xcd, 0x03, 0xa6, 0xab, 0xd8, 0x95, 0xc8, 0xaf, 0x8f, 0xed, 0x17, 0xbb, + 0x12, 0xf9, 0xce, 0x3f, 0xac, 0x10, 0xe6, 0x63, 0xe4, 0x46, 0xb4, 0xbd, 0x11, 0x32, 0x40, 0xf3, + 0x63, 0xbd, 0xca, 0xd7, 0x87, 0xf0, 0xc7, 0xf9, 0x3a, 0xdf, 0xb8, 0xd2, 0x2d, 0x9f, 0xf4, 0x95, + 0x6e, 0xfe, 0x2d, 0x7d, 0xe5, 0x31, 0xba, 0xa5, 0x77, 0x3e, 0x6b, 0x11, 0x5b, 0x79, 0x8c, 0x69, + 0x37, 0x9a, 0xcb, 0x64, 0x42, 0xb9, 0xa8, 0x89, 0xf9, 0xa2, 0x97, 0x68, 0x49, 0x00, 0xcd, 0x33, + 0x82, 0xe5, 0xe5, 0x39, 0xb9, 0x7f, 0x96, 0xd3, 0x6b, 0x09, 0xdb, 0x75, 0xc5, 0x76, 0xea, 0xfc, + 0x4a, 0x89, 0x3c, 0xc9, 0x55, 0xb7, 0x55, 0x37, 0x70, 0x3b, 0xb4, 0x8b, 0xb5, 0x1a, 0xd5, 0x31, + 0xaa, 0x85, 0x47, 0x7e, 0x4f, 0xc6, 0x9d, 0x1c, 0x75, 0xed, 0xe4, 0xeb, 0x0c, 0x5f, 0x59, 0x96, + 0x03, 0x2f, 0x01, 0x56, 0xb8, 0x1d, 0x93, 0x9a, 0x7c, 0x4d, 0xae, 0x5e, 0x2e, 0x52, 0x90, 0xda, + 0x16, 0x84, 0x96, 0x43, 0x41, 0x09, 0x42, 0x55, 0xc6, 0x0f, 0x5b, 0x3b, 0x38, 0xe5, 0xb3, 0xaa, + 0xcc, 0x8a, 0x48, 0x07, 0xc5, 0xe1, 0x74, 0xc9, 0x8c, 0x6c, 0xc3, 0x1e, 0x22, 0x91, 0xd3, 0x2d, + 0xdc, 0xff, 0x5b, 0x32, 0xc9, 0x78, 0xe0, 0x4e, 0xed, 0xff, 0x0b, 0x26, 0x11, 0xd2, 0xbc, 0x12, + 0xe3, 0xbc, 0x94, 0x8f, 0x71, 0xee, 0xfc, 0x8a, 0x45, 0xb2, 0x0a, 0x08, 0x33, 0xd8, 0x99, 0xaf, + 0xd5, 0x0d, 0x7b, 0xfc, 0xe0, 0x10, 0xb0, 0xc7, 0x1f, 0x20, 0x93, 0x6e, 0x82, 0x1a, 0x26, 0xb7, + 0x1e, 0x95, 0x1f, 0xee, 0xb6, 0x74, 0x35, 0x6c, 0x7b, 0x5b, 0x1e, 0x96, 0x00, 0x66, 0x71, 0xce, + 0x5f, 0xad, 0x92, 0x89, 0xc5, 0x68, 0xef, 0xf0, 0x11, 0x83, 0x83, 0xf1, 0x80, 0xa5, 0x43, 0xc5, + 0x03, 0xca, 0x88, 0xc3, 0xf2, 0xd0, 0x88, 0x43, 0x19, 0x31, 0x58, 0x79, 0x54, 0x11, 0x83, 0xd5, + 0xc7, 0x24, 0x62, 0x70, 0xec, 0x31, 0x88, 0x18, 0x1c, 0x3f, 0xe1, 0x88, 0x41, 0xe7, 0x7f, 0x54, + 0xc8, 0x99, 0x81, 0x00, 0x73, 0xfb, 0x45, 0x32, 0xa5, 0xe6, 0xa8, 0xbc, 0x30, 0x98, 0x30, 0xdd, + 0xf5, 0x35, 0x0d, 0x52, 0x9c, 0x23, 0x2c, 0xd4, 0xcb, 0xe4, 0x89, 0x08, 0x0d, 0xa9, 0x7d, 0x3a, + 0xbf, 0x95, 0xd0, 0xa8, 0x49, 0xd1, 0x3d, 0x83, 0x5f, 0xb5, 0x96, 0x1b, 0x4f, 0xe1, 0x9d, 0x35, + 0x0c, 0x92, 0x21, 0x2f, 0x8f, 0xdd, 0x23, 0xa7, 0x7c, 0xf3, 0xe4, 0x5a, 0xaf, 0x3c, 0xfc, 0xa1, + 0x57, 0xad, 0x55, 0xa9, 0x64, 0x48, 0x0b, 0x48, 0x1f, 0x7f, 0xab, 0x8f, 0xe8, 0xf8, 0xfb, 0xdd, + 0xfa, 0xf8, 0xcb, 0xbd, 0xdf, 0xde, 0x5f, 0x30, 0xc0, 0xc0, 0x28, 0xe7, 0xdf, 0xa3, 0x9c, 0x68, + 0x5f, 0x26, 0x35, 0xe9, 0x19, 0x3c, 0x92, 0x47, 0xad, 0x59, 0xce, 0x90, 0x9d, 0xfd, 0x47, 0x2a, + 0x24, 0xc7, 0x68, 0x83, 0x2b, 0xad, 0xd6, 0xf6, 0x53, 0x2b, 0xed, 0xe1, 0x34, 0x7e, 0xfb, 0x1e, + 0xf7, 0x8a, 0xe6, 0x3a, 0xde, 0xfb, 0x8a, 0x36, 0x3a, 0x69, 0x47, 0x69, 0xb5, 0xff, 0x29, 0x67, + 0xe9, 0x17, 0x08, 0xd1, 0x07, 0x46, 0xa1, 0xe9, 0x2b, 0x37, 0x27, 0x7d, 0xae, 0x04, 0x83, 0x8b, + 0xb9, 0x31, 0x04, 0x71, 0xe2, 0xfa, 0xfe, 0x35, 0x2f, 0x48, 0x84, 0xf6, 0xaf, 0xdd, 0x18, 0x34, + 0x09, 0x4c, 0x3e, 0x34, 0x67, 0xf5, 0x78, 0xbd, 0x0c, 0x7b, 0x43, 0x7d, 0x2c, 0x6d, 0xce, 0x5a, + 0x1f, 0xe0, 0x80, 0x9c, 0x5c, 0xf6, 0xcb, 0xea, 0x26, 0x6c, 0xfc, 0x61, 0xc2, 0xf7, 0xc8, 0xe0, + 0x3d, 0xd7, 0x85, 0xf7, 0x18, 0xc3, 0xe6, 0x30, 0xc3, 0x6d, 0x9b, 0x9c, 0x5f, 0xf2, 0x12, 0xb5, + 0xf2, 0xaa, 0x61, 0xce, 0xce, 0xa0, 0x72, 0x83, 0xb4, 0x86, 0x6e, 0x90, 0x46, 0xbc, 0x6f, 0x29, + 0x1d, 0x9e, 0x9c, 0x8d, 0xf7, 0x75, 0x5a, 0xe4, 0xec, 0x92, 0x97, 0x60, 0xcc, 0xe3, 0x31, 0x0a, + 0xf9, 0xe5, 0x31, 0x32, 0x65, 0xe2, 0xa2, 0x1c, 0x46, 0x9d, 0x40, 0x20, 0x2f, 0xb9, 0xef, 0x78, + 0xca, 0x43, 0xe4, 0xf6, 0x91, 0x41, 0x5a, 0xf2, 0x1b, 0xd7, 0x38, 0x3f, 0x69, 0x99, 0x60, 0x56, + 0xc0, 0xbe, 0x4b, 0xaa, 0x5b, 0x2c, 0xc4, 0xb4, 0x5c, 0x84, 0x4f, 0x60, 0x5e, 0xe3, 0xeb, 0x05, + 0x83, 0x07, 0xa9, 0x72, 0x79, 0xa8, 0xf3, 0x46, 0x69, 0x88, 0x05, 0x23, 0xdc, 0x87, 0xa7, 0x83, + 0xe2, 0x18, 0xb6, 0x69, 0x55, 0x1f, 0x62, 0xd3, 0x4a, 0x6d, 0x21, 0x63, 0x8f, 0x68, 0x0b, 0x61, + 0xe1, 0xc2, 0xc9, 0x36, 0x3b, 0x91, 0x89, 0xf8, 0xc4, 0x71, 0xd6, 0x08, 0x46, 0xb8, 0x70, 0x8a, + 0x0c, 0x59, 0x7e, 0xfb, 0x63, 0x6a, 0x13, 0xaa, 0x15, 0x71, 0x03, 0x67, 0x8e, 0xe8, 0xe3, 0xde, + 0x7f, 0x3e, 0x5b, 0x22, 0xd3, 0x4b, 0x41, 0x7f, 0x7d, 0x69, 0xbd, 0xbf, 0xe9, 0x7b, 0xad, 0xeb, + 0x74, 0x0f, 0x37, 0x99, 0x1d, 0xba, 0xb7, 0xbc, 0x98, 0x35, 0x45, 0x5d, 0xc7, 0x44, 0xe0, 0x34, + 0x5c, 0x56, 0xb7, 0xbc, 0xa0, 0x43, 0xa3, 0x5e, 0xe4, 0x89, 0xcb, 0x2e, 0x63, 0x59, 0xbd, 0xaa, + 0x49, 0x60, 0xf2, 0x61, 0xd9, 0xe1, 0xdd, 0x40, 0x81, 0xd4, 0xa9, 0xb2, 0xd7, 0x30, 0x11, 0x38, + 0x0d, 0x99, 0x92, 0xa8, 0x2f, 0x6c, 0xc9, 0x06, 0xd3, 0x06, 0x26, 0x02, 0xa7, 0x09, 0xd3, 0x10, + 0x73, 0xb9, 0xac, 0x0e, 0x98, 0x86, 0x30, 0x19, 0x24, 0x1d, 0x59, 0x77, 0xe8, 0xde, 0x22, 0xda, + 0x11, 0x33, 0x96, 0x9d, 0xeb, 0x3c, 0x19, 0x24, 0x9d, 0x01, 0xfa, 0xa7, 0x9b, 0xe3, 0xab, 0x0e, + 0xd0, 0x3f, 0x5d, 0xfd, 0x21, 0x16, 0xc9, 0x1f, 0x2f, 0x91, 0xa9, 0x37, 0x1e, 0x3d, 0xdf, 0xff, + 0x79, 0xbb, 0xdb, 0xe4, 0xcc, 0x00, 0x5e, 0xc1, 0x08, 0x3a, 0xda, 0x81, 0xc0, 0x36, 0x0e, 0x90, + 0x49, 0x2c, 0x58, 0x82, 0xcd, 0x2e, 0x90, 0x33, 0x7c, 0x1e, 0xa3, 0x24, 0x16, 0x7e, 0xae, 0x30, + 0x28, 0xd8, 0xc5, 0xee, 0xad, 0x2c, 0x11, 0x06, 0xf9, 0xf1, 0xf1, 0xb4, 0x53, 0x29, 0x08, 0x89, + 0x82, 0xb4, 0x49, 0x36, 0xd1, 0x43, 0x16, 0x39, 0xc0, 0x22, 0xb9, 0x32, 0x6e, 0xa0, 0x57, 0x35, + 0x09, 0x4c, 0x3e, 0xe7, 0x37, 0xca, 0xa4, 0x26, 0xbd, 0x15, 0x47, 0xa8, 0xca, 0x67, 0x2c, 0x72, + 0x4a, 0x5d, 0xa6, 0x33, 0x55, 0xab, 0x54, 0x44, 0x1c, 0x2b, 0xd6, 0x40, 0xd9, 0xef, 0xf0, 0xf6, + 0x43, 0x1d, 0x6d, 0xc0, 0x14, 0x06, 0x69, 0xd9, 0xf6, 0x2d, 0x8c, 0x36, 0x8a, 0x13, 0xda, 0x35, + 0xee, 0x61, 0x1c, 0x63, 0x94, 0xcd, 0xb5, 0xc2, 0x88, 0xe2, 0x98, 0x42, 0x1f, 0xcf, 0xa6, 0xe2, + 0xd4, 0xba, 0xa8, 0x4e, 0x03, 0xa3, 0x24, 0x7c, 0xf3, 0xcc, 0x37, 0x03, 0xcc, 0xa1, 0x18, 0x6f, + 0xd0, 0x51, 0x7c, 0x45, 0x8e, 0xe0, 0x6b, 0xe1, 0xfc, 0x6c, 0x89, 0x9c, 0xce, 0xb6, 0xa4, 0xfd, + 0x7e, 0x0c, 0x1f, 0xd0, 0xaf, 0xfa, 0x66, 0x5c, 0x44, 0xa7, 0xc0, 0xa0, 0xbd, 0x7e, 0x7f, 0x76, + 0x56, 0xbb, 0x8a, 0x5e, 0xc6, 0xc6, 0xbb, 0xbc, 0x6b, 0x78, 0xd3, 0xe2, 0x30, 0x48, 0x15, 0xc6, + 0x1d, 0x31, 0x84, 0x87, 0x51, 0x63, 0x6f, 0xbe, 0xd7, 0x13, 0xde, 0x14, 0x86, 0x23, 0x86, 0x49, + 0x85, 0x0c, 0x37, 0x86, 0xe3, 0x1a, 0x29, 0x37, 0xa8, 0xd7, 0xd9, 0xde, 0x0c, 0x23, 0x79, 0xb2, + 0x7e, 0x46, 0x3b, 0xb2, 0x0f, 0xf2, 0x40, 0x6e, 0x4e, 0xd4, 0x91, 0x5a, 0x6e, 0xcf, 0x6d, 0xe1, + 0x53, 0xbb, 0xfc, 0x3e, 0x4c, 0xad, 0xe8, 0x0b, 0x22, 0x1d, 0x14, 0x87, 0xf3, 0x13, 0x15, 0x72, + 0x9a, 0x7b, 0x6e, 0x53, 0x15, 0x98, 0x60, 0xbf, 0x9f, 0x4c, 0xc4, 0x89, 0x1b, 0x71, 0xa3, 0x9a, + 0x75, 0xe8, 0xa5, 0x4b, 0xe3, 0x5e, 0xc8, 0x42, 0x40, 0x97, 0x87, 0x01, 0x0e, 0x5b, 0x5e, 0xe0, + 0xc5, 0xdb, 0xac, 0xf4, 0xd2, 0xc3, 0x99, 0xec, 0xae, 0xaa, 0x12, 0xc0, 0x28, 0xcd, 0xfe, 0x16, + 0x52, 0xed, 0x6d, 0xbb, 0xb1, 0xb4, 0x27, 0xbf, 0x55, 0xae, 0x13, 0xeb, 0x98, 0x88, 0x2e, 0xfa, + 0xd9, 0x4f, 0x65, 0x04, 0xe0, 0x99, 0xcc, 0x55, 0xbe, 0x72, 0xc0, 0x2a, 0xff, 0x56, 0x32, 0xd6, + 0x8e, 0xf6, 0x9a, 0xd7, 0xe6, 0xb3, 0x4f, 0x96, 0x2d, 0xb2, 0x54, 0x10, 0x54, 0x5c, 0x93, 0xb6, + 0xb9, 0xc8, 0x36, 0x32, 0x8f, 0xa5, 0x95, 0x8f, 0x6b, 0x9a, 0x04, 0x26, 0x1f, 0x83, 0x50, 0xcb, + 0xf8, 0xf5, 0x8f, 0x1f, 0x43, 0xdc, 0xd7, 0xa8, 0x1e, 0xfd, 0x57, 0xc8, 0x04, 0xff, 0x9f, 0x6e, + 0x84, 0x68, 0x66, 0xe2, 0xe6, 0xca, 0x46, 0xe4, 0x06, 0xad, 0xed, 0xac, 0x99, 0x69, 0xc3, 0xa0, + 0x41, 0x8a, 0xd3, 0x59, 0x25, 0x95, 0x11, 0x17, 0xd9, 0x91, 0xac, 0x07, 0x2f, 0x93, 0x1a, 0x16, + 0x27, 0xcf, 0x6a, 0x45, 0x14, 0xf9, 0x77, 0x2b, 0xe4, 0x74, 0xf6, 0xf1, 0x78, 0x75, 0x97, 0x69, + 0x0d, 0xbd, 0xcb, 0x44, 0xa4, 0x9c, 0xd6, 0x36, 0x6d, 0xf7, 0x7d, 0x9a, 0xf5, 0x35, 0x6a, 0x8a, + 0x74, 0x50, 0x1c, 0x29, 0x77, 0xee, 0xf2, 0x81, 0xee, 0xdc, 0xef, 0x26, 0x53, 0xe6, 0x9d, 0x75, + 0xbd, 0xa2, 0xc3, 0x26, 0xcc, 0xeb, 0x6d, 0x48, 0x71, 0x65, 0xbc, 0x31, 0xab, 0x07, 0x7a, 0x63, + 0x3e, 0x6f, 0x00, 0x8f, 0x72, 0xdf, 0xcd, 0x61, 0x40, 0xa1, 0x2f, 0x10, 0xd2, 0x75, 0x83, 0xbe, + 0xeb, 0x33, 0xf4, 0xe3, 0xf1, 0xf4, 0xeb, 0x0c, 0xab, 0x8a, 0x02, 0x06, 0x17, 0x7e, 0x71, 0xe2, + 0x75, 0xe9, 0x2b, 0x61, 0x40, 0xb3, 0x5e, 0x32, 0x1b, 0x22, 0x1d, 0x14, 0x87, 0xfd, 0x22, 0xba, + 0x0a, 0xb6, 0xe5, 0x53, 0xa8, 0x02, 0x7a, 0x48, 0x0d, 0xd5, 0x9b, 0x31, 0x9d, 0xd7, 0x54, 0x30, + 0x59, 0xb3, 0xae, 0xca, 0x64, 0x44, 0x57, 0x65, 0x0c, 0x46, 0xd8, 0x0b, 0x5a, 0x6b, 0xbb, 0x34, + 0x8a, 0xfa, 0x1c, 0x00, 0xce, 0x50, 0x1c, 0x9a, 0x9a, 0x04, 0x26, 0x9f, 0x13, 0x92, 0x9a, 0x7c, + 0x18, 0xdb, 0x76, 0x48, 0xd9, 0x73, 0xa5, 0x13, 0x9e, 0xfa, 0xb8, 0xe5, 0x38, 0xee, 0xb3, 0x35, + 0x0a, 0x89, 0xf6, 0x73, 0xa4, 0x4c, 0xef, 0xf5, 0xb2, 0xde, 0x76, 0x57, 0xee, 0xf5, 0xbc, 0x88, + 0xc6, 0xc8, 0x44, 0xef, 0xf5, 0xec, 0x0b, 0xa4, 0xe4, 0xb5, 0xc5, 0xb0, 0x20, 0x82, 0xa7, 0xb4, + 0xbc, 0x08, 0x25, 0xaf, 0xed, 0xdc, 0x23, 0x13, 0x52, 0x20, 0x0b, 0xd7, 0xe0, 0xaa, 0xb8, 0x55, + 0x44, 0xb8, 0x86, 0x2c, 0x77, 0x88, 0x12, 0xde, 0x27, 0x44, 0x63, 0xee, 0x14, 0xa5, 0xaf, 0x5d, + 0x22, 0x95, 0x56, 0x28, 0xf0, 0xd8, 0x6a, 0xba, 0x18, 0xa6, 0x78, 0x33, 0x8a, 0x73, 0x9b, 0x4c, + 0x5f, 0x0f, 0xc2, 0xbb, 0xec, 0x4d, 0x4c, 0xf6, 0x68, 0x02, 0x16, 0xbc, 0x85, 0xff, 0x64, 0x4f, + 0x7c, 0x8c, 0x0a, 0x9c, 0xa6, 0xa0, 0xd1, 0x4b, 0xc3, 0xa0, 0xd1, 0x9d, 0x8f, 0x5b, 0x64, 0x4a, + 0x5d, 0x2e, 0x2c, 0xed, 0xee, 0x8c, 0xe6, 0xd4, 0x60, 0xa0, 0xda, 0x94, 0x0e, 0x40, 0xb5, 0x91, + 0x6b, 0x46, 0x79, 0xd8, 0x9a, 0xe1, 0xfc, 0x99, 0x45, 0x4e, 0xab, 0x2a, 0x48, 0x05, 0xfb, 0x45, + 0x32, 0xb5, 0xd9, 0xf7, 0xfc, 0xb6, 0xf8, 0x9d, 0x5d, 0x5b, 0x1b, 0x06, 0x0d, 0x52, 0x9c, 0x38, + 0x2d, 0x37, 0xbd, 0xc0, 0x8d, 0xf6, 0xd6, 0xb5, 0x46, 0xaf, 0xa6, 0x65, 0x43, 0x51, 0xc0, 0xe0, + 0x42, 0x30, 0x96, 0x5d, 0xe9, 0xf6, 0x52, 0x2e, 0x14, 0x8c, 0x45, 0xb4, 0x87, 0x9e, 0x09, 0xca, + 0x8f, 0x46, 0x49, 0x74, 0x7e, 0xa0, 0x4c, 0xa6, 0xd3, 0x00, 0x2a, 0x23, 0x58, 0xdc, 0x9e, 0x23, + 0x55, 0x86, 0xa9, 0x92, 0x1d, 0x58, 0x2c, 0x3f, 0x70, 0x1a, 0xfa, 0xf3, 0xf3, 0x7d, 0xa7, 0x98, + 0x67, 0xdb, 0x55, 0x25, 0xd5, 0xb5, 0x03, 0xb3, 0x73, 0x8a, 0x3b, 0x3c, 0x21, 0x0a, 0xfd, 0x2e, + 0xc7, 0xc3, 0x9e, 0x89, 0xc9, 0xfd, 0xbe, 0x22, 0xc1, 0x65, 0x04, 0x82, 0x83, 0x50, 0x9d, 0xd5, + 0xc0, 0x93, 0x83, 0x41, 0x8a, 0xbe, 0xf0, 0x4d, 0x64, 0xca, 0xe4, 0x3c, 0x48, 0x7b, 0xae, 0x99, + 0xda, 0xf3, 0x67, 0xcc, 0x21, 0x29, 0xe0, 0x73, 0x46, 0x98, 0xec, 0x37, 0x49, 0xb5, 0xa5, 0xfc, + 0x88, 0x1f, 0xea, 0x05, 0x23, 0x85, 0x78, 0x89, 0xc5, 0x00, 0x2f, 0x0d, 0x9d, 0xac, 0xa6, 0x8d, + 0xda, 0xc4, 0xcb, 0x6d, 0x3b, 0x22, 0xe5, 0xce, 0xee, 0x8e, 0xd0, 0x48, 0x5f, 0x2a, 0xa8, 0x79, + 0x97, 0x76, 0x77, 0xf4, 0x0c, 0x33, 0x53, 0x01, 0x85, 0x8d, 0x70, 0x37, 0x96, 0x42, 0x59, 0x2a, + 0x1f, 0x8c, 0xb2, 0xe4, 0x7c, 0xa1, 0x44, 0xce, 0x0c, 0x0c, 0x2a, 0xfb, 0x35, 0x52, 0x8d, 0xf0, + 0x2b, 0xeb, 0x56, 0x11, 0x9a, 0x5e, 0xba, 0xe5, 0xf4, 0xf6, 0x99, 0x4e, 0x07, 0x2e, 0x12, 0xef, + 0x10, 0xb4, 0x77, 0xbc, 0xba, 0x98, 0xe3, 0x9f, 0xac, 0xee, 0x10, 0xe6, 0x07, 0x38, 0x20, 0x27, + 0x17, 0xba, 0x15, 0xa4, 0xef, 0xf7, 0x32, 0xaf, 0x3c, 0xec, 0x77, 0x55, 0xe7, 0x7c, 0xce, 0x1c, + 0x82, 0xb7, 0xf4, 0x62, 0x7a, 0x54, 0x4b, 0xc6, 0xc0, 0xca, 0x5a, 0x1e, 0x75, 0x65, 0x75, 0x7e, + 0xb1, 0x44, 0x4e, 0xa5, 0x50, 0xdb, 0x6d, 0x9f, 0xd4, 0xa8, 0xcf, 0xdc, 0x50, 0xe4, 0xee, 0x7b, + 0xd4, 0xb7, 0xed, 0xd4, 0x3a, 0x79, 0x45, 0x94, 0x0b, 0x4a, 0xc2, 0xe3, 0xe1, 0xbc, 0xfb, 0x22, + 0x99, 0x92, 0x15, 0x7a, 0x9f, 0xdb, 0xf5, 0xb3, 0xcd, 0x77, 0xc5, 0xa0, 0x41, 0x8a, 0xd3, 0xf9, + 0xd5, 0x32, 0xa9, 0x73, 0xbf, 0x9d, 0xb6, 0x9a, 0x0c, 0xca, 0xff, 0xee, 0x7b, 0xf5, 0xdb, 0x0a, + 0xbc, 0x21, 0x37, 0x8f, 0xfa, 0x62, 0x6d, 0xbe, 0xa0, 0x91, 0x62, 0x54, 0x7e, 0x2c, 0x13, 0xa3, + 0xc2, 0xed, 0x3a, 0x9d, 0x63, 0xaa, 0xd1, 0xe1, 0x83, 0x56, 0x1e, 0x65, 0x10, 0xca, 0xdf, 0x2e, + 0x91, 0x99, 0xcc, 0x73, 0xc0, 0x08, 0xbd, 0x6a, 0xbe, 0xb9, 0x66, 0x15, 0x71, 0xab, 0xbd, 0xef, + 0xd3, 0xad, 0x87, 0x7b, 0x79, 0xed, 0x11, 0x4d, 0x15, 0xe7, 0x77, 0x4a, 0x64, 0x3a, 0xfd, 0x8e, + 0xf1, 0x63, 0xd8, 0x52, 0x6f, 0x27, 0x13, 0xec, 0x0d, 0xcd, 0xeb, 0x74, 0x4f, 0x5e, 0x9e, 0xf3, + 0x77, 0x04, 0x65, 0x22, 0x68, 0xfa, 0x63, 0xf1, 0xa0, 0x9d, 0xf3, 0xf7, 0x2c, 0x72, 0x8e, 0x7f, + 0x65, 0x76, 0x1c, 0xfe, 0x60, 0x5e, 0xeb, 0x7e, 0xb0, 0xd8, 0x0a, 0x66, 0xde, 0x04, 0x39, 0xa8, + 0x7d, 0x51, 0x79, 0x39, 0x2b, 0x6a, 0x9b, 0x1e, 0x0a, 0x8f, 0x61, 0x65, 0x0f, 0x35, 0x18, 0x9c, + 0x7f, 0x57, 0x22, 0x93, 0x6b, 0x0b, 0xcb, 0x6a, 0x09, 0x47, 0xaf, 0xd0, 0x88, 0xba, 0xda, 0x56, + 0x68, 0x7a, 0x85, 0x4a, 0x02, 0x68, 0x1e, 0x3c, 0x45, 0x71, 0xaf, 0xea, 0x38, 0x7b, 0x8a, 0xe2, + 0x4e, 0xd7, 0x31, 0x48, 0x3a, 0xda, 0x0d, 0x18, 0xc4, 0x03, 0x7a, 0x3a, 0x67, 0x2c, 0x25, 0x0c, + 0x02, 0x02, 0x6f, 0xc9, 0x15, 0x07, 0x16, 0xdc, 0x0e, 0x5b, 0x31, 0x32, 0x67, 0xcc, 0x77, 0x8b, + 0x98, 0x8c, 0x37, 0xea, 0x82, 0x8e, 0x95, 0xe6, 0x26, 0x2e, 0x64, 0xae, 0xa6, 0x2b, 0xcd, 0x6d, + 0x61, 0xc8, 0xae, 0x79, 0x0e, 0x03, 0xea, 0x9c, 0x31, 0x42, 0x8c, 0x8f, 0x66, 0x84, 0x40, 0x7f, + 0x87, 0xb5, 0x96, 0x77, 0x42, 0xfe, 0x0e, 0x6b, 0x2d, 0xef, 0x04, 0xfc, 0x1d, 0xcc, 0x57, 0x31, + 0x1e, 0xb9, 0xbf, 0xc3, 0xd0, 0xc6, 0x3d, 0x71, 0x7f, 0x87, 0xbc, 0xc6, 0x7f, 0xc3, 0xdf, 0xe1, + 0xab, 0xc2, 0xdf, 0xc1, 0x1c, 0xd1, 0xc7, 0xed, 0xef, 0xf0, 0x3b, 0x65, 0x32, 0xa1, 0xaf, 0x64, + 0x3c, 0x81, 0x74, 0x56, 0xc8, 0x23, 0x54, 0xcc, 0xa4, 0x29, 0x8b, 0xe6, 0x5e, 0x73, 0x06, 0xd0, + 0xd9, 0xf7, 0x58, 0xe8, 0x88, 0xe6, 0x25, 0x9e, 0xcb, 0x6e, 0x96, 0xea, 0xa5, 0x22, 0x62, 0x36, + 0x95, 0xb8, 0x65, 0x5e, 0x72, 0x18, 0x99, 0xae, 0x6d, 0x4a, 0x18, 0x98, 0x92, 0xed, 0x8f, 0x88, + 0x78, 0xfd, 0x72, 0x61, 0x70, 0x81, 0xb5, 0x4c, 0x90, 0x7e, 0x0f, 0x0f, 0xdd, 0x49, 0x54, 0x10, + 0xca, 0x26, 0x60, 0x51, 0xea, 0x31, 0x44, 0x35, 0xa5, 0x59, 0x32, 0x70, 0x41, 0x4e, 0x4c, 0xec, + 0xc1, 0xb6, 0x38, 0x64, 0x6c, 0x33, 0x46, 0x6f, 0xf7, 0x93, 0xb0, 0x8b, 0xcd, 0x24, 0x56, 0x62, + 0x1d, 0xbd, 0x2d, 0x09, 0xa0, 0x79, 0x9c, 0x1f, 0xad, 0x92, 0x0c, 0xee, 0x98, 0x7d, 0x8f, 0x4c, + 0x28, 0xe4, 0xb1, 0x62, 0xb0, 0x45, 0xf4, 0x88, 0x52, 0x95, 0x51, 0x49, 0xa0, 0x85, 0xd9, 0x91, + 0xbc, 0xa4, 0xe3, 0xdb, 0xff, 0x07, 0xb2, 0x97, 0x74, 0xd7, 0x0f, 0xed, 0xbe, 0x81, 0xc3, 0xf6, + 0x32, 0x07, 0x9d, 0x9e, 0x3b, 0xf0, 0x6a, 0xaf, 0x7c, 0xc0, 0xd5, 0xde, 0x27, 0xc4, 0xcb, 0xc9, + 0x40, 0xe3, 0xbe, 0x9f, 0x88, 0x81, 0xf1, 0x72, 0x81, 0x13, 0x8e, 0x17, 0xac, 0xa1, 0x3c, 0xf9, + 0x6f, 0x30, 0x84, 0xa6, 0x2f, 0x60, 0xc7, 0x8e, 0xf5, 0x02, 0x76, 0xbc, 0xd0, 0x0b, 0xd8, 0x17, + 0x08, 0x61, 0xc3, 0x9c, 0x87, 0x63, 0xd6, 0xd8, 0xce, 0xa3, 0xd4, 0x4f, 0x50, 0x14, 0x30, 0xb8, + 0x9c, 0xaf, 0x27, 0x69, 0x2c, 0x5a, 0x44, 0xce, 0xe0, 0xd0, 0xb7, 0xdc, 0xb5, 0x84, 0x21, 0x67, + 0xa4, 0x50, 0x6a, 0x7f, 0xc1, 0x22, 0x26, 0x60, 0xae, 0xfd, 0x2a, 0x47, 0xe6, 0xb5, 0x0a, 0xd9, + 0x9d, 0x75, 0xb9, 0x73, 0xab, 0x6e, 0x2f, 0xe3, 0xe0, 0x2b, 0xe1, 0x79, 0xd1, 0xad, 0x55, 0x52, + 0x0f, 0xb5, 0xaa, 0x7f, 0x8c, 0x3c, 0x21, 0x51, 0xb8, 0xa4, 0x57, 0x81, 0xf0, 0x64, 0x3b, 0x99, + 0xa0, 0xca, 0x7f, 0x6e, 0x91, 0x4b, 0xd9, 0x0a, 0xc4, 0xab, 0x61, 0xe0, 0x25, 0x61, 0xd4, 0xa4, + 0x49, 0xe2, 0x05, 0x1d, 0xf6, 0x80, 0xc2, 0x5d, 0x37, 0x92, 0xef, 0xa6, 0xb2, 0x35, 0xf3, 0xb6, + 0x1b, 0x05, 0xc0, 0x52, 0x31, 0xf0, 0x81, 0xc7, 0x8c, 0x09, 0xc5, 0xec, 0x88, 0x73, 0x23, 0xa7, + 0x39, 0xf4, 0x76, 0xca, 0xe3, 0xd5, 0x40, 0x08, 0x74, 0xbe, 0x6c, 0x11, 0x9b, 0x5d, 0xbf, 0x79, + 0x6d, 0x23, 0xca, 0x0d, 0xef, 0x48, 0xef, 0x34, 0xd7, 0x6e, 0xac, 0x87, 0x5e, 0xc0, 0x6e, 0x30, + 0x0d, 0x68, 0xb9, 0x97, 0x8c, 0x74, 0x48, 0x71, 0xa1, 0x37, 0xd3, 0x9d, 0x57, 0x51, 0x83, 0x30, + 0x9e, 0xe4, 0xaf, 0x97, 0xb4, 0x37, 0xd3, 0x4b, 0x2f, 0x67, 0x88, 0x30, 0xc8, 0x6f, 0xaf, 0x91, + 0x73, 0x5d, 0x6e, 0xe2, 0xe1, 0xaf, 0x7a, 0x73, 0x7b, 0x8f, 0x82, 0x33, 0x3a, 0x8f, 0x70, 0xe4, + 0xab, 0x79, 0x0c, 0x90, 0x9f, 0xcf, 0x79, 0x0f, 0xb1, 0x79, 0xb4, 0xc7, 0x42, 0x5e, 0x84, 0xc6, + 0x50, 0x13, 0xa8, 0xf3, 0xc5, 0x2a, 0x99, 0xc9, 0xbc, 0xaa, 0x87, 0xe6, 0xb5, 0xc1, 0x90, 0x90, + 0x23, 0x6f, 0xe5, 0x83, 0xd5, 0x1b, 0x29, 0xc8, 0x24, 0x20, 0x55, 0x2f, 0xe8, 0xf5, 0x93, 0x62, + 0xd0, 0xd4, 0x78, 0x25, 0x96, 0xb1, 0x40, 0xe3, 0xce, 0x12, 0x7f, 0x02, 0x17, 0x53, 0x64, 0xc8, + 0x4a, 0x4a, 0x1b, 0xae, 0x3c, 0x22, 0x6d, 0xf8, 0x13, 0x3a, 0x80, 0xa4, 0x5a, 0xc4, 0xfd, 0x52, + 0x66, 0xb0, 0x1c, 0xb7, 0x3a, 0xfb, 0x73, 0x25, 0x32, 0x69, 0x74, 0x9a, 0xfd, 0xe3, 0x69, 0x38, + 0x79, 0xab, 0xb8, 0x4f, 0x62, 0xe5, 0xcf, 0x69, 0xc0, 0x78, 0xfe, 0x49, 0x6f, 0x1d, 0x44, 0x92, + 0x7f, 0xfd, 0xfe, 0xec, 0xe9, 0x0c, 0x56, 0x7c, 0x0a, 0x5d, 0xfe, 0xc2, 0x77, 0x90, 0x99, 0x4c, + 0x31, 0x39, 0x9f, 0xbc, 0x61, 0x7e, 0xf2, 0x91, 0xaf, 0x02, 0xcc, 0x26, 0xfb, 0x19, 0x6c, 0x32, + 0x01, 0xe2, 0x14, 0xfa, 0x74, 0x84, 0x7b, 0x90, 0x8c, 0xed, 0xa1, 0x34, 0xa2, 0x03, 0xc4, 0xf3, + 0xa4, 0xd6, 0x0b, 0x7d, 0xaf, 0xe5, 0xa9, 0xd7, 0x68, 0x98, 0xf7, 0xc7, 0xba, 0x48, 0x03, 0x45, + 0xb5, 0xef, 0x92, 0x89, 0x3b, 0x77, 0x13, 0xee, 0x82, 0x50, 0xaf, 0x14, 0xea, 0x79, 0xa0, 0x94, + 0x16, 0x99, 0x12, 0x83, 0x96, 0x85, 0xa8, 0x86, 0x6c, 0x13, 0x94, 0xce, 0x2c, 0xec, 0x0a, 0x96, + 0xed, 0x8e, 0x31, 0x08, 0x8a, 0xf3, 0x6f, 0x26, 0xc9, 0xd9, 0xbc, 0xa7, 0x4d, 0xed, 0x8f, 0x92, + 0x31, 0x5e, 0xc7, 0x62, 0x5e, 0xcf, 0xce, 0x93, 0xb1, 0xc4, 0x0a, 0x14, 0xd5, 0x62, 0xff, 0x83, + 0x90, 0x29, 0xa4, 0xfb, 0xee, 0x66, 0xbd, 0x74, 0x8c, 0xd2, 0x57, 0x5c, 0x2d, 0x7d, 0xc5, 0xe5, + 0xd2, 0x7d, 0x77, 0xd3, 0xbe, 0x47, 0xaa, 0x1d, 0x2f, 0xa1, 0xae, 0x30, 0xdc, 0xde, 0x3e, 0x16, + 0xe1, 0xd4, 0xe5, 0x5a, 0x1a, 0xfb, 0x17, 0xb8, 0x40, 0x8c, 0x74, 0x9f, 0xd9, 0x4c, 0x83, 0x44, + 0x8a, 0xc5, 0xd3, 0x2d, 0xbe, 0x12, 0x19, 0x34, 0xca, 0xc6, 0x13, 0x68, 0x1e, 0xc8, 0x24, 0x42, + 0xb6, 0x3a, 0x18, 0x94, 0x37, 0xbe, 0xc5, 0x9e, 0xdc, 0x93, 0x8b, 0xea, 0x31, 0x74, 0x0e, 0x7f, + 0xd3, 0x4f, 0x9f, 0x38, 0xf8, 0xef, 0x18, 0xa4, 0xe4, 0x61, 0x3b, 0xd5, 0xd8, 0x51, 0x77, 0xaa, + 0xf1, 0x47, 0xb4, 0x53, 0x7d, 0xca, 0x22, 0x13, 0xaa, 0xa5, 0x05, 0xd8, 0xde, 0xfb, 0x8f, 0xb1, + 0xcb, 0xb9, 0xb5, 0x5a, 0xfd, 0x04, 0x2d, 0x1c, 0x61, 0x77, 0x26, 0xdd, 0xd7, 0xfa, 0x11, 0x6d, + 0xd3, 0xdd, 0xb0, 0x17, 0x0b, 0xf4, 0xfc, 0x0f, 0x16, 0x5f, 0x99, 0x79, 0x14, 0xb2, 0x48, 0x77, + 0xd7, 0x7a, 0xb1, 0x00, 0x8f, 0xd1, 0x09, 0x60, 0x56, 0x01, 0x61, 0xd5, 0xe5, 0x3e, 0x4e, 0x8a, + 0x78, 0x43, 0x25, 0xaf, 0x36, 0x23, 0x61, 0x21, 0x51, 0xf2, 0x74, 0x2b, 0x0c, 0x12, 0x2f, 0xe8, + 0xd3, 0xb5, 0x00, 0x8d, 0xb0, 0x37, 0xc2, 0xe4, 0x6a, 0xd8, 0x0f, 0xda, 0x57, 0xa2, 0x28, 0x8c, + 0x84, 0x1b, 0xdc, 0x73, 0x22, 0xf3, 0xd3, 0x0b, 0xc3, 0x59, 0x61, 0xbf, 0x72, 0x8e, 0xa2, 0x33, + 0xdc, 0x2f, 0x91, 0xd9, 0x03, 0x1a, 0x1b, 0x6f, 0xa6, 0xc3, 0xa8, 0xe3, 0x06, 0xde, 0x6b, 0x26, + 0x40, 0xae, 0x52, 0x48, 0xd7, 0x0c, 0x1a, 0xa4, 0x38, 0x4d, 0xe4, 0xc4, 0xd2, 0x01, 0xc8, 0x89, + 0x97, 0x48, 0x25, 0xa2, 0xbd, 0x30, 0x7b, 0xae, 0xc2, 0x8f, 0x05, 0x46, 0x41, 0x3c, 0x04, 0xb7, + 0xe7, 0x09, 0x23, 0xad, 0x3a, 0x2e, 0xce, 0xaf, 0x2f, 0x03, 0xa6, 0xa7, 0x80, 0x5c, 0xab, 0x27, + 0x02, 0xe4, 0x8a, 0x3b, 0xa6, 0xb8, 0x5a, 0x1f, 0xd3, 0x3b, 0x66, 0xfa, 0xca, 0xdb, 0xf9, 0x42, + 0x99, 0x3c, 0xbb, 0xef, 0xd4, 0xd2, 0x61, 0x50, 0xd6, 0x3e, 0x61, 0x50, 0xb2, 0x79, 0x4a, 0x07, + 0x35, 0x4f, 0x79, 0x48, 0xf3, 0x7c, 0x37, 0xae, 0x18, 0x12, 0x58, 0x58, 0x6c, 0x12, 0x47, 0x34, + 0xd5, 0x0e, 0xc3, 0x29, 0x16, 0x8b, 0x85, 0xa4, 0x82, 0x96, 0x8b, 0xc7, 0xa5, 0x14, 0x0a, 0x60, + 0xb5, 0x88, 0x1d, 0x73, 0x28, 0xb8, 0x2f, 0x5f, 0x26, 0x86, 0x41, 0x0b, 0x3a, 0xbf, 0x54, 0x21, + 0xcf, 0x8d, 0xb0, 0xd1, 0x99, 0xa3, 0xd8, 0x1a, 0x71, 0x14, 0x7f, 0x95, 0x77, 0xd3, 0x27, 0x73, + 0xbb, 0x09, 0x8a, 0xef, 0xa6, 0xfd, 0x7b, 0x88, 0xdd, 0x4e, 0x06, 0x31, 0x6d, 0xf5, 0x23, 0x2a, + 0xc2, 0xad, 0xf5, 0xed, 0xa4, 0x48, 0x07, 0xc5, 0x81, 0xc7, 0xdf, 0x96, 0x8b, 0xd3, 0x7f, 0xbc, + 0x20, 0xd4, 0x37, 0x13, 0xcb, 0x85, 0x6b, 0x5f, 0x0b, 0xf3, 0xb8, 0x02, 0x70, 0x31, 0x88, 0xd5, + 0x7d, 0x61, 0xb8, 0x36, 0x82, 0xa8, 0x67, 0x9b, 0xcc, 0x2b, 0x7f, 0x95, 0xb9, 0x53, 0x8a, 0xa1, + 0xc3, 0xbe, 0x57, 0x27, 0x83, 0xc9, 0x83, 0xf6, 0x12, 0xd3, 0x9d, 0x7f, 0xd5, 0xf0, 0xc3, 0x64, + 0xf6, 0x92, 0x8d, 0x2c, 0x11, 0x06, 0xf9, 0xd1, 0x31, 0x3d, 0xf1, 0x12, 0x9f, 0xf2, 0xdc, 0x7c, + 0xa0, 0x31, 0x83, 0xe2, 0x86, 0x4a, 0x05, 0x83, 0xc3, 0xf9, 0x4a, 0x39, 0xff, 0x33, 0xb8, 0x96, + 0x7b, 0x98, 0xd1, 0x2f, 0xc6, 0x76, 0x69, 0x84, 0x15, 0xba, 0x7c, 0xd2, 0x2b, 0x74, 0x65, 0xd8, + 0x0a, 0x8d, 0x20, 0xc1, 0x3d, 0xfd, 0xf9, 0x1c, 0x37, 0x90, 0x5f, 0x58, 0x2b, 0x90, 0xe0, 0xf5, + 0x0c, 0x1d, 0x06, 0x72, 0x3c, 0xe6, 0x43, 0xf5, 0xd7, 0x4a, 0xe4, 0xfc, 0xd0, 0x83, 0xc5, 0x09, + 0xed, 0x40, 0x66, 0xf7, 0x57, 0x4e, 0xa6, 0xfb, 0xcd, 0x4e, 0xa9, 0x1e, 0xd8, 0x29, 0xa3, 0x6c, + 0xe7, 0xbf, 0x5b, 0x1a, 0x3a, 0x59, 0xf0, 0x20, 0xfa, 0xe7, 0xb6, 0x25, 0xbf, 0x99, 0x9c, 0x72, + 0x7b, 0x3d, 0xce, 0xc7, 0x42, 0xfc, 0x32, 0xc0, 0xe5, 0xf3, 0x26, 0x11, 0xd2, 0xbc, 0x23, 0x35, + 0xec, 0xef, 0x5b, 0x64, 0x02, 0xe8, 0x16, 0x5f, 0xe1, 0xf0, 0xd5, 0x29, 0xd6, 0x44, 0x56, 0x11, + 0xaf, 0x4e, 0x61, 0xc3, 0xc6, 0x1e, 0xc3, 0x1a, 0xca, 0x6b, 0xec, 0xa3, 0x42, 0x49, 0x3d, 0x47, + 0xaa, 0xad, 0x6d, 0x37, 0x4a, 0xb2, 0x61, 0xec, 0x0c, 0xe2, 0x1f, 0x38, 0xcd, 0xf9, 0xd3, 0x29, + 0xfc, 0xbc, 0x5e, 0x88, 0x0f, 0x8b, 0xc7, 0xd8, 0xbf, 0xfd, 0xc8, 0xaf, 0x5b, 0xe9, 0xfe, 0x45, + 0x0f, 0x0d, 0x4c, 0x4f, 0x5d, 0x55, 0x96, 0x0e, 0x05, 0xc3, 0x5c, 0x3e, 0x10, 0x86, 0x19, 0x21, + 0x49, 0xe3, 0xed, 0xf5, 0xc8, 0xdb, 0x75, 0x13, 0xbc, 0x08, 0xa8, 0x57, 0xd2, 0x1d, 0xd9, 0x6c, + 0x5e, 0xd3, 0x44, 0x48, 0xf3, 0x22, 0x22, 0xa8, 0x06, 0x43, 0xa6, 0x51, 0xc2, 0xc2, 0xe8, 0xf9, + 0x48, 0x50, 0xf8, 0x77, 0x1a, 0x3e, 0x59, 0x30, 0xc0, 0x60, 0x1e, 0x5c, 0x73, 0x53, 0x89, 0x58, + 0x91, 0xb1, 0xf4, 0x9a, 0x9b, 0x2a, 0x07, 0xeb, 0x32, 0x90, 0x03, 0x9f, 0xfa, 0xe1, 0x03, 0x63, + 0xbe, 0xd7, 0x33, 0xbe, 0x68, 0x3c, 0xfd, 0xd4, 0xcf, 0xd2, 0x20, 0x0b, 0xe4, 0xe5, 0x43, 0xd3, + 0x9e, 0x4a, 0x5e, 0x5e, 0x14, 0x57, 0x6b, 0xca, 0xb4, 0xa7, 0x8a, 0x59, 0x6e, 0x83, 0xc9, 0x87, + 0x2f, 0xc9, 0xea, 0x9f, 0x1c, 0x35, 0x86, 0x5f, 0x3d, 0x2f, 0x0a, 0x5c, 0x7a, 0xf5, 0x92, 0xec, + 0x52, 0x2e, 0x5b, 0x1b, 0x86, 0xe5, 0xb7, 0x37, 0xc9, 0x05, 0x45, 0xba, 0x12, 0x24, 0x0c, 0x38, + 0x21, 0xa6, 0x0d, 0x37, 0x66, 0x5e, 0x55, 0x3c, 0xf8, 0xca, 0x11, 0xa5, 0x5f, 0x58, 0xf2, 0x92, + 0x6b, 0x79, 0x9c, 0xb0, 0x02, 0xfb, 0x94, 0x82, 0x37, 0xdd, 0x34, 0x70, 0x37, 0x7d, 0xba, 0xb6, + 0xb0, 0x2c, 0x4e, 0xa4, 0x3a, 0x72, 0x4a, 0x12, 0x40, 0xf3, 0xa8, 0xd8, 0x9f, 0xa9, 0x61, 0xb1, + 0x3f, 0x18, 0x71, 0xdb, 0x69, 0xf5, 0x50, 0xcb, 0xf4, 0x5a, 0x74, 0xbe, 0xc5, 0x82, 0x0d, 0xb0, + 0x63, 0xf8, 0x1b, 0x4c, 0x2a, 0xe2, 0x76, 0x69, 0x61, 0x7d, 0x80, 0x07, 0x72, 0x73, 0xb2, 0xa0, + 0x14, 0x84, 0x78, 0xae, 0x3f, 0x91, 0x09, 0x4a, 0xc1, 0x44, 0xe0, 0x34, 0x74, 0xb1, 0x67, 0x51, + 0xe7, 0xd7, 0x92, 0xa4, 0xa7, 0xd4, 0xda, 0xfa, 0xd9, 0x34, 0x4c, 0xcf, 0xd5, 0x01, 0x0e, 0xc8, + 0xc9, 0x85, 0x5a, 0x4f, 0x10, 0xb2, 0xd2, 0xeb, 0x4f, 0xa5, 0xb5, 0x9e, 0x1b, 0x3c, 0x19, 0x24, + 0xdd, 0xfe, 0x00, 0xa9, 0xf7, 0x63, 0xca, 0x0e, 0xcc, 0xb7, 0xc3, 0x68, 0xc7, 0x0f, 0xdd, 0xf6, + 0x72, 0x9b, 0x06, 0x09, 0x46, 0x07, 0xd7, 0x99, 0xf0, 0x4b, 0x22, 0x6f, 0xfd, 0xe6, 0x10, 0x3e, + 0x18, 0x5a, 0x42, 0x16, 0x36, 0xfd, 0xfc, 0x88, 0xb0, 0xe9, 0xeb, 0xe4, 0xac, 0xdc, 0xd7, 0xd6, + 0x16, 0x96, 0xd5, 0x47, 0xd7, 0x2f, 0xa4, 0xdf, 0x20, 0x5e, 0xce, 0xe1, 0x81, 0xdc, 0x9c, 0xf6, + 0x0e, 0x79, 0x96, 0xd9, 0x58, 0x44, 0xe7, 0xac, 0x47, 0x5e, 0xd0, 0xf2, 0x7a, 0xae, 0xcf, 0xa7, + 0xe4, 0x72, 0xbb, 0xfe, 0x2c, 0xab, 0xda, 0x5b, 0x44, 0xd1, 0xcf, 0xce, 0xef, 0xc7, 0x0c, 0xfb, + 0x97, 0x65, 0xdf, 0x25, 0x6f, 0xde, 0x87, 0x81, 0x6f, 0x2d, 0xf5, 0x8b, 0x4c, 0xe0, 0xd7, 0x0a, + 0x81, 0x6f, 0x9e, 0x3f, 0x28, 0x03, 0x1c, 0x5c, 0xe6, 0xd0, 0xaf, 0xdc, 0xa0, 0x81, 0xcb, 0xbe, + 0x72, 0x76, 0x84, 0xaf, 0x94, 0xcc, 0xb0, 0x7f, 0x59, 0xf6, 0x36, 0x79, 0x86, 0x31, 0xcc, 0xb7, + 0x12, 0x6f, 0x57, 0x23, 0xe2, 0x5d, 0x09, 0xda, 0xbd, 0xd0, 0x0b, 0x92, 0xfa, 0x25, 0x26, 0xeb, + 0x6b, 0x84, 0xac, 0x67, 0xe6, 0xf7, 0xe1, 0x85, 0x7d, 0x4b, 0x72, 0xfe, 0x93, 0x45, 0x4e, 0xa9, + 0xed, 0xe7, 0x04, 0x50, 0x4c, 0xfc, 0x34, 0x8a, 0xc9, 0xd2, 0xd1, 0x37, 0x70, 0x56, 0xf3, 0x21, + 0xb1, 0x93, 0xff, 0xfd, 0x0c, 0x21, 0x7a, 0x93, 0x57, 0xfa, 0x95, 0x35, 0x54, 0xbf, 0x7a, 0x6c, + 0x37, 0xd8, 0x3c, 0x0c, 0xf3, 0xea, 0xa3, 0xc5, 0x30, 0x6f, 0x92, 0x73, 0x72, 0x3d, 0xe0, 0xfe, + 0x00, 0x88, 0xfe, 0x20, 0xf7, 0x6b, 0xe3, 0x45, 0xf0, 0xe5, 0x3c, 0x26, 0xc8, 0xcf, 0x9b, 0x52, + 0xcc, 0xc7, 0x0f, 0x54, 0xcc, 0xd5, 0x16, 0xb5, 0xb2, 0x25, 0xdf, 0xeb, 0xcf, 0x6c, 0x51, 0x2b, + 0x57, 0x9b, 0xa0, 0x79, 0xf2, 0xf5, 0x94, 0x89, 0x82, 0xf4, 0x14, 0x72, 0x68, 0x3d, 0x45, 0xee, + 0x98, 0x93, 0x43, 0x77, 0x4c, 0x79, 0xef, 0x38, 0x35, 0xf4, 0xde, 0xf1, 0xbd, 0x64, 0xda, 0x0b, + 0xb6, 0x69, 0xe4, 0x25, 0xb4, 0xcd, 0xe6, 0x42, 0xfd, 0x54, 0x3a, 0x6a, 0x7b, 0x39, 0x45, 0x85, + 0x0c, 0x77, 0x7a, 0x9b, 0x9f, 0x1e, 0x61, 0x9b, 0x1f, 0xa2, 0x5c, 0xcd, 0x14, 0xa3, 0x5c, 0x9d, + 0x3e, 0xba, 0x72, 0x75, 0xe6, 0x58, 0x95, 0x2b, 0xbb, 0x10, 0xe5, 0x6a, 0x24, 0xbd, 0xc5, 0xb0, + 0xb0, 0x9c, 0x3d, 0xc0, 0xc2, 0x32, 0x4c, 0xb3, 0x3a, 0xf7, 0xd0, 0x9a, 0x55, 0xbe, 0xd2, 0xf4, + 0xe4, 0x1b, 0x4a, 0x53, 0x21, 0x4a, 0xd3, 0x73, 0xa4, 0xda, 0xa6, 0xbd, 0x64, 0xbb, 0xfe, 0x34, + 0x1b, 0xac, 0xaa, 0xff, 0x17, 0x31, 0x11, 0x38, 0xcd, 0x4e, 0xc8, 0xa5, 0xbb, 0x74, 0x73, 0x3b, + 0x0c, 0x77, 0x56, 0xdd, 0xc0, 0xdb, 0xa2, 0xe2, 0x9d, 0x9e, 0xdb, 0x6e, 0xd4, 0x15, 0x6f, 0xa4, + 0xb4, 0xeb, 0xcf, 0xb0, 0x2a, 0x3c, 0x2f, 0xf2, 0x5f, 0xba, 0x7d, 0x00, 0x3f, 0x1c, 0x58, 0xe2, + 0x1b, 0xfa, 0xdc, 0x57, 0xb3, 0x3e, 0xf7, 0xa9, 0x12, 0x39, 0xa7, 0x35, 0x1e, 0xdc, 0x67, 0xbc, + 0x2d, 0xdc, 0xf3, 0x29, 0xba, 0x87, 0x72, 0x2f, 0x18, 0x03, 0x88, 0x49, 0x43, 0x51, 0x29, 0x0a, + 0x18, 0x5c, 0x0c, 0xcf, 0x88, 0x46, 0xec, 0x79, 0xce, 0xac, 0x3a, 0xb4, 0x20, 0xd2, 0x41, 0x71, + 0xe0, 0xe4, 0xc2, 0xff, 0x05, 0xb2, 0x5e, 0xf6, 0x21, 0xa7, 0x05, 0x4d, 0x02, 0x93, 0x8f, 0xe1, + 0x9f, 0xc8, 0xad, 0x18, 0x55, 0xa2, 0x29, 0x81, 0x7f, 0x22, 0xd2, 0x40, 0x51, 0x65, 0x75, 0x18, + 0xde, 0x56, 0x75, 0xb0, 0x3a, 0x98, 0x0e, 0x8a, 0xc3, 0xf9, 0x9f, 0x16, 0x39, 0x9f, 0xdb, 0x14, + 0x27, 0xa0, 0xe6, 0xde, 0x4b, 0xab, 0xb9, 0xcd, 0xa2, 0xec, 0x54, 0xc6, 0x57, 0x0c, 0x51, 0x79, + 0xff, 0x83, 0x45, 0xa6, 0x35, 0xff, 0x09, 0x7c, 0xaa, 0x97, 0xfe, 0xd4, 0xe2, 0x4c, 0x72, 0x13, + 0x03, 0xdf, 0xf6, 0xab, 0x25, 0xa2, 0x1e, 0x57, 0x9b, 0x6f, 0x25, 0xa3, 0xc5, 0xa7, 0x23, 0x56, + 0xb8, 0x1b, 0xb9, 0xdd, 0xb8, 0x18, 0x97, 0xd9, 0xb4, 0x7c, 0xe6, 0xa2, 0xa6, 0x6f, 0xf9, 0xd9, + 0xcf, 0x18, 0x84, 0x40, 0x86, 0x36, 0x24, 0xd7, 0xe9, 0x72, 0x5a, 0x99, 0x55, 0xeb, 0xb1, 0xe2, + 0x40, 0x45, 0xcc, 0x6b, 0x85, 0xc1, 0x82, 0xef, 0xc6, 0xb1, 0x38, 0x1b, 0x28, 0x45, 0x6c, 0x59, + 0x12, 0x40, 0xf3, 0x30, 0x8f, 0x33, 0x2f, 0xee, 0xf9, 0xee, 0x9e, 0x61, 0x78, 0x35, 0x22, 0xaa, + 0x14, 0x09, 0x4c, 0x3e, 0xa7, 0x4b, 0xea, 0xe9, 0x8f, 0x58, 0xa4, 0x5b, 0x2c, 0xf2, 0x63, 0xa4, + 0xe6, 0xc4, 0xf8, 0x07, 0x96, 0x6b, 0xa5, 0xef, 0xd6, 0x4b, 0xe9, 0x5a, 0xce, 0x4b, 0x02, 0x68, + 0x1e, 0xe7, 0x1b, 0xc9, 0x13, 0x39, 0x6d, 0x36, 0x82, 0x57, 0xed, 0x2f, 0x96, 0xc8, 0x4c, 0x3a, + 0x67, 0xcc, 0xc0, 0x12, 0x78, 0x9d, 0xbd, 0xb8, 0x15, 0xee, 0xd2, 0x68, 0x0f, 0xab, 0x61, 0x65, + 0xc0, 0x12, 0x06, 0x38, 0x20, 0x27, 0x17, 0x7b, 0x17, 0xb1, 0xad, 0x3e, 0x5d, 0x0e, 0x8f, 0x5b, + 0x45, 0x0e, 0x0f, 0xdd, 0xb2, 0x46, 0xbf, 0x68, 0x91, 0x60, 0xca, 0x47, 0xbd, 0x9a, 0x85, 0x7a, + 0x22, 0x1e, 0x42, 0xe2, 0x05, 0xe2, 0x93, 0xc5, 0xc0, 0x51, 0x7a, 0xf5, 0xea, 0x20, 0x0b, 0xe4, + 0xe5, 0x73, 0xbe, 0x5c, 0x21, 0x0a, 0x5f, 0x8f, 0x79, 0x6a, 0x17, 0xe4, 0xe7, 0x7e, 0x58, 0xc8, + 0x0d, 0xd5, 0xd3, 0x95, 0xfd, 0x5c, 0x27, 0xb9, 0xe9, 0xdc, 0xbc, 0x63, 0x53, 0x0d, 0xb6, 0xa1, + 0x49, 0x60, 0xf2, 0x61, 0x4d, 0x7c, 0x6f, 0x97, 0xf2, 0x4c, 0x63, 0xe9, 0x9a, 0xac, 0x48, 0x02, + 0x68, 0x1e, 0xac, 0x49, 0xdb, 0xdb, 0xda, 0xaa, 0x8f, 0xa7, 0x6b, 0x82, 0xad, 0x03, 0x8c, 0xc2, + 0x5f, 0xce, 0x0d, 0x77, 0xc4, 0x59, 0xd2, 0x78, 0x39, 0x37, 0xdc, 0x01, 0x46, 0xc1, 0x5e, 0x0a, + 0xc2, 0xa8, 0xeb, 0xfa, 0xde, 0x6b, 0xb4, 0xad, 0xa4, 0x88, 0x33, 0xa4, 0xea, 0xa5, 0x1b, 0x83, + 0x2c, 0x90, 0x97, 0x8f, 0x23, 0x88, 0xd3, 0xb6, 0xd7, 0x4a, 0xcc, 0xd2, 0x48, 0x7a, 0x40, 0xaf, + 0x0f, 0x70, 0x40, 0x4e, 0x2e, 0x8c, 0xd9, 0x93, 0xf8, 0x88, 0x12, 0xfd, 0x7c, 0x32, 0x1d, 0xb3, + 0x07, 0x69, 0x32, 0x64, 0xf9, 0x71, 0xc5, 0xea, 0x8a, 0x17, 0x39, 0xea, 0x53, 0xe9, 0x15, 0x4b, + 0xbe, 0xd4, 0x01, 0x8a, 0xc3, 0xf9, 0x44, 0x19, 0x77, 0xd8, 0x21, 0x0f, 0xdf, 0x9c, 0x58, 0x5c, + 0x45, 0x7a, 0x44, 0x56, 0x46, 0x18, 0x91, 0x18, 0xb3, 0x10, 0x87, 0x81, 0x8a, 0x59, 0xa8, 0x0e, + 0x8d, 0x59, 0x30, 0xb8, 0xf2, 0x63, 0x16, 0xc6, 0x8a, 0x8a, 0x59, 0x18, 0x7f, 0xc8, 0x98, 0x85, + 0x7f, 0x59, 0x25, 0x4f, 0x2a, 0x8c, 0x4c, 0x9a, 0xdc, 0x0d, 0xa3, 0x1d, 0x2f, 0xe8, 0x30, 0xac, + 0xbf, 0x2f, 0x59, 0x12, 0x2e, 0x70, 0xc5, 0xc4, 0xf9, 0xd8, 0x2a, 0xe8, 0x79, 0xfb, 0x94, 0xb0, + 0xb9, 0x0d, 0x43, 0x10, 0xf7, 0x7d, 0xcb, 0xc0, 0x12, 0x72, 0x12, 0xa4, 0x6a, 0x64, 0x7f, 0x07, + 0x21, 0xf2, 0xd2, 0x6c, 0x4b, 0xae, 0xc0, 0xcb, 0xc5, 0xd4, 0x0f, 0x2f, 0x2d, 0x95, 0x7e, 0xbb, + 0xa1, 0x84, 0x80, 0x21, 0x10, 0xbd, 0x25, 0xe5, 0x05, 0x24, 0x8f, 0x73, 0xfc, 0xc8, 0xb1, 0xb4, + 0xcd, 0x28, 0x08, 0x28, 0x40, 0xc6, 0xbd, 0xa0, 0x83, 0xe3, 0x44, 0xf8, 0x76, 0xbf, 0x2d, 0x0f, + 0x4a, 0x76, 0x25, 0x74, 0xdb, 0x0d, 0xd7, 0x77, 0x83, 0x16, 0xbe, 0x1a, 0xc0, 0xd8, 0xf5, 0x59, + 0x5a, 0x24, 0x80, 0x2c, 0x08, 0xc7, 0x39, 0x7a, 0xb9, 0x47, 0x81, 0xeb, 0xdf, 0x84, 0x95, 0xd4, + 0x38, 0xbf, 0x62, 0xa4, 0x43, 0x8a, 0xeb, 0xc2, 0xb7, 0x91, 0x33, 0x03, 0x9d, 0x79, 0x28, 0xc0, + 0x93, 0x23, 0x80, 0xc8, 0xfe, 0xd2, 0x98, 0xde, 0xb4, 0x10, 0x36, 0xd7, 0xfe, 0xb8, 0x45, 0x26, + 0x23, 0xdd, 0xa3, 0x42, 0x7f, 0x2d, 0x70, 0x88, 0xa8, 0x6d, 0xc6, 0x48, 0x04, 0x53, 0x24, 0x8e, + 0xd1, 0x9e, 0x1b, 0xd1, 0xe0, 0xb8, 0xc7, 0xe8, 0xba, 0x12, 0x02, 0x86, 0x40, 0x7b, 0x3b, 0x15, + 0x88, 0x7b, 0xf5, 0xe8, 0x81, 0xb8, 0x2c, 0xe6, 0x3d, 0xef, 0xd5, 0xec, 0xcf, 0x59, 0x64, 0x3a, + 0x48, 0x8d, 0xdc, 0x62, 0x02, 0x6e, 0xf2, 0x67, 0x45, 0xc3, 0x46, 0xe3, 0x64, 0x3a, 0x0d, 0x32, + 0xf2, 0xf3, 0xb6, 0xb4, 0xea, 0x21, 0xb7, 0x34, 0x87, 0x8c, 0x31, 0x98, 0x8a, 0x94, 0x8f, 0x01, + 0x83, 0xb0, 0x88, 0x41, 0x50, 0xec, 0x80, 0x8c, 0x71, 0x18, 0xf2, 0xfa, 0x78, 0x11, 0xf8, 0x66, + 0x26, 0x96, 0x39, 0x97, 0xc7, 0x53, 0x40, 0x48, 0xb1, 0x6f, 0x9b, 0xc0, 0x1d, 0xb5, 0x43, 0x47, + 0x81, 0x9e, 0x1a, 0x06, 0xf0, 0xe1, 0xfc, 0xdf, 0x0a, 0x39, 0x2d, 0x5b, 0x44, 0x06, 0xeb, 0xe1, + 0xfe, 0xc8, 0xe5, 0x6a, 0x5d, 0x59, 0xed, 0x8f, 0xd7, 0x24, 0x01, 0x34, 0x0f, 0xea, 0x63, 0xfd, + 0x18, 0x81, 0x7a, 0x83, 0x15, 0x6f, 0x33, 0x16, 0x0e, 0x32, 0x6a, 0xa2, 0xdc, 0xd4, 0x24, 0x30, + 0xf9, 0x18, 0xba, 0x48, 0xcb, 0x84, 0xf8, 0xd2, 0xe8, 0x22, 0x2d, 0x01, 0x95, 0x27, 0xe8, 0xf6, + 0x8f, 0xe4, 0xbe, 0xc4, 0x57, 0x4c, 0xb4, 0xfb, 0x40, 0x8c, 0xe2, 0xe1, 0x9e, 0xe0, 0xb3, 0x7f, + 0xda, 0x22, 0xe7, 0x78, 0xaa, 0x6c, 0xc9, 0x9b, 0xbd, 0xb6, 0x9b, 0xd0, 0xb8, 0x3e, 0x76, 0x4c, + 0xf5, 0xd3, 0x57, 0x25, 0x79, 0x62, 0x21, 0xbf, 0x36, 0x88, 0x6c, 0x34, 0xb3, 0x93, 0x82, 0xe8, + 0x94, 0x5b, 0xc7, 0x51, 0xf1, 0xeb, 0x52, 0x85, 0xea, 0xa9, 0x96, 0x4e, 0x8f, 0x21, 0x2b, 0x1d, + 0x5f, 0xf9, 0x34, 0x97, 0xd1, 0x93, 0x47, 0xf6, 0x3c, 0xbc, 0x2a, 0x28, 0xb5, 0xcb, 0xea, 0x50, + 0xed, 0x12, 0x5d, 0x72, 0xbc, 0x76, 0x7d, 0x2c, 0xe3, 0x92, 0xb3, 0xbc, 0x08, 0x98, 0xee, 0x7c, + 0x7a, 0x4c, 0xdb, 0x24, 0x44, 0x04, 0xf9, 0x9f, 0x8b, 0xcf, 0x7e, 0x55, 0x3d, 0xf5, 0xc0, 0xbf, + 0xfc, 0x7d, 0x03, 0x4f, 0x3d, 0x2c, 0x1d, 0x09, 0x2b, 0x80, 0xb7, 0xd5, 0xb0, 0x97, 0x1e, 0xc6, + 0x0f, 0x00, 0x0a, 0xe8, 0x93, 0x1a, 0x9e, 0xc6, 0x98, 0x9d, 0xb1, 0x96, 0xaa, 0x5f, 0xed, 0x9a, + 0x48, 0x7f, 0xfd, 0xfe, 0xec, 0x95, 0x23, 0xd5, 0x50, 0x16, 0x04, 0x4a, 0x94, 0xfd, 0x31, 0x32, + 0x81, 0xff, 0x33, 0x78, 0x03, 0x71, 0xe4, 0xfb, 0x88, 0x5a, 0x49, 0x25, 0xa1, 0x68, 0x18, 0x05, + 0x2d, 0xd2, 0xde, 0x23, 0x13, 0xc8, 0xc8, 0xe5, 0xf3, 0x43, 0xe2, 0xfb, 0xa5, 0xfc, 0xa6, 0x24, + 0xbc, 0x7e, 0x7f, 0xf6, 0xea, 0x91, 0xe4, 0xab, 0x92, 0x40, 0x4b, 0x33, 0xb6, 0xd1, 0xc9, 0x61, + 0xdb, 0xa8, 0xf3, 0xa7, 0x15, 0x3d, 0x17, 0xc4, 0x8b, 0x21, 0x7f, 0x2e, 0xe6, 0xc2, 0x8b, 0x99, + 0xb9, 0x70, 0x69, 0x60, 0x2e, 0x4c, 0x63, 0x9b, 0xe5, 0x3c, 0x5e, 0x72, 0xd2, 0x8a, 0xc5, 0xc1, + 0xf6, 0x0b, 0xa6, 0x51, 0xbd, 0xda, 0xf7, 0x22, 0x1a, 0xaf, 0x47, 0xfd, 0x00, 0x5f, 0xeb, 0xe0, + 0x28, 0xdf, 0x86, 0x46, 0x95, 0x22, 0x43, 0x96, 0x9f, 0x41, 0xae, 0x23, 0x44, 0xbb, 0xbb, 0xcb, + 0x07, 0xa1, 0x81, 0xba, 0xdd, 0x14, 0xe9, 0xa0, 0x38, 0xf0, 0xee, 0x43, 0x16, 0xb0, 0x48, 0x7d, + 0x8a, 0x1f, 0xc4, 0xdc, 0x92, 0xa3, 0xae, 0x9b, 0x48, 0x13, 0x45, 0x4d, 0xdf, 0x7d, 0xc0, 0x3e, + 0xbc, 0xb0, 0x6f, 0x49, 0xce, 0xef, 0x31, 0x5f, 0x16, 0x03, 0x06, 0x06, 0x47, 0x9f, 0xef, 0x75, + 0x3d, 0x09, 0x0e, 0xae, 0x46, 0xdf, 0x0a, 0x26, 0x02, 0xa7, 0xd9, 0x77, 0xc9, 0xf8, 0xa6, 0xdb, + 0xda, 0x09, 0xb7, 0xb6, 0x8a, 0x79, 0xa9, 0xb6, 0xc1, 0x0b, 0x63, 0xaf, 0xc8, 0x8c, 0x8b, 0x1f, + 0xaf, 0xeb, 0x7f, 0x41, 0x4a, 0xe3, 0xb0, 0x5c, 0x5b, 0x11, 0x8d, 0xb7, 0x85, 0x91, 0xcf, 0x80, + 0xe5, 0x62, 0xc9, 0x20, 0xe9, 0xce, 0x6f, 0x57, 0xc9, 0x8c, 0xf4, 0x2b, 0xbd, 0xe6, 0xc5, 0xcc, + 0x9b, 0xc5, 0x04, 0xa8, 0x2a, 0x1d, 0x08, 0x50, 0xf5, 0x21, 0x42, 0xda, 0xb4, 0xe7, 0x87, 0x7b, + 0x4c, 0xe7, 0xac, 0x1c, 0x5a, 0xe7, 0x54, 0xc7, 0x94, 0x45, 0x55, 0x0a, 0x18, 0x25, 0x0a, 0xf0, + 0x74, 0x8e, 0x77, 0x95, 0x01, 0x4f, 0x37, 0x9e, 0xbe, 0x1e, 0x3b, 0xd9, 0xa7, 0xaf, 0x3d, 0x32, + 0xc3, 0xab, 0xa8, 0xc0, 0x58, 0x1e, 0x02, 0x73, 0x85, 0x85, 0xb3, 0x2e, 0xa6, 0x8b, 0x81, 0x6c, + 0xb9, 0xe6, 0xbb, 0xd6, 0xb5, 0x93, 0x7e, 0xd7, 0xfa, 0xed, 0x64, 0x42, 0xf6, 0x33, 0x86, 0x59, + 0x2a, 0x10, 0x41, 0x39, 0x0c, 0x62, 0xd0, 0xf4, 0x01, 0x88, 0x29, 0xf2, 0xa8, 0x20, 0xa6, 0x9c, + 0x5f, 0x64, 0x87, 0x15, 0x5e, 0xaf, 0x43, 0x3f, 0x0b, 0x7f, 0xcd, 0x78, 0x16, 0xfe, 0x70, 0xfd, + 0x59, 0xcb, 0x3c, 0x1f, 0xff, 0x0c, 0xa9, 0x24, 0x6e, 0x47, 0x46, 0xdf, 0x33, 0xea, 0x86, 0x8b, + 0xef, 0x58, 0x62, 0xea, 0x61, 0x1e, 0x26, 0x41, 0x07, 0x2f, 0xaf, 0x13, 0xb8, 0x09, 0x7a, 0x35, + 0xe9, 0x3b, 0x4a, 0xed, 0xe0, 0x65, 0x12, 0x21, 0xcd, 0x8b, 0xf1, 0x5d, 0x24, 0xa2, 0xea, 0x28, + 0x34, 0x56, 0xc4, 0x18, 0x52, 0xcb, 0x80, 0x2c, 0xd7, 0xc4, 0x03, 0x52, 0x47, 0x20, 0x43, 0xac, + 0xfd, 0x77, 0x2c, 0x72, 0x4e, 0x3e, 0xdf, 0x93, 0xd0, 0x4e, 0x84, 0xde, 0x14, 0x1c, 0x8b, 0x69, + 0xbc, 0x88, 0xf8, 0xf9, 0x66, 0xba, 0xe8, 0x85, 0x6d, 0xda, 0xda, 0xe1, 0xe5, 0x73, 0xcb, 0x67, + 0x33, 0x4f, 0x34, 0xe4, 0xd7, 0xc8, 0xf9, 0xa4, 0x45, 0xce, 0x0c, 0x7c, 0xa1, 0xdd, 0xc3, 0x67, + 0x34, 0xbb, 0x72, 0xcd, 0x3f, 0xf2, 0x59, 0x68, 0x81, 0x95, 0x25, 0x47, 0xa7, 0x7c, 0x65, 0x13, + 0xd3, 0x40, 0xc8, 0x71, 0x7e, 0x79, 0x8a, 0x9c, 0x6d, 0x2e, 0xac, 0xca, 0x07, 0x4a, 0x8f, 0x0d, + 0xfa, 0x20, 0x4f, 0xc6, 0xc9, 0x41, 0x1f, 0x0c, 0x91, 0xee, 0x1b, 0xd0, 0x07, 0xbe, 0x01, 0x7d, + 0x90, 0x8e, 0x43, 0x2f, 0x17, 0x11, 0x87, 0x9e, 0x57, 0x83, 0x51, 0xe2, 0xd0, 0x8f, 0x0d, 0x0b, + 0x61, 0xdf, 0x0a, 0x1d, 0x0a, 0x0b, 0x41, 0x01, 0x45, 0x14, 0x12, 0xf6, 0x3a, 0xa4, 0xab, 0x72, + 0x81, 0x22, 0x54, 0x90, 0x3e, 0x0f, 0xe9, 0xae, 0x8f, 0x15, 0x11, 0xa4, 0x9f, 0x57, 0x81, 0x11, + 0x82, 0xf4, 0xf9, 0x8f, 0x14, 0x30, 0xc4, 0x78, 0x11, 0xc0, 0x10, 0x79, 0xd5, 0x39, 0x10, 0x18, + 0x02, 0x5f, 0xe8, 0xf7, 0xc3, 0x80, 0xae, 0x47, 0x61, 0x12, 0xb6, 0x42, 0xbf, 0x5e, 0x4b, 0x2f, + 0xe6, 0x0b, 0x26, 0x11, 0xd2, 0xbc, 0xc3, 0x50, 0x25, 0x26, 0x8e, 0x8a, 0x2a, 0x41, 0x1e, 0x11, + 0xaa, 0x84, 0x81, 0x9b, 0x30, 0x59, 0x04, 0x6e, 0x42, 0x5e, 0x8f, 0x8c, 0x84, 0x9b, 0xf0, 0x05, + 0x8b, 0x9c, 0x72, 0xef, 0xb2, 0x33, 0x16, 0x5f, 0x85, 0xd9, 0x2d, 0xe5, 0xe4, 0x0b, 0x1f, 0x3e, + 0x86, 0x01, 0x7b, 0xbb, 0xa9, 0xc5, 0x34, 0xce, 0xb0, 0x58, 0x36, 0x33, 0x09, 0xd2, 0x15, 0x39, + 0x0a, 0xd6, 0xc2, 0x17, 0x4b, 0xe4, 0xcd, 0x07, 0x56, 0xc1, 0xbe, 0x8b, 0x77, 0x65, 0x1d, 0x31, + 0x50, 0xeb, 0x56, 0x11, 0xfe, 0xf3, 0x1b, 0xb2, 0x3c, 0x11, 0x07, 0xac, 0x8a, 0x07, 0x43, 0x14, + 0x73, 0x9b, 0x0f, 0xfd, 0x81, 0x67, 0x38, 0x20, 0xf4, 0x29, 0x30, 0x0a, 0x2a, 0x6d, 0x11, 0xed, + 0xe8, 0x47, 0xb5, 0x54, 0xf7, 0x01, 0x4b, 0x05, 0x41, 0x45, 0xc3, 0xb2, 0xeb, 0xfb, 0x3c, 0x26, + 0x99, 0x72, 0x27, 0x17, 0xc3, 0xb0, 0x3c, 0xaf, 0x49, 0x60, 0xf2, 0x39, 0x7f, 0x5c, 0x22, 0xb3, + 0x07, 0xac, 0x29, 0x03, 0x58, 0x14, 0xd5, 0x91, 0xb1, 0x28, 0x44, 0x4c, 0xe5, 0xd8, 0x90, 0x98, + 0x4a, 0x74, 0x4e, 0xa0, 0x08, 0x6a, 0xcb, 0x1d, 0x71, 0x33, 0x98, 0xd2, 0x1b, 0x9a, 0x04, 0x26, + 0x1f, 0xae, 0x62, 0xd3, 0x6e, 0xab, 0x45, 0xe3, 0x58, 0x06, 0x4d, 0x0a, 0x43, 0x7f, 0x61, 0x11, + 0x99, 0xec, 0xfe, 0x64, 0x3e, 0x25, 0x02, 0x32, 0x22, 0xb3, 0x0d, 0x3e, 0x31, 0x62, 0x83, 0xff, + 0x64, 0x89, 0x3c, 0xbb, 0xef, 0xee, 0x36, 0x72, 0x3c, 0x2b, 0xc6, 0x4a, 0x64, 0x07, 0x0e, 0x46, + 0x52, 0x00, 0xa3, 0xf0, 0x56, 0xea, 0xf5, 0x54, 0xb4, 0x44, 0xf1, 0x01, 0xe0, 0xbc, 0x95, 0x52, + 0x22, 0x20, 0x23, 0xf2, 0x61, 0x87, 0xe5, 0x6f, 0x57, 0xc8, 0x73, 0x23, 0xe8, 0x00, 0x05, 0x06, + 0xca, 0xa7, 0x41, 0x20, 0xca, 0x8f, 0x08, 0x04, 0xe2, 0xe1, 0x9a, 0xeb, 0x0d, 0xec, 0x88, 0x91, + 0x02, 0xf2, 0x7f, 0xa6, 0x44, 0x2e, 0x0c, 0x57, 0x58, 0xec, 0x6f, 0x45, 0xf3, 0x9d, 0x74, 0x91, + 0x34, 0xf1, 0x23, 0x9e, 0xe0, 0xa6, 0xbb, 0x14, 0x09, 0xb2, 0xbc, 0x08, 0x01, 0xd1, 0x73, 0x93, + 0xed, 0xf8, 0xca, 0x3d, 0x2f, 0x4e, 0x04, 0xe0, 0xe6, 0x34, 0xbf, 0x7c, 0x96, 0xa9, 0x60, 0x70, + 0xa0, 0x38, 0xf6, 0x6b, 0x11, 0x81, 0x85, 0x78, 0x26, 0x7e, 0x4c, 0x7e, 0x42, 0x42, 0x80, 0x1b, + 0x24, 0xc8, 0xf2, 0xa2, 0x38, 0xe6, 0xde, 0xc0, 0x2b, 0x5a, 0xd1, 0x88, 0x13, 0x2b, 0x2a, 0x15, + 0x0c, 0x8e, 0x2c, 0x32, 0x46, 0xf5, 0x60, 0x64, 0x0c, 0xe7, 0xd3, 0x65, 0x72, 0x7e, 0xa8, 0xc2, + 0x3b, 0xda, 0x32, 0xf5, 0xf8, 0xa1, 0x53, 0x3c, 0xe4, 0x0c, 0x3b, 0x1c, 0xaa, 0xc1, 0x3a, 0x39, + 0x2b, 0x5e, 0x0c, 0x98, 0x8f, 0x5a, 0xdb, 0xde, 0x2e, 0xc2, 0xc0, 0xf6, 0xc2, 0xb8, 0x3e, 0x96, + 0x0e, 0x6a, 0xb8, 0x92, 0xc3, 0x03, 0xb9, 0x39, 0x9d, 0xbf, 0x5f, 0xce, 0x1f, 0xbb, 0x02, 0x03, + 0xe1, 0xe1, 0xe1, 0xa2, 0x1e, 0xbf, 0x1e, 0x1a, 0x80, 0x3d, 0xa8, 0x1c, 0x02, 0xf6, 0x20, 0xd3, + 0xbd, 0xd5, 0x11, 0xbb, 0xb7, 0xf8, 0x0e, 0xfb, 0xf9, 0xea, 0xd0, 0x0e, 0xc3, 0x43, 0xfc, 0x48, + 0x97, 0x37, 0x8b, 0xe4, 0xb4, 0x17, 0xb0, 0xb2, 0x9b, 0xfd, 0x4d, 0x81, 0x13, 0xc9, 0x71, 0xd1, + 0x55, 0x24, 0xdc, 0x72, 0x86, 0x0e, 0x03, 0x39, 0x1e, 0x43, 0x60, 0x8b, 0x87, 0xec, 0xa4, 0xc3, + 0xed, 0x2e, 0x6b, 0xe4, 0x9c, 0x6c, 0x8a, 0x6d, 0x37, 0xa2, 0x6d, 0xa1, 0x10, 0xc4, 0x22, 0xf6, + 0xf1, 0x3c, 0x8f, 0x9f, 0xcc, 0x61, 0x80, 0xfc, 0x7c, 0xd8, 0x65, 0x49, 0xd8, 0xf3, 0x5a, 0xf5, + 0x5a, 0xba, 0xcb, 0x36, 0x30, 0x11, 0x38, 0x4d, 0xef, 0x69, 0x13, 0x27, 0xb2, 0xa7, 0xf1, 0xf0, + 0xa9, 0x9c, 0x81, 0x4b, 0xb2, 0xe1, 0x53, 0x79, 0x03, 0x37, 0x2f, 0xa7, 0xf3, 0x21, 0x32, 0xa1, + 0x7a, 0x90, 0x47, 0xb6, 0xa8, 0x89, 0x38, 0x10, 0xd9, 0xa2, 0x66, 0xa1, 0xc1, 0x65, 0x3f, 0xcb, + 0x8f, 0x67, 0x99, 0x15, 0x05, 0xbf, 0x00, 0xd3, 0x9d, 0x77, 0x91, 0x29, 0x65, 0xad, 0x15, 0x30, + 0x03, 0x3b, 0x74, 0x6f, 0x79, 0x31, 0x3b, 0x13, 0xae, 0x63, 0x22, 0x70, 0x9a, 0xf3, 0x67, 0x25, + 0x92, 0x79, 0xcd, 0x19, 0x91, 0xfe, 0xf1, 0x35, 0x6a, 0x96, 0x58, 0x0c, 0xd2, 0xff, 0xa2, 0x2c, + 0x4e, 0xdf, 0x6a, 0xaa, 0x24, 0xd0, 0xc2, 0xec, 0x8f, 0x72, 0x24, 0x7d, 0x21, 0xba, 0x54, 0x04, + 0x5c, 0x4a, 0x53, 0x95, 0x67, 0x34, 0xaf, 0x4a, 0x03, 0x43, 0x9e, 0x9d, 0x90, 0x89, 0x6d, 0xf9, + 0x6a, 0x75, 0x31, 0x4b, 0xb2, 0x7a, 0x04, 0x9b, 0x2b, 0xa6, 0xea, 0x27, 0x68, 0x41, 0xce, 0xcf, + 0x97, 0xc9, 0xd9, 0x74, 0x07, 0x88, 0x5b, 0xe8, 0x9f, 0xb5, 0xc8, 0x53, 0xbe, 0x1b, 0x27, 0xcd, + 0x3e, 0x3b, 0x1e, 0x6d, 0xf5, 0xfd, 0xb5, 0xcc, 0xfb, 0x0b, 0x47, 0x35, 0x31, 0xa9, 0x82, 0xb3, + 0xaf, 0x9c, 0x37, 0x9e, 0xc6, 0x18, 0xd4, 0x95, 0x7c, 0xe1, 0x30, 0xac, 0x56, 0x68, 0x97, 0x3b, + 0xdd, 0xea, 0x47, 0x11, 0x0d, 0x12, 0x5d, 0x55, 0xde, 0x8b, 0x37, 0x0a, 0x69, 0x48, 0x5d, 0xc1, + 0xb3, 0xb8, 0x44, 0x2f, 0x64, 0x64, 0xc1, 0x80, 0x74, 0x8c, 0xb8, 0xc5, 0xda, 0x2e, 0x84, 0xdd, + 0x1e, 0x2e, 0x39, 0x8b, 0xd1, 0x9e, 0xc2, 0xc5, 0xe1, 0xcb, 0xb6, 0x8a, 0xb8, 0x5d, 0xc9, 0x67, + 0x83, 0x61, 0xf9, 0x9d, 0x8f, 0x91, 0x99, 0x8c, 0xe9, 0xdf, 0xde, 0x21, 0xe5, 0x8e, 0x32, 0xe2, + 0xaf, 0x17, 0x7a, 0xed, 0xb0, 0xe4, 0x25, 0x8d, 0x71, 0x9c, 0xee, 0x4b, 0x5e, 0x02, 0x28, 0xc5, + 0xf9, 0x49, 0x8b, 0x5c, 0x18, 0x7e, 0x37, 0x81, 0xef, 0xcb, 0x8e, 0xb5, 0xf0, 0xb7, 0x34, 0xbb, + 0x7c, 0xe0, 0xb8, 0xae, 0x41, 0x98, 0x6f, 0xa6, 0xb2, 0x9e, 0x30, 0x42, 0x0c, 0x42, 0xb6, 0xe3, + 0x93, 0x8b, 0xfb, 0xe7, 0x1c, 0x21, 0x7c, 0x07, 0xe1, 0xa6, 0xa3, 0x70, 0xd3, 0x97, 0x01, 0x5b, + 0x12, 0x6e, 0x5a, 0xa4, 0x81, 0xa2, 0x3a, 0x3f, 0x6c, 0x11, 0x7b, 0xb0, 0xe1, 0xd0, 0x21, 0x57, + 0x03, 0x56, 0x5b, 0x45, 0x84, 0xcc, 0x0c, 0x0a, 0x61, 0xe0, 0xd7, 0x7b, 0xc3, 0x80, 0xb0, 0x9d, + 0x1f, 0x2c, 0x91, 0xfa, 0xb0, 0x4c, 0xf6, 0x77, 0xe2, 0xab, 0x32, 0xbd, 0x50, 0xd6, 0xed, 0x95, + 0xe3, 0xa9, 0x1b, 0xee, 0x42, 0xe6, 0x23, 0x33, 0xb8, 0x53, 0x71, 0xb9, 0x76, 0x42, 0xca, 0x9d, + 0x5e, 0x47, 0xcc, 0xd5, 0xf7, 0x1d, 0x8f, 0xf8, 0xa5, 0xf5, 0x25, 0x31, 0x82, 0xd7, 0x97, 0x00, + 0xc5, 0xe1, 0xab, 0xda, 0x4f, 0xef, 0xc3, 0x6d, 0x2f, 0x90, 0x4a, 0x37, 0x6c, 0xcb, 0x91, 0x71, + 0x59, 0x8e, 0x8c, 0xd5, 0xb0, 0x8d, 0xfe, 0x42, 0xb3, 0xfb, 0x64, 0x5d, 0x65, 0x6f, 0x82, 0x63, + 0x66, 0xbc, 0x29, 0xdd, 0xc1, 0x77, 0xea, 0x8c, 0x9b, 0x52, 0xf6, 0x44, 0x1d, 0x4b, 0x75, 0xbe, + 0x95, 0x3c, 0xb3, 0x5f, 0x73, 0x1d, 0x80, 0x6d, 0xe5, 0x7c, 0x2f, 0x1e, 0x7c, 0x87, 0x2e, 0xa3, + 0x68, 0x62, 0xc4, 0xcd, 0xed, 0xda, 0xbc, 0x38, 0x15, 0xaa, 0x49, 0xb2, 0xc8, 0x52, 0x41, 0x50, + 0x51, 0x6d, 0x13, 0x1b, 0x42, 0x1b, 0x99, 0xc7, 0xd2, 0xe6, 0xba, 0x6b, 0x9a, 0x04, 0x26, 0x9f, + 0xfd, 0x59, 0x8b, 0x4c, 0xc7, 0xa9, 0xad, 0xa3, 0x3e, 0x5e, 0xc4, 0xfd, 0x61, 0x7a, 0x3b, 0xd2, + 0xa0, 0x0c, 0xe9, 0x74, 0xc8, 0xc8, 0x76, 0xfe, 0x70, 0x8c, 0x9c, 0x4a, 0x3d, 0x5c, 0x93, 0xf2, + 0xf6, 0xb0, 0x0e, 0xf4, 0xf6, 0x60, 0xf0, 0x02, 0xfd, 0x40, 0xbe, 0x15, 0x67, 0xc0, 0x0b, 0xf4, + 0x03, 0x7c, 0x98, 0x07, 0xff, 0x88, 0x26, 0x85, 0x7e, 0x20, 0xdc, 0x4f, 0xcc, 0x26, 0x85, 0x7e, + 0x00, 0x82, 0x8a, 0x53, 0x7e, 0x8a, 0xed, 0xed, 0xc2, 0xad, 0xa6, 0x5e, 0x29, 0xc2, 0x97, 0xa9, + 0x69, 0x94, 0xc8, 0x63, 0x12, 0xcc, 0x14, 0x48, 0x49, 0xc4, 0x15, 0x78, 0x42, 0x3a, 0x76, 0xcb, + 0xcb, 0xf1, 0x66, 0xb1, 0xef, 0x02, 0x65, 0x94, 0x2a, 0x99, 0xc2, 0x7c, 0x27, 0xc4, 0xbf, 0xf8, + 0xba, 0x39, 0xff, 0x57, 0x0c, 0x8e, 0xc2, 0x7d, 0x3c, 0x48, 0x8e, 0x13, 0x0b, 0x3e, 0x11, 0x29, + 0x82, 0xf5, 0xb9, 0x6f, 0x89, 0x7c, 0x22, 0x52, 0x26, 0x82, 0xa6, 0xa3, 0x05, 0x25, 0x66, 0x1f, + 0x96, 0x18, 0xce, 0x20, 0xcc, 0x82, 0xd2, 0xd4, 0xc9, 0x60, 0xf2, 0x98, 0x9e, 0x2b, 0xe4, 0x91, + 0x7a, 0xae, 0x4c, 0x1e, 0xe0, 0xb9, 0xd2, 0x24, 0xe7, 0xdc, 0x7e, 0x12, 0xa2, 0xcb, 0xdb, 0x7c, + 0x82, 0x77, 0x53, 0x49, 0xcc, 0xdf, 0x3a, 0x9a, 0x62, 0xf7, 0x6a, 0xca, 0x8b, 0xba, 0x49, 0xfd, + 0xad, 0x01, 0x26, 0xc8, 0xcf, 0xeb, 0xfc, 0x03, 0x8b, 0x9c, 0xcb, 0x1d, 0x0a, 0x8f, 0x6f, 0xfc, + 0x9a, 0xf3, 0xf9, 0x2a, 0x79, 0x22, 0xe7, 0x59, 0x2b, 0x74, 0x0f, 0xd5, 0x93, 0xc4, 0x2a, 0xc2, + 0x15, 0x3c, 0xed, 0xd9, 0x2c, 0xfb, 0x26, 0x67, 0x66, 0x1c, 0xce, 0x19, 0x4d, 0x3b, 0x84, 0x95, + 0x4f, 0xd6, 0x21, 0xcc, 0x18, 0xeb, 0x95, 0x47, 0x3a, 0xd6, 0xab, 0x07, 0x8c, 0xf5, 0x9f, 0xb3, + 0x48, 0xbd, 0x3b, 0xe4, 0xfd, 0x6a, 0x71, 0x49, 0x7f, 0xeb, 0x78, 0x5e, 0xc7, 0x6e, 0x3c, 0x83, + 0xd8, 0x2a, 0xc3, 0xa8, 0x30, 0xb4, 0x56, 0xce, 0x97, 0xcb, 0x84, 0x1d, 0x07, 0x85, 0x22, 0xf6, + 0x31, 0xf3, 0xa1, 0x3c, 0xab, 0xa8, 0x97, 0xdc, 0x78, 0xe1, 0xea, 0xa1, 0x3d, 0xde, 0x82, 0x79, + 0xef, 0xee, 0x65, 0x57, 0xc2, 0xd2, 0x08, 0x2b, 0xa1, 0x2f, 0x5f, 0x24, 0x2c, 0x17, 0xff, 0x22, + 0xe1, 0x44, 0xf6, 0x35, 0xc2, 0xfd, 0xbb, 0xb8, 0xf2, 0x58, 0x76, 0xf1, 0x3f, 0xb1, 0xc8, 0x13, + 0x39, 0xbd, 0x80, 0xaf, 0xc6, 0x71, 0x75, 0x83, 0xbf, 0x5a, 0x36, 0x31, 0xa0, 0x6a, 0x3c, 0x4f, + 0x6a, 0xb1, 0x58, 0x95, 0x85, 0x4a, 0xc2, 0x94, 0x7b, 0xb9, 0x52, 0x83, 0xa2, 0xe2, 0x95, 0x81, + 0xeb, 0xfb, 0xe1, 0xdd, 0x2b, 0xdd, 0x5e, 0xb2, 0x27, 0x15, 0x13, 0xb4, 0x34, 0xcc, 0xab, 0x54, + 0x30, 0x38, 0xec, 0xb7, 0x90, 0x71, 0x0e, 0x4d, 0xd5, 0x16, 0x66, 0xf2, 0x49, 0xf6, 0x26, 0x2e, + 0x4f, 0x02, 0x49, 0x73, 0x3e, 0x6f, 0x11, 0xc3, 0x56, 0x81, 0xa6, 0x68, 0x13, 0x1f, 0x3b, 0x6b, + 0x8a, 0x36, 0xe1, 0xb4, 0x21, 0xc5, 0xa9, 0x5e, 0xea, 0x2d, 0xed, 0xf7, 0x52, 0xaf, 0x7c, 0x6d, + 0xb7, 0xbc, 0xff, 0x6b, 0xbb, 0xce, 0xdf, 0x28, 0x89, 0x5a, 0x71, 0x33, 0x85, 0xf6, 0x33, 0xb7, + 0x0e, 0xe9, 0x67, 0xfe, 0x51, 0x42, 0x5a, 0xe2, 0x5c, 0xbd, 0x11, 0x16, 0x63, 0xed, 0x59, 0x50, + 0xe5, 0x69, 0x6b, 0x8f, 0x4e, 0x03, 0x43, 0x5e, 0x6a, 0xf1, 0x2f, 0x1f, 0xb8, 0xf8, 0xa7, 0xd6, + 0xc1, 0xca, 0xfe, 0xeb, 0xa0, 0xf3, 0xc7, 0x16, 0x49, 0xe9, 0x85, 0xf8, 0x6a, 0x28, 0x56, 0x77, + 0x4f, 0x2c, 0x29, 0x6b, 0xc5, 0x29, 0xa1, 0xb8, 0x96, 0x8b, 0x79, 0xca, 0xfe, 0x05, 0x2e, 0xc8, + 0xf6, 0x85, 0x4f, 0x7d, 0x21, 0xd6, 0x17, 0x53, 0x20, 0x7a, 0xe5, 0xf3, 0x53, 0x94, 0xf6, 0xcf, + 0x77, 0x5e, 0x24, 0x67, 0x06, 0x2a, 0x85, 0xaa, 0x08, 0x43, 0xd5, 0x12, 0xf3, 0x4b, 0x3f, 0x58, + 0x8c, 0x89, 0xc0, 0x69, 0xce, 0xcf, 0x58, 0xe4, 0x74, 0xb6, 0x78, 0x74, 0x98, 0x39, 0x13, 0x67, + 0xcb, 0x3b, 0xae, 0xb6, 0x53, 0x71, 0x76, 0x03, 0x24, 0x18, 0xac, 0x84, 0xf3, 0x47, 0x16, 0x99, + 0xd1, 0x18, 0x79, 0xcc, 0x88, 0x9c, 0xb2, 0x9e, 0x5b, 0x07, 0x5a, 0xcf, 0xd3, 0x90, 0x46, 0xa5, + 0x91, 0x20, 0x8d, 0x4c, 0xb4, 0xa1, 0xf2, 0xbe, 0x68, 0x43, 0x6f, 0x21, 0xe3, 0x3b, 0x74, 0xcf, + 0x80, 0x25, 0x62, 0x2b, 0xcb, 0x75, 0x9e, 0x04, 0x92, 0x86, 0x81, 0x31, 0x2d, 0x57, 0xe1, 0x1d, + 0x4f, 0x09, 0x17, 0xd1, 0x79, 0xc6, 0x24, 0x28, 0xce, 0x1a, 0x99, 0x50, 0xbe, 0x35, 0xd2, 0xf4, + 0x6c, 0xe5, 0x9b, 0x9e, 0xb1, 0xaf, 0x0d, 0x37, 0x21, 0xdd, 0xd7, 0xcc, 0xb9, 0x48, 0x78, 0x0d, + 0x35, 0x36, 0x7f, 0xfd, 0x2b, 0x17, 0xdf, 0xf4, 0x5b, 0x5f, 0xb9, 0xf8, 0xa6, 0xdf, 0xfb, 0xca, + 0xc5, 0x37, 0x7d, 0xfc, 0xc1, 0x45, 0xeb, 0xd7, 0x1f, 0x5c, 0xb4, 0x7e, 0xeb, 0xc1, 0x45, 0xeb, + 0xf7, 0x1e, 0x5c, 0xb4, 0xbe, 0xfc, 0xe0, 0xa2, 0xf5, 0xb9, 0xff, 0x72, 0xf1, 0x4d, 0xaf, 0x7c, + 0xcb, 0x7e, 0x61, 0x40, 0x22, 0xf0, 0x07, 0xfb, 0xf7, 0xb2, 0xd1, 0xbf, 0x97, 0x65, 0xff, 0xfe, + 0xbf, 0x01, 0x00, 0x49, 0x60, 0xa2, 0x29, 0x92, 0x17, 0x01, 0x00, } func (m *AWSAuthConfig) Marshal() (dAtA []byte, err error) { @@ -6949,6 +7042,18 @@ func (m *ApplicationSetGenerator) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l + if m.Oci != nil { + { + size, err := m.Oci.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } if m.Plugin != nil { { size, err := m.Plugin.MarshalToSizedBuffer(dAtA[:i]) @@ -7139,6 +7244,18 @@ func (m *ApplicationSetNestedGenerator) MarshalToSizedBuffer(dAtA []byte) (int, _ = i var l int _ = l + if m.Oci != nil { + { + size, err := m.Oci.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + } if m.Plugin != nil { { size, err := m.Plugin.MarshalToSizedBuffer(dAtA[:i]) @@ -7837,6 +7954,18 @@ func (m *ApplicationSetTerminalGenerator) MarshalToSizedBuffer(dAtA []byte) (int _ = i var l int _ = l + if m.Oci != nil { + { + size, err := m.Oci.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } if m.Selector != nil { { size, err := m.Selector.MarshalToSizedBuffer(dAtA[:i]) @@ -8137,6 +8266,14 @@ func (m *ApplicationSourceDirectory) MarshalToSizedBuffer(dAtA []byte) (int, err _ = i var l int _ = l + i-- + if m.DisableExtensionFilter { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 i -= len(m.Include) copy(dAtA[i:], m.Include) i = encodeVarintGenerated(dAtA, i, uint64(len(m.Include))) @@ -9345,6 +9482,11 @@ func (m *Cluster) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.ConfigHash != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.ConfigHash)) + i-- + dAtA[i] = 0x70 + } if len(m.Annotations) > 0 { keysForAnnotations := make([]string, 0, len(m.Annotations)) for k := range m.Annotations { @@ -11167,6 +11309,105 @@ func (m *InfoItem) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *InlineSyncWindow) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *InlineSyncWindow) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InlineSyncWindow) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.SyncOverrun { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x52 + i-- + if m.UseAndOperator { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + i -= len(m.TimeZone) + copy(dAtA[i:], m.TimeZone) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.TimeZone))) + i-- + dAtA[i] = 0x42 + i-- + if m.ManualSync { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x38 + if len(m.Clusters) > 0 { + for iNdEx := len(m.Clusters) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Clusters[iNdEx]) + copy(dAtA[i:], m.Clusters[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Clusters[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(m.Namespaces) > 0 { + for iNdEx := len(m.Namespaces) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Namespaces[iNdEx]) + copy(dAtA[i:], m.Namespaces[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespaces[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if len(m.Applications) > 0 { + for iNdEx := len(m.Applications) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Applications[iNdEx]) + copy(dAtA[i:], m.Applications[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Applications[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + i -= len(m.Duration) + copy(dAtA[i:], m.Duration) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Duration))) + i-- + dAtA[i] = 0x1a + i -= len(m.Schedule) + copy(dAtA[i:], m.Schedule) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Schedule))) + i-- + dAtA[i] = 0x12 + i -= len(m.Kind) + copy(dAtA[i:], m.Kind) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Kind))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *JWTToken) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -11998,6 +12239,183 @@ func (m *OCIMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *OciDirectoryGeneratorItem) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OciDirectoryGeneratorItem) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OciDirectoryGeneratorItem) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.Exclude { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *OciFileGeneratorItem) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OciFileGeneratorItem) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OciFileGeneratorItem) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + i-- + if m.Exclude { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + i -= len(m.Path) + copy(dAtA[i:], m.Path) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Path))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *OciGenerator) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *OciGenerator) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *OciGenerator) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Values) > 0 { + keysForValues := make([]string, 0, len(m.Values)) + for k := range m.Values { + keysForValues = append(keysForValues, string(k)) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForValues) + for iNdEx := len(keysForValues) - 1; iNdEx >= 0; iNdEx-- { + v := m.Values[string(keysForValues[iNdEx])] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintGenerated(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(keysForValues[iNdEx]) + copy(dAtA[i:], keysForValues[iNdEx]) + i = encodeVarintGenerated(dAtA, i, uint64(len(keysForValues[iNdEx]))) + i-- + dAtA[i] = 0xa + i = encodeVarintGenerated(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x42 + } + } + i -= len(m.PathParamPrefix) + copy(dAtA[i:], m.PathParamPrefix) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.PathParamPrefix))) + i-- + dAtA[i] = 0x3a + { + size, err := m.Template.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + if m.RequeueAfterSeconds != nil { + i = encodeVarintGenerated(dAtA, i, uint64(*m.RequeueAfterSeconds)) + i-- + dAtA[i] = 0x28 + } + i -= len(m.Revision) + copy(dAtA[i:], m.Revision) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.Revision))) + i-- + dAtA[i] = 0x22 + if len(m.Files) > 0 { + for iNdEx := len(m.Files) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Files[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Directories) > 0 { + for iNdEx := len(m.Directories) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Directories[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenerated(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + i -= len(m.RepoURL) + copy(dAtA[i:], m.RepoURL) + i = encodeVarintGenerated(dAtA, i, uint64(len(m.RepoURL))) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + func (m *Operation) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -16774,105 +17192,6 @@ func (m *SyncStrategyHook) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *SyncWindow) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *SyncWindow) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *SyncWindow) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - i-- - if m.SyncOverrun { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x58 - i -= len(m.Description) - copy(dAtA[i:], m.Description) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Description))) - i-- - dAtA[i] = 0x52 - i-- - if m.UseAndOperator { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x48 - i -= len(m.TimeZone) - copy(dAtA[i:], m.TimeZone) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.TimeZone))) - i-- - dAtA[i] = 0x42 - i-- - if m.ManualSync { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i-- - dAtA[i] = 0x38 - if len(m.Clusters) > 0 { - for iNdEx := len(m.Clusters) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Clusters[iNdEx]) - copy(dAtA[i:], m.Clusters[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Clusters[iNdEx]))) - i-- - dAtA[i] = 0x32 - } - } - if len(m.Namespaces) > 0 { - for iNdEx := len(m.Namespaces) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Namespaces[iNdEx]) - copy(dAtA[i:], m.Namespaces[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Namespaces[iNdEx]))) - i-- - dAtA[i] = 0x2a - } - } - if len(m.Applications) > 0 { - for iNdEx := len(m.Applications) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Applications[iNdEx]) - copy(dAtA[i:], m.Applications[iNdEx]) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Applications[iNdEx]))) - i-- - dAtA[i] = 0x22 - } - } - i -= len(m.Duration) - copy(dAtA[i:], m.Duration) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Duration))) - i-- - dAtA[i] = 0x1a - i -= len(m.Schedule) - copy(dAtA[i:], m.Schedule) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Schedule))) - i-- - dAtA[i] = 0x12 - i -= len(m.Kind) - copy(dAtA[i:], m.Kind) - i = encodeVarintGenerated(dAtA, i, uint64(len(m.Kind))) - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - func (m *TLSClientConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -17374,6 +17693,10 @@ func (m *ApplicationSetGenerator) Size() (n int) { l = m.Plugin.Size() n += 1 + l + sovGenerated(uint64(l)) } + if m.Oci != nil { + l = m.Oci.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -17440,6 +17763,10 @@ func (m *ApplicationSetNestedGenerator) Size() (n int) { l = m.Plugin.Size() n += 1 + l + sovGenerated(uint64(l)) } + if m.Oci != nil { + l = m.Oci.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -17694,6 +18021,10 @@ func (m *ApplicationSetTerminalGenerator) Size() (n int) { l = m.Selector.Size() n += 1 + l + sovGenerated(uint64(l)) } + if m.Oci != nil { + l = m.Oci.Size() + n += 1 + l + sovGenerated(uint64(l)) + } return n } @@ -17777,6 +18108,7 @@ func (m *ApplicationSourceDirectory) Size() (n int) { n += 1 + l + sovGenerated(uint64(l)) l = len(m.Include) n += 1 + l + sovGenerated(uint64(l)) + n += 2 return n } @@ -18270,6 +18602,9 @@ func (m *Cluster) Size() (n int) { n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) } } + if m.ConfigHash != nil { + n += 1 + sovGenerated(uint64(*m.ConfigHash)) + } return n } @@ -18892,6 +19227,46 @@ func (m *InfoItem) Size() (n int) { return n } +func (m *InlineSyncWindow) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Kind) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Schedule) + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.Duration) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Applications) > 0 { + for _, s := range m.Applications { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Namespaces) > 0 { + for _, s := range m.Namespaces { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Clusters) > 0 { + for _, s := range m.Clusters { + l = len(s) + n += 1 + l + sovGenerated(uint64(l)) + } + } + n += 2 + l = len(m.TimeZone) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + l = len(m.Description) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + return n +} + func (m *JWTToken) Size() (n int) { if m == nil { return 0 @@ -19207,6 +19582,70 @@ func (m *OCIMetadata) Size() (n int) { return n } +func (m *OciDirectoryGeneratorItem) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Path) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + return n +} + +func (m *OciFileGeneratorItem) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Path) + n += 1 + l + sovGenerated(uint64(l)) + n += 2 + return n +} + +func (m *OciGenerator) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RepoURL) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Directories) > 0 { + for _, e := range m.Directories { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + if len(m.Files) > 0 { + for _, e := range m.Files { + l = e.Size() + n += 1 + l + sovGenerated(uint64(l)) + } + } + l = len(m.Revision) + n += 1 + l + sovGenerated(uint64(l)) + if m.RequeueAfterSeconds != nil { + n += 1 + sovGenerated(uint64(*m.RequeueAfterSeconds)) + } + l = m.Template.Size() + n += 1 + l + sovGenerated(uint64(l)) + l = len(m.PathParamPrefix) + n += 1 + l + sovGenerated(uint64(l)) + if len(m.Values) > 0 { + for k, v := range m.Values { + _ = k + _ = v + mapEntrySize := 1 + len(k) + sovGenerated(uint64(len(k))) + 1 + len(v) + sovGenerated(uint64(len(v))) + n += mapEntrySize + 1 + sovGenerated(uint64(mapEntrySize)) + } + } + return n +} + func (m *Operation) Size() (n int) { if m == nil { return 0 @@ -20955,46 +21394,6 @@ func (m *SyncStrategyHook) Size() (n int) { return n } -func (m *SyncWindow) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Kind) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Schedule) - n += 1 + l + sovGenerated(uint64(l)) - l = len(m.Duration) - n += 1 + l + sovGenerated(uint64(l)) - if len(m.Applications) > 0 { - for _, s := range m.Applications { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } - if len(m.Namespaces) > 0 { - for _, s := range m.Namespaces { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } - if len(m.Clusters) > 0 { - for _, s := range m.Clusters { - l = len(s) - n += 1 + l + sovGenerated(uint64(l)) - } - } - n += 2 - l = len(m.TimeZone) - n += 1 + l + sovGenerated(uint64(l)) - n += 2 - l = len(m.Description) - n += 1 + l + sovGenerated(uint64(l)) - n += 2 - return n -} - func (m *TLSClientConfig) Size() (n int) { if m == nil { return 0 @@ -21114,9 +21513,9 @@ func (this *AppProjectSpec) String() string { repeatedStringForNamespaceResourceBlacklist += fmt.Sprintf("%v", f) + "," } repeatedStringForNamespaceResourceBlacklist += "}" - repeatedStringForSyncWindows := "[]*SyncWindow{" + repeatedStringForSyncWindows := "[]*InlineSyncWindow{" for _, f := range this.SyncWindows { - repeatedStringForSyncWindows += strings.Replace(f.String(), "SyncWindow", "SyncWindow", 1) + "," + repeatedStringForSyncWindows += strings.Replace(f.String(), "InlineSyncWindow", "InlineSyncWindow", 1) + "," } repeatedStringForSyncWindows += "}" repeatedStringForNamespaceResourceWhitelist := "[]GroupKind{" @@ -21323,6 +21722,7 @@ func (this *ApplicationSetGenerator) String() string { `Merge:` + strings.Replace(this.Merge.String(), "MergeGenerator", "MergeGenerator", 1) + `,`, `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "v1.LabelSelector", 1) + `,`, `Plugin:` + strings.Replace(this.Plugin.String(), "PluginGenerator", "PluginGenerator", 1) + `,`, + `Oci:` + strings.Replace(this.Oci.String(), "OciGenerator", "OciGenerator", 1) + `,`, `}`, }, "") return s @@ -21358,6 +21758,7 @@ func (this *ApplicationSetNestedGenerator) String() string { `Merge:` + strings.Replace(fmt.Sprintf("%v", this.Merge), "JSON", "v11.JSON", 1) + `,`, `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "v1.LabelSelector", 1) + `,`, `Plugin:` + strings.Replace(this.Plugin.String(), "PluginGenerator", "PluginGenerator", 1) + `,`, + `Oci:` + strings.Replace(this.Oci.String(), "OciGenerator", "OciGenerator", 1) + `,`, `}`, }, "") return s @@ -21544,6 +21945,7 @@ func (this *ApplicationSetTerminalGenerator) String() string { `PullRequest:` + strings.Replace(this.PullRequest.String(), "PullRequestGenerator", "PullRequestGenerator", 1) + `,`, `Plugin:` + strings.Replace(this.Plugin.String(), "PluginGenerator", "PluginGenerator", 1) + `,`, `Selector:` + strings.Replace(fmt.Sprintf("%v", this.Selector), "LabelSelector", "v1.LabelSelector", 1) + `,`, + `Oci:` + strings.Replace(this.Oci.String(), "OciGenerator", "OciGenerator", 1) + `,`, `}`, }, "") return s @@ -21603,6 +22005,7 @@ func (this *ApplicationSourceDirectory) String() string { `Jsonnet:` + strings.Replace(strings.Replace(this.Jsonnet.String(), "ApplicationSourceJsonnet", "ApplicationSourceJsonnet", 1), `&`, ``, 1) + `,`, `Exclude:` + fmt.Sprintf("%v", this.Exclude) + `,`, `Include:` + fmt.Sprintf("%v", this.Include) + `,`, + `DisableExtensionFilter:` + fmt.Sprintf("%v", this.DisableExtensionFilter) + `,`, `}`, }, "") return s @@ -21936,6 +22339,7 @@ func (this *Cluster) String() string { `Project:` + fmt.Sprintf("%v", this.Project) + `,`, `Labels:` + mapStringForLabels + `,`, `Annotations:` + mapStringForAnnotations + `,`, + `ConfigHash:` + valueToStringGenerated(this.ConfigHash) + `,`, `}`, }, "") return s @@ -22433,6 +22837,26 @@ func (this *InfoItem) String() string { }, "") return s } +func (this *InlineSyncWindow) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&InlineSyncWindow{`, + `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, + `Schedule:` + fmt.Sprintf("%v", this.Schedule) + `,`, + `Duration:` + fmt.Sprintf("%v", this.Duration) + `,`, + `Applications:` + fmt.Sprintf("%v", this.Applications) + `,`, + `Namespaces:` + fmt.Sprintf("%v", this.Namespaces) + `,`, + `Clusters:` + fmt.Sprintf("%v", this.Clusters) + `,`, + `ManualSync:` + fmt.Sprintf("%v", this.ManualSync) + `,`, + `TimeZone:` + fmt.Sprintf("%v", this.TimeZone) + `,`, + `UseAndOperator:` + fmt.Sprintf("%v", this.UseAndOperator) + `,`, + `Description:` + fmt.Sprintf("%v", this.Description) + `,`, + `SyncOverrun:` + fmt.Sprintf("%v", this.SyncOverrun) + `,`, + `}`, + }, "") + return s +} func (this *JWTToken) String() string { if this == nil { return "nil" @@ -22710,6 +23134,65 @@ func (this *OCIMetadata) String() string { }, "") return s } +func (this *OciDirectoryGeneratorItem) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&OciDirectoryGeneratorItem{`, + `Path:` + fmt.Sprintf("%v", this.Path) + `,`, + `Exclude:` + fmt.Sprintf("%v", this.Exclude) + `,`, + `}`, + }, "") + return s +} +func (this *OciFileGeneratorItem) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&OciFileGeneratorItem{`, + `Path:` + fmt.Sprintf("%v", this.Path) + `,`, + `Exclude:` + fmt.Sprintf("%v", this.Exclude) + `,`, + `}`, + }, "") + return s +} +func (this *OciGenerator) String() string { + if this == nil { + return "nil" + } + repeatedStringForDirectories := "[]OciDirectoryGeneratorItem{" + for _, f := range this.Directories { + repeatedStringForDirectories += strings.Replace(strings.Replace(f.String(), "OciDirectoryGeneratorItem", "OciDirectoryGeneratorItem", 1), `&`, ``, 1) + "," + } + repeatedStringForDirectories += "}" + repeatedStringForFiles := "[]OciFileGeneratorItem{" + for _, f := range this.Files { + repeatedStringForFiles += strings.Replace(strings.Replace(f.String(), "OciFileGeneratorItem", "OciFileGeneratorItem", 1), `&`, ``, 1) + "," + } + repeatedStringForFiles += "}" + keysForValues := make([]string, 0, len(this.Values)) + for k := range this.Values { + keysForValues = append(keysForValues, k) + } + github_com_gogo_protobuf_sortkeys.Strings(keysForValues) + mapStringForValues := "map[string]string{" + for _, k := range keysForValues { + mapStringForValues += fmt.Sprintf("%v: %v,", k, this.Values[k]) + } + mapStringForValues += "}" + s := strings.Join([]string{`&OciGenerator{`, + `RepoURL:` + fmt.Sprintf("%v", this.RepoURL) + `,`, + `Directories:` + repeatedStringForDirectories + `,`, + `Files:` + repeatedStringForFiles + `,`, + `Revision:` + fmt.Sprintf("%v", this.Revision) + `,`, + `RequeueAfterSeconds:` + valueToStringGenerated(this.RequeueAfterSeconds) + `,`, + `Template:` + strings.Replace(strings.Replace(this.Template.String(), "ApplicationSetTemplate", "ApplicationSetTemplate", 1), `&`, ``, 1) + `,`, + `PathParamPrefix:` + fmt.Sprintf("%v", this.PathParamPrefix) + `,`, + `Values:` + mapStringForValues + `,`, + `}`, + }, "") + return s +} func (this *Operation) String() string { if this == nil { return "nil" @@ -23943,26 +24426,6 @@ func (this *SyncStrategyHook) String() string { }, "") return s } -func (this *SyncWindow) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&SyncWindow{`, - `Kind:` + fmt.Sprintf("%v", this.Kind) + `,`, - `Schedule:` + fmt.Sprintf("%v", this.Schedule) + `,`, - `Duration:` + fmt.Sprintf("%v", this.Duration) + `,`, - `Applications:` + fmt.Sprintf("%v", this.Applications) + `,`, - `Namespaces:` + fmt.Sprintf("%v", this.Namespaces) + `,`, - `Clusters:` + fmt.Sprintf("%v", this.Clusters) + `,`, - `ManualSync:` + fmt.Sprintf("%v", this.ManualSync) + `,`, - `TimeZone:` + fmt.Sprintf("%v", this.TimeZone) + `,`, - `UseAndOperator:` + fmt.Sprintf("%v", this.UseAndOperator) + `,`, - `Description:` + fmt.Sprintf("%v", this.Description) + `,`, - `SyncOverrun:` + fmt.Sprintf("%v", this.SyncOverrun) + `,`, - `}`, - }, "") - return s -} func (this *TLSClientConfig) String() string { if this == nil { return "nil" @@ -24201,7 +24664,7 @@ func (m *AppHealthStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Status = github_com_argoproj_argo_cd_gitops_engine_pkg_health.HealthStatusCode(dAtA[iNdEx:postIndex]) + m.Status = github_com_argoproj_argo_cd_gitops_engine_v3_pkg_health.HealthStatusCode(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -24852,7 +25315,7 @@ func (m *AppProjectSpec) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SyncWindows = append(m.SyncWindows, &SyncWindow{}) + m.SyncWindows = append(m.SyncWindows, &InlineSyncWindow{}) if err := m.SyncWindows[len(m.SyncWindows)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -27283,59 +27746,9 @@ func (m *ApplicationSetGenerator) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ApplicationSetList) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ApplicationSetList: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ApplicationSetList: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 11: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Oci", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -27362,41 +27775,10 @@ func (m *ApplicationSetList) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + if m.Oci == nil { + m.Oci = &OciGenerator{} } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Items = append(m.Items, ApplicationSet{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Oci.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -27421,7 +27803,7 @@ func (m *ApplicationSetList) Unmarshal(dAtA []byte) error { } return nil } -func (m *ApplicationSetNestedGenerator) Unmarshal(dAtA []byte) error { +func (m *ApplicationSetList) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -27444,15 +27826,15 @@ func (m *ApplicationSetNestedGenerator) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: ApplicationSetNestedGenerator: wiretype end group for non-group") + return fmt.Errorf("proto: ApplicationSetList: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: ApplicationSetNestedGenerator: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ApplicationSetList: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field List", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ListMeta", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -27479,124 +27861,241 @@ func (m *ApplicationSetNestedGenerator) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.List == nil { - m.List = &ListGenerator{} - } - if err := m.List.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.ListMeta.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Clusters", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Clusters == nil { - m.Clusters = &ClusterGenerator{} - } - if err := m.Clusters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Git", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.Git == nil { - m.Git = &GitGenerator{} - } - if err := m.Git.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SCMProvider", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.SCMProvider == nil { - m.SCMProvider = &SCMProviderGenerator{} - } - if err := m.SCMProvider.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ClusterDecisionResource", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Items = append(m.Items, ApplicationSet{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ApplicationSetNestedGenerator) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ApplicationSetNestedGenerator: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ApplicationSetNestedGenerator: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field List", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.List == nil { + m.List = &ListGenerator{} + } + if err := m.List.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Clusters", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Clusters == nil { + m.Clusters = &ClusterGenerator{} + } + if err := m.Clusters.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Git", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Git == nil { + m.Git = &GitGenerator{} + } + if err := m.Git.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SCMProvider", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SCMProvider == nil { + m.SCMProvider = &SCMProviderGenerator{} + } + if err := m.SCMProvider.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClusterDecisionResource", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -27810,6 +28309,42 @@ func (m *ApplicationSetNestedGenerator) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Oci", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Oci == nil { + m.Oci = &OciGenerator{} + } + if err := m.Oci.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -29835,6 +30370,42 @@ func (m *ApplicationSetTerminalGenerator) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Oci", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Oci == nil { + m.Oci = &OciGenerator{} + } + if err := m.Oci.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -30619,6 +31190,26 @@ func (m *ApplicationSourceDirectory) Unmarshal(dAtA []byte) error { } m.Include = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisableExtensionFilter", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.DisableExtensionFilter = bool(v != 0) default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -34826,6 +35417,26 @@ func (m *Cluster) Unmarshal(dAtA []byte) error { } m.Annotations[mapkey] = mapvalue iNdEx = postIndex + case 14: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ConfigHash", wireType) + } + var v uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ConfigHash = &v default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -39228,7 +39839,7 @@ func (m *HealthStatus) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Status = github_com_argoproj_argo_cd_gitops_engine_pkg_health.HealthStatusCode(dAtA[iNdEx:postIndex]) + m.Status = github_com_argoproj_argo_cd_gitops_engine_v3_pkg_health.HealthStatusCode(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -40654,7 +41265,7 @@ func (m *InfoItem) Unmarshal(dAtA []byte) error { } return nil } -func (m *JWTToken) Unmarshal(dAtA []byte) error { +func (m *InlineSyncWindow) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -40677,17 +41288,17 @@ func (m *JWTToken) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: JWTToken: wiretype end group for non-group") + return fmt.Errorf("proto: InlineSyncWindow: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: JWTToken: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: InlineSyncWindow: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field IssuedAt", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) } - m.IssuedAt = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -40697,16 +41308,29 @@ func (m *JWTToken) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.IssuedAt |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Kind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpiresAt", wireType) + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Schedule", wireType) } - m.ExpiresAt = 0 + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -40716,14 +41340,27 @@ func (m *JWTToken) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ExpiresAt |= int64(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Schedule = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -40751,63 +41388,13 @@ func (m *JWTToken) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ID = string(dAtA[iNdEx:postIndex]) + m.Duration = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *JWTTokens) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: JWTTokens: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: JWTTokens: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Applications", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -40817,79 +41404,59 @@ func (m *JWTTokens) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Items = append(m.Items, JWTToken{}) - if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.Applications = append(m.Applications, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Namespaces", wireType) } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *JsonnetVar) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated } - if iNdEx >= l { + if postIndex > l { return io.ErrUnexpectedEOF } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: JsonnetVar: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: JsonnetVar: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + m.Namespaces = append(m.Namespaces, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Clusters", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -40917,11 +41484,31 @@ func (m *JsonnetVar) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Name = string(dAtA[iNdEx:postIndex]) + m.Clusters = append(m.Clusters, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 2: + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ManualSync", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.ManualSync = bool(v != 0) + case 8: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TimeZone", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -40949,11 +41536,11 @@ func (m *JsonnetVar) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Value = string(dAtA[iNdEx:postIndex]) + m.TimeZone = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 9: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field UseAndOperator", wireType) } var v int for shift := uint(0); ; shift += 7 { @@ -40970,7 +41557,59 @@ func (m *JsonnetVar) Unmarshal(dAtA []byte) error { break } } - m.Code = bool(v != 0) + m.UseAndOperator = bool(v != 0) + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field SyncOverrun", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.SyncOverrun = bool(v != 0) default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -40992,7 +41631,7 @@ func (m *JsonnetVar) Unmarshal(dAtA []byte) error { } return nil } -func (m *KnownTypeField) Unmarshal(dAtA []byte) error { +func (m *JWTToken) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -41015,17 +41654,17 @@ func (m *KnownTypeField) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: KnownTypeField: wiretype end group for non-group") + return fmt.Errorf("proto: JWTToken: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: KnownTypeField: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: JWTToken: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Field", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IssuedAt", wireType) } - var stringLen uint64 + m.IssuedAt = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -41035,27 +41674,33 @@ func (m *KnownTypeField) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + m.IssuedAt |= int64(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpiresAt", wireType) } - if postIndex > l { - return io.ErrUnexpectedEOF + m.ExpiresAt = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExpiresAt |= int64(b&0x7F) << shift + if b < 0x80 { + break + } } - m.Field = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: + case 3: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -41083,7 +41728,7 @@ func (m *KnownTypeField) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Type = string(dAtA[iNdEx:postIndex]) + m.ID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -41106,7 +41751,7 @@ func (m *KnownTypeField) Unmarshal(dAtA []byte) error { } return nil } -func (m *KustomizeGvk) Unmarshal(dAtA []byte) error { +func (m *JWTTokens) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -41129,49 +41774,17 @@ func (m *KustomizeGvk) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: KustomizeGvk: wiretype end group for non-group") + return fmt.Errorf("proto: JWTTokens: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: KustomizeGvk: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: JWTTokens: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Group", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Group = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Items", wireType) } - var stringLen uint64 + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -41181,55 +41794,25 @@ func (m *KustomizeGvk) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - stringLen |= uint64(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - intStringLen := int(stringLen) - if intStringLen < 0 { + if msglen < 0 { return ErrInvalidLengthGenerated } - postIndex := iNdEx + intStringLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthGenerated } if postIndex > l { return io.ErrUnexpectedEOF } - m.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF + m.Items = append(m.Items, JWTToken{}) + if err := m.Items[len(m.Items)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } - m.Kind = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -41252,7 +41835,7 @@ func (m *KustomizeGvk) Unmarshal(dAtA []byte) error { } return nil } -func (m *KustomizeOptions) Unmarshal(dAtA []byte) error { +func (m *JsonnetVar) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -41275,15 +41858,15 @@ func (m *KustomizeOptions) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: KustomizeOptions: wiretype end group for non-group") + return fmt.Errorf("proto: JsonnetVar: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: KustomizeOptions: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: JsonnetVar: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BuildOptions", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -41311,11 +41894,11 @@ func (m *KustomizeOptions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.BuildOptions = string(dAtA[iNdEx:postIndex]) + m.Name = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field BinaryPath", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -41343,13 +41926,13 @@ func (m *KustomizeOptions) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.BinaryPath = string(dAtA[iNdEx:postIndex]) + m.Value = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Versions", wireType) + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) } - var msglen int + var v int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowGenerated @@ -41359,26 +41942,12 @@ func (m *KustomizeOptions) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + v |= int(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Versions = append(m.Versions, KustomizeVersion{}) - if err := m.Versions[len(m.Versions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex + m.Code = bool(v != 0) default: iNdEx = preIndex skippy, err := skipGenerated(dAtA[iNdEx:]) @@ -41400,7 +41969,7 @@ func (m *KustomizeOptions) Unmarshal(dAtA []byte) error { } return nil } -func (m *KustomizePatch) Unmarshal(dAtA []byte) error { +func (m *KnownTypeField) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -41423,15 +41992,423 @@ func (m *KustomizePatch) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: KustomizePatch: wiretype end group for non-group") + return fmt.Errorf("proto: KnownTypeField: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: KustomizePatch: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: KnownTypeField: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Field", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Field = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *KustomizeGvk) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: KustomizeGvk: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: KustomizeGvk: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Group", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Group = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Version", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Version = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Kind = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *KustomizeOptions) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: KustomizeOptions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: KustomizeOptions: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BuildOptions", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BuildOptions = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BinaryPath", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BinaryPath = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Versions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Versions = append(m.Versions, KustomizeVersion{}) + if err := m.Versions[len(m.Versions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *KustomizePatch) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: KustomizePatch: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: KustomizePatch: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -43413,6 +44390,604 @@ func (m *OCIMetadata) Unmarshal(dAtA []byte) error { } return nil } +func (m *OciDirectoryGeneratorItem) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OciDirectoryGeneratorItem: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OciDirectoryGeneratorItem: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Exclude", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Exclude = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OciFileGeneratorItem) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OciFileGeneratorItem: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OciFileGeneratorItem: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Path = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Exclude", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Exclude = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *OciGenerator) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: OciGenerator: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: OciGenerator: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RepoURL", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RepoURL = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Directories", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Directories = append(m.Directories, OciDirectoryGeneratorItem{}) + if err := m.Directories[len(m.Directories)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Files", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Files = append(m.Files, OciFileGeneratorItem{}) + if err := m.Files[len(m.Files)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Revision", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Revision = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RequeueAfterSeconds", wireType) + } + var v int64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.RequeueAfterSeconds = &v + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Template", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Template.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PathParamPrefix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PathParamPrefix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenerated + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenerated + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Values == nil { + m.Values = make(map[string]string) + } + var mapkey string + var mapvalue string + for iNdEx < postIndex { + entryPreIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + if fieldNum == 1 { + var stringLenmapkey uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapkey |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapkey := int(stringLenmapkey) + if intStringLenmapkey < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapkey := iNdEx + intStringLenmapkey + if postStringIndexmapkey < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapkey > l { + return io.ErrUnexpectedEOF + } + mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) + iNdEx = postStringIndexmapkey + } else if fieldNum == 2 { + var stringLenmapvalue uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenerated + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLenmapvalue |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLenmapvalue := int(stringLenmapvalue) + if intStringLenmapvalue < 0 { + return ErrInvalidLengthGenerated + } + postStringIndexmapvalue := iNdEx + intStringLenmapvalue + if postStringIndexmapvalue < 0 { + return ErrInvalidLengthGenerated + } + if postStringIndexmapvalue > l { + return io.ErrUnexpectedEOF + } + mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) + iNdEx = postStringIndexmapvalue + } else { + iNdEx = entryPreIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > postIndex { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + m.Values[mapkey] = mapvalue + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenerated(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenerated + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *Operation) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -43793,7 +45368,7 @@ func (m *OperationState) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Phase = github_com_argoproj_argo_cd_gitops_engine_pkg_sync_common.OperationPhase(dAtA[iNdEx:postIndex]) + m.Phase = github_com_argoproj_argo_cd_gitops_engine_v3_pkg_sync_common.OperationPhase(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { @@ -52522,7 +54097,7 @@ func (m *ResourceResult) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Status = github_com_argoproj_argo_cd_gitops_engine_pkg_sync_common.ResultCode(dAtA[iNdEx:postIndex]) + m.Status = github_com_argoproj_argo_cd_gitops_engine_v3_pkg_sync_common.ResultCode(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 7: if wireType != 2 { @@ -52586,7 +54161,7 @@ func (m *ResourceResult) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.HookType = github_com_argoproj_argo_cd_gitops_engine_pkg_sync_common.HookType(dAtA[iNdEx:postIndex]) + m.HookType = github_com_argoproj_argo_cd_gitops_engine_v3_pkg_sync_common.HookType(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 9: if wireType != 2 { @@ -52618,7 +54193,7 @@ func (m *ResourceResult) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.HookPhase = github_com_argoproj_argo_cd_gitops_engine_pkg_sync_common.OperationPhase(dAtA[iNdEx:postIndex]) + m.HookPhase = github_com_argoproj_argo_cd_gitops_engine_v3_pkg_sync_common.OperationPhase(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 10: if wireType != 2 { @@ -52650,7 +54225,7 @@ func (m *ResourceResult) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SyncPhase = github_com_argoproj_argo_cd_gitops_engine_pkg_sync_common.SyncPhase(dAtA[iNdEx:postIndex]) + m.SyncPhase = github_com_argoproj_argo_cd_gitops_engine_v3_pkg_sync_common.SyncPhase(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 11: if wireType != 2 { @@ -59236,372 +60811,6 @@ func (m *SyncStrategyHook) Unmarshal(dAtA []byte) error { } return nil } -func (m *SyncWindow) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: SyncWindow: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: SyncWindow: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Kind", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Kind = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Schedule", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Schedule = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Duration = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Applications", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Applications = append(m.Applications, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Namespaces", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Namespaces = append(m.Namespaces, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 6: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Clusters", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Clusters = append(m.Clusters, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 7: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ManualSync", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.ManualSync = bool(v != 0) - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TimeZone", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.TimeZone = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 9: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field UseAndOperator", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.UseAndOperator = bool(v != 0) - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Description", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthGenerated - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthGenerated - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Description = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 11: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field SyncOverrun", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenerated - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - m.SyncOverrun = bool(v != 0) - default: - iNdEx = preIndex - skippy, err := skipGenerated(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenerated - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *TLSClientConfig) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/generated.proto b/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/generated.proto index eec3b39a9..8801a1f9a 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/generated.proto +++ b/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/generated.proto @@ -33,8 +33,6 @@ message AppHealthStatus { optional string status = 1; // Message is a human-readable informational message describing the health status - // - // Deprecated: this field is not used and will be removed in a future release. optional string message = 2; // LastTransitionTime is the time the HealthStatus was set or updated @@ -92,7 +90,7 @@ message AppProjectSpec { optional OrphanedResourcesMonitorSettings orphanedResources = 7; // SyncWindows controls when syncs can be run for apps in this project - repeated SyncWindow syncWindows = 8; + repeated InlineSyncWindow syncWindows = 8; // NamespaceResourceWhitelist contains list of whitelisted namespace level resources repeated .k8s.io.apimachinery.pkg.apis.meta.v1.GroupKind namespaceResourceWhitelist = 9; @@ -284,6 +282,8 @@ message ApplicationSetGenerator { optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 9; optional PluginGenerator plugin = 10; + + optional OciGenerator oci = 11; } // ApplicationSetList contains a list of ApplicationSet @@ -320,6 +320,8 @@ message ApplicationSetNestedGenerator { optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 9; optional PluginGenerator plugin = 10; + + optional OciGenerator oci = 11; } // ApplicationSetResourceIgnoreDifferences configures how the ApplicationSet controller will ignore differences in live @@ -456,6 +458,8 @@ message ApplicationSetTerminalGenerator { // Selector allows to post-filter all generator. optional .k8s.io.apimachinery.pkg.apis.meta.v1.LabelSelector selector = 8; + + optional OciGenerator oci = 9; } // ApplicationSetTree holds nodes which belongs to the application @@ -534,6 +538,13 @@ message ApplicationSourceDirectory { // Include contains a glob pattern to match paths against that should be explicitly included during manifest generation optional string include = 4; + + // DisableExtensionFilter controls whether the built-in file-extension filter is skipped during + // manifest generation. When false (the default), only files with a .yaml, .yml, .json, or + // .jsonnet extension are considered as potential manifests. Set it to true to disable the filter + // so that files with custom extensions (e.g. *.yaml.sealed) can be matched by the include/exclude + // glob patterns instead. + optional bool disableExtensionFilter = 5; } // ApplicationSourceHelm holds helm specific options @@ -894,6 +905,9 @@ message Cluster { // Annotations for cluster secret metadata map annotations = 13; + + // ConfigHash is an opaque value which tracks changes to the desired configuration of a Cluster + optional uint64 configHash = 14; } // ClusterCacheInfo contains information about the cluster cache @@ -1343,6 +1357,44 @@ message InfoItem { optional string value = 2; } +// InlineSyncWindow contains the kind, time, duration and attributes that are used to assign the syncWindows to apps +message InlineSyncWindow { + // Kind defines if the window allows or blocks syncs + optional string kind = 1; + + // Schedule is the time the window will begin, specified in cron format + optional string schedule = 2; + + // Duration is the amount of time the sync window will be open + optional string duration = 3; + + // Applications contains a list of applications that the window will apply to + repeated string applications = 4; + + // Namespaces contains a list of namespaces that the window will apply to + repeated string namespaces = 5; + + // Clusters contains a list of clusters that the window will apply to + repeated string clusters = 6; + + // ManualSync enables manual syncs when they would otherwise be blocked + optional bool manualSync = 7; + + // TimeZone of the sync that will be applied to the schedule + optional string timeZone = 8; + + // UseAndOperator use AND operator for matching applications, namespaces and clusters instead of the default OR operator + optional bool andOperator = 9; + + // Description of the sync that will be applied to the schedule, can be used to add any information such as a ticket number for example + optional string description = 10; + + // SyncOverrun allows ongoing syncs to continue in two scenarios: + // For deny windows: allows syncs that started before the deny window became active to continue running + // For allow windows: allows syncs that started during the allow window to continue after the window ends + optional bool syncOverrun = 11; +} + // JWTToken holds the issuedAt and expiresAt values of a token message JWTToken { optional int64 iat = 1; @@ -1532,6 +1584,37 @@ message OCIMetadata { optional string description = 7; } +message OciDirectoryGeneratorItem { + optional string path = 1; + + optional bool exclude = 2; +} + +message OciFileGeneratorItem { + optional string path = 1; + + optional bool exclude = 2; +} + +message OciGenerator { + optional string repoURL = 1; + + repeated OciDirectoryGeneratorItem directories = 2; + + repeated OciFileGeneratorItem files = 3; + + optional string revision = 4; + + optional int64 requeueAfterSeconds = 5; + + optional ApplicationSetTemplate template = 6; + + optional string pathParamPrefix = 7; + + // Values contains key/value pairs which are passed directly as parameters to the template + map values = 8; +} + // Operation contains information about a requested or running operation message Operation { // Sync contains parameters for the operation @@ -2883,44 +2966,6 @@ message SyncStrategyHook { optional SyncStrategyApply syncStrategyApply = 1; } -// SyncWindow contains the kind, time, duration and attributes that are used to assign the syncWindows to apps -message SyncWindow { - // Kind defines if the window allows or blocks syncs - optional string kind = 1; - - // Schedule is the time the window will begin, specified in cron format - optional string schedule = 2; - - // Duration is the amount of time the sync window will be open - optional string duration = 3; - - // Applications contains a list of applications that the window will apply to - repeated string applications = 4; - - // Namespaces contains a list of namespaces that the window will apply to - repeated string namespaces = 5; - - // Clusters contains a list of clusters that the window will apply to - repeated string clusters = 6; - - // ManualSync enables manual syncs when they would otherwise be blocked - optional bool manualSync = 7; - - // TimeZone of the sync that will be applied to the schedule - optional string timeZone = 8; - - // UseAndOperator use AND operator for matching applications, namespaces and clusters instead of the default OR operator - optional bool andOperator = 9; - - // Description of the sync that will be applied to the schedule, can be used to add any information such as a ticket number for example - optional string description = 10; - - // SyncOverrun allows ongoing syncs to continue in two scenarios: - // For deny windows: allows syncs that started before the deny window became active to continue running - // For allow windows: allows syncs that started during the allow window to continue after the window ends - optional bool syncOverrun = 11; -} - // TLSClientConfig contains settings to enable transport layer security message TLSClientConfig { // Insecure specifies that the server should be accessed without verifying the TLS certificate. For testing only. diff --git a/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/openapi_generated.go b/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/openapi_generated.go index ab6dc1b4e..e3650ddbe 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/openapi_generated.go +++ b/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/openapi_generated.go @@ -173,7 +173,7 @@ func GetOpenAPIDefinitions(ref common.ReferenceCallback) map[string]common.OpenA "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1.SyncStrategy": schema_pkg_apis_application_v1alpha1_SyncStrategy(ref), "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1.SyncStrategyApply": schema_pkg_apis_application_v1alpha1_SyncStrategyApply(ref), "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1.SyncStrategyHook": schema_pkg_apis_application_v1alpha1_SyncStrategyHook(ref), - "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1.SyncWindow": schema_pkg_apis_application_v1alpha1_SyncWindow(ref), + "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1.InlineSyncWindow": schema_pkg_apis_application_v1alpha1_SyncWindow(ref), "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1.TLSClientConfig": schema_pkg_apis_application_v1alpha1_TLSClientConfig(ref), "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1.TagFilter": schema_pkg_apis_application_v1alpha1_TagFilter(ref), "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1.objectMeta": schema_pkg_apis_application_v1alpha1_objectMeta(ref), @@ -410,7 +410,7 @@ func schema_pkg_apis_application_v1alpha1_AppProjectSpec(ref common.ReferenceCal Items: &spec.SchemaOrArray{ Schema: &spec.Schema{ SchemaProps: spec.SchemaProps{ - Ref: ref("github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1.SyncWindow"), + Ref: ref("github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1.InlineSyncWindow"), }, }, }, @@ -498,7 +498,7 @@ func schema_pkg_apis_application_v1alpha1_AppProjectSpec(ref common.ReferenceCal }, }, Dependencies: []string{ - "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1.ApplicationDestination", "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1.ApplicationDestinationServiceAccount", "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1.OrphanedResourcesMonitorSettings", "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1.ProjectRole", "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1.SignatureKey", "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1.SyncWindow", "k8s.io/apimachinery/pkg/apis/meta/v1.GroupKind"}, + "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1.ApplicationDestination", "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1.ApplicationDestinationServiceAccount", "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1.OrphanedResourcesMonitorSettings", "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1.ProjectRole", "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1.SignatureKey", "github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1.InlineSyncWindow", "k8s.io/apimachinery/pkg/apis/meta/v1.GroupKind"}, } } @@ -8367,7 +8367,7 @@ func schema_pkg_apis_application_v1alpha1_SyncWindow(ref common.ReferenceCallbac return common.OpenAPIDefinition{ Schema: spec.Schema{ SchemaProps: spec.SchemaProps{ - Description: "SyncWindow contains the kind, time, duration and attributes that are used to assign the syncWindows to apps", + Description: "InlineSyncWindow contains the kind, time, duration and attributes that are used to assign the syncWindows to apps", Type: []string{"object"}, Properties: map[string]spec.Schema{ "kind": { diff --git a/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/repository_types.go b/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/repository_types.go index 33d74f032..69c921d68 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/repository_types.go +++ b/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/repository_types.go @@ -402,6 +402,7 @@ func (repo *Repository) Sanitized() *Repository { Repo: repo.Repo, Type: repo.Type, Name: repo.Name, + Username: repo.Username, Insecure: repo.IsInsecure(), EnableLFS: repo.EnableLFS, EnableOCI: repo.EnableOCI, @@ -423,7 +424,11 @@ func (repo *Repository) Sanitized() *Repository { func (repo *Repository) Normalize() *Repository { if repo.Type == "" { - repo.Type = common.DefaultRepoType + if strings.HasPrefix(repo.Repo, "oci://") { + repo.Type = "oci" + } else { + repo.Type = common.DefaultRepoType + } } return repo } diff --git a/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/source_integrity.go b/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/source_integrity.go index ebb2c8204..40cae68b1 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/source_integrity.go +++ b/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/source_integrity.go @@ -3,6 +3,12 @@ package v1alpha1 import ( "errors" "fmt" + "maps" + "slices" +) + +const ( + SourceIntegrityMethodNameGitGPG = "GIT/GPG" ) type SourceIntegrity struct { @@ -59,6 +65,33 @@ func (s *SourceIntegrity) CacheKey() string { return s.String() } +// ConfiguredMethods returns the list of names of methods that are configured for the SourceIntegrity. +func (s *SourceIntegrity) ConfiguredMethods() []string { + methods := make([]string, 0) + if s == nil { + return methods + } + if s.Git != nil { + methods = append(methods, getGitSourceIntegrityMethods(s.Git.Policies)...) + } + return methods +} + +func getGitSourceIntegrityMethods(policies []*SourceIntegrityGitPolicy) []string { + methods := make(map[string]any, 0) + for _, policy := range policies { + if policy == nil { + continue + } + + if policy.GPG != nil { + methods[SourceIntegrityMethodNameGitGPG] = nil + } + } + + return slices.Sorted(maps.Keys(methods)) +} + // SourceIntegrityCheckResult represents a conclusion of the SourceIntegrity evaluation. // Each check performed on a source(es), holds a check item representing all checks performed. type SourceIntegrityCheckResult struct { diff --git a/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/types.go b/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/types.go index de3710f37..3d7a6145e 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/types.go +++ b/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/types.go @@ -1,8 +1,6 @@ package v1alpha1 import ( - "bytes" - "encoding/gob" "encoding/json" "errors" "fmt" @@ -22,10 +20,9 @@ import ( "time" "unicode" - "github.com/argoproj/argo-cd/gitops-engine/pkg/health" - synccommon "github.com/argoproj/argo-cd/gitops-engine/pkg/sync/common" - "github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube" - "github.com/cespare/xxhash/v2" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health" + synccommon "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/common" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube" "github.com/robfig/cron/v3" log "github.com/sirupsen/logrus" "google.golang.org/grpc/codes" @@ -41,8 +38,10 @@ import ( "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" "k8s.io/client-go/tools/clientcmd/api" + "k8s.io/client-go/transport" "sigs.k8s.io/yaml" + "github.com/argoproj/argo-cd/v3/util/hash" "github.com/argoproj/argo-cd/v3/util/rbac" "github.com/argoproj/argo-cd/v3/common" @@ -937,11 +936,17 @@ type ApplicationSourceDirectory struct { Exclude string `json:"exclude,omitempty" protobuf:"bytes,3,opt,name=exclude"` // Include contains a glob pattern to match paths against that should be explicitly included during manifest generation Include string `json:"include,omitempty" protobuf:"bytes,4,opt,name=include"` + // DisableExtensionFilter controls whether the built-in file-extension filter is skipped during + // manifest generation. When false (the default), only files with a .yaml, .yml, .json, or + // .jsonnet extension are considered as potential manifests. Set it to true to disable the filter + // so that files with custom extensions (e.g. *.yaml.sealed) can be matched by the include/exclude + // glob patterns instead. + DisableExtensionFilter bool `json:"disableExtensionFilter,omitempty" protobuf:"bytes,5,opt,name=disableExtensionFilter"` } // IsZero returns true if the ApplicationSourceDirectory is considered empty func (d *ApplicationSourceDirectory) IsZero() bool { - return d == nil || !d.Recurse && d.Jsonnet.IsZero() + return d == nil || !d.Recurse && d.Jsonnet.IsZero() && !d.DisableExtensionFilter } type OptionalMap struct { @@ -1297,6 +1302,9 @@ type SuccessfulHydrateOperation struct { type HydrateOperationPhase string const ( + // HydrateOperationPhaseUnknown indicates that the hydration phase could not be reliably determined. + // For now this is only used in metrics, not in the CR status. + HydrateOperationPhaseUnknown HydrateOperationPhase = "Unknown" HydrateOperationPhaseHydrating HydrateOperationPhase = "Hydrating" HydrateOperationPhaseFailed HydrateOperationPhase = "Failed" HydrateOperationPhaseHydrated HydrateOperationPhase = "Hydrated" @@ -1587,7 +1595,7 @@ func (r *RetryStrategy) NextRetryAt(lastAttempt time.Time, retryCounts int64) (t // Formula: timeToWait = duration * factor^retry_number // Note that timeToWait should equal to duration for the first retry attempt. // When timeToWait is more than maxDuration retry should be performed at maxDuration. - timeToWait := float64(duration) * (math.Pow(float64(factor), float64(retryCounts))) + timeToWait := float64(duration) * math.Pow(float64(factor), float64(retryCounts)) if maxDuration > 0 { timeToWait = math.Min(float64(maxDuration), timeToWait) } @@ -1890,9 +1898,9 @@ const ( ) // ApplicationConditionType represents type of application condition. Type name has following convention: -// prefix "Error" means error condition -// prefix "Warning" means warning condition -// prefix "Info" means informational condition +// suffix "Error" means error condition +// suffix "Warning" means warning condition +// suffix "Info" means informational condition type ApplicationConditionType = string const ( @@ -1955,8 +1963,6 @@ type AppHealthStatus struct { // Status holds the status code of the application Status health.HealthStatusCode `json:"status,omitempty" protobuf:"bytes,1,opt,name=status"` // Message is a human-readable informational message describing the health status - // - // Deprecated: this field is not used and will be removed in a future release. Message string `json:"message,omitempty" protobuf:"bytes,2,opt,name=message"` // LastTransitionTime is the time the HealthStatus was set or updated LastTransitionTime *metav1.Time `json:"lastTransitionTime,omitempty" protobuf:"bytes,3,opt,name=lastTransitionTime"` @@ -2352,6 +2358,8 @@ type Cluster struct { Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,12,opt,name=labels"` // Annotations for cluster secret metadata Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,13,opt,name=annotations"` + // ConfigHash is an opaque value which tracks changes to the desired configuration of a Cluster + ConfigHash *uint64 `json:"configHash,omitempty" protobuf:"bytes,14,opt,name=configHash"` // The embedded metav1.ObjectMeta field is purely here to please the informer when converting from a v1.Secret to a Cluster. // More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata @@ -2372,6 +2380,7 @@ func (c *Cluster) Sanitized() *Cluster { ClusterResources: c.ClusterResources, Info: c.Info, RefreshRequestedAt: c.RefreshRequestedAt, + ConfigHash: c.ConfigHash, Config: ClusterConfig{ AWSAuthConfig: c.Config.AWSAuthConfig, ProxyUrl: c.Config.ProxyUrl, @@ -2427,6 +2436,25 @@ func (c *Cluster) Equals(other *Cluster) bool { return reflect.DeepEqual(c.Config, other.Config) } +func (c *Cluster) HashIdentity(defaultValue uint64) uint64 { + // Include only fields which are static identifiers or represent the desired state of the Cluster + // Note: ID is excluded as it has json:"-" tag and is not marshaled + + cluster := Cluster{ + Server: c.Server, + Name: c.Name, + Config: c.Config, + } + + result, err := hash.JsonObjectHash(cluster) + if err != nil { + log.Warnf("failed to encode cluster %s for hashing. returning default value: %d", c.Server, defaultValue) + return defaultValue + } + + return result +} + // ClusterInfo contains information about the cluster type ClusterInfo struct { // ConnectionState contains information about the connection to the cluster @@ -2706,6 +2734,7 @@ var validActions = map[string]bool{ rbac.ActionDelete: true, rbac.ActionSync: true, rbac.ActionOverride: true, + rbac.ActionRollback: true, "*": true, } @@ -2919,10 +2948,10 @@ type ClusterResourceRestrictionItem struct { } // SyncWindows is a collection of sync windows in this project -type SyncWindows []*SyncWindow +type SyncWindows []*InlineSyncWindow -// SyncWindow contains the kind, time, duration and attributes that are used to assign the syncWindows to apps -type SyncWindow struct { +// InlineSyncWindow contains the kind, time, duration and attributes that are used to assign the syncWindows to apps +type InlineSyncWindow struct { // Kind defines if the window allows or blocks syncs Kind string `json:"kind,omitempty" protobuf:"bytes,1,opt,name=kind"` // Schedule is the time the window will begin, specified in cron format @@ -2949,7 +2978,7 @@ type SyncWindow struct { SyncOverrun bool `json:"syncOverrun,omitempty" protobuf:"bytes,11,opt,name=syncOverrun"` } -// HasWindows returns true if SyncWindows has one or more SyncWindow +// HasWindows returns true if SyncWindows has one or more InlineSyncWindow func (w *SyncWindows) HasWindows() bool { return w != nil && len(*w) > 0 } @@ -3033,7 +3062,7 @@ func (w *SyncWindows) inactiveAllows(currentTime time.Time) (*SyncWindows, error return nil, nil } -func (w *SyncWindow) scheduleOffsetByTimeZone() time.Duration { +func (w *InlineSyncWindow) scheduleOffsetByTimeZone() time.Duration { loc, err := time.LoadLocation(w.TimeZone) if err != nil { log.Warnf("Invalid time zone %s specified. Using UTC as default time zone", w.TimeZone) @@ -3049,7 +3078,7 @@ func (spec *AppProjectSpec) AddWindow(knd string, sch string, dur string, app [] return errors.New("cannot create window: require kind, schedule, duration and one or more of applications, namespaces and clusters") } - window := &SyncWindow{ + window := &InlineSyncWindow{ Kind: knd, Schedule: sch, Duration: dur, @@ -3366,12 +3395,12 @@ func (w *SyncWindows) canSyncAtTime(isManual bool, checkTime time.Time) (bool, e } // Active returns true if the sync window is currently active -func (w SyncWindow) Active() (bool, error) { +func (w InlineSyncWindow) Active() (bool, error) { return w.active(time.Now()) } -func (w SyncWindow) active(currentTime time.Time) (bool, error) { - // If SyncWindow.Active() is called outside of a UTC locale, it should be +func (w InlineSyncWindow) active(currentTime time.Time) (bool, error) { + // If InlineSyncWindow.Active() is called outside of a UTC locale, it should be // first converted to UTC before search currentTime = currentTime.UTC() @@ -3393,7 +3422,7 @@ func (w SyncWindow) active(currentTime time.Time) (bool, error) { } // Update updates a sync window's settings with the given parameter -func (w *SyncWindow) Update(s string, d string, a []string, n []string, c []string, tz string, description string) error { +func (w *InlineSyncWindow) Update(s string, d string, a []string, n []string, c []string, tz string, description string) error { if s == "" && d == "" && len(a) == 0 && len(n) == 0 && len(c) == 0 && description == "" { return errors.New("cannot update: require one or more of schedule, duration, application, namespace, cluster or description") } @@ -3430,7 +3459,7 @@ func (w *SyncWindow) Update(s string, d string, a []string, n []string, c []stri } // Validate checks whether a sync window has valid configuration. The error returned indicates any problems that has been found. -func (w *SyncWindow) Validate() error { +func (w *InlineSyncWindow) Validate() error { // Default timeZone to UTC if timeZone is not specified if w.TimeZone == "" { w.TimeZone = "UTC" @@ -3460,10 +3489,10 @@ func (w *SyncWindow) Validate() error { return nil } -func (w *SyncWindow) HashIdentity() (uint64, error) { +func (w *InlineSyncWindow) HashIdentity() (uint64, error) { // Create a copy of the window with only the core identity fields // Excluding ManualSync and Description as they are behavioral/metadata fields - identityWindow := SyncWindow{ + identityWindow := InlineSyncWindow{ Kind: w.Kind, Schedule: w.Schedule, Duration: w.Duration, @@ -3475,13 +3504,12 @@ func (w *SyncWindow) HashIdentity() (uint64, error) { // ManualSync and Description are excluded as they don't affect window identity } - var windowBuffer bytes.Buffer - enc := gob.NewEncoder(&windowBuffer) - err := enc.Encode(identityWindow) + result, err := hash.GobObjectHash(identityWindow) if err != nil { return 0, fmt.Errorf("failed to encode sync window for hashing: %w", err) } - return xxhash.Sum64(windowBuffer.Bytes()), nil + + return result, nil } // DestinationClusters returns a list of cluster URLs allowed as destination in an AppProject @@ -3935,19 +3963,40 @@ func SetK8SConfigDefaults(config *rest.Config) error { config.AuthProvider = nil config.ExecProvider = nil - // Set server-side timeout - config.Timeout = K8sServerSideTimeout - + // config.Timeout sets both the client-side HTTP timeout and the server-side timeout. + // We keep config.Timeout as 0 and use a transport wrapper to explicitly pass the timeout parameters to the API server to honor it. + config.Timeout = 0 config.Transport = tr + // HTTPWrappersForConfig already applied the existing wrapper to tr. Clear it + // before adding Argo CD wrappers so client-go does not apply it a second time. + config.WrapTransport = nil + if K8sServerSideTimeout > 0 { + appendTransportWrapper(config, utilhttp.WithServerSideTimeout(K8sServerSideTimeout)) + } maxRetries := env.ParseInt64FromEnv(utilhttp.EnvRetryMax, 0, 1, math.MaxInt64) if maxRetries > 0 { backoffDurationMS := env.ParseInt64FromEnv(utilhttp.EnvRetryBaseBackoff, 100, 1, math.MaxInt64) backoffDuration := time.Duration(backoffDurationMS) * time.Millisecond - config.WrapTransport = utilhttp.WithRetry(maxRetries, backoffDuration) + // Retry is intentionally the outer wrapper so each attempt receives the + // server-side timeout query parameter. + appendTransportWrapper(config, utilhttp.WithRetry(maxRetries, backoffDuration)) } return nil } +func appendTransportWrapper(config *rest.Config, wrapper transport.WrapperFunc) { + if wrapper == nil { + return + } + previous := config.WrapTransport + config.WrapTransport = func(rt http.RoundTripper) http.RoundTripper { + if previous != nil { + rt = previous(rt) + } + return wrapper(rt) + } +} + // ParseProxyUrl returns a parsed url and verifies that schema is correct func ParseProxyUrl(proxyUrl string) (*url.URL, error) { //nolint:revive //FIXME(var-naming) u, err := url.Parse(proxyUrl) @@ -3962,8 +4011,7 @@ func ParseProxyUrl(proxyUrl string) (*url.URL, error) { //nolint:revive //FIXME( return u, nil } -// RawRestConfig returns a go-client REST config from cluster that might be serialized into the file using kube.WriteKubeConfig method. -func (c *Cluster) RawRestConfig() (*rest.Config, error) { +func (c *Cluster) rawRestConfig() (*rest.Config, error) { var config *rest.Config var err error @@ -4071,15 +4119,27 @@ func (c *Cluster) RawRestConfig() (*rest.Config, error) { config.Proxy = http.ProxyURL(u) } config.DisableCompression = c.Config.DisableCompression - config.Timeout = K8sServerSideTimeout + config.Timeout = 0 config.QPS = K8sClientConfigQPS config.Burst = K8sClientConfigBurst return config, nil } +// RawRestConfig returns a go-client REST config from cluster that might be serialized into the file using kube.WriteKubeConfig method. +func (c *Cluster) RawRestConfig() (*rest.Config, error) { + config, err := c.rawRestConfig() + if err != nil { + return nil, err + } + if K8sServerSideTimeout > 0 { + appendTransportWrapper(config, utilhttp.WithServerSideTimeout(K8sServerSideTimeout)) + } + return config, nil +} + // RESTConfig returns a go-client REST config from cluster with tuned throttling and HTTP client settings. func (c *Cluster) RESTConfig() (*rest.Config, error) { - config, err := c.RawRestConfig() + config, err := c.rawRestConfig() if err != nil { return nil, fmt.Errorf("unable to get K8s RAW REST config: %w", err) } diff --git a/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/zz_generated.deepcopy.go b/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/zz_generated.deepcopy.go index 9a92eff7d..89c3517b9 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/zz_generated.deepcopy.go +++ b/vendor/github.com/argoproj/argo-cd/v3/pkg/apis/application/v1alpha1/zz_generated.deepcopy.go @@ -164,7 +164,7 @@ func (in *AppProjectSpec) DeepCopyInto(out *AppProjectSpec) { for i := range *in { if (*in)[i] != nil { in, out := &(*in)[i], &(*out)[i] - *out = new(SyncWindow) + *out = new(InlineSyncWindow) (*in).DeepCopyInto(*out) } } @@ -526,6 +526,11 @@ func (in *ApplicationSetGenerator) DeepCopyInto(out *ApplicationSetGenerator) { *out = new(PluginGenerator) (*in).DeepCopyInto(*out) } + if in.Oci != nil { + in, out := &in.Oci, &out.Oci + *out = new(OciGenerator) + (*in).DeepCopyInto(*out) + } return } @@ -647,6 +652,11 @@ func (in *ApplicationSetNestedGenerator) DeepCopyInto(out *ApplicationSetNestedG *out = new(PluginGenerator) (*in).DeepCopyInto(*out) } + if in.Oci != nil { + in, out := &in.Oci, &out.Oci + *out = new(OciGenerator) + (*in).DeepCopyInto(*out) + } return } @@ -991,6 +1001,11 @@ func (in *ApplicationSetTerminalGenerator) DeepCopyInto(out *ApplicationSetTermi *out = new(v1.LabelSelector) (*in).DeepCopyInto(*out) } + if in.Oci != nil { + in, out := &in.Oci, &out.Oci + *out = new(OciGenerator) + (*in).DeepCopyInto(*out) + } return } @@ -1691,6 +1706,11 @@ func (in *Cluster) DeepCopyInto(out *Cluster) { (*out)[key] = val } } + if in.ConfigHash != nil { + in, out := &in.ConfigHash, &out.ConfigHash + *out = new(uint64) + **out = **in + } in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) return } @@ -2448,6 +2468,37 @@ func (in *InfoItem) DeepCopy() *InfoItem { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *InlineSyncWindow) DeepCopyInto(out *InlineSyncWindow) { + *out = *in + if in.Applications != nil { + in, out := &in.Applications, &out.Applications + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Namespaces != nil { + in, out := &in.Namespaces, &out.Namespaces + *out = make([]string, len(*in)) + copy(*out, *in) + } + if in.Clusters != nil { + in, out := &in.Clusters, &out.Clusters + *out = make([]string, len(*in)) + copy(*out, *in) + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new InlineSyncWindow. +func (in *InlineSyncWindow) DeepCopy() *InlineSyncWindow { + if in == nil { + return nil + } + out := new(InlineSyncWindow) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *JWTToken) DeepCopyInto(out *JWTToken) { *out = *in @@ -2885,6 +2936,77 @@ func (in *OCIMetadata) DeepCopy() *OCIMetadata { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OciDirectoryGeneratorItem) DeepCopyInto(out *OciDirectoryGeneratorItem) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OciDirectoryGeneratorItem. +func (in *OciDirectoryGeneratorItem) DeepCopy() *OciDirectoryGeneratorItem { + if in == nil { + return nil + } + out := new(OciDirectoryGeneratorItem) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OciFileGeneratorItem) DeepCopyInto(out *OciFileGeneratorItem) { + *out = *in + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OciFileGeneratorItem. +func (in *OciFileGeneratorItem) DeepCopy() *OciFileGeneratorItem { + if in == nil { + return nil + } + out := new(OciFileGeneratorItem) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *OciGenerator) DeepCopyInto(out *OciGenerator) { + *out = *in + if in.Directories != nil { + in, out := &in.Directories, &out.Directories + *out = make([]OciDirectoryGeneratorItem, len(*in)) + copy(*out, *in) + } + if in.Files != nil { + in, out := &in.Files, &out.Files + *out = make([]OciFileGeneratorItem, len(*in)) + copy(*out, *in) + } + if in.RequeueAfterSeconds != nil { + in, out := &in.RequeueAfterSeconds, &out.RequeueAfterSeconds + *out = new(int64) + **out = **in + } + in.Template.DeepCopyInto(&out.Template) + if in.Values != nil { + in, out := &in.Values, &out.Values + *out = make(map[string]string, len(*in)) + for key, val := range *in { + (*out)[key] = val + } + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OciGenerator. +func (in *OciGenerator) DeepCopy() *OciGenerator { + if in == nil { + return nil + } + out := new(OciGenerator) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Operation) DeepCopyInto(out *Operation) { *out = *in @@ -4964,37 +5086,6 @@ func (in *SyncStrategyHook) DeepCopy() *SyncStrategyHook { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *SyncWindow) DeepCopyInto(out *SyncWindow) { - *out = *in - if in.Applications != nil { - in, out := &in.Applications, &out.Applications - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Namespaces != nil { - in, out := &in.Namespaces, &out.Namespaces - *out = make([]string, len(*in)) - copy(*out, *in) - } - if in.Clusters != nil { - in, out := &in.Clusters, &out.Clusters - *out = make([]string, len(*in)) - copy(*out, *in) - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SyncWindow. -func (in *SyncWindow) DeepCopy() *SyncWindow { - if in == nil { - return nil - } - out := new(SyncWindow) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in SyncWindows) DeepCopyInto(out *SyncWindows) { { @@ -5003,7 +5094,7 @@ func (in SyncWindows) DeepCopyInto(out *SyncWindows) { for i := range *in { if (*in)[i] != nil { in, out := &(*in)[i], &(*out)[i] - *out = new(SyncWindow) + *out = new(InlineSyncWindow) (*in).DeepCopyInto(*out) } } diff --git a/vendor/github.com/argoproj/argo-cd/v3/pkg/client/clientset/versioned/clientset.go b/vendor/github.com/argoproj/argo-cd/v3/pkg/client/clientset/versioned/clientset.go index cbabdf373..c779d81ff 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/pkg/client/clientset/versioned/clientset.go +++ b/vendor/github.com/argoproj/argo-cd/v3/pkg/client/clientset/versioned/clientset.go @@ -13,7 +13,7 @@ import ( ) type Interface interface { - Discovery() discovery.DiscoveryInterface + Discovery() discovery.DiscoveryInterfaces ArgoprojV1alpha1() argoprojv1alpha1.ArgoprojV1alpha1Interface } @@ -29,7 +29,7 @@ func (c *Clientset) ArgoprojV1alpha1() argoprojv1alpha1.ArgoprojV1alpha1Interfac } // Discovery retrieves the DiscoveryClient -func (c *Clientset) Discovery() discovery.DiscoveryInterface { +func (c *Clientset) Discovery() discovery.DiscoveryInterfaces { if c == nil { return nil } diff --git a/vendor/github.com/argoproj/argo-cd/v3/pkg/client/clientset/versioned/fake/clientset_generated.go b/vendor/github.com/argoproj/argo-cd/v3/pkg/client/clientset/versioned/fake/clientset_generated.go index 945453933..9b5edc899 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/pkg/client/clientset/versioned/fake/clientset_generated.go +++ b/vendor/github.com/argoproj/argo-cd/v3/pkg/client/clientset/versioned/fake/clientset_generated.go @@ -55,7 +55,7 @@ type Clientset struct { tracker testing.ObjectTracker } -func (c *Clientset) Discovery() discovery.DiscoveryInterface { +func (c *Clientset) Discovery() discovery.DiscoveryInterfaces { return c.discovery } diff --git a/vendor/github.com/argoproj/argo-cd/v3/util/cache/cache.go b/vendor/github.com/argoproj/argo-cd/v3/util/cache/cache.go index d42ffaf0e..87988ebb5 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/util/cache/cache.go +++ b/vendor/github.com/argoproj/argo-cd/v3/util/cache/cache.go @@ -226,9 +226,27 @@ func AddCacheFlagsToCmd(cmd *cobra.Command, opts ...Options) func() (*Cache, err redisAddressSrc := getFlagVal(cmd, opt, "redis", cmd.Flags().GetString) cmd.Flags().IntVar(&redisDB, opt.FlagPrefix+"redisdb", env.ParseNumFromEnv(opt.getEnvPrefix()+"REDISDB", 0, 0, math.MaxInt32), "Redis database.") redisDBSrc := getFlagVal(cmd, opt, "redisdb", cmd.Flags().GetInt) - cmd.Flags().StringArrayVar(&sentinelAddresses, opt.FlagPrefix+"sentinel", []string{}, "Redis sentinel hostname and port (e.g. argocd-redis-ha-announce-0:6379). ") + cmd.Flags().StringArrayVar( + &sentinelAddresses, + opt.FlagPrefix+"sentinel", + env.StringsFromEnv( + opt.getEnvPrefix()+"REDIS_SENTINEL_HOSTS", + []string{}, + ",", + ), + "Redis sentinel hostname and port (e.g. argocd-redis-ha-announce-0:6379). ", + ) sentinelAddressesSrc := getFlagVal(cmd, opt, "sentinel", cmd.Flags().GetStringArray) - cmd.Flags().StringVar(&sentinelMaster, opt.FlagPrefix+"sentinelmaster", "master", "Redis sentinel master group name.") + + cmd.Flags().StringVar( + &sentinelMaster, + opt.FlagPrefix+"sentinelmaster", + env.StringFromEnv( + opt.getEnvPrefix()+"REDIS_SENTINEL_MASTER", + "master", + ), + "Redis sentinel master group name.", + ) sentinelMasterSrc := getFlagVal(cmd, opt, "sentinelmaster", cmd.Flags().GetString) cmd.Flags().DurationVar(&defaultCacheExpiration, opt.FlagPrefix+"default-cache-expiration", env.ParseDurationFromEnv("ARGOCD_DEFAULT_CACHE_EXPIRATION", 24*time.Hour, 0, math.MaxInt64), "Cache expiration default") defaultCacheExpirationSrc := getFlagVal(cmd, opt, "default-cache-expiration", cmd.Flags().GetDuration) @@ -364,6 +382,29 @@ func (c *Cache) GetItem(key string, item any) error { return client.Get(key, item) } +// localCacheClient is implemented by clients that keep a local copy of external cache entries. +type localCacheClient interface { + GetLocal(key string, obj any) error + InvalidateLocal(key string) +} + +// GetLocalItem reads the item from the client's local copy only. It returns ErrCacheMiss if the +// client keeps no local copy or the key is not in it. +func (c *Cache) GetLocalItem(key string, item any) error { + if client, ok := c.GetClient().(localCacheClient); ok { + return client.GetLocal(c.generateFullKey(key), item) + } + return ErrCacheMiss +} + +// InvalidateLocalItem drops the local copy of the item, if the client keeps one, +// so the next SetItem for that key is always written to the external cache. +func (c *Cache) InvalidateLocalItem(key string) { + if client, ok := c.GetClient().(localCacheClient); ok { + client.InvalidateLocal(c.generateFullKey(key)) + } +} + func (c *Cache) OnUpdated(ctx context.Context, key string, callback func() error) error { return c.client.OnUpdated(ctx, c.generateFullKey(key), callback) } diff --git a/vendor/github.com/argoproj/argo-cd/v3/util/cache/redis.go b/vendor/github.com/argoproj/argo-cd/v3/util/cache/redis.go index 33a34a9cb..cd3901a94 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/util/cache/redis.go +++ b/vendor/github.com/argoproj/argo-cd/v3/util/cache/redis.go @@ -13,6 +13,7 @@ import ( "sync" "time" + "github.com/argoproj/argo-cd/v3/util/env" utilio "github.com/argoproj/argo-cd/v3/util/io" rediscache "github.com/go-redis/cache/v9" @@ -27,6 +28,8 @@ var ( ) const ( + // envRedisKeyPrefix is an env variable name which stores the prefix for redis keys + envRedisKeyPrefix = "ARGOCD_REDIS_KEY_PREFIX" // redisNoSuchKeyErr is the error string Redis returns from RENAME when the source key does not // exist. It is treated as a cache miss rather than a failed request. redisNoSuchKeyErr = "ERR no such key" @@ -48,6 +51,7 @@ func NewRedisCache(client *redis.Client, expiration time.Duration, compressionTy expiration: expiration, cache: rediscache.New(&rediscache.Options{Redis: client}), redisCompressionType: compressionType, + prefix: env.StringFromEnv(envRedisKeyPrefix, ""), } } @@ -59,14 +63,17 @@ type redisCache struct { client *redis.Client cache *rediscache.Cache redisCompressionType RedisCompressionType + // prefix is added to all keys stored in redis + prefix string } func (r *redisCache) getKey(key string) string { + prefixedKey := r.prefix + key switch r.redisCompressionType { case RedisCompressionGZip: - return key + ".gz" + return prefixedKey + ".gz" default: - return key + return prefixedKey } } diff --git a/vendor/github.com/argoproj/argo-cd/v3/util/cache/twolevelclient.go b/vendor/github.com/argoproj/argo-cd/v3/util/cache/twolevelclient.go index 87d710038..aeab5b64e 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/util/cache/twolevelclient.go +++ b/vendor/github.com/argoproj/argo-cd/v3/util/cache/twolevelclient.go @@ -67,6 +67,18 @@ func (c *twoLevelClient) Delete(key string) error { return c.externalCache.Delete(key) } +// InvalidateLocal removes the key from the in-memory cache only, so the next Set of that key +// always reaches the external cache. Use it when another client may have overwritten the key +// in the external cache since this client last wrote it. +func (c *twoLevelClient) InvalidateLocal(key string) { + _ = c.inMemoryCache.Delete(key) +} + +// GetLocal reads the key from the in-memory cache only, without querying the external cache. +func (c *twoLevelClient) GetLocal(key string, obj any) error { + return c.inMemoryCache.Get(key, obj) +} + func (c *twoLevelClient) OnUpdated(ctx context.Context, key string, callback func() error) error { return c.externalCache.OnUpdated(ctx, key, callback) } diff --git a/vendor/github.com/argoproj/argo-cd/v3/util/env/env.go b/vendor/github.com/argoproj/argo-cd/v3/util/env/env.go index 1a7633c30..f056bc9ab 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/util/env/env.go +++ b/vendor/github.com/argoproj/argo-cd/v3/util/env/env.go @@ -203,15 +203,17 @@ func ParseStringToStringFromEnv(envVar string, defaultValue map[string]string, s parsed := make(map[string]string) for pair := range strings.SplitSeq(str, separator) { - keyvalue := strings.Split(pair, "=") - if len(keyvalue) != 2 { - log.Warnf("Invalid key-value pair when parsing environment '%s' as a string map", str) + // Split on the first '=' only: values such as base64 credentials may contain '='. + key, value, ok := strings.Cut(pair, "=") + if !ok { + // Don't log the value: it may hold credentials (e.g. OTLP auth headers). + log.Warnf("Invalid key-value pair when parsing environment '%s' as a string map", envVar) return defaultValue } - key := strings.TrimSpace(keyvalue[0]) - value := strings.TrimSpace(keyvalue[1]) + key = strings.TrimSpace(key) + value = strings.TrimSpace(value) if _, ok := parsed[key]; ok { - log.Warnf("Duplicate key '%s' when parsing environment '%s' as a string map", key, str) + log.Warnf("Duplicate key '%s' when parsing environment '%s' as a string map", key, envVar) return defaultValue } parsed[key] = value diff --git a/vendor/github.com/argoproj/argo-cd/v3/util/exec/exec.go b/vendor/github.com/argoproj/argo-cd/v3/util/exec/exec.go index d6c0dc352..52d327b20 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/util/exec/exec.go +++ b/vendor/github.com/argoproj/argo-cd/v3/util/exec/exec.go @@ -13,7 +13,7 @@ import ( "time" "unicode" - "github.com/argoproj/argo-cd/gitops-engine/pkg/utils/tracing" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/tracing" "github.com/sirupsen/logrus" "github.com/argoproj/argo-cd/v3/util/log" @@ -195,7 +195,9 @@ func RunCommandExt(cmd *exec.Cmd, opts CmdOpts) (string, error) { return "", err } - done := make(chan error) + // Buffered so the timeout path can return without waiting on Wait. An + // unbuffered channel leaks the Wait goroutine, which blocks forever on send. + done := make(chan error, 1) go func() { done <- cmd.Wait() }() // Start timers for timeout diff --git a/vendor/github.com/argoproj/argo-cd/v3/util/git/OWNERS b/vendor/github.com/argoproj/argo-cd/v3/util/git/OWNERS deleted file mode 100644 index 4fb7a97c2..000000000 --- a/vendor/github.com/argoproj/argo-cd/v3/util/git/OWNERS +++ /dev/null @@ -1,3 +0,0 @@ -owners: -- alexmt -- jannfis diff --git a/vendor/github.com/argoproj/argo-cd/v3/util/git/client.go b/vendor/github.com/argoproj/argo-cd/v3/util/git/client.go index 290f41ab5..6daa6dd50 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/util/git/client.go +++ b/vendor/github.com/argoproj/argo-cd/v3/util/git/client.go @@ -49,8 +49,19 @@ import ( ) var ( - ErrInvalidRepoURL = errors.New("repo URL is invalid") - ErrNoNoteFound = errors.New("no note found") + ErrInvalidRepoURL = errors.New("repo URL is invalid") + ErrNoNoteFound = errors.New("no note found") + ErrRevisionNotFound = errors.New("revision not found") +) + +// Values returned by CommitSignatureStatus for the GPG signature status code +// (git's %G? placeholder). The full set is documented under PRETTY FORMATS +// in git-log(1); only G and U represent good signatures that callers should +// accept (U = good but unknown trust, expected when the signing key has not +// been ultimately trusted in the local keyring). +const ( + SignatureStatusGood = "G" + SignatureStatusGoodUnknownTrust = "U" ) // builtinGitConfig configuration contains statements that are needed @@ -129,43 +140,55 @@ type Client interface { Root() string RepoURL() string Init() error - Fetch(revision string, depth int64) error - Submodule() error - Checkout(revision string, submoduleEnabled bool, cleanState bool) (string, error) + Fetch(ctx context.Context, revision string, depth int64) error + Submodule(ctx context.Context) error + Checkout(ctx context.Context, revision string, submoduleEnabled bool, cleanState bool) (string, error) LsRefs() (*Refs, error) LsRemote(revision string) (string, error) - LsFiles(path string, enableNewGitFileGlobbing bool) ([]string, error) - LsLargeFiles() ([]string, error) - CommitSHA() (string, error) - RevisionMetadata(revision string) (*RevisionMetadata, error) + LsFiles(ctx context.Context, path string, enableNewGitFileGlobbing bool) ([]string, error) + LsLargeFiles(ctx context.Context) ([]string, error) + CommitSHA(ctx context.Context) (string, error) + RevisionMetadata(ctx context.Context, revision string) (*RevisionMetadata, error) // Deprecated: To be removed in the next major version when Signature verification is replaced with Source Integrity. - VerifyCommitSignature(string) (string, error) + VerifyCommitSignature(ctx context.Context, revision string) (string, error) // IsAnnotatedTag determines if the revision is, or resolves to an annotated tag. - IsAnnotatedTag(revision string) bool + IsAnnotatedTag(ctx context.Context, revision string) bool // LsSignatures gets a list of revisions including their GPG signature info. // If revision is an annotated tag or a semantic constraint matching an annotated tag, its signature is reported as well // If deep==true, list the commits backwards in history until a signed "seal commit" or repo init commit. The listing includes those seal commits. // If deep==false, examines the revision only. Checking the annotated tag signature if the revision is an annotated tag, commit signature otherwise. - LsSignatures(revision string, deep bool) ([]RevisionSignatureInfo, string, error) - ChangedFiles(revision string, targetRevision string) ([]string, error) - IsRevisionPresent(revision string) bool + LsSignatures(ctx context.Context, revision string, deep bool) ([]RevisionSignatureInfo, string, error) + ChangedFiles(ctx context.Context, revision string, targetRevision string) ([]string, error) + IsRevisionPresent(ctx context.Context, revision string) bool // SetAuthor sets the author name and email in the git configuration. - SetAuthor(name, email string) (string, error) + SetAuthor(ctx context.Context, name, email string) (string, error) // CheckoutOrOrphan checks out the branch. If the branch does not exist, it creates an orphan branch. - CheckoutOrOrphan(branch string, submoduleEnabled bool) (string, error) + CheckoutOrOrphan(ctx context.Context, branch string, submoduleEnabled bool) (string, error) // CheckoutOrNew checks out the given branch. If the branch does not exist, it creates an empty branch based on // the base branch. - CheckoutOrNew(branch, base string, submoduleEnabled bool) (string, error) + CheckoutOrNew(ctx context.Context, branch, base string, submoduleEnabled bool) (string, error) // RemoveContents removes all files from the given paths in the git repository. - RemoveContents(paths []string) (string, error) - // CommitAndPush commits and pushes changes to the target branch. - CommitAndPush(branch, message string) (string, error) + RemoveContents(ctx context.Context, paths []string) (string, error) + // Commit stages all changes and creates a single commit. If signingKeyID + // is non-empty, the commit is GPG-signed with the given key from the + // shared GNUPGHOME (common.GetGnuPGHomePath()); the key's passphrase, if + // any, must already be cached in gpg-agent. Returns the git output. + Commit(message, signingKeyID string) (string, error) + // Push pushes the target branch to origin. + Push(branch string) (string, error) + // CommitSignatureStatus returns git's signature status code (%G?) and the + // long key ID used to sign the given revision (%GK). Used to assert a + // freshly created signed commit was produced by the expected key before + // pushing. Pass an exact commit SHA so the check is pinned to the commit + // being verified. See the SignatureStatus* constants for the values that + // indicate a usable signature. + CommitSignatureStatus(ctx context.Context, revision string) (status, keyID string, err error) // GetCommitNote gets the note associated with the DRY sha stored in the specific namespace - GetCommitNote(sha string, namespace string) (string, error) + GetCommitNote(ctx context.Context, sha string, namespace string) (string, error) // AddAndPushNote adds a note to a DRY sha and then pushes it. - AddAndPushNote(sha string, namespace string, note string) error + AddAndPushNote(ctx context.Context, sha string, namespace string, note string) error // HasFileChanged returns the outout of git diff considering whether it is tracked or un-tracked - HasFileChanged(filePath string) (bool, error) + HasFileChanged(ctx context.Context, filePath string) (bool, error) } type EventHandlers struct { @@ -276,11 +299,11 @@ func NewClient(rawRepoURL string, creds Creds, insecure bool, enableLfs bool, pr r := regexp.MustCompile(`([/:])`) normalizedGitURL := NormalizeGitURL(rawRepoURL) if normalizedGitURL == "" { - return nil, fmt.Errorf("repository %q cannot be initialized: %w", rawRepoURL, ErrInvalidRepoURL) + return nil, fmt.Errorf("repository %q cannot be initialized: %w", SanitizeRepoURL(rawRepoURL), ErrInvalidRepoURL) } root := filepath.Join(os.TempDir(), r.ReplaceAllString(normalizedGitURL, "_")) if root == os.TempDir() { - return nil, fmt.Errorf("repository %q cannot be initialized, because its root would be system temp at %s", rawRepoURL, root) + return nil, fmt.Errorf("repository %q cannot be initialized, because its root would be system temp at %s", SanitizeRepoURL(rawRepoURL), root) } return NewClientExt(rawRepoURL, root, creds, insecure, enableLfs, proxy, noProxy, opts...) } @@ -431,7 +454,7 @@ func buildSSHAuth(repoURL string, creds *SSHCreds) (transport.AuthMethod, error) // avoids handing back an AuthMethod with no host-key verification. // For the no-credentials path, newAuth catches this and lets go-git // fall back to its DefaultAuthBuilder. - return nil, fmt.Errorf("could not set up SSH known hosts callback for %s: %w", repoURL, err) + return nil, fmt.Errorf("could not set up SSH known hosts callback for %s: %w", SanitizeRepoURL(repoURL), err) } if creds == nil { @@ -585,12 +608,12 @@ func (m *nativeGitClient) fetch(ctx context.Context, revision string, depth int6 } // IsRevisionPresent checks to see if the given revision already exists locally. -func (m *nativeGitClient) IsRevisionPresent(revision string) bool { +func (m *nativeGitClient) IsRevisionPresent(ctx context.Context, revision string) bool { if revision == "" { return false } - cmd := exec.CommandContext(context.Background(), "git", "cat-file", "-t", revision) + cmd := exec.CommandContext(ctx, "git", "cat-file", "-t", revision) out, err := m.runCmdOutput(cmd, runOpts{SkipErrorLogging: true}) if out == "commit" && err == nil { return true @@ -672,12 +695,11 @@ func (m *nativeGitClient) cleanupOrphanedTempPackfiles() { } // Fetch fetches latest updates from origin -func (m *nativeGitClient) Fetch(revision string, depth int64) error { +func (m *nativeGitClient) Fetch(ctx context.Context, revision string, depth int64) error { if m.OnFetch != nil { done := m.OnFetch(m.repoURL) defer done() } - ctx := context.Background() err := m.fetch(ctx, revision, depth) if err != nil { @@ -687,7 +709,7 @@ func (m *nativeGitClient) Fetch(revision string, depth int64) error { // When we have LFS support enabled, check for large files and fetch them too. if m.IsLFSEnabled() { - largeFiles, err := m.LsLargeFiles() + largeFiles, err := m.LsLargeFiles(ctx) if err == nil && len(largeFiles) > 0 { err = m.runCredentialedCmd(ctx, "lfs", "fetch", "--all") if err != nil { @@ -700,7 +722,7 @@ func (m *nativeGitClient) Fetch(revision string, depth int64) error { } // LsFiles lists the local working tree, including only files that are under source control -func (m *nativeGitClient) LsFiles(path string, enableNewGitFileGlobbing bool) ([]string, error) { +func (m *nativeGitClient) LsFiles(ctx context.Context, path string, enableNewGitFileGlobbing bool) ([]string, error) { if enableNewGitFileGlobbing { // This is the new way with safer globbing @@ -738,7 +760,6 @@ func (m *nativeGitClient) LsFiles(path string, enableNewGitFileGlobbing bool) ([ } return files, nil } - ctx := context.Background() // This is the old and default way out, err := m.runCmd(ctx, "ls-files", "--full-name", "-z", "--", path) if err != nil { @@ -750,8 +771,8 @@ func (m *nativeGitClient) LsFiles(path string, enableNewGitFileGlobbing bool) ([ } // LsLargeFiles lists all files that have references to LFS storage -func (m *nativeGitClient) LsLargeFiles() ([]string, error) { - out, err := m.runCmd(context.Background(), "lfs", "ls-files", "-n") +func (m *nativeGitClient) LsLargeFiles(ctx context.Context) ([]string, error) { + out, err := m.runCmd(ctx, "lfs", "ls-files", "-n") if err != nil { return nil, err } @@ -760,8 +781,7 @@ func (m *nativeGitClient) LsLargeFiles() ([]string, error) { } // Submodule embed other repositories into this repository -func (m *nativeGitClient) Submodule() error { - ctx := context.Background() +func (m *nativeGitClient) Submodule(ctx context.Context) error { if err := m.runCredentialedCmd(ctx, "submodule", "sync", "--recursive"); err != nil { return err } @@ -769,18 +789,17 @@ func (m *nativeGitClient) Submodule() error { } // Checkout checks out the specified revision -func (m *nativeGitClient) Checkout(revision string, submoduleEnabled bool, cleanState bool) (string, error) { +func (m *nativeGitClient) Checkout(ctx context.Context, revision string, submoduleEnabled bool, cleanState bool) (string, error) { if revision == "" || revision == "HEAD" { revision = "origin/HEAD" } - ctx := context.Background() if out, err := m.runCmd(ctx, "checkout", "--force", revision); err != nil { return out, fmt.Errorf("failed to checkout %s: %w", revision, err) } // We must populate LFS content by using lfs checkout, if we have at least // one LFS reference in the current revision. if m.IsLFSEnabled() { - largeFiles, err := m.LsLargeFiles() + largeFiles, err := m.LsLargeFiles(ctx) if err != nil { return "", fmt.Errorf("failed to list LFS files: %w", err) } @@ -792,7 +811,7 @@ func (m *nativeGitClient) Checkout(revision string, submoduleEnabled bool, clean } if _, err := os.Stat(m.root + "/.gitmodules"); !os.IsNotExist(err) { if submoduleEnabled { - if err := m.Submodule(); err != nil { + if err := m.Submodule(ctx); err != nil { return "", fmt.Errorf("failed to update submodules: %w", err) } } @@ -919,7 +938,7 @@ func (m *nativeGitClient) LsRemote(revision string) (res string, err error) { // Formula: timeToWait = duration * factor^retry_number // Note that timeToWait should equal to duration for the first retry attempt. // When timeToWait is more than maxDuration retry should be performed at maxDuration. - timeToWait := float64(retryDuration) * (math.Pow(float64(factor), float64(attempt))) + timeToWait := float64(retryDuration) * math.Pow(float64(factor), float64(attempt)) if maxRetryDuration > 0 { timeToWait = math.Min(float64(maxRetryDuration), timeToWait) } @@ -1004,12 +1023,12 @@ func (m *nativeGitClient) lsRemote(revision string) (string, error) { // If we get here, revision string had non hexadecimal characters (indicating its a branch, tag, // or symbolic ref) and we were unable to resolve it to a commit SHA. - return "", fmt.Errorf("unable to resolve '%s' to a commit SHA", revision) + return "", fmt.Errorf("unable to resolve '%s' to a commit SHA: %w", revision, ErrRevisionNotFound) } // CommitSHA returns current commit sha from `git rev-parse HEAD` -func (m *nativeGitClient) CommitSHA() (string, error) { - out, err := m.runCmd(context.Background(), "rev-parse", "HEAD") +func (m *nativeGitClient) CommitSHA(ctx context.Context) (string, error) { + out, err := m.runCmd(ctx, "rev-parse", "HEAD") if err != nil { return "", err } @@ -1017,8 +1036,7 @@ func (m *nativeGitClient) CommitSHA() (string, error) { } // RevisionMetadata returns the meta-data for the commit -func (m *nativeGitClient) RevisionMetadata(revision string) (*RevisionMetadata, error) { - ctx := context.Background() +func (m *nativeGitClient) RevisionMetadata(ctx context.Context, revision string) (*RevisionMetadata, error) { out, err := m.runCmd(ctx, "show", "-s", "--format=%an <%ae>%n%at%n%B", revision) if err != nil { return nil, err @@ -1035,7 +1053,7 @@ func (m *nativeGitClient) RevisionMetadata(revision string) (*RevisionMetadata, cmd.Stdin = strings.NewReader(message) out, err = m.runCmdOutput(cmd, runOpts{}) if err != nil { - return nil, fmt.Errorf("failed to interpret trailers for revision %q in repo %q: %w", revision, m.repoURL, err) + return nil, fmt.Errorf("failed to interpret trailers for revision %q in repo %q: %w", revision, SanitizeRepoURL(m.repoURL), err) } relatedCommits, _ := GetReferences(log.WithFields(log.Fields{"repo": m.repoURL, "revision": revision}), out) @@ -1151,8 +1169,8 @@ func updateCommitMetadata(logCtx *log.Entry, relatedCommit *CommitMetadata, line // VerifyCommitSignature Runs verify-commit on a given revision and returns the output // // Deprecated: To be removed in the next major version when Signature verification is replaced with Source Integrity. -func (m *nativeGitClient) VerifyCommitSignature(revision string) (string, error) { - cmd := m.cmdWithGPG(context.Background(), "git-verify-wrapper.sh", revision) +func (m *nativeGitClient) VerifyCommitSignature(ctx context.Context, revision string) (string, error) { + cmd := m.cmdWithGPG(ctx, "git-verify-wrapper.sh", revision) out, err := m.runCmdOutput(cmd, runOpts{}) if err != nil { log.Errorf("error verifying commit signature: %v", err) @@ -1232,8 +1250,7 @@ func gpgVerificationFromGitRevParse(oneLetter string) (GPGVerificationResult, er var gpgKeyIdRegexp = regexp.MustCompile("[0-9a-zA-Z]{16}") -func (m *nativeGitClient) tagSignature(tagRevision string) (*RevisionSignatureInfo, error) { - ctx := context.Background() +func (m *nativeGitClient) tagSignature(ctx context.Context, tagRevision string) (*RevisionSignatureInfo, error) { // Unlike for commits, there is no elegant way to slurp all signature info for tag. So this extracts details needed // for RevisionSignatureInfo from 2 different git invocations. cmd := m.cmdWithGPG(ctx, "git", "for-each-ref", "refs/tags/"+tagRevision, `--format=%(taggerdate),%(taggername) "%(taggeremail)"`) @@ -1299,7 +1316,7 @@ func evaluateGpgSignStatus(cmdErr error, tagGpgOut string) (result GPGVerificati return "", "", fmt.Errorf("unexpected `git verify-tag --raw` output: %q", tagGpgOut) } -func (m *nativeGitClient) LsSignatures(unresolvedRevision string, deep bool) ([]RevisionSignatureInfo, string, error) { +func (m *nativeGitClient) LsSignatures(ctx context.Context, unresolvedRevision string, deep bool) ([]RevisionSignatureInfo, string, error) { legacyVerification := "" // Resolve eventual semantic tag constraint before annotated tag detection @@ -1314,14 +1331,14 @@ func (m *nativeGitClient) LsSignatures(unresolvedRevision string, deep bool) ([] } } - legacyVerification, err := m.VerifyCommitSignature(unresolvedRevision) + legacyVerification, err := m.VerifyCommitSignature(ctx, unresolvedRevision) if err != nil { return nil, "", err } var signatures []RevisionSignatureInfo - if m.IsAnnotatedTag(unresolvedRevision) { - signature, err := m.tagSignature(unresolvedRevision) + if m.IsAnnotatedTag(ctx, unresolvedRevision) { + signature, err := m.tagSignature(ctx, unresolvedRevision) if err != nil { return nil, "", err } @@ -1333,7 +1350,7 @@ func (m *nativeGitClient) LsSignatures(unresolvedRevision string, deep bool) ([] } } - commitSignaturesRawOut, err := m.listRawSignatures(deep) + commitSignaturesRawOut, err := m.listRawSignatures(ctx, deep) if err != nil { return nil, "", err } @@ -1400,14 +1417,12 @@ func newRevisionSignatureInfo(revision string, verificationResult GPGVerificatio }, nil } -func (m *nativeGitClient) listRawSignatures(deep bool) (string, error) { - revisionSha, err := m.CommitSHA() +func (m *nativeGitClient) listRawSignatures(ctx context.Context, deep bool) (string, error) { + revisionSha, err := m.CommitSHA(ctx) if err != nil { return "", err } - ctx := context.Background() - // This is using a two-step approach to solve the following problem: find all ancestors of a given revision in git history DAG, // stopping on a signed seal commit, or an init commit. Note there might be multiple seal commits that separate the revision // form init commit in case the history merged past the most recent seal commit. @@ -1429,7 +1444,7 @@ func (m *nativeGitClient) listRawSignatures(deep bool) (string, error) { return "", err } - commitFilterArgs, err = m.getSealRevListFilter(revisionSha, sealCommitsRawOut) + commitFilterArgs, err = m.getSealRevListFilter(ctx, revisionSha, sealCommitsRawOut) if err != nil { return "", err } @@ -1448,7 +1463,7 @@ func (m *nativeGitClient) listRawSignatures(deep bool) (string, error) { } // getSealRevListFilter create arguments for `git rev-list` to search the history all the way until the seal commits found. -func (m *nativeGitClient) getSealRevListFilter(revision string, sealCommitsRawOut string) ([]string, error) { +func (m *nativeGitClient) getSealRevListFilter(ctx context.Context, revision string, sealCommitsRawOut string) ([]string, error) { // Keep only seal commits with a valid signature var sealCommits []string for line := range strings.SplitSeq(sealCommitsRawOut, "\n") { @@ -1465,7 +1480,7 @@ func (m *nativeGitClient) getSealRevListFilter(revision string, sealCommitsRawOu } // Resolve, in case revision is not a commit number - sha, err := m.CommitSHA() + sha, err := m.CommitSHA(ctx) if err != nil { return nil, err } @@ -1479,8 +1494,8 @@ func (m *nativeGitClient) getSealRevListFilter(revision string, sealCommitsRawOu } // IsAnnotatedTag returns true if the revision is an annotated tag existing in the repository, and false for everything else. -func (m *nativeGitClient) IsAnnotatedTag(revision string) bool { - cmd := exec.CommandContext(context.Background(), "git", "cat-file", "-t", revision) +func (m *nativeGitClient) IsAnnotatedTag(ctx context.Context, revision string) bool { + cmd := exec.CommandContext(ctx, "git", "cat-file", "-t", revision) out, err := m.runCmdOutput(cmd, runOpts{SkipErrorLogging: true}) // a lightweight tag returns "commit" - makes sense in the git world if err == nil && out == "tag" { @@ -1490,7 +1505,7 @@ func (m *nativeGitClient) IsAnnotatedTag(revision string) bool { } // ChangedFiles returns a list of files changed between two revisions -func (m *nativeGitClient) ChangedFiles(revision string, targetRevision string) ([]string, error) { +func (m *nativeGitClient) ChangedFiles(ctx context.Context, revision string, targetRevision string) ([]string, error) { if revision == targetRevision { return []string{}, nil } @@ -1499,7 +1514,7 @@ func (m *nativeGitClient) ChangedFiles(revision string, targetRevision string) ( return []string{}, errors.New("invalid revision provided, must be SHA") } - out, err := m.runCmd(context.Background(), "diff", "--name-only", fmt.Sprintf("%s..%s", revision, targetRevision)) + out, err := m.runCmd(ctx, "diff", "--name-only", fmt.Sprintf("%s..%s", revision, targetRevision)) if err != nil { return nil, fmt.Errorf("failed to diff %s..%s: %w", revision, targetRevision, err) } @@ -1523,8 +1538,7 @@ func (m *nativeGitClient) config(ctx context.Context, args ...string) (string, e } // SetAuthor sets the author name and email in the git configuration. -func (m *nativeGitClient) SetAuthor(name, email string) (string, error) { - ctx := context.Background() +func (m *nativeGitClient) SetAuthor(ctx context.Context, name, email string) (string, error) { if name != "" { out, err := m.config(ctx, "--local", "user.name", name) if err != nil { @@ -1541,14 +1555,13 @@ func (m *nativeGitClient) SetAuthor(name, email string) (string, error) { } // CheckoutOrOrphan checks out the branch. If the branch does not exist, it creates an orphan branch. -func (m *nativeGitClient) CheckoutOrOrphan(branch string, submoduleEnabled bool) (string, error) { - out, err := m.Checkout(branch, submoduleEnabled, true) +func (m *nativeGitClient) CheckoutOrOrphan(ctx context.Context, branch string, submoduleEnabled bool) (string, error) { + out, err := m.Checkout(ctx, branch, submoduleEnabled, true) if err != nil { // If the branch doesn't exist, create it as an orphan branch. if !strings.Contains(err.Error(), "did not match any file(s) known to git") { return out, fmt.Errorf("failed to checkout branch: %w", err) } - ctx := context.Background() out, err = m.runCmd(ctx, "switch", "--orphan", branch) if err != nil { return out, fmt.Errorf("failed to create orphan branch: %w", err) @@ -1571,20 +1584,20 @@ func (m *nativeGitClient) CheckoutOrOrphan(branch string, submoduleEnabled bool) // CheckoutOrNew checks out the given branch. If the branch does not exist, it creates an empty branch based on // the base branch. -func (m *nativeGitClient) CheckoutOrNew(branch, base string, submoduleEnabled bool) (string, error) { - out, err := m.Checkout(branch, submoduleEnabled, true) +func (m *nativeGitClient) CheckoutOrNew(ctx context.Context, branch, base string, submoduleEnabled bool) (string, error) { + out, err := m.Checkout(ctx, branch, submoduleEnabled, true) if err != nil { if !strings.Contains(err.Error(), "did not match any file(s) known to git") { return out, fmt.Errorf("failed to checkout branch: %w", err) } // If the branch does not exist, create any empty branch based on the sync branch // First, checkout the sync branch. - out, err = m.Checkout(base, submoduleEnabled, true) + out, err = m.Checkout(ctx, base, submoduleEnabled, true) if err != nil { return out, fmt.Errorf("failed to checkout sync branch: %w", err) } - out, err = m.runCmd(context.Background(), "checkout", "-b", branch) + out, err = m.runCmd(ctx, "checkout", "-b", branch) if err != nil { return out, fmt.Errorf("failed to create branch: %w", err) } @@ -1593,53 +1606,94 @@ func (m *nativeGitClient) CheckoutOrNew(branch, base string, submoduleEnabled bo } // RemoveContents removes all files from the path of git repository. -func (m *nativeGitClient) RemoveContents(paths []string) (string, error) { +func (m *nativeGitClient) RemoveContents(ctx context.Context, paths []string) (string, error) { if len(paths) == 0 { return "", nil } args := append([]string{"rm", "-r", "--ignore-unmatch", "--"}, paths...) - out, err := m.runCmd(context.Background(), args...) + out, err := m.runCmd(ctx, args...) if err != nil { return out, fmt.Errorf("failed to clear paths %v: %w", paths, err) } return "", nil } -// CommitAndPush commits and pushes changes to the target branch. -func (m *nativeGitClient) CommitAndPush(branch, message string) (string, error) { +// Commit stages all changes and creates a single commit. If signingKeyID is +// non-empty, the commit is GPG-signed with that key from the shared GNUPGHOME; +// the key's passphrase, if any, must already be cached in gpg-agent so gpg can +// sign non-interactively. +func (m *nativeGitClient) Commit(message, signingKeyID string) (string, error) { ctx := context.Background() - out, err := m.runCmd(ctx, "add", ".") - if err != nil { + if out, err := m.runCmd(ctx, "add", "."); err != nil { return out, fmt.Errorf("failed to add files: %w", err) } - out, err = m.runCmd(ctx, "commit", "-m", message) - if err != nil { - if strings.Contains(out, "nothing to commit, working tree clean") { - return out, nil + if signingKeyID == "" { + out, err := m.runCmd(ctx, "commit", "-m", message) + if err != nil { + if strings.Contains(out, "nothing to commit, working tree clean") { + return out, nil + } + return out, fmt.Errorf("failed to commit: %w", err) } - return out, fmt.Errorf("failed to commit: %w", err) + return out, nil } + // Signed commit: configure the signing key on this invocation only (no + // persistent git config writes) and route through cmdWithGPG so gpg sees + // the configured GNUPGHOME. + args := []string{ + "-c", "user.signingkey=" + signingKeyID, + "-c", "commit.gpgsign=true", + "commit", "-m", message, + } + cmd := m.cmdWithGPG(ctx, "git", args...) + out, err := m.runCmdOutput(cmd, runOpts{}) + if err != nil { + // Unlike the unsigned path we do NOT swallow "nothing to commit": a + // signed commit is only requested when we expect a real change, and + // silently returning would leave the caller verifying the signature of + // a stale HEAD it never created. + return out, fmt.Errorf("failed to create signed commit: %w", err) + } + return out, nil +} + +// Push pushes the target branch to origin. +func (m *nativeGitClient) Push(branch string) (string, error) { if m.OnPush != nil { done := m.OnPush(m.repoURL) defer done() } - - err = m.runCredentialedCmd(ctx, "push", "origin", branch) - if err != nil { + if err := m.runCredentialedCmd(context.Background(), "push", "origin", branch); err != nil { return "", fmt.Errorf("failed to push: %w", err) } - return "", nil } +// CommitSignatureStatus returns the GPG signature status code (%G?) and the +// signing key ID (%GK) for the given revision. Status is "N" (and keyID "") +// when the commit carries no signature. See man git-log under PRETTY FORMATS +// for codes; for our purposes "G" (good) and "U" (good but unknown trust) are +// acceptable and everything else — including "N" — must be rejected. +func (m *nativeGitClient) CommitSignatureStatus(ctx context.Context, revision string) (string, string, error) { + cmd := m.cmdWithGPG(ctx, "git", "log", "-1", "--pretty=format:%G?:%GK", revision, "--") + out, err := m.runCmdOutput(cmd, runOpts{}) + if err != nil { + return "", "", fmt.Errorf("failed to read signature status of %q: %w", revision, err) + } + parts := strings.SplitN(strings.TrimSpace(out), ":", 2) + if len(parts) != 2 { + return "", "", fmt.Errorf("unexpected signature status output: %q", out) + } + return parts[0], parts[1], nil +} + // GetCommitNote gets the note associated with the DRY sha stored in the specific namespace -func (m *nativeGitClient) GetCommitNote(sha string, namespace string) (string, error) { +func (m *nativeGitClient) GetCommitNote(ctx context.Context, sha string, namespace string) (string, error) { if strings.TrimSpace(namespace) == "" { namespace = "commit" } - ctx := context.Background() // fetch first // cli command: git fetch origin refs/notes/source-hydrator:refs/notes/source-hydrator notesRef := "refs/notes/" + namespace @@ -1658,11 +1712,10 @@ func (m *nativeGitClient) GetCommitNote(sha string, namespace string) (string, e // AddAndPushNote adds a note to a DRY sha and then pushes it. // It uses a retry mechanism to handle concurrent note updates from multiple clients. -func (m *nativeGitClient) AddAndPushNote(sha string, namespace string, note string) error { +func (m *nativeGitClient) AddAndPushNote(ctx context.Context, sha string, namespace string, note string) error { if namespace == "" { namespace = "commit" } - ctx := context.Background() ref := "--ref=" + namespace notesRef := "refs/notes/" + namespace @@ -1672,6 +1725,7 @@ func (m *nativeGitClient) AddAndPushNote(sha string, namespace string, note stri b.MaxInterval = 1 * time.Second attempt := 0 + permanent := false operation := func() (struct{}, error) { attempt++ @@ -1707,6 +1761,7 @@ func (m *nativeGitClient) AddAndPushNote(sha string, namespace string, note stri // Check if this is a retryable error if !isRetryableNotePushError(err.Error()) { + permanent = true return struct{}{}, backoff.Permanent(fmt.Errorf("failed to push note: %w", err)) } @@ -1718,7 +1773,11 @@ func (m *nativeGitClient) AddAndPushNote(sha string, namespace string, note stri backoff.WithMaxElapsedTime(5*time.Second), ) if err != nil { - return fmt.Errorf("failed to push note after retries: %w", err) + if permanent { + // The operation already prefixed this error; prefixing again would duplicate it. + return err + } + return fmt.Errorf("failed to push note after %d attempts: %w", attempt, err) } return nil } @@ -1738,15 +1797,15 @@ func isRetryableNotePushError(errStr string) bool { } // HasFileChanged returns the outout of git diff considering whether it is tracked or un-tracked -func (m *nativeGitClient) HasFileChanged(filePath string) (bool, error) { +func (m *nativeGitClient) HasFileChanged(ctx context.Context, filePath string) (bool, error) { // Step 1: Is it UNTRACKED? (file is new to git) - _, err := m.runCmd(context.Background(), "ls-files", "--error-unmatch", filePath) + _, err := m.runCmd(ctx, "ls-files", "--error-unmatch", filePath) if err != nil { // File is NOT tracked by git → means it's new/unadded return true, nil } // use git diff --quiet and check exit code .. --cached is to consider files staged for deletion - _, err = m.runCmd(context.Background(), "diff", "--quiet", "--", filePath) + _, err = m.runCmd(ctx, "diff", "--quiet", "--", filePath) if err == nil { return false, nil // No changes } @@ -1792,7 +1851,39 @@ func (m *nativeGitClient) runCredentialedCmd(ctx context.Context, args ...string cmd := exec.CommandContext(ctx, "git", args...) cmd.Env = append(cmd.Env, environ...) _, err = m.runCmdOutput(cmd, runOpts{}) - return err + return humanizeAuthPromptError(m.repoURL, err) +} + +// gitTerminalPromptDisabledMsg is the substring Git prints when it needs +// credentials it wasn't given and interactive prompts are disabled +// (GIT_TERMINAL_PROMPT=0). It signals a failed git authentication, not an actual +// terminal problem. +const gitTerminalPromptDisabledMsg = "terminal prompts disabled" + +// humanizeAuthPromptError rewrites Git's misleading "terminal prompts disabled" +// failure into an authentication error, since the raw message reads as a tty +// problem when the real cause is that no credentials matched the repository URL. +// Any other error is returned unchanged. +func humanizeAuthPromptError(repoURL string, err error) error { + if err == nil || !strings.Contains(err.Error(), gitTerminalPromptDisabledMsg) { + return err + } + return fmt.Errorf("failed to authenticate to git repository %q: no credentials matched this URL: %w", SanitizeRepoURL(repoURL), err) +} + +// gitCancelGracePeriod is how long a cancelled git command has to exit after +// SIGTERM before it is killed. It reads ARGOCD_EXEC_FATAL_TIMEOUT, the same +// env var util/exec uses to bound its own timeout-then-SIGKILL escalation, so +// one knob governs both. Duplicating the read here instead of sharing an +// accessor with util/exec is a shortcut; a later layer should clean it up. +// +// Unlike util/exec, where ARGOCD_EXEC_FATAL_TIMEOUT=0 intentionally disables +// the fatal-SIGKILL escalation, a zero result here would become cmd.WaitDelay, +// which disables os/exec's own bound on waiting for inherited pipes to close. +// Reject zero (and negative) so it falls back to the default instead of +// removing the bound entirely. +func gitCancelGracePeriod() time.Duration { + return env.ParseDurationFromEnv("ARGOCD_EXEC_FATAL_TIMEOUT", 10*time.Second, time.Nanosecond, math.MaxInt64) } func (m *nativeGitClient) runCmdOutput(cmd *exec.Cmd, ropts runOpts) (string, error) { @@ -1829,6 +1920,10 @@ func (m *nativeGitClient) runCmdOutput(cmd *exec.Cmd, ropts runOpts) (string, er } } cmd.Env = proxy.UpsertEnv(cmd, m.proxy, m.noProxy) + // On context cancellation, send SIGTERM (not os/exec's default SIGKILL) so git can + // remove its lock files; os/exec sends SIGKILL if git is still running after WaitDelay. + cmd.Cancel = func() error { return cmd.Process.Signal(syscall.SIGTERM) } + cmd.WaitDelay = gitCancelGracePeriod() opts := executil.ExecRunOpts{ TimeoutBehavior: executil.TimeoutBehavior{ Signal: syscall.SIGTERM, diff --git a/vendor/github.com/argoproj/argo-cd/v3/util/git/creds.go b/vendor/github.com/argoproj/argo-cd/v3/util/git/creds.go index 10c13a588..1de4697d5 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/util/git/creds.go +++ b/vendor/github.com/argoproj/argo-cd/v3/util/git/creds.go @@ -33,8 +33,8 @@ import ( gocache "github.com/patrickmn/go-cache" - argoio "github.com/argoproj/argo-cd/gitops-engine/pkg/utils/io" - "github.com/argoproj/argo-cd/gitops-engine/pkg/utils/text" + argoio "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/io" + "github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/text" "github.com/bradleyfalzon/ghinstallation/v2" log "github.com/sirupsen/logrus" @@ -687,10 +687,10 @@ func (g GitHubAppCreds) getInstallationTransport() (*ghinstallation.Transport, e if installationID == 0 { org, err := ExtractOrgFromRepoURL(g.repoURL) if err != nil { - return nil, fmt.Errorf("failed to extract organization from repository URL %s for GitHub App installation discovery: %w", g.repoURL, err) + return nil, fmt.Errorf("failed to extract organization from repository URL %s for GitHub App installation discovery: %w", SanitizeRepoURL(g.repoURL), err) } if org == "" { - return nil, fmt.Errorf("could not extract organization from repository URL %s: the URL does not contain an organization/owner", g.repoURL) + return nil, fmt.Errorf("could not extract organization from repository URL %s: the URL does not contain an organization/owner", SanitizeRepoURL(g.repoURL)) } ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second) @@ -858,8 +858,8 @@ func domainFromBaseURL(baseURL string) (string, error) { // --- 1. SSH-style Git URL: git@github.com:org/repo.git --- if strings.Contains(baseURL, "@") && strings.Contains(baseURL, ":") && !strings.Contains(baseURL, "://") { parts := strings.SplitN(baseURL, "@", 2) - right := parts[len(parts)-1] // github.com:org/repo - host := strings.SplitN(right, ":", 2)[0] // github.com + right := parts[len(parts)-1] // github.com:org/repo + host, _, _ := strings.Cut(right, ":") // github.com if host != "" { return host, nil } @@ -927,7 +927,7 @@ func ExtractOrgFromRepoURL(repoURL string) (string, error) { // Use git-urls library to parse all Git URL formats parsed, err := giturls.Parse(repoURL) if err != nil { - return "", fmt.Errorf("failed to parse repository URL %q: %w", repoURL, err) + return "", fmt.Errorf("failed to parse repository URL %q: %w", SanitizeRepoURL(repoURL), err) } // Clean the path: remove leading/trailing slashes and .git suffix @@ -935,7 +935,7 @@ func ExtractOrgFromRepoURL(repoURL string) (string, error) { path = strings.TrimSuffix(path, ".git") if path == "" { - return "", fmt.Errorf("repository URL %q does not contain a path", repoURL) + return "", fmt.Errorf("repository URL %q does not contain a path", SanitizeRepoURL(repoURL)) } // Extract the first path component (organization/owner) @@ -948,7 +948,7 @@ func ExtractOrgFromRepoURL(repoURL string) (string, error) { // If there's no slash, the entire path might be just the org (unusual but handle it) // This would fail validation later, but let's return it - return "", fmt.Errorf("could not extract organization from repository URL %q: path %q does not contain org/repo format", repoURL, path) + return "", fmt.Errorf("could not extract organization from repository URL %q: path %q does not contain org/repo format", SanitizeRepoURL(repoURL), path) } var _ Creds = GoogleCloudCreds{} diff --git a/vendor/github.com/argoproj/argo-cd/v3/util/git/git.go b/vendor/github.com/argoproj/argo-cd/v3/util/git/git.go index 60afcfe60..01e0ebf80 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/util/git/git.go +++ b/vendor/github.com/argoproj/argo-cd/v3/util/git/git.go @@ -39,7 +39,18 @@ func IsTruncatedCommitSHA(sha string) bool { return truncatedCommitSHARegex.MatchString(sha) } -// SameURL returns whether or not the two repository URLs are equivalent in location +// SanitizeRepoURL strips any embedded userinfo (e.g. https://token@host/org/repo) from a +// repository URL so credentials are not leaked when the URL is logged or exported (e.g. as a +// tracing span attribute). If the URL cannot be parsed it is returned unchanged. +func SanitizeRepoURL(repoURL string) string { + u, err := url.Parse(repoURL) + if err != nil || u.User == nil { + return repoURL + } + u.User = nil + return u.String() +} + func SameURL(leftRepo, rightRepo string) bool { normalLeft := NormalizeGitURLAllowInvalid(leftRepo) normalRight := NormalizeGitURLAllowInvalid(rightRepo) diff --git a/vendor/github.com/argoproj/argo-cd/v3/util/glob/glob.go b/vendor/github.com/argoproj/argo-cd/v3/util/glob/glob.go index 60f1ca499..a8e298924 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/util/glob/glob.go +++ b/vendor/github.com/argoproj/argo-cd/v3/util/glob/glob.go @@ -17,7 +17,7 @@ const ( DefaultGlobCacheSize = 10000 ) -type compileFn func(pattern string, separators ...rune) (glob.Glob, error) +type compileFn func(pattern string, separators ...rune) (*glob.Pattern, error) var ( // globCache stores compiled glob patterns using an LRU cache with bounded size. @@ -58,18 +58,27 @@ func cacheKey(pattern string, separators ...rune) globCacheKey { // unique pattern is compiled exactly once even under concurrent access, while unrelated // patterns compile in parallel. // lru.Cache.Get() promotes entries (mutating), so a Mutex is used rather than RWMutex. -func getOrCompile(pattern string, compiler compileFn, separators ...rune) (glob.Glob, error) { +func getOrCompile(pattern string, compiler compileFn, separators ...rune) (*glob.Pattern, error) { key := cacheKey(pattern, separators...) globCacheLock.Lock() if cached, ok := globCache.Get(key); ok { globCacheLock.Unlock() - return cached.(glob.Glob), nil + return cached.(*glob.Pattern), nil } globCacheLock.Unlock() sfKey := key.Pattern + "\x00" + key.Separators v, err, _ := compileGroup.Do(sfKey, func() (any, error) { + // Double-check cache: another singleflight call may have populated it + // between our cache check and this singleflight registration. + globCacheLock.Lock() + if cached, ok := globCache.Get(key); ok { + globCacheLock.Unlock() + return cached.(*glob.Pattern), nil + } + globCacheLock.Unlock() + compiled, err := compiler(pattern, separators...) if err != nil { return nil, err @@ -82,7 +91,7 @@ func getOrCompile(pattern string, compiler compileFn, separators ...rune) (glob. if err != nil { return nil, err } - return v.(glob.Glob), nil + return v.(*glob.Pattern), nil } // Match tries to match a text with a given glob pattern. diff --git a/vendor/github.com/argoproj/argo-cd/v3/util/glob/list.go b/vendor/github.com/argoproj/argo-cd/v3/util/glob/list.go index 9a62374c2..820c01f29 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/util/glob/list.go +++ b/vendor/github.com/argoproj/argo-cd/v3/util/glob/list.go @@ -21,7 +21,7 @@ func MatchStringInList(list []string, item string, patternMatch string) bool { for _, ll := range list { // If string is wrapped in "/", assume it is a regular expression. switch { - case patternMatch == REGEXP && strings.HasPrefix(ll, "/") && strings.HasSuffix(ll, "/") && regex.Match(ll[1:len(ll)-1], item): + case patternMatch == REGEXP && len(ll) > 2 && strings.HasPrefix(ll, "/") && strings.HasSuffix(ll, "/") && regex.Match(ll[1:len(ll)-1], item): return true case (patternMatch == REGEXP || patternMatch == GLOB) && Match(ll, item): return true diff --git a/vendor/github.com/argoproj/argo-cd/v3/util/hash/hash.go b/vendor/github.com/argoproj/argo-cd/v3/util/hash/hash.go new file mode 100644 index 000000000..7a6e77e4f --- /dev/null +++ b/vendor/github.com/argoproj/argo-cd/v3/util/hash/hash.go @@ -0,0 +1,38 @@ +package hash + +import ( + "bytes" + "encoding/gob" + "encoding/json" + "hash/fnv" + + "github.com/cespare/xxhash/v2" +) + +// FNVa computes a FNVa hash on a string +func FNVa(s string) uint32 { + h := fnv.New32a() + _, _ = h.Write([]byte(s)) + return h.Sum32() +} + +func GobObjectHash(obj any) (uint64, error) { + var buffer bytes.Buffer + + enc := gob.NewEncoder(&buffer) + err := enc.Encode(obj) + if err != nil { + return 0, err + } + + return xxhash.Sum64(buffer.Bytes()), nil +} + +func JsonObjectHash(obj any) (uint64, error) { + data, err := json.Marshal(obj) + if err != nil { + return 0, err + } + + return xxhash.Sum64(data), nil +} diff --git a/vendor/github.com/argoproj/argo-cd/v3/util/helm/OWNERS b/vendor/github.com/argoproj/argo-cd/v3/util/helm/OWNERS deleted file mode 100644 index 4fb7a97c2..000000000 --- a/vendor/github.com/argoproj/argo-cd/v3/util/helm/OWNERS +++ /dev/null @@ -1,3 +0,0 @@ -owners: -- alexmt -- jannfis diff --git a/vendor/github.com/argoproj/argo-cd/v3/util/helm/client.go b/vendor/github.com/argoproj/argo-cd/v3/util/helm/client.go index cfaf3c97a..3eb54e3a8 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/util/helm/client.go +++ b/vendor/github.com/argoproj/argo-cd/v3/util/helm/client.go @@ -60,10 +60,10 @@ type indexCache interface { type Client interface { CleanChartCache(chart string, version string) error - ExtractChart(chart string, version string, passCredentials bool, manifestMaxExtractedSize int64, disableManifestMaxExtractedSize bool) (string, utilio.Closer, error) - GetIndex(noCache bool, maxIndexSize int64) (*Index, error) - GetTags(chart string, noCache bool) ([]string, error) - TestHelmOCI() (bool, error) + ExtractChart(ctx context.Context, chart string, version string, passCredentials bool, manifestMaxExtractedSize int64, disableManifestMaxExtractedSize bool) (string, utilio.Closer, error) + GetIndex(ctx context.Context, noCache bool, maxIndexSize int64) (*Index, error) + GetTags(ctx context.Context, chart string, noCache bool) ([]string, error) + TestHelmOCI(ctx context.Context) (bool, error) } type ClientOpts func(c *nativeHelmChart) @@ -115,19 +115,27 @@ func NewClientWithLock(repoURL string, creds Creds, repoLock sync.KeyLock, enabl return c } +// WithHelmChartCacheExpiration sets the cache expiration duration for chart cache. +func WithHelmChartCacheExpiration(helmChartCacheExpiration time.Duration) ClientOpts { + return func(c *nativeHelmChart) { + c.helmChartCacheExpiration = helmChartCacheExpiration + } +} + var _ Client = &nativeHelmChart{} type nativeHelmChart struct { - chartCachePaths utilio.TempPaths - repoURL string - creds Creds - repoLock sync.KeyLock - enableOci bool - plainHTTP bool - indexCache indexCache - proxy string - noProxy string - customUserAgent string // Custom User-Agent string (optional) + chartCachePaths utilio.TempPaths + repoURL string + creds Creds + repoLock sync.KeyLock + enableOci bool + plainHTTP bool + indexCache indexCache + proxy string + noProxy string + customUserAgent string // Custom User-Agent string (optional) + helmChartCacheExpiration time.Duration // Cache expiration for chart cache } // getUserAgent returns the User-Agent string to use for HTTP requests. @@ -157,6 +165,12 @@ func (c *nativeHelmChart) CleanChartCache(chart string, version string) error { if err != nil { return fmt.Errorf("error getting cached chart path: %w", err) } + + // ExtractChart reads and extracts the cached archive while holding this key lock. + // Acquire it here as well so a hard refresh cannot delete the archive mid-extraction. + c.repoLock.Lock(cachePath) + defer c.repoLock.Unlock(cachePath) + if err := os.RemoveAll(cachePath); err != nil { return fmt.Errorf("error removing chart cache at %s: %w", cachePath, err) } @@ -180,7 +194,7 @@ func untarChart(ctx context.Context, tempDir string, cachedChartPath string, man return files.Untgz(tempDir, reader, manifestMaxExtractedSize, false) } -func (c *nativeHelmChart) ExtractChart(chart string, version string, passCredentials bool, manifestMaxExtractedSize int64, disableManifestMaxExtractedSize bool) (string, utilio.Closer, error) { +func (c *nativeHelmChart) ExtractChart(ctx context.Context, chart string, version string, passCredentials bool, manifestMaxExtractedSize int64, disableManifestMaxExtractedSize bool) (string, utilio.Closer, error) { // always use Helm V3 since we don't have chart content to determine correct Helm version helmCmd, err := NewCmdWithVersion("", c.enableOci, c.proxy, c.noProxy) if err != nil { @@ -210,6 +224,28 @@ func (c *nativeHelmChart) ExtractChart(chart string, version string, passCredent return "", nil, fmt.Errorf("error checking existence of cached chart path: %w", err) } + // if chart tar exists, check if it is expired based on cache expiration duration configuration. + if exists && c.helmChartCacheExpiration > 0 { + info, err := os.Stat(cachedChartPath) + if err != nil { + log.WithFields(log.Fields{ + "path": cachedChartPath, + "err": err, + }).Warn("error checking cached Helm chart; removing cached archive") + _ = os.RemoveAll(cachedChartPath) + exists = false + } else if time.Since(info.ModTime()) > c.helmChartCacheExpiration { + if err := os.RemoveAll(cachedChartPath); err != nil { + _ = os.RemoveAll(tempDir) + return "", nil, fmt.Errorf( + "error removing expired cached chart: %w", + err, + ) + } + exists = false + } + } + if !exists { // create empty temp directory to extract chart from the registry tempDest, err := files.CreateTempDir(os.TempDir()) @@ -225,7 +261,7 @@ func (c *nativeHelmChart) ExtractChart(chart string, version string, passCredent return "", nil, fmt.Errorf("failed to get password for helm registry: %w", err) } if helmPassword != "" && c.creds.GetUsername() != "" { - _, err = helmCmd.RegistryLogin(c.repoURL, c.creds, c.plainHTTP) + _, err = helmCmd.RegistryLogin(ctx, c.repoURL, c.creds, c.plainHTTP) if err != nil { _ = os.RemoveAll(tempDir) return "", nil, fmt.Errorf("error logging into OCI registry: %w", err) @@ -267,7 +303,7 @@ func (c *nativeHelmChart) ExtractChart(chart string, version string, passCredent } } - err = untarChart(context.Background(), tempDir, cachedChartPath, manifestMaxExtractedSize, disableManifestMaxExtractedSize) + err = untarChart(ctx, tempDir, cachedChartPath, manifestMaxExtractedSize, disableManifestMaxExtractedSize) if err != nil { _ = os.RemoveAll(tempDir) return "", nil, fmt.Errorf("error untarring chart: %w", err) @@ -277,7 +313,7 @@ func (c *nativeHelmChart) ExtractChart(chart string, version string, passCredent }), nil } -func (c *nativeHelmChart) GetIndex(noCache bool, maxIndexSize int64) (*Index, error) { +func (c *nativeHelmChart) GetIndex(ctx context.Context, noCache bool, maxIndexSize int64) (*Index, error) { indexLock.Lock(c.repoURL) defer indexLock.Unlock(c.repoURL) @@ -290,7 +326,6 @@ func (c *nativeHelmChart) GetIndex(noCache bool, maxIndexSize int64) (*Index, er if len(data) == 0 { start := time.Now() - ctx := context.Background() var err error data, err = c.loadRepoIndex(ctx, maxIndexSize) if err != nil { @@ -314,7 +349,7 @@ func (c *nativeHelmChart) GetIndex(noCache bool, maxIndexSize int64) (*Index, er return index, nil } -func (c *nativeHelmChart) TestHelmOCI() (bool, error) { +func (c *nativeHelmChart) TestHelmOCI(ctx context.Context) (bool, error) { start := time.Now() tmpDir, err := os.MkdirTemp("", "helm") @@ -336,7 +371,7 @@ func (c *nativeHelmChart) TestHelmOCI() (bool, error) { return false, fmt.Errorf("failed to get password for helm registry: %w", err) } if c.creds.GetUsername() != "" && helmPassword != "" { - _, err = helmCmd.RegistryLogin(c.repoURL, c.creds, c.plainHTTP) + _, err = helmCmd.RegistryLogin(ctx, c.repoURL, c.creds, c.plainHTTP) if err != nil { return false, fmt.Errorf("error logging into OCI registry: %w", err) } @@ -445,12 +480,15 @@ func (c *nativeHelmChart) getCachedChartPath(chart string, version string) (stri // Ensures that given OCI registries URL does not have protocol func IsHelmOciRepo(repoURL string) bool { - if repoURL == "" { + if repoURL == "" || strings.Contains(repoURL, "://") { return false } - parsed, err := url.Parse(repoURL) - // the URL parser treat hostname as either path or opaque if scheme is not specified, so hostname must be empty - return err == nil && parsed.Host == "" + // A scheme-less registry reference such as "demo.goharbor.io:8080" or + // "192.168.100.150:1843" cannot be parsed as a URL on its own, so prepend a + // dummy scheme and require a host, the same way oras-go validates a registry + // (registry.Reference.ValidateRegistry). + parsed, err := url.ParseRequestURI("dummy://" + repoURL) + return err == nil && parsed.Host != "" } func getIndexURL(rawURL string) (string, error) { @@ -464,7 +502,7 @@ func getIndexURL(rawURL string) (string, error) { return repoURL.String(), nil } -func (c *nativeHelmChart) GetTags(chart string, noCache bool) ([]string, error) { +func (c *nativeHelmChart) GetTags(ctx context.Context, chart string, noCache bool) ([]string, error) { if !c.enableOci { return nil, ErrOCINotEnabled } @@ -538,7 +576,6 @@ func (c *nativeHelmChart) GetTags(chart string, noCache bool) ([]string, error) Credential: credential, } - ctx := context.Background() err = repo.Tags(ctx, "", func(tagsResult []string) error { for _, tag := range tagsResult { // By convention: Change underscore (_) back to plus (+) to get valid SemVer diff --git a/vendor/github.com/argoproj/argo-cd/v3/util/helm/cmd.go b/vendor/github.com/argoproj/argo-cd/v3/util/helm/cmd.go index c88a40320..5014ba60e 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/util/helm/cmd.go +++ b/vendor/github.com/argoproj/argo-cd/v3/util/helm/cmd.go @@ -90,7 +90,7 @@ func (c Cmd) runWithStdin(ctx context.Context, stdin io.Reader, args ...string) return out, fullCommand, nil } -func (c *Cmd) RegistryLogin(repo string, creds Creds, plainHTTP bool) (string, error) { +func (c *Cmd) RegistryLogin(ctx context.Context, repo string, creds Creds, plainHTTP bool) (string, error) { args := []string{"registry", "login"} registry, err := c.getHelmRegistry(repo) if err != nil { @@ -142,7 +142,7 @@ func (c *Cmd) RegistryLogin(repo string, creds Creds, plainHTTP bool) (string, e if helmPassword != "" { stdin = strings.NewReader(helmPassword) } - out, _, err := c.runWithStdin(context.Background(), stdin, args...) + out, _, err := c.runWithStdin(ctx, stdin, args...) if err != nil { return "", fmt.Errorf("failed to login to registry: %w", err) } diff --git a/vendor/github.com/argoproj/argo-cd/v3/util/helm/creds.go b/vendor/github.com/argoproj/argo-cd/v3/util/helm/creds.go index d320e00ef..1ed57725e 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/util/helm/creds.go +++ b/vendor/github.com/argoproj/argo-cd/v3/util/helm/creds.go @@ -124,7 +124,7 @@ func NewAzureWorkloadIdentityCreds(repoURL string, caPath string, certData []byt } func (creds AzureWorkloadIdentityCreds) GetAccessToken() (string, error) { - registryHost := strings.Split(creds.repoURL, "/")[0] + registryHost, _, _ := strings.Cut(creds.repoURL, "/") ctx := context.Background() // Compute hash as key for refresh token in the cache diff --git a/vendor/github.com/argoproj/argo-cd/v3/util/helm/helm.go b/vendor/github.com/argoproj/argo-cd/v3/util/helm/helm.go index fcf0b2f1e..cfac3f472 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/util/helm/helm.go +++ b/vendor/github.com/argoproj/argo-cd/v3/util/helm/helm.go @@ -38,7 +38,7 @@ type Helm interface { // GetParameters returns a list of chart parameters taking into account values in provided YAML files. GetParameters(valuesFiles []pathutil.ResolvedFilePath, appPath, repoRoot string) (map[string]string, error) // DependencyBuild runs `helm dependency build` to download a chart's dependencies - DependencyBuild() error + DependencyBuild(ctx context.Context) error // Dispose deletes temp resources Dispose() } @@ -77,7 +77,7 @@ func (h *helm) Template(templateOpts *TemplateOpts) (string, string, error) { return out, command, nil } -func (h *helm) DependencyBuild() error { +func (h *helm) DependencyBuild(ctx context.Context) error { isHelmOci := h.cmd.IsHelmOci defer func() { h.cmd.IsHelmOci = isHelmOci @@ -92,7 +92,7 @@ func (h *helm) DependencyBuild() error { return fmt.Errorf("failed to get password for helm registry: %w", err) } if repo.GetUsername() != "" && helmPassword != "" { - _, err := h.cmd.RegistryLogin(repo.Repo, repo.Creds, repo.InsecureOCIForceHttp) + _, err := h.cmd.RegistryLogin(ctx, repo.Repo, repo.Creds, repo.InsecureOCIForceHttp) defer func() { _, _ = h.cmd.RegistryLogout(repo.Repo, repo.Creds) diff --git a/vendor/github.com/argoproj/argo-cd/v3/util/http/http.go b/vendor/github.com/argoproj/argo-cd/v3/util/http/http.go index bcd8e0e83..80fa2399d 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/util/http/http.go +++ b/vendor/github.com/argoproj/argo-cd/v3/util/http/http.go @@ -12,6 +12,7 @@ import ( "time" log "github.com/sirupsen/logrus" + utilnet "k8s.io/apimachinery/pkg/util/net" "k8s.io/client-go/transport" "github.com/argoproj/argo-cd/v3/common" @@ -181,6 +182,46 @@ func WithRetry(maxRetries int64, baseRetryBackoff time.Duration) transport.Wrapp } } +// WithServerSideTimeout adds the timeout query parameter understood by the +// Kubernetes API server without imposing a client-side deadline. +func WithServerSideTimeout(timeout time.Duration) transport.WrapperFunc { + return func(rt http.RoundTripper) http.RoundTripper { + if timeout <= 0 { + return rt + } + if rt == nil { + rt = http.DefaultTransport + } + return &serverSideTimeoutTransport{ + inner: rt, + timeout: timeout, + } + } +} + +type serverSideTimeoutTransport struct { + inner http.RoundTripper + timeout time.Duration +} + +var _ utilnet.RoundTripperWrapper = (*serverSideTimeoutTransport)(nil) + +func (t *serverSideTimeoutTransport) RoundTrip(req *http.Request) (*http.Response, error) { + query := req.URL.Query() + if query.Get("timeout") != "" { + return t.inner.RoundTrip(req) + } + + clonedReq := req.Clone(req.Context()) + query.Set("timeout", t.timeout.String()) + clonedReq.URL.RawQuery = query.Encode() + return t.inner.RoundTrip(clonedReq) +} + +func (t *serverSideTimeoutTransport) WrappedRoundTripper() http.RoundTripper { + return t.inner +} + type retryTransport struct { inner http.RoundTripper maxRetries int64 diff --git a/vendor/github.com/argoproj/argo-cd/v3/util/io/files/tar.go b/vendor/github.com/argoproj/argo-cd/v3/util/io/files/tar.go index 125d079e1..5dd7e550e 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/util/io/files/tar.go +++ b/vendor/github.com/argoproj/argo-cd/v3/util/io/files/tar.go @@ -11,6 +11,7 @@ import ( "path/filepath" "strings" + "github.com/bmatcuk/doublestar/v4" log "github.com/sirupsen/logrus" ) @@ -210,10 +211,30 @@ func untar(dstPath string, r io.Reader, preserveFileMode bool) error { return nil } +func matchPath(pattern, relativePath string) (bool, error) { + normPattern := filepath.ToSlash(pattern) + normPath := filepath.ToSlash(relativePath) + return doublestar.Match(normPattern, normPath) +} + +func matchesPattern(pattern, base, relativePath string) (bool, error) { + if strings.Contains(filepath.ToSlash(pattern), "/") { + return matchPath(pattern, relativePath) + } + return filepath.Match(pattern, base) +} + // tgzFile is used as a filepath.WalkFunc implementing the logic to write // the given file in the tgz.tarWriter applying the exclusion pattern defined // in tgz.exclusions, or the inclusion pattern defined in tgz.inclusions. // Only regular files will be added in the tarball. +// +// Inclusion pattern matching rules: +// - Patterns containing a path separator ('/') are matched against the +// file's relative path. The special segment "**" matches zero or more +// path segments, so "charts/**" includes every file under charts/. +// - Patterns without a path separator are matched against the filename only +// via filepath.Match (original behaviour, e.g. "*.yaml"). func (t *tgz) tgzFile(path string, fi os.FileInfo, err error) error { if err != nil { return fmt.Errorf("error walking in %q: %w", t.srcPath, err) @@ -225,13 +246,14 @@ func (t *tgz) tgzFile(path string, fi os.FileInfo, err error) error { if err != nil { return fmt.Errorf("relative path error: %w", err) } + relativePath = filepath.ToSlash(relativePath) if t.inclusions != nil && base != "." && !fi.IsDir() { included := false for _, inclusionPattern := range t.inclusions { - found, err := filepath.Match(inclusionPattern, base) - if err != nil { - return fmt.Errorf("error verifying inclusion pattern %q: %w", inclusionPattern, err) + found, matchErr := matchesPattern(inclusionPattern, base, relativePath) + if matchErr != nil { + return fmt.Errorf("error verifying inclusion pattern %q: %w", inclusionPattern, matchErr) } if found { included = true @@ -244,9 +266,9 @@ func (t *tgz) tgzFile(path string, fi os.FileInfo, err error) error { } if t.exclusions != nil { for _, exclusionPattern := range t.exclusions { - found, err := filepath.Match(exclusionPattern, relativePath) - if err != nil { - return fmt.Errorf("error verifying exclusion pattern %q: %w", exclusionPattern, err) + found, matchErr := matchesExclusionPattern(exclusionPattern, relativePath) + if matchErr != nil { + return fmt.Errorf("error verifying exclusion pattern %q: %w", exclusionPattern, matchErr) } if found { if fi.IsDir() { @@ -340,3 +362,11 @@ func rejectSymlinkAncestors(root *os.Root, name string) error { } return nil } + +func matchesExclusionPattern(pattern, relativePath string) (bool, error) { + normPattern := filepath.ToSlash(pattern) + if strings.Contains(normPattern, "/") { + return matchPath(normPattern, relativePath) + } + return filepath.Match(normPattern, relativePath) +} diff --git a/vendor/github.com/argoproj/argo-cd/v3/util/io/path/resolved.go b/vendor/github.com/argoproj/argo-cd/v3/util/io/path/resolved.go index f5dd215d2..55aec4e52 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/util/io/path/resolved.go +++ b/vendor/github.com/argoproj/argo-cd/v3/util/io/path/resolved.go @@ -26,8 +26,7 @@ func resolveSymbolicLinkRecursive(path string, maxDepth int) (string, error) { resolved, err := os.Readlink(path) if err != nil { // path is not a symbolic link - var pathErr *os.PathError - if errors.As(err, &pathErr) { + if _, ok := errors.AsType[*os.PathError](err); ok { return path, nil } // Other error has occurred diff --git a/vendor/github.com/argoproj/argo-cd/v3/util/rbac/rbac.go b/vendor/github.com/argoproj/argo-cd/v3/util/rbac/rbac.go index 2c21879ae..da34f962b 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/util/rbac/rbac.go +++ b/vendor/github.com/argoproj/argo-cd/v3/util/rbac/rbac.go @@ -79,6 +79,7 @@ const ( ActionOverride = "override" ActionAction = "action" ActionInvoke = "invoke" + ActionRollback = "rollback" ) var ( @@ -103,6 +104,7 @@ var ( ActionUpdate, ActionDelete, ActionSync, + ActionRollback, ActionOverride, ActionAction, ActionInvoke, @@ -470,33 +472,7 @@ func (e *Enforcer) RunPolicyLoader(ctx context.Context, onUpdated func(cm *corev func (e *Enforcer) runInformer(ctx context.Context, onUpdated func(cm *corev1.ConfigMap) error) { cmInformer := e.newInformer() - _, err := cmInformer.AddEventHandler( - cache.ResourceEventHandlerFuncs{ - AddFunc: func(obj any) { - if cm, ok := obj.(*corev1.ConfigMap); ok { - err := e.syncUpdate(cm, onUpdated) - if err != nil { - log.Error(err) - } else { - log.Infof("RBAC ConfigMap '%s' added", e.configmap) - } - } - }, - UpdateFunc: func(old, new any) { - oldCM := old.(*corev1.ConfigMap) - newCM := new.(*corev1.ConfigMap) - if oldCM.ResourceVersion == newCM.ResourceVersion { - return - } - err := e.syncUpdate(newCM, onUpdated) - if err != nil { - log.Error(err) - } else { - log.Infof("RBAC ConfigMap '%s' updated", e.configmap) - } - }, - }, - ) + _, err := cmInformer.AddEventHandler(e.rbacConfigMapEventHandler(onUpdated)) if err != nil { log.Error(err) } @@ -505,6 +481,43 @@ func (e *Enforcer) runInformer(ctx context.Context, onUpdated func(cm *corev1.Co log.Info("rbac configmap informer cancelled") } +// rbacConfigMapEventHandler returns the informer event handlers for the RBAC ConfigMap. +// Add and update events resync the enforcer's policy from the ConfigMap via syncUpdate. +// Updates whose ResourceVersion is unchanged (e.g. informer resyncs) are skipped. The +// type assertions are guarded so that unexpected object types (including +// cache.DeletedFinalStateUnknown tombstones, which carry no UpdateFunc) are safely +// ignored rather than causing a panic. +func (e *Enforcer) rbacConfigMapEventHandler(onUpdated func(cm *corev1.ConfigMap) error) cache.ResourceEventHandlerFuncs { + return cache.ResourceEventHandlerFuncs{ + AddFunc: func(obj any) { + if cm, ok := obj.(*corev1.ConfigMap); ok { + err := e.syncUpdate(cm, onUpdated) + if err != nil { + log.Error(err) + } else { + log.Infof("RBAC ConfigMap '%s' added", e.configmap) + } + } + }, + UpdateFunc: func(old, new any) { + oldCM, oldOK := old.(*corev1.ConfigMap) + newCM, newOK := new.(*corev1.ConfigMap) + if !oldOK || !newOK { + return + } + if oldCM.ResourceVersion == newCM.ResourceVersion { + return + } + err := e.syncUpdate(newCM, onUpdated) + if err != nil { + log.Error(err) + } else { + log.Infof("RBAC ConfigMap '%s' updated", e.configmap) + } + }, + } +} + // PolicyCSV will generate the final policy csv to be used // by Argo CD RBAC. It will find entries in the given data // that matches the policy key name convention: diff --git a/vendor/github.com/argoproj/argo-cd/v3/util/regex/regex.go b/vendor/github.com/argoproj/argo-cd/v3/util/regex/regex.go index 9ff73b849..a6658a76f 100644 --- a/vendor/github.com/argoproj/argo-cd/v3/util/regex/regex.go +++ b/vendor/github.com/argoproj/argo-cd/v3/util/regex/regex.go @@ -1,12 +1,12 @@ package regex import ( - "github.com/dlclark/regexp2" + "github.com/dlclark/regexp2/v2" log "github.com/sirupsen/logrus" ) func Match(pattern, text string) bool { - compiledRegex, err := regexp2.Compile(pattern, 0) + compiledRegex, err := regexp2.Compile(pattern) if err != nil { log.Warnf("failed to compile pattern %s due to error %v", pattern, err) return false diff --git a/vendor/github.com/bombsimon/logrusr/v4/.golangci.yaml b/vendor/github.com/bombsimon/logrusr/v4/.golangci.yaml new file mode 100644 index 000000000..07c4407a8 --- /dev/null +++ b/vendor/github.com/bombsimon/logrusr/v4/.golangci.yaml @@ -0,0 +1,118 @@ +version: "2" + +run: + issues-exit-code: 1 + tests: true + +issues: + max-issues-per-linter: 0 + max-same-issues: 0 + +output: + formats: + text: + path: stdout + print-issued-lines: false + +linters: + default: none + enable: + - asasalint + - asciicheck + - bidichk + - containedctx + - contextcheck + - decorder + - dupl + - dupword + - durationcheck + - errcheck + - errchkjson + - errname + - errorlint + - exhaustive + - forbidigo + - forcetypeassert + - gochecknoglobals + - gochecknoinits + - gocritic + - godot + - godox + - gomoddirectives + - goprintffuncname + - gosec + - gosmopolitan + - govet + - grouper + - importas + - ineffassign + - interfacebloat + - lll + - loggercheck + - makezero + - mirror + - misspell + - mnd + - musttag + - nakedret + - nilerr + - nilnil + - noctx + - nolintlint + - nonamedreturns + - nosprintfhostport + - prealloc + - predeclared + - promlinter + - reassign + - revive + - rowserrcheck + - sqlclosecheck + - staticcheck + - tagalign + - tagliatelle + - testableexamples + - thelper + - unconvert + - unparam + - unused + - usestdlibvars + - wastedassign + - whitespace + - wrapcheck + - wsl_v5 + + settings: + misspell: + locale: US + + exclusions: + generated: lax + rules: + - linters: + - revive + text: "^package-comments:" + paths: + - third_party$ + - builtin$ + - examples$ + - example/.* + +formatters: + enable: + - gofmt + - gofumpt + - goimports + exclusions: + generated: lax + paths: + - third_party$ + - builtin$ + - examples$ + + settings: + gofmt: + simplify: true + rewrite-rules: + - pattern: "interface{}" + replacement: "any" diff --git a/vendor/github.com/bombsimon/logrusr/v4/logrusr.go b/vendor/github.com/bombsimon/logrusr/v4/logrusr.go index 3c1519969..bd1590141 100644 --- a/vendor/github.com/bombsimon/logrusr/v4/logrusr.go +++ b/vendor/github.com/bombsimon/logrusr/v4/logrusr.go @@ -11,16 +11,21 @@ import ( "github.com/sirupsen/logrus" ) -// According to the specification of the Logger interface calling the InfoLogger -// directly on the logger should be the same as calling them on V(0). Since -// logrus level 0 is PanicLevel and Infolevel doesn't start until V(4) we use -// this constant to be able to calculate what V(n) values should mean. -const logrusDiffToInfo = 4 +const ( + // According to the specification of the Logger interface calling the InfoLogger + // directly on the logger should be the same as calling them on V(0). Since + // logrus level 0 is PanicLevel and Infolevel doesn't start until V(4) we use + // this constant to be able to calculate what V(n) values should mean. + logrusDiffToInfo = 4 + + // Frames to skip when fetching caller. + logrusCallFramesSkip = 3 +) // FormatFunc is the function to format log values with for non primitive data. // If this is not set (default) all unknown types will be JSON marshaled and // added as a string. -type FormatFunc func(interface{}) interface{} +type FormatFunc func(any) any // Option is options to give when construction a logrusr logger. type Option func(l *logrusr) @@ -102,12 +107,13 @@ func (l *logrusr) Enabled(level int) bool { // logrus.InfoLevel has value 4 so if the level on the logger is set to 0 we // should only be seen as enabled if the logrus logger has a severity of // info or higher. + //nolint:gosec // We can't affect the types return l.logger.Logger.IsLevelEnabled(logrus.Level(level + logrusDiffToInfo)) } // Info logs info messages if the logger is enabled, that is if the level on the // logger is set to logrus.InfoLevel or less. -func (l *logrusr) Info(level int, msg string, keysAndValues ...interface{}) { +func (l *logrusr) Info(level int, msg string, keysAndValues ...any) { log := l.logger if c := l.caller(); c != "" { log = log.WithField("caller", c) @@ -115,13 +121,14 @@ func (l *logrusr) Info(level int, msg string, keysAndValues ...interface{}) { log. WithFields(listToLogrusFields(l.formatter, keysAndValues...)). + //nolint:gosec // We can't affect the types Log(logrus.Level(level+logrusDiffToInfo), msg) } // Error logs error messages. Since the log will be written with `Error` level // it won't show if the severity of the underlying logrus logger is less than // Error. -func (l *logrusr) Error(err error, msg string, keysAndValues ...interface{}) { +func (l *logrusr) Error(err error, msg string, keysAndValues ...any) { log := l.logger if c := l.caller(); c != "" { log = log.WithField("caller", c) @@ -137,7 +144,7 @@ func (l *logrusr) Error(err error, msg string, keysAndValues ...interface{}) { // equivalent to logrus WithFields() but takes a list of even arguments // (key/value pairs) instead of a map as input. If an odd number of arguments // are sent all values will be discarded. -func (l *logrusr) WithValues(keysAndValues ...interface{}) logr.LogSink { +func (l *logrusr) WithValues(keysAndValues ...any) logr.LogSink { newLogger := l.copyLogger() newLogger.logger = newLogger.logger.WithFields( listToLogrusFields(l.formatter, keysAndValues...), @@ -160,7 +167,7 @@ func (l *logrusr) WithName(name string) logr.LogSink { } // listToLogrusFields converts a list of arbitrary length to key/value paris. -func listToLogrusFields(formatter FormatFunc, keysAndValues ...interface{}) logrus.Fields { +func listToLogrusFields(formatter FormatFunc, keysAndValues ...any) logrus.Fields { f := make(logrus.Fields) // Skip all fields if it's not an even length list. @@ -186,7 +193,7 @@ func listToLogrusFields(formatter FormatFunc, keysAndValues ...interface{}) logr case int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64, float32, float64, complex64, complex128, - string, bool: + string, bool, error: f[s] = vVal case []byte: @@ -196,6 +203,7 @@ func listToLogrusFields(formatter FormatFunc, keysAndValues ...interface{}) logr if formatter != nil { f[s] = formatter(v) } else { + //nolint:errchkjson // This is just best effort j, _ := json.Marshal(vVal) f[s] = string(j) } @@ -240,7 +248,7 @@ func (l *logrusr) caller() string { // +1 for this frame. // +1 for frame calling here (Info/Error) // +1 for logr frame - _, file, line, ok := runtime.Caller(l.depth + 3) + _, file, line, ok := runtime.Caller(l.depth + logrusCallFramesSkip) if !ok { return "" } diff --git a/vendor/github.com/dlclark/regexp2/.travis.yml b/vendor/github.com/dlclark/regexp2/.travis.yml deleted file mode 100644 index a2da6be47..000000000 --- a/vendor/github.com/dlclark/regexp2/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: go -arch: - - AMD64 - - ppc64le -go: - - 1.9 - - tip diff --git a/vendor/github.com/dlclark/regexp2/README.md b/vendor/github.com/dlclark/regexp2/README.md deleted file mode 100644 index 3d56cf3eb..000000000 --- a/vendor/github.com/dlclark/regexp2/README.md +++ /dev/null @@ -1,174 +0,0 @@ -# regexp2 - full featured regular expressions for Go -Regexp2 is a feature-rich RegExp engine for Go. It doesn't have constant time guarantees like the built-in `regexp` package, but it allows backtracking and is compatible with Perl5 and .NET. You'll likely be better off with the RE2 engine from the `regexp` package and should only use this if you need to write very complex patterns or require compatibility with .NET. - -## Basis of the engine -The engine is ported from the .NET framework's System.Text.RegularExpressions.Regex engine. That engine was open sourced in 2015 under the MIT license. There are some fundamental differences between .NET strings and Go strings that required a bit of borrowing from the Go framework regex engine as well. I cleaned up a couple of the dirtier bits during the port (regexcharclass.cs was terrible), but the parse tree, code emmitted, and therefore patterns matched should be identical. - -## New Code Generation -For extra performance use `regexp2` with [`regexp2cg`](https://github.com/dlclark/regexp2cg). It is a code generation utility for `regexp2` and you can likely improve your regexp runtime performance by 3-10x in hot code paths. As always you should benchmark your specifics to confirm the results. Give it a try! - -## Installing -This is a go-gettable library, so install is easy: - - go get github.com/dlclark/regexp2 - -To use the new Code Generation (while it's in beta) you'll need to use the `code_gen` branch: - - go get github.com/dlclark/regexp2@code_gen - -## Usage -Usage is similar to the Go `regexp` package. Just like in `regexp`, you start by converting a regex into a state machine via the `Compile` or `MustCompile` methods. They ultimately do the same thing, but `MustCompile` will panic if the regex is invalid. You can then use the provided `Regexp` struct to find matches repeatedly. A `Regexp` struct is safe to use across goroutines. - -```go -re := regexp2.MustCompile(`Your pattern`, 0) -if isMatch, _ := re.MatchString(`Something to match`); isMatch { - //do something -} -``` - -The only error that the `*Match*` methods *should* return is a Timeout if you set the `re.MatchTimeout` field. Any other error is a bug in the `regexp2` package. If you need more details about capture groups in a match then use the `FindStringMatch` method, like so: - -```go -if m, _ := re.FindStringMatch(`Something to match`); m != nil { - // the whole match is always group 0 - fmt.Printf("Group 0: %v\n", m.String()) - - // you can get all the groups too - gps := m.Groups() - - // a group can be captured multiple times, so each cap is separately addressable - fmt.Printf("Group 1, first capture", gps[1].Captures[0].String()) - fmt.Printf("Group 1, second capture", gps[1].Captures[1].String()) -} -``` - -Group 0 is embedded in the Match. Group 0 is an automatically-assigned group that encompasses the whole pattern. This means that `m.String()` is the same as `m.Group.String()` and `m.Groups()[0].String()` - -The __last__ capture is embedded in each group, so `g.String()` will return the same thing as `g.Capture.String()` and `g.Captures[len(g.Captures)-1].String()`. - -If you want to find multiple matches from a single input string you should use the `FindNextMatch` method. For example, to implement a function similar to `regexp.FindAllString`: - -```go -func regexp2FindAllString(re *regexp2.Regexp, s string) []string { - var matches []string - m, _ := re.FindStringMatch(s) - for m != nil { - matches = append(matches, m.String()) - m, _ = re.FindNextMatch(m) - } - return matches -} -``` - -`FindNextMatch` is optmized so that it re-uses the underlying string/rune slice. - -The internals of `regexp2` always operate on `[]rune` so `Index` and `Length` data in a `Match` always reference a position in `rune`s rather than `byte`s (even if the input was given as a string). This is a dramatic difference between `regexp` and `regexp2`. It's advisable to use the provided `String()` methods to avoid having to work with indices. - -## Compare `regexp` and `regexp2` -| Category | regexp | regexp2 | -| --- | --- | --- | -| Catastrophic backtracking possible | no, constant execution time guarantees | yes, if your pattern is at risk you can use the `re.MatchTimeout` field | -| Python-style capture groups `(?Pre)` | yes | no (yes in RE2 compat mode) | -| .NET-style capture groups `(?re)` or `(?'name're)` | yes | yes | -| comments `(?#comment)` | no | yes | -| branch numbering reset `(?\|a\|b)` | no | no | -| possessive match `(?>re)` | no | yes | -| positive lookahead `(?=re)` | no | yes | -| negative lookahead `(?!re)` | no | yes | -| positive lookbehind `(?<=re)` | no | yes | -| negative lookbehind `(?re)`) -* change singleline behavior for `$` to only match end of string (like RE2) (see [#24](https://github.com/dlclark/regexp2/issues/24)) -* change the character classes `\d` `\s` and `\w` to match the same characters as RE2. NOTE: if you also use the `ECMAScript` option then this will change the `\s` character class to match ECMAScript instead of RE2. ECMAScript allows more whitespace characters in `\s` than RE2 (but still fewer than the the default behavior). -* allow character escape sequences to have defaults. For example, by default `\_` isn't a known character escape and will fail to compile, but in RE2 mode it will match the literal character `_` - -```go -re := regexp2.MustCompile(`Your RE2-compatible pattern`, regexp2.RE2) -if isMatch, _ := re.MatchString(`Something to match`); isMatch { - //do something -} -``` - -This feature is a work in progress and I'm open to ideas for more things to put here (maybe more relaxed character escaping rules?). - -## Catastrophic Backtracking and Timeouts - -`regexp2` supports features that can lead to catastrophic backtracking. -`Regexp.MatchTimeout` can be set to to limit the impact of such behavior; the -match will fail with an error after approximately MatchTimeout. No timeout -checks are done by default. - -Timeout checking is not free. The current timeout checking implementation starts -a background worker that updates a clock value approximately once every 100 -milliseconds. The matching code compares this value against the precomputed -deadline for the match. The performance impact is as follows. - -1. A match with a timeout runs almost as fast as a match without a timeout. -2. If any live matches have a timeout, there will be a background CPU load - (`~0.15%` currently on a modern machine). This load will remain constant - regardless of the number of matches done including matches done in parallel. -3. If no live matches are using a timeout, the background load will remain - until the longest deadline (match timeout + the time when the match started) - is reached. E.g., if you set a timeout of one minute the load will persist - for approximately a minute even if the match finishes quickly. - -See [PR #58](https://github.com/dlclark/regexp2/pull/58) for more details and -alternatives considered. - -## Goroutine leak error -If you're using a library during unit tests (e.g. https://github.com/uber-go/goleak) that validates all goroutines are exited then you'll likely get an error if you or any of your dependencies use regex's with a MatchTimeout. -To remedy the problem you'll need to tell the unit test to wait until the backgroup timeout goroutine is exited. - -```go -func TestSomething(t *testing.T) { - defer goleak.VerifyNone(t) - defer regexp2.StopTimeoutClock() - - // ... test -} - -//or - -func TestMain(m *testing.M) { - // setup - // ... - - // run - m.Run() - - //tear down - regexp2.StopTimeoutClock() - goleak.VerifyNone(t) -} -``` - -This will add ~100ms runtime to each test (or TestMain). If that's too much time you can set the clock cycle rate of the timeout goroutine in an init function in a test file. `regexp2.SetTimeoutCheckPeriod` isn't threadsafe so it must be setup before starting any regex's with Timeouts. - -```go -func init() { - //speed up testing by making the timeout clock 1ms - regexp2.SetTimeoutCheckPeriod(time.Millisecond) -} -``` - -## ECMAScript compatibility mode -In this mode the engine provides compatibility with the [regex engine](https://tc39.es/ecma262/multipage/text-processing.html#sec-regexp-regular-expression-objects) described in the ECMAScript specification. - -Additionally a Unicode mode is provided which allows parsing of `\u{CodePoint}` syntax that is only when both are provided. - -## Library features that I'm still working on -- Regex split - -## Potential bugs -I've run a battery of tests against regexp2 from various sources and found the debug output matches the .NET engine, but .NET and Go handle strings very differently. I've attempted to handle these differences, but most of my testing deals with basic ASCII with a little bit of multi-byte Unicode. There's a chance that there are bugs in the string handling related to character sets with supplementary Unicode chars. Right-to-Left support is coded, but not well tested either. - -## Find a bug? -I'm open to new issues and pull requests with tests if you find something odd! diff --git a/vendor/github.com/dlclark/regexp2/match.go b/vendor/github.com/dlclark/regexp2/match.go deleted file mode 100644 index 759cf8ccf..000000000 --- a/vendor/github.com/dlclark/regexp2/match.go +++ /dev/null @@ -1,349 +0,0 @@ -package regexp2 - -import ( - "bytes" - "fmt" -) - -// Match is a single regex result match that contains groups and repeated captures -// -// -Groups -// -Capture -type Match struct { - Group //embeded group 0 - - regex *Regexp - otherGroups []Group - - // input to the match - textpos int - textstart int - - capcount int - caps []int - sparseCaps map[int]int - - // output from the match - matches [][]int - matchcount []int - - // whether we've done any balancing with this match. If we - // have done balancing, we'll need to do extra work in Tidy(). - balancing bool -} - -// Group is an explicit or implit (group 0) matched group within the pattern -type Group struct { - Capture // the last capture of this group is embeded for ease of use - - Name string // group name - Captures []Capture // captures of this group -} - -// Capture is a single capture of text within the larger original string -type Capture struct { - // the original string - text []rune - // Index is the position in the underlying rune slice where the first character of - // captured substring was found. Even if you pass in a string this will be in Runes. - Index int - // Length is the number of runes in the captured substring. - Length int -} - -// String returns the captured text as a String -func (c *Capture) String() string { - return string(c.text[c.Index : c.Index+c.Length]) -} - -// Runes returns the captured text as a rune slice -func (c *Capture) Runes() []rune { - return c.text[c.Index : c.Index+c.Length] -} - -func newMatch(regex *Regexp, capcount int, text []rune, startpos int) *Match { - m := Match{ - regex: regex, - matchcount: make([]int, capcount), - matches: make([][]int, capcount), - textstart: startpos, - balancing: false, - } - m.Name = "0" - m.text = text - m.matches[0] = make([]int, 2) - return &m -} - -func newMatchSparse(regex *Regexp, caps map[int]int, capcount int, text []rune, startpos int) *Match { - m := newMatch(regex, capcount, text, startpos) - m.sparseCaps = caps - return m -} - -func (m *Match) reset(text []rune, textstart int) { - m.text = text - m.textstart = textstart - for i := 0; i < len(m.matchcount); i++ { - m.matchcount[i] = 0 - } - m.balancing = false -} - -func (m *Match) tidy(textpos int) { - - interval := m.matches[0] - m.Index = interval[0] - m.Length = interval[1] - m.textpos = textpos - m.capcount = m.matchcount[0] - //copy our root capture to the list - m.Group.Captures = []Capture{m.Group.Capture} - - if m.balancing { - // The idea here is that we want to compact all of our unbalanced captures. To do that we - // use j basically as a count of how many unbalanced captures we have at any given time - // (really j is an index, but j/2 is the count). First we skip past all of the real captures - // until we find a balance captures. Then we check each subsequent entry. If it's a balance - // capture (it's negative), we decrement j. If it's a real capture, we increment j and copy - // it down to the last free position. - for cap := 0; cap < len(m.matchcount); cap++ { - limit := m.matchcount[cap] * 2 - matcharray := m.matches[cap] - - var i, j int - - for i = 0; i < limit; i++ { - if matcharray[i] < 0 { - break - } - } - - for j = i; i < limit; i++ { - if matcharray[i] < 0 { - // skip negative values - j-- - } else { - // but if we find something positive (an actual capture), copy it back to the last - // unbalanced position. - if i != j { - matcharray[j] = matcharray[i] - } - j++ - } - } - - m.matchcount[cap] = j / 2 - } - - m.balancing = false - } -} - -// isMatched tells if a group was matched by capnum -func (m *Match) isMatched(cap int) bool { - return cap < len(m.matchcount) && m.matchcount[cap] > 0 && m.matches[cap][m.matchcount[cap]*2-1] != (-3+1) -} - -// matchIndex returns the index of the last specified matched group by capnum -func (m *Match) matchIndex(cap int) int { - i := m.matches[cap][m.matchcount[cap]*2-2] - if i >= 0 { - return i - } - - return m.matches[cap][-3-i] -} - -// matchLength returns the length of the last specified matched group by capnum -func (m *Match) matchLength(cap int) int { - i := m.matches[cap][m.matchcount[cap]*2-1] - if i >= 0 { - return i - } - - return m.matches[cap][-3-i] -} - -// Nonpublic builder: add a capture to the group specified by "c" -func (m *Match) addMatch(c, start, l int) { - - if m.matches[c] == nil { - m.matches[c] = make([]int, 2) - } - - capcount := m.matchcount[c] - - if capcount*2+2 > len(m.matches[c]) { - oldmatches := m.matches[c] - newmatches := make([]int, capcount*8) - copy(newmatches, oldmatches[:capcount*2]) - m.matches[c] = newmatches - } - - m.matches[c][capcount*2] = start - m.matches[c][capcount*2+1] = l - m.matchcount[c] = capcount + 1 - //log.Printf("addMatch: c=%v, i=%v, l=%v ... matches: %v", c, start, l, m.matches) -} - -// Nonpublic builder: Add a capture to balance the specified group. This is used by the -// -// balanced match construct. (?...) -// -// If there were no such thing as backtracking, this would be as simple as calling RemoveMatch(c). -// However, since we have backtracking, we need to keep track of everything. -func (m *Match) balanceMatch(c int) { - m.balancing = true - - // we'll look at the last capture first - capcount := m.matchcount[c] - target := capcount*2 - 2 - - // first see if it is negative, and therefore is a reference to the next available - // capture group for balancing. If it is, we'll reset target to point to that capture. - if m.matches[c][target] < 0 { - target = -3 - m.matches[c][target] - } - - // move back to the previous capture - target -= 2 - - // if the previous capture is a reference, just copy that reference to the end. Otherwise, point to it. - if target >= 0 && m.matches[c][target] < 0 { - m.addMatch(c, m.matches[c][target], m.matches[c][target+1]) - } else { - m.addMatch(c, -3-target, -4-target /* == -3 - (target + 1) */) - } -} - -// Nonpublic builder: removes a group match by capnum -func (m *Match) removeMatch(c int) { - m.matchcount[c]-- -} - -// GroupCount returns the number of groups this match has matched -func (m *Match) GroupCount() int { - return len(m.matchcount) -} - -// GroupByName returns a group based on the name of the group, or nil if the group name does not exist -func (m *Match) GroupByName(name string) *Group { - num := m.regex.GroupNumberFromName(name) - if num < 0 { - return nil - } - return m.GroupByNumber(num) -} - -// GroupByNumber returns a group based on the number of the group, or nil if the group number does not exist -func (m *Match) GroupByNumber(num int) *Group { - // check our sparse map - if m.sparseCaps != nil { - if newNum, ok := m.sparseCaps[num]; ok { - num = newNum - } - } - if num >= len(m.matchcount) || num < 0 { - return nil - } - - if num == 0 { - return &m.Group - } - - m.populateOtherGroups() - - return &m.otherGroups[num-1] -} - -// Groups returns all the capture groups, starting with group 0 (the full match) -func (m *Match) Groups() []Group { - m.populateOtherGroups() - g := make([]Group, len(m.otherGroups)+1) - g[0] = m.Group - copy(g[1:], m.otherGroups) - return g -} - -func (m *Match) populateOtherGroups() { - // Construct all the Group objects first time called - if m.otherGroups == nil { - m.otherGroups = make([]Group, len(m.matchcount)-1) - for i := 0; i < len(m.otherGroups); i++ { - m.otherGroups[i] = newGroup(m.regex.GroupNameFromNumber(i+1), m.text, m.matches[i+1], m.matchcount[i+1]) - } - } -} - -func (m *Match) groupValueAppendToBuf(groupnum int, buf *bytes.Buffer) { - c := m.matchcount[groupnum] - if c == 0 { - return - } - - matches := m.matches[groupnum] - - index := matches[(c-1)*2] - last := index + matches[(c*2)-1] - - for ; index < last; index++ { - buf.WriteRune(m.text[index]) - } -} - -func newGroup(name string, text []rune, caps []int, capcount int) Group { - g := Group{} - g.text = text - if capcount > 0 { - g.Index = caps[(capcount-1)*2] - g.Length = caps[(capcount*2)-1] - } - g.Name = name - g.Captures = make([]Capture, capcount) - for i := 0; i < capcount; i++ { - g.Captures[i] = Capture{ - text: text, - Index: caps[i*2], - Length: caps[i*2+1], - } - } - //log.Printf("newGroup! capcount %v, %+v", capcount, g) - - return g -} - -func (m *Match) dump() string { - buf := &bytes.Buffer{} - buf.WriteRune('\n') - if len(m.sparseCaps) > 0 { - for k, v := range m.sparseCaps { - fmt.Fprintf(buf, "Slot %v -> %v\n", k, v) - } - } - - for i, g := range m.Groups() { - fmt.Fprintf(buf, "Group %v (%v), %v caps:\n", i, g.Name, len(g.Captures)) - - for _, c := range g.Captures { - fmt.Fprintf(buf, " (%v, %v) %v\n", c.Index, c.Length, c.String()) - } - } - /* - for i := 0; i < len(m.matchcount); i++ { - fmt.Fprintf(buf, "\nGroup %v (%v):\n", i, m.regex.GroupNameFromNumber(i)) - - for j := 0; j < m.matchcount[i]; j++ { - text := "" - - if m.matches[i][j*2] >= 0 { - start := m.matches[i][j*2] - text = m.text[start : start+m.matches[i][j*2+1]] - } - - fmt.Fprintf(buf, " (%v, %v) %v\n", m.matches[i][j*2], m.matches[i][j*2+1], text) - } - } - */ - return buf.String() -} diff --git a/vendor/github.com/dlclark/regexp2/regexp.go b/vendor/github.com/dlclark/regexp2/regexp.go deleted file mode 100644 index a7ddbaf35..000000000 --- a/vendor/github.com/dlclark/regexp2/regexp.go +++ /dev/null @@ -1,395 +0,0 @@ -/* -Package regexp2 is a regexp package that has an interface similar to Go's framework regexp engine but uses a -more feature full regex engine behind the scenes. - -It doesn't have constant time guarantees, but it allows backtracking and is compatible with Perl5 and .NET. -You'll likely be better off with the RE2 engine from the regexp package and should only use this if you -need to write very complex patterns or require compatibility with .NET. -*/ -package regexp2 - -import ( - "errors" - "math" - "strconv" - "sync" - "time" - - "github.com/dlclark/regexp2/syntax" -) - -var ( - // DefaultMatchTimeout used when running regexp matches -- "forever" - DefaultMatchTimeout = time.Duration(math.MaxInt64) - // DefaultUnmarshalOptions used when unmarshaling a regex from text - DefaultUnmarshalOptions = None -) - -// Regexp is the representation of a compiled regular expression. -// A Regexp is safe for concurrent use by multiple goroutines. -type Regexp struct { - // A match will time out if it takes (approximately) more than - // MatchTimeout. This is a safety check in case the match - // encounters catastrophic backtracking. The default value - // (DefaultMatchTimeout) causes all time out checking to be - // suppressed. - MatchTimeout time.Duration - - // read-only after Compile - pattern string // as passed to Compile - options RegexOptions // options - - caps map[int]int // capnum->index - capnames map[string]int //capture group name -> index - capslist []string //sorted list of capture group names - capsize int // size of the capture array - - code *syntax.Code // compiled program - - // cache of machines for running regexp - muRun *sync.Mutex - runner []*runner -} - -// Compile parses a regular expression and returns, if successful, -// a Regexp object that can be used to match against text. -func Compile(expr string, opt RegexOptions) (*Regexp, error) { - // parse it - tree, err := syntax.Parse(expr, syntax.RegexOptions(opt)) - if err != nil { - return nil, err - } - - // translate it to code - code, err := syntax.Write(tree) - if err != nil { - return nil, err - } - - // return it - return &Regexp{ - pattern: expr, - options: opt, - caps: code.Caps, - capnames: tree.Capnames, - capslist: tree.Caplist, - capsize: code.Capsize, - code: code, - MatchTimeout: DefaultMatchTimeout, - muRun: &sync.Mutex{}, - }, nil -} - -// MustCompile is like Compile but panics if the expression cannot be parsed. -// It simplifies safe initialization of global variables holding compiled regular -// expressions. -func MustCompile(str string, opt RegexOptions) *Regexp { - regexp, error := Compile(str, opt) - if error != nil { - panic(`regexp2: Compile(` + quote(str) + `): ` + error.Error()) - } - return regexp -} - -// Escape adds backslashes to any special characters in the input string -func Escape(input string) string { - return syntax.Escape(input) -} - -// Unescape removes any backslashes from previously-escaped special characters in the input string -func Unescape(input string) (string, error) { - return syntax.Unescape(input) -} - -// SetTimeoutPeriod is a debug function that sets the frequency of the timeout goroutine's sleep cycle. -// Defaults to 100ms. The only benefit of setting this lower is that the 1 background goroutine that manages -// timeouts may exit slightly sooner after all the timeouts have expired. See Github issue #63 -func SetTimeoutCheckPeriod(d time.Duration) { - clockPeriod = d -} - -// StopTimeoutClock should only be used in unit tests to prevent the timeout clock goroutine -// from appearing like a leaking goroutine -func StopTimeoutClock() { - stopClock() -} - -// String returns the source text used to compile the regular expression. -func (re *Regexp) String() string { - return re.pattern -} - -func quote(s string) string { - if strconv.CanBackquote(s) { - return "`" + s + "`" - } - return strconv.Quote(s) -} - -// RegexOptions impact the runtime and parsing behavior -// for each specific regex. They are setable in code as well -// as in the regex pattern itself. -type RegexOptions int32 - -const ( - None RegexOptions = 0x0 - IgnoreCase = 0x0001 // "i" - Multiline = 0x0002 // "m" - ExplicitCapture = 0x0004 // "n" - Compiled = 0x0008 // "c" - Singleline = 0x0010 // "s" - IgnorePatternWhitespace = 0x0020 // "x" - RightToLeft = 0x0040 // "r" - Debug = 0x0080 // "d" - ECMAScript = 0x0100 // "e" - RE2 = 0x0200 // RE2 (regexp package) compatibility mode - Unicode = 0x0400 // "u" -) - -func (re *Regexp) RightToLeft() bool { - return re.options&RightToLeft != 0 -} - -func (re *Regexp) Debug() bool { - return re.options&Debug != 0 -} - -// Replace searches the input string and replaces each match found with the replacement text. -// Count will limit the number of matches attempted and startAt will allow -// us to skip past possible matches at the start of the input (left or right depending on RightToLeft option). -// Set startAt and count to -1 to go through the whole string -func (re *Regexp) Replace(input, replacement string, startAt, count int) (string, error) { - data, err := syntax.NewReplacerData(replacement, re.caps, re.capsize, re.capnames, syntax.RegexOptions(re.options)) - if err != nil { - return "", err - } - //TODO: cache ReplacerData - - return replace(re, data, nil, input, startAt, count) -} - -// ReplaceFunc searches the input string and replaces each match found using the string from the evaluator -// Count will limit the number of matches attempted and startAt will allow -// us to skip past possible matches at the start of the input (left or right depending on RightToLeft option). -// Set startAt and count to -1 to go through the whole string. -func (re *Regexp) ReplaceFunc(input string, evaluator MatchEvaluator, startAt, count int) (string, error) { - return replace(re, nil, evaluator, input, startAt, count) -} - -// FindStringMatch searches the input string for a Regexp match -func (re *Regexp) FindStringMatch(s string) (*Match, error) { - // convert string to runes - return re.run(false, -1, getRunes(s)) -} - -// FindRunesMatch searches the input rune slice for a Regexp match -func (re *Regexp) FindRunesMatch(r []rune) (*Match, error) { - return re.run(false, -1, r) -} - -// FindStringMatchStartingAt searches the input string for a Regexp match starting at the startAt index -func (re *Regexp) FindStringMatchStartingAt(s string, startAt int) (*Match, error) { - if startAt > len(s) { - return nil, errors.New("startAt must be less than the length of the input string") - } - r, startAt := re.getRunesAndStart(s, startAt) - if startAt == -1 { - // we didn't find our start index in the string -- that's a problem - return nil, errors.New("startAt must align to the start of a valid rune in the input string") - } - - return re.run(false, startAt, r) -} - -// FindRunesMatchStartingAt searches the input rune slice for a Regexp match starting at the startAt index -func (re *Regexp) FindRunesMatchStartingAt(r []rune, startAt int) (*Match, error) { - return re.run(false, startAt, r) -} - -// FindNextMatch returns the next match in the same input string as the match parameter. -// Will return nil if there is no next match or if given a nil match. -func (re *Regexp) FindNextMatch(m *Match) (*Match, error) { - if m == nil { - return nil, nil - } - - // If previous match was empty, advance by one before matching to prevent - // infinite loop - startAt := m.textpos - if m.Length == 0 { - if m.textpos == len(m.text) { - return nil, nil - } - - if re.RightToLeft() { - startAt-- - } else { - startAt++ - } - } - return re.run(false, startAt, m.text) -} - -// MatchString return true if the string matches the regex -// error will be set if a timeout occurs -func (re *Regexp) MatchString(s string) (bool, error) { - m, err := re.run(true, -1, getRunes(s)) - if err != nil { - return false, err - } - return m != nil, nil -} - -func (re *Regexp) getRunesAndStart(s string, startAt int) ([]rune, int) { - if startAt < 0 { - if re.RightToLeft() { - r := getRunes(s) - return r, len(r) - } - return getRunes(s), 0 - } - ret := make([]rune, len(s)) - i := 0 - runeIdx := -1 - for strIdx, r := range s { - if strIdx == startAt { - runeIdx = i - } - ret[i] = r - i++ - } - if startAt == len(s) { - runeIdx = i - } - return ret[:i], runeIdx -} - -func getRunes(s string) []rune { - return []rune(s) -} - -// MatchRunes return true if the runes matches the regex -// error will be set if a timeout occurs -func (re *Regexp) MatchRunes(r []rune) (bool, error) { - m, err := re.run(true, -1, r) - if err != nil { - return false, err - } - return m != nil, nil -} - -// GetGroupNames Returns the set of strings used to name capturing groups in the expression. -func (re *Regexp) GetGroupNames() []string { - var result []string - - if re.capslist == nil { - result = make([]string, re.capsize) - - for i := 0; i < len(result); i++ { - result[i] = strconv.Itoa(i) - } - } else { - result = make([]string, len(re.capslist)) - copy(result, re.capslist) - } - - return result -} - -// GetGroupNumbers returns the integer group numbers corresponding to a group name. -func (re *Regexp) GetGroupNumbers() []int { - var result []int - - if re.caps == nil { - result = make([]int, re.capsize) - - for i := 0; i < len(result); i++ { - result[i] = i - } - } else { - result = make([]int, len(re.caps)) - - for k, v := range re.caps { - result[v] = k - } - } - - return result -} - -// GroupNameFromNumber retrieves a group name that corresponds to a group number. -// It will return "" for and unknown group number. Unnamed groups automatically -// receive a name that is the decimal string equivalent of its number. -func (re *Regexp) GroupNameFromNumber(i int) string { - if re.capslist == nil { - if i >= 0 && i < re.capsize { - return strconv.Itoa(i) - } - - return "" - } - - if re.caps != nil { - var ok bool - if i, ok = re.caps[i]; !ok { - return "" - } - } - - if i >= 0 && i < len(re.capslist) { - return re.capslist[i] - } - - return "" -} - -// GroupNumberFromName returns a group number that corresponds to a group name. -// Returns -1 if the name is not a recognized group name. Numbered groups -// automatically get a group name that is the decimal string equivalent of its number. -func (re *Regexp) GroupNumberFromName(name string) int { - // look up name if we have a hashtable of names - if re.capnames != nil { - if k, ok := re.capnames[name]; ok { - return k - } - - return -1 - } - - // convert to an int if it looks like a number - result := 0 - for i := 0; i < len(name); i++ { - ch := name[i] - - if ch > '9' || ch < '0' { - return -1 - } - - result *= 10 - result += int(ch - '0') - } - - // return int if it's in range - if result >= 0 && result < re.capsize { - return result - } - - return -1 -} - -// MarshalText implements [encoding.TextMarshaler]. The output -// matches that of calling the [Regexp.String] method. -func (re *Regexp) MarshalText() ([]byte, error) { - return []byte(re.String()), nil -} - -// UnmarshalText implements [encoding.TextUnmarshaler] by calling -// [Compile] on the encoded value. -func (re *Regexp) UnmarshalText(text []byte) error { - newRE, err := Compile(string(text), DefaultUnmarshalOptions) - if err != nil { - return err - } - *re = *newRE - return nil -} diff --git a/vendor/github.com/dlclark/regexp2/replace.go b/vendor/github.com/dlclark/regexp2/replace.go deleted file mode 100644 index 0376bd9d3..000000000 --- a/vendor/github.com/dlclark/regexp2/replace.go +++ /dev/null @@ -1,177 +0,0 @@ -package regexp2 - -import ( - "bytes" - "errors" - - "github.com/dlclark/regexp2/syntax" -) - -const ( - replaceSpecials = 4 - replaceLeftPortion = -1 - replaceRightPortion = -2 - replaceLastGroup = -3 - replaceWholeString = -4 -) - -// MatchEvaluator is a function that takes a match and returns a replacement string to be used -type MatchEvaluator func(Match) string - -// Three very similar algorithms appear below: replace (pattern), -// replace (evaluator), and split. - -// Replace Replaces all occurrences of the regex in the string with the -// replacement pattern. -// -// Note that the special case of no matches is handled on its own: -// with no matches, the input string is returned unchanged. -// The right-to-left case is split out because StringBuilder -// doesn't handle right-to-left string building directly very well. -func replace(regex *Regexp, data *syntax.ReplacerData, evaluator MatchEvaluator, input string, startAt, count int) (string, error) { - if count < -1 { - return "", errors.New("Count too small") - } - if count == 0 { - return "", nil - } - - m, err := regex.FindStringMatchStartingAt(input, startAt) - - if err != nil { - return "", err - } - if m == nil { - return input, nil - } - - buf := &bytes.Buffer{} - text := m.text - - if !regex.RightToLeft() { - prevat := 0 - for m != nil { - if m.Index != prevat { - buf.WriteString(string(text[prevat:m.Index])) - } - prevat = m.Index + m.Length - if evaluator == nil { - replacementImpl(data, buf, m) - } else { - buf.WriteString(evaluator(*m)) - } - - count-- - if count == 0 { - break - } - m, err = regex.FindNextMatch(m) - if err != nil { - return "", nil - } - } - - if prevat < len(text) { - buf.WriteString(string(text[prevat:])) - } - } else { - prevat := len(text) - var al []string - - for m != nil { - if m.Index+m.Length != prevat { - al = append(al, string(text[m.Index+m.Length:prevat])) - } - prevat = m.Index - if evaluator == nil { - replacementImplRTL(data, &al, m) - } else { - al = append(al, evaluator(*m)) - } - - count-- - if count == 0 { - break - } - m, err = regex.FindNextMatch(m) - if err != nil { - return "", nil - } - } - - if prevat > 0 { - buf.WriteString(string(text[:prevat])) - } - - for i := len(al) - 1; i >= 0; i-- { - buf.WriteString(al[i]) - } - } - - return buf.String(), nil -} - -// Given a Match, emits into the StringBuilder the evaluated -// substitution pattern. -func replacementImpl(data *syntax.ReplacerData, buf *bytes.Buffer, m *Match) { - for _, r := range data.Rules { - - if r >= 0 { // string lookup - buf.WriteString(data.Strings[r]) - } else if r < -replaceSpecials { // group lookup - m.groupValueAppendToBuf(-replaceSpecials-1-r, buf) - } else { - switch -replaceSpecials - 1 - r { // special insertion patterns - case replaceLeftPortion: - for i := 0; i < m.Index; i++ { - buf.WriteRune(m.text[i]) - } - case replaceRightPortion: - for i := m.Index + m.Length; i < len(m.text); i++ { - buf.WriteRune(m.text[i]) - } - case replaceLastGroup: - m.groupValueAppendToBuf(m.GroupCount()-1, buf) - case replaceWholeString: - for i := 0; i < len(m.text); i++ { - buf.WriteRune(m.text[i]) - } - } - } - } -} - -func replacementImplRTL(data *syntax.ReplacerData, al *[]string, m *Match) { - l := *al - buf := &bytes.Buffer{} - - for _, r := range data.Rules { - buf.Reset() - if r >= 0 { // string lookup - l = append(l, data.Strings[r]) - } else if r < -replaceSpecials { // group lookup - m.groupValueAppendToBuf(-replaceSpecials-1-r, buf) - l = append(l, buf.String()) - } else { - switch -replaceSpecials - 1 - r { // special insertion patterns - case replaceLeftPortion: - for i := 0; i < m.Index; i++ { - buf.WriteRune(m.text[i]) - } - case replaceRightPortion: - for i := m.Index + m.Length; i < len(m.text); i++ { - buf.WriteRune(m.text[i]) - } - case replaceLastGroup: - m.groupValueAppendToBuf(m.GroupCount()-1, buf) - case replaceWholeString: - for i := 0; i < len(m.text); i++ { - buf.WriteRune(m.text[i]) - } - } - l = append(l, buf.String()) - } - } - - *al = l -} diff --git a/vendor/github.com/dlclark/regexp2/runner.go b/vendor/github.com/dlclark/regexp2/runner.go deleted file mode 100644 index 4bb0dfa1a..000000000 --- a/vendor/github.com/dlclark/regexp2/runner.go +++ /dev/null @@ -1,1614 +0,0 @@ -package regexp2 - -import ( - "bytes" - "errors" - "fmt" - "math" - "strconv" - "strings" - "time" - "unicode" - - "github.com/dlclark/regexp2/syntax" -) - -type runner struct { - re *Regexp - code *syntax.Code - - runtextstart int // starting point for search - - runtext []rune // text to search - runtextpos int // current position in text - runtextend int - - // The backtracking stack. Opcodes use this to store data regarding - // what they have matched and where to backtrack to. Each "frame" on - // the stack takes the form of [CodePosition Data1 Data2...], where - // CodePosition is the position of the current opcode and - // the data values are all optional. The CodePosition can be negative, and - // these values (also called "back2") are used by the BranchMark family of opcodes - // to indicate whether they are backtracking after a successful or failed - // match. - // When we backtrack, we pop the CodePosition off the stack, set the current - // instruction pointer to that code position, and mark the opcode - // with a backtracking flag ("Back"). Each opcode then knows how to - // handle its own data. - runtrack []int - runtrackpos int - - // This stack is used to track text positions across different opcodes. - // For example, in /(a*b)+/, the parentheses result in a SetMark/CaptureMark - // pair. SetMark records the text position before we match a*b. Then - // CaptureMark uses that position to figure out where the capture starts. - // Opcodes which push onto this stack are always paired with other opcodes - // which will pop the value from it later. A successful match should mean - // that this stack is empty. - runstack []int - runstackpos int - - // The crawl stack is used to keep track of captures. Every time a group - // has a capture, we push its group number onto the runcrawl stack. In - // the case of a balanced match, we push BOTH groups onto the stack. - runcrawl []int - runcrawlpos int - - runtrackcount int // count of states that may do backtracking - - runmatch *Match // result object - - ignoreTimeout bool - timeout time.Duration // timeout in milliseconds (needed for actual) - deadline fasttime - - operator syntax.InstOp - codepos int - rightToLeft bool - caseInsensitive bool -} - -// run searches for matches and can continue from the previous match -// -// quick is usually false, but can be true to not return matches, just put it in caches -// textstart is -1 to start at the "beginning" (depending on Right-To-Left), otherwise an index in input -// input is the string to search for our regex pattern -func (re *Regexp) run(quick bool, textstart int, input []rune) (*Match, error) { - - // get a cached runner - runner := re.getRunner() - defer re.putRunner(runner) - - if textstart < 0 { - if re.RightToLeft() { - textstart = len(input) - } else { - textstart = 0 - } - } - - return runner.scan(input, textstart, quick, re.MatchTimeout) -} - -// Scans the string to find the first match. Uses the Match object -// both to feed text in and as a place to store matches that come out. -// -// All the action is in the Go() method. Our -// responsibility is to load up the class members before -// calling Go. -// -// The optimizer can compute a set of candidate starting characters, -// and we could use a separate method Skip() that will quickly scan past -// any characters that we know can't match. -func (r *runner) scan(rt []rune, textstart int, quick bool, timeout time.Duration) (*Match, error) { - r.timeout = timeout - r.ignoreTimeout = (time.Duration(math.MaxInt64) == timeout) - r.runtextstart = textstart - r.runtext = rt - r.runtextend = len(rt) - - stoppos := r.runtextend - bump := 1 - - if r.re.RightToLeft() { - bump = -1 - stoppos = 0 - } - - r.runtextpos = textstart - initted := false - - r.startTimeoutWatch() - for { - if r.re.Debug() { - //fmt.Printf("\nSearch content: %v\n", string(r.runtext)) - fmt.Printf("\nSearch range: from 0 to %v\n", r.runtextend) - fmt.Printf("Firstchar search starting at %v stopping at %v\n", r.runtextpos, stoppos) - } - - if r.findFirstChar() { - if err := r.checkTimeout(); err != nil { - return nil, err - } - - if !initted { - r.initMatch() - initted = true - } - - if r.re.Debug() { - fmt.Printf("Executing engine starting at %v\n\n", r.runtextpos) - } - - if err := r.execute(); err != nil { - return nil, err - } - - if r.runmatch.matchcount[0] > 0 { - // We'll return a match even if it touches a previous empty match - return r.tidyMatch(quick), nil - } - - // reset state for another go - r.runtrackpos = len(r.runtrack) - r.runstackpos = len(r.runstack) - r.runcrawlpos = len(r.runcrawl) - } - - // failure! - - if r.runtextpos == stoppos { - r.tidyMatch(true) - return nil, nil - } - - // Recognize leading []* and various anchors, and bump on failure accordingly - - // r.bump by one and start again - - r.runtextpos += bump - } - // We never get here -} - -func (r *runner) execute() error { - - r.goTo(0) - - for { - - if r.re.Debug() { - r.dumpState() - } - - if err := r.checkTimeout(); err != nil { - return err - } - - switch r.operator { - case syntax.Stop: - return nil - - case syntax.Nothing: - break - - case syntax.Goto: - r.goTo(r.operand(0)) - continue - - case syntax.Testref: - if !r.runmatch.isMatched(r.operand(0)) { - break - } - r.advance(1) - continue - - case syntax.Lazybranch: - r.trackPush1(r.textPos()) - r.advance(1) - continue - - case syntax.Lazybranch | syntax.Back: - r.trackPop() - r.textto(r.trackPeek()) - r.goTo(r.operand(0)) - continue - - case syntax.Setmark: - r.stackPush(r.textPos()) - r.trackPush() - r.advance(0) - continue - - case syntax.Nullmark: - r.stackPush(-1) - r.trackPush() - r.advance(0) - continue - - case syntax.Setmark | syntax.Back, syntax.Nullmark | syntax.Back: - r.stackPop() - break - - case syntax.Getmark: - r.stackPop() - r.trackPush1(r.stackPeek()) - r.textto(r.stackPeek()) - r.advance(0) - continue - - case syntax.Getmark | syntax.Back: - r.trackPop() - r.stackPush(r.trackPeek()) - break - - case syntax.Capturemark: - if r.operand(1) != -1 && !r.runmatch.isMatched(r.operand(1)) { - break - } - r.stackPop() - if r.operand(1) != -1 { - r.transferCapture(r.operand(0), r.operand(1), r.stackPeek(), r.textPos()) - } else { - r.capture(r.operand(0), r.stackPeek(), r.textPos()) - } - r.trackPush1(r.stackPeek()) - - r.advance(2) - - continue - - case syntax.Capturemark | syntax.Back: - r.trackPop() - r.stackPush(r.trackPeek()) - r.uncapture() - if r.operand(0) != -1 && r.operand(1) != -1 { - r.uncapture() - } - - break - - case syntax.Branchmark: - r.stackPop() - - matched := r.textPos() - r.stackPeek() - - if matched != 0 { // Nonempty match -> loop now - r.trackPush2(r.stackPeek(), r.textPos()) // Save old mark, textpos - r.stackPush(r.textPos()) // Make new mark - r.goTo(r.operand(0)) // Loop - } else { // Empty match -> straight now - r.trackPushNeg1(r.stackPeek()) // Save old mark - r.advance(1) // Straight - } - continue - - case syntax.Branchmark | syntax.Back: - r.trackPopN(2) - r.stackPop() - r.textto(r.trackPeekN(1)) // Recall position - r.trackPushNeg1(r.trackPeek()) // Save old mark - r.advance(1) // Straight - continue - - case syntax.Branchmark | syntax.Back2: - r.trackPop() - r.stackPush(r.trackPeek()) // Recall old mark - break // Backtrack - - case syntax.Lazybranchmark: - { - // We hit this the first time through a lazy loop and after each - // successful match of the inner expression. It simply continues - // on and doesn't loop. - r.stackPop() - - oldMarkPos := r.stackPeek() - - if r.textPos() != oldMarkPos { // Nonempty match -> try to loop again by going to 'back' state - if oldMarkPos != -1 { - r.trackPush2(oldMarkPos, r.textPos()) // Save old mark, textpos - } else { - r.trackPush2(r.textPos(), r.textPos()) - } - } else { - // The inner expression found an empty match, so we'll go directly to 'back2' if we - // backtrack. Don't touch the grouping stack here; instead, record the old mark and - // a flag indicating that backtracking doesn't need to pop a grouping stack frame. - r.trackPushNeg2(oldMarkPos, 0) - } - r.advance(1) - continue - } - - case syntax.Lazybranchmark | syntax.Back: - - // After the first time, Lazybranchmark | syntax.Back occurs - // with each iteration of the loop, and therefore with every attempted - // match of the inner expression. We'll try to match the inner expression, - // then go back to Lazybranchmark if successful. If the inner expression - // fails, we go to Lazybranchmark | syntax.Back2 - - r.trackPopN(2) - pos := r.trackPeekN(1) - r.trackPushNeg2(r.trackPeek(), 1) // Save old mark, note that we pushed a new mark - r.stackPush(pos) // Make new mark - r.textto(pos) // Recall position - r.goTo(r.operand(0)) // Loop - continue - - case syntax.Lazybranchmark | syntax.Back2: - // The lazy loop has failed. We'll do a true backtrack and - // start over before the lazy loop. - r.trackPopN(2) - oldMark := r.trackPeek() - needsPop := r.trackPeekN(1) - if needsPop != 0 { - r.stackPop() - } - r.stackPush(oldMark) // Recall old mark - break - - case syntax.Setcount: - r.stackPush2(r.textPos(), r.operand(0)) - r.trackPush() - r.advance(1) - continue - - case syntax.Nullcount: - r.stackPush2(-1, r.operand(0)) - r.trackPush() - r.advance(1) - continue - - case syntax.Setcount | syntax.Back: - r.stackPopN(2) - break - - case syntax.Nullcount | syntax.Back: - r.stackPopN(2) - break - - case syntax.Branchcount: - // r.stackPush: - // 0: Mark - // 1: Count - - r.stackPopN(2) - mark := r.stackPeek() - count := r.stackPeekN(1) - matched := r.textPos() - mark - - if count >= r.operand(1) || (matched == 0 && count >= 0) { // Max loops or empty match -> straight now - r.trackPushNeg2(mark, count) // Save old mark, count - r.advance(2) // Straight - } else { // Nonempty match -> count+loop now - r.trackPush1(mark) // remember mark - r.stackPush2(r.textPos(), count+1) // Make new mark, incr count - r.goTo(r.operand(0)) // Loop - } - continue - - case syntax.Branchcount | syntax.Back: - // r.trackPush: - // 0: Previous mark - // r.stackPush: - // 0: Mark (= current pos, discarded) - // 1: Count - r.trackPop() - r.stackPopN(2) - if r.stackPeekN(1) > 0 { // Positive -> can go straight - r.textto(r.stackPeek()) // Zap to mark - r.trackPushNeg2(r.trackPeek(), r.stackPeekN(1)-1) // Save old mark, old count - r.advance(2) // Straight - continue - } - r.stackPush2(r.trackPeek(), r.stackPeekN(1)-1) // recall old mark, old count - break - - case syntax.Branchcount | syntax.Back2: - // r.trackPush: - // 0: Previous mark - // 1: Previous count - r.trackPopN(2) - r.stackPush2(r.trackPeek(), r.trackPeekN(1)) // Recall old mark, old count - break // Backtrack - - case syntax.Lazybranchcount: - // r.stackPush: - // 0: Mark - // 1: Count - - r.stackPopN(2) - mark := r.stackPeek() - count := r.stackPeekN(1) - - if count < 0 { // Negative count -> loop now - r.trackPushNeg1(mark) // Save old mark - r.stackPush2(r.textPos(), count+1) // Make new mark, incr count - r.goTo(r.operand(0)) // Loop - } else { // Nonneg count -> straight now - r.trackPush3(mark, count, r.textPos()) // Save mark, count, position - r.advance(2) // Straight - } - continue - - case syntax.Lazybranchcount | syntax.Back: - // r.trackPush: - // 0: Mark - // 1: Count - // 2: r.textPos - - r.trackPopN(3) - mark := r.trackPeek() - textpos := r.trackPeekN(2) - - if r.trackPeekN(1) < r.operand(1) && textpos != mark { // Under limit and not empty match -> loop - r.textto(textpos) // Recall position - r.stackPush2(textpos, r.trackPeekN(1)+1) // Make new mark, incr count - r.trackPushNeg1(mark) // Save old mark - r.goTo(r.operand(0)) // Loop - continue - } else { // Max loops or empty match -> backtrack - r.stackPush2(r.trackPeek(), r.trackPeekN(1)) // Recall old mark, count - break // backtrack - } - - case syntax.Lazybranchcount | syntax.Back2: - // r.trackPush: - // 0: Previous mark - // r.stackPush: - // 0: Mark (== current pos, discarded) - // 1: Count - r.trackPop() - r.stackPopN(2) - r.stackPush2(r.trackPeek(), r.stackPeekN(1)-1) // Recall old mark, count - break // Backtrack - - case syntax.Setjump: - r.stackPush2(r.trackpos(), r.crawlpos()) - r.trackPush() - r.advance(0) - continue - - case syntax.Setjump | syntax.Back: - r.stackPopN(2) - break - - case syntax.Backjump: - // r.stackPush: - // 0: Saved trackpos - // 1: r.crawlpos - r.stackPopN(2) - r.trackto(r.stackPeek()) - - for r.crawlpos() != r.stackPeekN(1) { - r.uncapture() - } - - break - - case syntax.Forejump: - // r.stackPush: - // 0: Saved trackpos - // 1: r.crawlpos - r.stackPopN(2) - r.trackto(r.stackPeek()) - r.trackPush1(r.stackPeekN(1)) - r.advance(0) - continue - - case syntax.Forejump | syntax.Back: - // r.trackPush: - // 0: r.crawlpos - r.trackPop() - - for r.crawlpos() != r.trackPeek() { - r.uncapture() - } - - break - - case syntax.Bol: - if r.leftchars() > 0 && r.charAt(r.textPos()-1) != '\n' { - break - } - r.advance(0) - continue - - case syntax.Eol: - if r.rightchars() > 0 && r.charAt(r.textPos()) != '\n' { - break - } - r.advance(0) - continue - - case syntax.Boundary: - if !r.isBoundary(r.textPos(), 0, r.runtextend) { - break - } - r.advance(0) - continue - - case syntax.Nonboundary: - if r.isBoundary(r.textPos(), 0, r.runtextend) { - break - } - r.advance(0) - continue - - case syntax.ECMABoundary: - if !r.isECMABoundary(r.textPos(), 0, r.runtextend) { - break - } - r.advance(0) - continue - - case syntax.NonECMABoundary: - if r.isECMABoundary(r.textPos(), 0, r.runtextend) { - break - } - r.advance(0) - continue - - case syntax.Beginning: - if r.leftchars() > 0 { - break - } - r.advance(0) - continue - - case syntax.Start: - if r.textPos() != r.textstart() { - break - } - r.advance(0) - continue - - case syntax.EndZ: - rchars := r.rightchars() - if rchars > 1 { - break - } - // RE2 and EcmaScript define $ as "asserts position at the end of the string" - // PCRE/.NET adds "or before the line terminator right at the end of the string (if any)" - if (r.re.options & (RE2 | ECMAScript)) != 0 { - // RE2/Ecmascript mode - if rchars > 0 { - break - } - } else if rchars == 1 && r.charAt(r.textPos()) != '\n' { - // "regular" mode - break - } - - r.advance(0) - continue - - case syntax.End: - if r.rightchars() > 0 { - break - } - r.advance(0) - continue - - case syntax.One: - if r.forwardchars() < 1 || r.forwardcharnext() != rune(r.operand(0)) { - break - } - - r.advance(1) - continue - - case syntax.Notone: - if r.forwardchars() < 1 || r.forwardcharnext() == rune(r.operand(0)) { - break - } - - r.advance(1) - continue - - case syntax.Set: - - if r.forwardchars() < 1 || !r.code.Sets[r.operand(0)].CharIn(r.forwardcharnext()) { - break - } - - r.advance(1) - continue - - case syntax.Multi: - if !r.runematch(r.code.Strings[r.operand(0)]) { - break - } - - r.advance(1) - continue - - case syntax.Ref: - - capnum := r.operand(0) - - if r.runmatch.isMatched(capnum) { - if !r.refmatch(r.runmatch.matchIndex(capnum), r.runmatch.matchLength(capnum)) { - break - } - } else { - if (r.re.options & ECMAScript) == 0 { - break - } - } - - r.advance(1) - continue - - case syntax.Onerep: - - c := r.operand(1) - - if r.forwardchars() < c { - break - } - - ch := rune(r.operand(0)) - - for c > 0 { - if r.forwardcharnext() != ch { - goto BreakBackward - } - c-- - } - - r.advance(2) - continue - - case syntax.Notonerep: - - c := r.operand(1) - - if r.forwardchars() < c { - break - } - ch := rune(r.operand(0)) - - for c > 0 { - if r.forwardcharnext() == ch { - goto BreakBackward - } - c-- - } - - r.advance(2) - continue - - case syntax.Setrep: - - c := r.operand(1) - - if r.forwardchars() < c { - break - } - - set := r.code.Sets[r.operand(0)] - - for c > 0 { - if !set.CharIn(r.forwardcharnext()) { - goto BreakBackward - } - c-- - } - - r.advance(2) - continue - - case syntax.Oneloop: - - c := r.operand(1) - - if c > r.forwardchars() { - c = r.forwardchars() - } - - ch := rune(r.operand(0)) - i := c - - for ; i > 0; i-- { - if r.forwardcharnext() != ch { - r.backwardnext() - break - } - } - - if c > i { - r.trackPush2(c-i-1, r.textPos()-r.bump()) - } - - r.advance(2) - continue - - case syntax.Notoneloop: - - c := r.operand(1) - - if c > r.forwardchars() { - c = r.forwardchars() - } - - ch := rune(r.operand(0)) - i := c - - for ; i > 0; i-- { - if r.forwardcharnext() == ch { - r.backwardnext() - break - } - } - - if c > i { - r.trackPush2(c-i-1, r.textPos()-r.bump()) - } - - r.advance(2) - continue - - case syntax.Setloop: - - c := r.operand(1) - - if c > r.forwardchars() { - c = r.forwardchars() - } - - set := r.code.Sets[r.operand(0)] - i := c - - for ; i > 0; i-- { - if !set.CharIn(r.forwardcharnext()) { - r.backwardnext() - break - } - } - - if c > i { - r.trackPush2(c-i-1, r.textPos()-r.bump()) - } - - r.advance(2) - continue - - case syntax.Oneloop | syntax.Back, syntax.Notoneloop | syntax.Back: - - r.trackPopN(2) - i := r.trackPeek() - pos := r.trackPeekN(1) - - r.textto(pos) - - if i > 0 { - r.trackPush2(i-1, pos-r.bump()) - } - - r.advance(2) - continue - - case syntax.Setloop | syntax.Back: - - r.trackPopN(2) - i := r.trackPeek() - pos := r.trackPeekN(1) - - r.textto(pos) - - if i > 0 { - r.trackPush2(i-1, pos-r.bump()) - } - - r.advance(2) - continue - - case syntax.Onelazy, syntax.Notonelazy: - - c := r.operand(1) - - if c > r.forwardchars() { - c = r.forwardchars() - } - - if c > 0 { - r.trackPush2(c-1, r.textPos()) - } - - r.advance(2) - continue - - case syntax.Setlazy: - - c := r.operand(1) - - if c > r.forwardchars() { - c = r.forwardchars() - } - - if c > 0 { - r.trackPush2(c-1, r.textPos()) - } - - r.advance(2) - continue - - case syntax.Onelazy | syntax.Back: - - r.trackPopN(2) - pos := r.trackPeekN(1) - r.textto(pos) - - if r.forwardcharnext() != rune(r.operand(0)) { - break - } - - i := r.trackPeek() - - if i > 0 { - r.trackPush2(i-1, pos+r.bump()) - } - - r.advance(2) - continue - - case syntax.Notonelazy | syntax.Back: - - r.trackPopN(2) - pos := r.trackPeekN(1) - r.textto(pos) - - if r.forwardcharnext() == rune(r.operand(0)) { - break - } - - i := r.trackPeek() - - if i > 0 { - r.trackPush2(i-1, pos+r.bump()) - } - - r.advance(2) - continue - - case syntax.Setlazy | syntax.Back: - - r.trackPopN(2) - pos := r.trackPeekN(1) - r.textto(pos) - - if !r.code.Sets[r.operand(0)].CharIn(r.forwardcharnext()) { - break - } - - i := r.trackPeek() - - if i > 0 { - r.trackPush2(i-1, pos+r.bump()) - } - - r.advance(2) - continue - - default: - return errors.New("unknown state in regex runner") - } - - BreakBackward: - ; - - // "break Backward" comes here: - r.backtrack() - } -} - -// increase the size of stack and track storage -func (r *runner) ensureStorage() { - if r.runstackpos < r.runtrackcount*4 { - doubleIntSlice(&r.runstack, &r.runstackpos) - } - if r.runtrackpos < r.runtrackcount*4 { - doubleIntSlice(&r.runtrack, &r.runtrackpos) - } -} - -func doubleIntSlice(s *[]int, pos *int) { - oldLen := len(*s) - newS := make([]int, oldLen*2) - - copy(newS[oldLen:], *s) - *pos += oldLen - *s = newS -} - -// Save a number on the longjump unrolling stack -func (r *runner) crawl(i int) { - if r.runcrawlpos == 0 { - doubleIntSlice(&r.runcrawl, &r.runcrawlpos) - } - r.runcrawlpos-- - r.runcrawl[r.runcrawlpos] = i -} - -// Remove a number from the longjump unrolling stack -func (r *runner) popcrawl() int { - val := r.runcrawl[r.runcrawlpos] - r.runcrawlpos++ - return val -} - -// Get the height of the stack -func (r *runner) crawlpos() int { - return len(r.runcrawl) - r.runcrawlpos -} - -func (r *runner) advance(i int) { - r.codepos += (i + 1) - r.setOperator(r.code.Codes[r.codepos]) -} - -func (r *runner) goTo(newpos int) { - // when branching backward or in place, ensure storage - if newpos <= r.codepos { - r.ensureStorage() - } - - r.setOperator(r.code.Codes[newpos]) - r.codepos = newpos -} - -func (r *runner) textto(newpos int) { - r.runtextpos = newpos -} - -func (r *runner) trackto(newpos int) { - r.runtrackpos = len(r.runtrack) - newpos -} - -func (r *runner) textstart() int { - return r.runtextstart -} - -func (r *runner) textPos() int { - return r.runtextpos -} - -// push onto the backtracking stack -func (r *runner) trackpos() int { - return len(r.runtrack) - r.runtrackpos -} - -func (r *runner) trackPush() { - r.runtrackpos-- - r.runtrack[r.runtrackpos] = r.codepos -} - -func (r *runner) trackPush1(I1 int) { - r.runtrackpos-- - r.runtrack[r.runtrackpos] = I1 - r.runtrackpos-- - r.runtrack[r.runtrackpos] = r.codepos -} - -func (r *runner) trackPush2(I1, I2 int) { - r.runtrackpos-- - r.runtrack[r.runtrackpos] = I1 - r.runtrackpos-- - r.runtrack[r.runtrackpos] = I2 - r.runtrackpos-- - r.runtrack[r.runtrackpos] = r.codepos -} - -func (r *runner) trackPush3(I1, I2, I3 int) { - r.runtrackpos-- - r.runtrack[r.runtrackpos] = I1 - r.runtrackpos-- - r.runtrack[r.runtrackpos] = I2 - r.runtrackpos-- - r.runtrack[r.runtrackpos] = I3 - r.runtrackpos-- - r.runtrack[r.runtrackpos] = r.codepos -} - -func (r *runner) trackPushNeg1(I1 int) { - r.runtrackpos-- - r.runtrack[r.runtrackpos] = I1 - r.runtrackpos-- - r.runtrack[r.runtrackpos] = -r.codepos -} - -func (r *runner) trackPushNeg2(I1, I2 int) { - r.runtrackpos-- - r.runtrack[r.runtrackpos] = I1 - r.runtrackpos-- - r.runtrack[r.runtrackpos] = I2 - r.runtrackpos-- - r.runtrack[r.runtrackpos] = -r.codepos -} - -func (r *runner) backtrack() { - newpos := r.runtrack[r.runtrackpos] - r.runtrackpos++ - - if r.re.Debug() { - if newpos < 0 { - fmt.Printf(" Backtracking (back2) to code position %v\n", -newpos) - } else { - fmt.Printf(" Backtracking to code position %v\n", newpos) - } - } - - if newpos < 0 { - newpos = -newpos - r.setOperator(r.code.Codes[newpos] | syntax.Back2) - } else { - r.setOperator(r.code.Codes[newpos] | syntax.Back) - } - - // When branching backward, ensure storage - if newpos < r.codepos { - r.ensureStorage() - } - - r.codepos = newpos -} - -func (r *runner) setOperator(op int) { - r.caseInsensitive = (0 != (op & syntax.Ci)) - r.rightToLeft = (0 != (op & syntax.Rtl)) - r.operator = syntax.InstOp(op & ^(syntax.Rtl | syntax.Ci)) -} - -func (r *runner) trackPop() { - r.runtrackpos++ -} - -// pop framesize items from the backtracking stack -func (r *runner) trackPopN(framesize int) { - r.runtrackpos += framesize -} - -// Technically we are actually peeking at items already popped. So if you want to -// get and pop the top item from the stack, you do -// r.trackPop(); -// r.trackPeek(); -func (r *runner) trackPeek() int { - return r.runtrack[r.runtrackpos-1] -} - -// get the ith element down on the backtracking stack -func (r *runner) trackPeekN(i int) int { - return r.runtrack[r.runtrackpos-i-1] -} - -// Push onto the grouping stack -func (r *runner) stackPush(I1 int) { - r.runstackpos-- - r.runstack[r.runstackpos] = I1 -} - -func (r *runner) stackPush2(I1, I2 int) { - r.runstackpos-- - r.runstack[r.runstackpos] = I1 - r.runstackpos-- - r.runstack[r.runstackpos] = I2 -} - -func (r *runner) stackPop() { - r.runstackpos++ -} - -// pop framesize items from the grouping stack -func (r *runner) stackPopN(framesize int) { - r.runstackpos += framesize -} - -// Technically we are actually peeking at items already popped. So if you want to -// get and pop the top item from the stack, you do -// r.stackPop(); -// r.stackPeek(); -func (r *runner) stackPeek() int { - return r.runstack[r.runstackpos-1] -} - -// get the ith element down on the grouping stack -func (r *runner) stackPeekN(i int) int { - return r.runstack[r.runstackpos-i-1] -} - -func (r *runner) operand(i int) int { - return r.code.Codes[r.codepos+i+1] -} - -func (r *runner) leftchars() int { - return r.runtextpos -} - -func (r *runner) rightchars() int { - return r.runtextend - r.runtextpos -} - -func (r *runner) bump() int { - if r.rightToLeft { - return -1 - } - return 1 -} - -func (r *runner) forwardchars() int { - if r.rightToLeft { - return r.runtextpos - } - return r.runtextend - r.runtextpos -} - -func (r *runner) forwardcharnext() rune { - var ch rune - if r.rightToLeft { - r.runtextpos-- - ch = r.runtext[r.runtextpos] - } else { - ch = r.runtext[r.runtextpos] - r.runtextpos++ - } - - if r.caseInsensitive { - return unicode.ToLower(ch) - } - return ch -} - -func (r *runner) runematch(str []rune) bool { - var pos int - - c := len(str) - if !r.rightToLeft { - if r.runtextend-r.runtextpos < c { - return false - } - - pos = r.runtextpos + c - } else { - if r.runtextpos-0 < c { - return false - } - - pos = r.runtextpos - } - - if !r.caseInsensitive { - for c != 0 { - c-- - pos-- - if str[c] != r.runtext[pos] { - return false - } - } - } else { - for c != 0 { - c-- - pos-- - if str[c] != unicode.ToLower(r.runtext[pos]) { - return false - } - } - } - - if !r.rightToLeft { - pos += len(str) - } - - r.runtextpos = pos - - return true -} - -func (r *runner) refmatch(index, len int) bool { - var c, pos, cmpos int - - if !r.rightToLeft { - if r.runtextend-r.runtextpos < len { - return false - } - - pos = r.runtextpos + len - } else { - if r.runtextpos-0 < len { - return false - } - - pos = r.runtextpos - } - cmpos = index + len - - c = len - - if !r.caseInsensitive { - for c != 0 { - c-- - cmpos-- - pos-- - if r.runtext[cmpos] != r.runtext[pos] { - return false - } - - } - } else { - for c != 0 { - c-- - cmpos-- - pos-- - - if unicode.ToLower(r.runtext[cmpos]) != unicode.ToLower(r.runtext[pos]) { - return false - } - } - } - - if !r.rightToLeft { - pos += len - } - - r.runtextpos = pos - - return true -} - -func (r *runner) backwardnext() { - if r.rightToLeft { - r.runtextpos++ - } else { - r.runtextpos-- - } -} - -func (r *runner) charAt(j int) rune { - return r.runtext[j] -} - -func (r *runner) findFirstChar() bool { - - if 0 != (r.code.Anchors & (syntax.AnchorBeginning | syntax.AnchorStart | syntax.AnchorEndZ | syntax.AnchorEnd)) { - if !r.code.RightToLeft { - if (0 != (r.code.Anchors&syntax.AnchorBeginning) && r.runtextpos > 0) || - (0 != (r.code.Anchors&syntax.AnchorStart) && r.runtextpos > r.runtextstart) { - r.runtextpos = r.runtextend - return false - } - if 0 != (r.code.Anchors&syntax.AnchorEndZ) && r.runtextpos < r.runtextend-1 { - r.runtextpos = r.runtextend - 1 - } else if 0 != (r.code.Anchors&syntax.AnchorEnd) && r.runtextpos < r.runtextend { - r.runtextpos = r.runtextend - } - } else { - if (0 != (r.code.Anchors&syntax.AnchorEnd) && r.runtextpos < r.runtextend) || - (0 != (r.code.Anchors&syntax.AnchorEndZ) && (r.runtextpos < r.runtextend-1 || - (r.runtextpos == r.runtextend-1 && r.charAt(r.runtextpos) != '\n'))) || - (0 != (r.code.Anchors&syntax.AnchorStart) && r.runtextpos < r.runtextstart) { - r.runtextpos = 0 - return false - } - if 0 != (r.code.Anchors&syntax.AnchorBeginning) && r.runtextpos > 0 { - r.runtextpos = 0 - } - } - - if r.code.BmPrefix != nil { - return r.code.BmPrefix.IsMatch(r.runtext, r.runtextpos, 0, r.runtextend) - } - - return true // found a valid start or end anchor - } else if r.code.BmPrefix != nil { - r.runtextpos = r.code.BmPrefix.Scan(r.runtext, r.runtextpos, 0, r.runtextend) - - if r.runtextpos == -1 { - if r.code.RightToLeft { - r.runtextpos = 0 - } else { - r.runtextpos = r.runtextend - } - return false - } - - return true - } else if r.code.FcPrefix == nil { - return true - } - - r.rightToLeft = r.code.RightToLeft - r.caseInsensitive = r.code.FcPrefix.CaseInsensitive - - set := r.code.FcPrefix.PrefixSet - if set.IsSingleton() { - ch := set.SingletonChar() - for i := r.forwardchars(); i > 0; i-- { - if ch == r.forwardcharnext() { - r.backwardnext() - return true - } - } - } else { - for i := r.forwardchars(); i > 0; i-- { - n := r.forwardcharnext() - //fmt.Printf("%v in %v: %v\n", string(n), set.String(), set.CharIn(n)) - if set.CharIn(n) { - r.backwardnext() - return true - } - } - } - - return false -} - -func (r *runner) initMatch() { - // Use a hashtable'ed Match object if the capture numbers are sparse - - if r.runmatch == nil { - if r.re.caps != nil { - r.runmatch = newMatchSparse(r.re, r.re.caps, r.re.capsize, r.runtext, r.runtextstart) - } else { - r.runmatch = newMatch(r.re, r.re.capsize, r.runtext, r.runtextstart) - } - } else { - r.runmatch.reset(r.runtext, r.runtextstart) - } - - // note we test runcrawl, because it is the last one to be allocated - // If there is an alloc failure in the middle of the three allocations, - // we may still return to reuse this instance, and we want to behave - // as if the allocations didn't occur. (we used to test _trackcount != 0) - - if r.runcrawl != nil { - r.runtrackpos = len(r.runtrack) - r.runstackpos = len(r.runstack) - r.runcrawlpos = len(r.runcrawl) - return - } - - r.initTrackCount() - - tracksize := r.runtrackcount * 8 - stacksize := r.runtrackcount * 8 - - if tracksize < 32 { - tracksize = 32 - } - if stacksize < 16 { - stacksize = 16 - } - - r.runtrack = make([]int, tracksize) - r.runtrackpos = tracksize - - r.runstack = make([]int, stacksize) - r.runstackpos = stacksize - - r.runcrawl = make([]int, 32) - r.runcrawlpos = 32 -} - -func (r *runner) tidyMatch(quick bool) *Match { - if !quick { - match := r.runmatch - - r.runmatch = nil - - match.tidy(r.runtextpos) - return match - } else { - // send back our match -- it's not leaving the package, so it's safe to not clean it up - // this reduces allocs for frequent calls to the "IsMatch" bool-only functions - return r.runmatch - } -} - -// capture captures a subexpression. Note that the -// capnum used here has already been mapped to a non-sparse -// index (by the code generator RegexWriter). -func (r *runner) capture(capnum, start, end int) { - if end < start { - T := end - end = start - start = T - } - - r.crawl(capnum) - r.runmatch.addMatch(capnum, start, end-start) -} - -// transferCapture captures a subexpression. Note that the -// capnum used here has already been mapped to a non-sparse -// index (by the code generator RegexWriter). -func (r *runner) transferCapture(capnum, uncapnum, start, end int) { - var start2, end2 int - - // these are the two intervals that are cancelling each other - - if end < start { - T := end - end = start - start = T - } - - start2 = r.runmatch.matchIndex(uncapnum) - end2 = start2 + r.runmatch.matchLength(uncapnum) - - // The new capture gets the innermost defined interval - - if start >= end2 { - end = start - start = end2 - } else if end <= start2 { - start = start2 - } else { - if end > end2 { - end = end2 - } - if start2 > start { - start = start2 - } - } - - r.crawl(uncapnum) - r.runmatch.balanceMatch(uncapnum) - - if capnum != -1 { - r.crawl(capnum) - r.runmatch.addMatch(capnum, start, end-start) - } -} - -// revert the last capture -func (r *runner) uncapture() { - capnum := r.popcrawl() - r.runmatch.removeMatch(capnum) -} - -//debug - -func (r *runner) dumpState() { - back := "" - if r.operator&syntax.Back != 0 { - back = " Back" - } - if r.operator&syntax.Back2 != 0 { - back += " Back2" - } - fmt.Printf("Text: %v\nTrack: %v\nStack: %v\n %s%s\n\n", - r.textposDescription(), - r.stackDescription(r.runtrack, r.runtrackpos), - r.stackDescription(r.runstack, r.runstackpos), - r.code.OpcodeDescription(r.codepos), - back) -} - -func (r *runner) stackDescription(a []int, index int) string { - buf := &bytes.Buffer{} - - fmt.Fprintf(buf, "%v/%v", len(a)-index, len(a)) - if buf.Len() < 8 { - buf.WriteString(strings.Repeat(" ", 8-buf.Len())) - } - - buf.WriteRune('(') - for i := index; i < len(a); i++ { - if i > index { - buf.WriteRune(' ') - } - - buf.WriteString(strconv.Itoa(a[i])) - } - - buf.WriteRune(')') - - return buf.String() -} - -func (r *runner) textposDescription() string { - buf := &bytes.Buffer{} - - buf.WriteString(strconv.Itoa(r.runtextpos)) - - if buf.Len() < 8 { - buf.WriteString(strings.Repeat(" ", 8-buf.Len())) - } - - if r.runtextpos > 0 { - buf.WriteString(syntax.CharDescription(r.runtext[r.runtextpos-1])) - } else { - buf.WriteRune('^') - } - - buf.WriteRune('>') - - for i := r.runtextpos; i < r.runtextend; i++ { - buf.WriteString(syntax.CharDescription(r.runtext[i])) - } - if buf.Len() >= 64 { - buf.Truncate(61) - buf.WriteString("...") - } else { - buf.WriteRune('$') - } - - return buf.String() -} - -// decide whether the pos -// at the specified index is a boundary or not. It's just not worth -// emitting inline code for this logic. -func (r *runner) isBoundary(index, startpos, endpos int) bool { - return (index > startpos && syntax.IsWordChar(r.runtext[index-1])) != - (index < endpos && syntax.IsWordChar(r.runtext[index])) -} - -func (r *runner) isECMABoundary(index, startpos, endpos int) bool { - return (index > startpos && syntax.IsECMAWordChar(r.runtext[index-1])) != - (index < endpos && syntax.IsECMAWordChar(r.runtext[index])) -} - -func (r *runner) startTimeoutWatch() { - if r.ignoreTimeout { - return - } - r.deadline = makeDeadline(r.timeout) -} - -func (r *runner) checkTimeout() error { - if r.ignoreTimeout || !r.deadline.reached() { - return nil - } - - if r.re.Debug() { - //Debug.WriteLine("") - //Debug.WriteLine("RegEx match timeout occurred!") - //Debug.WriteLine("Specified timeout: " + TimeSpan.FromMilliseconds(_timeout).ToString()) - //Debug.WriteLine("Timeout check frequency: " + TimeoutCheckFrequency) - //Debug.WriteLine("Search pattern: " + _runregex._pattern) - //Debug.WriteLine("Input: " + r.runtext) - //Debug.WriteLine("About to throw RegexMatchTimeoutException.") - } - - return fmt.Errorf("match timeout after %v on input `%v`", r.timeout, string(r.runtext)) -} - -func (r *runner) initTrackCount() { - r.runtrackcount = r.code.TrackCount -} - -// getRunner returns a run to use for matching re. -// It uses the re's runner cache if possible, to avoid -// unnecessary allocation. -func (re *Regexp) getRunner() *runner { - re.muRun.Lock() - if n := len(re.runner); n > 0 { - z := re.runner[n-1] - re.runner = re.runner[:n-1] - re.muRun.Unlock() - return z - } - re.muRun.Unlock() - z := &runner{ - re: re, - code: re.code, - } - return z -} - -// putRunner returns a runner to the re's cache. -// There is no attempt to limit the size of the cache, so it will -// grow to the maximum number of simultaneous matches -// run using re. (The cache empties when re gets garbage collected.) -func (re *Regexp) putRunner(r *runner) { - re.muRun.Lock() - r.runtext = nil - if r.runmatch != nil { - r.runmatch.text = nil - } - re.runner = append(re.runner, r) - re.muRun.Unlock() -} diff --git a/vendor/github.com/dlclark/regexp2/syntax/charclass.go b/vendor/github.com/dlclark/regexp2/syntax/charclass.go deleted file mode 100644 index 6881a0e29..000000000 --- a/vendor/github.com/dlclark/regexp2/syntax/charclass.go +++ /dev/null @@ -1,865 +0,0 @@ -package syntax - -import ( - "bytes" - "encoding/binary" - "fmt" - "sort" - "unicode" - "unicode/utf8" -) - -// CharSet combines start-end rune ranges and unicode categories representing a set of characters -type CharSet struct { - ranges []singleRange - categories []category - sub *CharSet //optional subtractor - negate bool - anything bool -} - -type category struct { - negate bool - cat string -} - -type singleRange struct { - first rune - last rune -} - -const ( - spaceCategoryText = " " - wordCategoryText = "W" -) - -var ( - ecmaSpace = []rune{0x0009, 0x000e, 0x0020, 0x0021, 0x00a0, 0x00a1, 0x1680, 0x1681, 0x2000, 0x200b, 0x2028, 0x202a, 0x202f, 0x2030, 0x205f, 0x2060, 0x3000, 0x3001, 0xfeff, 0xff00} - ecmaWord = []rune{0x0030, 0x003a, 0x0041, 0x005b, 0x005f, 0x0060, 0x0061, 0x007b} - ecmaDigit = []rune{0x0030, 0x003a} - - re2Space = []rune{0x0009, 0x000b, 0x000c, 0x000e, 0x0020, 0x0021} -) - -var ( - AnyClass = getCharSetFromOldString([]rune{0}, false) - ECMAAnyClass = getCharSetFromOldString([]rune{0, 0x000a, 0x000b, 0x000d, 0x000e}, false) - NoneClass = getCharSetFromOldString(nil, false) - ECMAWordClass = getCharSetFromOldString(ecmaWord, false) - NotECMAWordClass = getCharSetFromOldString(ecmaWord, true) - ECMASpaceClass = getCharSetFromOldString(ecmaSpace, false) - NotECMASpaceClass = getCharSetFromOldString(ecmaSpace, true) - ECMADigitClass = getCharSetFromOldString(ecmaDigit, false) - NotECMADigitClass = getCharSetFromOldString(ecmaDigit, true) - - WordClass = getCharSetFromCategoryString(false, false, wordCategoryText) - NotWordClass = getCharSetFromCategoryString(true, false, wordCategoryText) - SpaceClass = getCharSetFromCategoryString(false, false, spaceCategoryText) - NotSpaceClass = getCharSetFromCategoryString(true, false, spaceCategoryText) - DigitClass = getCharSetFromCategoryString(false, false, "Nd") - NotDigitClass = getCharSetFromCategoryString(false, true, "Nd") - - RE2SpaceClass = getCharSetFromOldString(re2Space, false) - NotRE2SpaceClass = getCharSetFromOldString(re2Space, true) -) - -var unicodeCategories = func() map[string]*unicode.RangeTable { - retVal := make(map[string]*unicode.RangeTable) - for k, v := range unicode.Scripts { - retVal[k] = v - } - for k, v := range unicode.Categories { - retVal[k] = v - } - for k, v := range unicode.Properties { - retVal[k] = v - } - return retVal -}() - -func getCharSetFromCategoryString(negateSet bool, negateCat bool, cats ...string) func() *CharSet { - if negateCat && negateSet { - panic("BUG! You should only negate the set OR the category in a constant setup, but not both") - } - - c := CharSet{negate: negateSet} - - c.categories = make([]category, len(cats)) - for i, cat := range cats { - c.categories[i] = category{cat: cat, negate: negateCat} - } - return func() *CharSet { - //make a copy each time - local := c - //return that address - return &local - } -} - -func getCharSetFromOldString(setText []rune, negate bool) func() *CharSet { - c := CharSet{} - if len(setText) > 0 { - fillFirst := false - l := len(setText) - if negate { - if setText[0] == 0 { - setText = setText[1:] - } else { - l++ - fillFirst = true - } - } - - if l%2 == 0 { - c.ranges = make([]singleRange, l/2) - } else { - c.ranges = make([]singleRange, l/2+1) - } - - first := true - if fillFirst { - c.ranges[0] = singleRange{first: 0} - first = false - } - - i := 0 - for _, r := range setText { - if first { - // lower bound in a new range - c.ranges[i] = singleRange{first: r} - first = false - } else { - c.ranges[i].last = r - 1 - i++ - first = true - } - } - if !first { - c.ranges[i].last = utf8.MaxRune - } - } - - return func() *CharSet { - local := c - return &local - } -} - -// Copy makes a deep copy to prevent accidental mutation of a set -func (c CharSet) Copy() CharSet { - ret := CharSet{ - anything: c.anything, - negate: c.negate, - } - - ret.ranges = append(ret.ranges, c.ranges...) - ret.categories = append(ret.categories, c.categories...) - - if c.sub != nil { - sub := c.sub.Copy() - ret.sub = &sub - } - - return ret -} - -// gets a human-readable description for a set string -func (c CharSet) String() string { - buf := &bytes.Buffer{} - buf.WriteRune('[') - - if c.IsNegated() { - buf.WriteRune('^') - } - - for _, r := range c.ranges { - - buf.WriteString(CharDescription(r.first)) - if r.first != r.last { - if r.last-r.first != 1 { - //groups that are 1 char apart skip the dash - buf.WriteRune('-') - } - buf.WriteString(CharDescription(r.last)) - } - } - - for _, c := range c.categories { - buf.WriteString(c.String()) - } - - if c.sub != nil { - buf.WriteRune('-') - buf.WriteString(c.sub.String()) - } - - buf.WriteRune(']') - - return buf.String() -} - -// mapHashFill converts a charset into a buffer for use in maps -func (c CharSet) mapHashFill(buf *bytes.Buffer) { - if c.negate { - buf.WriteByte(0) - } else { - buf.WriteByte(1) - } - - binary.Write(buf, binary.LittleEndian, len(c.ranges)) - binary.Write(buf, binary.LittleEndian, len(c.categories)) - for _, r := range c.ranges { - buf.WriteRune(r.first) - buf.WriteRune(r.last) - } - for _, ct := range c.categories { - buf.WriteString(ct.cat) - if ct.negate { - buf.WriteByte(1) - } else { - buf.WriteByte(0) - } - } - - if c.sub != nil { - c.sub.mapHashFill(buf) - } -} - -// CharIn returns true if the rune is in our character set (either ranges or categories). -// It handles negations and subtracted sub-charsets. -func (c CharSet) CharIn(ch rune) bool { - val := false - // in s && !s.subtracted - - //check ranges - for _, r := range c.ranges { - if ch < r.first { - continue - } - if ch <= r.last { - val = true - break - } - } - - //check categories if we haven't already found a range - if !val && len(c.categories) > 0 { - for _, ct := range c.categories { - // special categories...then unicode - if ct.cat == spaceCategoryText { - if unicode.IsSpace(ch) { - // we found a space so we're done - // negate means this is a "bad" thing - val = !ct.negate - break - } else if ct.negate { - val = true - break - } - } else if ct.cat == wordCategoryText { - if IsWordChar(ch) { - val = !ct.negate - break - } else if ct.negate { - val = true - break - } - } else if unicode.Is(unicodeCategories[ct.cat], ch) { - // if we're in this unicode category then we're done - // if negate=true on this category then we "failed" our test - // otherwise we're good that we found it - val = !ct.negate - break - } else if ct.negate { - val = true - break - } - } - } - - // negate the whole char set - if c.negate { - val = !val - } - - // get subtracted recurse - if val && c.sub != nil { - val = !c.sub.CharIn(ch) - } - - //log.Printf("Char '%v' in %v == %v", string(ch), c.String(), val) - return val -} - -func (c category) String() string { - switch c.cat { - case spaceCategoryText: - if c.negate { - return "\\S" - } - return "\\s" - case wordCategoryText: - if c.negate { - return "\\W" - } - return "\\w" - } - if _, ok := unicodeCategories[c.cat]; ok { - - if c.negate { - return "\\P{" + c.cat + "}" - } - return "\\p{" + c.cat + "}" - } - return "Unknown category: " + c.cat -} - -// CharDescription Produces a human-readable description for a single character. -func CharDescription(ch rune) string { - /*if ch == '\\' { - return "\\\\" - } - - if ch > ' ' && ch <= '~' { - return string(ch) - } else if ch == '\n' { - return "\\n" - } else if ch == ' ' { - return "\\ " - }*/ - - b := &bytes.Buffer{} - escape(b, ch, false) //fmt.Sprintf("%U", ch) - return b.String() -} - -// According to UTS#18 Unicode Regular Expressions (http://www.unicode.org/reports/tr18/) -// RL 1.4 Simple Word Boundaries The class of includes all Alphabetic -// values from the Unicode character database, from UnicodeData.txt [UData], plus the U+200C -// ZERO WIDTH NON-JOINER and U+200D ZERO WIDTH JOINER. -func IsWordChar(r rune) bool { - //"L", "Mn", "Nd", "Pc" - return unicode.In(r, - unicode.Categories["L"], unicode.Categories["Mn"], - unicode.Categories["Nd"], unicode.Categories["Pc"]) || r == '\u200D' || r == '\u200C' - //return 'A' <= r && r <= 'Z' || 'a' <= r && r <= 'z' || '0' <= r && r <= '9' || r == '_' -} - -func IsECMAWordChar(r rune) bool { - return unicode.In(r, - unicode.Categories["L"], unicode.Categories["Mn"], - unicode.Categories["Nd"], unicode.Categories["Pc"]) - - //return 'A' <= r && r <= 'Z' || 'a' <= r && r <= 'z' || '0' <= r && r <= '9' || r == '_' -} - -// SingletonChar will return the char from the first range without validation. -// It assumes you have checked for IsSingleton or IsSingletonInverse and will panic given bad input -func (c CharSet) SingletonChar() rune { - return c.ranges[0].first -} - -func (c CharSet) IsSingleton() bool { - return !c.negate && //negated is multiple chars - len(c.categories) == 0 && len(c.ranges) == 1 && // multiple ranges and unicode classes represent multiple chars - c.sub == nil && // subtraction means we've got multiple chars - c.ranges[0].first == c.ranges[0].last // first and last equal means we're just 1 char -} - -func (c CharSet) IsSingletonInverse() bool { - return c.negate && //same as above, but requires negated - len(c.categories) == 0 && len(c.ranges) == 1 && // multiple ranges and unicode classes represent multiple chars - c.sub == nil && // subtraction means we've got multiple chars - c.ranges[0].first == c.ranges[0].last // first and last equal means we're just 1 char -} - -func (c CharSet) IsMergeable() bool { - return !c.IsNegated() && !c.HasSubtraction() -} - -func (c CharSet) IsNegated() bool { - return c.negate -} - -func (c CharSet) HasSubtraction() bool { - return c.sub != nil -} - -func (c CharSet) IsEmpty() bool { - return len(c.ranges) == 0 && len(c.categories) == 0 && c.sub == nil -} - -func (c *CharSet) addDigit(ecma, negate bool, pattern string) { - if ecma { - if negate { - c.addRanges(NotECMADigitClass().ranges) - } else { - c.addRanges(ECMADigitClass().ranges) - } - } else { - c.addCategories(category{cat: "Nd", negate: negate}) - } -} - -func (c *CharSet) addChar(ch rune) { - c.addRange(ch, ch) -} - -func (c *CharSet) addSpace(ecma, re2, negate bool) { - if ecma { - if negate { - c.addRanges(NotECMASpaceClass().ranges) - } else { - c.addRanges(ECMASpaceClass().ranges) - } - } else if re2 { - if negate { - c.addRanges(NotRE2SpaceClass().ranges) - } else { - c.addRanges(RE2SpaceClass().ranges) - } - } else { - c.addCategories(category{cat: spaceCategoryText, negate: negate}) - } -} - -func (c *CharSet) addWord(ecma, negate bool) { - if ecma { - if negate { - c.addRanges(NotECMAWordClass().ranges) - } else { - c.addRanges(ECMAWordClass().ranges) - } - } else { - c.addCategories(category{cat: wordCategoryText, negate: negate}) - } -} - -// Add set ranges and categories into ours -- no deduping or anything -func (c *CharSet) addSet(set CharSet) { - if c.anything { - return - } - if set.anything { - c.makeAnything() - return - } - // just append here to prevent double-canon - c.ranges = append(c.ranges, set.ranges...) - c.addCategories(set.categories...) - c.canonicalize() -} - -func (c *CharSet) makeAnything() { - c.anything = true - c.categories = []category{} - c.ranges = AnyClass().ranges -} - -func (c *CharSet) addCategories(cats ...category) { - // don't add dupes and remove positive+negative - if c.anything { - // if we've had a previous positive+negative group then - // just return, we're as broad as we can get - return - } - - for _, ct := range cats { - found := false - for _, ct2 := range c.categories { - if ct.cat == ct2.cat { - if ct.negate != ct2.negate { - // oposite negations...this mean we just - // take us as anything and move on - c.makeAnything() - return - } - found = true - break - } - } - - if !found { - c.categories = append(c.categories, ct) - } - } -} - -// Merges new ranges to our own -func (c *CharSet) addRanges(ranges []singleRange) { - if c.anything { - return - } - c.ranges = append(c.ranges, ranges...) - c.canonicalize() -} - -// Merges everything but the new ranges into our own -func (c *CharSet) addNegativeRanges(ranges []singleRange) { - if c.anything { - return - } - - var hi rune - - // convert incoming ranges into opposites, assume they are in order - for _, r := range ranges { - if hi < r.first { - c.ranges = append(c.ranges, singleRange{hi, r.first - 1}) - } - hi = r.last + 1 - } - - if hi < utf8.MaxRune { - c.ranges = append(c.ranges, singleRange{hi, utf8.MaxRune}) - } - - c.canonicalize() -} - -func isValidUnicodeCat(catName string) bool { - _, ok := unicodeCategories[catName] - return ok -} - -func (c *CharSet) addCategory(categoryName string, negate, caseInsensitive bool, pattern string) { - if !isValidUnicodeCat(categoryName) { - // unknown unicode category, script, or property "blah" - panic(fmt.Errorf("Unknown unicode category, script, or property '%v'", categoryName)) - - } - - if caseInsensitive && (categoryName == "Ll" || categoryName == "Lu" || categoryName == "Lt") { - // when RegexOptions.IgnoreCase is specified then {Ll} {Lu} and {Lt} cases should all match - c.addCategories( - category{cat: "Ll", negate: negate}, - category{cat: "Lu", negate: negate}, - category{cat: "Lt", negate: negate}) - } - c.addCategories(category{cat: categoryName, negate: negate}) -} - -func (c *CharSet) addSubtraction(sub *CharSet) { - c.sub = sub -} - -func (c *CharSet) addRange(chMin, chMax rune) { - c.ranges = append(c.ranges, singleRange{first: chMin, last: chMax}) - c.canonicalize() -} - -func (c *CharSet) addNamedASCII(name string, negate bool) bool { - var rs []singleRange - - switch name { - case "alnum": - rs = []singleRange{singleRange{'0', '9'}, singleRange{'A', 'Z'}, singleRange{'a', 'z'}} - case "alpha": - rs = []singleRange{singleRange{'A', 'Z'}, singleRange{'a', 'z'}} - case "ascii": - rs = []singleRange{singleRange{0, 0x7f}} - case "blank": - rs = []singleRange{singleRange{'\t', '\t'}, singleRange{' ', ' '}} - case "cntrl": - rs = []singleRange{singleRange{0, 0x1f}, singleRange{0x7f, 0x7f}} - case "digit": - c.addDigit(false, negate, "") - case "graph": - rs = []singleRange{singleRange{'!', '~'}} - case "lower": - rs = []singleRange{singleRange{'a', 'z'}} - case "print": - rs = []singleRange{singleRange{' ', '~'}} - case "punct": //[!-/:-@[-`{-~] - rs = []singleRange{singleRange{'!', '/'}, singleRange{':', '@'}, singleRange{'[', '`'}, singleRange{'{', '~'}} - case "space": - c.addSpace(true, false, negate) - case "upper": - rs = []singleRange{singleRange{'A', 'Z'}} - case "word": - c.addWord(true, negate) - case "xdigit": - rs = []singleRange{singleRange{'0', '9'}, singleRange{'A', 'F'}, singleRange{'a', 'f'}} - default: - return false - } - - if len(rs) > 0 { - if negate { - c.addNegativeRanges(rs) - } else { - c.addRanges(rs) - } - } - - return true -} - -type singleRangeSorter []singleRange - -func (p singleRangeSorter) Len() int { return len(p) } -func (p singleRangeSorter) Less(i, j int) bool { return p[i].first < p[j].first } -func (p singleRangeSorter) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -// Logic to reduce a character class to a unique, sorted form. -func (c *CharSet) canonicalize() { - var i, j int - var last rune - - // - // Find and eliminate overlapping or abutting ranges - // - - if len(c.ranges) > 1 { - sort.Sort(singleRangeSorter(c.ranges)) - - done := false - - for i, j = 1, 0; ; i++ { - for last = c.ranges[j].last; ; i++ { - if i == len(c.ranges) || last == utf8.MaxRune { - done = true - break - } - - CurrentRange := c.ranges[i] - if CurrentRange.first > last+1 { - break - } - - if last < CurrentRange.last { - last = CurrentRange.last - } - } - - c.ranges[j] = singleRange{first: c.ranges[j].first, last: last} - - j++ - - if done { - break - } - - if j < i { - c.ranges[j] = c.ranges[i] - } - } - - c.ranges = append(c.ranges[:j], c.ranges[len(c.ranges):]...) - } -} - -// Adds to the class any lowercase versions of characters already -// in the class. Used for case-insensitivity. -func (c *CharSet) addLowercase() { - if c.anything { - return - } - toAdd := []singleRange{} - for i := 0; i < len(c.ranges); i++ { - r := c.ranges[i] - if r.first == r.last { - lower := unicode.ToLower(r.first) - c.ranges[i] = singleRange{first: lower, last: lower} - } else { - toAdd = append(toAdd, r) - } - } - - for _, r := range toAdd { - c.addLowercaseRange(r.first, r.last) - } - c.canonicalize() -} - -/************************************************************************** - Let U be the set of Unicode character values and let L be the lowercase - function, mapping from U to U. To perform case insensitive matching of - character sets, we need to be able to map an interval I in U, say - - I = [chMin, chMax] = { ch : chMin <= ch <= chMax } - - to a set A such that A contains L(I) and A is contained in the union of - I and L(I). - - The table below partitions U into intervals on which L is non-decreasing. - Thus, for any interval J = [a, b] contained in one of these intervals, - L(J) is contained in [L(a), L(b)]. - - It is also true that for any such J, [L(a), L(b)] is contained in the - union of J and L(J). This does not follow from L being non-decreasing on - these intervals. It follows from the nature of the L on each interval. - On each interval, L has one of the following forms: - - (1) L(ch) = constant (LowercaseSet) - (2) L(ch) = ch + offset (LowercaseAdd) - (3) L(ch) = ch | 1 (LowercaseBor) - (4) L(ch) = ch + (ch & 1) (LowercaseBad) - - It is easy to verify that for any of these forms [L(a), L(b)] is - contained in the union of [a, b] and L([a, b]). -***************************************************************************/ - -const ( - LowercaseSet = 0 // Set to arg. - LowercaseAdd = 1 // Add arg. - LowercaseBor = 2 // Bitwise or with 1. - LowercaseBad = 3 // Bitwise and with 1 and add original. -) - -type lcMap struct { - chMin, chMax rune - op, data int32 -} - -var lcTable = []lcMap{ - lcMap{'\u0041', '\u005A', LowercaseAdd, 32}, - lcMap{'\u00C0', '\u00DE', LowercaseAdd, 32}, - lcMap{'\u0100', '\u012E', LowercaseBor, 0}, - lcMap{'\u0130', '\u0130', LowercaseSet, 0x0069}, - lcMap{'\u0132', '\u0136', LowercaseBor, 0}, - lcMap{'\u0139', '\u0147', LowercaseBad, 0}, - lcMap{'\u014A', '\u0176', LowercaseBor, 0}, - lcMap{'\u0178', '\u0178', LowercaseSet, 0x00FF}, - lcMap{'\u0179', '\u017D', LowercaseBad, 0}, - lcMap{'\u0181', '\u0181', LowercaseSet, 0x0253}, - lcMap{'\u0182', '\u0184', LowercaseBor, 0}, - lcMap{'\u0186', '\u0186', LowercaseSet, 0x0254}, - lcMap{'\u0187', '\u0187', LowercaseSet, 0x0188}, - lcMap{'\u0189', '\u018A', LowercaseAdd, 205}, - lcMap{'\u018B', '\u018B', LowercaseSet, 0x018C}, - lcMap{'\u018E', '\u018E', LowercaseSet, 0x01DD}, - lcMap{'\u018F', '\u018F', LowercaseSet, 0x0259}, - lcMap{'\u0190', '\u0190', LowercaseSet, 0x025B}, - lcMap{'\u0191', '\u0191', LowercaseSet, 0x0192}, - lcMap{'\u0193', '\u0193', LowercaseSet, 0x0260}, - lcMap{'\u0194', '\u0194', LowercaseSet, 0x0263}, - lcMap{'\u0196', '\u0196', LowercaseSet, 0x0269}, - lcMap{'\u0197', '\u0197', LowercaseSet, 0x0268}, - lcMap{'\u0198', '\u0198', LowercaseSet, 0x0199}, - lcMap{'\u019C', '\u019C', LowercaseSet, 0x026F}, - lcMap{'\u019D', '\u019D', LowercaseSet, 0x0272}, - lcMap{'\u019F', '\u019F', LowercaseSet, 0x0275}, - lcMap{'\u01A0', '\u01A4', LowercaseBor, 0}, - lcMap{'\u01A7', '\u01A7', LowercaseSet, 0x01A8}, - lcMap{'\u01A9', '\u01A9', LowercaseSet, 0x0283}, - lcMap{'\u01AC', '\u01AC', LowercaseSet, 0x01AD}, - lcMap{'\u01AE', '\u01AE', LowercaseSet, 0x0288}, - lcMap{'\u01AF', '\u01AF', LowercaseSet, 0x01B0}, - lcMap{'\u01B1', '\u01B2', LowercaseAdd, 217}, - lcMap{'\u01B3', '\u01B5', LowercaseBad, 0}, - lcMap{'\u01B7', '\u01B7', LowercaseSet, 0x0292}, - lcMap{'\u01B8', '\u01B8', LowercaseSet, 0x01B9}, - lcMap{'\u01BC', '\u01BC', LowercaseSet, 0x01BD}, - lcMap{'\u01C4', '\u01C5', LowercaseSet, 0x01C6}, - lcMap{'\u01C7', '\u01C8', LowercaseSet, 0x01C9}, - lcMap{'\u01CA', '\u01CB', LowercaseSet, 0x01CC}, - lcMap{'\u01CD', '\u01DB', LowercaseBad, 0}, - lcMap{'\u01DE', '\u01EE', LowercaseBor, 0}, - lcMap{'\u01F1', '\u01F2', LowercaseSet, 0x01F3}, - lcMap{'\u01F4', '\u01F4', LowercaseSet, 0x01F5}, - lcMap{'\u01FA', '\u0216', LowercaseBor, 0}, - lcMap{'\u0386', '\u0386', LowercaseSet, 0x03AC}, - lcMap{'\u0388', '\u038A', LowercaseAdd, 37}, - lcMap{'\u038C', '\u038C', LowercaseSet, 0x03CC}, - lcMap{'\u038E', '\u038F', LowercaseAdd, 63}, - lcMap{'\u0391', '\u03AB', LowercaseAdd, 32}, - lcMap{'\u03E2', '\u03EE', LowercaseBor, 0}, - lcMap{'\u0401', '\u040F', LowercaseAdd, 80}, - lcMap{'\u0410', '\u042F', LowercaseAdd, 32}, - lcMap{'\u0460', '\u0480', LowercaseBor, 0}, - lcMap{'\u0490', '\u04BE', LowercaseBor, 0}, - lcMap{'\u04C1', '\u04C3', LowercaseBad, 0}, - lcMap{'\u04C7', '\u04C7', LowercaseSet, 0x04C8}, - lcMap{'\u04CB', '\u04CB', LowercaseSet, 0x04CC}, - lcMap{'\u04D0', '\u04EA', LowercaseBor, 0}, - lcMap{'\u04EE', '\u04F4', LowercaseBor, 0}, - lcMap{'\u04F8', '\u04F8', LowercaseSet, 0x04F9}, - lcMap{'\u0531', '\u0556', LowercaseAdd, 48}, - lcMap{'\u10A0', '\u10C5', LowercaseAdd, 48}, - lcMap{'\u1E00', '\u1EF8', LowercaseBor, 0}, - lcMap{'\u1F08', '\u1F0F', LowercaseAdd, -8}, - lcMap{'\u1F18', '\u1F1F', LowercaseAdd, -8}, - lcMap{'\u1F28', '\u1F2F', LowercaseAdd, -8}, - lcMap{'\u1F38', '\u1F3F', LowercaseAdd, -8}, - lcMap{'\u1F48', '\u1F4D', LowercaseAdd, -8}, - lcMap{'\u1F59', '\u1F59', LowercaseSet, 0x1F51}, - lcMap{'\u1F5B', '\u1F5B', LowercaseSet, 0x1F53}, - lcMap{'\u1F5D', '\u1F5D', LowercaseSet, 0x1F55}, - lcMap{'\u1F5F', '\u1F5F', LowercaseSet, 0x1F57}, - lcMap{'\u1F68', '\u1F6F', LowercaseAdd, -8}, - lcMap{'\u1F88', '\u1F8F', LowercaseAdd, -8}, - lcMap{'\u1F98', '\u1F9F', LowercaseAdd, -8}, - lcMap{'\u1FA8', '\u1FAF', LowercaseAdd, -8}, - lcMap{'\u1FB8', '\u1FB9', LowercaseAdd, -8}, - lcMap{'\u1FBA', '\u1FBB', LowercaseAdd, -74}, - lcMap{'\u1FBC', '\u1FBC', LowercaseSet, 0x1FB3}, - lcMap{'\u1FC8', '\u1FCB', LowercaseAdd, -86}, - lcMap{'\u1FCC', '\u1FCC', LowercaseSet, 0x1FC3}, - lcMap{'\u1FD8', '\u1FD9', LowercaseAdd, -8}, - lcMap{'\u1FDA', '\u1FDB', LowercaseAdd, -100}, - lcMap{'\u1FE8', '\u1FE9', LowercaseAdd, -8}, - lcMap{'\u1FEA', '\u1FEB', LowercaseAdd, -112}, - lcMap{'\u1FEC', '\u1FEC', LowercaseSet, 0x1FE5}, - lcMap{'\u1FF8', '\u1FF9', LowercaseAdd, -128}, - lcMap{'\u1FFA', '\u1FFB', LowercaseAdd, -126}, - lcMap{'\u1FFC', '\u1FFC', LowercaseSet, 0x1FF3}, - lcMap{'\u2160', '\u216F', LowercaseAdd, 16}, - lcMap{'\u24B6', '\u24D0', LowercaseAdd, 26}, - lcMap{'\uFF21', '\uFF3A', LowercaseAdd, 32}, -} - -func (c *CharSet) addLowercaseRange(chMin, chMax rune) { - var i, iMax, iMid int - var chMinT, chMaxT rune - var lc lcMap - - for i, iMax = 0, len(lcTable); i < iMax; { - iMid = (i + iMax) / 2 - if lcTable[iMid].chMax < chMin { - i = iMid + 1 - } else { - iMax = iMid - } - } - - for ; i < len(lcTable); i++ { - lc = lcTable[i] - if lc.chMin > chMax { - return - } - chMinT = lc.chMin - if chMinT < chMin { - chMinT = chMin - } - - chMaxT = lc.chMax - if chMaxT > chMax { - chMaxT = chMax - } - - switch lc.op { - case LowercaseSet: - chMinT = rune(lc.data) - chMaxT = rune(lc.data) - break - case LowercaseAdd: - chMinT += lc.data - chMaxT += lc.data - break - case LowercaseBor: - chMinT |= 1 - chMaxT |= 1 - break - case LowercaseBad: - chMinT += (chMinT & 1) - chMaxT += (chMaxT & 1) - break - } - - if chMinT < chMin || chMaxT > chMax { - c.addRange(chMinT, chMaxT) - } - } -} diff --git a/vendor/github.com/dlclark/regexp2/syntax/code.go b/vendor/github.com/dlclark/regexp2/syntax/code.go deleted file mode 100644 index 686e822af..000000000 --- a/vendor/github.com/dlclark/regexp2/syntax/code.go +++ /dev/null @@ -1,274 +0,0 @@ -package syntax - -import ( - "bytes" - "fmt" - "math" -) - -// similar to prog.go in the go regex package...also with comment 'may not belong in this package' - -// File provides operator constants for use by the Builder and the Machine. - -// Implementation notes: -// -// Regexps are built into RegexCodes, which contain an operation array, -// a string table, and some constants. -// -// Each operation is one of the codes below, followed by the integer -// operands specified for each op. -// -// Strings and sets are indices into a string table. - -type InstOp int - -const ( - // lef/back operands description - - Onerep InstOp = 0 // lef,back char,min,max a {n} - Notonerep = 1 // lef,back char,min,max .{n} - Setrep = 2 // lef,back set,min,max [\d]{n} - - Oneloop = 3 // lef,back char,min,max a {,n} - Notoneloop = 4 // lef,back char,min,max .{,n} - Setloop = 5 // lef,back set,min,max [\d]{,n} - - Onelazy = 6 // lef,back char,min,max a {,n}? - Notonelazy = 7 // lef,back char,min,max .{,n}? - Setlazy = 8 // lef,back set,min,max [\d]{,n}? - - One = 9 // lef char a - Notone = 10 // lef char [^a] - Set = 11 // lef set [a-z\s] \w \s \d - - Multi = 12 // lef string abcd - Ref = 13 // lef group \# - - Bol = 14 // ^ - Eol = 15 // $ - Boundary = 16 // \b - Nonboundary = 17 // \B - Beginning = 18 // \A - Start = 19 // \G - EndZ = 20 // \Z - End = 21 // \Z - - Nothing = 22 // Reject! - - // Primitive control structures - - Lazybranch = 23 // back jump straight first - Branchmark = 24 // back jump branch first for loop - Lazybranchmark = 25 // back jump straight first for loop - Nullcount = 26 // back val set counter, null mark - Setcount = 27 // back val set counter, make mark - Branchcount = 28 // back jump,limit branch++ if zero<=c impl group slots - Capsize int // number of impl group slots - FcPrefix *Prefix // the set of candidate first characters (may be null) - BmPrefix *BmPrefix // the fixed prefix string as a Boyer-Moore machine (may be null) - Anchors AnchorLoc // the set of zero-length start anchors (RegexFCD.Bol, etc) - RightToLeft bool // true if right to left -} - -func opcodeBacktracks(op InstOp) bool { - op &= Mask - - switch op { - case Oneloop, Notoneloop, Setloop, Onelazy, Notonelazy, Setlazy, Lazybranch, Branchmark, Lazybranchmark, - Nullcount, Setcount, Branchcount, Lazybranchcount, Setmark, Capturemark, Getmark, Setjump, Backjump, - Forejump, Goto: - return true - - default: - return false - } -} - -func opcodeSize(op InstOp) int { - op &= Mask - - switch op { - case Nothing, Bol, Eol, Boundary, Nonboundary, ECMABoundary, NonECMABoundary, Beginning, Start, EndZ, - End, Nullmark, Setmark, Getmark, Setjump, Backjump, Forejump, Stop: - return 1 - - case One, Notone, Multi, Ref, Testref, Goto, Nullcount, Setcount, Lazybranch, Branchmark, Lazybranchmark, - Prune, Set: - return 2 - - case Capturemark, Branchcount, Lazybranchcount, Onerep, Notonerep, Oneloop, Notoneloop, Onelazy, Notonelazy, - Setlazy, Setrep, Setloop: - return 3 - - default: - panic(fmt.Errorf("Unexpected op code: %v", op)) - } -} - -var codeStr = []string{ - "Onerep", "Notonerep", "Setrep", - "Oneloop", "Notoneloop", "Setloop", - "Onelazy", "Notonelazy", "Setlazy", - "One", "Notone", "Set", - "Multi", "Ref", - "Bol", "Eol", "Boundary", "Nonboundary", "Beginning", "Start", "EndZ", "End", - "Nothing", - "Lazybranch", "Branchmark", "Lazybranchmark", - "Nullcount", "Setcount", "Branchcount", "Lazybranchcount", - "Nullmark", "Setmark", "Capturemark", "Getmark", - "Setjump", "Backjump", "Forejump", "Testref", "Goto", - "Prune", "Stop", - "ECMABoundary", "NonECMABoundary", -} - -func operatorDescription(op InstOp) string { - desc := codeStr[op&Mask] - if (op & Ci) != 0 { - desc += "-Ci" - } - if (op & Rtl) != 0 { - desc += "-Rtl" - } - if (op & Back) != 0 { - desc += "-Back" - } - if (op & Back2) != 0 { - desc += "-Back2" - } - - return desc -} - -// OpcodeDescription is a humman readable string of the specific offset -func (c *Code) OpcodeDescription(offset int) string { - buf := &bytes.Buffer{} - - op := InstOp(c.Codes[offset]) - fmt.Fprintf(buf, "%06d ", offset) - - if opcodeBacktracks(op & Mask) { - buf.WriteString("*") - } else { - buf.WriteString(" ") - } - buf.WriteString(operatorDescription(op)) - buf.WriteString("(") - op &= Mask - - switch op { - case One, Notone, Onerep, Notonerep, Oneloop, Notoneloop, Onelazy, Notonelazy: - buf.WriteString("Ch = ") - buf.WriteString(CharDescription(rune(c.Codes[offset+1]))) - - case Set, Setrep, Setloop, Setlazy: - buf.WriteString("Set = ") - buf.WriteString(c.Sets[c.Codes[offset+1]].String()) - - case Multi: - fmt.Fprintf(buf, "String = %s", string(c.Strings[c.Codes[offset+1]])) - - case Ref, Testref: - fmt.Fprintf(buf, "Index = %d", c.Codes[offset+1]) - - case Capturemark: - fmt.Fprintf(buf, "Index = %d", c.Codes[offset+1]) - if c.Codes[offset+2] != -1 { - fmt.Fprintf(buf, ", Unindex = %d", c.Codes[offset+2]) - } - - case Nullcount, Setcount: - fmt.Fprintf(buf, "Value = %d", c.Codes[offset+1]) - - case Goto, Lazybranch, Branchmark, Lazybranchmark, Branchcount, Lazybranchcount: - fmt.Fprintf(buf, "Addr = %d", c.Codes[offset+1]) - } - - switch op { - case Onerep, Notonerep, Oneloop, Notoneloop, Onelazy, Notonelazy, Setrep, Setloop, Setlazy: - buf.WriteString(", Rep = ") - if c.Codes[offset+2] == math.MaxInt32 { - buf.WriteString("inf") - } else { - fmt.Fprintf(buf, "%d", c.Codes[offset+2]) - } - - case Branchcount, Lazybranchcount: - buf.WriteString(", Limit = ") - if c.Codes[offset+2] == math.MaxInt32 { - buf.WriteString("inf") - } else { - fmt.Fprintf(buf, "%d", c.Codes[offset+2]) - } - - } - - buf.WriteString(")") - - return buf.String() -} - -func (c *Code) Dump() string { - buf := &bytes.Buffer{} - - if c.RightToLeft { - fmt.Fprintln(buf, "Direction: right-to-left") - } else { - fmt.Fprintln(buf, "Direction: left-to-right") - } - if c.FcPrefix == nil { - fmt.Fprintln(buf, "Firstchars: n/a") - } else { - fmt.Fprintf(buf, "Firstchars: %v\n", c.FcPrefix.PrefixSet.String()) - } - - if c.BmPrefix == nil { - fmt.Fprintln(buf, "Prefix: n/a") - } else { - fmt.Fprintf(buf, "Prefix: %v\n", Escape(c.BmPrefix.String())) - } - - fmt.Fprintf(buf, "Anchors: %v\n", c.Anchors) - fmt.Fprintln(buf) - - if c.BmPrefix != nil { - fmt.Fprintln(buf, "BoyerMoore:") - fmt.Fprintln(buf, c.BmPrefix.Dump(" ")) - } - for i := 0; i < len(c.Codes); i += opcodeSize(InstOp(c.Codes[i])) { - fmt.Fprintln(buf, c.OpcodeDescription(i)) - } - - return buf.String() -} diff --git a/vendor/github.com/dlclark/regexp2/syntax/replacerdata.go b/vendor/github.com/dlclark/regexp2/syntax/replacerdata.go deleted file mode 100644 index bcf4d3f25..000000000 --- a/vendor/github.com/dlclark/regexp2/syntax/replacerdata.go +++ /dev/null @@ -1,87 +0,0 @@ -package syntax - -import ( - "bytes" - "errors" -) - -type ReplacerData struct { - Rep string - Strings []string - Rules []int -} - -const ( - replaceSpecials = 4 - replaceLeftPortion = -1 - replaceRightPortion = -2 - replaceLastGroup = -3 - replaceWholeString = -4 -) - -//ErrReplacementError is a general error during parsing the replacement text -var ErrReplacementError = errors.New("Replacement pattern error.") - -// NewReplacerData will populate a reusable replacer data struct based on the given replacement string -// and the capture group data from a regexp -func NewReplacerData(rep string, caps map[int]int, capsize int, capnames map[string]int, op RegexOptions) (*ReplacerData, error) { - p := parser{ - options: op, - caps: caps, - capsize: capsize, - capnames: capnames, - } - p.setPattern(rep) - concat, err := p.scanReplacement() - if err != nil { - return nil, err - } - - if concat.t != ntConcatenate { - panic(ErrReplacementError) - } - - sb := &bytes.Buffer{} - var ( - strings []string - rules []int - ) - - for _, child := range concat.children { - switch child.t { - case ntMulti: - child.writeStrToBuf(sb) - - case ntOne: - sb.WriteRune(child.ch) - - case ntRef: - if sb.Len() > 0 { - rules = append(rules, len(strings)) - strings = append(strings, sb.String()) - sb.Reset() - } - slot := child.m - - if len(caps) > 0 && slot >= 0 { - slot = caps[slot] - } - - rules = append(rules, -replaceSpecials-1-slot) - - default: - panic(ErrReplacementError) - } - } - - if sb.Len() > 0 { - rules = append(rules, len(strings)) - strings = append(strings, sb.String()) - } - - return &ReplacerData{ - Rep: rep, - Strings: strings, - Rules: rules, - }, nil -} diff --git a/vendor/github.com/dlclark/regexp2/syntax/tree.go b/vendor/github.com/dlclark/regexp2/syntax/tree.go deleted file mode 100644 index ea2882931..000000000 --- a/vendor/github.com/dlclark/regexp2/syntax/tree.go +++ /dev/null @@ -1,654 +0,0 @@ -package syntax - -import ( - "bytes" - "fmt" - "math" - "strconv" -) - -type RegexTree struct { - root *regexNode - caps map[int]int - capnumlist []int - captop int - Capnames map[string]int - Caplist []string - options RegexOptions -} - -// It is built into a parsed tree for a regular expression. - -// Implementation notes: -// -// Since the node tree is a temporary data structure only used -// during compilation of the regexp to integer codes, it's -// designed for clarity and convenience rather than -// space efficiency. -// -// RegexNodes are built into a tree, linked by the n.children list. -// Each node also has a n.parent and n.ichild member indicating -// its parent and which child # it is in its parent's list. -// -// RegexNodes come in as many types as there are constructs in -// a regular expression, for example, "concatenate", "alternate", -// "one", "rept", "group". There are also node types for basic -// peephole optimizations, e.g., "onerep", "notsetrep", etc. -// -// Because perl 5 allows "lookback" groups that scan backwards, -// each node also gets a "direction". Normally the value of -// boolean n.backward = false. -// -// During parsing, top-level nodes are also stacked onto a parse -// stack (a stack of trees). For this purpose we have a n.next -// pointer. [Note that to save a few bytes, we could overload the -// n.parent pointer instead.] -// -// On the parse stack, each tree has a "role" - basically, the -// nonterminal in the grammar that the parser has currently -// assigned to the tree. That code is stored in n.role. -// -// Finally, some of the different kinds of nodes have data. -// Two integers (for the looping constructs) are stored in -// n.operands, an an object (either a string or a set) -// is stored in n.data -type regexNode struct { - t nodeType - children []*regexNode - str []rune - set *CharSet - ch rune - m int - n int - options RegexOptions - next *regexNode -} - -type nodeType int32 - -const ( - // The following are leaves, and correspond to primitive operations - - ntOnerep nodeType = 0 // lef,back char,min,max a {n} - ntNotonerep = 1 // lef,back char,min,max .{n} - ntSetrep = 2 // lef,back set,min,max [\d]{n} - ntOneloop = 3 // lef,back char,min,max a {,n} - ntNotoneloop = 4 // lef,back char,min,max .{,n} - ntSetloop = 5 // lef,back set,min,max [\d]{,n} - ntOnelazy = 6 // lef,back char,min,max a {,n}? - ntNotonelazy = 7 // lef,back char,min,max .{,n}? - ntSetlazy = 8 // lef,back set,min,max [\d]{,n}? - ntOne = 9 // lef char a - ntNotone = 10 // lef char [^a] - ntSet = 11 // lef set [a-z\s] \w \s \d - ntMulti = 12 // lef string abcd - ntRef = 13 // lef group \# - ntBol = 14 // ^ - ntEol = 15 // $ - ntBoundary = 16 // \b - ntNonboundary = 17 // \B - ntBeginning = 18 // \A - ntStart = 19 // \G - ntEndZ = 20 // \Z - ntEnd = 21 // \Z - - // Interior nodes do not correspond to primitive operations, but - // control structures compositing other operations - - // Concat and alternate take n children, and can run forward or backwards - - ntNothing = 22 // [] - ntEmpty = 23 // () - ntAlternate = 24 // a|b - ntConcatenate = 25 // ab - ntLoop = 26 // m,x * + ? {,} - ntLazyloop = 27 // m,x *? +? ?? {,}? - ntCapture = 28 // n () - ntGroup = 29 // (?:) - ntRequire = 30 // (?=) (?<=) - ntPrevent = 31 // (?!) (?) (?<) - ntTestref = 33 // (?(n) | ) - ntTestgroup = 34 // (?(...) | ) - - ntECMABoundary = 41 // \b - ntNonECMABoundary = 42 // \B -) - -func newRegexNode(t nodeType, opt RegexOptions) *regexNode { - return ®exNode{ - t: t, - options: opt, - } -} - -func newRegexNodeCh(t nodeType, opt RegexOptions, ch rune) *regexNode { - return ®exNode{ - t: t, - options: opt, - ch: ch, - } -} - -func newRegexNodeStr(t nodeType, opt RegexOptions, str []rune) *regexNode { - return ®exNode{ - t: t, - options: opt, - str: str, - } -} - -func newRegexNodeSet(t nodeType, opt RegexOptions, set *CharSet) *regexNode { - return ®exNode{ - t: t, - options: opt, - set: set, - } -} - -func newRegexNodeM(t nodeType, opt RegexOptions, m int) *regexNode { - return ®exNode{ - t: t, - options: opt, - m: m, - } -} -func newRegexNodeMN(t nodeType, opt RegexOptions, m, n int) *regexNode { - return ®exNode{ - t: t, - options: opt, - m: m, - n: n, - } -} - -func (n *regexNode) writeStrToBuf(buf *bytes.Buffer) { - for i := 0; i < len(n.str); i++ { - buf.WriteRune(n.str[i]) - } -} - -func (n *regexNode) addChild(child *regexNode) { - reduced := child.reduce() - n.children = append(n.children, reduced) - reduced.next = n -} - -func (n *regexNode) insertChildren(afterIndex int, nodes []*regexNode) { - newChildren := make([]*regexNode, 0, len(n.children)+len(nodes)) - n.children = append(append(append(newChildren, n.children[:afterIndex]...), nodes...), n.children[afterIndex:]...) -} - -// removes children including the start but not the end index -func (n *regexNode) removeChildren(startIndex, endIndex int) { - n.children = append(n.children[:startIndex], n.children[endIndex:]...) -} - -// Pass type as OneLazy or OneLoop -func (n *regexNode) makeRep(t nodeType, min, max int) { - n.t += (t - ntOne) - n.m = min - n.n = max -} - -func (n *regexNode) reduce() *regexNode { - switch n.t { - case ntAlternate: - return n.reduceAlternation() - - case ntConcatenate: - return n.reduceConcatenation() - - case ntLoop, ntLazyloop: - return n.reduceRep() - - case ntGroup: - return n.reduceGroup() - - case ntSet, ntSetloop: - return n.reduceSet() - - default: - return n - } -} - -// Basic optimization. Single-letter alternations can be replaced -// by faster set specifications, and nested alternations with no -// intervening operators can be flattened: -// -// a|b|c|def|g|h -> [a-c]|def|[gh] -// apple|(?:orange|pear)|grape -> apple|orange|pear|grape -func (n *regexNode) reduceAlternation() *regexNode { - if len(n.children) == 0 { - return newRegexNode(ntNothing, n.options) - } - - wasLastSet := false - lastNodeCannotMerge := false - var optionsLast RegexOptions - var i, j int - - for i, j = 0, 0; i < len(n.children); i, j = i+1, j+1 { - at := n.children[i] - - if j < i { - n.children[j] = at - } - - for { - if at.t == ntAlternate { - for k := 0; k < len(at.children); k++ { - at.children[k].next = n - } - n.insertChildren(i+1, at.children) - - j-- - } else if at.t == ntSet || at.t == ntOne { - // Cannot merge sets if L or I options differ, or if either are negated. - optionsAt := at.options & (RightToLeft | IgnoreCase) - - if at.t == ntSet { - if !wasLastSet || optionsLast != optionsAt || lastNodeCannotMerge || !at.set.IsMergeable() { - wasLastSet = true - lastNodeCannotMerge = !at.set.IsMergeable() - optionsLast = optionsAt - break - } - } else if !wasLastSet || optionsLast != optionsAt || lastNodeCannotMerge { - wasLastSet = true - lastNodeCannotMerge = false - optionsLast = optionsAt - break - } - - // The last node was a Set or a One, we're a Set or One and our options are the same. - // Merge the two nodes. - j-- - prev := n.children[j] - - var prevCharClass *CharSet - if prev.t == ntOne { - prevCharClass = &CharSet{} - prevCharClass.addChar(prev.ch) - } else { - prevCharClass = prev.set - } - - if at.t == ntOne { - prevCharClass.addChar(at.ch) - } else { - prevCharClass.addSet(*at.set) - } - - prev.t = ntSet - prev.set = prevCharClass - } else if at.t == ntNothing { - j-- - } else { - wasLastSet = false - lastNodeCannotMerge = false - } - break - } - } - - if j < i { - n.removeChildren(j, i) - } - - return n.stripEnation(ntNothing) -} - -// Basic optimization. Adjacent strings can be concatenated. -// -// (?:abc)(?:def) -> abcdef -func (n *regexNode) reduceConcatenation() *regexNode { - // Eliminate empties and concat adjacent strings/chars - - var optionsLast RegexOptions - var optionsAt RegexOptions - var i, j int - - if len(n.children) == 0 { - return newRegexNode(ntEmpty, n.options) - } - - wasLastString := false - - for i, j = 0, 0; i < len(n.children); i, j = i+1, j+1 { - var at, prev *regexNode - - at = n.children[i] - - if j < i { - n.children[j] = at - } - - if at.t == ntConcatenate && - ((at.options & RightToLeft) == (n.options & RightToLeft)) { - for k := 0; k < len(at.children); k++ { - at.children[k].next = n - } - - //insert at.children at i+1 index in n.children - n.insertChildren(i+1, at.children) - - j-- - } else if at.t == ntMulti || at.t == ntOne { - // Cannot merge strings if L or I options differ - optionsAt = at.options & (RightToLeft | IgnoreCase) - - if !wasLastString || optionsLast != optionsAt { - wasLastString = true - optionsLast = optionsAt - continue - } - - j-- - prev = n.children[j] - - if prev.t == ntOne { - prev.t = ntMulti - prev.str = []rune{prev.ch} - } - - if (optionsAt & RightToLeft) == 0 { - if at.t == ntOne { - prev.str = append(prev.str, at.ch) - } else { - prev.str = append(prev.str, at.str...) - } - } else { - if at.t == ntOne { - // insert at the front by expanding our slice, copying the data over, and then setting the value - prev.str = append(prev.str, 0) - copy(prev.str[1:], prev.str) - prev.str[0] = at.ch - } else { - //insert at the front...this one we'll make a new slice and copy both into it - merge := make([]rune, len(prev.str)+len(at.str)) - copy(merge, at.str) - copy(merge[len(at.str):], prev.str) - prev.str = merge - } - } - } else if at.t == ntEmpty { - j-- - } else { - wasLastString = false - } - } - - if j < i { - // remove indices j through i from the children - n.removeChildren(j, i) - } - - return n.stripEnation(ntEmpty) -} - -// Nested repeaters just get multiplied with each other if they're not -// too lumpy -func (n *regexNode) reduceRep() *regexNode { - - u := n - t := n.t - min := n.m - max := n.n - - for { - if len(u.children) == 0 { - break - } - - child := u.children[0] - - // multiply reps of the same type only - if child.t != t { - childType := child.t - - if !(childType >= ntOneloop && childType <= ntSetloop && t == ntLoop || - childType >= ntOnelazy && childType <= ntSetlazy && t == ntLazyloop) { - break - } - } - - // child can be too lumpy to blur, e.g., (a {100,105}) {3} or (a {2,})? - // [but things like (a {2,})+ are not too lumpy...] - if u.m == 0 && child.m > 1 || child.n < child.m*2 { - break - } - - u = child - if u.m > 0 { - if (math.MaxInt32-1)/u.m < min { - u.m = math.MaxInt32 - } else { - u.m = u.m * min - } - } - if u.n > 0 { - if (math.MaxInt32-1)/u.n < max { - u.n = math.MaxInt32 - } else { - u.n = u.n * max - } - } - } - - if math.MaxInt32 == min { - return newRegexNode(ntNothing, n.options) - } - return u - -} - -// Simple optimization. If a concatenation or alternation has only -// one child strip out the intermediate node. If it has zero children, -// turn it into an empty. -func (n *regexNode) stripEnation(emptyType nodeType) *regexNode { - switch len(n.children) { - case 0: - return newRegexNode(emptyType, n.options) - case 1: - return n.children[0] - default: - return n - } -} - -func (n *regexNode) reduceGroup() *regexNode { - u := n - - for u.t == ntGroup { - u = u.children[0] - } - - return u -} - -// Simple optimization. If a set is a singleton, an inverse singleton, -// or empty, it's transformed accordingly. -func (n *regexNode) reduceSet() *regexNode { - // Extract empty-set, one and not-one case as special - - if n.set == nil { - n.t = ntNothing - } else if n.set.IsSingleton() { - n.ch = n.set.SingletonChar() - n.set = nil - n.t += (ntOne - ntSet) - } else if n.set.IsSingletonInverse() { - n.ch = n.set.SingletonChar() - n.set = nil - n.t += (ntNotone - ntSet) - } - - return n -} - -func (n *regexNode) reverseLeft() *regexNode { - if n.options&RightToLeft != 0 && n.t == ntConcatenate && len(n.children) > 0 { - //reverse children order - for left, right := 0, len(n.children)-1; left < right; left, right = left+1, right-1 { - n.children[left], n.children[right] = n.children[right], n.children[left] - } - } - - return n -} - -func (n *regexNode) makeQuantifier(lazy bool, min, max int) *regexNode { - if min == 0 && max == 0 { - return newRegexNode(ntEmpty, n.options) - } - - if min == 1 && max == 1 { - return n - } - - switch n.t { - case ntOne, ntNotone, ntSet: - if lazy { - n.makeRep(Onelazy, min, max) - } else { - n.makeRep(Oneloop, min, max) - } - return n - - default: - var t nodeType - if lazy { - t = ntLazyloop - } else { - t = ntLoop - } - result := newRegexNodeMN(t, n.options, min, max) - result.addChild(n) - return result - } -} - -// debug functions - -var typeStr = []string{ - "Onerep", "Notonerep", "Setrep", - "Oneloop", "Notoneloop", "Setloop", - "Onelazy", "Notonelazy", "Setlazy", - "One", "Notone", "Set", - "Multi", "Ref", - "Bol", "Eol", "Boundary", "Nonboundary", - "Beginning", "Start", "EndZ", "End", - "Nothing", "Empty", - "Alternate", "Concatenate", - "Loop", "Lazyloop", - "Capture", "Group", "Require", "Prevent", "Greedy", - "Testref", "Testgroup", - "Unknown", "Unknown", "Unknown", - "Unknown", "Unknown", "Unknown", - "ECMABoundary", "NonECMABoundary", -} - -func (n *regexNode) description() string { - buf := &bytes.Buffer{} - - buf.WriteString(typeStr[n.t]) - - if (n.options & ExplicitCapture) != 0 { - buf.WriteString("-C") - } - if (n.options & IgnoreCase) != 0 { - buf.WriteString("-I") - } - if (n.options & RightToLeft) != 0 { - buf.WriteString("-L") - } - if (n.options & Multiline) != 0 { - buf.WriteString("-M") - } - if (n.options & Singleline) != 0 { - buf.WriteString("-S") - } - if (n.options & IgnorePatternWhitespace) != 0 { - buf.WriteString("-X") - } - if (n.options & ECMAScript) != 0 { - buf.WriteString("-E") - } - - switch n.t { - case ntOneloop, ntNotoneloop, ntOnelazy, ntNotonelazy, ntOne, ntNotone: - buf.WriteString("(Ch = " + CharDescription(n.ch) + ")") - break - case ntCapture: - buf.WriteString("(index = " + strconv.Itoa(n.m) + ", unindex = " + strconv.Itoa(n.n) + ")") - break - case ntRef, ntTestref: - buf.WriteString("(index = " + strconv.Itoa(n.m) + ")") - break - case ntMulti: - fmt.Fprintf(buf, "(String = %s)", string(n.str)) - break - case ntSet, ntSetloop, ntSetlazy: - buf.WriteString("(Set = " + n.set.String() + ")") - break - } - - switch n.t { - case ntOneloop, ntNotoneloop, ntOnelazy, ntNotonelazy, ntSetloop, ntSetlazy, ntLoop, ntLazyloop: - buf.WriteString("(Min = ") - buf.WriteString(strconv.Itoa(n.m)) - buf.WriteString(", Max = ") - if n.n == math.MaxInt32 { - buf.WriteString("inf") - } else { - buf.WriteString(strconv.Itoa(n.n)) - } - buf.WriteString(")") - - break - } - - return buf.String() -} - -var padSpace = []byte(" ") - -func (t *RegexTree) Dump() string { - return t.root.dump() -} - -func (n *regexNode) dump() string { - var stack []int - CurNode := n - CurChild := 0 - - buf := bytes.NewBufferString(CurNode.description()) - buf.WriteRune('\n') - - for { - if CurNode.children != nil && CurChild < len(CurNode.children) { - stack = append(stack, CurChild+1) - CurNode = CurNode.children[CurChild] - CurChild = 0 - - Depth := len(stack) - if Depth > 32 { - Depth = 32 - } - buf.Write(padSpace[:Depth]) - buf.WriteString(CurNode.description()) - buf.WriteRune('\n') - } else { - if len(stack) == 0 { - break - } - - CurChild = stack[len(stack)-1] - stack = stack[:len(stack)-1] - CurNode = CurNode.next - } - } - return buf.String() -} diff --git a/vendor/github.com/dlclark/regexp2/syntax/writer.go b/vendor/github.com/dlclark/regexp2/syntax/writer.go deleted file mode 100644 index a5aa11ca0..000000000 --- a/vendor/github.com/dlclark/regexp2/syntax/writer.go +++ /dev/null @@ -1,500 +0,0 @@ -package syntax - -import ( - "bytes" - "fmt" - "math" - "os" -) - -func Write(tree *RegexTree) (*Code, error) { - w := writer{ - intStack: make([]int, 0, 32), - emitted: make([]int, 2), - stringhash: make(map[string]int), - sethash: make(map[string]int), - } - - code, err := w.codeFromTree(tree) - - if tree.options&Debug > 0 && code != nil { - os.Stdout.WriteString(code.Dump()) - os.Stdout.WriteString("\n") - } - - return code, err -} - -type writer struct { - emitted []int - - intStack []int - curpos int - stringhash map[string]int - stringtable [][]rune - sethash map[string]int - settable []*CharSet - counting bool - count int - trackcount int - caps map[int]int -} - -const ( - beforeChild nodeType = 64 - afterChild = 128 - //MaxPrefixSize is the largest number of runes we'll use for a BoyerMoyer prefix - MaxPrefixSize = 50 -) - -// The top level RegexCode generator. It does a depth-first walk -// through the tree and calls EmitFragment to emits code before -// and after each child of an interior node, and at each leaf. -// -// It runs two passes, first to count the size of the generated -// code, and second to generate the code. -// -// We should time it against the alternative, which is -// to just generate the code and grow the array as we go. -func (w *writer) codeFromTree(tree *RegexTree) (*Code, error) { - var ( - curNode *regexNode - curChild int - capsize int - ) - // construct sparse capnum mapping if some numbers are unused - - if tree.capnumlist == nil || tree.captop == len(tree.capnumlist) { - capsize = tree.captop - w.caps = nil - } else { - capsize = len(tree.capnumlist) - w.caps = tree.caps - for i := 0; i < len(tree.capnumlist); i++ { - w.caps[tree.capnumlist[i]] = i - } - } - - w.counting = true - - for { - if !w.counting { - w.emitted = make([]int, w.count) - } - - curNode = tree.root - curChild = 0 - - w.emit1(Lazybranch, 0) - - for { - if len(curNode.children) == 0 { - w.emitFragment(curNode.t, curNode, 0) - } else if curChild < len(curNode.children) { - w.emitFragment(curNode.t|beforeChild, curNode, curChild) - - curNode = curNode.children[curChild] - - w.pushInt(curChild) - curChild = 0 - continue - } - - if w.emptyStack() { - break - } - - curChild = w.popInt() - curNode = curNode.next - - w.emitFragment(curNode.t|afterChild, curNode, curChild) - curChild++ - } - - w.patchJump(0, w.curPos()) - w.emit(Stop) - - if !w.counting { - break - } - - w.counting = false - } - - fcPrefix := getFirstCharsPrefix(tree) - prefix := getPrefix(tree) - rtl := (tree.options & RightToLeft) != 0 - - var bmPrefix *BmPrefix - //TODO: benchmark string prefixes - if prefix != nil && len(prefix.PrefixStr) > 0 && MaxPrefixSize > 0 { - if len(prefix.PrefixStr) > MaxPrefixSize { - // limit prefix changes to 10k - prefix.PrefixStr = prefix.PrefixStr[:MaxPrefixSize] - } - bmPrefix = newBmPrefix(prefix.PrefixStr, prefix.CaseInsensitive, rtl) - } else { - bmPrefix = nil - } - - return &Code{ - Codes: w.emitted, - Strings: w.stringtable, - Sets: w.settable, - TrackCount: w.trackcount, - Caps: w.caps, - Capsize: capsize, - FcPrefix: fcPrefix, - BmPrefix: bmPrefix, - Anchors: getAnchors(tree), - RightToLeft: rtl, - }, nil -} - -// The main RegexCode generator. It does a depth-first walk -// through the tree and calls EmitFragment to emits code before -// and after each child of an interior node, and at each leaf. -func (w *writer) emitFragment(nodetype nodeType, node *regexNode, curIndex int) error { - bits := InstOp(0) - - if nodetype <= ntRef { - if (node.options & RightToLeft) != 0 { - bits |= Rtl - } - if (node.options & IgnoreCase) != 0 { - bits |= Ci - } - } - ntBits := nodeType(bits) - - switch nodetype { - case ntConcatenate | beforeChild, ntConcatenate | afterChild, ntEmpty: - break - - case ntAlternate | beforeChild: - if curIndex < len(node.children)-1 { - w.pushInt(w.curPos()) - w.emit1(Lazybranch, 0) - } - - case ntAlternate | afterChild: - if curIndex < len(node.children)-1 { - lbPos := w.popInt() - w.pushInt(w.curPos()) - w.emit1(Goto, 0) - w.patchJump(lbPos, w.curPos()) - } else { - for i := 0; i < curIndex; i++ { - w.patchJump(w.popInt(), w.curPos()) - } - } - break - - case ntTestref | beforeChild: - if curIndex == 0 { - w.emit(Setjump) - w.pushInt(w.curPos()) - w.emit1(Lazybranch, 0) - w.emit1(Testref, w.mapCapnum(node.m)) - w.emit(Forejump) - } - - case ntTestref | afterChild: - if curIndex == 0 { - branchpos := w.popInt() - w.pushInt(w.curPos()) - w.emit1(Goto, 0) - w.patchJump(branchpos, w.curPos()) - w.emit(Forejump) - if len(node.children) <= 1 { - w.patchJump(w.popInt(), w.curPos()) - } - } else if curIndex == 1 { - w.patchJump(w.popInt(), w.curPos()) - } - - case ntTestgroup | beforeChild: - if curIndex == 0 { - w.emit(Setjump) - w.emit(Setmark) - w.pushInt(w.curPos()) - w.emit1(Lazybranch, 0) - } - - case ntTestgroup | afterChild: - if curIndex == 0 { - w.emit(Getmark) - w.emit(Forejump) - } else if curIndex == 1 { - Branchpos := w.popInt() - w.pushInt(w.curPos()) - w.emit1(Goto, 0) - w.patchJump(Branchpos, w.curPos()) - w.emit(Getmark) - w.emit(Forejump) - if len(node.children) <= 2 { - w.patchJump(w.popInt(), w.curPos()) - } - } else if curIndex == 2 { - w.patchJump(w.popInt(), w.curPos()) - } - - case ntLoop | beforeChild, ntLazyloop | beforeChild: - - if node.n < math.MaxInt32 || node.m > 1 { - if node.m == 0 { - w.emit1(Nullcount, 0) - } else { - w.emit1(Setcount, 1-node.m) - } - } else if node.m == 0 { - w.emit(Nullmark) - } else { - w.emit(Setmark) - } - - if node.m == 0 { - w.pushInt(w.curPos()) - w.emit1(Goto, 0) - } - w.pushInt(w.curPos()) - - case ntLoop | afterChild, ntLazyloop | afterChild: - - startJumpPos := w.curPos() - lazy := (nodetype - (ntLoop | afterChild)) - - if node.n < math.MaxInt32 || node.m > 1 { - if node.n == math.MaxInt32 { - w.emit2(InstOp(Branchcount+lazy), w.popInt(), math.MaxInt32) - } else { - w.emit2(InstOp(Branchcount+lazy), w.popInt(), node.n-node.m) - } - } else { - w.emit1(InstOp(Branchmark+lazy), w.popInt()) - } - - if node.m == 0 { - w.patchJump(w.popInt(), startJumpPos) - } - - case ntGroup | beforeChild, ntGroup | afterChild: - - case ntCapture | beforeChild: - w.emit(Setmark) - - case ntCapture | afterChild: - w.emit2(Capturemark, w.mapCapnum(node.m), w.mapCapnum(node.n)) - - case ntRequire | beforeChild: - // NOTE: the following line causes lookahead/lookbehind to be - // NON-BACKTRACKING. It can be commented out with (*) - w.emit(Setjump) - - w.emit(Setmark) - - case ntRequire | afterChild: - w.emit(Getmark) - - // NOTE: the following line causes lookahead/lookbehind to be - // NON-BACKTRACKING. It can be commented out with (*) - w.emit(Forejump) - - case ntPrevent | beforeChild: - w.emit(Setjump) - w.pushInt(w.curPos()) - w.emit1(Lazybranch, 0) - - case ntPrevent | afterChild: - w.emit(Backjump) - w.patchJump(w.popInt(), w.curPos()) - w.emit(Forejump) - - case ntGreedy | beforeChild: - w.emit(Setjump) - - case ntGreedy | afterChild: - w.emit(Forejump) - - case ntOne, ntNotone: - w.emit1(InstOp(node.t|ntBits), int(node.ch)) - - case ntNotoneloop, ntNotonelazy, ntOneloop, ntOnelazy: - if node.m > 0 { - if node.t == ntOneloop || node.t == ntOnelazy { - w.emit2(Onerep|bits, int(node.ch), node.m) - } else { - w.emit2(Notonerep|bits, int(node.ch), node.m) - } - } - if node.n > node.m { - if node.n == math.MaxInt32 { - w.emit2(InstOp(node.t|ntBits), int(node.ch), math.MaxInt32) - } else { - w.emit2(InstOp(node.t|ntBits), int(node.ch), node.n-node.m) - } - } - - case ntSetloop, ntSetlazy: - if node.m > 0 { - w.emit2(Setrep|bits, w.setCode(node.set), node.m) - } - if node.n > node.m { - if node.n == math.MaxInt32 { - w.emit2(InstOp(node.t|ntBits), w.setCode(node.set), math.MaxInt32) - } else { - w.emit2(InstOp(node.t|ntBits), w.setCode(node.set), node.n-node.m) - } - } - - case ntMulti: - w.emit1(InstOp(node.t|ntBits), w.stringCode(node.str)) - - case ntSet: - w.emit1(InstOp(node.t|ntBits), w.setCode(node.set)) - - case ntRef: - w.emit1(InstOp(node.t|ntBits), w.mapCapnum(node.m)) - - case ntNothing, ntBol, ntEol, ntBoundary, ntNonboundary, ntECMABoundary, ntNonECMABoundary, ntBeginning, ntStart, ntEndZ, ntEnd: - w.emit(InstOp(node.t)) - - default: - return fmt.Errorf("unexpected opcode in regular expression generation: %v", nodetype) - } - - return nil -} - -// To avoid recursion, we use a simple integer stack. -// This is the push. -func (w *writer) pushInt(i int) { - w.intStack = append(w.intStack, i) -} - -// Returns true if the stack is empty. -func (w *writer) emptyStack() bool { - return len(w.intStack) == 0 -} - -// This is the pop. -func (w *writer) popInt() int { - //get our item - idx := len(w.intStack) - 1 - i := w.intStack[idx] - //trim our slice - w.intStack = w.intStack[:idx] - return i -} - -// Returns the current position in the emitted code. -func (w *writer) curPos() int { - return w.curpos -} - -// Fixes up a jump instruction at the specified offset -// so that it jumps to the specified jumpDest. -func (w *writer) patchJump(offset, jumpDest int) { - w.emitted[offset+1] = jumpDest -} - -// Returns an index in the set table for a charset -// uses a map to eliminate duplicates. -func (w *writer) setCode(set *CharSet) int { - if w.counting { - return 0 - } - - buf := &bytes.Buffer{} - - set.mapHashFill(buf) - hash := buf.String() - i, ok := w.sethash[hash] - if !ok { - i = len(w.sethash) - w.sethash[hash] = i - w.settable = append(w.settable, set) - } - return i -} - -// Returns an index in the string table for a string. -// uses a map to eliminate duplicates. -func (w *writer) stringCode(str []rune) int { - if w.counting { - return 0 - } - - hash := string(str) - i, ok := w.stringhash[hash] - if !ok { - i = len(w.stringhash) - w.stringhash[hash] = i - w.stringtable = append(w.stringtable, str) - } - - return i -} - -// When generating code on a regex that uses a sparse set -// of capture slots, we hash them to a dense set of indices -// for an array of capture slots. Instead of doing the hash -// at match time, it's done at compile time, here. -func (w *writer) mapCapnum(capnum int) int { - if capnum == -1 { - return -1 - } - - if w.caps != nil { - return w.caps[capnum] - } - - return capnum -} - -// Emits a zero-argument operation. Note that the emit -// functions all run in two modes: they can emit code, or -// they can just count the size of the code. -func (w *writer) emit(op InstOp) { - if w.counting { - w.count++ - if opcodeBacktracks(op) { - w.trackcount++ - } - return - } - w.emitted[w.curpos] = int(op) - w.curpos++ -} - -// Emits a one-argument operation. -func (w *writer) emit1(op InstOp, opd1 int) { - if w.counting { - w.count += 2 - if opcodeBacktracks(op) { - w.trackcount++ - } - return - } - w.emitted[w.curpos] = int(op) - w.curpos++ - w.emitted[w.curpos] = opd1 - w.curpos++ -} - -// Emits a two-argument operation. -func (w *writer) emit2(op InstOp, opd1, opd2 int) { - if w.counting { - w.count += 3 - if opcodeBacktracks(op) { - w.trackcount++ - } - return - } - w.emitted[w.curpos] = int(op) - w.curpos++ - w.emitted[w.curpos] = opd1 - w.curpos++ - w.emitted[w.curpos] = opd2 - w.curpos++ -} diff --git a/vendor/github.com/dlclark/regexp2/testoutput1 b/vendor/github.com/dlclark/regexp2/testoutput1 deleted file mode 100644 index fbf63fdf2..000000000 --- a/vendor/github.com/dlclark/regexp2/testoutput1 +++ /dev/null @@ -1,7061 +0,0 @@ -# This set of tests is for features that are compatible with all versions of -# Perl >= 5.10, in non-UTF mode. It should run clean for the 8-bit, 16-bit, and -# 32-bit PCRE libraries, and also using the perltest.pl script. - -#forbid_utf -#newline_default lf any anycrlf -#perltest - -/the quick brown fox/ - the quick brown fox - 0: the quick brown fox - What do you know about the quick brown fox? - 0: the quick brown fox -\= Expect no match - The quick brown FOX -No match - What do you know about THE QUICK BROWN FOX? -No match - -/The quick brown fox/i - the quick brown fox - 0: the quick brown fox - The quick brown FOX - 0: The quick brown FOX - What do you know about the quick brown fox? - 0: the quick brown fox - What do you know about THE QUICK BROWN FOX? - 0: THE QUICK BROWN FOX - -/abcd\t\n\r\f\a\e\071\x3b\$\\\?caxyz/ - abcd\t\n\r\f\a\e9;\$\\?caxyz - 0: abcd\x09\x0a\x0d\x0c\x07\x1b9;$\?caxyz - -/a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz/ - abxyzpqrrrabbxyyyypqAzz - 0: abxyzpqrrrabbxyyyypqAzz - abxyzpqrrrabbxyyyypqAzz - 0: abxyzpqrrrabbxyyyypqAzz - aabxyzpqrrrabbxyyyypqAzz - 0: aabxyzpqrrrabbxyyyypqAzz - aaabxyzpqrrrabbxyyyypqAzz - 0: aaabxyzpqrrrabbxyyyypqAzz - aaaabxyzpqrrrabbxyyyypqAzz - 0: aaaabxyzpqrrrabbxyyyypqAzz - abcxyzpqrrrabbxyyyypqAzz - 0: abcxyzpqrrrabbxyyyypqAzz - aabcxyzpqrrrabbxyyyypqAzz - 0: aabcxyzpqrrrabbxyyyypqAzz - aaabcxyzpqrrrabbxyyyypAzz - 0: aaabcxyzpqrrrabbxyyyypAzz - aaabcxyzpqrrrabbxyyyypqAzz - 0: aaabcxyzpqrrrabbxyyyypqAzz - aaabcxyzpqrrrabbxyyyypqqAzz - 0: aaabcxyzpqrrrabbxyyyypqqAzz - aaabcxyzpqrrrabbxyyyypqqqAzz - 0: aaabcxyzpqrrrabbxyyyypqqqAzz - aaabcxyzpqrrrabbxyyyypqqqqAzz - 0: aaabcxyzpqrrrabbxyyyypqqqqAzz - aaabcxyzpqrrrabbxyyyypqqqqqAzz - 0: aaabcxyzpqrrrabbxyyyypqqqqqAzz - aaabcxyzpqrrrabbxyyyypqqqqqqAzz - 0: aaabcxyzpqrrrabbxyyyypqqqqqqAzz - aaaabcxyzpqrrrabbxyyyypqAzz - 0: aaaabcxyzpqrrrabbxyyyypqAzz - abxyzzpqrrrabbxyyyypqAzz - 0: abxyzzpqrrrabbxyyyypqAzz - aabxyzzzpqrrrabbxyyyypqAzz - 0: aabxyzzzpqrrrabbxyyyypqAzz - aaabxyzzzzpqrrrabbxyyyypqAzz - 0: aaabxyzzzzpqrrrabbxyyyypqAzz - aaaabxyzzzzpqrrrabbxyyyypqAzz - 0: aaaabxyzzzzpqrrrabbxyyyypqAzz - abcxyzzpqrrrabbxyyyypqAzz - 0: abcxyzzpqrrrabbxyyyypqAzz - aabcxyzzzpqrrrabbxyyyypqAzz - 0: aabcxyzzzpqrrrabbxyyyypqAzz - aaabcxyzzzzpqrrrabbxyyyypqAzz - 0: aaabcxyzzzzpqrrrabbxyyyypqAzz - aaaabcxyzzzzpqrrrabbxyyyypqAzz - 0: aaaabcxyzzzzpqrrrabbxyyyypqAzz - aaaabcxyzzzzpqrrrabbbxyyyypqAzz - 0: aaaabcxyzzzzpqrrrabbbxyyyypqAzz - aaaabcxyzzzzpqrrrabbbxyyyyypqAzz - 0: aaaabcxyzzzzpqrrrabbbxyyyyypqAzz - aaabcxyzpqrrrabbxyyyypABzz - 0: aaabcxyzpqrrrabbxyyyypABzz - aaabcxyzpqrrrabbxyyyypABBzz - 0: aaabcxyzpqrrrabbxyyyypABBzz - >>>aaabxyzpqrrrabbxyyyypqAzz - 0: aaabxyzpqrrrabbxyyyypqAzz - >aaaabxyzpqrrrabbxyyyypqAzz - 0: aaaabxyzpqrrrabbxyyyypqAzz - >>>>abcxyzpqrrrabbxyyyypqAzz - 0: abcxyzpqrrrabbxyyyypqAzz -\= Expect no match - abxyzpqrrabbxyyyypqAzz -No match - abxyzpqrrrrabbxyyyypqAzz -No match - abxyzpqrrrabxyyyypqAzz -No match - aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz -No match - aaaabcxyzzzzpqrrrabbbxyyypqAzz -No match - aaabcxyzpqrrrabbxyyyypqqqqqqqAzz -No match - -/^(abc){1,2}zz/ - abczz - 0: abczz - 1: abc - abcabczz - 0: abcabczz - 1: abc -\= Expect no match - zz -No match - abcabcabczz -No match - >>abczz -No match - -/^(b+?|a){1,2}?c/ - bc - 0: bc - 1: b - bbc - 0: bbc - 1: b - bbbc - 0: bbbc - 1: bb - bac - 0: bac - 1: a - bbac - 0: bbac - 1: a - aac - 0: aac - 1: a - abbbbbbbbbbbc - 0: abbbbbbbbbbbc - 1: bbbbbbbbbbb - bbbbbbbbbbbac - 0: bbbbbbbbbbbac - 1: a -\= Expect no match - aaac -No match - abbbbbbbbbbbac -No match - -/^(b+|a){1,2}c/ - bc - 0: bc - 1: b - bbc - 0: bbc - 1: bb - bbbc - 0: bbbc - 1: bbb - bac - 0: bac - 1: a - bbac - 0: bbac - 1: a - aac - 0: aac - 1: a - abbbbbbbbbbbc - 0: abbbbbbbbbbbc - 1: bbbbbbbbbbb - bbbbbbbbbbbac - 0: bbbbbbbbbbbac - 1: a -\= Expect no match - aaac -No match - abbbbbbbbbbbac -No match - -/^(b+|a){1,2}?bc/ - bbc - 0: bbc - 1: b - -/^(b*|ba){1,2}?bc/ - babc - 0: babc - 1: ba - bbabc - 0: bbabc - 1: ba - bababc - 0: bababc - 1: ba -\= Expect no match - bababbc -No match - babababc -No match - -/^(ba|b*){1,2}?bc/ - babc - 0: babc - 1: ba - bbabc - 0: bbabc - 1: ba - bababc - 0: bababc - 1: ba -\= Expect no match - bababbc -No match - babababc -No match - -#/^\ca\cA\c[;\c:/ -# \x01\x01\e;z -# 0: \x01\x01\x1b;z - -/^[ab\]cde]/ - athing - 0: a - bthing - 0: b - ]thing - 0: ] - cthing - 0: c - dthing - 0: d - ething - 0: e -\= Expect no match - fthing -No match - [thing -No match - \\thing -No match - -/^[]cde]/ - ]thing - 0: ] - cthing - 0: c - dthing - 0: d - ething - 0: e -\= Expect no match - athing -No match - fthing -No match - -/^[^ab\]cde]/ - fthing - 0: f - [thing - 0: [ - \\thing - 0: \ -\= Expect no match - athing -No match - bthing -No match - ]thing -No match - cthing -No match - dthing -No match - ething -No match - -/^[^]cde]/ - athing - 0: a - fthing - 0: f -\= Expect no match - ]thing -No match - cthing -No match - dthing -No match - ething -No match - -# DLC - I don't get this one -#/^\/ -#  -# 0: \x81 - -#updated to handle 16-bits utf8 -/^ÿ/ - ÿ - 0: \xc3\xbf - -/^[0-9]+$/ - 0 - 0: 0 - 1 - 0: 1 - 2 - 0: 2 - 3 - 0: 3 - 4 - 0: 4 - 5 - 0: 5 - 6 - 0: 6 - 7 - 0: 7 - 8 - 0: 8 - 9 - 0: 9 - 10 - 0: 10 - 100 - 0: 100 -\= Expect no match - abc -No match - -/^.*nter/ - enter - 0: enter - inter - 0: inter - uponter - 0: uponter - -/^xxx[0-9]+$/ - xxx0 - 0: xxx0 - xxx1234 - 0: xxx1234 -\= Expect no match - xxx -No match - -/^.+[0-9][0-9][0-9]$/ - x123 - 0: x123 - x1234 - 0: x1234 - xx123 - 0: xx123 - 123456 - 0: 123456 -\= Expect no match - 123 -No match - -/^.+?[0-9][0-9][0-9]$/ - x123 - 0: x123 - x1234 - 0: x1234 - xx123 - 0: xx123 - 123456 - 0: 123456 -\= Expect no match - 123 -No match - -/^([^!]+)!(.+)=apquxz\.ixr\.zzz\.ac\.uk$/ - abc!pqr=apquxz.ixr.zzz.ac.uk - 0: abc!pqr=apquxz.ixr.zzz.ac.uk - 1: abc - 2: pqr -\= Expect no match - !pqr=apquxz.ixr.zzz.ac.uk -No match - abc!=apquxz.ixr.zzz.ac.uk -No match - abc!pqr=apquxz:ixr.zzz.ac.uk -No match - abc!pqr=apquxz.ixr.zzz.ac.ukk -No match - -/:/ - Well, we need a colon: somewhere - 0: : -\= Expect no match - Fail without a colon -No match - -/([\da-f:]+)$/i - 0abc - 0: 0abc - 1: 0abc - abc - 0: abc - 1: abc - fed - 0: fed - 1: fed - E - 0: E - 1: E - :: - 0: :: - 1: :: - 5f03:12C0::932e - 0: 5f03:12C0::932e - 1: 5f03:12C0::932e - fed def - 0: def - 1: def - Any old stuff - 0: ff - 1: ff -\= Expect no match - 0zzz -No match - gzzz -No match - fed\x20 -No match - Any old rubbish -No match - -/^.*\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/ - .1.2.3 - 0: .1.2.3 - 1: 1 - 2: 2 - 3: 3 - A.12.123.0 - 0: A.12.123.0 - 1: 12 - 2: 123 - 3: 0 -\= Expect no match - .1.2.3333 -No match - 1.2.3 -No match - 1234.2.3 -No match - -/^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/ - 1 IN SOA non-sp1 non-sp2( - 0: 1 IN SOA non-sp1 non-sp2( - 1: 1 - 2: non-sp1 - 3: non-sp2 - 1 IN SOA non-sp1 non-sp2 ( - 0: 1 IN SOA non-sp1 non-sp2 ( - 1: 1 - 2: non-sp1 - 3: non-sp2 -\= Expect no match - 1IN SOA non-sp1 non-sp2( -No match - -/^[a-zA-Z\d][a-zA-Z\d\-]*(\.[a-zA-Z\d][a-zA-z\d\-]*)*\.$/ - a. - 0: a. - Z. - 0: Z. - 2. - 0: 2. - ab-c.pq-r. - 0: ab-c.pq-r. - 1: .pq-r - sxk.zzz.ac.uk. - 0: sxk.zzz.ac.uk. - 1: .uk - x-.y-. - 0: x-.y-. - 1: .y- -\= Expect no match - -abc.peq. -No match - -/^\*\.[a-z]([a-z\-\d]*[a-z\d]+)?(\.[a-z]([a-z\-\d]*[a-z\d]+)?)*$/ - *.a - 0: *.a - *.b0-a - 0: *.b0-a - 1: 0-a - *.c3-b.c - 0: *.c3-b.c - 1: 3-b - 2: .c - *.c-a.b-c - 0: *.c-a.b-c - 1: -a - 2: .b-c - 3: -c -\= Expect no match - *.0 -No match - *.a- -No match - *.a-b.c- -No match - *.c-a.0-c -No match - -/^(?=ab(de))(abd)(e)/ - abde - 0: abde - 1: de - 2: abd - 3: e - -/^(?!(ab)de|x)(abd)(f)/ - abdf - 0: abdf - 1: - 2: abd - 3: f - -/^(?=(ab(cd)))(ab)/ - abcd - 0: ab - 1: abcd - 2: cd - 3: ab - -/^[\da-f](\.[\da-f])*$/i - a.b.c.d - 0: a.b.c.d - 1: .d - A.B.C.D - 0: A.B.C.D - 1: .D - a.b.c.1.2.3.C - 0: a.b.c.1.2.3.C - 1: .C - -/^\".*\"\s*(;.*)?$/ - \"1234\" - 0: "1234" - \"abcd\" ; - 0: "abcd" ; - 1: ; - \"\" ; rhubarb - 0: "" ; rhubarb - 1: ; rhubarb -\= Expect no match - \"1234\" : things -No match - -/^$/ - \ - 0: -\= Expect no match - A non-empty line -No match - -/ ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/x - ab c - 0: ab c -\= Expect no match - abc -No match - ab cde -No match - -/(?x) ^ a (?# begins with a) b\sc (?# then b c) $ (?# then end)/ - ab c - 0: ab c -\= Expect no match - abc -No match - ab cde -No match - -/^ a\ b[c ]d $/x - a bcd - 0: a bcd - a b d - 0: a b d -\= Expect no match - abcd -No match - ab d -No match - -/^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$/ - abcdefhijklm - 0: abcdefhijklm - 1: abc - 2: bc - 3: c - 4: def - 5: ef - 6: f - 7: hij - 8: ij - 9: j -10: klm -11: lm -12: m - -/^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$/ - abcdefhijklm - 0: abcdefhijklm - 1: bc - 2: c - 3: ef - 4: f - 5: ij - 6: j - 7: lm - 8: m - -#/^[\w][\W][\s][\S][\d][\D][\b][\n][\c]][\022]/ -# a+ Z0+\x08\n\x1d\x12 -# 0: a+ Z0+\x08\x0a\x1d\x12 - -/^[.^$|()*+?{,}]+/ - .^\$(*+)|{?,?} - 0: .^$(*+)|{?,?} - -/^a*\w/ - z - 0: z - az - 0: az - aaaz - 0: aaaz - a - 0: a - aa - 0: aa - aaaa - 0: aaaa - a+ - 0: a - aa+ - 0: aa - -/^a*?\w/ - z - 0: z - az - 0: a - aaaz - 0: a - a - 0: a - aa - 0: a - aaaa - 0: a - a+ - 0: a - aa+ - 0: a - -/^a+\w/ - az - 0: az - aaaz - 0: aaaz - aa - 0: aa - aaaa - 0: aaaa - aa+ - 0: aa - -/^a+?\w/ - az - 0: az - aaaz - 0: aa - aa - 0: aa - aaaa - 0: aa - aa+ - 0: aa - -/^\d{8}\w{2,}/ - 1234567890 - 0: 1234567890 - 12345678ab - 0: 12345678ab - 12345678__ - 0: 12345678__ -\= Expect no match - 1234567 -No match - -/^[aeiou\d]{4,5}$/ - uoie - 0: uoie - 1234 - 0: 1234 - 12345 - 0: 12345 - aaaaa - 0: aaaaa -\= Expect no match - 123456 -No match - -/^[aeiou\d]{4,5}?/ - uoie - 0: uoie - 1234 - 0: 1234 - 12345 - 0: 1234 - aaaaa - 0: aaaa - 123456 - 0: 1234 - -/\A(abc|def)=(\1){2,3}\Z/ - abc=abcabc - 0: abc=abcabc - 1: abc - 2: abc - def=defdefdef - 0: def=defdefdef - 1: def - 2: def -\= Expect no match - abc=defdef -No match - -/^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\11*(\3\4)\1(?#)2$/ - abcdefghijkcda2 - 0: abcdefghijkcda2 - 1: a - 2: b - 3: c - 4: d - 5: e - 6: f - 7: g - 8: h - 9: i -10: j -11: k -12: cd - abcdefghijkkkkcda2 - 0: abcdefghijkkkkcda2 - 1: a - 2: b - 3: c - 4: d - 5: e - 6: f - 7: g - 8: h - 9: i -10: j -11: k -12: cd - -/(cat(a(ract|tonic)|erpillar)) \1()2(3)/ - cataract cataract23 - 0: cataract cataract23 - 1: cataract - 2: aract - 3: ract - 4: - 5: 3 - catatonic catatonic23 - 0: catatonic catatonic23 - 1: catatonic - 2: atonic - 3: tonic - 4: - 5: 3 - caterpillar caterpillar23 - 0: caterpillar caterpillar23 - 1: caterpillar - 2: erpillar - 3: - 4: - 5: 3 - - -/^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/ - From abcd Mon Sep 01 12:33:02 1997 - 0: From abcd Mon Sep 01 12:33 - 1: abcd - -/^From\s+\S+\s+([a-zA-Z]{3}\s+){2}\d{1,2}\s+\d\d:\d\d/ - From abcd Mon Sep 01 12:33:02 1997 - 0: From abcd Mon Sep 01 12:33 - 1: Sep - From abcd Mon Sep 1 12:33:02 1997 - 0: From abcd Mon Sep 1 12:33 - 1: Sep -\= Expect no match - From abcd Sep 01 12:33:02 1997 -No match - -/^12.34/s - 12\n34 - 0: 12\x0a34 - 12\r34 - 0: 12\x0d34 - -/\w+(?=\t)/ - the quick brown\t fox - 0: brown - -/foo(?!bar)(.*)/ - foobar is foolish see? - 0: foolish see? - 1: lish see? - -/(?:(?!foo)...|^.{0,2})bar(.*)/ - foobar crowbar etc - 0: rowbar etc - 1: etc - barrel - 0: barrel - 1: rel - 2barrel - 0: 2barrel - 1: rel - A barrel - 0: A barrel - 1: rel - -/^(\D*)(?=\d)(?!123)/ - abc456 - 0: abc - 1: abc -\= Expect no match - abc123 -No match - -/^1234(?# test newlines - inside)/ - 1234 - 0: 1234 - -/^1234 #comment in extended re - /x - 1234 - 0: 1234 - -/#rhubarb - abcd/x - abcd - 0: abcd - -/^abcd#rhubarb/x - abcd - 0: abcd - -/^(a)\1{2,3}(.)/ - aaab - 0: aaab - 1: a - 2: b - aaaab - 0: aaaab - 1: a - 2: b - aaaaab - 0: aaaaa - 1: a - 2: a - aaaaaab - 0: aaaaa - 1: a - 2: a - -/(?!^)abc/ - the abc - 0: abc -\= Expect no match - abc -No match - -/(?=^)abc/ - abc - 0: abc -\= Expect no match - the abc -No match - -/^[ab]{1,3}(ab*|b)/ - aabbbbb - 0: aabb - 1: b - -/^[ab]{1,3}?(ab*|b)/ - aabbbbb - 0: aabbbbb - 1: abbbbb - -/^[ab]{1,3}?(ab*?|b)/ - aabbbbb - 0: aa - 1: a - -/^[ab]{1,3}(ab*?|b)/ - aabbbbb - 0: aabb - 1: b - -/ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # optional leading comment -(?: (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # initial word -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) )* # further okay, if led by a period -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -# address -| # or -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # one word, optionally followed by.... -(?: -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] | # atom and space parts, or... -\( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) | # comments, or... - -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -# quoted strings -)* -< (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # leading < -(?: @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* - -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* , (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -)* # further okay, if led by comma -: # closing colon -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* )? # optional route -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) # initial word -(?: (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -" (?: # opening quote... -[^\\\x80-\xff\n\015"] # Anything except backslash and quote -| # or -\\ [^\x80-\xff] # Escaped something (something != CR) -)* " # closing quote -) )* # further okay, if led by a period -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* @ (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # initial subdomain -(?: # -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* \. # if led by a period... -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* (?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| \[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) # ...further okay -)* -# address spec -(?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* > # trailing > -# name and address -) (?: [\040\t] | \( -(?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] | \( (?: [^\\\x80-\xff\n\015()] | \\ [^\x80-\xff] )* \) )* -\) )* # optional trailing comment -/x - Alan Other - 0: Alan Other - - 0: user@dom.ain - user\@dom.ain - 0: user@dom.ain - \"A. Other\" (a comment) - 0: "A. Other" (a comment) - A. Other (a comment) - 0: Other (a comment) - \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay - 0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay - A missing angle @,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# additional words -)* -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -# address -| # or -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -# leading word -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # "normal" atoms and or spaces -(?: -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -| -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -) # "special" comment or quoted string -[^()<>@,;:".\\\[\]\x80-\xff\000-\010\012-\037] * # more "normal" -)* -< -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# < -(?: -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -(?: , -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -)* # additional domains -: -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)? # optional route -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -# Atom -| # or -" # " -[^\\\x80-\xff\n\015"] * # normal -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015"] * )* # ( special normal* )* -" # " -# Quoted string -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# additional words -)* -@ -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -(?: -\. -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -(?: -[^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]+ # some number of atom characters... -(?![^(\040)<>@,;:".\\\[\]\000-\037\x80-\xff]) # ..not followed by something that could be part of an atom -| -\[ # [ -(?: [^\\\x80-\xff\n\015\[\]] | \\ [^\x80-\xff] )* # stuff -\] # ] -) -[\040\t]* # Nab whitespace. -(?: -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: # ( -(?: \\ [^\x80-\xff] | -\( # ( -[^\\\x80-\xff\n\015()] * # normal* -(?: \\ [^\x80-\xff] [^\\\x80-\xff\n\015()] * )* # (special normal*)* -\) # ) -) # special -[^\\\x80-\xff\n\015()] * # normal* -)* # )* -\) # ) -[\040\t]* )* # If comment found, allow more spaces. -# optional trailing comments -)* -# address spec -> # > -# name and address -) -/x - Alan Other - 0: Alan Other - - 0: user@dom.ain - user\@dom.ain - 0: user@dom.ain - \"A. Other\" (a comment) - 0: "A. Other" - A. Other (a comment) - 0: Other - \"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"\@x400-re.lay - 0: "/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/"@x400-re.lay - A missing angle ?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f - -/P[^*]TAIRE[^*]{1,6}?LL/ - xxxxxxxxxxxPSTAIREISLLxxxxxxxxx - 0: PSTAIREISLL - -/P[^*]TAIRE[^*]{1,}?LL/ - xxxxxxxxxxxPSTAIREISLLxxxxxxxxx - 0: PSTAIREISLL - -/(\.\d\d[1-9]?)\d+/ - 1.230003938 - 0: .230003938 - 1: .23 - 1.875000282 - 0: .875000282 - 1: .875 - 1.235 - 0: .235 - 1: .23 - -/(\.\d\d((?=0)|\d(?=\d)))/ - 1.230003938 - 0: .23 - 1: .23 - 2: - 1.875000282 - 0: .875 - 1: .875 - 2: 5 -\= Expect no match - 1.235 -No match - -/\b(foo)\s+(\w+)/i - Food is on the foo table - 0: foo table - 1: foo - 2: table - -/foo(.*)bar/ - The food is under the bar in the barn. - 0: food is under the bar in the bar - 1: d is under the bar in the - -/foo(.*?)bar/ - The food is under the bar in the barn. - 0: food is under the bar - 1: d is under the - -/(.*)(\d*)/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: 53147 - 2: - -/(.*)(\d+)/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: 5314 - 2: 7 - -/(.*?)(\d*)/ - I have 2 numbers: 53147 - 0: - 1: - 2: - -/(.*?)(\d+)/ - I have 2 numbers: 53147 - 0: I have 2 - 1: I have - 2: 2 - -/(.*)(\d+)$/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: 5314 - 2: 7 - -/(.*?)(\d+)$/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: - 2: 53147 - -/(.*)\b(\d+)$/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: - 2: 53147 - -/(.*\D)(\d+)$/ - I have 2 numbers: 53147 - 0: I have 2 numbers: 53147 - 1: I have 2 numbers: - 2: 53147 - -/^\D*(?!123)/ - ABC123 - 0: AB - -/^(\D*)(?=\d)(?!123)/ - ABC445 - 0: ABC - 1: ABC -\= Expect no match - ABC123 -No match - -/^[W-]46]/ - W46]789 - 0: W46] - -46]789 - 0: -46] -\= Expect no match - Wall -No match - Zebra -No match - 42 -No match - [abcd] -No match - ]abcd[ -No match - -/^[W-\]46]/ - W46]789 - 0: W - Wall - 0: W - Zebra - 0: Z - Xylophone - 0: X - 42 - 0: 4 - [abcd] - 0: [ - ]abcd[ - 0: ] - \\backslash - 0: \ -\= Expect no match - -46]789 -No match - well -No match - -/\d\d\/\d\d\/\d\d\d\d/ - 01/01/2000 - 0: 01/01/2000 - -/word (?:[a-zA-Z0-9]+ ){0,10}otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark otherword - 0: word cat dog elephant mussel cow horse canary baboon snake shark otherword -\= Expect no match - word cat dog elephant mussel cow horse canary baboon snake shark -No match - -/word (?:[a-zA-Z0-9]+ ){0,300}otherword/ -\= Expect no match - word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope -No match - -/^(a){0,0}/ - bcd - 0: - abc - 0: - aab - 0: - -/^(a){0,1}/ - bcd - 0: - abc - 0: a - 1: a - aab - 0: a - 1: a - -/^(a){0,2}/ - bcd - 0: - abc - 0: a - 1: a - aab - 0: aa - 1: a - -/^(a){0,3}/ - bcd - 0: - abc - 0: a - 1: a - aab - 0: aa - 1: a - aaa - 0: aaa - 1: a - -/^(a){0,}/ - bcd - 0: - abc - 0: a - 1: a - aab - 0: aa - 1: a - aaa - 0: aaa - 1: a - aaaaaaaa - 0: aaaaaaaa - 1: a - -/^(a){1,1}/ - abc - 0: a - 1: a - aab - 0: a - 1: a -\= Expect no match - bcd -No match - -/^(a){1,2}/ - abc - 0: a - 1: a - aab - 0: aa - 1: a -\= Expect no match - bcd -No match - -/^(a){1,3}/ - abc - 0: a - 1: a - aab - 0: aa - 1: a - aaa - 0: aaa - 1: a -\= Expect no match - bcd -No match - -/^(a){1,}/ - abc - 0: a - 1: a - aab - 0: aa - 1: a - aaa - 0: aaa - 1: a - aaaaaaaa - 0: aaaaaaaa - 1: a -\= Expect no match - bcd -No match - -/.*\.gif/ - borfle\nbib.gif\nno - 0: bib.gif - -/.{0,}\.gif/ - borfle\nbib.gif\nno - 0: bib.gif - -/.*\.gif/m - borfle\nbib.gif\nno - 0: bib.gif - -/.*\.gif/s - borfle\nbib.gif\nno - 0: borfle\x0abib.gif - -/.*\.gif/ms - borfle\nbib.gif\nno - 0: borfle\x0abib.gif - -/.*$/ - borfle\nbib.gif\nno - 0: no - -/.*$/m - borfle\nbib.gif\nno - 0: borfle - -/.*$/s - borfle\nbib.gif\nno - 0: borfle\x0abib.gif\x0ano - -/.*$/ms - borfle\nbib.gif\nno - 0: borfle\x0abib.gif\x0ano - -/.*$/ - borfle\nbib.gif\nno\n - 0: no - -/.*$/m - borfle\nbib.gif\nno\n - 0: borfle - -/.*$/s - borfle\nbib.gif\nno\n - 0: borfle\x0abib.gif\x0ano\x0a - -/.*$/ms - borfle\nbib.gif\nno\n - 0: borfle\x0abib.gif\x0ano\x0a - -/(.*X|^B)/ - abcde\n1234Xyz - 0: 1234X - 1: 1234X - BarFoo - 0: B - 1: B -\= Expect no match - abcde\nBar -No match - -/(.*X|^B)/m - abcde\n1234Xyz - 0: 1234X - 1: 1234X - BarFoo - 0: B - 1: B - abcde\nBar - 0: B - 1: B - -/(.*X|^B)/s - abcde\n1234Xyz - 0: abcde\x0a1234X - 1: abcde\x0a1234X - BarFoo - 0: B - 1: B -\= Expect no match - abcde\nBar -No match - -/(.*X|^B)/ms - abcde\n1234Xyz - 0: abcde\x0a1234X - 1: abcde\x0a1234X - BarFoo - 0: B - 1: B - abcde\nBar - 0: B - 1: B - -/(?s)(.*X|^B)/ - abcde\n1234Xyz - 0: abcde\x0a1234X - 1: abcde\x0a1234X - BarFoo - 0: B - 1: B -\= Expect no match - abcde\nBar -No match - -/(?s:.*X|^B)/ - abcde\n1234Xyz - 0: abcde\x0a1234X - BarFoo - 0: B -\= Expect no match - abcde\nBar -No match - -/^.*B/ -\= Expect no match - abc\nB -No match - -/(?s)^.*B/ - abc\nB - 0: abc\x0aB - -/(?m)^.*B/ - abc\nB - 0: B - -/(?ms)^.*B/ - abc\nB - 0: abc\x0aB - -/(?ms)^B/ - abc\nB - 0: B - -/(?s)B$/ - B\n - 0: B - -/^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/ - 123456654321 - 0: 123456654321 - -/^\d\d\d\d\d\d\d\d\d\d\d\d/ - 123456654321 - 0: 123456654321 - -/^[\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d][\d]/ - 123456654321 - 0: 123456654321 - -/^[abc]{12}/ - abcabcabcabc - 0: abcabcabcabc - -/^[a-c]{12}/ - abcabcabcabc - 0: abcabcabcabc - -/^(a|b|c){12}/ - abcabcabcabc - 0: abcabcabcabc - 1: c - -/^[abcdefghijklmnopqrstuvwxy0123456789]/ - n - 0: n -\= Expect no match - z -No match - -/abcde{0,0}/ - abcd - 0: abcd -\= Expect no match - abce -No match - -/ab[cd]{0,0}e/ - abe - 0: abe -\= Expect no match - abcde -No match - -/ab(c){0,0}d/ - abd - 0: abd -\= Expect no match - abcd -No match - -/a(b*)/ - a - 0: a - 1: - ab - 0: ab - 1: b - abbbb - 0: abbbb - 1: bbbb -\= Expect no match - bbbbb -No match - -/ab\d{0}e/ - abe - 0: abe -\= Expect no match - ab1e -No match - -/"([^\\"]+|\\.)*"/ - the \"quick\" brown fox - 0: "quick" - 1: quick - \"the \\\"quick\\\" brown fox\" - 0: "the \"quick\" brown fox" - 1: brown fox - -/]{0,})>]{0,})>([\d]{0,}\.)(.*)((
([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/is - 43.Word Processor
(N-1286)
Lega lstaff.comCA - Statewide - 0: 43.Word Processor
(N-1286)
Lega lstaff.comCA - Statewide - 1: BGCOLOR='#DBE9E9' - 2: align=left valign=top - 3: 43. - 4: Word Processor
(N-1286) - 5: - 6: - 7: - 8: align=left valign=top - 9: Lega lstaff.com -10: align=left valign=top -11: CA - Statewide - -/a[^a]b/ - acb - 0: acb - a\nb - 0: a\x0ab - -/a.b/ - acb - 0: acb -\= Expect no match - a\nb -No match - -/a[^a]b/s - acb - 0: acb - a\nb - 0: a\x0ab - -/a.b/s - acb - 0: acb - a\nb - 0: a\x0ab - -/^(b+?|a){1,2}?c/ - bac - 0: bac - 1: a - bbac - 0: bbac - 1: a - bbbac - 0: bbbac - 1: a - bbbbac - 0: bbbbac - 1: a - bbbbbac - 0: bbbbbac - 1: a - -/^(b+|a){1,2}?c/ - bac - 0: bac - 1: a - bbac - 0: bbac - 1: a - bbbac - 0: bbbac - 1: a - bbbbac - 0: bbbbac - 1: a - bbbbbac - 0: bbbbbac - 1: a - -/(?!\A)x/m - a\bx\n - 0: x - a\nx\n - 0: x -\= Expect no match - x\nb\n -No match - -/(A|B)*?CD/ - CD - 0: CD - -/(A|B)*CD/ - CD - 0: CD - -/(AB)*?\1/ - ABABAB - 0: ABAB - 1: AB - -/(AB)*\1/ - ABABAB - 0: ABABAB - 1: AB - -/(?.*/)foo" - /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo - 0: /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/and/foo -\= Expect no match - /this/is/a/very/long/line/in/deed/with/very/many/slashes/in/it/you/see/ -No match - -/(?>(\.\d\d[1-9]?))\d+/ - 1.230003938 - 0: .230003938 - 1: .23 - 1.875000282 - 0: .875000282 - 1: .875 -\= Expect no match - 1.235 -No match - -/^((?>\w+)|(?>\s+))*$/ - now is the time for all good men to come to the aid of the party - 0: now is the time for all good men to come to the aid of the party - 1: party -\= Expect no match - this is not a line with only words and spaces! -No match - -/(\d+)(\w)/ - 12345a - 0: 12345a - 1: 12345 - 2: a - 12345+ - 0: 12345 - 1: 1234 - 2: 5 - -/((?>\d+))(\w)/ - 12345a - 0: 12345a - 1: 12345 - 2: a -\= Expect no match - 12345+ -No match - -/(?>a+)b/ - aaab - 0: aaab - -/((?>a+)b)/ - aaab - 0: aaab - 1: aaab - -/(?>(a+))b/ - aaab - 0: aaab - 1: aaa - -/(?>b)+/ - aaabbbccc - 0: bbb - -/(?>a+|b+|c+)*c/ - aaabbbbccccd - 0: aaabbbbc - -/((?>[^()]+)|\([^()]*\))+/ - ((abc(ade)ufh()()x - 0: abc(ade)ufh()()x - 1: x - -/\(((?>[^()]+)|\([^()]+\))+\)/ - (abc) - 0: (abc) - 1: abc - (abc(def)xyz) - 0: (abc(def)xyz) - 1: xyz -\= Expect no match - ((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -No match - -/a(?-i)b/i - ab - 0: ab - Ab - 0: Ab -\= Expect no match - aB -No match - AB -No match - -/(a (?x)b c)d e/ - a bcd e - 0: a bcd e - 1: a bc -\= Expect no match - a b cd e -No match - abcd e -No match - a bcde -No match - -/(a b(?x)c d (?-x)e f)/ - a bcde f - 0: a bcde f - 1: a bcde f -\= Expect no match - abcdef -No match - -/(a(?i)b)c/ - abc - 0: abc - 1: ab - aBc - 0: aBc - 1: aB -\= Expect no match - abC -No match - aBC -No match - Abc -No match - ABc -No match - ABC -No match - AbC -No match - -/a(?i:b)c/ - abc - 0: abc - aBc - 0: aBc -\= Expect no match - ABC -No match - abC -No match - aBC -No match - -/a(?i:b)*c/ - aBc - 0: aBc - aBBc - 0: aBBc -\= Expect no match - aBC -No match - aBBC -No match - -/a(?=b(?i)c)\w\wd/ - abcd - 0: abcd - abCd - 0: abCd -\= Expect no match - aBCd -No match - abcD -No match - -/(?s-i:more.*than).*million/i - more than million - 0: more than million - more than MILLION - 0: more than MILLION - more \n than Million - 0: more \x0a than Million -\= Expect no match - MORE THAN MILLION -No match - more \n than \n million -No match - -/(?:(?s-i)more.*than).*million/i - more than million - 0: more than million - more than MILLION - 0: more than MILLION - more \n than Million - 0: more \x0a than Million -\= Expect no match - MORE THAN MILLION -No match - more \n than \n million -No match - -/(?>a(?i)b+)+c/ - abc - 0: abc - aBbc - 0: aBbc - aBBc - 0: aBBc -\= Expect no match - Abc -No match - abAb -No match - abbC -No match - -/(?=a(?i)b)\w\wc/ - abc - 0: abc - aBc - 0: aBc -\= Expect no match - Ab -No match - abC -No match - aBC -No match - -/(?<=a(?i)b)(\w\w)c/ - abxxc - 0: xxc - 1: xx - aBxxc - 0: xxc - 1: xx -\= Expect no match - Abxxc -No match - ABxxc -No match - abxxC -No match - -/(?:(a)|b)(?(1)A|B)/ - aA - 0: aA - 1: a - bB - 0: bB -\= Expect no match - aB -No match - bA -No match - -/^(a)?(?(1)a|b)+$/ - aa - 0: aa - 1: a - b - 0: b - bb - 0: bb -\= Expect no match - ab -No match - -# Perl gets this next one wrong if the pattern ends with $; in that case it -# fails to match "12". - -/^(?(?=abc)\w{3}:|\d\d)/ - abc: - 0: abc: - 12 - 0: 12 - 123 - 0: 12 -\= Expect no match - xyz -No match - -/^(?(?!abc)\d\d|\w{3}:)$/ - abc: - 0: abc: - 12 - 0: 12 -\= Expect no match - 123 -No match - xyz -No match - -/(?(?<=foo)bar|cat)/ - foobar - 0: bar - cat - 0: cat - fcat - 0: cat - focat - 0: cat -\= Expect no match - foocat -No match - -/(?(?a*)*/ - a - 0: a - aa - 0: aa - aaaa - 0: aaaa - -/(abc|)+/ - abc - 0: abc - 1: - abcabc - 0: abcabc - 1: - abcabcabc - 0: abcabcabc - 1: - xyz - 0: - 1: - -/([a]*)*/ - a - 0: a - 1: - aaaaa - 0: aaaaa - 1: - -/([ab]*)*/ - a - 0: a - 1: - b - 0: b - 1: - ababab - 0: ababab - 1: - aaaabcde - 0: aaaab - 1: - bbbb - 0: bbbb - 1: - -/([^a]*)*/ - b - 0: b - 1: - bbbb - 0: bbbb - 1: - aaa - 0: - 1: - -/([^ab]*)*/ - cccc - 0: cccc - 1: - abab - 0: - 1: - -/([a]*?)*/ - a - 0: - 1: - aaaa - 0: - 1: - -/([ab]*?)*/ - a - 0: - 1: - b - 0: - 1: - abab - 0: - 1: - baba - 0: - 1: - -/([^a]*?)*/ - b - 0: - 1: - bbbb - 0: - 1: - aaa - 0: - 1: - -/([^ab]*?)*/ - c - 0: - 1: - cccc - 0: - 1: - baba - 0: - 1: - -/(?>a*)*/ - a - 0: a - aaabcde - 0: aaa - -/((?>a*))*/ - aaaaa - 0: aaaaa - 1: - aabbaa - 0: aa - 1: - -/((?>a*?))*/ - aaaaa - 0: - 1: - aabbaa - 0: - 1: - -/(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /x - 12-sep-98 - 0: 12-sep-98 - 12-09-98 - 0: 12-09-98 -\= Expect no match - sep-12-98 -No match - -/(?<=(foo))bar\1/ - foobarfoo - 0: barfoo - 1: foo - foobarfootling - 0: barfoo - 1: foo -\= Expect no match - foobar -No match - barfoo -No match - -/(?i:saturday|sunday)/ - saturday - 0: saturday - sunday - 0: sunday - Saturday - 0: Saturday - Sunday - 0: Sunday - SATURDAY - 0: SATURDAY - SUNDAY - 0: SUNDAY - SunDay - 0: SunDay - -/(a(?i)bc|BB)x/ - abcx - 0: abcx - 1: abc - aBCx - 0: aBCx - 1: aBC - bbx - 0: bbx - 1: bb - BBx - 0: BBx - 1: BB -\= Expect no match - abcX -No match - aBCX -No match - bbX -No match - BBX -No match - -/^([ab](?i)[cd]|[ef])/ - ac - 0: ac - 1: ac - aC - 0: aC - 1: aC - bD - 0: bD - 1: bD - elephant - 0: e - 1: e - Europe - 0: E - 1: E - frog - 0: f - 1: f - France - 0: F - 1: F -\= Expect no match - Africa -No match - -/^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)/ - ab - 0: ab - 1: ab - aBd - 0: aBd - 1: aBd - xy - 0: xy - 1: xy - xY - 0: xY - 1: xY - zebra - 0: z - 1: z - Zambesi - 0: Z - 1: Z -\= Expect no match - aCD -No match - XY -No match - -/(?<=foo\n)^bar/m - foo\nbar - 0: bar -\= Expect no match - bar -No match - baz\nbar -No match - -/(?<=(?]&/ - <&OUT - 0: <& - -/^(a\1?){4}$/ - aaaaaaaaaa - 0: aaaaaaaaaa - 1: aaaa -\= Expect no match - AB -No match - aaaaaaaaa -No match - aaaaaaaaaaa -No match - -/^(a(?(1)\1)){4}$/ - aaaaaaaaaa - 0: aaaaaaaaaa - 1: aaaa -\= Expect no match - aaaaaaaaa -No match - aaaaaaaaaaa -No match - -/(?:(f)(o)(o)|(b)(a)(r))*/ - foobar - 0: foobar - 1: f - 2: o - 3: o - 4: b - 5: a - 6: r - -/(?<=a)b/ - ab - 0: b -\= Expect no match - cb -No match - b -No match - -/(? - 2: abcd - xy:z:::abcd - 0: xy:z:::abcd - 1: xy:z::: - 2: abcd - -/^[^bcd]*(c+)/ - aexycd - 0: aexyc - 1: c - -/(a*)b+/ - caab - 0: aab - 1: aa - -/([\w:]+::)?(\w+)$/ - abcd - 0: abcd - 1: - 2: abcd - xy:z:::abcd - 0: xy:z:::abcd - 1: xy:z::: - 2: abcd -\= Expect no match - abcd: -No match - abcd: -No match - -/^[^bcd]*(c+)/ - aexycd - 0: aexyc - 1: c - -/(>a+)ab/ - -/(?>a+)b/ - aaab - 0: aaab - -/([[:]+)/ - a:[b]: - 0: :[ - 1: :[ - -/([[=]+)/ - a=[b]= - 0: =[ - 1: =[ - -/([[.]+)/ - a.[b]. - 0: .[ - 1: .[ - -/((?>a+)b)/ - aaab - 0: aaab - 1: aaab - -/(?>(a+))b/ - aaab - 0: aaab - 1: aaa - -/((?>[^()]+)|\([^()]*\))+/ - ((abc(ade)ufh()()x - 0: abc(ade)ufh()()x - 1: x - -/a\Z/ -\= Expect no match - aaab -No match - a\nb\n -No match - -/b\Z/ - a\nb\n - 0: b - -/b\z/ - -/b\Z/ - a\nb - 0: b - -/b\z/ - a\nb - 0: b - -/^(?>(?(1)\.|())[^\W_](?>[a-z0-9-]*[^\W_])?)+$/ - a - 0: a - 1: - abc - 0: abc - 1: - a-b - 0: a-b - 1: - 0-9 - 0: 0-9 - 1: - a.b - 0: a.b - 1: - 5.6.7 - 0: 5.6.7 - 1: - the.quick.brown.fox - 0: the.quick.brown.fox - 1: - a100.b200.300c - 0: a100.b200.300c - 1: - 12-ab.1245 - 0: 12-ab.1245 - 1: -\= Expect no match - \ -No match - .a -No match - -a -No match - a- -No match - a. -No match - a_b -No match - a.- -No match - a.. -No match - ab..bc -No match - the.quick.brown.fox- -No match - the.quick.brown.fox. -No match - the.quick.brown.fox_ -No match - the.quick.brown.fox+ -No match - -/(?>.*)(?<=(abcd|wxyz))/ - alphabetabcd - 0: alphabetabcd - 1: abcd - endingwxyz - 0: endingwxyz - 1: wxyz -\= Expect no match - a rather long string that doesn't end with one of them -No match - -/word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword/ - word cat dog elephant mussel cow horse canary baboon snake shark otherword - 0: word cat dog elephant mussel cow horse canary baboon snake shark otherword -\= Expect no match - word cat dog elephant mussel cow horse canary baboon snake shark -No match - -/word (?>[a-zA-Z0-9]+ ){0,30}otherword/ -\= Expect no match - word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope -No match - -/(?<=\d{3}(?!999))foo/ - 999foo - 0: foo - 123999foo - 0: foo -\= Expect no match - 123abcfoo -No match - -/(?<=(?!...999)\d{3})foo/ - 999foo - 0: foo - 123999foo - 0: foo -\= Expect no match - 123abcfoo -No match - -/(?<=\d{3}(?!999)...)foo/ - 123abcfoo - 0: foo - 123456foo - 0: foo -\= Expect no match - 123999foo -No match - -/(?<=\d{3}...)(? - 2: - 3: abcd -
- 2: - 3: abcd - \s*)=(?>\s*) # find - 2: - 3: abcd - Z)+|A)*/ - ZABCDEFG - 0: ZA - 1: A - -/((?>)+|A)*/ - ZABCDEFG - 0: - 1: - -/^[\d-a]/ - abcde - 0: a - -things - 0: - - 0digit - 0: 0 -\= Expect no match - bcdef -No match - -/[\s]+/ - > \x09\x0a\x0c\x0d\x0b< - 0: \x09\x0a\x0c\x0d\x0b - -/\s+/ - > \x09\x0a\x0c\x0d\x0b< - 0: \x09\x0a\x0c\x0d\x0b - -/a b/x - ab - 0: ab - -/(?!\A)x/m - a\nxb\n - 0: x - -/(?!^)x/m -\= Expect no match - a\nxb\n -No match - -#/abc\Qabc\Eabc/ -# abcabcabc -# 0: abcabcabc - -#/abc\Q(*+|\Eabc/ -# abc(*+|abc -# 0: abc(*+|abc - -#/ abc\Q abc\Eabc/x -# abc abcabc -# 0: abc abcabc -#\= Expect no match -# abcabcabc -#No match - -#/abc#comment -# \Q#not comment -# literal\E/x -# abc#not comment\n literal -# 0: abc#not comment\x0a literal - -#/abc#comment -# \Q#not comment -# literal/x -# abc#not comment\n literal -# 0: abc#not comment\x0a literal - -#/abc#comment -# \Q#not comment -# literal\E #more comment -# /x -# abc#not comment\n literal -# 0: abc#not comment\x0a literal - -#/abc#comment -# \Q#not comment -# literal\E #more comment/x -# abc#not comment\n literal -# 0: abc#not comment\x0a literal - -#/\Qabc\$xyz\E/ -# abc\\\$xyz -# 0: abc\$xyz - -#/\Qabc\E\$\Qxyz\E/ -# abc\$xyz -# 0: abc$xyz - -/\Gabc/ - abc - 0: abc -\= Expect no match - xyzabc -No match - -/a(?x: b c )d/ - XabcdY - 0: abcd -\= Expect no match - Xa b c d Y -No match - -/((?x)x y z | a b c)/ - XabcY - 0: abc - 1: abc - AxyzB - 0: xyz - 1: xyz - -/(?i)AB(?-i)C/ - XabCY - 0: abC -\= Expect no match - XabcY -No match - -/((?i)AB(?-i)C|D)E/ - abCE - 0: abCE - 1: abC - DE - 0: DE - 1: D -\= Expect no match - abcE -No match - abCe -No match - dE -No match - De -No match - -/(.*)\d+\1/ - abc123abc - 0: abc123abc - 1: abc - abc123bc - 0: bc123bc - 1: bc - -/(.*)\d+\1/s - abc123abc - 0: abc123abc - 1: abc - abc123bc - 0: bc123bc - 1: bc - -/((.*))\d+\1/ - abc123abc - 0: abc123abc - 1: abc - 2: abc - abc123bc - 0: bc123bc - 1: bc - 2: bc - -# This tests for an IPv6 address in the form where it can have up to -# eight components, one and only one of which is empty. This must be -# an internal component. - -/^(?!:) # colon disallowed at start - (?: # start of item - (?: [0-9a-f]{1,4} | # 1-4 hex digits or - (?(1)0 | () ) ) # if null previously matched, fail; else null - : # followed by colon - ){1,7} # end item; 1-7 of them required - [0-9a-f]{1,4} $ # final hex number at end of string - (?(1)|.) # check that there was an empty component - /ix - a123::a123 - 0: a123::a123 - 1: - a123:b342::abcd - 0: a123:b342::abcd - 1: - a123:b342::324e:abcd - 0: a123:b342::324e:abcd - 1: - a123:ddde:b342::324e:abcd - 0: a123:ddde:b342::324e:abcd - 1: - a123:ddde:b342::324e:dcba:abcd - 0: a123:ddde:b342::324e:dcba:abcd - 1: - a123:ddde:9999:b342::324e:dcba:abcd - 0: a123:ddde:9999:b342::324e:dcba:abcd - 1: -\= Expect no match - 1:2:3:4:5:6:7:8 -No match - a123:bce:ddde:9999:b342::324e:dcba:abcd -No match - a123::9999:b342::324e:dcba:abcd -No match - abcde:2:3:4:5:6:7:8 -No match - ::1 -No match - abcd:fee0:123:: -No match - :1 -No match - 1: -No match - -#/[z\Qa-d]\E]/ -# z -# 0: z -# a -# 0: a -# - -# 0: - -# d -# 0: d -# ] -# 0: ] -#\= Expect no match -# b -#No match - -#TODO: PCRE has an optimization to make this workable, .NET does not -#/(a+)*b/ -#\= Expect no match -# aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -#No match - -# All these had to be updated because we understand unicode -# and this looks like it's expecting single byte matches - -# .NET generates \xe4...not sure what's up, might just be different code pages -/(?i)reg(?:ul(?:[aä]|ae)r|ex)/ - REGular - 0: REGular - regulaer - 0: regulaer - Regex - 0: Regex - regulär - 0: regul\xc3\xa4r - -#/Åæåä[à-ÿÀ-ß]+/ -# Åæåäà -# 0: \xc5\xe6\xe5\xe4\xe0 -# Åæåäÿ -# 0: \xc5\xe6\xe5\xe4\xff -# ÅæåäÀ -# 0: \xc5\xe6\xe5\xe4\xc0 -# Åæåäß -# 0: \xc5\xe6\xe5\xe4\xdf - -/(?<=Z)X./ - \x84XAZXB - 0: XB - -/ab cd (?x) de fg/ - ab cd defg - 0: ab cd defg - -/ab cd(?x) de fg/ - ab cddefg - 0: ab cddefg -\= Expect no match - abcddefg -No match - -/(? - 2: - D - 0: D - 1: - 2: - -# this is really long with debug -- removing for now -#/(a|)*\d/ -# aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 -# 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 -# 1: -#\= Expect no match -# aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -#No match - -/(?>a|)*\d/ - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 -\= Expect no match - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -No match - -/(?:a|)*\d/ - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 - 0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4 -\= Expect no match - aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa -No match - -/^(?s)(?>.*)(? - 2: a - -/(?>(a))b|(a)c/ - ac - 0: ac - 1: - 2: a - -/(?=(a))ab|(a)c/ - ac - 0: ac - 1: - 2: a - -/((?>(a))b|(a)c)/ - ac - 0: ac - 1: ac - 2: - 3: a - -/(?=(?>(a))b|(a)c)(..)/ - ac - 0: ac - 1: - 2: a - 3: ac - -/(?>(?>(a))b|(a)c)/ - ac - 0: ac - 1: - 2: a - -/((?>(a+)b)+(aabab))/ - aaaabaaabaabab - 0: aaaabaaabaabab - 1: aaaabaaabaabab - 2: aaa - 3: aabab - -/(?>a+|ab)+?c/ -\= Expect no match - aabc -No match - -/(?>a+|ab)+c/ -\= Expect no match - aabc -No match - -/(?:a+|ab)+c/ - aabc - 0: aabc - -/^(?:a|ab)+c/ - aaaabc - 0: aaaabc - -/(?=abc){0}xyz/ - xyz - 0: xyz - -/(?=abc){1}xyz/ -\= Expect no match - xyz -No match - -/(?=(a))?./ - ab - 0: a - 1: a - bc - 0: b - -/(?=(a))??./ - ab - 0: a - bc - 0: b - -/^(?!a){0}\w+/ - aaaaa - 0: aaaaa - -/(?<=(abc))?xyz/ - abcxyz - 0: xyz - 1: abc - pqrxyz - 0: xyz - -/^[g]+/ - ggg<<>> - 0: ggg<<>> -\= Expect no match - \\ga -No match - -/^[ga]+/ - gggagagaxyz - 0: gggagaga - -/[:a]xxx[b:]/ - :xxx: - 0: :xxx: - -/(?<=a{2})b/i - xaabc - 0: b -\= Expect no match - xabc -No match - -/(? -# 4: -# 5: c -# 6: d -# 7: Y - -#/^X(?7)(a)(?|(b|(?|(r)|(t))(s))|(q))(c)(d)(Y)/ -# XYabcdY -# 0: XYabcdY -# 1: a -# 2: b -# 3: -# 4: -# 5: c -# 6: d -# 7: Y - -/(?'abc'\w+):\k{2}/ - a:aaxyz - 0: a:aa - 1: a - ab:ababxyz - 0: ab:abab - 1: ab -\= Expect no match - a:axyz -No match - ab:abxyz -No match - -/^(?a)? (?(ab)b|c) (?(ab)d|e)/x - abd - 0: abd - 1: a - ce - 0: ce - -# .NET has more consistent grouping numbers with these dupe groups for the two options -/(?:a(? (?')|(?")) |b(? (?')|(?")) ) (?(quote)[a-z]+|[0-9]+)/x,dupnames - a\"aaaaa - 0: a"aaaaa - 1: " - 2: - 3: " - b\"aaaaa - 0: b"aaaaa - 1: " - 2: - 3: " -\= Expect no match - b\"11111 -No match - -#/(?P(?P0)(?P>L1)|(?P>L2))/ -# 0 -# 0: 0 -# 1: 0 -# 00 -# 0: 00 -# 1: 00 -# 2: 0 -# 0000 -# 0: 0000 -# 1: 0000 -# 2: 0 - -#/(?P(?P0)|(?P>L2)(?P>L1))/ -# 0 -# 0: 0 -# 1: 0 -# 2: 0 -# 00 -# 0: 0 -# 1: 0 -# 2: 0 -# 0000 -# 0: 0 -# 1: 0 -# 2: 0 - -# Check the use of names for failure - -# Check opening parens in comment when seeking forward reference. - -#/(?P(?P=abn)xxx|)+/ -# xxx -# 0: -# 1: - -#Posses -/^(a)?(\w)/ - aaaaX - 0: aa - 1: a - 2: a - YZ - 0: Y - 1: - 2: Y - -#Posses -/^(?:a)?(\w)/ - aaaaX - 0: aa - 1: a - YZ - 0: Y - 1: Y - -/\A.*?(a|bc)/ - ba - 0: ba - 1: a - -/\A.*?(?:a|bc|d)/ - ba - 0: ba - -# -------------------------- - -/(another)?(\1?)test/ - hello world test - 0: test - 1: - 2: - -/(another)?(\1+)test/ -\= Expect no match - hello world test -No match - -/((?:a?)*)*c/ - aac - 0: aac - 1: - -/((?>a?)*)*c/ - aac - 0: aac - 1: - -/(?>.*?a)(?<=ba)/ - aba - 0: ba - -/(?:.*?a)(?<=ba)/ - aba - 0: aba - -/(?>.*?a)b/s - aab - 0: ab - -/(?>.*?a)b/ - aab - 0: ab - -/(?>^a)b/s -\= Expect no match - aab -No match - -/(?>.*?)(?<=(abcd)|(wxyz))/ - alphabetabcd - 0: - 1: abcd - endingwxyz - 0: - 1: - 2: wxyz - -/(?>.*)(?<=(abcd)|(wxyz))/ - alphabetabcd - 0: alphabetabcd - 1: abcd - endingwxyz - 0: endingwxyz - 1: - 2: wxyz - -"(?>.*)foo" -\= Expect no match - abcdfooxyz -No match - -"(?>.*?)foo" - abcdfooxyz - 0: foo - -# Tests that try to figure out how Perl works. My hypothesis is that the first -# verb that is backtracked onto is the one that acts. This seems to be the case -# almost all the time, but there is one exception that is perhaps a bug. - -/a(?=bc).|abd/ - abd - 0: abd - abc - 0: ab - -/a(?>bc)d|abd/ - abceabd - 0: abd - -# These tests were formerly in test 2, but changes in PCRE and Perl have -# made them compatible. - -/^(a)?(?(1)a|b)+$/ -\= Expect no match - a -No match - -# ---- - -/^\d*\w{4}/ - 1234 - 0: 1234 -\= Expect no match - 123 -No match - -/^[^b]*\w{4}/ - aaaa - 0: aaaa -\= Expect no match - aaa -No match - -/^[^b]*\w{4}/i - aaaa - 0: aaaa -\= Expect no match - aaa -No match - -/^a*\w{4}/ - aaaa - 0: aaaa -\= Expect no match - aaa -No match - -/^a*\w{4}/i - aaaa - 0: aaaa -\= Expect no match - aaa -No match - -/(?:(?foo)|(?bar))\k/dupnames - foofoo - 0: foofoo - 1: foo - barbar - 0: barbar - 1: bar - -# A notable difference between PCRE and .NET. According to -# the PCRE docs: -# If you make a subroutine call to a non-unique named -# subpattern, the one that corresponds to the first -# occurrence of the name is used. In the absence of -# duplicate numbers (see the previous section) this is -# the one with the lowest number. -# .NET takes the most recently captured number according to MSDN: -# A backreference refers to the most recent definition of -# a group (the definition most immediately to the left, -# when matching left to right). When a group makes multiple -# captures, a backreference refers to the most recent capture. - -#/(?A)(?:(?foo)|(?bar))\k/dupnames -# AfooA -# 0: AfooA -# 1: A -# 2: foo -# AbarA -# 0: AbarA -# 1: A -# 2: -# 3: bar -#\= Expect no match -# Afoofoo -#No match -# Abarbar -#No match - -/^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/ - 1 IN SOA non-sp1 non-sp2( - 0: 1 IN SOA non-sp1 non-sp2( - 1: 1 - 2: non-sp1 - 3: non-sp2 - -# TODO: .NET's group number ordering here in the second example is a bit odd -/^ (?:(?A)|(?'B'B)(?A)) (?(A)x) (?(B)y)$/x,dupnames - Ax - 0: Ax - 1: A - BAxy - 0: BAxy - 1: A - 2: B - -/ ^ a + b $ /x - aaaab - 0: aaaab - -/ ^ a + #comment - b $ /x - aaaab - 0: aaaab - -/ ^ a + #comment - #comment - b $ /x - aaaab - 0: aaaab - -/ ^ (?> a + ) b $ /x - aaaab - 0: aaaab - -/ ^ ( a + ) + \w $ /x - aaaab - 0: aaaab - 1: aaaa - -/(?:x|(?:(xx|yy)+|x|x|x|x|x)|a|a|a)bc/ -\= Expect no match - acb -No match - -#Posses -#/\A(?:[^\"]+|\"(?:[^\"]*|\"\")*\")+/ -# NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED -# 0: NON QUOTED "QUOT""ED" AFTER - -#Posses -#/\A(?:[^\"]+|\"(?:[^\"]+|\"\")*\")+/ -# NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED -# 0: NON QUOTED "QUOT""ED" AFTER - -#Posses -#/\A(?:[^\"]+|\"(?:[^\"]+|\"\")+\")+/ -# NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED -# 0: NON QUOTED "QUOT""ED" AFTER - -#Posses -#/\A([^\"1]+|[\"2]([^\"3]*|[\"4][\"5])*[\"6])+/ -# NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED -# 0: NON QUOTED "QUOT""ED" AFTER -# 1: AFTER -# 2: - -/^\w+(?>\s*)(?<=\w)/ - test test - 0: tes - -#/(?Pa)?(?Pb)?(?()c|d)*l/ -# acl -# 0: acl -# 1: a -# bdl -# 0: bdl -# 1: -# 2: b -# adl -# 0: dl -# bcl -# 0: l - -/\sabc/ - \x0babc - 0: \x0babc - -#/[\Qa]\E]+/ -# aa]] -# 0: aa]] - -#/[\Q]a\E]+/ -# aa]] -# 0: aa]] - -/A((((((((a))))))))\8B/ - AaaB - 0: AaaB - 1: a - 2: a - 3: a - 4: a - 5: a - 6: a - 7: a - 8: a - -/A(((((((((a)))))))))\9B/ - AaaB - 0: AaaB - 1: a - 2: a - 3: a - 4: a - 5: a - 6: a - 7: a - 8: a - 9: a - -/(|ab)*?d/ - abd - 0: abd - 1: ab - xyd - 0: d - -/(\2|a)(\1)/ - aaa - 0: aa - 1: a - 2: a - -/(\2)(\1)/ - -"Z*(|d*){216}" - -/((((((((((((x))))))))))))\12/ - xx - 0: xx - 1: x - 2: x - 3: x - 4: x - 5: x - 6: x - 7: x - 8: x - 9: x -10: x -11: x -12: x - -#"(?|(\k'Pm')|(?'Pm'))" -# abcd -# 0: -# 1: - -#/(?|(aaa)|(b))\g{1}/ -# aaaaaa -# 0: aaaaaa -# 1: aaa -# bb -# 0: bb -# 1: b - -#/(?|(aaa)|(b))(?1)/ -# aaaaaa -# 0: aaaaaa -# 1: aaa -# baaa -# 0: baaa -# 1: b -#\= Expect no match -# bb -#No match - -#/(?|(aaa)|(b))/ -# xaaa -# 0: aaa -# 1: aaa -# xbc -# 0: b -# 1: b - -#/(?|(?'a'aaa)|(?'a'b))\k'a'/ -# aaaaaa -# 0: aaaaaa -# 1: aaa -# bb -# 0: bb -# 1: b - -#/(?|(?'a'aaa)|(?'a'b))(?'a'cccc)\k'a'/dupnames -# aaaccccaaa -# 0: aaaccccaaa -# 1: aaa -# 2: cccc -# bccccb -# 0: bccccb -# 1: b -# 2: cccc - -# End of testinput1 diff --git a/vendor/github.com/dlclark/regexp2/.gitignore b/vendor/github.com/dlclark/regexp2/v2/.gitignore similarity index 94% rename from vendor/github.com/dlclark/regexp2/.gitignore rename to vendor/github.com/dlclark/regexp2/v2/.gitignore index fb844c330..e41389dff 100644 --- a/vendor/github.com/dlclark/regexp2/.gitignore +++ b/vendor/github.com/dlclark/regexp2/v2/.gitignore @@ -25,3 +25,5 @@ _testmain.go *.out .DS_Store +*.txt +benchmarks/ diff --git a/vendor/github.com/dlclark/regexp2/ATTRIB b/vendor/github.com/dlclark/regexp2/v2/ATTRIB similarity index 100% rename from vendor/github.com/dlclark/regexp2/ATTRIB rename to vendor/github.com/dlclark/regexp2/v2/ATTRIB diff --git a/vendor/github.com/dlclark/regexp2/LICENSE b/vendor/github.com/dlclark/regexp2/v2/LICENSE similarity index 100% rename from vendor/github.com/dlclark/regexp2/LICENSE rename to vendor/github.com/dlclark/regexp2/v2/LICENSE diff --git a/vendor/github.com/dlclark/regexp2/v2/README.md b/vendor/github.com/dlclark/regexp2/v2/README.md new file mode 100644 index 000000000..d527cbc2b --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/README.md @@ -0,0 +1,391 @@ +# regexp2 - full featured regular expressions for Go +Regexp2 is a feature-rich RegExp engine for Go. It doesn't have constant time guarantees like the built-in `regexp` package, but it allows backtracking and is compatible with Perl5 and .NET. You'll likely be better off with the RE2 engine from the `regexp` package and should only use this if you need to write very complex patterns or require compatibility with .NET. + +## Basis of the engine +The engine is ported from the .NET framework's System.Text.RegularExpressions.Regex engine. That engine was open sourced in 2015 under the MIT license. There are some fundamental differences between .NET strings and Go strings that required a bit of borrowing from the Go framework regex engine as well. The engine retains .NET-style syntax and matching features, with the compatibility priorities described below. + +## New Code Generation +For extra performance use `regexp2` with [`regexp2cg`](https://github.com/dlclark/regexp2cg). It is a code generation utility for `regexp2` and you can likely improve your regexp runtime performance by 3-10x in hot code paths. As always you should benchmark your specifics to confirm the results. Give it a try! + +## Installing +This is a go-gettable library, so install is easy: + + go get github.com/dlclark/regexp2/v2@latest + +## Changes in v2 +Version 2 includes changes that may affect compatibility with existing v1 users: + +* The module path is now `github.com/dlclark/regexp2/v2`, so imports need to use the `/v2` suffix. +* The minimum supported Go version is now Go 1.25. +* Changes to support https://github.com/dlclark/regexp2cg are merged in to support generated regex engines. +* `Regexp.Split` is now available for splitting strings with regexp matches. +* The new `compat` sub-package provides a [`regexp` compatibility adapter](#regexp-compatibility-adapter) with the same `Find*` and `Match*` method signatures as `regexp.Regexp`, plus a `compat.Matcher` interface that is implemented by both `*regexp.Regexp` and the adapter. +* The parser, optimizer, and runner internals have changed significantly to support generated regexes and additional matching optimizations. +* `Compile` and `MustCompile` now use variadic compile options for regex behavior and memory/performance tuning. See [Compile options](#compile-options) for more details. +* Moved `regexp2.Debug` and `regexp2.Compile` to new `regexp2.OptionDebug()` and `regexp2.OptionIsCodeGen()` compile options. +* Some types and constants in the `syntax` package have been exported or changed to support code generation. +* Conceptually changed the goal of the `regexp2.ECMAScript` option to be closer to the ECMAScript standard rather than C#'s ECMAScript behavior. +* Renamed the fields `Capture.Index` and `Capture.Length` to `Capture.RuneIndex` and `Capture.RuneLength` to be more clear that we're dealing with rune offsets. +* Added `Capture.ByteRange()` to return the byte offset index and length of the captured text. This requires some additional processing to be done behind the scenes the first time it's called for a given capture to convert the native rune offsets to byte offsets. + +## Usage +Usage is similar to the Go `regexp` package. Just like in `regexp`, you start by converting a regex into a state machine via the `Compile` or `MustCompile` methods. They ultimately do the same thing, but `MustCompile` will panic if the regex is invalid. You can then use the provided `Regexp` struct to find matches repeatedly. A `Regexp` struct is safe to use across goroutines. + +```go +re := regexp2.MustCompile(`Your pattern`) +if isMatch, _ := re.MatchString(`Something to match`); isMatch { + //do something +} +``` + +The `*Match*` methods can return a timeout error if you set the `re.MatchTimeout` field, or `ErrBacktrackingStackLimit` if a match exceeds its configured backtracking stack size. Any other error is a bug in the `regexp2` package. If you need more details about capture groups in a match then use the `FindStringMatch` method, like so: + +```go +if m, _ := re.FindStringMatch(`Something to match`); m != nil { + // the whole match is always group 0 + fmt.Printf("Group 0: %v\n", m.String()) + + // you can get all the groups too + gps := m.Groups() + + // a group can be captured multiple times, so each cap is separately addressable + fmt.Printf("Group 1, first capture", gps[1].Captures[0].String()) + fmt.Printf("Group 1, second capture", gps[1].Captures[1].String()) +} +``` + +Group 0 is embedded in the Match. Group 0 is an automatically-assigned group that encompasses the whole pattern. This means that `m.String()` is the same as `m.Group.String()` and `m.Groups()[0].String()` + +The __last__ capture is embedded in each group, so `g.String()` will return the same thing as `g.Capture.String()` and `g.Captures[len(g.Captures)-1].String()`. + +In `ECMAScript` mode, duplicate group names are allowed in separate alternatives and keep distinct group numbers. `GroupByName(name)` selects the participating group (or the first if none participated); `GroupNumberFromName(name)` always returns the first declaration's number, which may differ from the selected group. + +In `ECMAScript` mode, captures inside a quantified group are cleared before each repetition. Only the final successful repetition's captures remain; a group that does not participate in that repetition has no captures, and its backreference matches the empty string. Other modes retain capture history across repetitions. + +If you want to find multiple matches from a single input string you should use the `FindNextMatch` method. For example, to implement a function similar to `regexp.FindAllString`: + +```go +func regexp2FindAllString(re *regexp2.Regexp, s string) []string { + var matches []string + m, _ := re.FindStringMatch(s) + for m != nil { + matches = append(matches, m.String()) + m, _ = re.FindNextMatch(m) + } + return matches +} +``` + +`FindNextMatch` is optmized so that it re-uses the underlying string/rune slice. + +For capture positions on rune input, `FindRunesMatches` avoids allocating a full +`Match` and its text metadata for every result: + +```go +input := []rune("first=one second=two") +re := regexp2.MustCompile(`(\w+)=(\w+)`) +err := re.FindRunesMatches(input, -1, func(view regexp2.MatchView) bool { + index, length, ok := view.GroupRange(2) + if ok { + fmt.Println(string(input[index : index+length])) + } + return true // return false to stop successfully +}) +if err != nil { + // Handle a timeout or backtracking-stack limit error. + log.Fatal(err) +} +``` + +`MatchView` exposes only `GroupRange` and `GroupCount`. Group 0 is the whole match; +other groups report their last remaining capture. A participating empty capture +has `ok == true` and length 0, while an unmatched or fully balanced group has +`ok == false`. Ranges use rune indexes in the original input, even with a nonzero +`startAt`. For explicitly numbered groups, use `re.GetGroupNumbers()` to enumerate +their possibly sparse numbers. ECMAScript capture clearing and duplicate-name +group numbering follow the same rules as the full matching API. + +The view borrows reusable engine storage and is valid only during its callback. +Save returned indexes and lengths to keep results; copying the view does not +extend its lifetime. Do not modify the input during iteration. Initial setup and +buffer growth may allocate, but range lookup does not. Use the full matching API +when you need capture histories or independently owned matches. + +The internals of `regexp2` always operate on `[]rune` so `RuneIndex` and `RuneLength` data in a `Match` always reference a position in `rune`s rather than `byte`s (even if the input was given as a string). `ByteRange()` provides UTF-8 byte offsets, matching the original string input for string APIs. It's advisable to use the provided `String()` methods when you do not need explicit offsets. `ByteRange()` lazily caches byte offsets on the shared match text, so the first call on captures from the same match is not safe to run concurrently with other `ByteRange()` calls on that match. + +## Compatibility and Unicode case folding + +`regexp2`'s behavior and compatibility goals are different depending on the mode. + +| Mode | Compatibility priority | +| --- | --- | +| Default | .NET-style syntax and matching features, with Go's Unicode simple case folding preferred over exact .NET casing behavior. | +| `RE2` | Go's `regexp` semantics where features overlap, while retaining regexp2 extensions. | +| `ECMAScript` | The ECMAScript specification, including the distinction between legacy case-insensitive matching (`/i`) and Unicode case-insensitive matching (`/iu`). | + +Outside ECMAScript mode, `IgnoreCase` targets the locale-independent simple folding used by Go's `regexp` and [`unicode.SimpleFold`](https://pkg.go.dev/unicode#SimpleFold). For example, `(?i)^[a-z]$` matches the Kelvin sign `K` and long s `ſ`, and `(?i)^Σ$` matches final sigma `ς`. Differences from .NET's culture-sensitive or culture-invariant casing are intentional when they follow Go's simple folding. The engine does not select casing rules from the process locale. Simple folding does not perform Unicode normalization or multi-character expansion: `(?i)^ss$` does not match `ß`. Go's folding tables follow the Unicode version supplied by the consumer's Go toolchain. + +Case folding and character-class definitions are separate choices. Default mode retains .NET-style Unicode word classes, so `\w` matches `é`; `RE2` mode uses Go's ASCII word-class definition. Adopting Go's folding rules does not replace all default character classes with Go's definitions. + +With `ECMAScript|IgnoreCase`, legacy folding prevents non-ASCII characters from folding into ASCII: `^[a-z]$` matches `K` but not `K` or `ſ`. Adding `Unicode` selects ECMAScript `/iu` behavior, which allows those matches and includes `K` and `ſ` in `\w`. `\W` is the complement of that mode's word class. The `Unicode` option selects ECMAScript Unicode behavior when combined with `ECMAScript`; it is not a switch for enabling Unicode folding in default mode. + +Case-insensitive backreferences use the same folding policy: in default mode, both `(?i)^ss$` and `(?i)^(s)\1$` match `sſ`. The flags at the backreference determine whether its comparison ignores case, independently of the flags used to capture the text. These priorities are compatibility targets, not a guarantee of complete conformance; inconsistencies within a mode are bugs under this policy. + +## Unicode character classes + +`regexp2` supports Unicode character classes with `\p{...}` and negated classes with `\P{...}`. Outside ECMAScript Unicode mode, it also accepts the RE2/PCRE-style one-letter form, such as `\pL`. + +Outside `ECMAScript|Unicode` mode, the class name may be a Go Unicode category, category alias, script, or property exposed by the Go standard library Unicode tables. For example: + +```go +letter := regexp2.MustCompile(`\p{L}+`) +katakana := regexp2.MustCompile(`\p{Katakana}+`) +notEmoji := regexp2.MustCompile(`\P{Emoji}+`) +``` + +Outside `ECMAScript|Unicode` mode, `regexp2` also supports Unicode property selection syntax in the form `\p{property=value}`. Property and value aliases are matched loosely: case, hyphens, and underscores are ignored. For example, `\p{GCB=RI}`, `\p{grapheme_cluster_break=regional_indicator}`, and `\p{grapheme-cluster-break=regional-indicator}` all refer to the same class. + +Valid property names and aliases come from Unicode 17.0.0 [`PropertyAliases.txt`](https://www.unicode.org/Public/17.0.0/ucd/PropertyAliases.txt). Valid property values and aliases come from Unicode 17.0.0 [`PropertyValueAliases.txt`](https://www.unicode.org/Public/17.0.0/ucd/PropertyValueAliases.txt). The generated tables use Unicode 17.0.0 data from [`DerivedCoreProperties.txt`](https://www.unicode.org/Public/17.0.0/ucd/DerivedCoreProperties.txt), [`emoji/emoji-data.txt`](https://www.unicode.org/Public/17.0.0/ucd/emoji/emoji-data.txt), [`auxiliary/GraphemeBreakProperty.txt`](https://www.unicode.org/Public/17.0.0/ucd/auxiliary/GraphemeBreakProperty.txt), [`auxiliary/WordBreakProperty.txt`](https://www.unicode.org/Public/17.0.0/ucd/auxiliary/WordBreakProperty.txt), and [`auxiliary/SentenceBreakProperty.txt`](https://www.unicode.org/Public/17.0.0/ucd/auxiliary/SentenceBreakProperty.txt) for the package-local properties whose data changes more frequently than the Go standard library tables. + +## Additional Perl and PCRE syntax + +The default mode supports the following syntax: + +* `\Q...\E` quotes every character between `\Q` and `\E`. If `\E` is omitted, quoting continues to the end of the pattern. This also works inside character classes. +* `\R` matches one Unicode newline sequence: CRLF as a single sequence, or LF, VT, FF, CR, NEL, line separator, or paragraph separator. +* `\X` atomically matches one Unicode 17.0.0 extended grapheme cluster. This includes combining sequences, Hangul syllables, regional-indicator pairs, emoji ZWJ sequences, and Indic conjuncts. +* A `+` after a quantifier makes it possessive: `*+`, `++`, `?+`, and `{m,n}+`. For example, `a*+` is equivalent to `(?>a*)` and will not give characters back when the remainder of the pattern fails. + +`RE2` mode also supports `\Q...\E` and possessive quantifiers, but keeps `\R` and `\X` as literal `R` and `X` identity escapes. `ECMAScript` mode does not enable any of this syntax: `\Q`, `\E`, `\R`, and `\X` retain ECMAScript identity-escape behavior, and possessive quantifiers remain invalid. + +## `regexp` compatibility adapter + +The `github.com/dlclark/regexp2/v2/compat` package provides an adapter for callers that want the same `Find*` and `Match*` method signatures as the standard library's `regexp.Regexp`, while still using the `regexp2` engine. + +```go +import ( + "github.com/dlclark/regexp2/v2" + "github.com/dlclark/regexp2/v2/compat" +) + +re := compat.MustCompile(`Your pattern`, regexp2.RE2) +if re.MatchString(`Something to match`) { + // do something +} + +matches := re.FindAllString(`abc axbc`, -1) +_ = matches +``` + +You can also wrap an existing compiled regexp: + +```go +base := regexp2.MustCompile(`Your pattern`) +re := compat.Wrap(base) +``` + +The adapter includes the standard-library matching surface: `Match`, `MatchString`, `MatchReader`, and all `Find(All)?(String)?(Submatch)?(Index)?` methods. Index-returning methods use UTF-8 byte offsets like `regexp`, not regexp2's rune offsets. + +The package also defines `compat.Matcher`, a common interface implemented by both `*regexp.Regexp` and `*compat.Regexp`. Use it when code should accept either the standard library engine or a regexp2-backed adapter: + +```go +func findWords(re compat.Matcher, input string) []string { + return re.FindAllString(input, -1) +} +``` + +Because those standard-library method signatures do not return errors, the adapter panics if the wrapped regexp2 matcher returns an error such as a match timeout or `ErrBacktrackingStackLimit`. Use the main `regexp2` APIs directly when you need to handle match errors directly. + +## Compile options + +`Compile` and `MustCompile` take variadic compile options. Most users can omit them and get default regex behavior plus bounded shared pools for rune buffers and replacement output buffers, plus per-regexp caches for parsed replacement patterns and ASCII character class bitmaps. + +Regex option constants can be passed directly, individually or as a bitmask: + +```go +re := regexp2.MustCompile(`Your pattern`, regexp2.IgnoreCase, regexp2.Singleline) +re = regexp2.MustCompile(`Your pattern`, regexp2.IgnoreCase|regexp2.Singleline) +``` + +Performance tuning options override the default cache settings: + +```go +re := regexp2.MustCompile(`Your pattern`, + regexp2.IgnoreCase, + regexp2.OptionMaxBacktrackingStackSize(200000), + regexp2.OptionMaxCachedRuneBufferLength(64*1024), + regexp2.OptionMaxCachedReplacerDataEntries(8), +) +``` + +Compile-only options configure behavior that is not settable from the pattern: + +```go +re := regexp2.MustCompile(`(?This) (is)`, regexp2.OptionMaintainCaptureOrder()) +``` + +The defaults are intentionally bounded: + +| Option | Default | Used by | Working-set growth | Tradeoffs | +| --- | ---: | --- | --- | --- | +| `OptionMaintainCaptureOrder()` | false | Parser capture-slot assignment for mixed named and unnamed captures. | None at match time. This changes compile-time capture numbering only. | Keeps named and unnamed captures in pattern order instead of appending named captures after unnamed captures. This can change numeric backreference meaning, so it is caller-controlled rather than an inline regex option. | +| `OptionDebug()` | false | Compile dumps and runner tracing. | Debug output volume only. | Useful for diagnostics, but it can produce noisy output and slower traced matching. | +| `OptionIsCodeGen()` | false | Compile-time find-optimization analysis for [`regexp2cg`](https://github.com/dlclark/regexp2cg). | Per compiled regexp, during `Compile` or `MustCompile`. | Enables more expensive analysis intended for generated engines. Do not use it for normal interpreter execution; the interpreter defaults intentionally avoid this extra compile-time cost. | +| `OptionMaxBacktrackingStackSize(n)` | 100,000 | The interpreter's per-match backtracking stack. | Per pooled runner. The initial allocation and subsequent growth are capped at the configured number of integer slots; the runner pool may retain stacks at their high-water size for reuse. | Lowering this bounds backtracking memory more tightly but may reject complex matches sooner with `ErrBacktrackingStackLimit`. Raising it permits deeper backtracking and increases possible memory use. A negative value disables the limit. | +| `OptionMaxCachedRuneBufferLength(n)` | 256K runes | String APIs that run through pooled runners, such as `MatchString`, `FindStringMatch`, and replacement-pattern `Replace`, when converting input strings to the engine's internal `[]rune` representation. | Process-wide shared `sync.Pool` retention by size class. This does not grow per compiled regexp or per input string; the practical working set follows recent and concurrent use across all regexps and can be dropped by GC. | Raising this can reduce allocations for repeated searches on large strings, at the cost of retaining larger buffers for reuse. Lowering it reduces retained buffer memory but can increase allocations. Setting it to `0` disables rune buffer caching. | +| `OptionMaxCachedReplaceBufferLength(n)` | 256 KB | Replacement-pattern `Replace` calls that build output through a shared byte buffer. | Process-wide shared `sync.Pool` retention by size class after replacement-pattern `Replace` runs. It does not grow from evaluator-based `ReplaceFunc` output and is shared across compiled regexps. | Raising this lets larger replacement outputs use pooled buffers and can reduce allocations. Lowering it prevents larger output buffers from being retained, so large replacements allocate directly. | +| `OptionMaxCachedReplacerDataEntries(n)` | `16` | `Replace` with replacement pattern strings, after the replacement pattern is parsed into reusable replacement data. | Per compiled regexp. The cache grows as distinct cacheable replacement strings are used with `Replace`, up to this entry count. | Raising this helps when a single compiled regexp is used with many recurring replacement patterns. It increases per-regexp cache memory and lock-protected cache bookkeeping. Setting it to `0` disables this cache. | +| `OptionMaxCachedReplacerDataBytes(n)` | 4 KB | The parsed replacement-pattern cache. Replacement strings longer than this are parsed for the call but not retained. | Per compiled regexp, combined with `OptionMaxCachedReplacerDataEntries`. Only replacement strings whose source text is at or below this size can add parsed data to the cache. | Raising this helps if large replacement patterns are reused. It can retain more memory per cached replacement. Lowering it avoids keeping unusual large replacement patterns around. | +| `OptionDisableCharClassASCIIBitmap()` | false | Compile-time preparation of character classes and first-character prefix sets. By default, character classes with ASCII membership get a small bitmap used by `CharIn`. | Per compiled regexp, during `Compile` or `MustCompile`. Each eligible character class can hold one small bitmap; this does not scale with match concurrency or input size. | Leaving this false speeds up ASCII-heavy character class checks at the cost of a small amount of per-char-class memory and compile-time work. Setting to true can reduce memory for large numbers of compiled char classes in regexps, but ASCII character class matching may be slower. | + +For `OptionMaxBacktrackingStackSize`, set `n` to a negative value to allow unbounded stack growth. Setting it to `0` permits no backtracking stack entries, so most interpreted matches will return `ErrBacktrackingStackLimit`. + +For pooled buffer cache options, set `n` to `0` to disable pooling, or `-1` to allow all built-in size classes. The rune buffer classes are 1K, 4K, 16K, 64K, and 256K runes. The replacement byte buffer classes are 4 KB, 16 KB, 64 KB, 256 KB, and 1 MB. By default the 1 MB pool is unused. For replacement data byte-size cache options, `-1` means unbounded. For entry-count cache options, set `n` to `0` to disable the cache. + +## Compare `regexp` and `regexp2` +| Category | regexp | regexp2 | +| --- | --- | --- | +| Catastrophic backtracking possible | no, constant execution time guarantees | yes; backtracking stack growth is bounded by default, and `re.MatchTimeout` can also bound match duration | +| Python-style capture groups `(?Pre)` | yes | no (yes in RE2 compat mode) | +| .NET-style capture groups `(?re)` or `(?'name're)` | yes | yes | +| comments `(?#comment)` | no | yes | +| branch numbering reset `(?\|a\|b)` | no | no | +| atomic group `(?>re)` | no | yes | +| possessive quantifiers `*+`, `++`, `?+`, `{m,n}+` | no | yes | +| literal quoting `\Q...\E` | yes | yes | +| Unicode newline sequence `\R` | no | yes (default mode only) | +| extended grapheme cluster `\X` | no | yes (default mode only) | +| positive lookahead `(?=re)` | no | yes | +| negative lookahead `(?!re)` | no | yes | +| positive lookbehind `(?<=re)` | no | yes | +| negative lookbehind `(?re)`) +* add support for python-style named backreferences (e.g. `(?P=name)`) +* change singleline behavior for `$` to only match end of string (like RE2) (see [#24](https://github.com/dlclark/regexp2/issues/24)) +* change the character classes `\d` `\s` and `\w` to match the same characters as RE2. NOTE: if you also use the `ECMAScript` option then this will change the `\s` character class to match ECMAScript instead of RE2. ECMAScript allows more whitespace characters in `\s` than RE2 (but still fewer than the the default behavior). +* allow character escape sequences to have defaults. For example, by default `\_` isn't a known character escape and will fail to compile, but in RE2 mode it will match the literal character `_` +* support RE2-style literal quoting with `\Q...\E` +* support possessive quantifiers (`*+`, `++`, `?+`, and `{m,n}+`) as a regexp2 extension + +```go +re := regexp2.MustCompile(`Your RE2-compatible pattern`, regexp2.RE2) +if isMatch, _ := re.MatchString(`Something to match`); isMatch { + //do something +} +``` + +This feature is a work in progress and I'm open to ideas for more things to put here (maybe more relaxed character escaping rules?). + +## Catastrophic Backtracking and Timeouts + +`regexp2` supports features that can lead to catastrophic backtracking. +Each compiled regexp limits its per-match backtracking stack to 100,000 +slots by default. If a match would exceed that limit, it stops and returns +`ErrBacktrackingStackLimit`. Callers can identify it with +`errors.Is(err, regexp2.ErrBacktrackingStackLimit)`. The limit can be changed at +compile time; a negative value restores the previous unbounded behavior: + +```go +re := regexp2.MustCompile(pattern, regexp2.OptionMaxBacktrackingStackSize(200000)) +// regexp2.OptionMaxBacktrackingStackSize(-1) disables the limit. +``` + +This limit bounds the interpreter's backtracking stack, not total match time or +all memory used by a match. Literal empty expressions repeated any number of +times are optimized away and do not consume backtracking stack space. + +`Regexp.MatchTimeout` can be set to limit the impact of such behavior; the +match will fail with an error after approximately MatchTimeout. No timeout +checks are done by default. + +Timeout checking is not free. The current timeout checking implementation starts +a background worker that updates a clock value approximately once every 100 +milliseconds. The matching code compares this value against the precomputed +deadline for the match. The performance impact is as follows. + +1. A match with a timeout runs almost as fast as a match without a timeout. +2. If any live matches have a timeout, there will be a background CPU load + (`~0.15%` currently on a modern machine). This load will remain constant + regardless of the number of matches done including matches done in parallel. +3. If no live matches are using a timeout, the background load will remain + until the longest deadline (match timeout + the time when the match started) + is reached. E.g., if you set a timeout of one minute the load will persist + for approximately a minute even if the match finishes quickly. + +See [PR #58](https://github.com/dlclark/regexp2/pull/58) for more details and +alternatives considered. + +## Goroutine leak error +If you're using a library during unit tests (e.g. https://github.com/uber-go/goleak) that validates all goroutines are exited then you'll likely get an error if you or any of your dependencies use regex's with a MatchTimeout. +To remedy the problem you'll need to tell the unit test to wait until the backgroup timeout goroutine is exited. + +```go +func TestSomething(t *testing.T) { + defer goleak.VerifyNone(t) + defer regexp2.StopTimeoutClock() + + // ... test +} + +//or + +func TestMain(m *testing.M) { + // setup + // ... + + // run + m.Run() + + //tear down + regexp2.StopTimeoutClock() + goleak.VerifyNone(t) +} +``` + +This will add ~100ms runtime to each test (or TestMain). If that's too much time you can set the clock cycle rate of the timeout goroutine in an init function in a test file. `regexp2.SetTimeoutCheckPeriod` isn't threadsafe so it must be setup before starting any regex's with Timeouts. + +```go +func init() { + //speed up testing by making the timeout clock 1ms + regexp2.SetTimeoutCheckPeriod(time.Millisecond) +} +``` + +## ECMAScript compatibility mode +In this mode the engine attempts to match the [regex engine](https://tc39.es/ecma262/multipage/text-processing.html#sec-regexp-regular-expression-objects) described in the ECMAScript specification as closely as reasonably possible within regexp2's API and implementation. + +This flag should not be treated as compatibility with C#'s `RegexOptions.ECMAScript`. regexp2's ECMAScript behavior prioritizes ECMAScript specification behavior over matching the C# regex engine's interpretation of that option. + +Without `Unicode`, escapes such as `\a`, `\e`, `\A`, `\G`, `\Z`, and `\z` match their literal letters. A control escape `\c` requires an ASCII letter; inside a character class, digits and `_` are also accepted, with character value modulo 32. Otherwise the backslash is literal and `c` and the following syntax are parsed normally: `\c*` matches a backslash followed by zero or more `c` characters, and `[\c]` matches either a backslash or `c`. With `Unicode`, Annex B is not applied, so `\c` must be followed by an ASCII letter and any other character is a compile error. A decimal escape such as `\1` or `\8` must refer to an existing capture group and cannot appear in a character class, so octal escapes, `\8` or `\9` with fewer groups, and `\0` followed by a digit are also compile errors. `Escape` emits `\x07` for BEL so that its output also preserves that character in ECMAScript mode. + +Additionally a Unicode mode is provided which allows parsing of `\u{CodePoint}` syntax only when both `ECMAScript` and `Unicode` are provided. In that mode, adjacent four-hex high/low surrogate escapes, such as `\uD83D\uDE00`, form one code point in atoms, character classes, and ranges. Braced surrogate escapes and isolated surrogates remain separate. + +With `ECMAScript|Unicode`, property escapes use the exact names and aliases allowed by [ECMA-262](https://tc39.es/ecma262/multipage/text-processing.html#sec-runtime-semantics-unicodematchproperty-p): + +* General categories: `\p{Letter}`, `\p{Lu}`, `\p{General_Category=Lowercase_Letter}`, or `\p{gc=Ll}`. +* Scripts: `\p{Script=Greek}` or `\p{sc=Grek}`. +* Script extensions: `\p{Script_Extensions=Hiragana}` or `\p{scx=Hira}`. These include shared characters such as U+30FC, which has `Script=Common`. +* Supported binary properties and aliases: for example, `\p{Alphabetic}`, `\p{Alpha}`, `\p{Emoji}`, `\p{ASCII}`, `\p{Any}`, and `\p{Assigned}`. + +These forms also work with `\P` and inside character classes. Names are case-sensitive; spaces and hyphens are not ignored. Bare script names, unsupported properties such as `GCB`, and binary properties with explicit values such as `ASCII=Yes` are rejected. Without `Unicode`, ECMAScript property escapes retain identity-escape behavior. The `/v` Unicode sets flag and properties of strings such as `RGI_Emoji` are not supported. + +Categories, scripts, and binary properties provided by Go follow the consumer's standard-library `unicode.Version`: Unicode 15.0.0 in Go 1.25–1.26, and Unicode 17.0.0 in Go 1.27. New scripts therefore require a Go toolchain that includes them. `Assigned` and the special script value `Unknown` also follow Go's assignments. + +Properties Go doesn't expose use supplemental Unicode 17.0.0 data, reusing this package's existing tables where available. Script extensions combine Go's script tables with explicit Unicode 17.0.0 extension overrides. The package doesn't embed replacements for Go's categories, scripts, or built-in binary properties. Regenerate only the supplemental data and exact alias mappings with `go run ./internal/unicodegen -ucd /path/to/UCD.zip`, using the pinned [Unicode 17.0.0 archive](https://www.unicode.org/Public/17.0.0/ucd/UCD.zip). Consumers don't need to run the generator. + +Perl/PCRE extensions `\Q...\E`, `\R`, `\X`, and possessive quantifiers are intentionally not enabled in this mode. The letter escapes retain the engine's existing ECMAScript identity-escape behavior. + +## Potential bugs +I've run a battery of tests against regexp2 from various sources and found the debug output matches the .NET engine, but .NET and Go handle strings very differently. I've attempted to handle these differences, but most of my testing deals with basic ASCII with a little bit of multi-byte Unicode. There's a chance that there are bugs in the string handling related to character sets with supplementary Unicode chars. Right-to-Left support is coded, but not well tested either. + +## Find a bug? +I'm open to new issues and pull requests with tests if you find something odd! diff --git a/vendor/github.com/dlclark/regexp2/v2/Taskfile.yml b/vendor/github.com/dlclark/regexp2/v2/Taskfile.yml new file mode 100644 index 000000000..fffb3f270 --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/Taskfile.yml @@ -0,0 +1,64 @@ +version: '3' + +tasks: + benchcmp: + desc: Compare current benchmarks against an optional commit, defaulting to HEAD + vars: + BENCH_COUNT: '{{default "5" .COUNT}}' + REF: + sh: | + if [ -n "{{.COMMIT}}" ]; then + printf '%s\n' "{{.COMMIT}}" + elif [ -n "{{.CLI_ARGS}}" ]; then + set -- {{.CLI_ARGS}} + printf '%s\n' "$1" + else + printf '%s\n' HEAD + fi + COMMIT_HASH: + sh: git rev-parse --verify "{{.REF}}^{commit}" + cmds: + - | + set -eu + + mkdir -p benchmarks + + base_file="benchmarks/{{.COMMIT_HASH}}-count{{.BENCH_COUNT}}.txt" + new_file="benchmarks/new.txt" + base_tmp="" + new_tmp="" + worktree_dir="$(mktemp -d /tmp/regexp2-benchcmp.XXXXXX)" + + cleanup() { + if [ -n "$base_tmp" ]; then + rm -f "$base_tmp" + fi + if [ -n "$new_tmp" ]; then + rm -f "$new_tmp" + fi + git worktree remove --force "$worktree_dir" >/dev/null 2>&1 || true + } + trap cleanup EXIT + + if [ -f "$base_file" ] && grep -q '^Benchmark' "$base_file"; then + printf 'Using cached baseline benchmarks from %s...\n' "$base_file" + else + if [ -f "$base_file" ]; then + printf 'Ignoring cached baseline without benchmark results at %s...\n' "$base_file" + fi + printf 'Running baseline benchmarks for %s (%s samples)...\n' "{{.COMMIT_HASH}}" "{{.BENCH_COUNT}}" + git worktree add --detach "$worktree_dir" "{{.COMMIT_HASH}}" + base_tmp="$(mktemp "${base_file}.tmp.XXXXXX")" + (cd "$worktree_dir" && env GOWORK=off go test -run '^$' -bench . -benchmem -count "{{.BENCH_COUNT}}" ./...) > "$base_tmp" + mv "$base_tmp" "$base_file" + base_tmp="" + fi + + printf 'Running current benchmarks (%s samples)...\n' "{{.BENCH_COUNT}}" + new_tmp="$(mktemp "${new_file}.tmp.XXXXXX")" + env GOWORK=off go test -run '^$' -bench . -benchmem -count "{{.BENCH_COUNT}}" ./... > "$new_tmp" + mv "$new_tmp" "$new_file" + new_tmp="" + + printf 'Comparing benchmark results with benchstat...\n' + benchstat "$base_file" "$new_file" diff --git a/vendor/github.com/dlclark/regexp2/v2/bufferpool.go b/vendor/github.com/dlclark/regexp2/v2/bufferpool.go new file mode 100644 index 000000000..16474c0b2 --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/bufferpool.go @@ -0,0 +1,119 @@ +package regexp2 + +import ( + "bytes" + "slices" + "sync" +) + +type pooledSliceBuffers[T any] struct { + sizes []int + pools []sync.Pool +} + +func newPooledSliceBuffers[T any](sizes ...int) *pooledSliceBuffers[T] { + sizes = slices.Clone(sizes) + slices.Sort(sizes) + return &pooledSliceBuffers[T]{ + sizes: sizes, + pools: make([]sync.Pool, len(sizes)), + } +} + +func (p *pooledSliceBuffers[T]) poolIndex(neededSize, maxSize int) int { + if maxSize == 0 { + return -1 + } + for i, classSize := range p.sizes { + if neededSize <= classSize { + if maxSize > 0 && classSize > maxSize { + return -1 + } + return i + } + } + return -1 +} + +func (p *pooledSliceBuffers[T]) get(neededSize, maxSize int) ([]T, *[]T) { + idx := p.poolIndex(neededSize, maxSize) + if idx < 0 { + return make([]T, neededSize), nil + } + if v := p.pools[idx].Get(); v != nil { + bufp := v.(*[]T) + if cap(*bufp) >= neededSize { + return (*bufp)[:neededSize], bufp + } + } + buf := make([]T, neededSize, p.sizes[idx]) + return buf, &buf +} + +func (p *pooledSliceBuffers[T]) put(bufp *[]T) { + idx := p.poolIndex(cap(*bufp), -1) + if idx < 0 || cap(*bufp) != p.sizes[idx] { + return + } + *bufp = (*bufp)[:0] + p.pools[idx].Put(bufp) +} + +// getExact uses size classes to share slice wrappers, but allocates exactly the +// requested capacity. A returned match can then take the buffer without retaining +// a much larger size-class allocation. +func (p *pooledSliceBuffers[T]) getExact(neededSize, maxSize int) ([]T, *[]T) { + idx := p.poolIndex(neededSize, maxSize) + if idx < 0 { + return make([]T, neededSize), nil + } + var bufp *[]T + if v := p.pools[idx].Get(); v != nil { + bufp = v.(*[]T) + } else { + bufp = new([]T) + } + if cap(*bufp) != neededSize { + // Store new buffers in the wrapper only when they are returned. A + // successful search transfers the buffer and recycles an empty wrapper. + return make([]T, neededSize), bufp + } + return (*bufp)[:neededSize], bufp +} + +func (p *pooledSliceBuffers[T]) putExact(bufp *[]T) { + idx := p.poolIndex(cap(*bufp), -1) + if idx < 0 { + return + } + *bufp = (*bufp)[:0] + p.pools[idx].Put(bufp) +} + +// detach gives the caller ownership of the buffer and recycles its wrapper. +// Only getExact may borrow these wrappers, since a detached one has no buffer. +func (p *pooledSliceBuffers[T]) detach(bufp *[]T, bufferSize int) { + idx := p.poolIndex(bufferSize, -1) + *bufp = nil + if idx >= 0 { + p.pools[idx].Put(bufp) + } +} + +// our specific pooled buffers +var ( + pooledRuneBuffers = newPooledSliceBuffers[rune](1<<10, 4<<10, 16<<10, 64<<10, 256<<10) + // Match-returning string searches can transfer their exact-size buffers to callers. + pooledMatchRuneBuffers = newPooledSliceBuffers[rune](1<<10, 4<<10, 16<<10, 64<<10, 256<<10) + pooledByteBuffers = newPooledSliceBuffers[byte](4<<10, 16<<10, 64<<10, 256<<10, 1<<20) +) + +func getPooledReplaceBuffer(neededBytes, maxSize int) (*bytes.Buffer, *[]byte) { + buf, pooled := pooledByteBuffers.get(neededBytes, maxSize) + return bytes.NewBuffer(buf[:0]), pooled +} + +func putPooledReplaceBuffer(buf *bytes.Buffer, pooled *[]byte) { + *pooled = buf.Bytes() + pooledByteBuffers.put(pooled) +} diff --git a/vendor/github.com/dlclark/regexp2/v2/decode.go b/vendor/github.com/dlclark/regexp2/v2/decode.go new file mode 100644 index 000000000..bf0994ced --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/decode.go @@ -0,0 +1,175 @@ +package regexp2 + +import ( + "unicode/utf8" + + "github.com/dlclark/regexp2/v2/helpers" +) + +// decodedInput is the engine's rune view of a string. When the pattern cannot +// look behind a candidate start, the slice may begin at that candidate instead +// of byte 0. +type decodedInput struct { + runes []rune + pooled *[]rune + runeStart int // index in runes of the requested startAt; -1 if not a rune boundary + runeOffset int // original-string rune index of runes[0] + byteOffset int // original-string byte index of runes[0] + ascii bool // every decoded rune is ASCII; invalid UTF-8 is not ASCII + matchBuffer bool // pooled in exact-size storage that can be transferred to a Match +} + +// decodeFrom is the first original-string byte that must be decoded. 0 means +// the whole string; a later index is only used when slicing is safe. +func (re *Regexp) decodeFrom(s string, startAt int) int { + if startAt <= 0 || re.RightToLeft() { + return 0 + } + need := re.decodeLeftContextRunes() + if need < 0 { + return 0 + } + if need > 0 { + return prevRuneByte(s, startAt) + } + return startAt +} + +func (re *Regexp) decodeLeftContextRunes() int { + if re.code != nil { + return re.code.LeftContextRunes + } + return re.leftContextRunes +} + +// stringSearchOrigin preserves the caller's origin when \G may observe it. +// Such patterns retain the whole input, so no decode offset is needed. +// Otherwise the origin is unobservable and the candidate is sufficient. +func (re *Regexp) stringSearchOrigin(input string, startAt, candidate int) int { + if !re.RightToLeft() && re.decodeLeftContextRunes() < 0 { + if startAt <= 0 { + return 0 + } + return utf8.RuneCountInString(input[:startAt]) + } + return candidate +} + +// decodeString converts s to []rune for the MatchString startAt<=0 path. +// Keep this as close as possible to a single UTF-8 walk so 4–30 byte +// matches stay cheap. +func decodeString(s string, maxCachedLength int) ([]rune, *[]rune) { + buf, pooled := pooledRuneBuffers.get(len(s), maxCachedLength) + if len(s) >= helpers.ASCIIScanMin { + n, _ := helpers.DecodeString(s, buf) + return buf[:n], pooled + } + n := 0 + for _, ch := range s { + buf[n] = ch + n++ + } + return buf[:n], pooled +} + +// decodeStringInput decodes into exact-size storage a returned match can own. +func (re *Regexp) decodeStringInput(s string, startAt int, pooled bool) decodedInput { + maxCachedLength := 0 + if pooled { + maxCachedLength = re.optimizations.MaxCachedRuneBufferLength + } + decodeFrom := max(0, min(re.decodeFrom(s, startAt), len(s))) + substr := s[decodeFrom:] + buf, pooledBuffer := pooledMatchRuneBuffers.getExact(len(substr), maxCachedLength) + n, ascii := helpers.DecodeString(substr, buf) + out := decodedInput{ + runes: buf[:n], + pooled: pooledBuffer, + byteOffset: decodeFrom, + ascii: ascii, + runeStart: startRuneIndex(s, startAt, decodeFrom, n, ascii), + matchBuffer: true, + } + // Byte index equals rune index only when the skipped prefix is also ASCII. + if ascii && (decodeFrom == 0 || helpers.IsASCII(s[:decodeFrom])) { + out.runeOffset = decodeFrom + } else if decodeFrom > 0 { + out.runeOffset = utf8.RuneCountInString(s[:decodeFrom]) + } + return out +} + +// decodeInput converts s[decodeFrom:] to runes for internal scans, which do not +// need original-string offsets. Keep decoding in this call: an extra helper +// call measurably slows short Boolean searches. +// If startAt < 0 or is not a rune boundary, runeStart is -1. +func decodeInput(s string, startAt, decodeFrom, maxCachedLength int) decodedInput { + if decodeFrom < 0 { + decodeFrom = 0 + } + if decodeFrom > len(s) { + decodeFrom = len(s) + } + substr := s[decodeFrom:] + buf, pooledBuffer := pooledRuneBuffers.get(len(substr), maxCachedLength) + n, ascii := helpers.DecodeString(substr, buf) + return decodedInput{ + runes: buf[:n], + pooled: pooledBuffer, + byteOffset: decodeFrom, + ascii: ascii, + runeStart: startRuneIndex(s, startAt, decodeFrom, n, ascii), + } +} + +func startRuneIndex(s string, startAt, decodeFrom, runeCount int, ascii bool) int { + if startAt < 0 { + return -1 + } + if startAt < decodeFrom || startAt > len(s) { + return -1 + } + if startAt == decodeFrom { + return 0 + } + if startAt == len(s) { + return runeCount + } + if ascii { + return startAt - decodeFrom + } + rel := startAt - decodeFrom + i := 0 + for strIdx := range s[decodeFrom:] { + if strIdx == rel { + return i + } + if strIdx > rel { + return -1 + } + i++ + } + return -1 +} + +func prevRuneByte(s string, byteIndex int) int { + if byteIndex <= 0 { + return 0 + } + _, size := utf8.DecodeLastRuneInString(s[:byteIndex]) + if size <= 0 { + return byteIndex - 1 + } + return byteIndex - size +} + +func (d decodedInput) release() { + if d.pooled != nil { + *d.pooled = d.runes + if d.matchBuffer { + pooledMatchRuneBuffers.putExact(d.pooled) + } else { + pooledRuneBuffers.put(d.pooled) + } + } +} diff --git a/vendor/github.com/dlclark/regexp2/fastclock.go b/vendor/github.com/dlclark/regexp2/v2/fastclock.go similarity index 92% rename from vendor/github.com/dlclark/regexp2/fastclock.go rename to vendor/github.com/dlclark/regexp2/v2/fastclock.go index d256e63c7..31bea9da7 100644 --- a/vendor/github.com/dlclark/regexp2/fastclock.go +++ b/vendor/github.com/dlclark/regexp2/v2/fastclock.go @@ -46,10 +46,13 @@ func (t fasttime) reached() bool { func makeDeadline(d time.Duration) fasttime { // Increase the deadline since the clock we are reading may be // just about to tick forwards. + // Read clockEnd first: observing an extension also observes the refreshed + // current value that preceded it. + clockEnd := fast.clockEnd.read() end := fast.current.read() + durationToTicks(d+clockPeriod) // Start or extend clock if necessary. - if end > fast.clockEnd.read() { + if end > clockEnd { // If time.Since(last use) > timeout, there's a chance that // fast.current will no longer be updated, which can lead to // incorrect 'end' calculations that can trigger a false timeout @@ -57,9 +60,9 @@ func makeDeadline(d time.Duration) fasttime { if !fast.running && !fast.start.IsZero() { // update fast.current fast.current.write(durationToTicks(time.Since(fast.start))) - // recalculate our end value - end = fast.current.read() + durationToTicks(d+clockPeriod) } + // Another caller may have refreshed the clock while we waited for mu. + end = fast.current.read() + durationToTicks(d+clockPeriod) fast.mu.Unlock() extendClock(end) } diff --git a/vendor/github.com/dlclark/regexp2/v2/findfirstchar.go b/vendor/github.com/dlclark/regexp2/v2/findfirstchar.go new file mode 100644 index 000000000..7bf0787f6 --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/findfirstchar.go @@ -0,0 +1,222 @@ +package regexp2 + +import "github.com/dlclark/regexp2/v2/syntax" + +// compileFindFirstChar preserves the precedence of the interpreter's search +// strategies: fixed trailing anchors, leading anchors, Boyer-Moore, analyzed +// searches, then the first-character fallback. Input-dependent choices such +// as the dense multi-prefix heuristic still run inside the selected finder. +// The functions read r.code so the full and capture-elided programs can share +// a finder without retaining either program in a closure. +func compileFindFirstChar(code *syntax.Code) func(*Runner) bool { + if opts := code.FindOptimizations; opts != nil { + switch opts.FindMode { + case syntax.TrailingAnchor_FixedLength_LeftToRight_End: + return findTrailingEnd + case syntax.TrailingAnchor_FixedLength_LeftToRight_EndZ: + return findTrailingEndZ + } + } + if code.Anchors&(syntax.AnchorBeginning|syntax.AnchorStart|syntax.AnchorEndZ|syntax.AnchorEnd) != 0 { + if code.RightToLeft { + return findAnchoredRightToLeft + } + return findAnchoredLeftToRight + } + if code.BmPrefix != nil { + if code.RightToLeft { + return findBoyerMooreRightToLeft + } + return findBoyerMooreLeftToRight + } + if opts := code.FindOptimizations; opts != nil { + switch opts.FindMode { + case syntax.LeadingString_OrdinalIgnoreCase_LeftToRight: + return findLeadingStringIgnoreCase + case syntax.LeadingStrings_LeftToRight: + return findLeadingStrings + case syntax.LeadingStrings_OrdinalIgnoreCase_LeftToRight: + return findLeadingStringsIgnoreCase + case syntax.FixedDistanceChar_LeftToRight: + return findFixedDistanceChar + case syntax.FixedDistanceString_LeftToRight: + return findFixedDistanceString + case syntax.FixedDistanceSets_LeftToRight: + return findFixedDistanceSets + case syntax.LiteralAfterLoop_LeftToRight: + return findLiteralAfterLoop + case syntax.RequiredLandmarkChain_LeftToRight: + return findLandmarkChain + case syntax.LeadingSet_LeftToRight: + // General Unicode sets and large enumerated sets use the class's + // membership test in the fallback instead of a linear needle scan. + if len(opts.FixedDistanceSets) > 0 { + set := opts.FixedDistanceSets[0] + if len(set.Chars) > 0 && len(set.Chars) <= 5 || set.Range != nil { + return findFixedDistanceSets + } + } + } + } + if code.FcPrefix == nil { + return findWithoutPrefix + } + if code.FcPrefix.PrefixSet.IsSingleton() { + if code.RightToLeft { + return findSingletonRightToLeft + } + return findSingletonLeftToRight + } + if code.RightToLeft { + return findSetRightToLeft + } + return findSetLeftToRight +} + +func findTrailingEnd(r *Runner) bool { + return findTrailingFixedLengthEnd(r, r.code.FindOptimizations.MinRequiredLength, false) +} + +func findTrailingEndZ(r *Runner) bool { + return findTrailingFixedLengthEnd(r, r.code.FindOptimizations.MinRequiredLength, true) +} + +func findLeadingStringIgnoreCase(r *Runner) bool { + opts := r.code.FindOptimizations + return findLeadingStringLeftToRight(r, opts.LeadingPrefixRunes, true, opts.LeadingPrefixASCII) +} + +func findLeadingStrings(r *Runner) bool { + opts := r.code.FindOptimizations + if search := r.re.prefixSearch; search != nil && search.shouldUseRunes(r.Runtext, r.Runtextpos) { + start := search.indexRunes(r.Runtext, r.Runtextpos) + if start >= 0 && hasRequiredLengthAt(r, start) { + r.Runtextpos = start + return true + } + r.Runtextpos = r.Runtextend + return false + } + return findLeadingStringsLeftToRight(r, opts.LeadingPrefixesRunes, opts.LeadingPrefixFirstRunes, opts.LeadingPrefixFirstASCII, false) +} + +func findLeadingStringsIgnoreCase(r *Runner) bool { + opts := r.code.FindOptimizations + return findLeadingStringsLeftToRight(r, opts.LeadingPrefixesRunes, opts.LeadingPrefixFirstRunes, opts.LeadingPrefixFirstASCII, true) +} + +func findFixedDistanceChar(r *Runner) bool { + literal := r.code.FindOptimizations.FixedDistanceLiteral + return findFixedDistanceCharLeftToRight(r, literal.C, literal.Distance) +} + +func findFixedDistanceString(r *Runner) bool { + literal := r.code.FindOptimizations.FixedDistanceLiteral + return findFixedDistanceStringLeftToRight(r, literal.Runes, literal.Distance) +} + +func findFixedDistanceSets(r *Runner) bool { + return findFixedDistanceSetsLeftToRight(r, r.code.FindOptimizations.FixedDistanceSets) +} + +func findLiteralAfterLoop(r *Runner) bool { + return findLiteralAfterLoopLeftToRight(r, r.code.FindOptimizations.LiteralAfterLoop) +} + +func findLandmarkChain(r *Runner) bool { + return findRequiredLandmarkChainLeftToRight(r, r.code.FindOptimizations.LandmarkChain) +} + +func findAnchoredLeftToRight(r *Runner) bool { + anchors := r.code.Anchors + if anchors&syntax.AnchorBeginning != 0 && r.Runtextpos > 0 || + anchors&syntax.AnchorStart != 0 && r.Runtextpos > r.Runtextstart { + r.Runtextpos = r.Runtextend + return false + } + if anchors&syntax.AnchorEndZ != 0 && r.Runtextpos < r.Runtextend-1 { + r.Runtextpos = r.Runtextend - 1 + } else if anchors&syntax.AnchorEnd != 0 && r.Runtextpos < r.Runtextend { + r.Runtextpos = r.Runtextend + } + return r.code.BmPrefix == nil || r.code.BmPrefix.IsMatch(r.Runtext, r.Runtextpos, 0, r.Runtextend) +} + +func findAnchoredRightToLeft(r *Runner) bool { + anchors := r.code.Anchors + if anchors&syntax.AnchorEnd != 0 && r.Runtextpos < r.Runtextend || + anchors&syntax.AnchorEndZ != 0 && (r.Runtextpos < r.Runtextend-1 || + (r.Runtextpos == r.Runtextend-1 && r.Runtext[r.Runtextpos] != '\n')) || + anchors&syntax.AnchorStart != 0 && r.Runtextpos < r.Runtextstart { + r.Runtextpos = 0 + return false + } + if anchors&syntax.AnchorBeginning != 0 && r.Runtextpos > 0 { + r.Runtextpos = 0 + } + return r.code.BmPrefix == nil || r.code.BmPrefix.IsMatch(r.Runtext, r.Runtextpos, 0, r.Runtextend) +} + +func findBoyerMooreLeftToRight(r *Runner) bool { + r.Runtextpos = r.code.BmPrefix.Scan(r.Runtext, r.Runtextpos, 0, r.Runtextend) + if r.Runtextpos < 0 { + r.Runtextpos = r.Runtextend + return false + } + return true +} + +func findBoyerMooreRightToLeft(r *Runner) bool { + r.Runtextpos = r.code.BmPrefix.Scan(r.Runtext, r.Runtextpos, 0, r.Runtextend) + if r.Runtextpos < 0 { + r.Runtextpos = 0 + return false + } + return true +} + +func findWithoutPrefix(*Runner) bool { return true } + +func findSingletonLeftToRight(r *Runner) bool { + ch := r.code.FcPrefix.PrefixSet.SingletonChar() + for r.Runtextpos < r.Runtextend { + if r.Runtext[r.Runtextpos] == ch { + return true + } + r.Runtextpos++ + } + return false +} + +func findSingletonRightToLeft(r *Runner) bool { + ch := r.code.FcPrefix.PrefixSet.SingletonChar() + for r.Runtextpos > 0 { + if r.Runtext[r.Runtextpos-1] == ch { + return true + } + r.Runtextpos-- + } + return false +} + +func findSetLeftToRight(r *Runner) bool { + set := r.code.FcPrefix.PrefixSet + for r.Runtextpos < r.Runtextend { + if set.Contains(r.Runtext[r.Runtextpos]) { + return true + } + r.Runtextpos++ + } + return false +} + +func findSetRightToLeft(r *Runner) bool { + set := r.code.FcPrefix.PrefixSet + for r.Runtextpos > 0 { + if set.Contains(r.Runtext[r.Runtextpos-1]) { + return true + } + r.Runtextpos-- + } + return false +} diff --git a/vendor/github.com/dlclark/regexp2/v2/helpers/ascii.go b/vendor/github.com/dlclark/regexp2/v2/helpers/ascii.go new file mode 100644 index 000000000..a7b4829ad --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/helpers/ascii.go @@ -0,0 +1,75 @@ +package helpers + +import ( + "unicode/utf8" + "unsafe" +) + +const asciiHighBits = 0x8080808080808080 + +// ASCIIScanMin is the input length where a separate ASCII probe plus a tight +// copy beats a single UTF-8 range loop. Short matches stay on the one-pass path. +const ASCIIScanMin = 64 + +// ASCIISearchMin is the haystack length where stdlib/SIMD string search beats +// a scalar first-rune scan. Below this, needle setup and unaligned +// bytes.Index retries dominate. +const ASCIISearchMin = 32 + +// IsASCII reports whether s contains only bytes below utf8.RuneSelf. +func IsASCII(s string) bool { + n := len(s) + if n == 0 { + return true + } + + b := unsafe.Slice(unsafe.StringData(s), n) + i := 0 + for ; i < n && uintptr(unsafe.Pointer(&b[i]))&7 != 0; i++ { + if b[i] >= utf8.RuneSelf { + return false + } + } + for ; i+8 <= n; i += 8 { + v := *(*uint64)(unsafe.Pointer(&b[i])) + if v&asciiHighBits != 0 { + return false + } + } + for ; i < n; i++ { + if b[i] >= utf8.RuneSelf { + return false + } + } + return true +} + +// IsASCIIRunes reports whether every rune in in is an ASCII code point. +func IsASCIIRunes(in []rune) bool { + for _, ch := range in { + if ch >= utf8.RuneSelf { + return false + } + } + return true +} + +// DecodeString writes the runes of s into buf, which must have length >= len(s). +// It returns the rune count and whether s was all ASCII. +func DecodeString(s string, buf []rune) (n int, ascii bool) { + if len(s) >= ASCIIScanMin && IsASCII(s) { + for i := 0; i < len(s); i++ { + buf[i] = rune(s[i]) + } + return len(s), true + } + ascii = true + for _, ch := range s { + if ch >= utf8.RuneSelf { + ascii = false + } + buf[n] = ch + n++ + } + return n, ascii +} diff --git a/vendor/github.com/dlclark/regexp2/v2/helpers/indexof.go b/vendor/github.com/dlclark/regexp2/v2/helpers/indexof.go new file mode 100644 index 000000000..30e3f9ff7 --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/helpers/indexof.go @@ -0,0 +1,471 @@ +package helpers + +import ( + "bytes" + "slices" + "strings" + "unicode" + "unsafe" + + "github.com/dlclark/regexp2/v2/syntax" +) + +func IndexOfAny(in []rune, find []rune) int { + switch len(find) { + case 0: + return -1 + case 1: + return IndexOfAny1(in, find[0]) + case 2: + return IndexOfAny2(in, find[0], find[1]) + case 3: + return IndexOfAny3(in, find[0], find[1], find[2]) + } + + if IsASCIIRunes(find) { + var bits [2]uint64 + for _, c := range find { + bits[c>>6] |= 1 << (c & 63) + } + for i, c := range in { + if uint32(c) < 128 && bits[c>>6]&(1<<(c&63)) != 0 { + return i + } + } + return -1 + } + + for i, c := range in { + if slices.Contains(find, c) { + return i + } + } + return -1 +} + +func IndexOfAny1(in []rune, find rune) int { + if len(in) < ASCIISearchMin { + return slices.Index(in, find) + } + return indexOfRuneBytes(runeSliceBytes(in), find) +} + +func IndexOfAny2(in []rune, find1, find2 rune) int { + for i, c := range in { + if c == find1 || c == find2 { + return i + } + } + + return -1 +} + +func IndexOfAny3(in []rune, find1, find2, find3 rune) int { + for i, c := range in { + if c == find1 || c == find2 || c == find3 { + return i + } + } + + return -1 +} + +func IndexOfAnyInRange(in []rune, first, last rune) int { + for i, c := range in { + if c >= first && c <= last { + return i + } + } + return -1 +} + +func IndexOfAnyExcept(in []rune, bad []rune) int { + for i, c := range in { + found := false + for _, b := range bad { + if b == c { + found = true + break + } + } + if !found { + return i + } + } + return -1 +} + +func IndexOfAnyExcept1(in []rune, bad rune) int { + for i, c := range in { + if c != bad { + return i + } + } + return -1 +} + +func IndexOfAnyExcept2(in []rune, bad1, bad2 rune) int { + for i, c := range in { + if c != bad1 && c != bad2 { + return i + } + } + + return -1 +} + +func IndexOfAnyExcept3(in []rune, bad1, bad2, bad3 rune) int { + for i, c := range in { + if c != bad1 && c != bad2 && c != bad3 { + return i + } + } + + return -1 +} + +func IndexOfAnyExceptInRange(in []rune, first, last rune) int { + for i, c := range in { + if c > last { + return i + } + if c < first { + return i + } + } + return -1 +} + +func IndexFunc(in []rune, f func(ch rune) bool) int { + for i := range in { + if f(in[i]) { + return i + } + } + return -1 +} + +func IndexOfAnyExceptInSet(in []rune, set syntax.CharSet) int { + for i, c := range in { + if !set.Contains(c) { + return i + } + } + return -1 +} + +func LastIndexOf(in []rune, find []rune) int { + if len(find) == 0 { + return len(in) + } + if len(in) < len(find) { + return -1 + } + haystack := runeSliceBytes(in) + needle := runeSliceBytes(find) + end := len(haystack) + for end >= len(needle) { + idx := bytes.LastIndex(haystack[:end], needle) + if idx < 0 { + return -1 + } + if idx%4 == 0 { + return idx / 4 + } + end = idx + len(needle) - 1 + } + return -1 +} + +func LastIndexOfAnyExcept1(in []rune, not rune) int { + for i := len(in) - 1; i >= 0; i-- { + if in[i] != not { + return i + } + } + return -1 +} + +func LastIndexOfAny1(in []rune, find rune) int { + if len(in) == 0 { + return -1 + } + return lastIndexOfRuneBytes(runeSliceBytes(in), find) +} + +func LastIndexOfAnyInRange(in []rune, first, last rune) int { + for i := len(in) - 1; i >= 0; i-- { + if in[i] >= first && in[i] <= last { + return i + } + } + return -1 +} + +//TODO: LastIndexOf methods +//IndexOfAnyInRange +//LastIndexOfAnyInRange +//LastIndexOfAnyExceptInRange + +// find should always be sent in lower-case +func IndexOfIgnoreCase(in []rune, find []rune) int { + // search the in slice for the "find" slice, ignoring case in the comparisons + end := len(in) - len(find) + first := find[0] + for i := 0; i <= end; i++ { + if in[i] != first && unicode.ToLower(in[i]) != first { + continue + } + match := true + for j := 1; j < len(find); j++ { + inChar := in[i+j] + if inChar != find[j] && unicode.ToLower(inChar) != find[j] { + match = false + break + } + } + if match { + return i + } + } + return -1 +} + +func IndexOfIgnoreCaseAscii(in []rune, find []rune) int { + // search the in slice for the "find" slice, ignoring case in the comparisons + // we can assume the find chars are ascii and do simple masks on them + if len(find) == 0 { + return 0 + } + end := len(in) - len(find) + first := foldASCII(rune(find[0])) + for i := 0; i <= end; i++ { + if foldASCII(in[i]) != first { + continue + } + match := true + for j := 1; j < len(find); j++ { + if foldASCII(in[i+j]) != foldASCII(find[j]) { + match = false + break + } + } + if match { + return i + } + } + return -1 +} + +func IndexStringIgnoreCaseASCII(s, prefix string) int { + if len(prefix) == 0 { + return 0 + } + + lower := byte(foldASCII(rune(prefix[0]))) + upper := lower + if lower >= 'a' && lower <= 'z' { + upper -= 'a' - 'A' + } + // Remember the next occurrence of each case separately. A search for a + // missing case then scans the input only once, instead of rescanning the + // whole suffix after every rejected prefix (for example, "ab" in "AAAA"). + nextLower, nextUpper := -1, -1 + for start, end := 0, len(s)-len(prefix); start <= end; { + // Check nearby candidates directly before setting up the longer searches. + if s[start] != lower && s[start] != upper { + start++ + if start > end { + return -1 + } + if s[start] != lower && s[start] != upper { + if nextLower < start { + nextLower = strings.IndexByte(s[start:end+1], lower) + if nextLower < 0 { + nextLower = end + 1 + } else { + nextLower += start + } + } + if upper == lower { + nextUpper = nextLower + } else if nextUpper < start { + nextUpper = strings.IndexByte(s[start:end+1], upper) + if nextUpper < 0 { + nextUpper = end + 1 + } else { + nextUpper += start + } + } + start = min(nextLower, nextUpper) + if start > end { + return -1 + } + } + } + + if EqualStringIgnoreCaseASCII(s[start:start+len(prefix)], prefix) { + return start + } + start++ + } + return -1 +} + +func EqualStringIgnoreCaseASCII(s, prefix string) bool { + if len(s) < len(prefix) { + return false + } + for i := 0; i < len(prefix); i++ { + if foldASCII(rune(s[i])) != foldASCII(rune(prefix[i])) { + return false + } + } + return true +} + +func foldASCII(c rune) rune { + if 'A' <= c && c <= 'Z' { + return c + ('a' - 'A') + } + return c +} + +func IndexOf(in []rune, find []rune) int { + if len(find) == 0 { + return 0 + } + if len(in) < len(find) { + return -1 + } + end := len(in) - len(find) + first := find[0] + for i := 0; i <= end; { + off := IndexOfAny1(in[i:end+1], first) + if off < 0 { + return -1 + } + i += off + if bytesEqual(in[i:i+len(find)], find) { + return i + } + i++ + } + return -1 +} + +func runeSliceBytes(in []rune) []byte { + if len(in) == 0 { + return nil + } + return unsafe.Slice((*byte)(unsafe.Pointer(&in[0])), len(in)*4) +} + +func indexOfRuneBytes(haystack []byte, find rune) int { + needleRune := [1]rune{find} + needle := runeSliceBytes(needleRune[:]) + start := 0 + for { + idx := bytes.Index(haystack[start:], needle) + if idx < 0 { + return -1 + } + idx += start + if idx%4 == 0 { + return idx / 4 + } + start = idx + 1 + } +} + +func lastIndexOfRuneBytes(haystack []byte, find rune) int { + needleRune := [1]rune{find} + needle := runeSliceBytes(needleRune[:]) + end := len(haystack) + for end >= 4 { + idx := bytes.LastIndex(haystack[:end], needle) + if idx < 0 { + return -1 + } + if idx%4 == 0 { + return idx / 4 + } + end = idx + 3 + } + return -1 +} + +func StartsWith(in []rune, find []rune) bool { + // if text is less than our "begin" then can't find it + if len(in) < len(find) { + return false + } + + return bytesEqual(in[:len(find)], find) + + /*for i := 0; i < len(find); i++ { + if in[i] != find[i] { + return false + } + } + + return true*/ +} + +//StartsWithIgnoreCaseAscii would be faster + +// find should always be sent in lower-case +func StartsWithIgnoreCase(in []rune, find []rune) bool { + // if text is less than our "begin" then can't find it + if len(in) < len(find) { + return false + } + + for i := 0; i < len(find); i++ { + if in[i] == find[i] { + // if we match the char exactly then we're good + continue + } + // if the to-lower still doesn't match then it's not a match + if unicode.ToLower(in[i]) != find[i] { + return false + } + } + + return true +} + +// internal function, assumes the bounds are already set right on the slices for equality +// casts the rune slices to bytes to use framework fast []byte comparison +func bytesEqual(a, b []rune) bool { + bytesA := unsafe.Slice((*byte)(unsafe.Pointer(&a[0])), len(a)*4) + bytesB := unsafe.Slice((*byte)(unsafe.Pointer(&b[0])), len(b)*4) + return bytes.Equal(bytesA, bytesB) +} + +func Equals(in []rune, start int, length int, find []rune) bool { + if len(find) == 0 { + return true + } + return bytesEqual(in[start:start+length], find) +} + +func EqualsIgnoreCase(in []rune, start int, length int, find []rune) bool { + //fast path if case matches + if Equals(in, start, length, find) { + return true + } + + // search the in slice for the "find" slice, ignoring case in the comparisons + // we can't assume casing or ascii-ness for either letter, have to toLower them both + for j := 0; j < len(find); j++ { + inChar := in[start+j] + findChar := find[j] + if inChar != findChar && unicode.ToLower(inChar) != unicode.ToLower(findChar) { + return false + } + } + + // we've checked all chars and found matches every time + return true +} diff --git a/vendor/github.com/dlclark/regexp2/v2/helpers/math.go b/vendor/github.com/dlclark/regexp2/v2/helpers/math.go new file mode 100644 index 000000000..7f58991e3 --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/helpers/math.go @@ -0,0 +1,15 @@ +package helpers + +func Min(a, b int) int { + if a < b { + return a + } + return b +} + +func Max(a, b int) int { + if a > b { + return a + } + return b +} diff --git a/vendor/github.com/dlclark/regexp2/v2/helpers/runes.go b/vendor/github.com/dlclark/regexp2/v2/helpers/runes.go new file mode 100644 index 000000000..3d581c88f --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/helpers/runes.go @@ -0,0 +1,61 @@ +package helpers + +import ( + "unicode" + "unicode/utf8" +) + +func IsBetween(val rune, first, last rune) bool { + if val > last { + return false + } + if val >= first { + return true + } + return false +} + +// According to UTS#18 Unicode Regular Expressions (http://www.unicode.org/reports/tr18/) +// RL 1.4 Simple Word Boundaries The class of includes all Alphabetic +// values from the Unicode character database, from UnicodeData.txt [UData], plus the U+200C +// ZERO WIDTH NON-JOINER and U+200D ZERO WIDTH JOINER. +func IsWordChar(r rune) bool { + // matches charclass.go + + if r < utf8.RuneSelf { + // In ASCII, L, Mn, Nd and Pc are these runes only. + return 'a' <= r && r <= 'z' || 'A' <= r && r <= 'Z' || '0' <= r && r <= '9' || r == '_' + } + //"L", "Mn", "Nd", "Pc" + return unicode.In(r, unicode.L, unicode.Mn, unicode.Nd, unicode.Pc) || r == '\u200D' || r == '\u200C' + //return 'A' <= r && r <= 'Z' || 'a' <= r && r <= 'z' || '0' <= r && r <= '9' || r == '_' +} + +func IsInMask32(ch rune, mask uint32) bool { + //BDFHJLNPRTVX = 10101010 10101010 10101010 00000000 + //B = 00000000 00000000 00000000 01000010 + //char=B-B = 00000000 00000000 00000000 00000000 + //BDFH.. << 0 = 10101010 10101010 10101010 00000000 + //char-32 = 11111111 11111111 11111111 11100000 + //& = 10101010 10101010 10101010 00000000 + // first bit is 1 then negative, so it matches + + //charMinusLowUInt32 := int32(ch - low) + return int32((mask< unicode.MaxASCII { + // a bug got us here. that's bad. + panic(fmt.Errorf("non-ascii value found in ascii search values: %s", vals)) + } + idx := c / 64 + shift := c % 64 + sv.set[idx] |= 1 << shift + } + + return sv +} + +// return the first index of our original vals values within the slice given +func (s AsciiSearchValues) IndexOfAny(chars []rune) int { + for i := 0; i < len(chars); i++ { + c := chars[i] + if c > unicode.MaxASCII { + continue + } + idx := c / 64 + shift := c % 64 + if s.set[idx]&(1< unicode.MaxASCII { + return i + } + idx := c / 64 + shift := c % 64 + if s.set[idx]&(1<= 0; i-- { + c := chars[i] + if c > unicode.MaxASCII { + continue + } + if s.set[c/64]&(1<<(c%64)) != 0 { + return i + } + } + return -1 +} + +// return the last index of our original vals values within the slice given +func (s AsciiSearchValues) LastIndexOfAnyExcept(chars []rune) int { + for i := len(chars) - 1; i >= 0; i-- { + c := chars[i] + if c > unicode.MaxASCII { + return i + } + if s.set[c/64]&(1<<(c%64)) == 0 { + return i + } + } + return -1 +} + +type RuneSearchValues struct { + vals []rune +} + +func newRuneSearchValues(vals []rune) RuneSearchValues { + return RuneSearchValues{vals: vals} +} + +func NewRuneSearchValues(vals string) RuneSearchValues { + return newRuneSearchValues([]rune(vals)) +} + +func (s RuneSearchValues) IndexOfAny(chars []rune) int { + return IndexOfAny(chars, s.vals) +} + +func (s RuneSearchValues) IndexOfAnyExcept(chars []rune) int { + return IndexOfAnyExcept(chars, s.vals) +} + +func (s RuneSearchValues) LastIndexOfAny(chars []rune) int { + if len(s.vals) == 1 { + return LastIndexOfAny1(chars, s.vals[0]) + } + for i := len(chars) - 1; i >= 0; i-- { + if slices.Contains(s.vals, chars[i]) { + return i + } + } + return -1 +} + +func (s RuneSearchValues) LastIndexOfAnyExcept(chars []rune) int { + for i := len(chars) - 1; i >= 0; i-- { + if !slices.Contains(s.vals, chars[i]) { + return i + } + } + return -1 +} + +type StringSearchValues struct { + vals [][]rune + ignoreCase bool + shortestVal int + + firstChars RuneSearchValues +} + +func NewStringSearchValues(vals [][]rune, ignoreCase bool) StringSearchValues { + min := math.MaxInt + firstLetters := make([]rune, 0, len(vals)) + for _, val := range vals { + if min > len(val) { + min = len(val) + } + if !slices.Contains(firstLetters, val[0]) { + firstLetters = append(firstLetters, val[0]) + if ignoreCase && val[0] != unicode.ToUpper(val[0]) { + //if we're ignoring case and this letter is impacted by case, add it to our set + firstLetters = append(firstLetters, unicode.ToUpper(val[0])) + } + } + } + + return StringSearchValues{ + vals: vals, + ignoreCase: ignoreCase, + shortestVal: min, + firstChars: newRuneSearchValues(firstLetters), + } +} + +func (s StringSearchValues) StartsWith(chars []rune) int { + for _, val := range s.vals { + if StartsWith(chars, val) { + return 0 + } + } + return -1 +} + +func (s StringSearchValues) StartsWithIgnoreCase(chars []rune) int { + for _, val := range s.vals { + if StartsWithIgnoreCase(chars, val) { + return 0 + } + } + return -1 +} + +func (s StringSearchValues) IndexOfAny(in []rune) int { + // go through our input once + end := len(in) - s.shortestVal + for i := 0; i <= end; i++ { + // check if the char are in our starting chars + j := s.firstChars.IndexOfAny(in[i:]) + // first chars not found at all + if j < 0 { + return -1 + } + j += i + // found a first char, do our full search through each item + for _, val := range s.vals { + if len(in)-j >= len(val) && Equals(in, j, len(val), val) { + return j + } + if s.ignoreCase && len(in)-j >= len(val) && EqualsIgnoreCase(in, j, len(val), val) { + return j + } + } + //skip ahead + i = j + } + + return -1 +} diff --git a/vendor/github.com/dlclark/regexp2/v2/match.go b/vendor/github.com/dlclark/regexp2/v2/match.go new file mode 100644 index 000000000..f37c9a7b1 --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/match.go @@ -0,0 +1,540 @@ +package regexp2 + +import ( + "bytes" + "fmt" + "sync/atomic" + "unicode/utf8" +) + +// Match is a single regex result match that contains groups and repeated captures +// +// -Groups +// -Capture +type Match struct { + Group //embeded group 0 + + // Keep pointers and slices ahead of scalar state to shorten the portion + // of each match that the garbage collector must scan. + regex *Regexp + sparseCaps map[int]int + // landmarks holds the required landmark searches that found this match. + landmarks *requiredLandmarkState + otherGroups []Group + + // output from the match + matches [][]int + matchcount []int + + // input to the match + textpos int + textstart int + capcount int + + // whether we've done any balancing with this match. If we have, full + // matches need capture-history compaction in tidy. + balancing bool +} + +// Group is an explicit or implit (group 0) matched group within the pattern +type Group struct { + Capture // the last capture of this group is embeded for ease of use + + Name string // group name + Captures []Capture // captures of this group +} + +// Capture is a single capture of text within the larger original string +type Capture struct { + // the original string + text *matchText + // RuneIndex is the rune index in the original input where the capture starts. + // For string input this counts runes from the start of that string, not of + // any internally sliced decode buffer. + RuneIndex int + // RuneLength is the number of runes in the captured substring. + RuneLength int +} + +type matchText struct { + runes []rune + input string + hasStringInput bool + runeOffset int // original-string rune index of runes[0] + byteOffset int // original-string byte index of runes[0] + byteOffsets []int + byteOffsetsReady bool + // The first returned capture retains this metadata anyway. Store it here + // to avoid a separate allocation; subsequent matches need their own record. + initialCaptureUsed bool + initialCapture [1]Capture + // landmarkMatch is the last match that FindNextMatch found in this text. + // The first call to continue from it takes its landmarks. + landmarkMatch atomic.Pointer[Match] +} + +// String returns the captured text. For string input it is a slice of the +// original haystack: it does not allocate and keeps the original string alive. +func (c *Capture) String() string { + if c.text == nil { + return "" + } + if c.text.hasStringInput { + start, length := c.ByteRange() + return c.text.input[start : start+length] + } + start := c.runeSliceIndex() + return string(c.text.runes[start : start+c.RuneLength]) +} + +// Runes returns the captured text as a rune slice +func (c *Capture) Runes() []rune { + if c.text == nil { + return nil + } + start := c.runeSliceIndex() + return c.text.runes[start : start+c.RuneLength] +} + +func (c *Capture) runeSliceIndex() int { + if c.text == nil { + return c.RuneIndex + } + return c.RuneIndex - c.text.runeOffset +} + +// ByteRange returns the UTF-8 byte index and byte length of the captured +// substring. Matches returned to callers have offsets computed when the match +// is tidied, so concurrent ByteRange/String on captures of the same match is +// then safe. Internal match objects may still initialize the cache on first use. +func (c *Capture) ByteRange() (index, length int) { + if c.text == nil { + return c.RuneIndex, c.RuneLength + } + return c.text.byteRange(c.RuneIndex, c.RuneLength) +} + +func newMatchText(r []rune) *matchText { + return &matchText{runes: r} +} + +func (t *matchText) resetString(input string, r []rune, runeOffset, byteOffset int) { + *t = matchText{ + runes: r, + input: input, + hasStringInput: true, + runeOffset: runeOffset, + byteOffset: byteOffset, + // Every decoded rune consumes at least one byte, even invalid UTF-8. + // Equal lengths therefore mean byte and rune offsets are identical. + byteOffsetsReady: len(input)-byteOffset == len(r), + } +} + +func (t *matchText) ensureByteOffsets() { + if t == nil || t.byteOffsetsReady { + return + } + t.byteOffsets = t.buildByteOffsets() + t.byteOffsetsReady = true +} + +func (t *matchText) byteRange(runeIndex, runeLength int) (int, int) { + localRuneIndex := runeIndex - t.runeOffset + t.ensureByteOffsets() + if t.byteOffsets == nil { + return t.byteOffset + localRuneIndex, runeLength + } + byteIndex := t.byteOffsets[localRuneIndex] + return t.byteOffset + byteIndex, t.byteOffsets[localRuneIndex+runeLength] - byteIndex +} + +func (t *matchText) buildByteOffsets() []int { + if t.hasStringInput { + return stringByteOffsets(t.input[t.byteOffset:], len(t.runes)) + } + return runeByteOffsets(t.runes) +} + +func stringByteOffsets(s string, runeCount int) []int { + if len(s) == runeCount { + return nil + } + // Decoding already established the rune count. A range walk gives the + // original byte positions, including one-byte invalid UTF-8 sequences. + offsets := make([]int, runeCount+1) + i := 0 + for byteIndex := range s { + offsets[i] = byteIndex + i++ + } + offsets[runeCount] = len(s) + return offsets +} + +func runeByteOffsets(runes []rune) []int { + var byteOffsets []int + bytePos := 0 + for i, ch := range runes { + if byteOffsets != nil { + byteOffsets[i] = bytePos + } + runeLen := utf8.RuneLen(ch) + if runeLen < 0 { + runeLen = utf8.RuneLen(utf8.RuneError) + } + if byteOffsets == nil && runeLen != 1 { + byteOffsets = make([]int, len(runes)+1) + for j := 0; j < i; j++ { + byteOffsets[j] = j + } + byteOffsets[i] = bytePos + } + bytePos += runeLen + } + if byteOffsets != nil { + byteOffsets[len(runes)] = bytePos + } + return byteOffsets +} + +func newMatch(regex *Regexp, capcount int, text *matchText, startpos int) *Match { + var m *Match + if capcount == 1 { + // With no explicit capture groups, keep the whole-match bookkeeping in + // one allocation rather than allocating three separate slice backings. + storage := new(struct { + Match + countsAndInterval [3]int + intervals [1][]int + }) + m = &storage.Match + m.matchcount = storage.countsAndInterval[:1:1] + m.matches = storage.intervals[:] + m.matches[0] = storage.countsAndInterval[1:] + } else { + // Capture counts and the initial whole-match interval have the same lifetime. + countsAndInterval := make([]int, capcount+2) + m = &Match{ + matchcount: countsAndInterval[:capcount:capcount], + matches: make([][]int, capcount), + } + m.matches[0] = countsAndInterval[capcount:] + } + m.regex = regex + m.textstart = startpos + if (regex.options & ECMAScript) == 0 { + m.Name = "0" + } + m.text = text + return m +} + +func newMatchSparse(regex *Regexp, caps map[int]int, capcount int, text *matchText, startpos int) *Match { + m := newMatch(regex, capcount, text, startpos) + m.sparseCaps = caps + return m +} + +func (m *Match) reset(text *matchText, textstart int) { + m.text = text + m.textstart = textstart + for i := 0; i < len(m.matchcount); i++ { + m.matchcount[i] = 0 + } + m.balancing = false +} + +func (m *Match) tidy(textpos int) { + + interval := m.matches[0] + setCaptureFields(&m.Capture, interval[0], interval[1]) + m.textpos = textpos + m.capcount = m.matchcount[0] + //copy our root capture to the list + if m.text != nil && !m.text.initialCaptureUsed { + m.text.initialCaptureUsed = true + m.text.initialCapture[0] = m.Capture + m.Captures = m.text.initialCapture[:] + } else { + m.Captures = []Capture{m.Capture} + } + if m.text != nil && m.text.hasStringInput { + m.text.ensureByteOffsets() + } + + if m.balancing { + // The idea here is that we want to compact all of our unbalanced captures. To do that we + // use j basically as a count of how many unbalanced captures we have at any given time + // (really j is an index, but j/2 is the count). First we skip past all of the real captures + // until we find a balance captures. Then we check each subsequent entry. If it's a balance + // capture (it's negative), we decrement j. If it's a real capture, we increment j and copy + // it down to the last free position. + for cap := 0; cap < len(m.matchcount); cap++ { + limit := m.matchcount[cap] * 2 + matcharray := m.matches[cap] + + var i, j int + + for i = 0; i < limit; i++ { + if matcharray[i] < 0 { + break + } + } + + for j = i; i < limit; i++ { + if matcharray[i] < 0 { + // skip negative values + j-- + } else { + // but if we find something positive (an actual capture), copy it back to the last + // unbalanced position. + if i != j { + matcharray[j] = matcharray[i] + } + j++ + } + } + + m.matchcount[cap] = j / 2 + } + + m.balancing = false + } +} + +// isMatched tells if a group was matched by capnum +func (m *Match) isMatched(cap int) bool { + return cap < len(m.matchcount) && m.matchcount[cap] > 0 && m.matches[cap][m.matchcount[cap]*2-1] != (-3+1) +} + +// matchIndex returns the index of the last specified matched group by capnum +func (m *Match) matchIndex(cap int) int { + i := m.matches[cap][m.matchcount[cap]*2-2] + if i >= 0 { + return i + } + + return m.matches[cap][-3-i] +} + +// matchLength returns the length of the last specified matched group by capnum +func (m *Match) matchLength(cap int) int { + i := m.matches[cap][m.matchcount[cap]*2-1] + if i >= 0 { + return i + } + + return m.matches[cap][-3-i] +} + +// Nonpublic builder: add a capture to the group specified by "c" +func (m *Match) addMatch(c, start, l int) { + + if m.matches[c] == nil { + m.matches[c] = make([]int, 2) + } + + capcount := m.matchcount[c] + + if capcount*2+2 > len(m.matches[c]) { + oldmatches := m.matches[c] + newmatches := make([]int, capcount*8) + copy(newmatches, oldmatches[:capcount*2]) + m.matches[c] = newmatches + } + + m.matches[c][capcount*2] = start + m.matches[c][capcount*2+1] = l + m.matchcount[c] = capcount + 1 + //log.Printf("addMatch: c=%v, i=%v, l=%v ... matches: %v", c, start, l, m.matches) +} + +// Nonpublic builder: Add a capture to balance the specified group. This is used by the +// +// balanced match construct. (?...) +// +// If there were no such thing as backtracking, this would be as simple as calling RemoveMatch(c). +// However, since we have backtracking, we need to keep track of everything. +func (m *Match) balanceMatch(c int) { + m.balancing = true + + // we'll look at the last capture first + capcount := m.matchcount[c] + target := capcount*2 - 2 + + // first see if it is negative, and therefore is a reference to the next available + // capture group for balancing. If it is, we'll reset target to point to that capture. + if m.matches[c][target] < 0 { + target = -3 - m.matches[c][target] + } + + // move back to the previous capture + target -= 2 + + // if the previous capture is a reference, just copy that reference to the end. Otherwise, point to it. + if target >= 0 && m.matches[c][target] < 0 { + m.addMatch(c, m.matches[c][target], m.matches[c][target+1]) + } else { + m.addMatch(c, -3-target, -4-target /* == -3 - (target + 1) */) + } +} + +// Nonpublic builder: removes a group match by capnum +func (m *Match) removeMatch(c int) { + m.matchcount[c]-- +} + +// GroupCount returns the number of groups this match has matched +func (m *Match) GroupCount() int { + return len(m.matchcount) +} + +// GroupByName returns a group based on the name of the group, or nil if the group name does not exist +// For duplicate ECMAScript names, it selects the participating group, or the +// first declaration if none participated. +func (m *Match) GroupByName(name string) *Group { + // Participating selection follows ECMAScript 2025 §22.2.7.2 RegExpBuiltinExec, + // step 34.5; + // https://tc39.es/ecma262/2025/multipage/text-processing.html#sec-regexpbuiltinexec + if slots := m.regex.duplicateCapnames[name]; len(slots) > 0 { + for _, slot := range slots { + if m.isMatched(slot) { + return m.groupByIndex(slot) + } + } + return m.groupByIndex(slots[0]) + } + num := m.regex.GroupNumberFromName(name) + if num < 0 { + return nil + } + return m.GroupByNumber(num) +} + +// GroupByNumber returns a group based on the number of the group, or nil if the group number does not exist +func (m *Match) GroupByNumber(num int) *Group { + // check our sparse map + if m.sparseCaps != nil { + newNum, ok := m.sparseCaps[num] + if !ok { + return nil + } + num = newNum + } + return m.groupByIndex(num) +} + +func (m *Match) groupByIndex(num int) *Group { + if num >= len(m.matchcount) || num < 0 { + return nil + } + + if num == 0 { + return &m.Group + } + + m.populateOtherGroups() + + return &m.otherGroups[num-1] +} + +// Groups returns all the capture groups, starting with group 0 (the full match) +func (m *Match) Groups() []Group { + m.populateOtherGroups() + g := make([]Group, len(m.otherGroups)+1) + g[0] = m.Group + copy(g[1:], m.otherGroups) + return g +} + +func (m *Match) populateOtherGroups() { + // Construct all the Group objects first time called + if m.otherGroups == nil { + m.otherGroups = make([]Group, len(m.matchcount)-1) + for i := 0; i < len(m.otherGroups); i++ { + m.otherGroups[i] = newGroup(m.regex.groupNameFromSlot(i+1), m.text, m.matches[i+1], m.matchcount[i+1]) + } + } +} + +func (m *Match) groupValueAppendToBuf(groupnum int, buf *bytes.Buffer) { + c := m.matchcount[groupnum] + if c == 0 { + return + } + + matches := m.matches[groupnum] + + index := matches[(c-1)*2] + last := index + matches[(c*2)-1] + + for ; index < last; index++ { + buf.WriteRune(m.text.runes[index]) + } +} + +func newGroup(name string, text *matchText, caps []int, capcount int) Group { + g := Group{} + g.text = text + if capcount > 0 { + setCaptureFields(&g.Capture, caps[(capcount-1)*2], caps[(capcount*2)-1]) + } + g.Name = name + g.Captures = make([]Capture, capcount) + for i := 0; i < capcount; i++ { + g.Captures[i] = newCapture(text, caps[i*2], caps[i*2+1]) + } + //log.Printf("newGroup! capcount %v, %+v", capcount, g) + + return g +} + +func newCapture(text *matchText, runeIndex, runeLength int) Capture { + c := Capture{text: text} + setCaptureFields(&c, runeIndex, runeLength) + return c +} + +func setCaptureFields(c *Capture, runeIndex, runeLength int) { + if c.text != nil { + runeIndex += c.text.runeOffset + } + c.RuneIndex = runeIndex + c.RuneLength = runeLength +} + +func (m *Match) dump() string { + buf := &bytes.Buffer{} + buf.WriteRune('\n') + if len(m.sparseCaps) > 0 { + for k, v := range m.sparseCaps { + fmt.Fprintf(buf, "Slot %v -> %v\n", k, v) + } + } + + for i, g := range m.Groups() { + fmt.Fprintf(buf, "Group %v (%v), %v caps:\n", i, g.Name, len(g.Captures)) + + for _, c := range g.Captures { + fmt.Fprintf(buf, " (%v, %v) %v\n", c.RuneIndex, c.RuneLength, c.String()) + } + } + /* + for i := 0; i < len(m.matchcount); i++ { + fmt.Fprintf(buf, "\nGroup %v (%v):\n", i, m.regex.GroupNameFromNumber(i)) + + for j := 0; j < m.matchcount[i]; j++ { + text := "" + + if m.matches[i][j*2] >= 0 { + start := m.matches[i][j*2] + text = m.text.runes[start : start+m.matches[i][j*2+1]] + } + + fmt.Fprintf(buf, " (%v, %v) %v\n", m.matches[i][j*2], m.matches[i][j*2+1], text) + } + } + */ + return buf.String() +} diff --git a/vendor/github.com/dlclark/regexp2/v2/matchview.go b/vendor/github.com/dlclark/regexp2/v2/matchview.go new file mode 100644 index 000000000..747cd8b5c --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/matchview.go @@ -0,0 +1,95 @@ +package regexp2 + +import "errors" + +// MatchView provides the capture positions of a match during FindRunesMatches. +// It borrows the engine's storage and is valid only until the callback returns. +// Copy the values returned by GroupRange to retain positions; copying a +// MatchView does not extend its lifetime. The zero value has no groups. +type MatchView struct { + match *Match +} + +// GroupCount returns the number of groups defined by the pattern, including +// group 0 (the whole match) and groups that did not participate in this match. +// Explicit group numbers may be sparse; call Regexp.GetGroupNumbers before +// iteration to enumerate them rather than assuming they run from 0 to +// GroupCount()-1. +func (v MatchView) GroupCount() int { + if v.match == nil { + return 0 + } + return len(v.match.matchcount) +} + +// GroupRange returns the rune index and rune length of the last capture of the +// group with the given number. Indexes are relative to the original input, +// including when FindRunesMatches starts at a nonzero position. Group 0 is the +// whole match. It returns (0, 0, false) if the number does not exist or the group +// has no remaining capture; a participating empty capture has ok == true. +// For a successful result, input[index:index+length] is the captured text. +func (v MatchView) GroupRange(num int) (index, length int, ok bool) { + m := v.match + if m == nil { + return 0, 0, false + } + if m.sparseCaps != nil { + var exists bool + num, exists = m.sparseCaps[num] + if !exists { + return 0, 0, false + } + } + if num < 0 || num >= len(m.matchcount) || !m.isMatched(num) { + return 0, 0, false + } + // These helpers resolve balancing references without compacting the entire + // capture history. The interpreter and generated engines use them too. + return m.matchIndex(num), m.matchLength(num), true +} + +// FindRunesMatches calls yield for each successive match in input, starting at +// the rune index startAt. A negative startAt starts at the beginning of input, +// or at its end for RightToLeft patterns. A nil yield is a no-op; otherwise, +// a startAt beyond len(input) is an error. +// Match order and advancement after empty matches are the same as with +// FindRunesMatchStartingAt followed by FindNextMatch. +// +// The view is valid only during the callback. Copy out any positions to retain +// them, and do not modify input during iteration. Returning false stops the +// iteration successfully. Matching errors are returned after any preceding +// callbacks have completed. MatchTimeout applies to each search for the next +// match, not to the whole iteration or the callback. +// +// Matching reuses the runner and capture storage instead of allocating a Match +// and text metadata for every result. Initial setup and growing the engine's +// buffers may allocate; GroupRange and GroupCount do not allocate. +func (re *Regexp) FindRunesMatches(input []rune, startAt int, yield func(MatchView) bool) error { + if yield == nil { + return nil + } + if startAt > len(input) { + return errors.New("regexp2: startAt must not exceed the input length") + } + if startAt < 0 { + startAt = 0 + if re.RightToLeft() { + startAt = len(input) + } + } + + runner := re.getRunner() + defer re.putRunner(runner) + previousMatchLength := -1 + for { + m, err := runner.scan(input, nil, startAt, startAt, previousMatchLength, scanCaptures, re.MatchTimeout) + if err != nil || m == nil { + return err + } + if !yield(MatchView{match: m}) { + return nil + } + startAt = m.textpos + previousMatchLength = m.RuneLength + } +} diff --git a/vendor/github.com/dlclark/regexp2/v2/options.go b/vendor/github.com/dlclark/regexp2/v2/options.go new file mode 100644 index 000000000..e54fa782b --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/options.go @@ -0,0 +1,170 @@ +package regexp2 + +var ( + // DefaultUnmarshalOptions used when unmarshaling a regex from text + DefaultUnmarshalOptions = None + // DefaultOptimizationOptions controls the default memory/performance trade-offs used by Compile. + DefaultOptimizationOptions = OptimizationOptions{ + MaxBacktrackingStackSize: 100000, + MaxCachedRuneBufferLength: 256 << 10, + MaxCachedReplaceBufferLength: 256 << 10, + MaxCachedReplacerDataEntries: 16, + MaxCachedReplacerDataBytes: 4 << 10, + DisableCharClassASCIIBitmap: false, + } +) + +// RegexOptions impact the runtime and parsing behavior +// for each specific regex. They are setable in code as well +// as in the regex pattern itself. +type RegexOptions int32 + +func (o RegexOptions) applyCompileOption(c *compileConfig) { + c.regexOptions |= o +} + +const ( + None RegexOptions = 0x0 + IgnoreCase RegexOptions = 0x0001 // "i" + Multiline RegexOptions = 0x0002 // "m" + ExplicitCapture RegexOptions = 0x0004 // "n" + Singleline RegexOptions = 0x0010 // "s" + IgnorePatternWhitespace RegexOptions = 0x0020 // "x" + RightToLeft RegexOptions = 0x0040 // "r" + // ECMAScript attempts to follow ECMAScript regex behavior rather than C# RegexOptions.ECMAScript compatibility. + ECMAScript RegexOptions = 0x0100 // "e" + RE2 RegexOptions = 0x0200 // RE2 (regexp package) compatibility mode + Unicode RegexOptions = 0x0400 // "u" +) + +// OptimizationOptions controls runtime limits, optional caches, and compile-time fast paths. +// +// For MaxBacktrackingStackSize, negative values allow unbounded growth. +// For replacement data cache size fields, 0 disables persistent retention and +// -1 means unbounded. For pooled buffer cache size fields, 0 disables pooling +// and -1 allows all built-in size classes. +// Defaults are intentionally bounded so Compile is safe for mixed-cardinality inputs. +type OptimizationOptions struct { + // MaxBacktrackingStackSize limits the number of integer slots used by a match's backtracking stack. + // Negative values disable the limit. + MaxBacktrackingStackSize int + // MaxCachedRuneBufferLength limits retained string-to-rune buffers in the shared size-classed pool. + MaxCachedRuneBufferLength int + // MaxCachedReplaceBufferLength limits retained replacement output buffers in the shared size-classed pool. + MaxCachedReplaceBufferLength int + // MaxCachedReplacerDataEntries limits the number of parsed replacement patterns cached per Regexp. + MaxCachedReplacerDataEntries int + // MaxCachedReplacerDataBytes skips caching replacement patterns longer than this many bytes. + MaxCachedReplacerDataBytes int + // DisableCharClassASCIIBitmap disables compile-time ASCII bitmap construction for character classes. + DisableCharClassASCIIBitmap bool +} + +// CompileOption configures Compile and MustCompile. +type CompileOption interface { + applyCompileOption(*compileConfig) +} + +type compileConfig struct { + regexOptions RegexOptions + optimizations OptimizationOptions + codeGen bool + debug bool + maintainCaptureOrder bool +} + +type compileOptionFunc func(*compileConfig) + +func (f compileOptionFunc) applyCompileOption(c *compileConfig) { + f(c) +} + +func (o OptimizationOptions) cacheReplacerData(replacement string) bool { + if o.MaxCachedReplacerDataEntries == 0 { + return false + } + return keepCacheBytes(o.MaxCachedReplacerDataBytes, len(replacement)) +} + +func keepCacheBytes(maxBytes, actualBytes int) bool { + if maxBytes < 0 { + return true + } + return maxBytes > 0 && actualBytes <= maxBytes +} + +func newCompileConfig(options []CompileOption) compileConfig { + c := compileConfig{ + optimizations: DefaultOptimizationOptions, + } + for _, option := range options { + if option != nil { + option.applyCompileOption(&c) + } + } + return c +} + +// OptionMaxBacktrackingStackSize limits the number of integer slots used by a match's backtracking stack. +// Negative values disable the limit. A match that exceeds the limit returns ErrBacktrackingStackLimit. +func OptionMaxBacktrackingStackSize(n int) CompileOption { + return compileOptionFunc(func(c *compileConfig) { + c.optimizations.MaxBacktrackingStackSize = n + }) +} + +// OptionMaxCachedRuneBufferLength limits retained string-to-rune buffers in the shared size-classed pool. +func OptionMaxCachedRuneBufferLength(n int) CompileOption { + return compileOptionFunc(func(c *compileConfig) { + c.optimizations.MaxCachedRuneBufferLength = n + }) +} + +// OptionMaxCachedReplaceBufferLength limits retained replacement output buffers in the shared size-classed pool. +func OptionMaxCachedReplaceBufferLength(n int) CompileOption { + return compileOptionFunc(func(c *compileConfig) { + c.optimizations.MaxCachedReplaceBufferLength = n + }) +} + +// OptionMaxCachedReplacerDataEntries limits parsed replacement patterns cached per Regexp. +func OptionMaxCachedReplacerDataEntries(n int) CompileOption { + return compileOptionFunc(func(c *compileConfig) { + c.optimizations.MaxCachedReplacerDataEntries = n + }) +} + +// OptionMaxCachedReplacerDataBytes skips caching replacement patterns longer than n bytes. +func OptionMaxCachedReplacerDataBytes(n int) CompileOption { + return compileOptionFunc(func(c *compileConfig) { + c.optimizations.MaxCachedReplacerDataBytes = n + }) +} + +// OptionDisableCharClassASCIIBitmap disables compile-time ASCII bitmaps for character classes. +func OptionDisableCharClassASCIIBitmap() CompileOption { + return compileOptionFunc(func(c *compileConfig) { + c.optimizations.DisableCharClassASCIIBitmap = true + }) +} + +// OptionIsCodeGen enables more expensive compile-time analysis intended for regexp2cg generated engines. +func OptionIsCodeGen() CompileOption { + return compileOptionFunc(func(c *compileConfig) { + c.codeGen = true + }) +} + +// OptionDebug enables debug output and runner tracing for the compiled regexp. +func OptionDebug() CompileOption { + return compileOptionFunc(func(c *compileConfig) { + c.debug = true + }) +} + +// OptionMaintainCaptureOrder assigns named and unnamed capture slots in pattern order. +func OptionMaintainCaptureOrder() CompileOption { + return compileOptionFunc(func(c *compileConfig) { + c.maintainCaptureOrder = true + }) +} diff --git a/vendor/github.com/dlclark/regexp2/v2/prefixsearch.go b/vendor/github.com/dlclark/regexp2/v2/prefixsearch.go new file mode 100644 index 000000000..ba2c2eca2 --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/prefixsearch.go @@ -0,0 +1,124 @@ +package regexp2 + +// equalASCIIPrefixSearch searches several equal-length prefixes in parallel +// using one bit per character. Equal lengths ensure that the first completed +// prefix also has the earliest start. The masks are immutable after compilation +// and can be shared by concurrent runners. +type equalASCIIPrefixSearch struct { + masks [128]uint64 + starts uint64 + ends uint64 + width int + sharedFirst bool + minRuneCandidates uint8 +} + +func compileEqualASCIIPrefixSearch(prefixes []string) *equalASCIIPrefixSearch { + if len(prefixes) < 2 || len(prefixes[0]) == 0 { + return nil + } + width := len(prefixes[0]) + if width > 64/len(prefixes) { + return nil + } + for _, prefix := range prefixes { + if len(prefix) != width || !isASCIIString(prefix) { + return nil + } + } + search := &equalASCIIPrefixSearch{width: width, minRuneCandidates: prefixSearchSampleSize / 8} + // Checking more alternatives at each candidate makes a combined search + // worthwhile at a lower density. Two-prefix searches retain a higher bar. + if len(prefixes) >= 3 { + search.minRuneCandidates = prefixSearchSampleSize / 16 + } + var firstSeen [128]bool + for k, prefix := range prefixes { + for i := range len(prefix) { + ch := prefix[i] + search.masks[ch] |= uint64(1) << (k*width + i) + } + search.starts |= uint64(1) << (k * width) + search.ends |= uint64(1) << (k*width + width - 1) + first := prefix[0] + search.sharedFirst = search.sharedFirst || firstSeen[first] + firstSeen[first] = true + } + return search +} + +const prefixSearchSampleSize = 64 + +// Retain the existing first-character scanners when candidates are sparse. +// Sampling is bounded, and short inputs retain their cheaper existing search. +func (s *equalASCIIPrefixSearch) shouldUseRunes(input []rune, startAt int) bool { + if startAt < 0 || startAt > len(input)-prefixSearchSampleSize { + return false + } + candidates := 0 + for _, ch := range input[startAt : startAt+prefixSearchSampleSize] { + if uint32(ch) < 128 && s.masks[ch]&s.starts != 0 { + candidates++ + } + } + return candidates >= int(s.minRuneCandidates) +} + +func (s *equalASCIIPrefixSearch) shouldUseString(input string, startAt int) bool { + // Distinct first bytes already use strings.Index per prefix, which is + // especially effective for a small number of alternatives on sparse input. + if !s.sharedFirst || startAt < 0 || startAt > len(input)-prefixSearchSampleSize { + return false + } + candidates := 0 + for i := startAt; i < startAt+prefixSearchSampleSize; i++ { + ch := input[i] + if ch < 128 && s.masks[ch]&s.starts != 0 { + candidates++ + } + } + return candidates >= prefixSearchSampleSize/4 +} + +// indexRunes returns an absolute rune index, or -1. A non-ASCII rune (including +// invalid rune values accepted by rune APIs) cannot occur in these prefixes and +// therefore resets all partial matches. +func (s *equalASCIIPrefixSearch) indexRunes(input []rune, startAt int) int { + if startAt < 0 || startAt > len(input)-s.width { + return -1 + } + var state uint64 + for i := startAt; i < len(input); i++ { + ch := input[i] + if uint32(ch) >= 128 { + state = 0 + continue + } + state = ((state << 1) | s.starts) & s.masks[ch] + if state&s.ends != 0 { + return i - s.width + 1 + } + } + return -1 +} + +// indexString returns an absolute byte index, or -1. ASCII prefixes can only +// start at rune boundaries, even in strings containing invalid UTF-8 bytes. +func (s *equalASCIIPrefixSearch) indexString(input string, startAt int) int { + if startAt < 0 || startAt > len(input)-s.width { + return -1 + } + var state uint64 + for i := startAt; i < len(input); i++ { + ch := input[i] + if ch >= 128 { + state = 0 + continue + } + state = ((state << 1) | s.starts) & s.masks[ch] + if state&s.ends != 0 { + return i - s.width + 1 + } + } + return -1 +} diff --git a/vendor/github.com/dlclark/regexp2/v2/regexp.go b/vendor/github.com/dlclark/regexp2/v2/regexp.go new file mode 100644 index 000000000..b48eaa6aa --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/regexp.go @@ -0,0 +1,763 @@ +/* +Package regexp2 is a regexp package that has an interface similar to Go's framework regexp engine but uses a +more feature full regex engine behind the scenes. + +It doesn't have constant time guarantees, but it allows backtracking and is compatible with Perl5 and .NET. +You'll likely be better off with the RE2 engine from the regexp package and should only use this if you +need to write very complex patterns or require compatibility with .NET. +*/ +package regexp2 + +import ( + "container/list" + "errors" + "log" + "math" + "strconv" + "sync" + "time" + "unicode/utf8" + + "github.com/dlclark/regexp2/v2/syntax" +) + +var ( + // DefaultMatchTimeout used when running regexp matches -- "forever" + DefaultMatchTimeout = time.Duration(math.MaxInt64) + // ErrBacktrackingStackLimit is returned when a match exceeds its configured backtracking stack size. + ErrBacktrackingStackLimit = errors.New("regexp2: maximum backtracking stack size exceeded") +) + +// Regexp is the representation of a compiled regular expression. +// A Regexp is safe for concurrent use by multiple goroutines. +type Regexp struct { + // A match will time out if it takes (approximately) more than + // MatchTimeout. This is a safety check in case the match + // encounters catastrophic backtracking. The default value + // (DefaultMatchTimeout) causes all time out checking to be + // suppressed. + MatchTimeout time.Duration + + // read-only after Compile + pattern string // as passed to Compile + options RegexOptions // options + debug bool + + caps map[int]int // public group number -> dense capture slot + capnames map[string]int // capture group name -> first public group number + duplicateCapnames map[string][]int // ECMAScript name -> dense capture slots + duplicateGroupNumbers map[string][]int // ECMAScript name -> public group numbers; shared when dense + capslist []string // sorted list of capture group names + capsize int // size of the capture array + + code *syntax.Code // compiled program + + optimizations OptimizationOptions + + // cache of machines for running regexp + runnerPool *sync.Pool + + replaceCache *replacerDataCache + + // hook points to override runner functions + findFirstChar func(r *Runner) bool + execute func(r *Runner) error + executeQuick func(r *Runner) error + stringPrefixFilter StringPrefixFilter + prefixSearch *equalASCIIPrefixSearch // immutable search masks shared by string and rune finders + quickCode *syntax.Code // bool-only program with unobservable captures removed + // leftContextRunes is used when code is nil (registered engines). + // The interpreter reads the same value from code.LeftContextRunes. + leftContextRunes int +} + +// Compile parses a regular expression and returns, if successful, +// a Regexp object that can be used to match against text. +func Compile(expr string, options ...CompileOption) (*Regexp, error) { + c := newCompileConfig(options) + return compile(expr, c) +} + +func compile(expr string, c compileConfig) (*Regexp, error) { + // parse it + parseOptions := syntax.ParseOptions{ + RegexOptions: syntax.RegexOptions(c.regexOptions), + MaintainCaptureOrder: c.maintainCaptureOrder, + CodeGen: c.codeGen, + } + tree, err := syntax.Parse(expr, parseOptions) + if err != nil { + return nil, err + } + + if c.debug { + log.Print(tree.Dump()) + } + + // translate it to code + code, err := syntax.Write(tree) + if err != nil { + return nil, err + } + if c.debug { + log.Print(code.Dump()) + } + if !c.optimizations.DisableCharClassASCIIBitmap { + code.PrepareCharSetASCIIBitmaps() + } + + // return it + re := &Regexp{ + pattern: expr, + options: c.regexOptions, + debug: c.debug, + caps: code.Caps, + capnames: tree.Capnames, + capslist: tree.Caplist, + capsize: code.Capsize, + code: code, + quickCode: makeQuickCode(code), + MatchTimeout: DefaultMatchTimeout, + optimizations: c.optimizations, + } + re.stringPrefixFilter = newStringPrefixFilter(code) + if opts := code.FindOptimizations; opts != nil && opts.FindMode == syntax.LeadingStrings_LeftToRight { + re.prefixSearch = compileEqualASCIIPrefixSearch(opts.LeadingPrefixes) + if re.prefixSearch != nil && re.prefixSearch.sharedFirst && re.stringPrefixFilter != nil { + re.stringPrefixFilter = withEqualASCIIPrefixSearch(re.stringPrefixFilter, re.prefixSearch, opts.MinRequiredLength) + } + } + re.findFirstChar = compileFindFirstChar(code) + re.initCaptureNames() + re.initCaches() + return re, nil +} + +func makeQuickCode(code *syntax.Code) *syntax.Code { + if code == nil || len(code.QuickCodes) == 0 { + return nil + } + quick := *code + quick.Codes = code.QuickCodes + quick.Dispatches = code.QuickDispatches + quick.QuickCodes = nil + quick.QuickDispatches = nil + return &quick +} + +// MustCompile is like Compile but panics if the expression cannot be parsed. +// It simplifies safe initialization of global variables holding compiled regular +// expressions. +func MustCompile(str string, options ...CompileOption) *Regexp { + c := newCompileConfig(options) + + // lookup if we have a pre-built state machine for this pattern and options + regexp := getEngineRegexp(str, c) + if regexp != nil { + return regexp + } + + regexp, err := compile(str, c) + if err != nil { + panic(`regexp2: Compile(` + quote(str) + `): ` + err.Error()) + } + return regexp +} + +// Escape adds backslashes to any special characters in the input string +func Escape(input string) string { + return syntax.Escape(input) +} + +// Unescape removes any backslashes from previously-escaped special characters in the input string +func Unescape(input string) (string, error) { + return syntax.Unescape(input) +} + +// SetTimeoutPeriod is a debug function that sets the frequency of the timeout goroutine's sleep cycle. +// Defaults to 100ms. The only benefit of setting this lower is that the 1 background goroutine that manages +// timeouts may exit slightly sooner after all the timeouts have expired. See Github issue #63 +func SetTimeoutCheckPeriod(d time.Duration) { + clockPeriod = d +} + +// StopTimeoutClock should only be used in unit tests to prevent the timeout clock goroutine +// from appearing like a leaking goroutine +func StopTimeoutClock() { + stopClock() +} + +// String returns the source text used to compile the regular expression. +func (re *Regexp) String() string { + return re.pattern +} + +func quote(s string) string { + if strconv.CanBackquote(s) { + return "`" + s + "`" + } + return strconv.Quote(s) +} + +func (re *Regexp) RightToLeft() bool { + return re.options&RightToLeft != 0 +} + +func (re *Regexp) Debug() bool { + return re.debug +} + +// Replace searches the input string and replaces each match found with the replacement text. +// Count will limit the number of matches attempted and startAt will allow +// us to skip past possible matches at the start of the input (left or right depending on RightToLeft option). +// Set startAt and count to -1 to go through the whole string +func (re *Regexp) Replace(input, replacement string, startAt, count int) (string, error) { + data, err := re.getReplacerData(replacement) + if err != nil { + return "", err + } + + return replace(re, data, nil, input, startAt, count) +} + +func (re *Regexp) getReplacerData(replacement string) (*syntax.ReplacerData, error) { + shouldCache := re.replaceCache != nil && re.optimizations.cacheReplacerData(replacement) + if shouldCache { + if data, ok := re.replaceCache.get(replacement); ok { + return data, nil + } + } + + var data *syntax.ReplacerData + var err error + if len(re.duplicateCapnames) > 0 { + data, err = syntax.NewReplacerDataWithGroupNumbers(replacement, re.caps, re.capsize, re.capnames, syntax.RegexOptions(re.options), re.duplicateGroupNumbers) + } else { + data, err = syntax.NewReplacerData(replacement, re.caps, re.capsize, re.capnames, syntax.RegexOptions(re.options)) + } + if err != nil { + return nil, err + } + if shouldCache { + re.replaceCache.add(replacement, data) + } + return data, nil +} + +// ReplaceFunc searches the input string and replaces each match found using the string from the evaluator +// Count will limit the number of matches attempted and startAt will allow +// us to skip past possible matches at the start of the input (left or right depending on RightToLeft option). +// Set startAt and count to -1 to go through the whole string. +func (re *Regexp) ReplaceFunc(input string, evaluator MatchEvaluator, startAt, count int) (string, error) { + return replace(re, nil, evaluator, input, startAt, count) +} + +// FindStringMatch searches the input string for a Regexp match +func (re *Regexp) FindStringMatch(s string) (*Match, error) { + startAt, ok, err := re.findStringMatchStart(s, -1) + if err != nil { + return nil, err + } + if !ok { + return nil, nil + } + return re.findDecodedStringMatch(s, startAt, -1) +} + +// FindRunesMatch searches the input rune slice for a Regexp match +func (re *Regexp) FindRunesMatch(r []rune) (*Match, error) { + return re.run(scanFullMatch, -1, r) +} + +// FindStringMatchStartingAt searches the input string for a Regexp match starting at the startAt index +func (re *Regexp) FindStringMatchStartingAt(s string, startAt int) (*Match, error) { + candidate, ok, err := re.findStringMatchStart(s, startAt) + if err != nil { + return nil, err + } + if !ok { + return nil, nil + } + return re.findDecodedStringMatch(s, candidate, startAt) +} + +func (re *Regexp) findDecodedStringMatch(s string, candidate, startAt int) (*Match, error) { + d := re.decodeStringInput(s, candidate, true) + runner := re.getRunner() + defer re.putRunner(runner) + text := runner.stringMatchText(s, d.runes, d.runeOffset, d.byteOffset) + origin := re.stringSearchOrigin(s, startAt, d.runeStart) + m, err := runner.scan(d.runes, text, origin, d.runeStart, -1, scanFullMatch, re.MatchTimeout) + if err != nil || m == nil { + d.release() + return nil, err + } + // The match takes both the input and its metadata. A miss keeps the + // metadata in the runner and returns the decoded buffer for reuse. + runner.textInfo = nil + if d.pooled != nil { + pooledMatchRuneBuffers.detach(d.pooled, cap(d.runes)) + } + return m, nil +} + +// FindRunesMatchStartingAt searches the input rune slice for a Regexp match starting at the startAt index +func (re *Regexp) FindRunesMatchStartingAt(r []rune, startAt int) (*Match, error) { + return re.run(scanFullMatch, startAt, r) +} + +// FindAllStringIndex returns a slice of byte index pairs identifying all +// successive matches in s. +func (re *Regexp) FindAllStringIndex(s string, n int) ([][]int, error) { + if n == 0 { + return nil, nil + } + + startAt, ok, err := re.findStringMatchStart(s, -1) + if err != nil { + return nil, err + } + if !ok { + return nil, nil + } + + // Index results only need byte offsets. Keep the mapper relative to the + // decoded suffix so neither decoding nor mapping has to count prefix runes. + d := decodeInput(s, startAt, re.decodeFrom(s, startAt), re.optimizations.MaxCachedRuneBufferLength) + runner := re.getRunner() + defer func() { + re.putRunner(runner) + d.release() + }() + byteOffsets := stringByteMapper{input: s[d.byteOffset:]} + if re.RightToLeft() { + byteOffsets.runePos = len(d.runes) + byteOffsets.bytePos = len(byteOffsets.input) + } + if re.quickCode != nil { + runner.code = re.quickCode + } + origin := re.stringSearchOrigin(s, -1, d.runeStart) + return re.findAllRunesIndex(runner, d.runes, origin, d.runeStart, n, func(runeIndex, runeLength int) (int, int) { + if len(d.runes) == len(byteOffsets.input) { + return d.byteOffset + runeIndex, d.byteOffset + runeIndex + runeLength + } + return d.byteOffset + byteOffsets.byteIndex(runeIndex), d.byteOffset + byteOffsets.byteIndex(runeIndex+runeLength) + }) +} + +// FindAllRunesIndex returns a slice of rune index pairs identifying all +// successive matches in r. +func (re *Regexp) FindAllRunesIndex(r []rune, n int) ([][]int, error) { + if n == 0 { + return nil, nil + } + + runner := re.getRunner() + defer re.putRunner(runner) + + startAt := 0 + if re.RightToLeft() { + startAt = len(r) + } + if re.quickCode != nil { + runner.code = re.quickCode + } + return re.findAllRunesIndex(runner, r, startAt, startAt, n, func(runeIndex, runeLength int) (int, int) { + return runeIndex, runeIndex + runeLength + }) +} + +func (re *Regexp) findAllRunesIndex(runner *Runner, input []rune, origin, startAt, n int, makeIndex func(runeIndex, runeLength int) (int, int)) ([][]int, error) { + var out [][]int + var flat []int + if n > 0 { + // Preserve the non-nil empty result without allocating backing storage. + out = [][]int{} + } + + prevEnd := -1 + previousMatchLength := -1 + for n != 0 { + m, err := runner.scan(input, nil, origin, startAt, previousMatchLength, scanBounds, re.MatchTimeout) + if err != nil { + return nil, err + } + if m == nil { + break + } + + localIndex := m.runeSliceIndex() + if m.RuneLength != 0 || localIndex != prevEnd { + if len(out) == 0 && n > 0 { + out = make([][]int, 0, n) + flat = make([]int, 0, n*2) + } + start, end := makeIndex(localIndex, m.RuneLength) + flat = append(flat, start, end) + out = append(out, flat[len(flat)-2:len(flat):len(flat)]) + prevEnd = localIndex + m.RuneLength + if n > 0 { + n-- + } + } + + startAt = m.textpos + origin = startAt + previousMatchLength = m.RuneLength + } + return out, nil +} + +type stringByteMapper struct { + input string + runePos int + bytePos int +} + +// runeIndex is relative to input; each invalid UTF-8 byte counts as one rune. +func (m *stringByteMapper) byteIndex(runeIndex int) int { + for m.runePos < runeIndex { + size := 1 + if m.input[m.bytePos] >= utf8.RuneSelf { + _, size = utf8.DecodeRuneInString(m.input[m.bytePos:]) + } + m.bytePos += size + m.runePos++ + } + for m.runePos > runeIndex { + size := 1 + if m.input[m.bytePos-1] >= utf8.RuneSelf { + _, size = utf8.DecodeLastRuneInString(m.input[:m.bytePos]) + } + m.bytePos -= size + m.runePos-- + } + return m.bytePos +} + +// FindNextMatch returns the next match in the same input string as the match parameter. +// Will return nil if there is no next match or if given a nil match. +// It can reuse what earlier calls read of the input, so a rune slice input +// must not change between them. +func (re *Regexp) FindNextMatch(m *Match) (*Match, error) { + if m == nil { + return nil, nil + } + + runner := re.getRunner() + defer re.putRunner(runner) + landmarkChain := re.code != nil && re.code.FindOptimizations != nil && re.code.FindOptimizations.FindMode == syntax.RequiredLandmarkChain_LeftToRight + // Continue the required landmark searches that found m, so that iterating + // reads the input once. Only one call can take them; other calls, and + // calls on older matches or copies, start new ones. + if landmarkChain && m.text.landmarkMatch.CompareAndSwap(m, nil) { + runner.landmarks, runner.Runtext = m.landmarks, m.text.runes + } + next, err := runner.scan(m.text.runes, m.text, m.textpos, m.textpos, m.RuneLength, scanFullMatch, re.MatchTimeout) + if landmarkChain && next != nil && runner.landmarks != nil { + next.landmarks, runner.landmarks = runner.landmarks, nil + m.text.landmarkMatch.Store(next) + } + return next, err +} + +// MatchString return true if the string matches the regex +// error will be set if a timeout occurs +func (re *Regexp) MatchString(s string) (bool, error) { + if re.stringPrefixFilter != nil && !re.RightToLeft() { + candidateByteIndex, ok := re.stringPrefixFilter(s, 0) + if !ok { + return false, nil + } + + return re.matchStringAt(s, candidateByteIndex) + } + return re.matchStringAt(s, -1) +} + +func (re *Regexp) matchStringAt(s string, startAt int) (bool, error) { + runner := re.getRunner() + var input []rune + var pooledInput *[]rune + runeStart := 0 + if startAt <= 0 { + // Common path: decode the whole string without start/offset work. + input, pooledInput = decodeString(s, re.optimizations.MaxCachedRuneBufferLength) + if re.RightToLeft() { + runeStart = len(input) + } + } else { + d := decodeInput(s, startAt, re.decodeFrom(s, startAt), re.optimizations.MaxCachedRuneBufferLength) + input = d.runes + pooledInput = d.pooled + runeStart = d.runeStart + if runeStart < 0 { + runeStart = 0 + } + } + defer func() { + re.putRunner(runner) + if pooledInput != nil { + *pooledInput = input + pooledRuneBuffers.put(pooledInput) + } + }() + if re.quickCode != nil { + runner.code = re.quickCode + } + + origin := re.stringSearchOrigin(s, -1, runeStart) + m, err := runner.scan(input, nil, origin, runeStart, -1, scanBounds, re.MatchTimeout) + if err != nil { + return false, err + } + return m != nil, nil +} + +// MatchRunes return true if the runes matches the regex +// error will be set if a timeout occurs +func (re *Regexp) MatchRunes(r []rune) (bool, error) { + m, err := re.run(scanBounds, -1, r) + if err != nil { + return false, err + } + return m != nil, nil +} + +// GetGroupNames returns the capture-group names in group-number order. +// Duplicate ECMAScript names appear once for each group with that name. +func (re *Regexp) GetGroupNames() []string { + var result []string + + if re.capslist == nil { + result = make([]string, re.capsize) + + for i := 0; i < len(result); i++ { + result[i] = strconv.Itoa(i) + } + } else { + result = make([]string, len(re.capslist)) + copy(result, re.capslist) + } + + return result +} + +// GetGroupNumbers returns the integer group numbers corresponding to a group name. +func (re *Regexp) GetGroupNumbers() []int { + var result []int + + if re.caps == nil { + result = make([]int, re.capsize) + + for i := 0; i < len(result); i++ { + result[i] = i + } + } else { + result = make([]int, len(re.caps)) + + for k, v := range re.caps { + result[v] = k + } + } + + return result +} + +// GroupNameFromNumber retrieves a group name that corresponds to a group number. +// It will return "" for an unknown group number. Unnamed groups automatically +// receive a name that is the decimal string equivalent of its number, except in +// ECMAScript mode where unnamed groups have no name. +func (re *Regexp) GroupNameFromNumber(i int) string { + if re.capslist == nil { + if i >= 0 && i < re.capsize { + return strconv.Itoa(i) + } + + return "" + } + + if re.caps != nil { + var ok bool + if i, ok = re.caps[i]; !ok { + return "" + } + } + + if i >= 0 && i < len(re.capslist) { + return re.capslist[i] + } + + return "" +} + +// groupNameFromSlot returns the name of the group stored in capture slot i. +// The slot differs from the group number when explicit numbers leave gaps. +func (re *Regexp) groupNameFromSlot(i int) string { + if re.caps == nil { + return re.GroupNameFromNumber(i) + } + + if i >= 0 && i < len(re.capslist) { + return re.capslist[i] + } + + return "" +} + +// GroupNumberFromName returns a group number that corresponds to a group name. +// Returns -1 if the name is not a recognized group name. Numbered groups +// automatically get a group name that is the decimal string equivalent of its +// number, except in ECMAScript mode where unnamed groups have no name. +// For a name shared by multiple ECMAScript groups, it returns the number of +// the first declaration, which may differ from the group selected by GroupByName. +// This first-declaration lookup is regexp2's API policy. +func (re *Regexp) GroupNumberFromName(name string) int { + // look up name if we have a hashtable of names + if re.capnames != nil { + if k, ok := re.capnames[name]; ok { + return k + } + + return -1 + } + + // Parse the decimal name without allowing empty input or integer overflow. + result, err := strconv.ParseUint(name, 10, 64) + if err == nil && result < uint64(re.capsize) { + return int(result) + } + + return -1 +} + +// MarshalText implements [encoding.TextMarshaler]. The output +// matches that of calling the [Regexp.String] method. +func (re *Regexp) MarshalText() ([]byte, error) { + return []byte(re.String()), nil +} + +// UnmarshalText implements [encoding.TextUnmarshaler] by calling +// [Compile] on the encoded value. +func (re *Regexp) UnmarshalText(text []byte) error { + newRE, err := Compile(string(text), DefaultUnmarshalOptions) + if err != nil { + return err + } + *re = *newRE + return nil +} + +// initCaptureNames builds immutable duplicate-name mappings during construction, +// before the compiled or registered regexp is shared. +func (re *Regexp) initCaptureNames() { + if re.options&ECMAScript != 0 { + for slot, name := range re.capslist { + if name == "" { + continue + } + firstNumber, ok := re.capnames[name] + if !ok { + continue + } + first := firstNumber + if re.caps != nil { + first = re.caps[firstNumber] + } + if slot != first { + if re.duplicateCapnames == nil { + re.duplicateCapnames = make(map[string][]int) + } + if re.duplicateCapnames[name] == nil { + re.duplicateCapnames[name] = []int{first} + } + re.duplicateCapnames[name] = append(re.duplicateCapnames[name], slot) + } + } + // Replacements use public numbers; name lookup uses dense slots. + // Both are immutable after initialization and can share storage when + // the public numbering is already dense. + re.duplicateGroupNumbers = re.duplicateCapnames + if len(re.duplicateCapnames) > 0 && re.caps != nil { + numbers := make([]int, re.capsize) + for number, slot := range re.caps { + numbers[slot] = number + } + re.duplicateGroupNumbers = make(map[string][]int, len(re.duplicateCapnames)) + for name, slots := range re.duplicateCapnames { + groups := make([]int, len(slots)) + for i, slot := range slots { + groups[i] = numbers[slot] + } + re.duplicateGroupNumbers[name] = groups + } + } + } +} + +func (re *Regexp) initCaches() { + re.runnerPool = &sync.Pool{ + New: func() any { + return &Runner{ + re: re, + code: re.code, + } + }, + } + if re.optimizations.MaxCachedReplacerDataEntries > 0 { + re.replaceCache = newReplacerDataCache(re.optimizations.MaxCachedReplacerDataEntries) + } +} + +type replacerDataCache struct { + mu sync.Mutex + maxSize int + ll *list.List + cache map[string]*list.Element +} + +type replacerDataCacheEntry struct { + key string + data *syntax.ReplacerData +} + +func newReplacerDataCache(maxSize int) *replacerDataCache { + return &replacerDataCache{ + maxSize: maxSize, + ll: list.New(), + cache: make(map[string]*list.Element), + } +} + +func (c *replacerDataCache) get(key string) (*syntax.ReplacerData, bool) { + c.mu.Lock() + defer c.mu.Unlock() + + if ele, ok := c.cache[key]; ok { + c.ll.MoveToFront(ele) + return ele.Value.(*replacerDataCacheEntry).data, true + } + return nil, false +} + +func (c *replacerDataCache) add(key string, data *syntax.ReplacerData) { + c.mu.Lock() + defer c.mu.Unlock() + + if ele, ok := c.cache[key]; ok { + ele.Value.(*replacerDataCacheEntry).data = data + c.ll.MoveToFront(ele) + return + } + + ele := c.ll.PushFront(&replacerDataCacheEntry{key: key, data: data}) + c.cache[key] = ele + if c.maxSize > 0 && c.ll.Len() > c.maxSize { + oldest := c.ll.Back() + if oldest != nil { + c.ll.Remove(oldest) + delete(c.cache, oldest.Value.(*replacerDataCacheEntry).key) + } + } +} diff --git a/vendor/github.com/dlclark/regexp2/v2/regexp_codegen.go b/vendor/github.com/dlclark/regexp2/v2/regexp_codegen.go new file mode 100644 index 000000000..b5628dabe --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/regexp_codegen.go @@ -0,0 +1,88 @@ +package regexp2 + +import ( + "sync" +) + +type RuntimeEngineData struct { + Caps map[int]int // capnum->index + CapNames map[string]int // cap group name -> index + CapsList []string // sorted list of capture group names + CapSize int // size of the capture array + FindFirstChar func(*Runner) bool // generated candidate search + Execute func(*Runner) error + ExecuteQuick func(*Runner) error // optional bool-only execution with unobservable captures removed + StringPrefixFilter StringPrefixFilter // optional pre-decode candidate search for string input + // LeftContextKnown reports that LeftContextRunes was computed by the + // code generator. If it is false, decoded string input is never sliced; + // older generated engines omit the field and must keep the full string. + LeftContextKnown bool + // LeftContextRunes is how many runes before a candidate start matching + // may inspect. 0 means none, 1 means a single previous rune, and -1 + // means do not slice (lookbehind or \G). Ignored unless LeftContextKnown. + LeftContextRunes int +} + +type cacheKey struct { + pattern string + opt RegexOptions + maintainCaptureOrder bool + maxBacktrackingStackSize int +} + +func RegisterEngine(pattern string, engine RuntimeEngineData, options ...CompileOption) { + c := newCompileConfig(options) + enginesMu.Lock() + engines[cacheKeyFromConfig(pattern, c)] = engine + enginesMu.Unlock() +} + +func newEngineRegexp(pattern string, c compileConfig, engine RuntimeEngineData) *Regexp { + leftContext := -1 + if engine.LeftContextKnown { + leftContext = engine.LeftContextRunes + } + re := &Regexp{ + pattern: pattern, + options: c.regexOptions, + debug: c.debug, + caps: engine.Caps, + capnames: engine.CapNames, + capslist: engine.CapsList, + capsize: engine.CapSize, + MatchTimeout: DefaultMatchTimeout, + optimizations: c.optimizations, + findFirstChar: engine.FindFirstChar, + execute: engine.Execute, + executeQuick: engine.ExecuteQuick, + stringPrefixFilter: engine.StringPrefixFilter, + leftContextRunes: leftContext, + } + re.initCaptureNames() + re.initCaches() + return re +} + +func getEngineRegexp(pattern string, c compileConfig) *Regexp { + enginesMu.RLock() + engine, ok := engines[cacheKeyFromConfig(pattern, c)] + enginesMu.RUnlock() + if !ok { + return nil + } + return newEngineRegexp(pattern, c, engine) +} + +func cacheKeyFromConfig(pattern string, c compileConfig) cacheKey { + return cacheKey{ + pattern: pattern, + opt: c.regexOptions, + maintainCaptureOrder: c.maintainCaptureOrder, + maxBacktrackingStackSize: c.optimizations.MaxBacktrackingStackSize, + } +} + +var ( + enginesMu sync.RWMutex + engines = map[cacheKey]RuntimeEngineData{} +) diff --git a/vendor/github.com/dlclark/regexp2/v2/replace.go b/vendor/github.com/dlclark/regexp2/v2/replace.go new file mode 100644 index 000000000..a4aa2dc8b --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/replace.go @@ -0,0 +1,383 @@ +package regexp2 + +import ( + "bytes" + "errors" + + "github.com/dlclark/regexp2/v2/helpers" + "github.com/dlclark/regexp2/v2/syntax" +) + +const ( + replaceSpecials = 4 + replaceLeftPortion = -1 + replaceRightPortion = -2 + replaceLastGroup = -3 + replaceWholeString = -4 +) + +// MatchEvaluator is a function that takes a match and returns a replacement string to be used +type MatchEvaluator func(Match) string + +// Three very similar algorithms appear below: replace (pattern), +// replace (evaluator), and split. + +func writeRunes(buf *bytes.Buffer, text []rune, start, end int) { + for i := start; i < end; i++ { + buf.WriteRune(text[i]) + } +} + +func writeUnmatched(buf *bytes.Buffer, input string, d *decodedInput, start, end int) { + // Equal byte/rune lengths can include invalid UTF-8, which must be re-encoded. + if d.ascii { + buf.WriteString(input[start:end]) + } else { + writeRunes(buf, d.runes, start, end) + } +} + +func compactBalancedMatches(m *Match) { + for cap := 0; cap < len(m.matchcount); cap++ { + limit := m.matchcount[cap] * 2 + matcharray := m.matches[cap] + + var i, j int + for i = 0; i < limit; i++ { + if matcharray[i] < 0 { + break + } + } + + for j = i; i < limit; i++ { + if matcharray[i] < 0 { + j-- + } else { + if i != j { + matcharray[j] = matcharray[i] + } + j++ + } + } + + m.matchcount[cap] = j / 2 + } + m.balancing = false +} + +// Replace Replaces all occurrences of the regex in the string with the +// replacement pattern. +// +// Note that the special case of no matches is handled on its own: +// with no matches, the input string is returned unchanged. +// The right-to-left case is split out because StringBuilder +// doesn't handle right-to-left string building directly very well. +func replace(regex *Regexp, data *syntax.ReplacerData, evaluator MatchEvaluator, input string, startAt, count int) (string, error) { + if count < -1 { + return "", errors.New("count too small") + } + if count == 0 { + return input, nil + } + + if evaluator == nil { + if !regex.RightToLeft() { + return replaceRunnerLTR(regex, data, input, startAt, count) + } + return replaceRunnerRTL(regex, data, input, startAt, count) + } + + m, err := regex.FindStringMatchStartingAt(input, startAt) + + if err != nil { + return "", err + } + if m == nil { + return input, nil + } + + buf := &bytes.Buffer{} + + if !regex.RightToLeft() { + prevat := 0 + for m != nil { + start, end := matchInputSpan(m) + if start > prevat { + buf.WriteString(input[prevat:start]) + } + prevat = end + buf.WriteString(evaluator(*m)) + + count-- + if count == 0 { + break + } + m, err = regex.FindNextMatch(m) + if err != nil { + return "", err + } + } + + if prevat < len(input) { + buf.WriteString(input[prevat:]) + } + } else { + prevat := len(input) + var al []string + + for m != nil { + start, end := matchInputSpan(m) + if end < prevat { + al = append(al, input[end:prevat]) + } + prevat = start + al = append(al, evaluator(*m)) + + count-- + if count == 0 { + break + } + m, err = regex.FindNextMatch(m) + if err != nil { + return "", err + } + } + + if prevat > 0 { + buf.WriteString(input[:prevat]) + } + + for i := len(al) - 1; i >= 0; i-- { + buf.WriteString(al[i]) + } + } + + return buf.String(), nil +} + +// matchInputSpan returns the UTF-8 byte range of m in its original string input. +func matchInputSpan(m *Match) (start, end int) { + if m.text != nil && m.text.hasStringInput { + start, length := m.ByteRange() + return start, start + length + } + return m.RuneIndex, m.RuneIndex + m.RuneLength +} + +func replaceRunnerLTR(regex *Regexp, data *syntax.ReplacerData, input string, startAt, count int) (string, error) { + if startAt > len(input) { + return "", errors.New("startAt must be less than the length of the input string") + } + // Short inputs are cheaper to decode directly. For longer inputs, validate + // startAt before rejecting a miss. Keep the original scan start: anchors + // and replacement rules may need context before the candidate. + if len(input) >= helpers.ASCIISearchMin { + if _, ok, err := regex.findStringMatchStart(input, startAt); err != nil { + return "", err + } else if !ok { + return input, nil + } + } + + runner := regex.getRunner() + d := decodeInput(input, startAt, 0, regex.optimizations.MaxCachedRuneBufferLength) + text := d.runes + textInfo := runner.stringMatchText(input, text, 0, 0) + defer func() { + regex.putRunner(runner) + d.release() + }() + runeStart := d.runeStart + if startAt >= 0 && runeStart < 0 { + return "", errors.New("startAt must align to the start of a valid rune in the input string") + } + if runeStart < 0 { + runeStart = 0 + } + + m, err := runner.scan(text, textInfo, runeStart, runeStart, -1, scanCaptures, regex.MatchTimeout) + if err != nil { + return "", err + } + if m == nil { + return input, nil + } + + buf, pooledBuf := getPooledReplaceBuffer(len(input), regex.optimizations.MaxCachedReplaceBufferLength) + if pooledBuf != nil { + defer putPooledReplaceBuffer(buf, pooledBuf) + } + + prevat := 0 + for m != nil { + if m.balancing { + compactBalancedMatches(m) + } + + local := m.runeSliceIndex() + if local != prevat { + writeUnmatched(buf, input, &d, prevat, local) + } + prevat = local + m.RuneLength + replacementImpl(data, buf, m) + + count-- + if count == 0 { + break + } + + m, err = runner.scan(text, textInfo, m.textpos, m.textpos, m.RuneLength, scanCaptures, regex.MatchTimeout) + if err != nil { + return "", err + } + } + + if prevat < len(text) { + writeUnmatched(buf, input, &d, prevat, len(text)) + } + return buf.String(), nil +} + +func replaceRunnerRTL(regex *Regexp, data *syntax.ReplacerData, input string, startAt, count int) (string, error) { + if startAt > len(input) { + return "", errors.New("startAt must be less than the length of the input string") + } + + runner := regex.getRunner() + d := decodeInput(input, startAt, 0, regex.optimizations.MaxCachedRuneBufferLength) + text := d.runes + textInfo := runner.stringMatchText(input, text, 0, 0) + defer func() { + regex.putRunner(runner) + d.release() + }() + runeStart := d.runeStart + if startAt >= 0 && runeStart < 0 { + return "", errors.New("startAt must align to the start of a valid rune in the input string") + } + if runeStart < 0 { + runeStart = len(text) + } + + m, err := runner.scan(text, textInfo, runeStart, runeStart, -1, scanCaptures, regex.MatchTimeout) + if err != nil { + return "", err + } + if m == nil { + return input, nil + } + + buf, pooledBuf := getPooledReplaceBuffer(len(input), regex.optimizations.MaxCachedReplaceBufferLength) + if pooledBuf != nil { + defer putPooledReplaceBuffer(buf, pooledBuf) + } + + prevat := len(text) + var al []string + + for m != nil { + if m.balancing { + compactBalancedMatches(m) + } + + local := m.runeSliceIndex() + if local+m.RuneLength != prevat { + // As in writeUnmatched, only ASCII permits copying original bytes. + if d.ascii { + al = append(al, input[local+m.RuneLength:prevat]) + } else { + al = append(al, string(text[local+m.RuneLength:prevat])) + } + } + prevat = local + replacementImplRTL(data, &al, m) + + count-- + if count == 0 { + break + } + + m, err = runner.scan(text, textInfo, m.textpos, m.textpos, m.RuneLength, scanCaptures, regex.MatchTimeout) + if err != nil { + return "", err + } + } + + if prevat > 0 { + writeUnmatched(buf, input, &d, 0, prevat) + } + for i := len(al) - 1; i >= 0; i-- { + buf.WriteString(al[i]) + } + return buf.String(), nil +} + +// Given a Match, emits into the StringBuilder the evaluated +// substitution pattern. +func replacementImpl(data *syntax.ReplacerData, buf *bytes.Buffer, m *Match) { + for _, r := range data.Rules { + + if r >= 0 { // string lookup + buf.WriteString(data.Strings[r]) + } else if r < -replaceSpecials { // group lookup + m.groupValueAppendToBuf(-replaceSpecials-1-r, buf) + } else { + switch -replaceSpecials - 1 - r { // special insertion patterns + case replaceLeftPortion: + end := m.runeSliceIndex() + for i := 0; i < end; i++ { + buf.WriteRune(m.text.runes[i]) + } + case replaceRightPortion: + for i := m.runeSliceIndex() + m.RuneLength; i < len(m.text.runes); i++ { + buf.WriteRune(m.text.runes[i]) + } + case replaceLastGroup: + m.groupValueAppendToBuf(m.GroupCount()-1, buf) + case replaceWholeString: + for i := 0; i < len(m.text.runes); i++ { + buf.WriteRune(m.text.runes[i]) + } + } + } + } +} + +func replacementImplRTL(data *syntax.ReplacerData, al *[]string, m *Match) { + l := *al + buf := &bytes.Buffer{} + + // The caller reverses the complete segment list, so emit each + // replacement's fragments in reverse order as well. + for i := len(data.Rules) - 1; i >= 0; i-- { + r := data.Rules[i] + buf.Reset() + if r >= 0 { // string lookup + l = append(l, data.Strings[r]) + } else if r < -replaceSpecials { // group lookup + m.groupValueAppendToBuf(-replaceSpecials-1-r, buf) + l = append(l, buf.String()) + } else { + switch -replaceSpecials - 1 - r { // special insertion patterns + case replaceLeftPortion: + end := m.runeSliceIndex() + for i := 0; i < end; i++ { + buf.WriteRune(m.text.runes[i]) + } + case replaceRightPortion: + for i := m.runeSliceIndex() + m.RuneLength; i < len(m.text.runes); i++ { + buf.WriteRune(m.text.runes[i]) + } + case replaceLastGroup: + m.groupValueAppendToBuf(m.GroupCount()-1, buf) + case replaceWholeString: + for i := 0; i < len(m.text.runes); i++ { + buf.WriteRune(m.text.runes[i]) + } + } + l = append(l, buf.String()) + } + } + + *al = l +} diff --git a/vendor/github.com/dlclark/regexp2/v2/runner.go b/vendor/github.com/dlclark/regexp2/v2/runner.go new file mode 100644 index 000000000..3d9865146 --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/runner.go @@ -0,0 +1,2710 @@ +package regexp2 + +import ( + "bytes" + "fmt" + "math" + "slices" + "strconv" + "strings" + "time" + "unicode" + + "github.com/dlclark/regexp2/v2/helpers" + "github.com/dlclark/regexp2/v2/syntax" +) + +type Runner struct { + re *Regexp + code *syntax.Code + + // Keep the byte-sized flags together to avoid padding between word-sized fields. + debug bool + ignoreTimeout bool + rightToLeft bool + caseInsensitive bool + + Runtextstart int // starting point for search + + Runtext []rune // text to search + Runtextpos int // current position in text + Runtextend int + + // The backtracking stack. Opcodes use this to store data regarding + // what they have matched and where to backtrack to. Each "frame" on + // the stack takes the form of [CodePosition Data1 Data2...], where + // CodePosition is the position of the current opcode and + // the data values are all optional. The CodePosition can be negative, and + // these values (also called "back2") are used by the BranchMark family of opcodes + // to indicate whether they are backtracking after a successful or failed + // match. + // When we backtrack, we pop the CodePosition off the stack, set the current + // instruction pointer to that code position, and mark the opcode + // with a backtracking flag ("Back"). Each opcode then knows how to + // handle its own data. + runtrack []int + Runtrackpos int + + // This stack is used to track text positions across different opcodes. + // For example, in /(a*b)+/, the parentheses result in a SetMark/CaptureMark + // pair. SetMark records the text position before we match a*b. Then + // CaptureMark uses that position to figure out where the capture starts. + // Opcodes which push onto this stack are always paired with other opcodes + // which will pop the value from it later. A successful match should mean + // that this stack is empty. + runstack []int + Runstackpos int + + // The crawl stack is used to keep track of captures. Every time a group + // has a capture, we push its group number onto the runcrawl stack. In + // the case of a balanced match, we push BOTH groups onto the stack. + runcrawl []int + runcrawlpos int + + runtrackcount int // count of states that may do backtracking + + runmatch *Match // result object + // Reusable metadata for internal string scans. Returned matches own theirs. + textInfo *matchText + + timeout time.Duration // timeout in milliseconds (needed for actual) + deadline fasttime + + operator syntax.InstOp + codepos int + + // landmarkCore and landmarkCandidate come from the last required landmark + // chain search in this scan, and landmarkCore is -1 before it. A search + // from a later position up to landmarkCore would return the larger of that + // position and landmarkCandidate. + landmarkCore int + landmarkCandidate int + // landmarks holds what the required landmark searches learned about + // Runtext. Scans of the same Runtext between getRunner and putRunner + // start where earlier ones ended, so they keep it. FindNextMatch moves it + // to the match it returns and back. + landmarks *requiredLandmarkState +} + +// scanMode controls capture elision and ownership independently of text metadata. +type scanMode uint8 + +const ( + // scanBounds may elide unobserved captures and keeps the match in the runner. + scanBounds scanMode = iota + // scanCaptures records all captures and keeps the match in the runner. + scanCaptures + // scanFullMatch records all captures and returns an independently owned match. + scanFullMatch +) + +// run starts a search on rune input. +// +// mode selects bounds-only, borrowed-capture, or independently owned results. +// textstart is -1 to start at the "beginning" (depending on Right-To-Left), otherwise an index in input. +func (re *Regexp) run(mode scanMode, textstart int, input []rune) (*Match, error) { + + // get a cached runner + runner := re.getRunner() + defer re.putRunner(runner) + + if textstart < 0 { + if re.RightToLeft() { + textstart = len(input) + } else { + textstart = 0 + } + } + if mode == scanBounds && re.quickCode != nil { + runner.code = re.quickCode + } + + return runner.scan(input, nil, textstart, textstart, -1, mode, re.MatchTimeout) +} + +// scan starts at candidate while preserving textstart for \G. Both are rune +// indexes in rt. A nil textInfo defers rune input metadata until a match is returned +// and allows borrowed scans to omit it entirely. +func (r *Runner) scan(rt []rune, textInfo *matchText, textstart, candidate, previousMatchLength int, mode scanMode, timeout time.Duration) (*Match, error) { + r.timeout = timeout + r.ignoreTimeout = (time.Duration(math.MaxInt64) == timeout) + r.debug = r.re.Debug() + r.Runtextstart = textstart + // putRunner clears Runtext, so another call keeps landmarks only if + // FindNextMatch sets them. + if r.landmarks != nil && (len(r.Runtext) != len(rt) || len(rt) == 0 || &r.Runtext[0] != &rt[0]) { + r.resetRequiredLandmarkSearches() + } + r.Runtext = rt + r.Runtextend = len(rt) + + stoppos := r.Runtextend + bump := 1 + + if r.re.RightToLeft() { + bump = -1 + stoppos = 0 + } + + r.Runtextpos = candidate + r.landmarkCore = -1 + + // setup our scanner functions + findFirstChar := r.re.findFirstChar + execute := r.re.execute + if mode == scanBounds && r.re.executeQuick != nil { + execute = r.re.executeQuick + } + if execute == nil { + execute = executeDefault + } + + minRequiredLength := 0 + if r.code != nil && r.code.FindOptimizations != nil { + minRequiredLength = r.code.FindOptimizations.MinRequiredLength + } + + r.initMatch(textInfo) + + // An empty previous match must not be returned again. Keep Runtextstart at + // the previous match position for \G, but move the candidate scan position. + if previousMatchLength == 0 { + if r.Runtextpos == stoppos { + r.tidyMatch(scanBounds) + return nil, nil + } + r.Runtextpos += bump + } + + r.startTimeoutWatch() + for { + if minRequiredLength > 0 { + if r.code.RightToLeft { + if r.Runtextpos < minRequiredLength { + r.tidyMatch(scanBounds) + return nil, nil + } + } else if r.Runtextend-r.Runtextpos < minRequiredLength { + r.tidyMatch(scanBounds) + return nil, nil + } + } + + if r.debug { + //fmt.Printf("\nSearch content: %v\n", string(r.runtext)) + fmt.Printf("\nSearch range: from 0 to %v\n", r.Runtextend) + fmt.Printf("Firstchar search starting at %v stopping at %v\n", r.Runtextpos, stoppos) + } + + if findFirstChar(r) { + if !r.ignoreTimeout { + if err := r.CheckTimeout(); err != nil { + return nil, err + } + } + + if r.debug { + fmt.Printf("Executing engine starting at %v\n\n", r.Runtextpos) + } + + if err := execute(r); err != nil { + return nil, err + } + + if r.runmatch.matchcount[0] > 0 { + // We'll return a match even if it touches a previous empty match + return r.tidyMatch(mode), nil + } + + // reset state for another go + r.Runtrackpos = len(r.runtrack) + r.Runstackpos = len(r.runstack) + r.runcrawlpos = len(r.runcrawl) + } + + // failure! + + if r.Runtextpos == stoppos { + r.tidyMatch(scanBounds) + return nil, nil + } + + // Recognize leading []* and various anchors, and bump on failure accordingly + + // r.bump by one and start again + + r.Runtextpos += bump + } + // We never get here +} + +func executeDefault(r *Runner) error { + + if err := r.goTo(0); err != nil { + return err + } + for { + + if r.debug { + r.dumpState() + } + + if !r.ignoreTimeout { + if err := r.CheckTimeout(); err != nil { + return err + } + } + + switch r.operator { + case syntax.Stop: + return nil + + case syntax.Nothing: + //noop + + case syntax.Goto: + if err := r.goTo(r.operand(0)); err != nil { + return err + } + continue + + case syntax.Dispatch: + // Dispatch only peeks at the next rune. It consumes it after finding a + // matching branch, so a failed dispatch leaves the input position alone. + if r.forwardchars() < 1 { + break + } + // Pick the next rune in the current execution direction. + pos := r.Runtextpos + if r.rightToLeft { + pos-- + } + ch := r.Runtext[pos] + tableIndex := r.operand(0) + table := &r.code.Dispatches[tableIndex] + branch := -1 + if ch >= 0 && ch < 128 { + if table.ASCII != nil { + // Larger dispatches use a direct ASCII branch lookup. + branch = int(table.ASCII[ch]) - 1 + } else { + // Smaller dispatches use two compact ASCII bitmasks per set. + word := int(ch >> 6) + bit := uint64(1) << (ch & 63) + for i := range table.Sets { + if table.ASCIIMasks[i*2+word]&bit != 0 { + branch = i + break + } + } + } + } else { + // Non-ASCII runes fall back to the complete character sets. + for i, setIndex := range table.Sets { + if r.code.Sets[setIndex].Contains(ch) { + branch = i + break + } + } + } + if branch < 0 { + break + } + // The selected branch starts with this rune, so consume it and jump + // directly to the rest of that branch. + r.Runtextpos += r.bump() + if err := r.goTo(table.Branches[branch]); err != nil { + return err + } + continue + + case syntax.Testref: + if !r.runmatch.isMatched(r.operand(0)) { + break + } + r.advance(1) + continue + + case syntax.Lazybranch: + r.trackPush1(r.textPos()) + r.advance(1) + continue + + case syntax.Lazybranch | syntax.Back: + r.trackPop() + r.textto(r.trackPeek()) + if err := r.goTo(r.operand(0)); err != nil { + return err + } + continue + + case syntax.Setmark: + r.stackPush(r.textPos()) + r.trackPush() + r.advance(0) + continue + + case syntax.Nullmark: + r.stackPush(-1) + r.trackPush() + r.advance(0) + continue + + case syntax.Setmark | syntax.Back, syntax.Nullmark | syntax.Back: + r.stackPop() + + case syntax.Getmark: + r.stackPop() + r.trackPush1(r.stackPeek()) + r.textto(r.stackPeek()) + r.advance(0) + continue + + case syntax.Getmark | syntax.Back: + r.trackPop() + r.stackPush(r.trackPeek()) + + case syntax.Capturemark: + if r.operand(1) != -1 && !r.runmatch.isMatched(r.operand(1)) { + break + } + r.stackPop() + if r.operand(1) != -1 { + r.transferCapture(r.operand(0), r.operand(1), r.stackPeek(), r.textPos()) + } else { + r.Capture(r.operand(0), r.stackPeek(), r.textPos()) + } + r.trackPush1(r.stackPeek()) + + r.advance(2) + + continue + + case syntax.Capturemark | syntax.Back: + r.trackPop() + r.stackPush(r.trackPeek()) + r.uncapture() + if r.operand(0) != -1 && r.operand(1) != -1 { + r.uncapture() + } + + case syntax.Branchmark: + r.stackPop() + + matched := r.textPos() - r.stackPeek() + + if matched != 0 { // Nonempty match -> loop now + r.trackPush2(r.stackPeek(), r.textPos()) // Save old mark, textpos + r.stackPush(r.textPos()) // Make new mark + if err := r.goTo(r.operand(0)); err != nil { // Loop + return err + } + } else { // Empty match -> straight now + r.trackPushNeg1(r.stackPeek()) // Save old mark + r.advance(1) // Straight + } + continue + + case syntax.Branchmark | syntax.Back: + r.trackPopN(2) + r.stackPop() + r.textto(r.trackPeekN(1)) // Recall position + r.trackPushNeg1(r.trackPeek()) // Save old mark + r.advance(1) // Straight + continue + + case syntax.Branchmark | syntax.Back2: + r.trackPop() + r.stackPush(r.trackPeek()) // Recall old mark + // Backtrack + + case syntax.Lazybranchmark: + { + // We hit this the first time through a lazy loop and after each + // successful match of the inner expression. It simply continues + // on and doesn't loop. + r.stackPop() + + oldMarkPos := r.stackPeek() + + if r.textPos() != oldMarkPos { // Nonempty match -> try to loop again by going to 'back' state + if oldMarkPos != -1 { + r.trackPush2(oldMarkPos, r.textPos()) // Save old mark, textpos + } else { + r.trackPush2(r.textPos(), r.textPos()) + } + } else { + // The inner expression found an empty match, so we'll go directly to 'back2' if we + // backtrack. Don't touch the grouping stack here; instead, record the old mark and + // a flag indicating that backtracking doesn't need to pop a grouping stack frame. + r.trackPushNeg2(oldMarkPos, 0) + } + r.advance(1) + continue + } + + case syntax.Lazybranchmark | syntax.Back: + + // After the first time, Lazybranchmark | syntax.Back occurs + // with each iteration of the loop, and therefore with every attempted + // match of the inner expression. We'll try to match the inner expression, + // then go back to Lazybranchmark if successful. If the inner expression + // fails, we go to Lazybranchmark | syntax.Back2 + + r.trackPopN(2) + pos := r.trackPeekN(1) + r.trackPushNeg2(r.trackPeek(), 1) // Save old mark, note that we pushed a new mark + r.stackPush(pos) // Make new mark + r.textto(pos) // Recall position + if err := r.goTo(r.operand(0)); err != nil { // Loop + return err + } + continue + + case syntax.Lazybranchmark | syntax.Back2: + // The lazy loop has failed. We'll do a true backtrack and + // start over before the lazy loop. + r.trackPopN(2) + oldMark := r.trackPeek() + needsPop := r.trackPeekN(1) + if needsPop != 0 { + r.stackPop() + } + r.stackPush(oldMark) // Recall old mark + + case syntax.Setcount: + r.stackPush2(r.textPos(), r.operand(0)) + r.trackPush() + r.advance(1) + continue + + case syntax.Nullcount: + r.stackPush2(-1, r.operand(0)) + r.trackPush() + r.advance(1) + continue + + case syntax.Setcount | syntax.Back: + r.stackPopN(2) + + case syntax.Nullcount | syntax.Back: + r.stackPopN(2) + + case syntax.Branchcount: + // r.stackPush: + // 0: Mark + // 1: Count + + r.stackPopN(2) + mark := r.stackPeek() + count := r.stackPeekN(1) + matched := r.textPos() - mark + if matched == 0 && count > 0 && r.re.options&ECMAScript != 0 { + // ECMAScript 2025 §22.2.2.3.1 RepeatMatcher, step 2.2, + // rejects an empty iteration once no required repeats remain. + // Fail the iteration so its captures are undone and any remaining + // alternatives in the body can still be tried. + // https://tc39.es/ecma262/2025/multipage/text-processing.html#sec-repeatmatcher + r.stackPush2(mark, count) + break + } + + if count >= r.operand(1) || (matched == 0 && count >= 0 && r.re.options&ECMAScript == 0) { // Max loops or empty match -> straight now + r.trackPushNeg2(mark, count) // Save old mark, count + r.advance(2) // Straight + } else { // Nonempty match -> count+loop now + r.trackPush1(mark) // remember mark + r.stackPush2(r.textPos(), count+1) // Make new mark, incr count + if err := r.goTo(r.operand(0)); err != nil { // Loop + return err + } + } + continue + + case syntax.Branchcount | syntax.Back: + // r.trackPush: + // 0: Previous mark + // r.stackPush: + // 0: Mark (= current pos, discarded) + // 1: Count + r.trackPop() + r.stackPopN(2) + if r.stackPeekN(1) > 0 { // Positive -> can go straight + r.textto(r.stackPeek()) // Zap to mark + r.trackPushNeg2(r.trackPeek(), r.stackPeekN(1)-1) // Save old mark, old count + r.advance(2) // Straight + continue + } + r.stackPush2(r.trackPeek(), r.stackPeekN(1)-1) // recall old mark, old count + + case syntax.Branchcount | syntax.Back2: + // r.trackPush: + // 0: Previous mark + // 1: Previous count + r.trackPopN(2) + r.stackPush2(r.trackPeek(), r.trackPeekN(1)) // Recall old mark, old count + + case syntax.Lazybranchcount: + // r.stackPush: + // 0: Mark + // 1: Count + + r.stackPopN(2) + mark := r.stackPeek() + count := r.stackPeekN(1) + if r.textPos() == mark && count > 0 && r.re.options&ECMAScript != 0 { + // RepeatMatcher step 2.2 applies to lazy quantifiers too. + r.stackPush2(mark, count) + break + } + + if count < 0 { // Negative count -> loop now + r.trackPushNeg1(mark) // Save old mark + r.stackPush2(r.textPos(), count+1) // Make new mark, incr count + if err := r.goTo(r.operand(0)); err != nil { // Loop + return err + } + } else { // Nonneg count -> straight now + r.trackPush3(mark, count, r.textPos()) // Save mark, count, position + r.advance(2) // Straight + } + continue + + case syntax.Lazybranchcount | syntax.Back: + // r.trackPush: + // 0: Mark + // 1: Count + // 2: r.textPos + + r.trackPopN(3) + mark := r.trackPeek() + textpos := r.trackPeekN(2) + + // RepeatMatcher permits a required empty iteration, then tries + // another iteration; step 2.2 rejects it only if it is also empty. + if r.trackPeekN(1) < r.operand(1) && (textpos != mark || (r.trackPeekN(1) == 0 && r.re.options&ECMAScript != 0)) { // Under limit and another iteration is permitted + r.textto(textpos) // Recall position + r.stackPush2(textpos, r.trackPeekN(1)+1) // Make new mark, incr count + r.trackPushNeg1(mark) // Save old mark + if err := r.goTo(r.operand(0)); err != nil { // Loop + return err + } + continue + } else { // Max loops or empty match -> backtrack + r.stackPush2(r.trackPeek(), r.trackPeekN(1)) // Recall old mark, count + // backtrack + } + + case syntax.Lazybranchcount | syntax.Back2: + // r.trackPush: + // 0: Previous mark + // r.stackPush: + // 0: Mark (== current pos, discarded) + // 1: Count + r.trackPop() + r.stackPopN(2) + r.stackPush2(r.trackPeek(), r.stackPeekN(1)-1) // Recall old mark, count + // Backtrack + + case syntax.Setjump: + r.stackPush2(r.trackpos(), r.Crawlpos()) + r.trackPush() + r.advance(0) + continue + + case syntax.Setjump | syntax.Back: + r.stackPopN(2) + + case syntax.Backjump: + // r.stackPush: + // 0: Saved trackpos + // 1: r.crawlpos + r.stackPopN(2) + r.trackto(r.stackPeek()) + + for r.Crawlpos() != r.stackPeekN(1) { + r.uncapture() + } + + case syntax.Forejump: + // r.stackPush: + // 0: Saved trackpos + // 1: r.crawlpos + r.stackPopN(2) + r.trackto(r.stackPeek()) + r.trackPush1(r.stackPeekN(1)) + r.advance(0) + continue + + case syntax.Forejump | syntax.Back: + // r.trackPush: + // 0: r.crawlpos + r.trackPop() + + for r.Crawlpos() != r.trackPeek() { + r.uncapture() + } + + case syntax.Bol: + if r.leftchars() > 0 && !r.isLineBreak(r.charAt(r.textPos()-1)) { + break + } + r.advance(0) + continue + + case syntax.Eol: + if r.rightchars() > 0 && !r.isLineBreak(r.charAt(r.textPos())) { + break + } + r.advance(0) + continue + + case syntax.Boundary: + if !r.IsBoundary(r.textPos()) { + break + } + r.advance(0) + continue + + case syntax.Nonboundary: + if r.IsBoundary(r.textPos()) { + break + } + r.advance(0) + continue + + case syntax.ECMABoundary: + if !r.IsECMABoundaryWithOptions(r.textPos(), r.ecmaBoundaryOptions()) { + break + } + r.advance(0) + continue + + case syntax.NonECMABoundary: + if r.IsECMABoundaryWithOptions(r.textPos(), r.ecmaBoundaryOptions()) { + break + } + r.advance(0) + continue + + case syntax.Beginning: + if r.leftchars() > 0 { + break + } + r.advance(0) + continue + + case syntax.Start: + if r.textPos() != r.textstart() { + break + } + r.advance(0) + continue + + case syntax.EndZ: + rchars := r.rightchars() + if rchars > 1 { + break + } + // RE2 and EcmaScript define $ as "asserts position at the end of the string" + // PCRE/.NET adds "or before the line terminator right at the end of the string (if any)" + if (r.re.options & (RE2 | ECMAScript)) != 0 { + // RE2/Ecmascript mode + if rchars > 0 { + break + } + } else if rchars == 1 && r.charAt(r.textPos()) != '\n' { + // "regular" mode + break + } + + r.advance(0) + continue + + case syntax.End: + if r.rightchars() > 0 { + break + } + r.advance(0) + continue + + case syntax.One: + if r.forwardchars() < 1 || r.forwardcharnext() != rune(r.operand(0)) { + break + } + + r.advance(1) + continue + + case syntax.Notone: + if r.forwardchars() < 1 || r.forwardcharnext() == rune(r.operand(0)) { + break + } + + r.advance(1) + continue + + case syntax.Set: + + if r.forwardchars() < 1 || !r.code.Sets[r.operand(0)].Contains(r.forwardcharnext()) { + break + } + + r.advance(1) + continue + + case syntax.Multi: + if !r.runematch(r.code.Strings[r.operand(0)]) { + break + } + + r.advance(1) + continue + + case syntax.Grapheme: + if !r.TryMatchGrapheme(r.rightToLeft) { + break + } + r.advance(0) + continue + + case syntax.Ref: + + capnum := r.operand(0) + + if r.runmatch.isMatched(capnum) { + if !r.refmatch(r.runmatch.matchIndex(capnum), r.runmatch.matchLength(capnum)) { + break + } + } else { + if (r.re.options & ECMAScript) == 0 { + break + } + } + + r.advance(1) + continue + + case syntax.Onerep: + + c := r.operand(1) + + if r.forwardchars() < c { + break + } + + ch := rune(r.operand(0)) + + for c > 0 { + if r.forwardcharnext() != ch { + goto BreakBackward + } + c-- + } + + r.advance(2) + continue + + case syntax.Notonerep: + + c := r.operand(1) + + if r.forwardchars() < c { + break + } + ch := rune(r.operand(0)) + + for c > 0 { + if r.forwardcharnext() == ch { + goto BreakBackward + } + c-- + } + + r.advance(2) + continue + + case syntax.Setrep: + + c := r.operand(1) + + if r.forwardchars() < c { + break + } + + set := r.code.Sets[r.operand(0)] + + for c > 0 { + if !set.Contains(r.forwardcharnext()) { + goto BreakBackward + } + c-- + } + + r.advance(2) + continue + + case syntax.Oneloop, syntax.Oneloopatomic: + + c := r.operand(1) + + if c > r.forwardchars() { + c = r.forwardchars() + } + + ch := rune(r.operand(0)) + i := c + + for ; i > 0; i-- { + if r.forwardcharnext() != ch { + r.backwardnext() + break + } + } + + if c > i && r.operator == syntax.Oneloop { + r.trackPush2(c-i-1, r.textPos()-r.bump()) + } + + r.advance(2) + continue + + case syntax.Notoneloop, syntax.Notoneloopatomic: + + c := r.operand(1) + + if c > r.forwardchars() { + c = r.forwardchars() + } + + ch := rune(r.operand(0)) + i := c + + for ; i > 0; i-- { + if r.forwardcharnext() == ch { + r.backwardnext() + break + } + } + + if c > i && r.operator == syntax.Notoneloop { + r.trackPush2(c-i-1, r.textPos()-r.bump()) + } + + r.advance(2) + continue + + case syntax.Setloop, syntax.Setloopatomic: + + c := r.operand(1) + + if c > r.forwardchars() { + c = r.forwardchars() + } + + set := r.code.Sets[r.operand(0)] + i := c + + for ; i > 0; i-- { + if !set.Contains(r.forwardcharnext()) { + r.backwardnext() + break + } + } + + if c > i && r.operator == syntax.Setloop { + r.trackPush2(c-i-1, r.textPos()-r.bump()) + } + + r.advance(2) + continue + + case syntax.Oneloop | syntax.Back, syntax.Notoneloop | syntax.Back: + + r.trackPopN(2) + i := r.trackPeek() + pos := r.trackPeekN(1) + + r.textto(pos) + + if i > 0 { + r.trackPush2(i-1, pos-r.bump()) + } + + r.advance(2) + continue + + case syntax.Setloop | syntax.Back: + + r.trackPopN(2) + i := r.trackPeek() + pos := r.trackPeekN(1) + + r.textto(pos) + + if i > 0 { + r.trackPush2(i-1, pos-r.bump()) + } + + r.advance(2) + continue + + case syntax.Onelazy, syntax.Notonelazy: + + c := r.operand(1) + + if c > r.forwardchars() { + c = r.forwardchars() + } + + if c > 0 { + r.trackPush2(c-1, r.textPos()) + } + + r.advance(2) + continue + + case syntax.Setlazy: + + c := r.operand(1) + + if c > r.forwardchars() { + c = r.forwardchars() + } + + if c > 0 { + r.trackPush2(c-1, r.textPos()) + } + + r.advance(2) + continue + + case syntax.Onelazy | syntax.Back: + + r.trackPopN(2) + pos := r.trackPeekN(1) + r.textto(pos) + + if r.forwardcharnext() != rune(r.operand(0)) { + break + } + + i := r.trackPeek() + + if i > 0 { + r.trackPush2(i-1, pos+r.bump()) + } + + r.advance(2) + continue + + case syntax.Notonelazy | syntax.Back: + + r.trackPopN(2) + pos := r.trackPeekN(1) + r.textto(pos) + + if r.forwardcharnext() == rune(r.operand(0)) { + break + } + + i := r.trackPeek() + + if i > 0 { + r.trackPush2(i-1, pos+r.bump()) + } + + r.advance(2) + continue + + case syntax.Setlazy | syntax.Back: + + r.trackPopN(2) + pos := r.trackPeekN(1) + r.textto(pos) + + if !r.code.Sets[r.operand(0)].Contains(r.forwardcharnext()) { + break + } + + i := r.trackPeek() + + if i > 0 { + r.trackPush2(i-1, pos+r.bump()) + } + + r.advance(2) + continue + + case syntax.UpdateBumpalong: + // UpdateBumpalong should only exist in the code stream at such a point where the root + // of the backtracking stack contains the runtextpos from the start of this Go call. Replace + // that tracking value with the current runtextpos value if it's greater. + trackingpos := r.runtrack[len(r.runtrack)-1] + if trackingpos < r.Runtextpos { + r.runtrack[len(r.runtrack)-1] = r.Runtextpos + } + r.advance(0) + continue + + default: + // Keep resets outside the main dispatch: adding them to its cases + // slows existing programs that never execute a reset instruction. + switch r.operator { + case syntax.ResetCapture: + capnum := r.operand(0) + if r.runmatch.isMatched(capnum) { + // Use the crawl stack so lookarounds and atomic groups can + // undo the reset when they unwind discarded backtracking frames. + r.crawl(capnum) + r.runmatch.balanceMatch(capnum) + r.trackPush() + } + r.advance(1) + continue + + case syntax.ResetCapture | syntax.Back: + r.uncapture() + + default: + return fmt.Errorf("unknown state in regex runner: %v", r.operator) + } + } + + BreakBackward: + ; + + // "break Backward" comes here: + if err := r.backtrack(); err != nil { + return err + } + } +} + +// increase the size of stack and track storage +func (r *Runner) ensureStorage() error { + if r.Runstackpos < r.runtrackcount*4 { + doubleIntSlice(&r.runstack, &r.Runstackpos) + } + if r.Runtrackpos < r.runtrackcount*4 && !r.growTrack() { + return ErrBacktrackingStackLimit + } + return nil +} + +func (r *Runner) ensureStack(plus int) { + if r.Runstackpos-plus < r.runtrackcount*4 { + doubleIntSlice(&r.runstack, &r.Runstackpos) + } +} + +func doubleIntSlice(s *[]int, pos *int) { + oldLen := len(*s) + newS := make([]int, oldLen*2) + + copy(newS[oldLen:], *s) + *pos += oldLen + *s = newS +} + +// Save a number on the longjump unrolling stack +func (r *Runner) crawl(i int) { + if r.runcrawlpos == 0 { + doubleIntSlice(&r.runcrawl, &r.runcrawlpos) + } + r.runcrawlpos-- + r.runcrawl[r.runcrawlpos] = i +} + +// Remove a number from the longjump unrolling stack +func (r *Runner) popcrawl() int { + val := r.runcrawl[r.runcrawlpos] + r.runcrawlpos++ + return val +} + +// Get the height of the stack +func (r *Runner) Crawlpos() int { + return len(r.runcrawl) - r.runcrawlpos +} + +func (r *Runner) advance(i int) { + r.codepos += (i + 1) + r.setOperator(r.code.Codes[r.codepos]) +} + +func (r *Runner) goTo(newpos int) error { + // when branching backward or in place, ensure storage + if newpos <= r.codepos { + if err := r.ensureStorage(); err != nil { + return err + } + } + + r.setOperator(r.code.Codes[newpos]) + r.codepos = newpos + return nil +} + +func (r *Runner) textto(newpos int) { + r.Runtextpos = newpos +} + +func (r *Runner) trackto(newpos int) { + r.Runtrackpos = len(r.runtrack) - newpos +} + +func (r *Runner) textstart() int { + return r.Runtextstart +} + +func (r *Runner) textPos() int { + return r.Runtextpos +} + +// TryMatchGrapheme consumes one Unicode extended grapheme cluster in the +// runner's current direction. It is exported for regexp2cg-generated engines. +func (r *Runner) TryMatchGrapheme(rightToLeft bool) bool { + var boundary int + if rightToLeft { + boundary = syntax.PreviousGraphemeClusterBoundary(r.Runtext, r.Runtextpos) + } else { + boundary = syntax.NextGraphemeClusterBoundary(r.Runtext, r.Runtextpos) + } + if boundary < 0 { + return false + } + r.Runtextpos = boundary + return true +} + +// push onto the backtracking stack +func (r *Runner) trackpos() int { + return len(r.runtrack) - r.Runtrackpos +} + +func (r *Runner) growTrack() bool { + oldLen := len(r.runtrack) + newLen := oldLen * 2 + if newLen == 0 { + newLen = 1 + } + if limit := r.re.optimizations.MaxBacktrackingStackSize; limit >= 0 && newLen > limit { + newLen = limit + } + if newLen <= oldLen { + return false + } + + newTrack := make([]int, newLen) + copy(newTrack[newLen-oldLen:], r.runtrack) + r.Runtrackpos += newLen - oldLen + r.runtrack = newTrack + return true +} + +func (r *Runner) trackPush() { + r.Runtrackpos-- + r.runtrack[r.Runtrackpos] = r.codepos +} + +func (r *Runner) trackPush1(I1 int) { + r.Runtrackpos-- + r.runtrack[r.Runtrackpos] = I1 + r.Runtrackpos-- + r.runtrack[r.Runtrackpos] = r.codepos +} + +func (r *Runner) trackPush2(I1, I2 int) { + r.Runtrackpos-- + r.runtrack[r.Runtrackpos] = I1 + r.Runtrackpos-- + r.runtrack[r.Runtrackpos] = I2 + r.Runtrackpos-- + r.runtrack[r.Runtrackpos] = r.codepos +} + +func (r *Runner) trackPush3(I1, I2, I3 int) { + r.Runtrackpos-- + r.runtrack[r.Runtrackpos] = I1 + r.Runtrackpos-- + r.runtrack[r.Runtrackpos] = I2 + r.Runtrackpos-- + r.runtrack[r.Runtrackpos] = I3 + r.Runtrackpos-- + r.runtrack[r.Runtrackpos] = r.codepos +} + +func (r *Runner) trackPushNeg1(I1 int) { + r.Runtrackpos-- + r.runtrack[r.Runtrackpos] = I1 + r.Runtrackpos-- + r.runtrack[r.Runtrackpos] = -r.codepos +} + +func (r *Runner) trackPushNeg2(I1, I2 int) { + r.Runtrackpos-- + r.runtrack[r.Runtrackpos] = I1 + r.Runtrackpos-- + r.runtrack[r.Runtrackpos] = I2 + r.Runtrackpos-- + r.runtrack[r.Runtrackpos] = -r.codepos +} + +func (r *Runner) backtrack() error { + newpos := r.runtrack[r.Runtrackpos] + r.Runtrackpos++ + + if r.debug { + if newpos < 0 { + fmt.Printf(" Backtracking (back2) to code position %v\n", -newpos) + } else { + fmt.Printf(" Backtracking to code position %v\n", newpos) + } + } + + if newpos < 0 { + newpos = -newpos + r.setOperator(r.code.Codes[newpos] | int(syntax.Back2)) + } else { + r.setOperator(r.code.Codes[newpos] | int(syntax.Back)) + } + + // When branching backward, ensure storage + if newpos < r.codepos { + if err := r.ensureStorage(); err != nil { + return err + } + } + + r.codepos = newpos + return nil +} + +func (r *Runner) setOperator(op int) { + r.caseInsensitive = (0 != (op & int(syntax.Ci))) + r.rightToLeft = (0 != (op & int(syntax.Rtl))) + r.operator = syntax.InstOp(op & ^int(syntax.Rtl|syntax.Ci)) +} + +func (r *Runner) trackPop() { + r.Runtrackpos++ +} + +// pop framesize items from the backtracking stack +func (r *Runner) trackPopN(framesize int) { + r.Runtrackpos += framesize +} + +// Technically we are actually peeking at items already popped. So if you want to +// get and pop the top item from the stack, you do +// r.trackPop(); +// r.trackPeek(); +func (r *Runner) trackPeek() int { + return r.runtrack[r.Runtrackpos-1] +} + +// get the ith element down on the backtracking stack +func (r *Runner) trackPeekN(i int) int { + return r.runtrack[r.Runtrackpos-i-1] +} + +// Push onto the grouping stack +func (r *Runner) stackPush(I1 int) { + r.Runstackpos-- + r.runstack[r.Runstackpos] = I1 +} + +func (r *Runner) stackPush2(I1, I2 int) { + r.Runstackpos-- + r.runstack[r.Runstackpos] = I1 + r.Runstackpos-- + r.runstack[r.Runstackpos] = I2 +} + +func (r *Runner) stackPop() { + r.Runstackpos++ +} + +// pop framesize items from the grouping stack +func (r *Runner) stackPopN(framesize int) { + r.Runstackpos += framesize +} + +// Technically we are actually peeking at items already popped. So if you want to +// get and pop the top item from the stack, you do +// r.stackPop(); +// r.stackPeek(); +func (r *Runner) stackPeek() int { + return r.runstack[r.Runstackpos-1] +} + +// get the ith element down on the grouping stack +func (r *Runner) stackPeekN(i int) int { + return r.runstack[r.Runstackpos-i-1] +} + +func (r *Runner) operand(i int) int { + return r.code.Codes[r.codepos+i+1] +} + +func (r *Runner) leftchars() int { + return r.Runtextpos +} + +func (r *Runner) rightchars() int { + return r.Runtextend - r.Runtextpos +} + +func (r *Runner) bump() int { + if r.rightToLeft { + return -1 + } + return 1 +} + +func (r *Runner) forwardchars() int { + if r.rightToLeft { + return r.Runtextpos + } + return r.Runtextend - r.Runtextpos +} + +func (r *Runner) forwardcharnext() rune { + var ch rune + if r.rightToLeft { + r.Runtextpos-- + ch = r.Runtext[r.Runtextpos] + } else { + ch = r.Runtext[r.Runtextpos] + r.Runtextpos++ + } + + // move this to compile time for individual runes + /*if r.caseInsensitive { + return unicode.ToLower(ch) + }*/ + return ch +} + +// Bound each vectorized comparison to preserve fast rejection near the end. +const runeComparisonChunkSize = 32 + +func (r *Runner) runematch(str []rune) bool { + var pos int + + c := len(str) + if !r.rightToLeft { + if r.Runtextend-r.Runtextpos < c { + return false + } + + pos = r.Runtextpos + c + } else { + if r.Runtextpos-0 < c { + return false + } + + pos = r.Runtextpos + } + + if !r.caseInsensitive { + for c > 0 { + length := min(c, runeComparisonChunkSize) + c -= length + pos -= length + if !helpers.Equals(r.Runtext, pos, length, str[c:c+length]) { + return false + } + } + } else { + for c != 0 { + c-- + pos-- + if str[c] != unicode.ToLower(r.Runtext[pos]) { + return false + } + } + } + + if !r.rightToLeft { + pos += len(str) + } + + r.Runtextpos = pos + + return true +} + +func (r *Runner) refmatch(index, length int) bool { + pos := r.Runtextpos + if r.rightToLeft { + if pos < length { + return false + } + pos -= length + } else if r.Runtextend-pos < length { + return false + } + + candidate := r.Runtext[pos : pos+length] + options := syntax.RegexOptions(r.re.options) + // Compare bounded chunks from the end, preserving fast rejection near the + // end while allowing exact spans to use vectorized slice comparisons. + for end := length; end > 0; { + start := max(0, end-runeComparisonChunkSize) + if !helpers.Equals(r.Runtext, index+start, end-start, candidate[start:end]) { + if !r.caseInsensitive { + return false + } + for i := end - 1; i >= start; i-- { + captured, ch := r.Runtext[index+i], candidate[i] + if captured == ch { + continue + } + // ASCII letters fold identically in every mode; other runes + // require the mode-aware Unicode comparison. + if uint32(captured|ch) <= unicode.MaxASCII { + folded := captured | 0x20 + if folded < 'a' || folded > 'z' || folded != ch|0x20 { + return false + } + continue + } + if !syntax.IsCaseEquivalent(captured, ch, options) { + return false + } + } + } + end = start + } + + if !r.rightToLeft { + pos += length + } + r.Runtextpos = pos + return true +} + +func (r *Runner) backwardnext() { + if r.rightToLeft { + r.Runtextpos++ + } else { + r.Runtextpos-- + } +} + +func (r *Runner) charAt(j int) rune { + return r.Runtext[j] +} + +func findTrailingFixedLengthEnd(r *Runner, fixedLength int, allowFinalNewline bool) bool { + start := r.Runtextend - fixedLength + if start < r.Runtextpos || start < 0 { + r.Runtextpos = r.Runtextend + return false + } + // Prefer the position before a final newline when allowed by the anchor. + // A rejected prefix must still allow the absolute-end candidate: the + // expression itself may consume the newline. + prefix := r.code.BmPrefix + if allowFinalNewline && r.Runtextend > 0 && r.Runtext[r.Runtextend-1] == '\n' && start-1 >= r.Runtextpos { + if prefix == nil || prefix.IsMatch(r.Runtext, start-1, 0, r.Runtextend) { + r.Runtextpos = start - 1 + return true + } + } + // Retain the literal prefilter when narrowing the search to the end. + // Otherwise even a first-character mismatch would enter the interpreter. + if prefix != nil && !prefix.IsMatch(r.Runtext, start, 0, r.Runtextend) { + r.Runtextpos = r.Runtextend + return false + } + r.Runtextpos = start + return true +} + +func findLeadingStringLeftToRight(r *Runner, prefix []rune, ignoreCase, ascii bool) bool { + if len(prefix) == 0 { + return true + } + + search := r.Runtext[r.Runtextpos:] + var offset int + if ignoreCase { + if ascii { + offset = helpers.IndexOfIgnoreCaseAscii(search, prefix) + } else { + offset = helpers.IndexOfIgnoreCase(search, prefix) + } + } else { + offset = helpers.IndexOf(search, prefix) + } + if offset < 0 { + r.Runtextpos = r.Runtextend + return false + } + + start := r.Runtextpos + offset + if !hasRequiredLengthAt(r, start) { + r.Runtextpos = r.Runtextend + return false + } + r.Runtextpos = start + return true +} + +func findLeadingStringsLeftToRight(r *Runner, prefixes [][]rune, firstRunes []rune, ascii *[2]uint64, ignoreCase bool) bool { + if len(prefixes) == 0 { + return false + } + + // Unicode ordinal-ignore-case matching has more possible first-rune folds + // than a small precomputed set can safely represent. Keep its conservative + // position-by-position scan; the common case-sensitive path skips directly + // between possible first runes. + if ignoreCase || len(firstRunes) == 0 { + for start := r.Runtextpos; start <= latestPossibleStart(r); start++ { + for _, prefix := range prefixes { + if ignoreCase { + if helpers.StartsWithIgnoreCase(r.Runtext[start:], prefix) { + r.Runtextpos = start + return true + } + } else if helpers.StartsWith(r.Runtext[start:], prefix) { + r.Runtextpos = start + return true + } + } + } + r.Runtextpos = r.Runtextend + return false + } + + latest := min(latestPossibleStart(r), r.Runtextend-1) + for searchAt := r.Runtextpos; searchAt <= latest; { + offset := indexOfAnyRunes(r.Runtext[searchAt:latest+1], firstRunes, ascii) + if offset < 0 { + break + } + start := searchAt + offset + first := r.Runtext[start] + for _, prefix := range prefixes { + if len(prefix) > 0 && prefix[0] == first && helpers.StartsWith(r.Runtext[start:], prefix) { + r.Runtextpos = start + return true + } + } + searchAt = start + 1 + } + + r.Runtextpos = r.Runtextend + return false +} + +func indexOfAnyRunes(input, find []rune, ascii *[2]uint64) int { + switch len(find) { + case 0: + return -1 + case 1: + return helpers.IndexOfAny1(input, find[0]) + case 2: + return helpers.IndexOfAny2(input, find[0], find[1]) + case 3: + return helpers.IndexOfAny3(input, find[0], find[1], find[2]) + } + if ascii != nil { + for i, ch := range input { + if uint32(ch) < 128 && ascii[ch>>6]&(1<<(uint(ch)&63)) != 0 { + return i + } + } + return -1 + } + return helpers.IndexOfAny(input, find) +} + +func findFixedDistanceCharLeftToRight(r *Runner, ch rune, distance int) bool { + searchStart := r.Runtextpos + distance + for searchStart < r.Runtextend { + offset := helpers.IndexOfAny1(r.Runtext[searchStart:], ch) + if offset < 0 { + r.Runtextpos = r.Runtextend + return false + } + literalIndex := searchStart + offset + start := literalIndex - distance + if start >= r.Runtextpos && hasRequiredLengthAt(r, start) { + r.Runtextpos = start + return true + } + if start > latestPossibleStart(r) { + break + } + searchStart = literalIndex + 1 + } + + r.Runtextpos = r.Runtextend + return false +} + +func findFixedDistanceStringLeftToRight(r *Runner, literal []rune, distance int) bool { + if len(literal) == 0 { + return true + } + + searchStart := r.Runtextpos + distance + for searchStart <= r.Runtextend-len(literal) { + offset := helpers.IndexOf(r.Runtext[searchStart:], literal) + if offset < 0 { + r.Runtextpos = r.Runtextend + return false + } + literalIndex := searchStart + offset + start := literalIndex - distance + if start >= r.Runtextpos && hasRequiredLengthAt(r, start) { + r.Runtextpos = start + return true + } + if start > latestPossibleStart(r) { + break + } + searchStart = literalIndex + 1 + } + + r.Runtextpos = r.Runtextend + return false +} + +func findFixedDistanceSetsLeftToRight(r *Runner, sets []syntax.FixedDistanceSet) bool { + if len(sets) == 0 || sets[0].Set == nil { + return false + } + + primary := sets[0] + searchStart := r.Runtextpos + primary.Distance + for searchStart < r.Runtextend { + offset := indexOfSet(r.Runtext[searchStart:], primary) + if offset < 0 { + r.Runtextpos = r.Runtextend + return false + } + + charIndex := searchStart + offset + start := charIndex - primary.Distance + if start > latestPossibleStart(r) { + break + } + if start >= r.Runtextpos && hasRequiredLengthAt(r, start) && fixedDistanceSetsMatchAt(r, sets, start) { + r.Runtextpos = start + return true + } + searchStart = charIndex + 1 + } + + r.Runtextpos = r.Runtextend + return false +} + +func findLiteralAfterLoopLeftToRight(r *Runner, literal *syntax.LiteralAfterLoop) bool { + if literal == nil || literal.LoopNode == nil || literal.LoopNode.Set == nil { + return false + } + + searchStart := r.Runtextpos + for searchStart < r.Runtextend { + literalIndex := indexOfLiteralAfterLoop(r, literal, searchStart) + if literalIndex < 0 { + r.Runtextpos = r.Runtextend + return false + } + + start := literalIndex + for start > r.Runtextpos && literal.LoopNode.Set.Contains(r.Runtext[start-1]) { + start-- + } + if hasRequiredLengthAt(r, start) { + r.Runtextpos = start + return true + } + searchStart = literalIndex + 1 + } + + r.Runtextpos = r.Runtextend + return false +} + +func findRequiredLandmarkChainLeftToRight(r *Runner, chain *syntax.RequiredLandmarkChain) bool { + if chain == nil || chain.LeadingLoopSet == nil || len(chain.Landmarks) == 0 { + return false + } + + if r.Runtextpos <= r.landmarkCore { + if candidate := max(r.Runtextpos, r.landmarkCandidate); hasRequiredLengthAt(r, candidate) { + r.Runtextpos = candidate + return true + } + } + searches := r.requiredLandmarkSearches(chain) + + for searchStart := r.Runtextpos; searchStart <= latestPossibleStart(r); { + first, ok := searches[0].next(r.Runtext, searchStart, r.Runtextend, chain.Landmarks[0]) + if !ok { + r.Runtextpos = r.Runtextend + return false + } + + nextStart := first.End + for i := 1; i < len(chain.Landmarks); i++ { + landmark, ok := searches[i].next(r.Runtext, nextStart, r.Runtextend, chain.Landmarks[i]) + if !ok { + r.Runtextpos = r.Runtextend + return false + } + nextStart = landmark.End + } + + candidate := requiredLandmarkStart(r, chain, first.CoreStart, searches[0].alternatives) + for candidate > r.Runtextpos && chain.LeadingLoopSet.Contains(r.Runtext[candidate-1]) { + candidate-- + } + if hasRequiredLengthAt(r, candidate) { + r.Runtextpos = candidate + r.landmarkCore, r.landmarkCandidate = first.CoreStart, candidate + return true + } + + searchStart = first.CoreStart + 1 + } + + r.Runtextpos = r.Runtextend + return false +} + +// requiredLandmarkState holds what the searches for chain's landmarks learned +// about one input. +type requiredLandmarkState struct { + chain *syntax.RequiredLandmarkChain + searches []requiredLandmarkSearch +} + +// requiredLandmarkSearches returns the search state of chain's landmarks. +func (r *Runner) requiredLandmarkSearches(chain *syntax.RequiredLandmarkChain) []requiredLandmarkSearch { + if r.landmarks == nil || r.landmarks.chain != chain { + searches := make([]requiredLandmarkSearch, len(chain.Landmarks)) + for i, landmark := range chain.Landmarks { + searches[i].alternatives = make([]requiredLandmarkCursor, len(landmark.Alternatives)) + } + r.landmarks = &requiredLandmarkState{chain: chain, searches: searches} + } + return r.landmarks.searches +} + +// resetRequiredLandmarkSearches discards everything learned about Runtext. +func (r *Runner) resetRequiredLandmarkSearches() { + for i := range r.landmarks.searches { + s := &r.landmarks.searches[i] + s.last, s.found = requiredLandmarkMatch{}, false + for j := range s.alternatives { + s.alternatives[j] = requiredLandmarkCursor{prefix: s.alternatives[j].prefix} + } + } +} + +type requiredLandmarkMatch struct { + CoreStart int + End int +} + +// requiredLandmarkSearch finds the cores of one landmark. Calls must pass the +// same input, endAt and landmark and must not decrease startAt, so each +// cursor only moves forward. A call makes O(1) calls to each cursor per start +// it passes, so the calls on one input read O(n) runes per alternative. +type requiredLandmarkSearch struct { + // last is the last core found, if found. It is also the result of a + // call from any position up to last.CoreStart. + last requiredLandmarkMatch + found bool + alternatives []requiredLandmarkCursor +} + +// next returns the first core at or after startAt. Its End holds for +// whichever alternative the VM uses, at this core or a later one. +func (s *requiredLandmarkSearch) next(input []rune, startAt, endAt int, landmark syntax.RequiredLandmark) (requiredLandmarkMatch, bool) { + if s.found && startAt <= s.last.CoreStart { + return s.last, true + } + for i := startAt; i < endAt; { + // Let the cursors read up to about twice as far from startAt as i, + // so that each reads many runes per call. + limit := endAt + if i-startAt < endAt-i { + limit = i + (i - startAt) + 1 + } + // After this pass no alternative has a core in [i, first). Unless + // first is limit, one has a core at first or cannot rule one out + // yet. found is the alternative with a core at first, if no earlier + // one is still open there. + first, found := limit, -1 + var match requiredLandmarkMatch + for j := 0; j < len(landmark.Alternatives) && first > i; j++ { + c := &s.alternatives[j] + if m, ok := c.find(input, i, endAt, first, first, &landmark.Alternatives[j]); ok { + match, first, found = m, m.CoreStart, j + } else if u := c.undecided(endAt); u < first { + first, found = u, -1 + } + } + if first == limit { + i = limit + continue + } + // Unless found is set, test the alternatives at first in order, + // reading as far as each needs. No alternative has a core in + // [startAt, first), so these reads decide the earliest remaining start. + for j := 0; j < len(landmark.Alternatives) && found < 0; j++ { + if m, ok := s.alternatives[j].find(input, first, endAt, first+1, endAt, &landmark.Alternatives[j]); ok { + match, found = m, j + } + } + if found < 0 { + i = first + 1 + continue + } + match = s.bound(input, landmark, found, match) + // The last End also holds here, since this core is later. Keeping + // the larger one keeps the next landmark's startAt from decreasing. + if s.found { + match.End = max(match.End, s.last.End) + } + s.last, s.found = match, true + return match, true + } + return requiredLandmarkMatch{}, false +} + +// bound lowers match.End so that it holds for every alternative. Another +// alternative can end before End only if its core starts before End, so End +// drops to the earliest end that such a start allows. +func (s *requiredLandmarkSearch) bound(input []rune, landmark syntax.RequiredLandmark, found int, match requiredLandmarkMatch) requiredLandmarkMatch { + for j := range landmark.Alternatives { + if j == found { + continue + } + alt := &landmark.Alternatives[j] + minLength := alt.MinRepeat + if len(alt.Literal) > 0 { + minLength = len(alt.Literal) + } + c := &s.alternatives[j] + c.first = max(c.first, match.CoreStart) + // minLength can be close to MaxInt32, so first+minLength can overflow + // int on 32-bit platforms. + for minLength < match.End-c.first { + ch := input[c.first] + if (len(alt.Literal) > 0 && ch == alt.Literal[0]) || (alt.Set != nil && alt.Set.Contains(ch)) { + match.End = c.first + minLength + break + } + c.first++ + } + } + return match +} + +// requiredLandmarkCursor finds the cores of one landmark alternative. Calls +// to find and reachable must pass the same input, endAt and alternative and +// must not decrease their start. It keeps what it has read, so its calls on +// one input read O(n) runes plus O(1) per call, whatever the repeat counts +// and literal lengths. +type requiredLandmarkCursor struct { + // prefix is the KMP failure function of a literal core. It depends only + // on the alternative. + prefix []int + + // For a set core, pos is the next start to test. For a literal core, it + // is the next rune to read, and the matched runes before it are the + // longest proper prefix of the literal there that starts at or after the + // last startAt. Neither is used once exhausted. + pos, matched int + // core is the first core at or after the last startAt, if found. If + // exhausted, there is none. + core requiredLandmarkMatch + found, exhausted bool + + // The runes from the current start to setEnd are in Set. The runes from + // the current start plus MinRepeat to trailingEnd are not in + // TrailingWhitespaceSet. + setEnd, trailingEnd int + + // For bound: no rune from the last core to first can start this + // alternative. + first int + + // For reachable: the runes from the last pos to leadingEnd are in + // LeadingWhitespaceSet, and the rune at leadingEnd, if any, is not. + leadingEnd int +} + +// find returns the first core that starts in [startAt, limit). It reads past +// limit only to finish a core that starts before limit, and reads no rune at +// or past readEnd other than the one after a literal core. If a start before +// the first core needs such runes, find returns no core and leaves that start +// for a later call. Unlike startAt, limit and readEnd can decrease between +// calls. +func (c *requiredLandmarkCursor) find(input []rune, startAt, endAt, limit, readEnd int, alt *syntax.RequiredLandmarkAlternative) (requiredLandmarkMatch, bool) { + if c.exhausted || c.found && startAt <= c.core.CoreStart { + return c.core, c.found && c.core.CoreStart < limit + } + c.found = false + if c.pos < startAt { + c.pos, c.matched = startAt, 0 + } + if len(alt.Literal) > 0 { + c.findLiteral(input, startAt, endAt, limit, readEnd, alt) + } else { + c.findSet(input, endAt, limit, readEnd, alt) + } + if !c.found && c.pos >= endAt { + c.exhausted = true + } + return c.core, c.found +} + +// undecided returns the first start in [startAt, limit) that the last call to +// find, which found no core, left for a later one, or a start at or past limit +// if there is none. +func (c *requiredLandmarkCursor) undecided(endAt int) int { + if c.exhausted { + return endAt + } + return c.pos - c.matched +} + +func (c *requiredLandmarkCursor) findLiteral(input []rune, startAt, endAt, limit, readEnd int, alt *syntax.RequiredLandmarkAlternative) { + literal := alt.Literal + if c.prefix == nil { + c.prefix = make([]int, len(literal)) + for i, k := 1, 0; i < len(literal); i++ { + for k > 0 && literal[i] != literal[k] { + k = c.prefix[k-1] + } + if literal[i] == literal[k] { + k++ + } + c.prefix[i] = k + } + } + // A match that starts before startAt cannot be a core. Keep the shorter + // ones within it that start at or after startAt. + for c.matched > 0 && c.pos-c.matched < startAt { + c.matched = c.prefix[c.matched-1] + } + // Stop once the matched prefix starts at or past limit. + for c.pos < readEnd && c.pos-c.matched < limit { + r := input[c.pos] + for c.matched > 0 && r != literal[c.matched] { + c.matched = c.prefix[c.matched-1] + } + if r == literal[c.matched] { + c.matched++ + } + c.pos++ + if c.matched < len(literal) { + continue + } + start := c.pos - len(literal) + c.matched = c.prefix[len(literal)-1] + if (!alt.RequireWhitespaceBefore || start > 0 && alt.LeadingWhitespaceSet.Contains(input[start-1])) && + (!alt.RequireWhitespaceAfter || c.pos < endAt && alt.TrailingWhitespaceSet.Contains(input[c.pos])) { + c.core, c.found = requiredLandmarkMatch{CoreStart: start, End: c.pos}, true + return + } + } + if c.pos-c.matched > endAt-len(literal) { + // No start that is left fits. + c.pos = endAt + } +} + +// findSet looks for the shortest core at each start. The VM can backtrack a +// longer one, so a longer core could pass the whitespace required after it or +// the start of the next landmark. +func (c *requiredLandmarkCursor) findSet(input []rune, endAt, limit, readEnd int, alt *syntax.RequiredLandmarkAlternative) { + for c.pos < limit { + start := c.pos + // Test the fit first, so that the cursor stops even if no later start + // follows whitespace. MinRepeat can be close to MaxInt32, so + // start+MinRepeat can overflow int on 32-bit platforms. + if alt.MinRepeat > endAt-start { + c.pos = endAt + return + } + if alt.RequireWhitespaceBefore && (start == 0 || !alt.LeadingWhitespaceSet.Contains(input[start-1])) { + c.pos++ + continue + } + if c.setEnd < start { + c.setEnd = start + } + end := start + alt.MinRepeat + if alt.RequireWhitespaceAfter { + end = max(end, c.trailingEnd) + for end < readEnd && end-start <= alt.MaxRepeat && c.extendSet(input, end, alt) && !alt.TrailingWhitespaceSet.Contains(input[end]) { + end++ + } + c.trailingEnd = end + if end-start > alt.MaxRepeat { + // No start before this one can reach whitespace either. + c.pos = end - alt.MaxRepeat + continue + } + if end >= endAt { + c.pos = endAt + return + } + } + if !c.extendSet(input, min(end, readEnd), alt) { + // The set run ends too early for every start up to its end. + c.pos = c.setEnd + 1 + continue + } + // Deciding this start needs the runes from readEnd on. + if end > readEnd || end == readEnd && alt.RequireWhitespaceAfter { + return + } + c.pos = start + 1 + c.core, c.found = requiredLandmarkMatch{CoreStart: start, End: end}, true + return + } +} + +// extendSet reports whether the runes from the current start to end are in +// Set. It reads only as far as end. +func (c *requiredLandmarkCursor) extendSet(input []rune, end int, alt *syntax.RequiredLandmarkAlternative) bool { + for c.setEnd < end { + if !alt.Set.Contains(input[c.setEnd]) { + break + } + c.setEnd++ + } + return c.setEnd >= end +} + +// reachable reports whether alt's core starts at pos or right after a run of +// alt's leading whitespace from pos. +func (c *requiredLandmarkCursor) reachable(input []rune, pos, endAt int, alt *syntax.RequiredLandmarkAlternative) bool { + if c.leadingEnd <= pos { + c.leadingEnd = pos + for c.leadingEnd < endAt && alt.LeadingWhitespaceSet.Contains(input[c.leadingEnd]) { + c.leadingEnd++ + } + } + _, ok := c.find(input, pos, endAt, min(c.leadingEnd+1, endAt), endAt, alt) + return ok +} + +// requiredLandmarkStart returns a position, not before Runtextpos, that is at +// or before the start of any match whose first landmark core starts at or +// after core, once LeadingLoopSet is rewound from it. An alternative's leading +// whitespace can start such a match before core only if the chain's anchors +// hold where the alternative starts, and the alternative's core starts at +// core or right after a run of that whitespace from core. +func requiredLandmarkStart(r *Runner, chain *syntax.RequiredLandmarkChain, core int, cursors []requiredLandmarkCursor) int { + input, minStart := r.Runtext, r.Runtextpos + landmark := chain.Landmarks[0] + anchored := len(chain.Anchors) > 0 + start := core + for j := range landmark.Alternatives { + if start == minStart { + break + } + alt := &landmark.Alternatives[j] + ws := alt.LeadingWhitespaceSet + if ws == nil { + continue + } + // Rewind only to just before start at first. An alternative that + // cannot get there needs no more work. + altStart := core + for altStart >= start && altStart > minStart && ws.Contains(input[altStart-1]) { + altStart-- + } + if altStart >= start { + continue + } + // Without anchors, test reachable before the rest of the rewind, so + // that a failure skips it. With anchors, rewind first: they can fail + // at every start the rewind reaches, and then reachable need not read + // ahead. + if !anchored && !cursors[j].reachable(input, core, r.Runtextend, alt) { + continue + } + for altStart > minStart && ws.Contains(input[altStart-1]) { + altStart-- + } + for altStart < start && !requiredLandmarkAnchorsHold(r, chain.Anchors, altStart) { + altStart++ + } + if altStart < start && (!anchored || cursors[j].reachable(input, core, r.Runtextend, alt)) { + start = altStart + } + } + return start +} + +// requiredLandmarkAnchorsHold reports whether the VM would pass every anchor +// at pos. +func requiredLandmarkAnchorsHold(r *Runner, anchors []syntax.NodeType, pos int) bool { + for _, anchor := range anchors { + ok := true + switch anchor { + case syntax.NtBol: + ok = pos == 0 || r.isLineBreak(r.Runtext[pos-1]) + case syntax.NtEol: + ok = pos == r.Runtextend || r.isLineBreak(r.Runtext[pos]) + case syntax.NtBoundary: + ok = r.IsBoundary(pos) + case syntax.NtNonboundary: + ok = !r.IsBoundary(pos) + // Boundaries with the IgnoreCase|Unicode word characters are not + // landmark anchors (see findRequiredLandmarkChain). + case syntax.NtECMABoundary: + ok = r.IsECMABoundaryWithOptions(pos, None) + case syntax.NtNonECMABoundary: + ok = !r.IsECMABoundaryWithOptions(pos, None) + case syntax.NtBeginning: + ok = pos == 0 + case syntax.NtStart: + ok = pos == r.Runtextstart + case syntax.NtEndZ: + // RE2 and ECMAScript allow only the end. Otherwise a final '\n' + // may follow. + rest := r.Runtextend - pos + ok = rest == 0 || rest == 1 && r.re.options&(RE2|ECMAScript) == 0 && r.Runtext[pos] == '\n' + case syntax.NtEnd: + ok = pos == r.Runtextend + } + if !ok { + return false + } + } + return true +} + +func indexOfLiteralAfterLoop(r *Runner, literal *syntax.LiteralAfterLoop, searchStart int) int { + switch { + case literal.String != "": + needle := literal.StringRunes + if literal.StringIgnoreCase { + var offset int + if literal.StringASCII { + offset = helpers.IndexOfIgnoreCaseAscii(r.Runtext[searchStart:], needle) + } else { + offset = helpers.IndexOfIgnoreCase(r.Runtext[searchStart:], needle) + } + if offset >= 0 { + return searchStart + offset + } + } else if offset := helpers.IndexOf(r.Runtext[searchStart:], needle); offset >= 0 { + return searchStart + offset + } + case len(literal.Chars) > 0: + if offset := indexOfAnyRunes(r.Runtext[searchStart:], literal.Chars, literal.CharsASCII); offset >= 0 { + return searchStart + offset + } + default: + if offset := helpers.IndexOfAny1(r.Runtext[searchStart:], literal.Char); offset >= 0 { + return searchStart + offset + } + } + return -1 +} + +func indexOfSet(chars []rune, set syntax.FixedDistanceSet) int { + if len(set.Chars) > 5 && set.Set != nil { + // The class already has an ASCII bitmap. Avoid constructing another + // one each time a candidate search resumes, and keep Unicode handling + // and negation in the class's membership test. + for i, ch := range chars { + if set.Set.Contains(ch) { + return i + } + } + return -1 + } + if len(set.Chars) > 0 && !set.Negated { + return indexOfAnyRunes(chars, set.Chars, set.CharsASCII) + } + if len(set.Chars) > 0 && set.Negated { + return helpers.IndexOfAnyExcept(chars, set.Chars) + } + if set.Range != nil { + if set.Negated { + return helpers.IndexOfAnyExceptInRange(chars, set.Range.First, set.Range.Last) + } + return helpers.IndexOfAnyInRange(chars, set.Range.First, set.Range.Last) + } + return helpers.IndexFunc(chars, func(ch rune) bool { + return charInFixedDistanceSet(set, ch) + }) +} + +func fixedDistanceSetsMatchAt(r *Runner, sets []syntax.FixedDistanceSet, start int) bool { + for _, set := range sets { + index := start + set.Distance + if index < 0 || index >= r.Runtextend || !charInFixedDistanceSet(set, r.Runtext[index]) { + return false + } + } + return true +} + +func charInFixedDistanceSet(set syntax.FixedDistanceSet, ch rune) bool { + if len(set.Chars) > 5 && set.Set != nil { + return set.Set.Contains(ch) + } + if len(set.Chars) > 0 { + found := slices.Contains(set.Chars, ch) + if set.Negated { + return !found + } + return found + } + if set.Range != nil { + found := ch >= set.Range.First && ch <= set.Range.Last + if set.Negated { + return !found + } + return found + } + return set.Set != nil && set.Set.Contains(ch) +} + +func latestPossibleStart(r *Runner) int { + if r.code == nil || r.code.FindOptimizations == nil { + return r.Runtextend + } + minRequiredLength := r.code.FindOptimizations.MinRequiredLength + if minRequiredLength <= 0 { + return r.Runtextend + } + return r.Runtextend - minRequiredLength +} + +func hasRequiredLengthAt(r *Runner, start int) bool { + return start >= 0 && start <= latestPossibleStart(r) +} + +func (r *Runner) stringMatchText(input string, runes []rune, runeOffset, byteOffset int) *matchText { + if r.textInfo == nil { + r.textInfo = new(matchText) + } + r.textInfo.resetString(input, runes, runeOffset, byteOffset) + return r.textInfo +} + +func (r *Runner) initMatch(textInfo *matchText) { + // Use a hashtable'ed Match object if the capture numbers are sparse + + if r.runmatch == nil { + if r.re.caps != nil { + r.runmatch = newMatchSparse(r.re, r.re.caps, r.re.capsize, textInfo, r.Runtextstart) + } else { + r.runmatch = newMatch(r.re, r.re.capsize, textInfo, r.Runtextstart) + } + } else { + r.runmatch.reset(textInfo, r.Runtextstart) + } + + // note we test runcrawl, because it is the last one to be allocated + // If there is an alloc failure in the middle of the three allocations, + // we may still return to reuse this instance, and we want to behave + // as if the allocations didn't occur. (we used to test _trackcount != 0) + + if r.runcrawl != nil { + r.Runtrackpos = len(r.runtrack) + r.Runstackpos = len(r.runstack) + r.runcrawlpos = len(r.runcrawl) + return + } + + r.initTrackCount() + + tracksize := r.runtrackcount * 8 + stacksize := r.runtrackcount * 8 + + if tracksize < 64 { + tracksize = 64 + } + if limit := r.re.optimizations.MaxBacktrackingStackSize; limit >= 0 && tracksize > limit { + tracksize = limit + } + if stacksize < 32 { + stacksize = 32 + } + + r.runtrack = make([]int, tracksize) + r.Runtrackpos = tracksize + + r.runstack = make([]int, stacksize) + r.Runstackpos = stacksize + + r.runcrawl = make([]int, 32) + r.runcrawlpos = 32 +} + +func (r *Runner) tidyMatch(mode scanMode) *Match { + if mode == scanFullMatch { + match := r.runmatch + + r.runmatch = nil + + // Rune input needs capture text metadata only when a match escapes the runner. + if match.text == nil { + match.text = newMatchText(r.Runtext) + } + match.tidy(r.Runtextpos) + return match + } else { + // Borrowed results need only the whole-match bounds and continuation + // position. MatchView reads capture ranges directly from the engine's + // bookkeeping, including unresolved balancing references. + m := r.runmatch + if m == nil { + return nil + } + m.textpos = r.Runtextpos + if m.matchcount[0] > 0 { + interval := m.matches[0] + setCaptureFields(&m.Capture, interval[0], interval[1]) + } + return m + } +} + +// Capture captures a subexpression. Note that the +// capnum used here has already been mapped to a non-sparse +// index (by the code generator RegexWriter). +func (r *Runner) Capture(capnum, start, end int) { + if end < start { + T := end + end = start + start = T + } + + r.crawl(capnum) + r.runmatch.addMatch(capnum, start, end-start) +} + +// TransferCapture removes the last capture from uncapnum and optionally +// captures its interval with [start, end) into capnum. Use -1 for capnum to +// only remove the capture. uncapnum must be matched, and both group numbers +// must already be mapped to dense capture slots. UncaptureUntil can undo it. +func (r *Runner) TransferCapture(capnum, uncapnum, start, end int) { + r.transferCapture(capnum, uncapnum, start, end) +} + +// transferCapture captures a subexpression. Note that the +// capnum used here has already been mapped to a non-sparse +// index (by the code generator RegexWriter). +func (r *Runner) transferCapture(capnum, uncapnum, start, end int) { + var start2, end2 int + + // these are the two intervals that are cancelling each other + + if end < start { + T := end + end = start + start = T + } + + start2 = r.runmatch.matchIndex(uncapnum) + end2 = start2 + r.runmatch.matchLength(uncapnum) + + // The new capture gets the innermost defined interval + + if start >= end2 { + end = start + start = end2 + } else if end <= start2 { + start = start2 + } else { + if end > end2 { + end = end2 + } + if start2 > start { + start = start2 + } + } + + r.crawl(uncapnum) + r.runmatch.balanceMatch(uncapnum) + + if capnum != -1 { + r.crawl(capnum) + r.runmatch.addMatch(capnum, start, end-start) + } +} + +// revert the last capture +func (r *Runner) uncapture() { + capnum := r.popcrawl() + r.runmatch.removeMatch(capnum) +} + +//debug + +func (r *Runner) dumpState() { + back := "" + if r.operator&syntax.Back != 0 { + back = " Back" + } + if r.operator&syntax.Back2 != 0 { + back += " Back2" + } + fmt.Printf("Text: %v\nTrack: %v\nStack: %v\n %s%s\n\n", + r.textposDescription(), + r.stackDescription(r.runtrack, r.Runtrackpos), + r.stackDescription(r.runstack, r.Runstackpos), + r.code.OpcodeDescription(r.codepos), + back) +} + +func (r *Runner) stackDescription(a []int, index int) string { + buf := &bytes.Buffer{} + + fmt.Fprintf(buf, "%v/%v", len(a)-index, len(a)) + if buf.Len() < 8 { + buf.WriteString(strings.Repeat(" ", 8-buf.Len())) + } + + buf.WriteRune('(') + for i := index; i < len(a); i++ { + if i > index { + buf.WriteRune(' ') + } + + buf.WriteString(strconv.Itoa(a[i])) + } + + buf.WriteRune(')') + + return buf.String() +} + +func (r *Runner) textposDescription() string { + buf := &bytes.Buffer{} + + buf.WriteString(strconv.Itoa(r.Runtextpos)) + + if buf.Len() < 8 { + buf.WriteString(strings.Repeat(" ", 8-buf.Len())) + } + + if r.Runtextpos > 0 { + buf.WriteString(syntax.CharDescription(r.Runtext[r.Runtextpos-1])) + } else { + buf.WriteRune('^') + } + + buf.WriteRune('>') + + for i := r.Runtextpos; i < r.Runtextend; i++ { + buf.WriteString(syntax.CharDescription(r.Runtext[i])) + } + if buf.Len() >= 64 { + buf.Truncate(61) + buf.WriteString("...") + } else { + buf.WriteRune('$') + } + + return buf.String() +} + +// decide whether the pos +// at the specified index is a boundary or not. It's just not worth +// emitting inline code for this logic. +func (r *Runner) IsBoundary(index int) bool { + return (index > 0 && syntax.IsWordChar(r.Runtext[index-1])) != + (index < r.Runtextend && syntax.IsWordChar(r.Runtext[index])) +} + +// isLineBreak reports whether ch ends a line for the multiline ^ and $ anchors. +func (r *Runner) isLineBreak(ch rune) bool { + return ch == '\n' || r.re.options&ECMAScript != 0 && syntax.IsECMALineTerminator(ch) +} + +// IsECMABoundary reports whether index is between a letter, nonspacing mark, +// decimal digit or connector punctuation and something else. +// +// Deprecated: IsECMABoundary is kept so that existing generated engines keep +// their behavior. It does not use the ECMAScript word characters; use +// IsECMABoundaryWithOptions. +func (r *Runner) IsECMABoundary(index int) bool { + return (index > 0 && syntax.IsECMAWordChar(r.Runtext[index-1])) != + (index < r.Runtextend && syntax.IsECMAWordChar(r.Runtext[index])) +} + +// IsECMABoundaryWithOptions reports whether index is an ECMAScript word +// boundary for a \b or \B with the given options: whether exactly one of the +// characters before and after index is in the WordCharacters, which are +// [A-Za-z0-9_], plus U+017F and U+212A with both IgnoreCase and Unicode. +func (r *Runner) IsECMABoundaryWithOptions(index int, options RegexOptions) bool { + opts := syntax.RegexOptions(options) + return (index > 0 && syntax.IsECMAWordCharWithOptions(opts, r.Runtext[index-1])) != + (index < r.Runtextend && syntax.IsECMAWordCharWithOptions(opts, r.Runtext[index])) +} + +// ecmaBoundaryOptions returns the options of the current \b or \B operator +// that choose its word characters. The writer sets Ci on it only when its +// scoped options have both IgnoreCase and Unicode (see RegexNode.reduce). +func (r *Runner) ecmaBoundaryOptions() RegexOptions { + if r.caseInsensitive { + return IgnoreCase | Unicode + } + return None +} + +func (r *Runner) startTimeoutWatch() { + if r.ignoreTimeout { + return + } + r.deadline = makeDeadline(r.timeout) +} + +func (r *Runner) CheckTimeout() error { + if r.ignoreTimeout || !r.deadline.reached() { + return nil + } + + return fmt.Errorf("match timeout after %v on input `%v`", r.timeout, string(r.Runtext)) +} + +func (r *Runner) initTrackCount() { + if r.code != nil { + r.runtrackcount = r.code.TrackCount + } +} + +// getRunner returns a runner to use for matching re. +func (re *Regexp) getRunner() *Runner { + if re.runnerPool == nil { + re.initCaches() + } + return re.runnerPool.Get().(*Runner) +} + +// putRunner returns a runner to the re's pool cache. +func (re *Regexp) putRunner(r *Runner) { + r.Runtext = nil + r.code = re.code + if r.runmatch != nil { + r.runmatch.text = nil + } + if r.textInfo != nil { + // Release the input and offset cache, keeping the metadata object for reuse. + *r.textInfo = matchText{} + } + re.runnerPool.Put(r) +} + +func (r *Runner) LastIndexOfRune(startIndex int, endIndex int, find rune) int { + for i := endIndex - 1; i >= startIndex; i-- { + if r.Runtext[i] == find { + return i + } + } + return -1 +} + +// Undo captures until it reaches the specified capture position +func (r *Runner) UncaptureUntil(capturePos int) { + for r.Crawlpos() > capturePos { + r.uncapture() + } +} + +func (r *Runner) StackPop() int { + //get it + val := r.runstack[r.Runstackpos] + // pop it + r.Runstackpos++ + // return it + return val +} + +// StackDepth returns the number of integer slots currently used by the +// generated engine's backtracking stack. +func (r *Runner) StackDepth() int { + return len(r.runstack) - r.Runstackpos +} + +func (r *Runner) StackPush(val int) { + // check if we need to size up stack + r.ensureStack(1) + r.Runstackpos-- + r.runstack[r.Runstackpos] = val +} +func (r *Runner) StackPush2(val1, val2 int) { + // check if we need to size up stack + r.ensureStack(2) + r.Runstackpos-- + r.runstack[r.Runstackpos] = val1 + r.Runstackpos-- + r.runstack[r.Runstackpos] = val2 +} +func (r *Runner) StackPush3(val1, val2, val3 int) { + // check if we need to size up stack + r.ensureStack(3) + r.Runstackpos-- + r.runstack[r.Runstackpos] = val1 + r.Runstackpos-- + r.runstack[r.Runstackpos] = val2 + r.Runstackpos-- + r.runstack[r.Runstackpos] = val3 +} +func (r *Runner) StackPush4(val1, val2, val3, val4 int) { + // check if we need to size up stack + r.ensureStack(4) + r.Runstackpos-- + r.runstack[r.Runstackpos] = val1 + r.Runstackpos-- + r.runstack[r.Runstackpos] = val2 + r.Runstackpos-- + r.runstack[r.Runstackpos] = val3 + r.Runstackpos-- + r.runstack[r.Runstackpos] = val4 +} +func (r *Runner) StackPush5(val1, val2, val3, val4, val5 int) { + // check if we need to size up stack + r.ensureStack(5) + r.Runstackpos-- + r.runstack[r.Runstackpos] = val1 + r.Runstackpos-- + r.runstack[r.Runstackpos] = val2 + r.Runstackpos-- + r.runstack[r.Runstackpos] = val3 + r.Runstackpos-- + r.runstack[r.Runstackpos] = val4 + r.Runstackpos-- + r.runstack[r.Runstackpos] = val5 +} +func (r *Runner) StackPushN(vals ...int) { + // check if we need to size up stack + r.ensureStack(len(vals)) + for _, val := range vals { + r.Runstackpos-- + r.runstack[r.Runstackpos] = val + } +} +func (r *Runner) IsMatched(cap int) bool { + return r.runmatch.isMatched(cap) +} +func (r *Runner) MatchLength(cap int) int { + return r.runmatch.matchLength(cap) +} +func (r *Runner) MatchIndex(cap int) int { + return r.runmatch.matchIndex(cap) +} diff --git a/vendor/github.com/dlclark/regexp2/v2/split.go b/vendor/github.com/dlclark/regexp2/v2/split.go new file mode 100644 index 000000000..a540dd17e --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/split.go @@ -0,0 +1,104 @@ +package regexp2 + +import ( + "errors" + "math" + "slices" +) + +// Split splits the given input string using the pattern and returns +// a slice of the parts. Count limits the number of matches to process. +// If Count is -1, then it will process the input fully. +// If Count is 0, returns nil. If Count is 1, returns the original input. +// The only expected error is a Timeout, if it's set. +// +// If capturing parentheses are used in the Regex expression, any captured +// text is included in the resulting string array +// For example, a pattern of "-" Split("a-b") will return ["a", "b"] +// but a pattern with "(-)" Split ("a-b") will return ["a", "-", "b"] +func (re *Regexp) Split(input string, count int) ([]string, error) { + if count < -1 { + return nil, errors.New("count too small") + } + if count == 0 { + return nil, nil + } + if count == 1 { + return []string{input}, nil + } + if count == -1 { + // no limit + count = math.MaxInt + } + + startAt, ok, err := re.findStringMatchStart(input, -1) + if err != nil { + return nil, err + } + if !ok { + return []string{input}, nil + } + d := decodeInput(input, startAt, re.decodeFrom(input, startAt), re.optimizations.MaxCachedRuneBufferLength) + runner := re.getRunner() + defer func() { + re.putRunner(runner) + d.release() + }() + text := runner.stringMatchText(input, d.runes, 0, d.byteOffset) + + // Keep captures in the reusable match, but only materialize output strings. + // Passing text also ensures registered engines use their capturing program. + priorIndex := 0 + if re.RightToLeft() { + priorIndex = len(input) + } + var retVal []string + matched := false + + origin := re.stringSearchOrigin(input, -1, d.runeStart) + m, err := runner.scan(d.runes, text, origin, d.runeStart, -1, scanCaptures, re.MatchTimeout) + + for ; m != nil && count > 0; m, err = runner.scan(d.runes, text, m.textpos, m.textpos, m.RuneLength, scanCaptures, re.MatchTimeout) { + if m.balancing { + compactBalancedMatches(m) + } + matched = true + start, end := matchInputSpan(m) + if re.RightToLeft() { + retVal = append(retVal, input[end:priorIndex]) + } else { + retVal = append(retVal, input[priorIndex:start]) + } + // Preserve group order and empty strings for unmatched groups without + // allocating Group objects or their capture histories. + for group := 1; group < len(m.matchcount); group++ { + value := "" + if m.matchcount[group] > 0 { + capture := newCapture(text, m.matchIndex(group), m.matchLength(group)) + value = capture.String() + } + retVal = append(retVal, value) + } + priorIndex = end + if re.RightToLeft() { + priorIndex = start + } + count-- + } + + if err != nil { + return nil, err + } + + if !matched { + return []string{input}, nil + } + + if re.RightToLeft() { + retVal = append(retVal, input[:priorIndex]) + slices.Reverse(retVal) + } else { + retVal = append(retVal, input[priorIndex:]) + } + return retVal, nil +} diff --git a/vendor/github.com/dlclark/regexp2/v2/stringprefixfilter.go b/vendor/github.com/dlclark/regexp2/v2/stringprefixfilter.go new file mode 100644 index 000000000..ac2e48cd8 --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/stringprefixfilter.go @@ -0,0 +1,498 @@ +package regexp2 + +import ( + "errors" + "strings" + "unicode/utf8" + + "github.com/dlclark/regexp2/v2/helpers" + "github.com/dlclark/regexp2/v2/syntax" +) + +const maxStringFilterLiteralLen = 8 + +var ( + errStringStartAtTooLarge = errors.New("startAt must be less than the length of the input string") + errStringStartAtNotRuneBoundary = errors.New("startAt must align to the start of a valid rune in the input string") +) + +// StringPrefixFilter optionally searches string input before the engine decodes it +// to runes. It returns a byte index for a candidate match start, or ok=false if +// the regex cannot match. The filter must be conservative: false positives are +// allowed, false negatives are not. +type StringPrefixFilter func(input string, startAt int) (candidateByteIndex int, ok bool) + +func newStringPrefixFilter(code *syntax.Code) StringPrefixFilter { + if code == nil || code.RightToLeft || code.FindOptimizations == nil { + return nil + } + + opts := code.FindOptimizations + minRequiredLength := opts.MinRequiredLength + + switch opts.FindMode { + case syntax.LeadingString_LeftToRight: + return stringIndexPrefixFilter(opts.LeadingPrefix, false, minRequiredLength) + case syntax.LeadingString_OrdinalIgnoreCase_LeftToRight: + return stringIndexPrefixFilter(opts.LeadingPrefix, true, minRequiredLength) + case syntax.LeadingStrings_LeftToRight: + return stringIndexPrefixesFilter(opts.LeadingPrefixes, false, minRequiredLength) + case syntax.LeadingStrings_OrdinalIgnoreCase_LeftToRight: + return stringIndexPrefixesFilter(opts.LeadingPrefixes, true, minRequiredLength) + case syntax.LeadingSet_LeftToRight: + if len(opts.FixedDistanceSets) == 0 { + return nil + } + set := opts.FixedDistanceSets[0] + if set.Range == nil && (len(set.Chars) == 0 || len(set.Chars) > 5) { + return nil + } + return stringFixedDistanceSetFilter(set, minRequiredLength) + case syntax.FixedDistanceChar_LeftToRight: + return stringFixedDistanceCharFilter(opts.FixedDistanceLiteral.C, opts.FixedDistanceLiteral.Distance, minRequiredLength) + case syntax.FixedDistanceString_LeftToRight: + return stringFixedDistanceStringFilter(opts.FixedDistanceLiteral.S, opts.FixedDistanceLiteral.Distance, minRequiredLength) + case syntax.LiteralAfterLoop_LeftToRight: + return stringLiteralAfterLoopFilter(opts.LiteralAfterLoop, minRequiredLength) + default: + return nil + } +} + +// Dense candidate prefixes benefit from checking alternatives together. Keep +// the existing scanner for short inputs and sparse candidates, where its +// string searches can skip farther with less work. +func withEqualASCIIPrefixSearch(fallback StringPrefixFilter, search *equalASCIIPrefixSearch, minRequiredLength int) StringPrefixFilter { + return func(input string, startAt int) (int, bool) { + if !search.shouldUseString(input, startAt) { + return fallback(input, startAt) + } + index := search.indexString(input, startAt) + return index, index >= 0 && hasMinRequiredBytes(input, index, minRequiredLength) + } +} + +type asciiSetStringScanner struct { + chars string + first byte + last byte + useRange bool + distance int +} + +func newASCIISetStringScanner(set syntax.FixedDistanceSet) (asciiSetStringScanner, bool) { + if set.Negated || set.Distance < 0 { + return asciiSetStringScanner{}, false + } + if set.Range != nil { + if set.Range.First < 0 || set.Range.Last > utf8.RuneSelf-1 { + return asciiSetStringScanner{}, false + } + return asciiSetStringScanner{ + first: byte(set.Range.First), + last: byte(set.Range.Last), + useRange: true, + distance: set.Distance, + }, true + } + if len(set.Chars) == 0 { + return asciiSetStringScanner{}, false + } + chars := make([]byte, len(set.Chars)) + for i, ch := range set.Chars { + if ch < 0 || ch > utf8.RuneSelf-1 { + return asciiSetStringScanner{}, false + } + chars[i] = byte(ch) + } + return asciiSetStringScanner{chars: string(chars), distance: set.Distance}, true +} + +func stringFixedDistanceSetFilter(set syntax.FixedDistanceSet, minRequiredLength int) StringPrefixFilter { + scanner, ok := newASCIISetStringScanner(set) + if !ok { + return nil + } + + return func(input string, startAt int) (candidateByteIndex int, ok bool) { + if !hasMinRequiredBytes(input, startAt, minRequiredLength) { + return 0, false + } + + for searchAt := startAt; searchAt < len(input); { + offset := scanner.index(input[searchAt:]) + if offset < 0 { + return 0, false + } + setByteIndex := searchAt + offset + candidateByteIndex, valid := stringFixedDistanceCandidateStart(input, startAt, setByteIndex, scanner.distance) + if valid && hasMinRequiredBytes(input, candidateByteIndex, minRequiredLength) { + return candidateByteIndex, true + } + if valid { + return 0, false + } + searchAt = setByteIndex + 1 + } + return 0, false + } +} + +func (s asciiSetStringScanner) index(input string) int { + if !s.useRange { + if len(s.chars) == 1 { + return strings.IndexByte(input, s.chars[0]) + } + return strings.IndexAny(input, s.chars) + } + for i := 0; i < len(input); i++ { + if input[i] >= s.first && input[i] <= s.last { + return i + } + } + return -1 +} + +// A literal U+FFFD also matches invalid UTF-8 bytes once decoded. Keep the +// byte filter for valid strings, and let the rune engine handle invalid input. +// Ordinary literals return the original filter without a per-search check. +func withRuneErrorFallback(filter StringPrefixFilter, literals ...string) StringPrefixFilter { + for _, literal := range literals { + if strings.ContainsRune(literal, utf8.RuneError) { + return func(input string, startAt int) (int, bool) { + if startAt < 0 || startAt > len(input) { + return 0, false + } + if !utf8.ValidString(input[startAt:]) { + return startAt, true + } + return filter(input, startAt) + } + } + } + return filter +} + +func stringIndexPrefixFilter(prefix string, ignoreCase bool, minRequiredLength int) StringPrefixFilter { + if prefix == "" { + return nil + } + if ignoreCase && !isASCIIString(prefix) { + return nil + } + + return withRuneErrorFallback(func(input string, startAt int) (candidateByteIndex int, ok bool) { + if !hasMinRequiredBytes(input, startAt, minRequiredLength) { + return 0, false + } + + var offset int + if ignoreCase { + offset = helpers.IndexStringIgnoreCaseASCII(input[startAt:], prefix) + } else { + offset = strings.Index(input[startAt:], prefix) + } + if offset < 0 { + return 0, false + } + return startAt + offset, true + }, prefix) +} + +func stringIndexPrefixesFilter(prefixes []string, ignoreCase bool, minRequiredLength int) StringPrefixFilter { + if len(prefixes) == 0 { + return nil + } + if ignoreCase { + for _, prefix := range prefixes { + if !isASCIIString(prefix) { + return nil + } + } + } + + if filter, ok := compileASCIIStringSetPrefixFilter(prefixes, ignoreCase, minRequiredLength); ok { + return filter.index + } + + return withRuneErrorFallback(func(input string, startAt int) (candidateByteIndex int, ok bool) { + return indexAnyPrefixFallback(input, startAt, prefixes, ignoreCase, minRequiredLength) + }, prefixes...) +} + +func indexAnyPrefixFallback(input string, startAt int, prefixes []string, ignoreCase bool, minRequiredLength int) (candidateByteIndex int, ok bool) { + if !hasMinRequiredBytes(input, startAt, minRequiredLength) { + return 0, false + } + + best := -1 + remaining := input[startAt:] + for _, prefix := range prefixes { + var offset int + if ignoreCase { + offset = helpers.IndexStringIgnoreCaseASCII(remaining, prefix) + } else { + offset = strings.Index(remaining, prefix) + } + if offset >= 0 && (best < 0 || offset < best) { + best = offset + } + } + if best < 0 { + return 0, false + } + return startAt + best, true +} + +type asciiStringSetPrefixFilter struct { + firstChars string + prefixesByFirst [256][]string + minRequiredBytes int +} + +// compileASCIIStringSetPrefixFilter builds a byte-oriented multi-prefix scanner +// for the narrow shape where it beats running strings.Index once per prefix: +// case-sensitive ASCII prefixes with at least two prefixes sharing a first byte. +// It indexes possible first bytes with strings.IndexAny, then verifies only the +// bucket for the byte found. Other shapes fall back to the old implementation. +func compileASCIIStringSetPrefixFilter(prefixes []string, ignoreCase bool, minRequiredLength int) (*asciiStringSetPrefixFilter, bool) { + if ignoreCase { + return nil, false + } + + filter := &asciiStringSetPrefixFilter{ + minRequiredBytes: minRequiredLength, + } + var firstChars [256]bool + var hasSharedFirst bool + for _, prefix := range prefixes { + if prefix == "" || !isASCIIString(prefix) { + return nil, false + } + + first := prefix[0] + filter.prefixesByFirst[first] = append(filter.prefixesByFirst[first], prefix) + if len(filter.prefixesByFirst[first]) > 1 { + hasSharedFirst = true + } + firstChars[first] = true + } + + if !hasSharedFirst { + return nil, false + } + + firstBytes := make([]byte, 0, len(prefixes)*2) + for i, ok := range firstChars { + if ok { + firstBytes = append(firstBytes, byte(i)) + } + } + if len(firstBytes) == 0 { + return nil, false + } + filter.firstChars = string(firstBytes) + return filter, true +} + +func (f *asciiStringSetPrefixFilter) index(input string, startAt int) (candidateByteIndex int, ok bool) { + if !hasMinRequiredBytes(input, startAt, f.minRequiredBytes) { + return 0, false + } + + for searchAt := startAt; searchAt < len(input); { + offset := strings.IndexAny(input[searchAt:], f.firstChars) + if offset < 0 { + return 0, false + } + i := searchAt + offset + first := input[i] + for _, prefix := range f.prefixesByFirst[first] { + if len(input)-i >= len(prefix) && strings.HasPrefix(input[i:], prefix) { + return i, true + } + } + searchAt = i + 1 + } + return 0, false +} + +func stringFixedDistanceCharFilter(ch rune, distance, minRequiredLength int) StringPrefixFilter { + if distance < 0 { + return nil + } + + return func(input string, startAt int) (candidateByteIndex int, ok bool) { + if !hasMinRequiredBytes(input, startAt, minRequiredLength) { + return 0, false + } + + searchAt := startAt + for { + offset := strings.IndexRune(input[searchAt:], ch) + if offset < 0 { + return 0, false + } + byteIndex := searchAt + offset + candidateByteIndex, ok := stringFixedDistanceCandidateStart(input, startAt, byteIndex, distance) + if ok && hasMinRequiredBytes(input, candidateByteIndex, minRequiredLength) { + return candidateByteIndex, true + } + if ok { + return 0, false + } + _, size := utf8.DecodeRuneInString(input[byteIndex:]) + if size == 0 { + return 0, false + } + searchAt = byteIndex + size + } + } +} + +func stringFixedDistanceStringFilter(literal string, distance, minRequiredLength int) StringPrefixFilter { + if literal == "" || distance < 0 || len(literal) > maxStringFilterLiteralLen { + return nil + } + + return withRuneErrorFallback(func(input string, startAt int) (candidateByteIndex int, ok bool) { + if !hasMinRequiredBytes(input, startAt, minRequiredLength) { + return 0, false + } + + searchAt := startAt + for searchAt <= len(input)-len(literal) { + offset := strings.Index(input[searchAt:], literal) + if offset < 0 { + return 0, false + } + literalIndex := searchAt + offset + candidateByteIndex, ok := stringFixedDistanceCandidateStart(input, startAt, literalIndex, distance) + if ok && hasMinRequiredBytes(input, candidateByteIndex, minRequiredLength) { + return candidateByteIndex, true + } + if ok { + return 0, false + } + searchAt = literalIndex + 1 + } + return 0, false + }, literal) +} + +func stringLiteralAfterLoopFilter(literal *syntax.LiteralAfterLoop, minRequiredLength int) StringPrefixFilter { + if literal == nil || literal.LoopNode == nil || literal.LoopNode.Set == nil { + return nil + } + if literal.StringIgnoreCase && (literal.String == "" || !isASCIIString(literal.String)) { + return nil + } + + return withRuneErrorFallback(func(input string, startAt int) (candidateByteIndex int, ok bool) { + if !hasMinRequiredBytes(input, startAt, minRequiredLength) { + return 0, false + } + if !stringHasLiteralAfterLoop(input, startAt, literal) { + return 0, false + } + return startAt, true + }, literal.String) +} + +func stringHasLiteralAfterLoop(input string, searchAt int, literal *syntax.LiteralAfterLoop) bool { + switch { + case literal.String != "": + if literal.StringIgnoreCase { + return helpers.IndexStringIgnoreCaseASCII(input[searchAt:], literal.String) >= 0 + } + return strings.Contains(input[searchAt:], literal.String) + case len(literal.Chars) > 0: + needle := string(literal.Chars) + return strings.ContainsAny(input[searchAt:], needle) + default: + return strings.ContainsRune(input[searchAt:], literal.Char) + } +} + +func stringFixedDistanceCandidateStart(input string, startAt, byteIndex, distance int) (int, bool) { + candidateByteIndex := byteIndex + for i := 0; i < distance; i++ { + if candidateByteIndex <= startAt { + return 0, false + } + _, size := utf8.DecodeLastRuneInString(input[:candidateByteIndex]) + if size == 0 { + return 0, false + } + candidateByteIndex -= size + } + return candidateByteIndex, true +} + +func (re *Regexp) findStringPrefixCandidate(input string, startAt int) (candidateByteIndex int, ok bool) { + if re.stringPrefixFilter == nil || re.RightToLeft() { + return startAt, true + } + candidateByteIndex, ok = re.stringPrefixFilter(input, startAt) + if !ok { + return 0, false + } + if candidateByteIndex < startAt || candidateByteIndex > len(input) || !isStringRuneBoundary(input, candidateByteIndex) { + return startAt, true + } + return candidateByteIndex, true +} + +func (re *Regexp) findStringMatchStart(input string, startAt int) (candidateByteIndex int, ok bool, err error) { + if startAt > len(input) { + return 0, false, errStringStartAtTooLarge + } + if startAt >= 0 && !isStringRuneBoundary(input, startAt) { + return 0, false, errStringStartAtNotRuneBoundary + } + + if startAt < 0 { + if re.RightToLeft() { + startAt = len(input) + } else { + startAt = 0 + } + } + + candidateByteIndex, ok = re.findStringPrefixCandidate(input, startAt) + return candidateByteIndex, ok, nil +} + +func hasMinRequiredBytes(input string, startAt, minRequiredLength int) bool { + if startAt < 0 || startAt > len(input) { + return false + } + return minRequiredLength <= 0 || len(input)-startAt >= minRequiredLength +} + +func isStringRuneBoundary(s string, index int) bool { + if index == 0 || index == len(s) { + return true + } + if index < 0 || index > len(s) { + return false + } + for strIdx := range s { + if strIdx == index { + return true + } + if strIdx > index { + return false + } + } + return false +} + +func isASCIIString(s string) bool { + for i := 0; i < len(s); i++ { + if s[i] >= utf8.RuneSelf { + return false + } + } + return true +} diff --git a/vendor/github.com/dlclark/regexp2/v2/syntax/charclass.go b/vendor/github.com/dlclark/regexp2/v2/syntax/charclass.go new file mode 100644 index 000000000..485b7e63d --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/charclass.go @@ -0,0 +1,1649 @@ +package syntax + +import ( + "bytes" + "encoding/binary" + "fmt" + "slices" + "sort" + "strings" + "unicode" + "unicode/utf8" +) + +// CharSet combines start-end rune ranges and unicode categories representing a set of characters +type CharSet struct { + ranges []SingleRange + categories []charCategory + sub *CharSet //optional subtractor + negate bool + anything bool + + ascii *asciiBitmap +} + +type asciiBitmap struct { + bits [2]uint64 +} + +type Category struct { + Negate bool + Cat string +} + +// Keep the public Category representation and serialized form unchanged. +// Resolve membership data when constructing or deserializing a category so +// matching does not need a name lookup. Both tables and ECMAScript sets are +// immutable and can be shared when a character set is copied or merged. +type charCategory struct { + Category + set *CharSet + table *unicode.RangeTable +} + +func newCharCategory(category Category) charCategory { + ct := charCategory{Category: category} + if strings.HasPrefix(category.Cat, ecmaPropertyPrefix) { + ct.set = ecmaPropertySet(category.Cat) + } else if category.Cat != WordCategoryText && category.Cat != SpaceCategoryText { + ct.table, _ = lookupUnicodeCategory(category.Cat) + } + return ct +} + +type SingleRange struct { + First rune + Last rune +} + +const ( + SpaceCategoryText = " " + WordCategoryText = "W" +) + +var ( + ecmaSpace = []rune{0x0009, 0x000e, 0x0020, 0x0021, 0x00a0, 0x00a1, 0x1680, 0x1681, 0x2000, 0x200b, 0x2028, 0x202a, 0x202f, 0x2030, 0x205f, 0x2060, 0x3000, 0x3001, 0xfeff, 0xff00} + ecmaWord = []rune{0x0030, 0x003a, 0x0041, 0x005b, 0x005f, 0x0060, 0x0061, 0x007b} + ecmaDigit = []rune{0x0030, 0x003a} + + re2Space = []rune{0x0009, 0x000b, 0x000c, 0x000e, 0x0020, 0x0021} +) + +var ( + AnyClass = getCharSetFromOldString([]rune{0}, false) + ECMAAnyClass = getCharSetFromOldString([]rune{0, 0x000a, 0x000b, 0x000d, 0x000e, 0x2028, 0x202a}, false) + NoneClass = getCharSetFromOldString(nil, false) + ECMAWordClass = getCharSetFromOldString(ecmaWord, false) + NotECMAWordClass = getCharSetFromOldString(ecmaWord, true) + ECMASpaceClass = getCharSetFromOldString(ecmaSpace, false) + NotECMASpaceClass = getCharSetFromOldString(ecmaSpace, true) + ECMADigitClass = getCharSetFromOldString(ecmaDigit, false) + NotECMADigitClass = getCharSetFromOldString(ecmaDigit, true) + + WordClass = getCharSetFromCategoryString(false, false, WordCategoryText) + NotWordClass = getCharSetFromCategoryString(true, false, WordCategoryText) + SpaceClass = getCharSetFromCategoryString(false, false, SpaceCategoryText) + NotSpaceClass = getCharSetFromCategoryString(true, false, SpaceCategoryText) + DigitClass = getCharSetFromCategoryString(false, false, "Nd") + NotDigitClass = getCharSetFromCategoryString(false, true, "Nd") + + RE2SpaceClass = getCharSetFromOldString(re2Space, false) + NotRE2SpaceClass = getCharSetFromOldString(re2Space, true) + + NotNewLineClass = getCharSetFromOldString([]rune{0x0a, 0x0b}, true) +) + +// lookupUnicodeCategory searches the source tables without building a merged +// map at startup. Preserve the old map's overwrite precedence: generated +// properties override Go properties, category aliases, categories, and scripts. +func lookupUnicodeCategory(name string) (*unicode.RangeTable, bool) { + if table, ok := unicodeAliasCategories[name]; ok { + return table, true + } + if table, ok := unicode.Properties[name]; ok { + return table, true + } + if canonical, ok := unicode.CategoryAliases[name]; ok { + return unicode.Categories[canonical], true + } + if table, ok := unicode.Categories[name]; ok { + return table, true + } + table, ok := unicode.Scripts[name] + return table, ok +} + +func getCharSetFromCategoryString(negateSet bool, negateCat bool, cats ...string) func() *CharSet { + if negateCat && negateSet { + panic("BUG! You should only negate the set OR the category in a constant setup, but not both") + } + + c := CharSet{negate: negateSet} + + c.categories = make([]charCategory, len(cats)) + for i, cat := range cats { + c.categories[i] = newCharCategory(Category{Cat: cat, Negate: negateCat}) + } + return func() *CharSet { + //make a copy each time + local := c + //return that address + return &local + } +} + +func getCharSetFromOldString(setText []rune, negate bool) func() *CharSet { + c := CharSet{} + if len(setText) > 0 { + fillFirst := false + l := len(setText) + if negate { + if setText[0] == 0 { + setText = setText[1:] + } else { + l++ + fillFirst = true + } + } + + if l%2 == 0 { + c.ranges = make([]SingleRange, l/2) + } else { + c.ranges = make([]SingleRange, l/2+1) + } + + first := true + if fillFirst { + c.ranges[0] = SingleRange{First: 0} + first = false + } + + i := 0 + for _, r := range setText { + if first { + // lower bound in a new range + c.ranges[i] = SingleRange{First: r} + first = false + } else { + c.ranges[i].Last = r - 1 + i++ + first = true + } + } + if !first { + c.ranges[i].Last = utf8.MaxRune + } + if len(c.ranges) == 1 && c.ranges[0].First == 0 && c.ranges[0].Last >= unicode.MaxRune { + // this is anything...or nothing + c.anything = !negate + } + } + + return func() *CharSet { + local := c + return &local + } +} + +// Copy makes a deep copy to prevent accidental mutation of a set +func (c CharSet) Copy() CharSet { + ret := CharSet{ + anything: c.anything, + negate: c.negate, + } + + ret.ranges = append(ret.ranges, c.ranges...) + ret.categories = append(ret.categories, c.categories...) + + if c.sub != nil { + sub := c.sub.Copy() + ret.sub = &sub + } + + return ret +} + +// gets a human-readable description for a set string +func (c CharSet) String() string { + buf := &bytes.Buffer{} + buf.WriteRune('[') + + if c.IsNegated() { + buf.WriteRune('^') + } + + for _, r := range c.ranges { + + buf.WriteString(CharDescription(r.First)) + if r.First != r.Last { + if r.Last-r.First != 1 { + //groups that are 1 char apart skip the dash + buf.WriteRune('-') + } + buf.WriteString(CharDescription(r.Last)) + } + } + + for _, c := range c.categories { + buf.WriteString(c.String()) + } + + if c.sub != nil { + buf.WriteRune('-') + buf.WriteString(c.sub.String()) + } + + buf.WriteRune(']') + + return buf.String() +} + +func b2i(b bool) byte { + if b { + return 1 + } + return 0 +} + +// mapHashFill converts a charset into a buffer for use in maps +func (c CharSet) mapHashFill(buf *bytes.Buffer) { + buf.WriteByte(b2i(c.negate) + b2i(c.anything)*2) + + _ = binary.Write(buf, binary.LittleEndian, int32(len(c.ranges))) + _ = binary.Write(buf, binary.LittleEndian, int32(len(c.categories))) + for _, r := range c.ranges { + buf.WriteRune(r.First) + buf.WriteRune(r.Last) + } + for _, ct := range c.categories { + // write the length of the cat and indicate if it's negated + if ct.Negate { + _ = binary.Write(buf, binary.LittleEndian, int8(-1*len(ct.Cat))) + } else { + _ = binary.Write(buf, binary.LittleEndian, int8(len(ct.Cat))) + } + buf.WriteString(ct.Cat) + } + + if c.sub != nil { + c.sub.mapHashFill(buf) + } +} + +func NewCharSetRuntime(buf string) CharSet { + retVal := CharSet{} + b := bytes.NewBufferString(buf) + val, _ := b.ReadByte() + //1s bit == negate, 2s bit == anything + retVal.negate = (val&0x1 == 0x1) + retVal.anything = (val&0x2 == 0x2) + var lenRanges, lenCats int32 + _ = binary.Read(b, binary.LittleEndian, &lenRanges) + _ = binary.Read(b, binary.LittleEndian, &lenCats) + + retVal.ranges = make([]SingleRange, lenRanges) + for i := 0; i < int(lenRanges); i++ { + r := SingleRange{} + r.First, _, _ = b.ReadRune() + r.Last, _, _ = b.ReadRune() + retVal.ranges[i] = r + } + + retVal.categories = make([]charCategory, lenCats) + for i := 0; i < int(lenCats); i++ { + var lenCat int8 + c := Category{} + _ = binary.Read(b, binary.LittleEndian, &lenCat) + if lenCat < 0 { + c.Negate = true + lenCat *= -1 + } + c.Cat = string(b.Next(int(lenCat))) + retVal.categories[i] = newCharCategory(c) + } + + //sub + if b.Len() > 0 { + sub := NewCharSetRuntime(b.String()) + retVal.sub = &sub + } + + return retVal +} + +// CharIn returns true if the rune is in our character set (either ranges or categories). +// It handles negations and subtracted sub-charsets. +func (c CharSet) CharIn(ch rune) bool { + return c.Contains(ch) +} + +// Contains reports whether ch is in the character set, including negation and +// subtraction. It is equivalent to CharIn but avoids copying the set on each +// call when testing many runes. +func (c *CharSet) Contains(ch rune) bool { + if ch >= 0 && ch < 128 && c.ascii != nil { + return (c.ascii.bits[ch/64] & (1 << (uint(ch) % 64))) != 0 + } + return c.charInSlow(ch) +} + +func (c *CharSet) charInSlow(ch rune) bool { + val := false + // in s && !s.subtracted + + //check ranges -- binary search for sets with many ranges, linear for small sets + n := len(c.ranges) + if n > 0 { + if n <= 4 { + for _, r := range c.ranges { + if ch < r.First { + break + } + if ch <= r.Last { + val = true + break + } + } + } else { + lo, hi := 0, n + for lo < hi { + mid := int(uint(lo+hi) >> 1) + if c.ranges[mid].First <= ch { + lo = mid + 1 + } else { + hi = mid + } + } + if lo > 0 && ch <= c.ranges[lo-1].Last { + val = true + } + } + } + + //check categories if we haven't already found a range + if !val && len(c.categories) > 0 { + val = c.charInCategories(ch) + } + + // negate the whole char set + if c.negate { + val = !val + } + + // get subtracted recurse + if val && c.sub != nil { + val = !c.sub.Contains(ch) + } + + //log.Printf("Char '%v' in %v == %v", string(ch), c.String(), val) + return val +} + +func (c *CharSet) prepareASCIIBitmap() { + if c == nil || c.ascii != nil { + return + } + if c.sub != nil { + c.sub.prepareASCIIBitmap() + } + bm := &asciiBitmap{} + for i := range rune(128) { + if c.charInSlow(i) { + bm.bits[i/64] |= 1 << (uint(i) % 64) + } + } + c.ascii = bm +} + +func (c *CharSet) charInCategories(ch rune) bool { + for _, ct := range c.categories { + if ct.set != nil { + if ct.set.Contains(ch) != ct.Negate { + return true + } + // Each category contributes to a union. Failure to match one + // property must not prevent a later property from matching. + continue + } + // special categories...then unicode + if ct.Cat == SpaceCategoryText { + if unicode.IsSpace(ch) { + // we found a space so we're done + // negate means this is a "bad" thing + return !ct.Negate + } else if ct.Negate { + return true + } + } else if ct.Cat == WordCategoryText { + if IsWordChar(ch) { + return !ct.Negate + } else if ct.Negate { + return true + } + } else if unicode.Is(ct.table, ch) { + // if we're in this unicode category then we're done + // if negate=true on this category then we "failed" our test + // otherwise we're good that we found it + return !ct.Negate + } else if ct.Negate { + return true + } + } + return false +} + +func (c Category) String() string { + if flags, ok := strings.CutPrefix(c.Cat, ecmaPropertyPrefix); ok { + escape := "\\p{" + if (flags[0] == 'P') != c.Negate { + escape = "\\P{" + } + return escape + flags[2:] + "}" + } + switch c.Cat { + case SpaceCategoryText: + if c.Negate { + return "\\S" + } + return "\\s" + case WordCategoryText: + if c.Negate { + return "\\W" + } + return "\\w" + } + if _, ok := lookupUnicodeCategory(c.Cat); ok { + + if c.Negate { + return "\\P{" + c.Cat + "}" + } + return "\\p{" + c.Cat + "}" + } + return "Unknown category: " + c.Cat +} + +// CharDescription Produces a human-readable description for a single character. +func CharDescription(ch rune) string { + /*if ch == '\\' { + return "\\\\" + } + + if ch > ' ' && ch <= '~' { + return string(ch) + } else if ch == '\n' { + return "\\n" + } else if ch == ' ' { + return "\\ " + }*/ + + b := &bytes.Buffer{} + escape(b, ch, false) //fmt.Sprintf("%U", ch) + return b.String() +} + +// According to UTS#18 Unicode Regular Expressions (http://www.unicode.org/reports/tr18/) +// RL 1.4 Simple Word Boundaries The class of includes all Alphabetic +// values from the Unicode character database, from UnicodeData.txt [UData], plus the U+200C +// ZERO WIDTH NON-JOINER and U+200D ZERO WIDTH JOINER. +func IsWordChar(r rune) bool { + if r < utf8.RuneSelf { + // In ASCII, L, Mn, Nd and Pc are these runes only. + return 'a' <= r && r <= 'z' || 'A' <= r && r <= 'Z' || '0' <= r && r <= '9' || r == '_' + } + //"L", "Mn", "Nd", "Pc" + return unicode.In(r, unicode.L, unicode.Mn, unicode.Nd, unicode.Pc) || r == '\u200D' || r == '\u200C' + //return 'A' <= r && r <= 'Z' || 'a' <= r && r <= 'z' || '0' <= r && r <= '9' || r == '_' +} + +// IsECMAWordChar reports whether r is a letter, nonspacing mark, decimal +// digit or connector punctuation. This is the classification that +// Runner.IsECMABoundary keeps for existing generated code. +// +// Deprecated: IsECMAWordChar is not the ECMAScript word character set; use +// IsECMAWordCharWithOptions. +func IsECMAWordChar(r rune) bool { + return unicode.In(r, unicode.L, unicode.Mn, unicode.Nd, unicode.Pc) + + //return 'A' <= r && r <= 'Z' || 'a' <= r && r <= 'z' || '0' <= r && r <= '9' || r == '_' +} + +// IsECMAWordCharWithOptions reports whether r is in the ECMAScript +// WordCharacters that \w, \b and \B are defined by, for a \b or \B with the +// given options: [A-Za-z0-9_], plus U+017F and U+212A (whose simple case folds +// are 's' and 'k') with both IgnoreCase and Unicode. +func IsECMAWordCharWithOptions(options RegexOptions, r rune) bool { + return 'A' <= r && r <= 'Z' || 'a' <= r && r <= 'z' || '0' <= r && r <= '9' || r == '_' || + (r == '\u017F' || r == '\u212A') && hasECMAWordCharExtras(options) +} + +func hasECMAWordCharExtras(options RegexOptions) bool { + return options&(IgnoreCase|Unicode) == IgnoreCase|Unicode +} + +// IsECMALineTerminator reports whether r is an ECMAScript LineTerminator: +// LF, CR, LINE SEPARATOR or PARAGRAPH SEPARATOR. +func IsECMALineTerminator(r rune) bool { + return r == '\n' || r == '\r' || r == '\u2028' || r == '\u2029' +} + +// IsLineBreak reports whether r ends a line for the ^ and $ anchors in +// Multiline mode. Only LF does, except in ECMAScript mode, where every +// LineTerminator does. +func IsLineBreak(options RegexOptions, r rune) bool { + if options&ECMAScript != 0 { + return IsECMALineTerminator(r) + } + return r == '\n' +} + +func IsECMAIdentifierStartChar(r rune) bool { + return r == '$' || r == '_' || unicode.In(r, unicode.L, unicode.Nl, unicode.Other_ID_Start) +} + +func IsECMAIdentifierChar(r rune) bool { + return IsECMAIdentifierStartChar(r) || r == '\u200C' || r == '\u200D' || + unicode.In(r, unicode.Mn, unicode.Mc, unicode.Nd, unicode.Pc, unicode.Other_ID_Continue) +} + +// SingletonChar will return the char from the first range without validation. +// It assumes you have checked for IsSingleton or IsSingletonInverse and will panic given bad input +func (c CharSet) SingletonChar() rune { + return c.ranges[0].First +} + +func (c CharSet) IsSingleton() bool { + return !c.negate && //negated is multiple chars + len(c.categories) == 0 && len(c.ranges) == 1 && // multiple ranges and unicode classes represent multiple chars + c.sub == nil && // subtraction means we've got multiple chars + c.ranges[0].First == c.ranges[0].Last // first and last equal means we're just 1 char +} + +func (c CharSet) IsSingletonInverse() bool { + return c.negate && //same as above, but requires negated + len(c.categories) == 0 && len(c.ranges) == 1 && // multiple ranges and unicode classes represent multiple chars + c.sub == nil && // subtraction means we've got multiple chars + c.ranges[0].First == c.ranges[0].Last // first and last equal means we're just 1 char +} + +func (c CharSet) IsMergeable() bool { + return !c.IsNegated() && !c.HasSubtraction() +} + +func (c CharSet) IsNegated() bool { + return c.negate +} + +func (c CharSet) HasSubtraction() bool { + return c.sub != nil +} + +func (c CharSet) IsEmpty() bool { + return len(c.ranges) == 0 && len(c.categories) == 0 && c.sub == nil +} + +func (c CharSet) IsAnything() bool { + return c.anything +} + +func (c *CharSet) addDigit(ecma, negate bool) { + if ecma { + if negate { + c.addRanges(NotECMADigitClass().ranges) + } else { + c.addRanges(ECMADigitClass().ranges) + } + } else { + c.addCategories(Category{Cat: "Nd", Negate: negate}) + } +} + +func (c *CharSet) addChar(ch rune) { + c.addRange(ch, ch) +} + +func (c *CharSet) addSpace(ecma, re2, negate bool) { + if ecma { + if negate { + c.addRanges(NotECMASpaceClass().ranges) + } else { + c.addRanges(ECMASpaceClass().ranges) + } + } else if re2 { + if negate { + c.addRanges(NotRE2SpaceClass().ranges) + } else { + c.addRanges(RE2SpaceClass().ranges) + } + } else { + c.addCategories(Category{Cat: SpaceCategoryText, Negate: negate}) + } +} + +func (c *CharSet) addWord(ecma, negate bool) { + if ecma { + if negate { + c.addRanges(NotECMAWordClass().ranges) + } else { + c.addRanges(ECMAWordClass().ranges) + } + } else { + c.addCategories(Category{Cat: WordCategoryText, Negate: negate}) + } +} + +// Add set ranges and categories into ours -- no deduping or anything +func (c *CharSet) addSet(set CharSet) { + if c.anything { + return + } + if set.anything { + c.makeAnything() + return + } + // just append here to prevent double-canon + c.ranges = append(c.ranges, set.ranges...) + for _, ct := range set.categories { + c.addCharCategory(ct) + } + c.canonicalize() +} + +func (c *CharSet) makeAnything() { + c.anything = true + c.categories = nil + c.ranges = []SingleRange{{First: 0, Last: unicode.MaxRune}} +} + +func (c *CharSet) addCategories(cats ...Category) { + for _, ct := range cats { + c.addCharCategory(newCharCategory(ct)) + } +} + +func (c *CharSet) addCharCategory(ct charCategory) { + // don't add dupes and remove positive+negative + if c.anything { + // if we've had a previous positive+negative group then + // just return, we're as broad as we can get + return + } + + for _, ct2 := range c.categories { + if ct.Cat == ct2.Cat { + if ct.Negate != ct2.Negate { + // Opposite negations cover the entire character domain. + c.makeAnything() + } + return + } + } + c.categories = append(c.categories, ct) +} + +// Merges new ranges to our own +func (c *CharSet) addRanges(ranges []SingleRange) { + if c.anything { + return + } + c.ranges = append(c.ranges, ranges...) + c.canonicalize() +} + +// Merges everything but the new ranges into our own +func (c *CharSet) addNegativeRanges(ranges []SingleRange) { + if c.anything { + return + } + + var hi rune + + // convert incoming ranges into opposites, assume they are in order + for _, r := range ranges { + if hi < r.First { + c.ranges = append(c.ranges, SingleRange{hi, r.First - 1}) + } + hi = r.Last + 1 + } + + if hi < utf8.MaxRune { + c.ranges = append(c.ranges, SingleRange{hi, utf8.MaxRune}) + } + + c.canonicalize() +} + +func normalizeUnicodeCategoryAlias(catName string) string { + var b strings.Builder + b.Grow(len(catName)) + for _, ch := range catName { + switch ch { + case '_', '-', ' ': + continue + default: + b.WriteRune(unicode.ToLower(ch)) + } + } + return b.String() +} + +func canonicalUnicodeCatName(catName string) (string, bool) { + if _, ok := lookupUnicodeCategory(catName); ok { + return catName, true + } + + normalized := normalizeUnicodeCategoryAlias(catName) + if canonical, ok := unicodeSupportedPropertyAliases[normalized]; ok { + return canonical, true + } + if canonical, ok := unicodeBarePropertyValueAliases[normalized]; ok { + return canonical, true + } + + if eq := strings.IndexRune(catName, '='); eq >= 0 { + propName := catName[:eq] + valueName := catName[eq+1:] + prop, ok := unicodeSupportedPropertyAliases[normalizeUnicodeCategoryAlias(propName)] + if !ok { + return "", false + } + values := unicodeSupportedPropertyValueAliases[prop] + if values == nil { + return "", false + } + value, ok := values[normalizeUnicodeCategoryAlias(valueName)] + if !ok { + return "", false + } + canonical := prop + "=" + value + if _, ok := lookupUnicodeCategory(canonical); ok { + return canonical, true + } + } + + return "", false +} + +func (c *CharSet) addCategory(categoryName string, negate, caseInsensitive bool) { + var ok bool + categoryName, ok = canonicalUnicodeCatName(categoryName) + if !ok { + // unknown unicode category, script, or property "blah" + panic(fmt.Errorf("unknown unicode category, script, or property '%v'", categoryName)) + + } + + if caseInsensitive && (categoryName == "Ll" || categoryName == "Lu" || categoryName == "Lt") { + // when RegexOptions.IgnoreCase is specified then {Ll} {Lu} and {Lt} cases should all match + c.addCategories( + Category{Cat: "Ll", Negate: negate}, + Category{Cat: "Lu", Negate: negate}, + Category{Cat: "Lt", Negate: negate}) + } + c.addCategories(Category{Cat: categoryName, Negate: negate}) +} + +// Adds to the class any case-equivalence versions of characters already +// in the class. Used for case-insensitivity. +func (c *CharSet) addCaseEquivalences(options RegexOptions) { + // we already have all case equiv + if c.anything { + return + } + rangeCount := len(c.ranges) + for i := 0; i < rangeCount; i++ { + r := c.ranges[i] + // For a single range that's in the set, adds any additional ranges + // necessary to ensure that lowercase equivalents are also included. + for i := r.First; i <= r.Last; i++ { + equiv := tryFindCaseEquivalences(i, options) + for _, eq := range equiv { + c.ranges = append(c.ranges, SingleRange{First: eq, Last: eq}) + } + } + } + c.canonicalize() +} + +// Performs a fast lookup which determines if a character is involved in case conversion, as well as +// returns the OTHER characters that should be considered equivalent in case it does participate in case conversion. +func tryFindCaseEquivalences(ch rune, options RegexOptions) []rune { + newCh := unicode.SimpleFold(ch) + if newCh == ch { + // no case support + return nil + } + var equiv []rune + legacyECMA := options&ECMAScript != 0 && options&Unicode == 0 + for ; newCh != ch; newCh = unicode.SimpleFold(newCh) { + if !legacyECMA || ecmaLegacyCase(ch) == ecmaLegacyCase(newCh) { + equiv = append(equiv, newCh) + } + } + return equiv +} + +// IsCaseEquivalent reports whether two runes match ignoring case. It uses +// Unicode simple folding except in legacy ECMAScript mode, which uses +// single-code-unit uppercase mappings. Only ECMAScript and Unicode in options +// affect the comparison; callers decide whether IgnoreCase is enabled. +func IsCaseEquivalent(a, b rune, options RegexOptions) bool { + if a == b { + return true + } + if options&ECMAScript != 0 && options&Unicode == 0 { + return ecmaLegacyCase(a) == ecmaLegacyCase(b) + } + for folded := unicode.SimpleFold(a); folded != a; folded = unicode.SimpleFold(folded) { + if folded == b { + return true + } + } + return false +} + +// Legacy ECMAScript /i compares single UTF-16-unit uppercase mappings, not +// Unicode simple folds. Non-ASCII characters must never map to ASCII. +// https://tc39.es/ecma262/#sec-runtime-semantics-canonicalize-ch +func ecmaLegacyCase(ch rune) rune { + // These Greek simple-fold pairs have multi-character full uppercase + // mappings (Greek letter + iota), so legacy /i keeps each character distinct. + // Other multi-character uppercase mappings do not share an uppercase value + // with another member of their simple-fold cycle (e.g. sharp s). + if ch > 0xffff || ch >= 0x1f80 && ch <= 0x1faf || + ch == 0x1fb3 || ch == 0x1fbc || ch == 0x1fc3 || ch == 0x1fcc || ch == 0x1ff3 || ch == 0x1ffc { + return ch + } + upper := unicode.ToUpper(ch) + if ch >= 128 && upper < 128 { + return ch + } + return upper +} + +func ecmaWordClass(options RegexOptions, negate bool) *CharSet { + if options&(Unicode|IgnoreCase) != Unicode|IgnoreCase { + if negate { + return NotECMAWordClass() + } + return ECMAWordClass() + } + set := ECMAWordClass().Copy() + set.addCaseEquivalences(options) + if negate { + // \W complements the case-closed word set, rather than folding the + // complement of the ASCII set (which would bring K and S back in). + set.ranges = appendECMAComplement(nil, set.ranges) + } + return &set +} + +func (c *CharSet) addSubtraction(sub *CharSet) { + c.sub = sub +} + +func (c *CharSet) addRange(chMin, chMax rune) { + c.ranges = append(c.ranges, SingleRange{First: chMin, Last: chMax}) + c.canonicalize() +} + +func (c *CharSet) addNamedASCII(name string, negate bool) bool { + var rs []SingleRange + + switch name { + case "alnum": + rs = []SingleRange{{'0', '9'}, {'A', 'Z'}, {'a', 'z'}} + case "alpha": + rs = []SingleRange{{'A', 'Z'}, {'a', 'z'}} + case "ascii": + rs = []SingleRange{{0, 0x7f}} + case "blank": + rs = []SingleRange{{'\t', '\t'}, {' ', ' '}} + case "cntrl": + rs = []SingleRange{{0, 0x1f}, {0x7f, 0x7f}} + case "digit": + c.addDigit(false, negate) + case "graph": + rs = []SingleRange{{'!', '~'}} + case "lower": + rs = []SingleRange{{'a', 'z'}} + case "print": + rs = []SingleRange{{' ', '~'}} + case "punct": //[!-/:-@[-`{-~] + rs = []SingleRange{{'!', '/'}, {':', '@'}, {'[', '`'}, {'{', '~'}} + case "space": + c.addSpace(true, false, negate) + case "upper": + rs = []SingleRange{{'A', 'Z'}} + case "word": + c.addWord(true, negate) + case "xdigit": + rs = []SingleRange{{'0', '9'}, {'A', 'F'}, {'a', 'f'}} + default: + return false + } + + if len(rs) > 0 { + if negate { + c.addNegativeRanges(rs) + } else { + c.addRanges(rs) + } + } + + return true +} + +type singleRangeSorter []SingleRange + +func (p singleRangeSorter) Len() int { return len(p) } +func (p singleRangeSorter) Less(i, j int) bool { return p[i].First < p[j].First } +func (p singleRangeSorter) Swap(i, j int) { p[i], p[j] = p[j], p[i] } + +// Logic to reduce a character class to a unique, sorted form. +func (c *CharSet) canonicalize() { + var i, j int + var last rune + + if len(c.ranges) == 0 { + return + } + + // + // Find and eliminate overlapping or abutting ranges + // + + if len(c.ranges) > 1 { + sort.Sort(singleRangeSorter(c.ranges)) + + done := false + + for i, j = 1, 0; ; i++ { + for last = c.ranges[j].Last; ; i++ { + if i == len(c.ranges) || last >= unicode.MaxRune { + done = true + break + } + + CurrentRange := c.ranges[i] + if CurrentRange.First > last+1 { + break + } + + if last < CurrentRange.Last { + last = CurrentRange.Last + } + } + + c.ranges[j] = SingleRange{First: c.ranges[j].First, Last: last} + + j++ + + if done { + break + } + + if j < i { + c.ranges[j] = c.ranges[i] + } + } + + c.ranges = append(c.ranges[:j], c.ranges[len(c.ranges):]...) + } + + // A full range makes categories redundant without changing the set's polarity. + if !c.negate && c.sub == nil && len(c.ranges) == 1 && + c.ranges[0].First == 0 && c.ranges[0].Last >= unicode.MaxRune { + c.makeAnything() + } +} + +// simplify reduces a completed set. Unlike canonicalize, it may change the +// set's polarity, so it must not run while class members are still being added. +func (c *CharSet) simplify() { + // If the class now represents a single negated range, but does so by including every + // other character, invert it to produce a normalized form with a single range. This + // is valuable for subsequent optimizations in most of the engines. + if !c.negate && c.sub == nil && len(c.categories) == 0 { + if len(c.ranges) == 2 { + // There are two ranges in the list. See if there's one missing range between them. + // Such a range might be as small as a single character. + if c.ranges[0].First == 0 && + c.ranges[1].Last >= unicode.MaxRune && + c.ranges[0].Last < c.ranges[1].First-1 { + c.ranges = []SingleRange{{c.ranges[0].Last + 1, c.ranges[1].First - 1}} + c.negate = true + } + } else if len(c.ranges) == 1 { + switch c.ranges[0].First { + case 0: + // There's only one range in the list. Does it include everything but the last char? + if c.ranges[0].Last == unicode.MaxRune-1 { + c.ranges = []SingleRange{{unicode.MaxRune, unicode.MaxRune}} + c.negate = true + } + case 1: + // Or everything but the first char? + if c.ranges[0].Last >= unicode.MaxRune { + c.ranges = []SingleRange{{'\x00', '\x00'}} + c.negate = true + } + } + } + } + + // If there's only a single character omitted from ranges, if there's no subtractor, and if there are categories, + // see if that character is in the categories. If it is, then we can replace whole thing with a complete "any" range. + // If it's not, then we can remove the categories, as they're only duplicating the rest of the range, turning the set + // into a "not one". This primarily helps in the case of a synthesized set from analysis that ends up combining '.' with + // categories, as we want to reduce that set down to either [^\n] or [\0-\uFFFF]. (This can be extrapolated to any number + // of missing characters; in fact, categories in general are superfluous and the entire set can be represented as ranges. + // But categories serve as a space optimization, and we strike a balance between testing many characters and the time/complexity + // it takes to do so. Thus, we limit this to the common case of a single missing character.) + if !c.negate && c.sub == nil && len(c.categories) > 0 && + len(c.ranges) == 2 && c.ranges[0].First == 0 && c.ranges[0].Last+2 == c.ranges[1].First && c.ranges[1].Last == unicode.MaxRune { + + if c.charInCategories(c.ranges[0].Last + 1) { + //c.ranges = []SingleRange{{'\x00', unicode.MaxRune}} + c.makeAnything() + } else { + c.negate = true + c.ranges = []SingleRange{{c.ranges[0].Last + 1, c.ranges[0].Last + 1}} + c.categories = nil + } + } +} + +// Adds to the class any lowercase versions of characters already +// in the class. Used for case-insensitivity. +func (c *CharSet) addLowercase() { + if c.anything { + return + } + toAdd := []SingleRange{} + for i := 0; i < len(c.ranges); i++ { + r := c.ranges[i] + if r.First == r.Last { + lower := unicode.ToLower(r.First) + c.ranges[i] = SingleRange{First: lower, Last: lower} + } else { + toAdd = append(toAdd, r) + } + } + + for _, r := range toAdd { + c.addLowercaseRange(r.First, r.Last) + } + c.canonicalize() +} + +/************************************************************************** + Let U be the set of Unicode character values and let L be the lowercase + function, mapping from U to U. To perform case insensitive matching of + character sets, we need to be able to map an interval I in U, say + + I = [chMin, chMax] = { ch : chMin <= ch <= chMax } + + to a set A such that A contains L(I) and A is contained in the union of + I and L(I). + + The table below partitions U into intervals on which L is non-decreasing. + Thus, for any interval J = [a, b] contained in one of these intervals, + L(J) is contained in [L(a), L(b)]. + + It is also true that for any such J, [L(a), L(b)] is contained in the + union of J and L(J). This does not follow from L being non-decreasing on + these intervals. It follows from the nature of the L on each interval. + On each interval, L has one of the following forms: + + (1) L(ch) = constant (LowercaseSet) + (2) L(ch) = ch + offset (LowercaseAdd) + (3) L(ch) = ch | 1 (LowercaseBor) + (4) L(ch) = ch + (ch & 1) (LowercaseBad) + + It is easy to verify that for any of these forms [L(a), L(b)] is + contained in the union of [a, b] and L([a, b]). +***************************************************************************/ + +const ( + LowercaseSet = 0 // Set to arg. + LowercaseAdd = 1 // Add arg. + LowercaseBor = 2 // Bitwise or with 1. + LowercaseBad = 3 // Bitwise and with 1 and add original. +) + +type lcMap struct { + chMin, chMax rune + op, data int32 +} + +var lcTable = []lcMap{ + {'\u0041', '\u005A', LowercaseAdd, 32}, + {'\u00C0', '\u00DE', LowercaseAdd, 32}, + {'\u0100', '\u012E', LowercaseBor, 0}, + {'\u0130', '\u0130', LowercaseSet, 0x0069}, + {'\u0132', '\u0136', LowercaseBor, 0}, + {'\u0139', '\u0147', LowercaseBad, 0}, + {'\u014A', '\u0176', LowercaseBor, 0}, + {'\u0178', '\u0178', LowercaseSet, 0x00FF}, + {'\u0179', '\u017D', LowercaseBad, 0}, + {'\u0181', '\u0181', LowercaseSet, 0x0253}, + {'\u0182', '\u0184', LowercaseBor, 0}, + {'\u0186', '\u0186', LowercaseSet, 0x0254}, + {'\u0187', '\u0187', LowercaseSet, 0x0188}, + {'\u0189', '\u018A', LowercaseAdd, 205}, + {'\u018B', '\u018B', LowercaseSet, 0x018C}, + {'\u018E', '\u018E', LowercaseSet, 0x01DD}, + {'\u018F', '\u018F', LowercaseSet, 0x0259}, + {'\u0190', '\u0190', LowercaseSet, 0x025B}, + {'\u0191', '\u0191', LowercaseSet, 0x0192}, + {'\u0193', '\u0193', LowercaseSet, 0x0260}, + {'\u0194', '\u0194', LowercaseSet, 0x0263}, + {'\u0196', '\u0196', LowercaseSet, 0x0269}, + {'\u0197', '\u0197', LowercaseSet, 0x0268}, + {'\u0198', '\u0198', LowercaseSet, 0x0199}, + {'\u019C', '\u019C', LowercaseSet, 0x026F}, + {'\u019D', '\u019D', LowercaseSet, 0x0272}, + {'\u019F', '\u019F', LowercaseSet, 0x0275}, + {'\u01A0', '\u01A4', LowercaseBor, 0}, + {'\u01A7', '\u01A7', LowercaseSet, 0x01A8}, + {'\u01A9', '\u01A9', LowercaseSet, 0x0283}, + {'\u01AC', '\u01AC', LowercaseSet, 0x01AD}, + {'\u01AE', '\u01AE', LowercaseSet, 0x0288}, + {'\u01AF', '\u01AF', LowercaseSet, 0x01B0}, + {'\u01B1', '\u01B2', LowercaseAdd, 217}, + {'\u01B3', '\u01B5', LowercaseBad, 0}, + {'\u01B7', '\u01B7', LowercaseSet, 0x0292}, + {'\u01B8', '\u01B8', LowercaseSet, 0x01B9}, + {'\u01BC', '\u01BC', LowercaseSet, 0x01BD}, + {'\u01C4', '\u01C5', LowercaseSet, 0x01C6}, + {'\u01C7', '\u01C8', LowercaseSet, 0x01C9}, + {'\u01CA', '\u01CB', LowercaseSet, 0x01CC}, + {'\u01CD', '\u01DB', LowercaseBad, 0}, + {'\u01DE', '\u01EE', LowercaseBor, 0}, + {'\u01F1', '\u01F2', LowercaseSet, 0x01F3}, + {'\u01F4', '\u01F4', LowercaseSet, 0x01F5}, + {'\u01FA', '\u0216', LowercaseBor, 0}, + {'\u0386', '\u0386', LowercaseSet, 0x03AC}, + {'\u0388', '\u038A', LowercaseAdd, 37}, + {'\u038C', '\u038C', LowercaseSet, 0x03CC}, + {'\u038E', '\u038F', LowercaseAdd, 63}, + {'\u0391', '\u03AB', LowercaseAdd, 32}, + {'\u03E2', '\u03EE', LowercaseBor, 0}, + {'\u0401', '\u040F', LowercaseAdd, 80}, + {'\u0410', '\u042F', LowercaseAdd, 32}, + {'\u0460', '\u0480', LowercaseBor, 0}, + {'\u0490', '\u04BE', LowercaseBor, 0}, + {'\u04C1', '\u04C3', LowercaseBad, 0}, + {'\u04C7', '\u04C7', LowercaseSet, 0x04C8}, + {'\u04CB', '\u04CB', LowercaseSet, 0x04CC}, + {'\u04D0', '\u04EA', LowercaseBor, 0}, + {'\u04EE', '\u04F4', LowercaseBor, 0}, + {'\u04F8', '\u04F8', LowercaseSet, 0x04F9}, + {'\u0531', '\u0556', LowercaseAdd, 48}, + {'\u10A0', '\u10C5', LowercaseAdd, 48}, + {'\u1E00', '\u1EF8', LowercaseBor, 0}, + {'\u1F08', '\u1F0F', LowercaseAdd, -8}, + {'\u1F18', '\u1F1F', LowercaseAdd, -8}, + {'\u1F28', '\u1F2F', LowercaseAdd, -8}, + {'\u1F38', '\u1F3F', LowercaseAdd, -8}, + {'\u1F48', '\u1F4D', LowercaseAdd, -8}, + {'\u1F59', '\u1F59', LowercaseSet, 0x1F51}, + {'\u1F5B', '\u1F5B', LowercaseSet, 0x1F53}, + {'\u1F5D', '\u1F5D', LowercaseSet, 0x1F55}, + {'\u1F5F', '\u1F5F', LowercaseSet, 0x1F57}, + {'\u1F68', '\u1F6F', LowercaseAdd, -8}, + {'\u1F88', '\u1F8F', LowercaseAdd, -8}, + {'\u1F98', '\u1F9F', LowercaseAdd, -8}, + {'\u1FA8', '\u1FAF', LowercaseAdd, -8}, + {'\u1FB8', '\u1FB9', LowercaseAdd, -8}, + {'\u1FBA', '\u1FBB', LowercaseAdd, -74}, + {'\u1FBC', '\u1FBC', LowercaseSet, 0x1FB3}, + {'\u1FC8', '\u1FCB', LowercaseAdd, -86}, + {'\u1FCC', '\u1FCC', LowercaseSet, 0x1FC3}, + {'\u1FD8', '\u1FD9', LowercaseAdd, -8}, + {'\u1FDA', '\u1FDB', LowercaseAdd, -100}, + {'\u1FE8', '\u1FE9', LowercaseAdd, -8}, + {'\u1FEA', '\u1FEB', LowercaseAdd, -112}, + {'\u1FEC', '\u1FEC', LowercaseSet, 0x1FE5}, + {'\u1FF8', '\u1FF9', LowercaseAdd, -128}, + {'\u1FFA', '\u1FFB', LowercaseAdd, -126}, + {'\u1FFC', '\u1FFC', LowercaseSet, 0x1FF3}, + {'\u2160', '\u216F', LowercaseAdd, 16}, + {'\u24B6', '\u24D0', LowercaseAdd, 26}, + {'\uFF21', '\uFF3A', LowercaseAdd, 32}, +} + +func (c *CharSet) addLowercaseRange(chMin, chMax rune) { + var i, iMax, iMid int + var chMinT, chMaxT rune + var lc lcMap + + for i, iMax = 0, len(lcTable); i < iMax; { + iMid = (i + iMax) / 2 + if lcTable[iMid].chMax < chMin { + i = iMid + 1 + } else { + iMax = iMid + } + } + + for ; i < len(lcTable); i++ { + lc = lcTable[i] + if lc.chMin > chMax { + return + } + chMinT = lc.chMin + if chMinT < chMin { + chMinT = chMin + } + + chMaxT = lc.chMax + if chMaxT > chMax { + chMaxT = chMax + } + + switch lc.op { + case LowercaseSet: + chMinT = rune(lc.data) + chMaxT = rune(lc.data) + case LowercaseAdd: + chMinT += lc.data + chMaxT += lc.data + case LowercaseBor: + chMinT |= 1 + chMaxT |= 1 + case LowercaseBad: + chMinT += (chMinT & 1) + chMaxT += (chMaxT & 1) + } + + if chMinT < chMin || chMaxT > chMax { + c.ranges = append(c.ranges, SingleRange{First: chMinT, Last: chMaxT}) + } + } +} + +// Determines whether two sets could overlap. +func (set1 *CharSet) MayOverlap(set2 *CharSet) bool { + // If the sets are identical, there's obviously overlap. + if set1.Equals(set2) { + return true + } + + // If either set is all-inclusive, there's overlap by definition (unless + // the other set is empty, but that's so rare it's not worth checking.) + if set1.IsAnything() || set2.IsAnything() { + return true + } + + // If one set is negated and the other one isn't, we're in one of two situations: + // - The remainder of the sets are identical, in which case these are inverses of + // each other, and they don't overlap. + // - The remainder of the sets aren't identical, in which case there's very likely + // overlap, and it's not worth spending more time investigating. + set1Negated := set1.IsNegated() + set2Negated := set2.IsNegated() + if set1Negated != set2Negated { + + return !set1.equals(set2, true) + } + + // If the sets are negated, since they're not equal, there's almost certainly overlap. + if set1Negated { + return true + } + + // Special-case some known, common classes that don't overlap. + if knownDistinctSets(set1, set2) || knownDistinctSets(set2, set1) { + return false + } + + // If set2 can be easily enumerated (e.g. no unicode categories), then enumerate it and + // check if any of its members are in set1. Otherwise, the same for set1. + if !set2.HasSubtraction() && len(set2.categories) == 0 { + if !set1.HasSubtraction() && len(set1.categories) == 0 { + // Both sets are just ranges, so compare those. Enumerating a large + // set such as ECMAScript's "." would visit about 1.1M runes. + return rangesOverlap(set1.ranges, set2.ranges) + } + return mayOverlapByEnumeration(set1, set2) + } else if !set1.HasSubtraction() && len(set1.categories) == 0 { + return mayOverlapByEnumeration(set2, set1) + } + + // Assume that everything else might overlap. In the future if it proved impactful, we could be more accurate here, + // at the exense of more computation time. + return true +} + +func knownDistinctSets(set1, set2 *CharSet) bool { + + return (set1.Equals(SpaceClass()) || set1.Equals(ECMASpaceClass())) && + (set2.Equals(DigitClass()) || set2.Equals(WordClass()) || + set2.Equals(ECMADigitClass()) || set2.Equals(ECMAWordClass())) + +} + +// rangesOverlap reports whether two range lists, each sorted by First as +// Contains also requires, share a rune. +func rangesOverlap(ranges1, ranges2 []SingleRange) bool { + for i, j := 0, 0; i < len(ranges1) && j < len(ranges2); { + switch { + case ranges1[i].Last < ranges2[j].First: + i++ + case ranges2[j].Last < ranges1[i].First: + j++ + default: + return true + } + } + return false +} + +func mayOverlapByEnumeration(set1, set2 *CharSet) bool { + for i := 0; i < len(set2.ranges); i++ { + for c := set2.ranges[i].First; c <= set2.ranges[i].Last; c++ { + if set1.CharIn(c) { + return true + } + } + } + + return false +} + +// Gets all of the characters in the specified set, storing them into the provided span. +// +// Only considers character classes that only contain sets (no categories), +// just simple sets containing starting/ending pairs (subtraction from those pairs +// is factored in, however).The returned characters may be negated: if IsNegated(set) +// is false, then the returned characters are the only ones that match; if it returns +// true, then the returned characters are the only ones that don't match. +func (c *CharSet) GetSetChars(maxChars int) []rune { + // don't support categories, just ranges + if len(c.categories) > 0 || len(c.ranges) > maxChars { + return nil + } + + // Negation with subtraction is too cumbersome to reason about efficiently. + if c.IsNegated() && c.HasSubtraction() { + return nil + } + + chars := make([]rune, 0, maxChars) + curWork := 0 + // Iterate through the pairs of ranges, storing each value in each range + // into the supplied span. If they all won't fit, we give up and return 0. + // Otherwise we return the number found. Note that we don't bother to handle + // the corner case where the last range's upper bound is LastChar (\uFFFF), + // based on it a) complicating things, and b) it being really unlikely to + // be part of a small set. + for _, r := range c.ranges { + // loop through each char in the range + for ch := r.First; ch <= r.Last; ch++ { + + // Keep track of how many characters we've checked. This could work + // just comparing count rather than evaluated, but we also want to + // limit how much work is done here, which we can do by constraining + // the number of checks to the size of the storage provided. + curWork++ + if curWork > maxChars { + return nil + } + + // If the set is all ranges but has a subtracted class, + // validate the char is actually in the set prior to storing it: + // it might be in the subtracted range. + if c.HasSubtraction() && !c.CharIn(ch) { + continue + } + chars = append(chars, ch) + } + } + return chars +} + +func (c *CharSet) Hash() []byte { + b := &bytes.Buffer{} + c.mapHashFill(b) + return b.Bytes() +} + +func (c *CharSet) Equals(c2 *CharSet) bool { + return c.equals(c2, false) +} + +func (c *CharSet) equals(c2 *CharSet, ignoreNegate bool) bool { + if c == nil && c2 == nil { + return true + } + if c == nil && c2 != nil || c2 == nil && c != nil { + return false + } + + if !ignoreNegate { + if c.negate != c2.negate { + return false + } + } + if c.anything != c2.anything { + return false + } + + if !slices.Equal(c.ranges, c2.ranges) { + return false + } + if !slices.Equal(c.categories, c2.categories) { + return false + } + + return c.sub.equals(c2.sub, false) +} + +var whitespaceChars = []rune{'\u0009', '\u000A', '\u000B', '\u000C', '\u000D', + '\u0020', '\u0085', '\u00A0', '\u1680', '\u2000', + '\u2001', '\u2002', '\u2003', '\u2004', '\u2005', + '\u2006', '\u2007', '\u2008', '\u2009', '\u200A', + '\u2028', '\u2029', '\u202F', '\u205F', '\u3000'} + +// Gets whether the specified set is a named set with a reasonably small count +// of Unicode characters. Designed to help the regexp code generator choose a better +// search algo for finding chars +// Description is a short name that can be used as part of a var name in code gen +func (c *CharSet) IsUnicodeCategoryOfSmallCharCount() (isSmall bool, chars []rune, negated bool, desc string) { + // figure out if we're SpaceClass, RE2SpaceClass, ECMASpaceClass or inverse + // "hash" ourselves -- this is actually fully serialized, not just hashed + if c.IsSingleton() { + return true, []rune{c.SingletonChar()}, false, "" + } + if c.IsSingletonInverse() { + return true, []rune{c.SingletonChar()}, true, "" + } + + if c.Equals(SpaceClass()) { + // we're SpaceClass + return true, whitespaceChars, false, "whitespace" + } + if c.Equals(NotSpaceClass()) { + // we're NotSpaceClass + return true, whitespaceChars, true, "whitespace" + } + + return false, nil, false, "" +} + +// Gets whether the set description string is for two ASCII letters that case +// to each other under IgnoreCase rules. +func (c *CharSet) containsAsciiIgnoreCaseCharacter() (bool, []rune) { + if c.IsNegated() { + return false, nil + } + // get up to 3 chars, just to be able to error on both "too many" and "too few" + twoChars := c.GetSetChars(3) + return len(twoChars) == 2 && twoChars[0] < unicode.MaxASCII && twoChars[1] < unicode.MaxASCII && + (twoChars[0]|0x20) == (twoChars[1]|0x20) && + unicode.IsLetter(twoChars[0]) && unicode.IsLetter(twoChars[1]), twoChars +} + +func anyParticipateInCaseConversion(chars []rune) bool { + for _, c := range chars { + if participatesInCaseConversion(c) { + return true + } + } + return false +} + +func participatesInCaseConversion(ch rune) bool { + /* + case UnicodeCategory.ClosePunctuation: + case UnicodeCategory.ConnectorPunctuation: + case UnicodeCategory.Control: + case UnicodeCategory.DashPunctuation: + case UnicodeCategory.DecimalDigitNumber: + case UnicodeCategory.FinalQuotePunctuation: + case UnicodeCategory.InitialQuotePunctuation: + case UnicodeCategory.LineSeparator: + case UnicodeCategory.OpenPunctuation: + case UnicodeCategory.OtherNumber: + case UnicodeCategory.OtherPunctuation: + case UnicodeCategory.ParagraphSeparator: + case UnicodeCategory.SpaceSeparator: + */ + return !unicode.In(ch, unicode.Pe, unicode.Pc, unicode.Cc, unicode.Pd, unicode.Nd, unicode.Pf, + unicode.Pi, unicode.Zl, unicode.Ps, unicode.No, unicode.Po, unicode.Zp, unicode.Zs) +} + +func anyParticipatesInCaseConversion(str string) bool { + for _, c := range str { + if participatesInCaseConversion(c) { + return true + } + } + return false +} + +func isAsciiRunes(in []rune) bool { + for i := 0; i < len(in); i++ { + if in[i] > unicode.MaxASCII { + return false + } + } + return true +} + +func (c CharSet) GetIfNRanges(n int) []SingleRange { + if len(c.categories) > 0 { + return nil + } + if c.sub != nil { + return nil + } + if len(c.ranges) == n { + return c.ranges[:n] + } + return nil +} + +func (c *CharSet) GetIfOnlyUnicodeCategories() (cats []Category, negate bool) { + if c.sub != nil { + return nil, false + } + if len(c.ranges) > 0 { + return nil, false + } + // all cats need to be rationalized to the same negation or not + if len(c.categories) == 0 { + return nil, false + } + + neg := c.categories[0].Negate + for _, cat := range c.categories { + if neg != cat.Negate || cat.Cat == SpaceCategoryText || cat.Cat == WordCategoryText || cat.set != nil { + // negate some and not others...a problem + // or one of our non-unicode categories + return nil, false + } + } + + // tell the caller to negate if either all the categories + // are negated or the set as a whole is negated, but not + // both + cats = make([]Category, len(c.categories)) + for i, cat := range c.categories { + cats[i] = cat.Category + } + return cats, neg != c.negate +} + +type CharClassAnalysisResults struct { + // true if the set contains only ranges; false if it contains Unicode categories and/or subtraction. + OnlyRanges bool + // true if we know for sure that the set contains only ASCII values; otherwise, false. + // This can only be true if OnlyRanges is true. + ContainsOnlyAscii bool + // true if we know for sure that the set doesn't contain any ASCII values; otherwise, false. + // This can only be true if OnlyRanges is true. + ContainsNoAscii bool + // true if we know for sure that all ASCII values are in the set; otherwise, false. + // This can only be true if OnlyRanges is true. + AllAsciiContained bool + // true if we know for sure that all non-ASCII values are in the set; otherwise, false. + // This can only be true if OnlyRanges is true. + AllNonAsciiContained bool + // The inclusive lower bound. + // This is only valid if OnlyRanges is true. + LowerBoundInclusiveIfOnlyRanges rune + // The exclusive upper bound. + // This is only valid if OnlyRanges is true. + UpperBoundExclusiveIfOnlyRanges rune +} + +// Analyzes the set to determine some basic properties that can be used to optimize usage. +func (set *CharSet) Analyze() CharClassAnalysisResults { + // The analysis is performed based entirely on ranges contained within the set. + // Thus, we require that it can be "easily enumerated", meaning it contains only + // ranges (and more specifically those with both the lower inclusive and upper + // exclusive bounds specified). We also permit the set to contain a subtracted + // character class, as for non-negated sets, that can only narrow what's permitted, + // and the analysis can be performed on the overestimate of the set prior to subtraction. + // However, negation is performed before subtraction, which means we can't trust + // the ranges to inform AllNonAsciiContained and AllAsciiContained, as the subtraction + // could create holes in those. As such, while we can permit subtraction for non-negated + // sets, for negated sets, we need to bail. + if (set.IsNegated() && set.HasSubtraction()) || len(set.categories) > 0 || len(set.ranges) == 0 { + // We can't make any strong claims about the set. + return CharClassAnalysisResults{} + } + + firstValueInclusive := set.ranges[0].First + lastValueExclusive := set.ranges[len(set.ranges)-1].Last + 1 + + if set.IsNegated() { + // We're negated: if the upper bound of the range is ASCII, that means everything + // above it is actually included, meaning all non-ASCII are in the class. + // Similarly if the lower bound is non-ASCII, that means in a negated world + // everything ASCII is included. + return CharClassAnalysisResults{ + OnlyRanges: true, + AllNonAsciiContained: lastValueExclusive <= unicode.MaxASCII, + AllAsciiContained: firstValueInclusive >= unicode.MaxASCII, + ContainsNoAscii: firstValueInclusive == 0 && set.ranges[0].Last >= unicode.MaxASCII, + ContainsOnlyAscii: false, + LowerBoundInclusiveIfOnlyRanges: firstValueInclusive, + UpperBoundExclusiveIfOnlyRanges: lastValueExclusive, + } + } + + // If the upper bound is ASCII, that means everything included in the class is ASCII. + // Similarly if the lower bound is non-ASCII, that means no ASCII is in the class. + return CharClassAnalysisResults{ + OnlyRanges: true, + AllNonAsciiContained: false, + AllAsciiContained: firstValueInclusive == 0 && set.ranges[0].Last >= unicode.MaxASCII && !set.HasSubtraction(), + ContainsOnlyAscii: lastValueExclusive <= unicode.MaxASCII, + ContainsNoAscii: firstValueInclusive >= unicode.MaxASCII, + LowerBoundInclusiveIfOnlyRanges: firstValueInclusive, + UpperBoundExclusiveIfOnlyRanges: lastValueExclusive, + } +} diff --git a/vendor/github.com/dlclark/regexp2/v2/syntax/code.go b/vendor/github.com/dlclark/regexp2/v2/syntax/code.go new file mode 100644 index 000000000..3f26f9586 --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/code.go @@ -0,0 +1,393 @@ +package syntax + +import ( + "bytes" + "fmt" + "math" +) + +// similar to prog.go in the go regex package...also with comment 'may not belong in this package' + +// File provides operator constants for use by the Builder and the Machine. + +// Implementation notes: +// +// Regexps are built into RegexCodes, which contain an operation array, +// a string table, and some constants. +// +// Each operation is one of the codes below, followed by the integer +// operands specified for each op. +// +// Strings and sets are indices into a string table. + +type InstOp int + +const ( + // lef/back operands description + + Onerep InstOp = 0 // lef,back char,min,max a {n} + Notonerep InstOp = 1 // lef,back char,min,max .{n} + Setrep InstOp = 2 // lef,back set,min,max [\d]{n} + + Oneloop InstOp = 3 // lef,back char,min,max a {,n} + Notoneloop InstOp = 4 // lef,back char,min,max .{,n} + Setloop InstOp = 5 // lef,back set,min,max [\d]{,n} + + Onelazy InstOp = 6 // lef,back char,min,max a {,n}? + Notonelazy InstOp = 7 // lef,back char,min,max .{,n}? + Setlazy InstOp = 8 // lef,back set,min,max [\d]{,n}? + + One InstOp = 9 // lef char a + Notone InstOp = 10 // lef char [^a] + Set InstOp = 11 // lef set [a-z\s] \w \s \d + + Multi InstOp = 12 // lef string abcd + Ref InstOp = 13 // lef group \# + + Bol InstOp = 14 // ^ + Eol InstOp = 15 // $ + Boundary InstOp = 16 // \b + Nonboundary InstOp = 17 // \B + Beginning InstOp = 18 // \A + Start InstOp = 19 // \G + EndZ InstOp = 20 // \Z + End InstOp = 21 // \Z + + Nothing InstOp = 22 // Reject! + + // Primitive control structures + + Lazybranch InstOp = 23 // back jump straight first + Branchmark InstOp = 24 // back jump branch first for loop + Lazybranchmark InstOp = 25 // back jump straight first for loop + Nullcount InstOp = 26 // back val set counter, null mark + Setcount InstOp = 27 // back val set counter, make mark + Branchcount InstOp = 28 // back jump,limit branch++ if zero<=c impl group slots + Capsize int // number of impl group slots + FcPrefix *Prefix // the set of candidate first characters (may be null) + BmPrefix *BmPrefix // the fixed prefix string as a Boyer-Moore machine (may be null) + Anchors AnchorLoc // the set of zero-length start anchors (RegexFCD.Bol, etc) + RightToLeft bool // true if right to left + FindOptimizations *FindOptimizations // analyzed candidate search strategy + QuickCodes []int // bool-only code with unobservable captures removed + QuickDispatches []DispatchTable // lightweight tables targeting QuickCodes + CaptureSlotInUse []bool // capture slots observable by the pattern itself during quick matches + // LeftContextRunes is how many runes before a candidate start matching may + // inspect. 0 means none, 1 means a single previous rune (or slack so ^/\A + // do not see the candidate as the origin), and -1 means do not slice + // (lookbehind or \G). + LeftContextRunes int +} + +// DispatchTable maps disjoint character sets to branch indices. Larger tables +// use a direct ASCII lookup, small tables use compact masks, and non-ASCII +// runes inspect the full sets. +type DispatchTable struct { + Sets []int + Branches []int + ASCII *[128]uint16 // entry index + 1; zero means no branch + ASCIIMasks []uint64 // two membership words per branch when ASCII is nil +} + +// captureSlotsInUse returns the capture slots whose values can affect matching. +// Group 0 is always retained as the success marker. Ordinary captures that are +// never referenced by the pattern may be omitted by bool-only matching APIs. +func captureSlotsInUse(root *RegexNode, capsize int, caps map[int]int) []bool { + inUse := make([]bool, capsize) + if capsize > 0 { + inUse[0] = true + } + mark := func(number int) { + if number < 0 { + return + } + slot := number + if caps != nil { + slot = caps[number] + } + inUse[slot] = true + } + stack := []*RegexNode{root} + for len(stack) > 0 { + node := stack[len(stack)-1] + stack = stack[:len(stack)-1] + switch node.T { + case NtRef, NtBackRefCond: + mark(node.M) + case NtCapture: + // Balancing groups both observe and mutate capture state. Keep both + // sides live even if no later backreference refers to them. + if node.N != -1 { + mark(node.M) + mark(node.N) + } + } + // Synthetic resets mutate state but do not observe it. A slot only + // needs retaining if an actual reference or balancing group uses it. + stack = append(stack, node.Children...) + } + return inUse +} + +// PrepareCharSetASCIIBitmaps builds bounded ASCII lookup tables for compiled +// character classes before the regexp is shared across goroutines. +func (c *Code) PrepareCharSetASCIIBitmaps() { + if c == nil { + return + } + for _, set := range c.Sets { + set.prepareASCIIBitmap() + } + if c.FcPrefix != nil { + c.FcPrefix.PrefixSet.prepareASCIIBitmap() + } + if c.FindOptimizations != nil { + for _, set := range c.FindOptimizations.FixedDistanceSets { + set.Set.prepareASCIIBitmap() + } + if c.FindOptimizations.LiteralAfterLoop != nil && c.FindOptimizations.LiteralAfterLoop.LoopNode != nil { + c.FindOptimizations.LiteralAfterLoop.LoopNode.Set.prepareASCIIBitmap() + } + } +} + +func opcodeBacktracks(op InstOp) bool { + op &= Mask + + switch op { + case Oneloop, Notoneloop, Setloop, Onelazy, Notonelazy, Setlazy, Lazybranch, Branchmark, Lazybranchmark, + Nullcount, Setcount, Branchcount, Lazybranchcount, Setmark, Capturemark, Getmark, Setjump, Backjump, + Forejump, Goto, ResetCapture: + return true + + default: + return false + } +} + +func opcodeSize(op InstOp) int { + op &= Mask + + switch op { + case Nothing, Bol, Eol, Boundary, Nonboundary, ECMABoundary, NonECMABoundary, Beginning, Start, EndZ, + End, Nullmark, Setmark, Getmark, Setjump, Backjump, Forejump, Stop, UpdateBumpalong, Grapheme: + return 1 + + case One, Notone, Multi, Ref, Testref, Goto, Nullcount, Setcount, Lazybranch, Branchmark, Lazybranchmark, + Prune, Set, Dispatch, ResetCapture: + return 2 + + case Capturemark, Branchcount, Lazybranchcount, Onerep, Notonerep, Oneloop, Notoneloop, Onelazy, Notonelazy, + Setlazy, Setrep, Setloop, Oneloopatomic, Notoneloopatomic, Setloopatomic: + return 3 + + default: + panic(fmt.Errorf("unexpected op code: %v", op)) + } +} + +var codeStr = []string{ + "Onerep", "Notonerep", "Setrep", + "Oneloop", "Notoneloop", "Setloop", + "Onelazy", "Notonelazy", "Setlazy", + "One", "Notone", "Set", + "Multi", "Ref", + "Bol", "Eol", "Boundary", "Nonboundary", "Beginning", "Start", "EndZ", "End", + "Nothing", + "Lazybranch", "Branchmark", "Lazybranchmark", + "Nullcount", "Setcount", "Branchcount", "Lazybranchcount", + "Nullmark", "Setmark", "Capturemark", "Getmark", + "Setjump", "Backjump", "Forejump", "Testref", "Goto", + "Prune", "Stop", + "ECMABoundary", "NonECMABoundary", + "Oneloopatomic", "Notoneloopatomic", "Setloopatomic", + "Bumpalong", "Grapheme", "Dispatch", "ResetCapture", +} + +func operatorDescription(op InstOp) string { + desc := codeStr[op&Mask] + if (op & Ci) != 0 { + desc += "-Ci" + } + if (op & Rtl) != 0 { + desc += "-Rtl" + } + if (op & Back) != 0 { + desc += "-Back" + } + if (op & Back2) != 0 { + desc += "-Back2" + } + + return desc +} + +// OpcodeDescription is a humman readable string of the specific offset +func (c *Code) OpcodeDescription(offset int) string { + buf := &bytes.Buffer{} + + op := InstOp(c.Codes[offset]) + fmt.Fprintf(buf, "%06d ", offset) + + if opcodeBacktracks(op & Mask) { + buf.WriteString("*") + } else { + buf.WriteString(" ") + } + buf.WriteString(operatorDescription(op)) + buf.WriteString("(") + op &= Mask + + switch op { + case One, Notone, Onerep, Notonerep, Oneloop, Notoneloop, Onelazy, Notonelazy, + Oneloopatomic, Notoneloopatomic: + buf.WriteString("Ch = ") + buf.WriteString(CharDescription(rune(c.Codes[offset+1]))) + + case Set, Setrep, Setloop, Setlazy, Setloopatomic: + buf.WriteString("Set = ") + buf.WriteString(c.Sets[c.Codes[offset+1]].String()) + + case Dispatch: + tableIndex := c.Codes[offset+1] + fmt.Fprintf(buf, "Table = %d", tableIndex) + if tableIndex >= 0 && tableIndex < len(c.Dispatches) { + table := &c.Dispatches[tableIndex] + for i, setIndex := range table.Sets { + fmt.Fprintf(buf, ", %s -> %d", c.Sets[setIndex].String(), table.Branches[i]) + } + } + + case Multi: + fmt.Fprintf(buf, "String = %s", string(c.Strings[c.Codes[offset+1]])) + + case Ref, Testref, ResetCapture: + fmt.Fprintf(buf, "Index = %d", c.Codes[offset+1]) + + case Capturemark: + fmt.Fprintf(buf, "Index = %d", c.Codes[offset+1]) + if c.Codes[offset+2] != -1 { + fmt.Fprintf(buf, ", Unindex = %d", c.Codes[offset+2]) + } + + case Nullcount, Setcount: + fmt.Fprintf(buf, "Value = %d", c.Codes[offset+1]) + + case Goto, Lazybranch, Branchmark, Lazybranchmark, Branchcount, Lazybranchcount: + fmt.Fprintf(buf, "Addr = %d", c.Codes[offset+1]) + } + + switch op { + case Onerep, Notonerep, Oneloop, Notoneloop, Onelazy, Notonelazy, Setrep, Setloop, Setlazy, + Oneloopatomic, Notoneloopatomic, Setloopatomic: + buf.WriteString(", Rep = ") + if c.Codes[offset+2] == math.MaxInt32 { + buf.WriteString("inf") + } else { + fmt.Fprintf(buf, "%d", c.Codes[offset+2]) + } + + case Branchcount, Lazybranchcount: + buf.WriteString(", Limit = ") + if c.Codes[offset+2] == math.MaxInt32 { + buf.WriteString("inf") + } else { + fmt.Fprintf(buf, "%d", c.Codes[offset+2]) + } + + } + + buf.WriteString(")") + + return buf.String() +} + +func (c *Code) Dump() string { + buf := &bytes.Buffer{} + + if c.RightToLeft { + fmt.Fprintln(buf, "Direction: right-to-left") + } else { + fmt.Fprintln(buf, "Direction: left-to-right") + } + if c.FcPrefix == nil { + fmt.Fprintln(buf, "Firstchars: n/a") + } else { + fmt.Fprintf(buf, "Firstchars: %v\n", c.FcPrefix.PrefixSet.String()) + } + + if c.BmPrefix == nil { + fmt.Fprintln(buf, "Prefix: n/a") + } else { + fmt.Fprintf(buf, "Prefix: %v\n", Escape(c.BmPrefix.String())) + } + + fmt.Fprintf(buf, "Anchors: %v\n", c.Anchors) + if c.FindOptimizations != nil { + fmt.Fprint(buf, c.FindOptimizations.Dump()) + } + fmt.Fprintln(buf) + + if c.BmPrefix != nil { + fmt.Fprintln(buf, "BoyerMoore:") + fmt.Fprintln(buf, c.BmPrefix.Dump(" ")) + } + for i := 0; i < len(c.Codes); i += opcodeSize(InstOp(c.Codes[i])) { + fmt.Fprintln(buf, c.OpcodeDescription(i)) + } + + return buf.String() +} diff --git a/vendor/github.com/dlclark/regexp2/v2/syntax/ecma_unicode.go b/vendor/github.com/dlclark/regexp2/v2/syntax/ecma_unicode.go new file mode 100644 index 000000000..7ef7dd15b --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/ecma_unicode.go @@ -0,0 +1,216 @@ +package syntax + +import ( + "slices" + "strings" + "sync" + "unicode" +) + +// Inline at most 256 bytes of ranges per property escape. Larger properties +// share immutable ranges, avoiding copies in every syntax tree and runner. +const ecmaPropertyRangeLimit = 32 + +// The prefix cannot occur in a parsed property name. Encoding the complement +// and folding in the key also lets generated runners restore the same set. +const ecmaPropertyPrefix = "\x00ecma:" + +var ecmaPropertyCache sync.Map // map[string]func() *CharSet + +func ecmaPropertySet(key string) *CharSet { + if cached, ok := ecmaPropertyCache.Load(key); ok { + return cached.(func() *CharSet)() + } + build := sync.OnceValue(func() *CharSet { + flags := key[len(ecmaPropertyPrefix):] + ranges := ecmaRangesForProperty(flags[2:]) + set := &CharSet{} + if flags[0] == 'P' { + set.ranges = appendECMAComplement(nil, ranges) + } else { + // Folding and canonicalization must not mutate generated data. + set.ranges = slices.Clone(ranges) + } + // Complement before folding: /\P{Lowercase_Letter}/iu includes + // both "a" and "A". Use the same folding as inline character sets. + // https://tc39.es/ecma262/#sec-runtime-semantics-compiletocharset + if flags[1] == 'i' { + set.addCaseEquivalences(ECMAScript | Unicode | IgnoreCase) + } else { + set.canonicalize() + } + // Discard spare capacity left by merging/folding before sharing. + set.ranges = append([]SingleRange(nil), set.ranges...) + return set + }) + actual, _ := ecmaPropertyCache.LoadOrStore(key, build) + return actual.(func() *CharSet)() +} + +func appendECMAComplement(dst, ranges []SingleRange) []SingleRange { + next := rune(0) + for _, r := range ranges { + if next < r.First { + dst = append(dst, SingleRange{next, r.First - 1}) + } + next = r.Last + 1 + } + if next <= unicode.MaxRune { + dst = append(dst, SingleRange{next, unicode.MaxRune}) + } + return dst +} + +// ECMAScript accepts exact Unicode aliases, only General_Category values or +// supported binary properties alone, and only gc/sc/scx with an explicit value. +// Keep this resolver separate from the permissive aliases used by other modes. +// +// ECMA-262, UnicodePropertyValueExpression early errors, UnicodeMatchProperty, +// and UnicodeMatchPropertyValue (including the prohibition on loose matching): +// https://tc39.es/ecma262/#sec-patterns-static-semantics-early-errors +// https://tc39.es/ecma262/#sec-runtime-semantics-unicodematchproperty-p +// https://tc39.es/ecma262/#sec-runtime-semantics-unicodematchpropertyvalue-p-v +func canonicalECMAProperty(name string) (string, bool) { + if property, value, hasValue := strings.Cut(name, "="); hasValue { + switch property { + case "General_Category", "gc": + category, ok := ecmaCategoryAliases[value] + return "gc=" + category, ok + case "Script", "sc", "Script_Extensions", "scx": + script, ok := ecmaScriptAliases[value] + // Alias spelling is fixed, but available scripts follow the + // consumer's Go Unicode version. These two special values have + // no table in unicode.Scripts. + ok = ok && (unicode.Scripts[script] != nil || script == "Unknown" || script == "Katakana_Or_Hiragana") + key := "sc=" + script + if property == "Script_Extensions" || property == "scx" { + key = "scx=" + script + } + return key, ok + } + return "", false + } + if category, ok := ecmaCategoryAliases[name]; ok { + return "gc=" + category, true + } + property, ok := ecmaBinaryAliases[name] + return property, ok +} + +func (p *parser) addProperty(cc *CharSet, property string, negate, ignoreCase bool) { + if !p.useOptionE() || !p.useOptionU() { + cc.addCategory(property, negate, ignoreCase) + return + } + + // Assigned is the complement of the current Go toolchain's Unassigned + // category, rather than a separately embedded Unicode-version snapshot. + if property == "Assigned" { + property, negate = "gc=Cn", !negate + } + flags := [2]byte{'p', '-'} + if negate { + flags[0] = 'P' + } + if ignoreCase { + flags[1] = 'i' + } + key := ecmaPropertyPrefix + string(flags[:]) + property + set := ecmaPropertySet(key) + if len(set.ranges) > ecmaPropertyRangeLimit { + cc.addCategories(Category{Cat: key}) + return + } + if set.negate { + cc.ranges = appendECMAComplement(cc.ranges, set.ranges) + cc.canonicalize() + } else { + cc.addRanges(set.ranges) + } +} + +func ecmaRangesForProperty(property string) []SingleRange { + if category, ok := strings.CutPrefix(property, "gc="); ok { + return ecmaRangesFromTable(unicode.Categories[category]) + } + if script, ok := strings.CutPrefix(property, "sc="); ok { + return ecmaRangesForScript(script) + } + if script, ok := strings.CutPrefix(property, "scx="); ok { + // Remove all explicit overrides from Script, then add the overrides + // that include this script. In particular, Common and Inherited + // must lose characters explicitly assigned to other script sets. + // https://www.unicode.org/reports/tr24/#Script_Extensions_Def + base := ecmaRangesForScript(script) + var result []SingleRange + j := 0 + for _, r := range base { + next := r.First + for j < len(ecmaScriptExtensionOverrides) && ecmaScriptExtensionOverrides[j].Last < next { + j++ + } + for k := j; k < len(ecmaScriptExtensionOverrides) && ecmaScriptExtensionOverrides[k].First <= r.Last; k++ { + override := ecmaScriptExtensionOverrides[k] + if next < override.First { + result = append(result, SingleRange{next, override.First - 1}) + } + if next <= override.Last { + next = override.Last + 1 + } + } + if next <= r.Last { + result = append(result, SingleRange{next, r.Last}) + } + } + set := CharSet{ranges: append(result, ecmaScriptExtensions[script]...)} + set.canonicalize() + return set.ranges + } + if table := unicode.Properties[property]; table != nil { + return ecmaRangesFromTable(table) + } + if table := unicodeAliasCategories[property]; table != nil { + return ecmaRangesFromTable(table) + } + return ecmaPropertyRanges[property] +} + +func ecmaRangesForScript(script string) []SingleRange { + if script == "Katakana_Or_Hiragana" { + return nil // A valid Unicode alias with no characters assigned to it. + } + if script == "Unknown" { + // UAX #24 assigns Unknown to unassigned, private-use, and surrogate + // code points. Derive it from Go so new assignments follow the toolchain. + // https://www.unicode.org/reports/tr24/#Common_Inherited + set := CharSet{} + for _, table := range []*unicode.RangeTable{unicode.Cn, unicode.Co, unicode.Cs} { + set.ranges = append(set.ranges, ecmaRangesFromTable(table)...) + } + set.canonicalize() + return set.ranges + } + return ecmaRangesFromTable(unicode.Scripts[script]) +} + +// Expand strided Go tables lazily into the shared property cache; their full +// contents aren't embedded again in the package's generated Unicode data. +func ecmaRangesFromTable(table *unicode.RangeTable) []SingleRange { + ranges := make([]SingleRange, 0, len(table.R16)+len(table.R32)) + add := func(lo, hi, stride rune) { + if stride == 1 { + ranges = append(ranges, SingleRange{lo, hi}) + return + } + for r := lo; r <= hi; r += stride { + ranges = append(ranges, SingleRange{r, r}) + } + } + for _, r := range table.R16 { + add(rune(r.Lo), rune(r.Hi), rune(r.Stride)) + } + for _, r := range table.R32 { + add(rune(r.Lo), rune(r.Hi), rune(r.Stride)) + } + return ranges +} diff --git a/vendor/github.com/dlclark/regexp2/v2/syntax/ecma_unicode_tables.go b/vendor/github.com/dlclark/regexp2/v2/syntax/ecma_unicode_tables.go new file mode 100644 index 000000000..bd86c46d2 --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/ecma_unicode_tables.go @@ -0,0 +1,11968 @@ +// Code generated by go run ./internal/unicodegen; DO NOT EDIT. +// Unicode 17.0.0; see internal/unicodegen/UNICODE-LICENSE.txt. +// Categories, scripts, and built-in binary properties come from the consumer's Go toolchain. +package syntax + +var ecmaBinaryAliases = map[string]string{ + "AHex": "ASCII_Hex_Digit", + "ASCII": "ASCII", + "ASCII_Hex_Digit": "ASCII_Hex_Digit", + "Alpha": "Alphabetic", + "Alphabetic": "Alphabetic", + "Any": "Any", + "Assigned": "Assigned", + "Bidi_C": "Bidi_Control", + "Bidi_Control": "Bidi_Control", + "Bidi_M": "Bidi_Mirrored", + "Bidi_Mirrored": "Bidi_Mirrored", + "CI": "Case_Ignorable", + "CWCF": "Changes_When_Casefolded", + "CWCM": "Changes_When_Casemapped", + "CWKCF": "Changes_When_NFKC_Casefolded", + "CWL": "Changes_When_Lowercased", + "CWT": "Changes_When_Titlecased", + "CWU": "Changes_When_Uppercased", + "Case_Ignorable": "Case_Ignorable", + "Cased": "Cased", + "Changes_When_Casefolded": "Changes_When_Casefolded", + "Changes_When_Casemapped": "Changes_When_Casemapped", + "Changes_When_Lowercased": "Changes_When_Lowercased", + "Changes_When_NFKC_Casefolded": "Changes_When_NFKC_Casefolded", + "Changes_When_Titlecased": "Changes_When_Titlecased", + "Changes_When_Uppercased": "Changes_When_Uppercased", + "DI": "Default_Ignorable_Code_Point", + "Dash": "Dash", + "Default_Ignorable_Code_Point": "Default_Ignorable_Code_Point", + "Dep": "Deprecated", + "Deprecated": "Deprecated", + "Dia": "Diacritic", + "Diacritic": "Diacritic", + "EBase": "Emoji_Modifier_Base", + "EComp": "Emoji_Component", + "EMod": "Emoji_Modifier", + "EPres": "Emoji_Presentation", + "Emoji": "Emoji", + "Emoji_Component": "Emoji_Component", + "Emoji_Modifier": "Emoji_Modifier", + "Emoji_Modifier_Base": "Emoji_Modifier_Base", + "Emoji_Presentation": "Emoji_Presentation", + "Ext": "Extender", + "ExtPict": "Extended_Pictographic", + "Extended_Pictographic": "Extended_Pictographic", + "Extender": "Extender", + "Gr_Base": "Grapheme_Base", + "Gr_Ext": "Grapheme_Extend", + "Grapheme_Base": "Grapheme_Base", + "Grapheme_Extend": "Grapheme_Extend", + "Hex": "Hex_Digit", + "Hex_Digit": "Hex_Digit", + "IDC": "ID_Continue", + "IDS": "ID_Start", + "IDSB": "IDS_Binary_Operator", + "IDST": "IDS_Trinary_Operator", + "IDS_Binary_Operator": "IDS_Binary_Operator", + "IDS_Trinary_Operator": "IDS_Trinary_Operator", + "ID_Continue": "ID_Continue", + "ID_Start": "ID_Start", + "Ideo": "Ideographic", + "Ideographic": "Ideographic", + "Join_C": "Join_Control", + "Join_Control": "Join_Control", + "LOE": "Logical_Order_Exception", + "Logical_Order_Exception": "Logical_Order_Exception", + "Lower": "Lowercase", + "Lowercase": "Lowercase", + "Math": "Math", + "NChar": "Noncharacter_Code_Point", + "Noncharacter_Code_Point": "Noncharacter_Code_Point", + "Pat_Syn": "Pattern_Syntax", + "Pat_WS": "Pattern_White_Space", + "Pattern_Syntax": "Pattern_Syntax", + "Pattern_White_Space": "Pattern_White_Space", + "QMark": "Quotation_Mark", + "Quotation_Mark": "Quotation_Mark", + "RI": "Regional_Indicator", + "Radical": "Radical", + "Regional_Indicator": "Regional_Indicator", + "SD": "Soft_Dotted", + "STerm": "Sentence_Terminal", + "Sentence_Terminal": "Sentence_Terminal", + "Soft_Dotted": "Soft_Dotted", + "Term": "Terminal_Punctuation", + "Terminal_Punctuation": "Terminal_Punctuation", + "UIdeo": "Unified_Ideograph", + "Unified_Ideograph": "Unified_Ideograph", + "Upper": "Uppercase", + "Uppercase": "Uppercase", + "VS": "Variation_Selector", + "Variation_Selector": "Variation_Selector", + "White_Space": "White_Space", + "XIDC": "XID_Continue", + "XIDS": "XID_Start", + "XID_Continue": "XID_Continue", + "XID_Start": "XID_Start", + "space": "White_Space", +} + +var ecmaCategoryAliases = map[string]string{ + "C": "C", + "Cased_Letter": "LC", + "Cc": "Cc", + "Cf": "Cf", + "Close_Punctuation": "Pe", + "Cn": "Cn", + "Co": "Co", + "Combining_Mark": "M", + "Connector_Punctuation": "Pc", + "Control": "Cc", + "Cs": "Cs", + "Currency_Symbol": "Sc", + "Dash_Punctuation": "Pd", + "Decimal_Number": "Nd", + "Enclosing_Mark": "Me", + "Final_Punctuation": "Pf", + "Format": "Cf", + "Initial_Punctuation": "Pi", + "L": "L", + "LC": "LC", + "Letter": "L", + "Letter_Number": "Nl", + "Line_Separator": "Zl", + "Ll": "Ll", + "Lm": "Lm", + "Lo": "Lo", + "Lowercase_Letter": "Ll", + "Lt": "Lt", + "Lu": "Lu", + "M": "M", + "Mark": "M", + "Math_Symbol": "Sm", + "Mc": "Mc", + "Me": "Me", + "Mn": "Mn", + "Modifier_Letter": "Lm", + "Modifier_Symbol": "Sk", + "N": "N", + "Nd": "Nd", + "Nl": "Nl", + "No": "No", + "Nonspacing_Mark": "Mn", + "Number": "N", + "Open_Punctuation": "Ps", + "Other": "C", + "Other_Letter": "Lo", + "Other_Number": "No", + "Other_Punctuation": "Po", + "Other_Symbol": "So", + "P": "P", + "Paragraph_Separator": "Zp", + "Pc": "Pc", + "Pd": "Pd", + "Pe": "Pe", + "Pf": "Pf", + "Pi": "Pi", + "Po": "Po", + "Private_Use": "Co", + "Ps": "Ps", + "Punctuation": "P", + "S": "S", + "Sc": "Sc", + "Separator": "Z", + "Sk": "Sk", + "Sm": "Sm", + "So": "So", + "Space_Separator": "Zs", + "Spacing_Mark": "Mc", + "Surrogate": "Cs", + "Symbol": "S", + "Titlecase_Letter": "Lt", + "Unassigned": "Cn", + "Uppercase_Letter": "Lu", + "Z": "Z", + "Zl": "Zl", + "Zp": "Zp", + "Zs": "Zs", + "cntrl": "Cc", + "digit": "Nd", + "punct": "P", +} + +var ecmaScriptAliases = map[string]string{ + "Adlam": "Adlam", + "Adlm": "Adlam", + "Aghb": "Caucasian_Albanian", + "Ahom": "Ahom", + "Anatolian_Hieroglyphs": "Anatolian_Hieroglyphs", + "Arab": "Arabic", + "Arabic": "Arabic", + "Armenian": "Armenian", + "Armi": "Imperial_Aramaic", + "Armn": "Armenian", + "Avestan": "Avestan", + "Avst": "Avestan", + "Bali": "Balinese", + "Balinese": "Balinese", + "Bamu": "Bamum", + "Bamum": "Bamum", + "Bass": "Bassa_Vah", + "Bassa_Vah": "Bassa_Vah", + "Batak": "Batak", + "Batk": "Batak", + "Beng": "Bengali", + "Bengali": "Bengali", + "Berf": "Beria_Erfe", + "Beria_Erfe": "Beria_Erfe", + "Bhaiksuki": "Bhaiksuki", + "Bhks": "Bhaiksuki", + "Bopo": "Bopomofo", + "Bopomofo": "Bopomofo", + "Brah": "Brahmi", + "Brahmi": "Brahmi", + "Brai": "Braille", + "Braille": "Braille", + "Bugi": "Buginese", + "Buginese": "Buginese", + "Buhd": "Buhid", + "Buhid": "Buhid", + "Cakm": "Chakma", + "Canadian_Aboriginal": "Canadian_Aboriginal", + "Cans": "Canadian_Aboriginal", + "Cari": "Carian", + "Carian": "Carian", + "Caucasian_Albanian": "Caucasian_Albanian", + "Chakma": "Chakma", + "Cham": "Cham", + "Cher": "Cherokee", + "Cherokee": "Cherokee", + "Chorasmian": "Chorasmian", + "Chrs": "Chorasmian", + "Common": "Common", + "Copt": "Coptic", + "Coptic": "Coptic", + "Cpmn": "Cypro_Minoan", + "Cprt": "Cypriot", + "Cuneiform": "Cuneiform", + "Cypriot": "Cypriot", + "Cypro_Minoan": "Cypro_Minoan", + "Cyrillic": "Cyrillic", + "Cyrl": "Cyrillic", + "Deseret": "Deseret", + "Deva": "Devanagari", + "Devanagari": "Devanagari", + "Diak": "Dives_Akuru", + "Dives_Akuru": "Dives_Akuru", + "Dogr": "Dogra", + "Dogra": "Dogra", + "Dsrt": "Deseret", + "Dupl": "Duployan", + "Duployan": "Duployan", + "Egyp": "Egyptian_Hieroglyphs", + "Egyptian_Hieroglyphs": "Egyptian_Hieroglyphs", + "Elba": "Elbasan", + "Elbasan": "Elbasan", + "Elym": "Elymaic", + "Elymaic": "Elymaic", + "Ethi": "Ethiopic", + "Ethiopic": "Ethiopic", + "Gara": "Garay", + "Garay": "Garay", + "Geor": "Georgian", + "Georgian": "Georgian", + "Glag": "Glagolitic", + "Glagolitic": "Glagolitic", + "Gong": "Gunjala_Gondi", + "Gonm": "Masaram_Gondi", + "Goth": "Gothic", + "Gothic": "Gothic", + "Gran": "Grantha", + "Grantha": "Grantha", + "Greek": "Greek", + "Grek": "Greek", + "Gujarati": "Gujarati", + "Gujr": "Gujarati", + "Gukh": "Gurung_Khema", + "Gunjala_Gondi": "Gunjala_Gondi", + "Gurmukhi": "Gurmukhi", + "Guru": "Gurmukhi", + "Gurung_Khema": "Gurung_Khema", + "Han": "Han", + "Hang": "Hangul", + "Hangul": "Hangul", + "Hani": "Han", + "Hanifi_Rohingya": "Hanifi_Rohingya", + "Hano": "Hanunoo", + "Hanunoo": "Hanunoo", + "Hatr": "Hatran", + "Hatran": "Hatran", + "Hebr": "Hebrew", + "Hebrew": "Hebrew", + "Hira": "Hiragana", + "Hiragana": "Hiragana", + "Hluw": "Anatolian_Hieroglyphs", + "Hmng": "Pahawh_Hmong", + "Hmnp": "Nyiakeng_Puachue_Hmong", + "Hrkt": "Katakana_Or_Hiragana", + "Hung": "Old_Hungarian", + "Imperial_Aramaic": "Imperial_Aramaic", + "Inherited": "Inherited", + "Inscriptional_Pahlavi": "Inscriptional_Pahlavi", + "Inscriptional_Parthian": "Inscriptional_Parthian", + "Ital": "Old_Italic", + "Java": "Javanese", + "Javanese": "Javanese", + "Kaithi": "Kaithi", + "Kali": "Kayah_Li", + "Kana": "Katakana", + "Kannada": "Kannada", + "Katakana": "Katakana", + "Katakana_Or_Hiragana": "Katakana_Or_Hiragana", + "Kawi": "Kawi", + "Kayah_Li": "Kayah_Li", + "Khar": "Kharoshthi", + "Kharoshthi": "Kharoshthi", + "Khitan_Small_Script": "Khitan_Small_Script", + "Khmer": "Khmer", + "Khmr": "Khmer", + "Khoj": "Khojki", + "Khojki": "Khojki", + "Khudawadi": "Khudawadi", + "Kirat_Rai": "Kirat_Rai", + "Kits": "Khitan_Small_Script", + "Knda": "Kannada", + "Krai": "Kirat_Rai", + "Kthi": "Kaithi", + "Lana": "Tai_Tham", + "Lao": "Lao", + "Laoo": "Lao", + "Latin": "Latin", + "Latn": "Latin", + "Lepc": "Lepcha", + "Lepcha": "Lepcha", + "Limb": "Limbu", + "Limbu": "Limbu", + "Lina": "Linear_A", + "Linb": "Linear_B", + "Linear_A": "Linear_A", + "Linear_B": "Linear_B", + "Lisu": "Lisu", + "Lyci": "Lycian", + "Lycian": "Lycian", + "Lydi": "Lydian", + "Lydian": "Lydian", + "Mahajani": "Mahajani", + "Mahj": "Mahajani", + "Maka": "Makasar", + "Makasar": "Makasar", + "Malayalam": "Malayalam", + "Mand": "Mandaic", + "Mandaic": "Mandaic", + "Mani": "Manichaean", + "Manichaean": "Manichaean", + "Marc": "Marchen", + "Marchen": "Marchen", + "Masaram_Gondi": "Masaram_Gondi", + "Medefaidrin": "Medefaidrin", + "Medf": "Medefaidrin", + "Meetei_Mayek": "Meetei_Mayek", + "Mend": "Mende_Kikakui", + "Mende_Kikakui": "Mende_Kikakui", + "Merc": "Meroitic_Cursive", + "Mero": "Meroitic_Hieroglyphs", + "Meroitic_Cursive": "Meroitic_Cursive", + "Meroitic_Hieroglyphs": "Meroitic_Hieroglyphs", + "Miao": "Miao", + "Mlym": "Malayalam", + "Modi": "Modi", + "Mong": "Mongolian", + "Mongolian": "Mongolian", + "Mro": "Mro", + "Mroo": "Mro", + "Mtei": "Meetei_Mayek", + "Mult": "Multani", + "Multani": "Multani", + "Myanmar": "Myanmar", + "Mymr": "Myanmar", + "Nabataean": "Nabataean", + "Nag_Mundari": "Nag_Mundari", + "Nagm": "Nag_Mundari", + "Nand": "Nandinagari", + "Nandinagari": "Nandinagari", + "Narb": "Old_North_Arabian", + "Nbat": "Nabataean", + "New_Tai_Lue": "New_Tai_Lue", + "Newa": "Newa", + "Nko": "Nko", + "Nkoo": "Nko", + "Nshu": "Nushu", + "Nushu": "Nushu", + "Nyiakeng_Puachue_Hmong": "Nyiakeng_Puachue_Hmong", + "Ogam": "Ogham", + "Ogham": "Ogham", + "Ol_Chiki": "Ol_Chiki", + "Ol_Onal": "Ol_Onal", + "Olck": "Ol_Chiki", + "Old_Hungarian": "Old_Hungarian", + "Old_Italic": "Old_Italic", + "Old_North_Arabian": "Old_North_Arabian", + "Old_Permic": "Old_Permic", + "Old_Persian": "Old_Persian", + "Old_Sogdian": "Old_Sogdian", + "Old_South_Arabian": "Old_South_Arabian", + "Old_Turkic": "Old_Turkic", + "Old_Uyghur": "Old_Uyghur", + "Onao": "Ol_Onal", + "Oriya": "Oriya", + "Orkh": "Old_Turkic", + "Orya": "Oriya", + "Osage": "Osage", + "Osge": "Osage", + "Osma": "Osmanya", + "Osmanya": "Osmanya", + "Ougr": "Old_Uyghur", + "Pahawh_Hmong": "Pahawh_Hmong", + "Palm": "Palmyrene", + "Palmyrene": "Palmyrene", + "Pau_Cin_Hau": "Pau_Cin_Hau", + "Pauc": "Pau_Cin_Hau", + "Perm": "Old_Permic", + "Phag": "Phags_Pa", + "Phags_Pa": "Phags_Pa", + "Phli": "Inscriptional_Pahlavi", + "Phlp": "Psalter_Pahlavi", + "Phnx": "Phoenician", + "Phoenician": "Phoenician", + "Plrd": "Miao", + "Prti": "Inscriptional_Parthian", + "Psalter_Pahlavi": "Psalter_Pahlavi", + "Qaac": "Coptic", + "Qaai": "Inherited", + "Rejang": "Rejang", + "Rjng": "Rejang", + "Rohg": "Hanifi_Rohingya", + "Runic": "Runic", + "Runr": "Runic", + "Samaritan": "Samaritan", + "Samr": "Samaritan", + "Sarb": "Old_South_Arabian", + "Saur": "Saurashtra", + "Saurashtra": "Saurashtra", + "Sgnw": "SignWriting", + "Sharada": "Sharada", + "Shavian": "Shavian", + "Shaw": "Shavian", + "Shrd": "Sharada", + "Sidd": "Siddham", + "Siddham": "Siddham", + "Sidetic": "Sidetic", + "Sidt": "Sidetic", + "SignWriting": "SignWriting", + "Sind": "Khudawadi", + "Sinh": "Sinhala", + "Sinhala": "Sinhala", + "Sogd": "Sogdian", + "Sogdian": "Sogdian", + "Sogo": "Old_Sogdian", + "Sora": "Sora_Sompeng", + "Sora_Sompeng": "Sora_Sompeng", + "Soyo": "Soyombo", + "Soyombo": "Soyombo", + "Sund": "Sundanese", + "Sundanese": "Sundanese", + "Sunu": "Sunuwar", + "Sunuwar": "Sunuwar", + "Sylo": "Syloti_Nagri", + "Syloti_Nagri": "Syloti_Nagri", + "Syrc": "Syriac", + "Syriac": "Syriac", + "Tagalog": "Tagalog", + "Tagb": "Tagbanwa", + "Tagbanwa": "Tagbanwa", + "Tai_Le": "Tai_Le", + "Tai_Tham": "Tai_Tham", + "Tai_Viet": "Tai_Viet", + "Tai_Yo": "Tai_Yo", + "Takr": "Takri", + "Takri": "Takri", + "Tale": "Tai_Le", + "Talu": "New_Tai_Lue", + "Tamil": "Tamil", + "Taml": "Tamil", + "Tang": "Tangut", + "Tangsa": "Tangsa", + "Tangut": "Tangut", + "Tavt": "Tai_Viet", + "Tayo": "Tai_Yo", + "Telu": "Telugu", + "Telugu": "Telugu", + "Tfng": "Tifinagh", + "Tglg": "Tagalog", + "Thaa": "Thaana", + "Thaana": "Thaana", + "Thai": "Thai", + "Tibetan": "Tibetan", + "Tibt": "Tibetan", + "Tifinagh": "Tifinagh", + "Tirh": "Tirhuta", + "Tirhuta": "Tirhuta", + "Tnsa": "Tangsa", + "Todhri": "Todhri", + "Todr": "Todhri", + "Tolong_Siki": "Tolong_Siki", + "Tols": "Tolong_Siki", + "Toto": "Toto", + "Tulu_Tigalari": "Tulu_Tigalari", + "Tutg": "Tulu_Tigalari", + "Ugar": "Ugaritic", + "Ugaritic": "Ugaritic", + "Unknown": "Unknown", + "Vai": "Vai", + "Vaii": "Vai", + "Vith": "Vithkuqi", + "Vithkuqi": "Vithkuqi", + "Wancho": "Wancho", + "Wara": "Warang_Citi", + "Warang_Citi": "Warang_Citi", + "Wcho": "Wancho", + "Xpeo": "Old_Persian", + "Xsux": "Cuneiform", + "Yezi": "Yezidi", + "Yezidi": "Yezidi", + "Yi": "Yi", + "Yiii": "Yi", + "Zanabazar_Square": "Zanabazar_Square", + "Zanb": "Zanabazar_Square", + "Zinh": "Inherited", + "Zyyy": "Common", + "Zzzz": "Unknown", +} + +// Binary properties unavailable in Go or our existing package tables. + +var ecmaPropertyRanges = map[string][]SingleRange{ + "ASCII": { + {0x0, 0x7F}, + }, + "Alphabetic": { + {0x41, 0x5A}, + {0x61, 0x7A}, + {0xAA, 0xAA}, + {0xB5, 0xB5}, + {0xBA, 0xBA}, + {0xC0, 0xD6}, + {0xD8, 0xF6}, + {0xF8, 0x2C1}, + {0x2C6, 0x2D1}, + {0x2E0, 0x2E4}, + {0x2EC, 0x2EC}, + {0x2EE, 0x2EE}, + {0x345, 0x345}, + {0x363, 0x374}, + {0x376, 0x377}, + {0x37A, 0x37D}, + {0x37F, 0x37F}, + {0x386, 0x386}, + {0x388, 0x38A}, + {0x38C, 0x38C}, + {0x38E, 0x3A1}, + {0x3A3, 0x3F5}, + {0x3F7, 0x481}, + {0x48A, 0x52F}, + {0x531, 0x556}, + {0x559, 0x559}, + {0x560, 0x588}, + {0x5B0, 0x5BD}, + {0x5BF, 0x5BF}, + {0x5C1, 0x5C2}, + {0x5C4, 0x5C5}, + {0x5C7, 0x5C7}, + {0x5D0, 0x5EA}, + {0x5EF, 0x5F2}, + {0x610, 0x61A}, + {0x620, 0x657}, + {0x659, 0x65F}, + {0x66E, 0x6D3}, + {0x6D5, 0x6DC}, + {0x6E1, 0x6E8}, + {0x6ED, 0x6EF}, + {0x6FA, 0x6FC}, + {0x6FF, 0x6FF}, + {0x710, 0x73F}, + {0x74D, 0x7B1}, + {0x7CA, 0x7EA}, + {0x7F4, 0x7F5}, + {0x7FA, 0x7FA}, + {0x800, 0x817}, + {0x81A, 0x82C}, + {0x840, 0x858}, + {0x860, 0x86A}, + {0x870, 0x887}, + {0x889, 0x88F}, + {0x897, 0x897}, + {0x8A0, 0x8C9}, + {0x8D4, 0x8DF}, + {0x8E3, 0x8E9}, + {0x8F0, 0x93B}, + {0x93D, 0x94C}, + {0x94E, 0x950}, + {0x955, 0x963}, + {0x971, 0x983}, + {0x985, 0x98C}, + {0x98F, 0x990}, + {0x993, 0x9A8}, + {0x9AA, 0x9B0}, + {0x9B2, 0x9B2}, + {0x9B6, 0x9B9}, + {0x9BD, 0x9C4}, + {0x9C7, 0x9C8}, + {0x9CB, 0x9CC}, + {0x9CE, 0x9CE}, + {0x9D7, 0x9D7}, + {0x9DC, 0x9DD}, + {0x9DF, 0x9E3}, + {0x9F0, 0x9F1}, + {0x9FC, 0x9FC}, + {0xA01, 0xA03}, + {0xA05, 0xA0A}, + {0xA0F, 0xA10}, + {0xA13, 0xA28}, + {0xA2A, 0xA30}, + {0xA32, 0xA33}, + {0xA35, 0xA36}, + {0xA38, 0xA39}, + {0xA3E, 0xA42}, + {0xA47, 0xA48}, + {0xA4B, 0xA4C}, + {0xA51, 0xA51}, + {0xA59, 0xA5C}, + {0xA5E, 0xA5E}, + {0xA70, 0xA75}, + {0xA81, 0xA83}, + {0xA85, 0xA8D}, + {0xA8F, 0xA91}, + {0xA93, 0xAA8}, + {0xAAA, 0xAB0}, + {0xAB2, 0xAB3}, + {0xAB5, 0xAB9}, + {0xABD, 0xAC5}, + {0xAC7, 0xAC9}, + {0xACB, 0xACC}, + {0xAD0, 0xAD0}, + {0xAE0, 0xAE3}, + {0xAF9, 0xAFC}, + {0xB01, 0xB03}, + {0xB05, 0xB0C}, + {0xB0F, 0xB10}, + {0xB13, 0xB28}, + {0xB2A, 0xB30}, + {0xB32, 0xB33}, + {0xB35, 0xB39}, + {0xB3D, 0xB44}, + {0xB47, 0xB48}, + {0xB4B, 0xB4C}, + {0xB56, 0xB57}, + {0xB5C, 0xB5D}, + {0xB5F, 0xB63}, + {0xB71, 0xB71}, + {0xB82, 0xB83}, + {0xB85, 0xB8A}, + {0xB8E, 0xB90}, + {0xB92, 0xB95}, + {0xB99, 0xB9A}, + {0xB9C, 0xB9C}, + {0xB9E, 0xB9F}, + {0xBA3, 0xBA4}, + {0xBA8, 0xBAA}, + {0xBAE, 0xBB9}, + {0xBBE, 0xBC2}, + {0xBC6, 0xBC8}, + {0xBCA, 0xBCC}, + {0xBD0, 0xBD0}, + {0xBD7, 0xBD7}, + {0xC00, 0xC0C}, + {0xC0E, 0xC10}, + {0xC12, 0xC28}, + {0xC2A, 0xC39}, + {0xC3D, 0xC44}, + {0xC46, 0xC48}, + {0xC4A, 0xC4C}, + {0xC55, 0xC56}, + {0xC58, 0xC5A}, + {0xC5C, 0xC5D}, + {0xC60, 0xC63}, + {0xC80, 0xC83}, + {0xC85, 0xC8C}, + {0xC8E, 0xC90}, + {0xC92, 0xCA8}, + {0xCAA, 0xCB3}, + {0xCB5, 0xCB9}, + {0xCBD, 0xCC4}, + {0xCC6, 0xCC8}, + {0xCCA, 0xCCC}, + {0xCD5, 0xCD6}, + {0xCDC, 0xCDE}, + {0xCE0, 0xCE3}, + {0xCF1, 0xCF3}, + {0xD00, 0xD0C}, + {0xD0E, 0xD10}, + {0xD12, 0xD3A}, + {0xD3D, 0xD44}, + {0xD46, 0xD48}, + {0xD4A, 0xD4C}, + {0xD4E, 0xD4E}, + {0xD54, 0xD57}, + {0xD5F, 0xD63}, + {0xD7A, 0xD7F}, + {0xD81, 0xD83}, + {0xD85, 0xD96}, + {0xD9A, 0xDB1}, + {0xDB3, 0xDBB}, + {0xDBD, 0xDBD}, + {0xDC0, 0xDC6}, + {0xDCF, 0xDD4}, + {0xDD6, 0xDD6}, + {0xDD8, 0xDDF}, + {0xDF2, 0xDF3}, + {0xE01, 0xE3A}, + {0xE40, 0xE46}, + {0xE4D, 0xE4D}, + {0xE81, 0xE82}, + {0xE84, 0xE84}, + {0xE86, 0xE8A}, + {0xE8C, 0xEA3}, + {0xEA5, 0xEA5}, + {0xEA7, 0xEB9}, + {0xEBB, 0xEBD}, + {0xEC0, 0xEC4}, + {0xEC6, 0xEC6}, + {0xECD, 0xECD}, + {0xEDC, 0xEDF}, + {0xF00, 0xF00}, + {0xF40, 0xF47}, + {0xF49, 0xF6C}, + {0xF71, 0xF83}, + {0xF88, 0xF97}, + {0xF99, 0xFBC}, + {0x1000, 0x1036}, + {0x1038, 0x1038}, + {0x103B, 0x103F}, + {0x1050, 0x108F}, + {0x109A, 0x109D}, + {0x10A0, 0x10C5}, + {0x10C7, 0x10C7}, + {0x10CD, 0x10CD}, + {0x10D0, 0x10FA}, + {0x10FC, 0x1248}, + {0x124A, 0x124D}, + {0x1250, 0x1256}, + {0x1258, 0x1258}, + {0x125A, 0x125D}, + {0x1260, 0x1288}, + {0x128A, 0x128D}, + {0x1290, 0x12B0}, + {0x12B2, 0x12B5}, + {0x12B8, 0x12BE}, + {0x12C0, 0x12C0}, + {0x12C2, 0x12C5}, + {0x12C8, 0x12D6}, + {0x12D8, 0x1310}, + {0x1312, 0x1315}, + {0x1318, 0x135A}, + {0x1380, 0x138F}, + {0x13A0, 0x13F5}, + {0x13F8, 0x13FD}, + {0x1401, 0x166C}, + {0x166F, 0x167F}, + {0x1681, 0x169A}, + {0x16A0, 0x16EA}, + {0x16EE, 0x16F8}, + {0x1700, 0x1713}, + {0x171F, 0x1733}, + {0x1740, 0x1753}, + {0x1760, 0x176C}, + {0x176E, 0x1770}, + {0x1772, 0x1773}, + {0x1780, 0x17B3}, + {0x17B6, 0x17C8}, + {0x17D7, 0x17D7}, + {0x17DC, 0x17DC}, + {0x1820, 0x1878}, + {0x1880, 0x18AA}, + {0x18B0, 0x18F5}, + {0x1900, 0x191E}, + {0x1920, 0x192B}, + {0x1930, 0x1938}, + {0x1950, 0x196D}, + {0x1970, 0x1974}, + {0x1980, 0x19AB}, + {0x19B0, 0x19C9}, + {0x1A00, 0x1A1B}, + {0x1A20, 0x1A5E}, + {0x1A61, 0x1A74}, + {0x1AA7, 0x1AA7}, + {0x1ABF, 0x1AC0}, + {0x1ACC, 0x1ACE}, + {0x1B00, 0x1B33}, + {0x1B35, 0x1B43}, + {0x1B45, 0x1B4C}, + {0x1B80, 0x1BA9}, + {0x1BAC, 0x1BAF}, + {0x1BBA, 0x1BE5}, + {0x1BE7, 0x1BF1}, + {0x1C00, 0x1C36}, + {0x1C4D, 0x1C4F}, + {0x1C5A, 0x1C7D}, + {0x1C80, 0x1C8A}, + {0x1C90, 0x1CBA}, + {0x1CBD, 0x1CBF}, + {0x1CE9, 0x1CEC}, + {0x1CEE, 0x1CF3}, + {0x1CF5, 0x1CF6}, + {0x1CFA, 0x1CFA}, + {0x1D00, 0x1DBF}, + {0x1DD3, 0x1DF4}, + {0x1E00, 0x1F15}, + {0x1F18, 0x1F1D}, + {0x1F20, 0x1F45}, + {0x1F48, 0x1F4D}, + {0x1F50, 0x1F57}, + {0x1F59, 0x1F59}, + {0x1F5B, 0x1F5B}, + {0x1F5D, 0x1F5D}, + {0x1F5F, 0x1F7D}, + {0x1F80, 0x1FB4}, + {0x1FB6, 0x1FBC}, + {0x1FBE, 0x1FBE}, + {0x1FC2, 0x1FC4}, + {0x1FC6, 0x1FCC}, + {0x1FD0, 0x1FD3}, + {0x1FD6, 0x1FDB}, + {0x1FE0, 0x1FEC}, + {0x1FF2, 0x1FF4}, + {0x1FF6, 0x1FFC}, + {0x2071, 0x2071}, + {0x207F, 0x207F}, + {0x2090, 0x209C}, + {0x2102, 0x2102}, + {0x2107, 0x2107}, + {0x210A, 0x2113}, + {0x2115, 0x2115}, + {0x2119, 0x211D}, + {0x2124, 0x2124}, + {0x2126, 0x2126}, + {0x2128, 0x2128}, + {0x212A, 0x212D}, + {0x212F, 0x2139}, + {0x213C, 0x213F}, + {0x2145, 0x2149}, + {0x214E, 0x214E}, + {0x2160, 0x2188}, + {0x24B6, 0x24E9}, + {0x2C00, 0x2CE4}, + {0x2CEB, 0x2CEE}, + {0x2CF2, 0x2CF3}, + {0x2D00, 0x2D25}, + {0x2D27, 0x2D27}, + {0x2D2D, 0x2D2D}, + {0x2D30, 0x2D67}, + {0x2D6F, 0x2D6F}, + {0x2D80, 0x2D96}, + {0x2DA0, 0x2DA6}, + {0x2DA8, 0x2DAE}, + {0x2DB0, 0x2DB6}, + {0x2DB8, 0x2DBE}, + {0x2DC0, 0x2DC6}, + {0x2DC8, 0x2DCE}, + {0x2DD0, 0x2DD6}, + {0x2DD8, 0x2DDE}, + {0x2DE0, 0x2DFF}, + {0x2E2F, 0x2E2F}, + {0x3005, 0x3007}, + {0x3021, 0x3029}, + {0x3031, 0x3035}, + {0x3038, 0x303C}, + {0x3041, 0x3096}, + {0x309D, 0x309F}, + {0x30A1, 0x30FA}, + {0x30FC, 0x30FF}, + {0x3105, 0x312F}, + {0x3131, 0x318E}, + {0x31A0, 0x31BF}, + {0x31F0, 0x31FF}, + {0x3400, 0x4DBF}, + {0x4E00, 0xA48C}, + {0xA4D0, 0xA4FD}, + {0xA500, 0xA60C}, + {0xA610, 0xA61F}, + {0xA62A, 0xA62B}, + {0xA640, 0xA66E}, + {0xA674, 0xA67B}, + {0xA67F, 0xA6EF}, + {0xA717, 0xA71F}, + {0xA722, 0xA788}, + {0xA78B, 0xA7DC}, + {0xA7F1, 0xA805}, + {0xA807, 0xA827}, + {0xA840, 0xA873}, + {0xA880, 0xA8C3}, + {0xA8C5, 0xA8C5}, + {0xA8F2, 0xA8F7}, + {0xA8FB, 0xA8FB}, + {0xA8FD, 0xA8FF}, + {0xA90A, 0xA92A}, + {0xA930, 0xA952}, + {0xA960, 0xA97C}, + {0xA980, 0xA9B2}, + {0xA9B4, 0xA9BF}, + {0xA9CF, 0xA9CF}, + {0xA9E0, 0xA9EF}, + {0xA9FA, 0xA9FE}, + {0xAA00, 0xAA36}, + {0xAA40, 0xAA4D}, + {0xAA60, 0xAA76}, + {0xAA7A, 0xAABE}, + {0xAAC0, 0xAAC0}, + {0xAAC2, 0xAAC2}, + {0xAADB, 0xAADD}, + {0xAAE0, 0xAAEF}, + {0xAAF2, 0xAAF5}, + {0xAB01, 0xAB06}, + {0xAB09, 0xAB0E}, + {0xAB11, 0xAB16}, + {0xAB20, 0xAB26}, + {0xAB28, 0xAB2E}, + {0xAB30, 0xAB5A}, + {0xAB5C, 0xAB69}, + {0xAB70, 0xABEA}, + {0xAC00, 0xD7A3}, + {0xD7B0, 0xD7C6}, + {0xD7CB, 0xD7FB}, + {0xF900, 0xFA6D}, + {0xFA70, 0xFAD9}, + {0xFB00, 0xFB06}, + {0xFB13, 0xFB17}, + {0xFB1D, 0xFB28}, + {0xFB2A, 0xFB36}, + {0xFB38, 0xFB3C}, + {0xFB3E, 0xFB3E}, + {0xFB40, 0xFB41}, + {0xFB43, 0xFB44}, + {0xFB46, 0xFBB1}, + {0xFBD3, 0xFD3D}, + {0xFD50, 0xFD8F}, + {0xFD92, 0xFDC7}, + {0xFDF0, 0xFDFB}, + {0xFE70, 0xFE74}, + {0xFE76, 0xFEFC}, + {0xFF21, 0xFF3A}, + {0xFF41, 0xFF5A}, + {0xFF66, 0xFFBE}, + {0xFFC2, 0xFFC7}, + {0xFFCA, 0xFFCF}, + {0xFFD2, 0xFFD7}, + {0xFFDA, 0xFFDC}, + {0x10000, 0x1000B}, + {0x1000D, 0x10026}, + {0x10028, 0x1003A}, + {0x1003C, 0x1003D}, + {0x1003F, 0x1004D}, + {0x10050, 0x1005D}, + {0x10080, 0x100FA}, + {0x10140, 0x10174}, + {0x10280, 0x1029C}, + {0x102A0, 0x102D0}, + {0x10300, 0x1031F}, + {0x1032D, 0x1034A}, + {0x10350, 0x1037A}, + {0x10380, 0x1039D}, + {0x103A0, 0x103C3}, + {0x103C8, 0x103CF}, + {0x103D1, 0x103D5}, + {0x10400, 0x1049D}, + {0x104B0, 0x104D3}, + {0x104D8, 0x104FB}, + {0x10500, 0x10527}, + {0x10530, 0x10563}, + {0x10570, 0x1057A}, + {0x1057C, 0x1058A}, + {0x1058C, 0x10592}, + {0x10594, 0x10595}, + {0x10597, 0x105A1}, + {0x105A3, 0x105B1}, + {0x105B3, 0x105B9}, + {0x105BB, 0x105BC}, + {0x105C0, 0x105F3}, + {0x10600, 0x10736}, + {0x10740, 0x10755}, + {0x10760, 0x10767}, + {0x10780, 0x10785}, + {0x10787, 0x107B0}, + {0x107B2, 0x107BA}, + {0x10800, 0x10805}, + {0x10808, 0x10808}, + {0x1080A, 0x10835}, + {0x10837, 0x10838}, + {0x1083C, 0x1083C}, + {0x1083F, 0x10855}, + {0x10860, 0x10876}, + {0x10880, 0x1089E}, + {0x108E0, 0x108F2}, + {0x108F4, 0x108F5}, + {0x10900, 0x10915}, + {0x10920, 0x10939}, + {0x10940, 0x10959}, + {0x10980, 0x109B7}, + {0x109BE, 0x109BF}, + {0x10A00, 0x10A03}, + {0x10A05, 0x10A06}, + {0x10A0C, 0x10A13}, + {0x10A15, 0x10A17}, + {0x10A19, 0x10A35}, + {0x10A60, 0x10A7C}, + {0x10A80, 0x10A9C}, + {0x10AC0, 0x10AC7}, + {0x10AC9, 0x10AE4}, + {0x10B00, 0x10B35}, + {0x10B40, 0x10B55}, + {0x10B60, 0x10B72}, + {0x10B80, 0x10B91}, + {0x10C00, 0x10C48}, + {0x10C80, 0x10CB2}, + {0x10CC0, 0x10CF2}, + {0x10D00, 0x10D27}, + {0x10D4A, 0x10D65}, + {0x10D69, 0x10D69}, + {0x10D6F, 0x10D85}, + {0x10E80, 0x10EA9}, + {0x10EAB, 0x10EAC}, + {0x10EB0, 0x10EB1}, + {0x10EC2, 0x10EC7}, + {0x10EFA, 0x10EFC}, + {0x10F00, 0x10F1C}, + {0x10F27, 0x10F27}, + {0x10F30, 0x10F45}, + {0x10F70, 0x10F81}, + {0x10FB0, 0x10FC4}, + {0x10FE0, 0x10FF6}, + {0x11000, 0x11045}, + {0x11071, 0x11075}, + {0x11080, 0x110B8}, + {0x110C2, 0x110C2}, + {0x110D0, 0x110E8}, + {0x11100, 0x11132}, + {0x11144, 0x11147}, + {0x11150, 0x11172}, + {0x11176, 0x11176}, + {0x11180, 0x111BF}, + {0x111C1, 0x111C4}, + {0x111CE, 0x111CF}, + {0x111DA, 0x111DA}, + {0x111DC, 0x111DC}, + {0x11200, 0x11211}, + {0x11213, 0x11234}, + {0x11237, 0x11237}, + {0x1123E, 0x11241}, + {0x11280, 0x11286}, + {0x11288, 0x11288}, + {0x1128A, 0x1128D}, + {0x1128F, 0x1129D}, + {0x1129F, 0x112A8}, + {0x112B0, 0x112E8}, + {0x11300, 0x11303}, + {0x11305, 0x1130C}, + {0x1130F, 0x11310}, + {0x11313, 0x11328}, + {0x1132A, 0x11330}, + {0x11332, 0x11333}, + {0x11335, 0x11339}, + {0x1133D, 0x11344}, + {0x11347, 0x11348}, + {0x1134B, 0x1134C}, + {0x11350, 0x11350}, + {0x11357, 0x11357}, + {0x1135D, 0x11363}, + {0x11380, 0x11389}, + {0x1138B, 0x1138B}, + {0x1138E, 0x1138E}, + {0x11390, 0x113B5}, + {0x113B7, 0x113C0}, + {0x113C2, 0x113C2}, + {0x113C5, 0x113C5}, + {0x113C7, 0x113CA}, + {0x113CC, 0x113CD}, + {0x113D1, 0x113D1}, + {0x113D3, 0x113D3}, + {0x11400, 0x11441}, + {0x11443, 0x11445}, + {0x11447, 0x1144A}, + {0x1145F, 0x11461}, + {0x11480, 0x114C1}, + {0x114C4, 0x114C5}, + {0x114C7, 0x114C7}, + {0x11580, 0x115B5}, + {0x115B8, 0x115BE}, + {0x115D8, 0x115DD}, + {0x11600, 0x1163E}, + {0x11640, 0x11640}, + {0x11644, 0x11644}, + {0x11680, 0x116B5}, + {0x116B8, 0x116B8}, + {0x11700, 0x1171A}, + {0x1171D, 0x1172A}, + {0x11740, 0x11746}, + {0x11800, 0x11838}, + {0x118A0, 0x118DF}, + {0x118FF, 0x11906}, + {0x11909, 0x11909}, + {0x1190C, 0x11913}, + {0x11915, 0x11916}, + {0x11918, 0x11935}, + {0x11937, 0x11938}, + {0x1193B, 0x1193C}, + {0x1193F, 0x11942}, + {0x119A0, 0x119A7}, + {0x119AA, 0x119D7}, + {0x119DA, 0x119DF}, + {0x119E1, 0x119E1}, + {0x119E3, 0x119E4}, + {0x11A00, 0x11A32}, + {0x11A35, 0x11A3E}, + {0x11A50, 0x11A97}, + {0x11A9D, 0x11A9D}, + {0x11AB0, 0x11AF8}, + {0x11B60, 0x11B67}, + {0x11BC0, 0x11BE0}, + {0x11C00, 0x11C08}, + {0x11C0A, 0x11C36}, + {0x11C38, 0x11C3E}, + {0x11C40, 0x11C40}, + {0x11C72, 0x11C8F}, + {0x11C92, 0x11CA7}, + {0x11CA9, 0x11CB6}, + {0x11D00, 0x11D06}, + {0x11D08, 0x11D09}, + {0x11D0B, 0x11D36}, + {0x11D3A, 0x11D3A}, + {0x11D3C, 0x11D3D}, + {0x11D3F, 0x11D41}, + {0x11D43, 0x11D43}, + {0x11D46, 0x11D47}, + {0x11D60, 0x11D65}, + {0x11D67, 0x11D68}, + {0x11D6A, 0x11D8E}, + {0x11D90, 0x11D91}, + {0x11D93, 0x11D96}, + {0x11D98, 0x11D98}, + {0x11DB0, 0x11DDB}, + {0x11EE0, 0x11EF6}, + {0x11F00, 0x11F10}, + {0x11F12, 0x11F3A}, + {0x11F3E, 0x11F40}, + {0x11FB0, 0x11FB0}, + {0x12000, 0x12399}, + {0x12400, 0x1246E}, + {0x12480, 0x12543}, + {0x12F90, 0x12FF0}, + {0x13000, 0x1342F}, + {0x13441, 0x13446}, + {0x13460, 0x143FA}, + {0x14400, 0x14646}, + {0x16100, 0x1612E}, + {0x16800, 0x16A38}, + {0x16A40, 0x16A5E}, + {0x16A70, 0x16ABE}, + {0x16AD0, 0x16AED}, + {0x16B00, 0x16B2F}, + {0x16B40, 0x16B43}, + {0x16B63, 0x16B77}, + {0x16B7D, 0x16B8F}, + {0x16D40, 0x16D6C}, + {0x16E40, 0x16E7F}, + {0x16EA0, 0x16EB8}, + {0x16EBB, 0x16ED3}, + {0x16F00, 0x16F4A}, + {0x16F4F, 0x16F87}, + {0x16F8F, 0x16F9F}, + {0x16FE0, 0x16FE1}, + {0x16FE3, 0x16FE3}, + {0x16FF0, 0x16FF6}, + {0x17000, 0x18CD5}, + {0x18CFF, 0x18D1E}, + {0x18D80, 0x18DF2}, + {0x1AFF0, 0x1AFF3}, + {0x1AFF5, 0x1AFFB}, + {0x1AFFD, 0x1AFFE}, + {0x1B000, 0x1B122}, + {0x1B132, 0x1B132}, + {0x1B150, 0x1B152}, + {0x1B155, 0x1B155}, + {0x1B164, 0x1B167}, + {0x1B170, 0x1B2FB}, + {0x1BC00, 0x1BC6A}, + {0x1BC70, 0x1BC7C}, + {0x1BC80, 0x1BC88}, + {0x1BC90, 0x1BC99}, + {0x1BC9E, 0x1BC9E}, + {0x1D400, 0x1D454}, + {0x1D456, 0x1D49C}, + {0x1D49E, 0x1D49F}, + {0x1D4A2, 0x1D4A2}, + {0x1D4A5, 0x1D4A6}, + {0x1D4A9, 0x1D4AC}, + {0x1D4AE, 0x1D4B9}, + {0x1D4BB, 0x1D4BB}, + {0x1D4BD, 0x1D4C3}, + {0x1D4C5, 0x1D505}, + {0x1D507, 0x1D50A}, + {0x1D50D, 0x1D514}, + {0x1D516, 0x1D51C}, + {0x1D51E, 0x1D539}, + {0x1D53B, 0x1D53E}, + {0x1D540, 0x1D544}, + {0x1D546, 0x1D546}, + {0x1D54A, 0x1D550}, + {0x1D552, 0x1D6A5}, + {0x1D6A8, 0x1D6C0}, + {0x1D6C2, 0x1D6DA}, + {0x1D6DC, 0x1D6FA}, + {0x1D6FC, 0x1D714}, + {0x1D716, 0x1D734}, + {0x1D736, 0x1D74E}, + {0x1D750, 0x1D76E}, + {0x1D770, 0x1D788}, + {0x1D78A, 0x1D7A8}, + {0x1D7AA, 0x1D7C2}, + {0x1D7C4, 0x1D7CB}, + {0x1DF00, 0x1DF1E}, + {0x1DF25, 0x1DF2A}, + {0x1E000, 0x1E006}, + {0x1E008, 0x1E018}, + {0x1E01B, 0x1E021}, + {0x1E023, 0x1E024}, + {0x1E026, 0x1E02A}, + {0x1E030, 0x1E06D}, + {0x1E08F, 0x1E08F}, + {0x1E100, 0x1E12C}, + {0x1E137, 0x1E13D}, + {0x1E14E, 0x1E14E}, + {0x1E290, 0x1E2AD}, + {0x1E2C0, 0x1E2EB}, + {0x1E4D0, 0x1E4EB}, + {0x1E5D0, 0x1E5ED}, + {0x1E5F0, 0x1E5F0}, + {0x1E6C0, 0x1E6DE}, + {0x1E6E0, 0x1E6F5}, + {0x1E6FE, 0x1E6FF}, + {0x1E7E0, 0x1E7E6}, + {0x1E7E8, 0x1E7EB}, + {0x1E7ED, 0x1E7EE}, + {0x1E7F0, 0x1E7FE}, + {0x1E800, 0x1E8C4}, + {0x1E900, 0x1E943}, + {0x1E947, 0x1E947}, + {0x1E94B, 0x1E94B}, + {0x1EE00, 0x1EE03}, + {0x1EE05, 0x1EE1F}, + {0x1EE21, 0x1EE22}, + {0x1EE24, 0x1EE24}, + {0x1EE27, 0x1EE27}, + {0x1EE29, 0x1EE32}, + {0x1EE34, 0x1EE37}, + {0x1EE39, 0x1EE39}, + {0x1EE3B, 0x1EE3B}, + {0x1EE42, 0x1EE42}, + {0x1EE47, 0x1EE47}, + {0x1EE49, 0x1EE49}, + {0x1EE4B, 0x1EE4B}, + {0x1EE4D, 0x1EE4F}, + {0x1EE51, 0x1EE52}, + {0x1EE54, 0x1EE54}, + {0x1EE57, 0x1EE57}, + {0x1EE59, 0x1EE59}, + {0x1EE5B, 0x1EE5B}, + {0x1EE5D, 0x1EE5D}, + {0x1EE5F, 0x1EE5F}, + {0x1EE61, 0x1EE62}, + {0x1EE64, 0x1EE64}, + {0x1EE67, 0x1EE6A}, + {0x1EE6C, 0x1EE72}, + {0x1EE74, 0x1EE77}, + {0x1EE79, 0x1EE7C}, + {0x1EE7E, 0x1EE7E}, + {0x1EE80, 0x1EE89}, + {0x1EE8B, 0x1EE9B}, + {0x1EEA1, 0x1EEA3}, + {0x1EEA5, 0x1EEA9}, + {0x1EEAB, 0x1EEBB}, + {0x1F130, 0x1F149}, + {0x1F150, 0x1F169}, + {0x1F170, 0x1F189}, + {0x20000, 0x2A6DF}, + {0x2A700, 0x2B81D}, + {0x2B820, 0x2CEAD}, + {0x2CEB0, 0x2EBE0}, + {0x2EBF0, 0x2EE5D}, + {0x2F800, 0x2FA1D}, + {0x30000, 0x3134A}, + {0x31350, 0x33479}, + }, + "Any": { + {0x0, 0x10FFFF}, + }, + "Bidi_Mirrored": { + {0x28, 0x29}, + {0x3C, 0x3C}, + {0x3E, 0x3E}, + {0x5B, 0x5B}, + {0x5D, 0x5D}, + {0x7B, 0x7B}, + {0x7D, 0x7D}, + {0xAB, 0xAB}, + {0xBB, 0xBB}, + {0xF3A, 0xF3D}, + {0x169B, 0x169C}, + {0x2039, 0x203A}, + {0x2045, 0x2046}, + {0x207D, 0x207E}, + {0x208D, 0x208E}, + {0x2140, 0x2140}, + {0x2201, 0x2204}, + {0x2208, 0x220D}, + {0x2211, 0x2211}, + {0x2215, 0x2216}, + {0x221A, 0x221D}, + {0x221F, 0x2222}, + {0x2224, 0x2224}, + {0x2226, 0x2226}, + {0x222B, 0x2233}, + {0x2239, 0x2239}, + {0x223B, 0x224C}, + {0x2252, 0x2255}, + {0x225F, 0x2260}, + {0x2262, 0x2262}, + {0x2264, 0x226B}, + {0x226D, 0x228C}, + {0x228F, 0x2292}, + {0x2298, 0x2298}, + {0x22A2, 0x22A3}, + {0x22A6, 0x22B8}, + {0x22BE, 0x22BF}, + {0x22C9, 0x22CD}, + {0x22D0, 0x22D1}, + {0x22D6, 0x22ED}, + {0x22F0, 0x22FF}, + {0x2308, 0x230B}, + {0x2320, 0x2321}, + {0x2329, 0x232A}, + {0x2768, 0x2775}, + {0x27C0, 0x27C0}, + {0x27C3, 0x27C6}, + {0x27C8, 0x27C9}, + {0x27CB, 0x27CD}, + {0x27D3, 0x27D6}, + {0x27DC, 0x27DE}, + {0x27E2, 0x27EF}, + {0x2983, 0x2998}, + {0x299B, 0x29A0}, + {0x29A2, 0x29AF}, + {0x29B8, 0x29B8}, + {0x29C0, 0x29C5}, + {0x29C9, 0x29C9}, + {0x29CE, 0x29D2}, + {0x29D4, 0x29D5}, + {0x29D8, 0x29DC}, + {0x29E1, 0x29E1}, + {0x29E3, 0x29E5}, + {0x29E8, 0x29E9}, + {0x29F4, 0x29F9}, + {0x29FC, 0x29FD}, + {0x2A0A, 0x2A1C}, + {0x2A1E, 0x2A21}, + {0x2A24, 0x2A24}, + {0x2A26, 0x2A26}, + {0x2A29, 0x2A29}, + {0x2A2B, 0x2A2E}, + {0x2A34, 0x2A35}, + {0x2A3C, 0x2A3E}, + {0x2A57, 0x2A58}, + {0x2A64, 0x2A65}, + {0x2A6A, 0x2A6D}, + {0x2A6F, 0x2A70}, + {0x2A73, 0x2A74}, + {0x2A79, 0x2AA3}, + {0x2AA6, 0x2AAD}, + {0x2AAF, 0x2AD6}, + {0x2ADC, 0x2ADC}, + {0x2ADE, 0x2ADE}, + {0x2AE2, 0x2AE6}, + {0x2AEC, 0x2AEE}, + {0x2AF3, 0x2AF3}, + {0x2AF7, 0x2AFB}, + {0x2AFD, 0x2AFD}, + {0x2BFE, 0x2BFE}, + {0x2E02, 0x2E05}, + {0x2E09, 0x2E0A}, + {0x2E0C, 0x2E0D}, + {0x2E1C, 0x2E1D}, + {0x2E20, 0x2E29}, + {0x2E55, 0x2E5C}, + {0x3008, 0x3011}, + {0x3014, 0x301B}, + {0xFE59, 0xFE5E}, + {0xFE64, 0xFE65}, + {0xFF08, 0xFF09}, + {0xFF1C, 0xFF1C}, + {0xFF1E, 0xFF1E}, + {0xFF3B, 0xFF3B}, + {0xFF3D, 0xFF3D}, + {0xFF5B, 0xFF5B}, + {0xFF5D, 0xFF5D}, + {0xFF5F, 0xFF60}, + {0xFF62, 0xFF63}, + {0x1D6DB, 0x1D6DB}, + {0x1D715, 0x1D715}, + {0x1D74F, 0x1D74F}, + {0x1D789, 0x1D789}, + {0x1D7C3, 0x1D7C3}, + }, + "Case_Ignorable": { + {0x27, 0x27}, + {0x2E, 0x2E}, + {0x3A, 0x3A}, + {0x5E, 0x5E}, + {0x60, 0x60}, + {0xA8, 0xA8}, + {0xAD, 0xAD}, + {0xAF, 0xAF}, + {0xB4, 0xB4}, + {0xB7, 0xB8}, + {0x2B0, 0x36F}, + {0x374, 0x375}, + {0x37A, 0x37A}, + {0x384, 0x385}, + {0x387, 0x387}, + {0x483, 0x489}, + {0x559, 0x559}, + {0x55F, 0x55F}, + {0x591, 0x5BD}, + {0x5BF, 0x5BF}, + {0x5C1, 0x5C2}, + {0x5C4, 0x5C5}, + {0x5C7, 0x5C7}, + {0x5F4, 0x5F4}, + {0x600, 0x605}, + {0x610, 0x61A}, + {0x61C, 0x61C}, + {0x640, 0x640}, + {0x64B, 0x65F}, + {0x670, 0x670}, + {0x6D6, 0x6DD}, + {0x6DF, 0x6E8}, + {0x6EA, 0x6ED}, + {0x70F, 0x70F}, + {0x711, 0x711}, + {0x730, 0x74A}, + {0x7A6, 0x7B0}, + {0x7EB, 0x7F5}, + {0x7FA, 0x7FA}, + {0x7FD, 0x7FD}, + {0x816, 0x82D}, + {0x859, 0x85B}, + {0x888, 0x888}, + {0x890, 0x891}, + {0x897, 0x89F}, + {0x8C9, 0x902}, + {0x93A, 0x93A}, + {0x93C, 0x93C}, + {0x941, 0x948}, + {0x94D, 0x94D}, + {0x951, 0x957}, + {0x962, 0x963}, + {0x971, 0x971}, + {0x981, 0x981}, + {0x9BC, 0x9BC}, + {0x9C1, 0x9C4}, + {0x9CD, 0x9CD}, + {0x9E2, 0x9E3}, + {0x9FE, 0x9FE}, + {0xA01, 0xA02}, + {0xA3C, 0xA3C}, + {0xA41, 0xA42}, + {0xA47, 0xA48}, + {0xA4B, 0xA4D}, + {0xA51, 0xA51}, + {0xA70, 0xA71}, + {0xA75, 0xA75}, + {0xA81, 0xA82}, + {0xABC, 0xABC}, + {0xAC1, 0xAC5}, + {0xAC7, 0xAC8}, + {0xACD, 0xACD}, + {0xAE2, 0xAE3}, + {0xAFA, 0xAFF}, + {0xB01, 0xB01}, + {0xB3C, 0xB3C}, + {0xB3F, 0xB3F}, + {0xB41, 0xB44}, + {0xB4D, 0xB4D}, + {0xB55, 0xB56}, + {0xB62, 0xB63}, + {0xB82, 0xB82}, + {0xBC0, 0xBC0}, + {0xBCD, 0xBCD}, + {0xC00, 0xC00}, + {0xC04, 0xC04}, + {0xC3C, 0xC3C}, + {0xC3E, 0xC40}, + {0xC46, 0xC48}, + {0xC4A, 0xC4D}, + {0xC55, 0xC56}, + {0xC62, 0xC63}, + {0xC81, 0xC81}, + {0xCBC, 0xCBC}, + {0xCBF, 0xCBF}, + {0xCC6, 0xCC6}, + {0xCCC, 0xCCD}, + {0xCE2, 0xCE3}, + {0xD00, 0xD01}, + {0xD3B, 0xD3C}, + {0xD41, 0xD44}, + {0xD4D, 0xD4D}, + {0xD62, 0xD63}, + {0xD81, 0xD81}, + {0xDCA, 0xDCA}, + {0xDD2, 0xDD4}, + {0xDD6, 0xDD6}, + {0xE31, 0xE31}, + {0xE34, 0xE3A}, + {0xE46, 0xE4E}, + {0xEB1, 0xEB1}, + {0xEB4, 0xEBC}, + {0xEC6, 0xEC6}, + {0xEC8, 0xECE}, + {0xF18, 0xF19}, + {0xF35, 0xF35}, + {0xF37, 0xF37}, + {0xF39, 0xF39}, + {0xF71, 0xF7E}, + {0xF80, 0xF84}, + {0xF86, 0xF87}, + {0xF8D, 0xF97}, + {0xF99, 0xFBC}, + {0xFC6, 0xFC6}, + {0x102D, 0x1030}, + {0x1032, 0x1037}, + {0x1039, 0x103A}, + {0x103D, 0x103E}, + {0x1058, 0x1059}, + {0x105E, 0x1060}, + {0x1071, 0x1074}, + {0x1082, 0x1082}, + {0x1085, 0x1086}, + {0x108D, 0x108D}, + {0x109D, 0x109D}, + {0x10FC, 0x10FC}, + {0x135D, 0x135F}, + {0x1712, 0x1714}, + {0x1732, 0x1733}, + {0x1752, 0x1753}, + {0x1772, 0x1773}, + {0x17B4, 0x17B5}, + {0x17B7, 0x17BD}, + {0x17C6, 0x17C6}, + {0x17C9, 0x17D3}, + {0x17D7, 0x17D7}, + {0x17DD, 0x17DD}, + {0x180B, 0x180F}, + {0x1843, 0x1843}, + {0x1885, 0x1886}, + {0x18A9, 0x18A9}, + {0x1920, 0x1922}, + {0x1927, 0x1928}, + {0x1932, 0x1932}, + {0x1939, 0x193B}, + {0x1A17, 0x1A18}, + {0x1A1B, 0x1A1B}, + {0x1A56, 0x1A56}, + {0x1A58, 0x1A5E}, + {0x1A60, 0x1A60}, + {0x1A62, 0x1A62}, + {0x1A65, 0x1A6C}, + {0x1A73, 0x1A7C}, + {0x1A7F, 0x1A7F}, + {0x1AA7, 0x1AA7}, + {0x1AB0, 0x1ADD}, + {0x1AE0, 0x1AEB}, + {0x1B00, 0x1B03}, + {0x1B34, 0x1B34}, + {0x1B36, 0x1B3A}, + {0x1B3C, 0x1B3C}, + {0x1B42, 0x1B42}, + {0x1B6B, 0x1B73}, + {0x1B80, 0x1B81}, + {0x1BA2, 0x1BA5}, + {0x1BA8, 0x1BA9}, + {0x1BAB, 0x1BAD}, + {0x1BE6, 0x1BE6}, + {0x1BE8, 0x1BE9}, + {0x1BED, 0x1BED}, + {0x1BEF, 0x1BF1}, + {0x1C2C, 0x1C33}, + {0x1C36, 0x1C37}, + {0x1C78, 0x1C7D}, + {0x1CD0, 0x1CD2}, + {0x1CD4, 0x1CE0}, + {0x1CE2, 0x1CE8}, + {0x1CED, 0x1CED}, + {0x1CF4, 0x1CF4}, + {0x1CF8, 0x1CF9}, + {0x1D2C, 0x1D6A}, + {0x1D78, 0x1D78}, + {0x1D9B, 0x1DFF}, + {0x1FBD, 0x1FBD}, + {0x1FBF, 0x1FC1}, + {0x1FCD, 0x1FCF}, + {0x1FDD, 0x1FDF}, + {0x1FED, 0x1FEF}, + {0x1FFD, 0x1FFE}, + {0x200B, 0x200F}, + {0x2018, 0x2019}, + {0x2024, 0x2024}, + {0x2027, 0x2027}, + {0x202A, 0x202E}, + {0x2060, 0x2064}, + {0x2066, 0x206F}, + {0x2071, 0x2071}, + {0x207F, 0x207F}, + {0x2090, 0x209C}, + {0x20D0, 0x20F0}, + {0x2C7C, 0x2C7D}, + {0x2CEF, 0x2CF1}, + {0x2D6F, 0x2D6F}, + {0x2D7F, 0x2D7F}, + {0x2DE0, 0x2DFF}, + {0x2E2F, 0x2E2F}, + {0x3005, 0x3005}, + {0x302A, 0x302D}, + {0x3031, 0x3035}, + {0x303B, 0x303B}, + {0x3099, 0x309E}, + {0x30FC, 0x30FE}, + {0xA015, 0xA015}, + {0xA4F8, 0xA4FD}, + {0xA60C, 0xA60C}, + {0xA66F, 0xA672}, + {0xA674, 0xA67D}, + {0xA67F, 0xA67F}, + {0xA69C, 0xA69F}, + {0xA6F0, 0xA6F1}, + {0xA700, 0xA721}, + {0xA770, 0xA770}, + {0xA788, 0xA78A}, + {0xA7F1, 0xA7F4}, + {0xA7F8, 0xA7F9}, + {0xA802, 0xA802}, + {0xA806, 0xA806}, + {0xA80B, 0xA80B}, + {0xA825, 0xA826}, + {0xA82C, 0xA82C}, + {0xA8C4, 0xA8C5}, + {0xA8E0, 0xA8F1}, + {0xA8FF, 0xA8FF}, + {0xA926, 0xA92D}, + {0xA947, 0xA951}, + {0xA980, 0xA982}, + {0xA9B3, 0xA9B3}, + {0xA9B6, 0xA9B9}, + {0xA9BC, 0xA9BD}, + {0xA9CF, 0xA9CF}, + {0xA9E5, 0xA9E6}, + {0xAA29, 0xAA2E}, + {0xAA31, 0xAA32}, + {0xAA35, 0xAA36}, + {0xAA43, 0xAA43}, + {0xAA4C, 0xAA4C}, + {0xAA70, 0xAA70}, + {0xAA7C, 0xAA7C}, + {0xAAB0, 0xAAB0}, + {0xAAB2, 0xAAB4}, + {0xAAB7, 0xAAB8}, + {0xAABE, 0xAABF}, + {0xAAC1, 0xAAC1}, + {0xAADD, 0xAADD}, + {0xAAEC, 0xAAED}, + {0xAAF3, 0xAAF4}, + {0xAAF6, 0xAAF6}, + {0xAB5B, 0xAB5F}, + {0xAB69, 0xAB6B}, + {0xABE5, 0xABE5}, + {0xABE8, 0xABE8}, + {0xABED, 0xABED}, + {0xFB1E, 0xFB1E}, + {0xFBB2, 0xFBC2}, + {0xFE00, 0xFE0F}, + {0xFE13, 0xFE13}, + {0xFE20, 0xFE2F}, + {0xFE52, 0xFE52}, + {0xFE55, 0xFE55}, + {0xFEFF, 0xFEFF}, + {0xFF07, 0xFF07}, + {0xFF0E, 0xFF0E}, + {0xFF1A, 0xFF1A}, + {0xFF3E, 0xFF3E}, + {0xFF40, 0xFF40}, + {0xFF70, 0xFF70}, + {0xFF9E, 0xFF9F}, + {0xFFE3, 0xFFE3}, + {0xFFF9, 0xFFFB}, + {0x101FD, 0x101FD}, + {0x102E0, 0x102E0}, + {0x10376, 0x1037A}, + {0x10780, 0x10785}, + {0x10787, 0x107B0}, + {0x107B2, 0x107BA}, + {0x10A01, 0x10A03}, + {0x10A05, 0x10A06}, + {0x10A0C, 0x10A0F}, + {0x10A38, 0x10A3A}, + {0x10A3F, 0x10A3F}, + {0x10AE5, 0x10AE6}, + {0x10D24, 0x10D27}, + {0x10D4E, 0x10D4E}, + {0x10D69, 0x10D6D}, + {0x10D6F, 0x10D6F}, + {0x10EAB, 0x10EAC}, + {0x10EC5, 0x10EC5}, + {0x10EFA, 0x10EFF}, + {0x10F46, 0x10F50}, + {0x10F82, 0x10F85}, + {0x11001, 0x11001}, + {0x11038, 0x11046}, + {0x11070, 0x11070}, + {0x11073, 0x11074}, + {0x1107F, 0x11081}, + {0x110B3, 0x110B6}, + {0x110B9, 0x110BA}, + {0x110BD, 0x110BD}, + {0x110C2, 0x110C2}, + {0x110CD, 0x110CD}, + {0x11100, 0x11102}, + {0x11127, 0x1112B}, + {0x1112D, 0x11134}, + {0x11173, 0x11173}, + {0x11180, 0x11181}, + {0x111B6, 0x111BE}, + {0x111C9, 0x111CC}, + {0x111CF, 0x111CF}, + {0x1122F, 0x11231}, + {0x11234, 0x11234}, + {0x11236, 0x11237}, + {0x1123E, 0x1123E}, + {0x11241, 0x11241}, + {0x112DF, 0x112DF}, + {0x112E3, 0x112EA}, + {0x11300, 0x11301}, + {0x1133B, 0x1133C}, + {0x11340, 0x11340}, + {0x11366, 0x1136C}, + {0x11370, 0x11374}, + {0x113BB, 0x113C0}, + {0x113CE, 0x113CE}, + {0x113D0, 0x113D0}, + {0x113D2, 0x113D2}, + {0x113E1, 0x113E2}, + {0x11438, 0x1143F}, + {0x11442, 0x11444}, + {0x11446, 0x11446}, + {0x1145E, 0x1145E}, + {0x114B3, 0x114B8}, + {0x114BA, 0x114BA}, + {0x114BF, 0x114C0}, + {0x114C2, 0x114C3}, + {0x115B2, 0x115B5}, + {0x115BC, 0x115BD}, + {0x115BF, 0x115C0}, + {0x115DC, 0x115DD}, + {0x11633, 0x1163A}, + {0x1163D, 0x1163D}, + {0x1163F, 0x11640}, + {0x116AB, 0x116AB}, + {0x116AD, 0x116AD}, + {0x116B0, 0x116B5}, + {0x116B7, 0x116B7}, + {0x1171D, 0x1171D}, + {0x1171F, 0x1171F}, + {0x11722, 0x11725}, + {0x11727, 0x1172B}, + {0x1182F, 0x11837}, + {0x11839, 0x1183A}, + {0x1193B, 0x1193C}, + {0x1193E, 0x1193E}, + {0x11943, 0x11943}, + {0x119D4, 0x119D7}, + {0x119DA, 0x119DB}, + {0x119E0, 0x119E0}, + {0x11A01, 0x11A0A}, + {0x11A33, 0x11A38}, + {0x11A3B, 0x11A3E}, + {0x11A47, 0x11A47}, + {0x11A51, 0x11A56}, + {0x11A59, 0x11A5B}, + {0x11A8A, 0x11A96}, + {0x11A98, 0x11A99}, + {0x11B60, 0x11B60}, + {0x11B62, 0x11B64}, + {0x11B66, 0x11B66}, + {0x11C30, 0x11C36}, + {0x11C38, 0x11C3D}, + {0x11C3F, 0x11C3F}, + {0x11C92, 0x11CA7}, + {0x11CAA, 0x11CB0}, + {0x11CB2, 0x11CB3}, + {0x11CB5, 0x11CB6}, + {0x11D31, 0x11D36}, + {0x11D3A, 0x11D3A}, + {0x11D3C, 0x11D3D}, + {0x11D3F, 0x11D45}, + {0x11D47, 0x11D47}, + {0x11D90, 0x11D91}, + {0x11D95, 0x11D95}, + {0x11D97, 0x11D97}, + {0x11DD9, 0x11DD9}, + {0x11EF3, 0x11EF4}, + {0x11F00, 0x11F01}, + {0x11F36, 0x11F3A}, + {0x11F40, 0x11F40}, + {0x11F42, 0x11F42}, + {0x11F5A, 0x11F5A}, + {0x13430, 0x13440}, + {0x13447, 0x13455}, + {0x1611E, 0x16129}, + {0x1612D, 0x1612F}, + {0x16AF0, 0x16AF4}, + {0x16B30, 0x16B36}, + {0x16B40, 0x16B43}, + {0x16D40, 0x16D42}, + {0x16D6B, 0x16D6C}, + {0x16F4F, 0x16F4F}, + {0x16F8F, 0x16F9F}, + {0x16FE0, 0x16FE1}, + {0x16FE3, 0x16FE4}, + {0x16FF2, 0x16FF3}, + {0x1AFF0, 0x1AFF3}, + {0x1AFF5, 0x1AFFB}, + {0x1AFFD, 0x1AFFE}, + {0x1BC9D, 0x1BC9E}, + {0x1BCA0, 0x1BCA3}, + {0x1CF00, 0x1CF2D}, + {0x1CF30, 0x1CF46}, + {0x1D167, 0x1D169}, + {0x1D173, 0x1D182}, + {0x1D185, 0x1D18B}, + {0x1D1AA, 0x1D1AD}, + {0x1D242, 0x1D244}, + {0x1DA00, 0x1DA36}, + {0x1DA3B, 0x1DA6C}, + {0x1DA75, 0x1DA75}, + {0x1DA84, 0x1DA84}, + {0x1DA9B, 0x1DA9F}, + {0x1DAA1, 0x1DAAF}, + {0x1E000, 0x1E006}, + {0x1E008, 0x1E018}, + {0x1E01B, 0x1E021}, + {0x1E023, 0x1E024}, + {0x1E026, 0x1E02A}, + {0x1E030, 0x1E06D}, + {0x1E08F, 0x1E08F}, + {0x1E130, 0x1E13D}, + {0x1E2AE, 0x1E2AE}, + {0x1E2EC, 0x1E2EF}, + {0x1E4EB, 0x1E4EF}, + {0x1E5EE, 0x1E5EF}, + {0x1E6E3, 0x1E6E3}, + {0x1E6E6, 0x1E6E6}, + {0x1E6EE, 0x1E6EF}, + {0x1E6F5, 0x1E6F5}, + {0x1E6FF, 0x1E6FF}, + {0x1E8D0, 0x1E8D6}, + {0x1E944, 0x1E94B}, + {0x1F3FB, 0x1F3FF}, + {0xE0001, 0xE0001}, + {0xE0020, 0xE007F}, + {0xE0100, 0xE01EF}, + }, + "Cased": { + {0x41, 0x5A}, + {0x61, 0x7A}, + {0xAA, 0xAA}, + {0xB5, 0xB5}, + {0xBA, 0xBA}, + {0xC0, 0xD6}, + {0xD8, 0xF6}, + {0xF8, 0x1BA}, + {0x1BC, 0x1BF}, + {0x1C4, 0x293}, + {0x296, 0x2B8}, + {0x2C0, 0x2C1}, + {0x2E0, 0x2E4}, + {0x345, 0x345}, + {0x370, 0x373}, + {0x376, 0x377}, + {0x37A, 0x37D}, + {0x37F, 0x37F}, + {0x386, 0x386}, + {0x388, 0x38A}, + {0x38C, 0x38C}, + {0x38E, 0x3A1}, + {0x3A3, 0x3F5}, + {0x3F7, 0x481}, + {0x48A, 0x52F}, + {0x531, 0x556}, + {0x560, 0x588}, + {0x10A0, 0x10C5}, + {0x10C7, 0x10C7}, + {0x10CD, 0x10CD}, + {0x10D0, 0x10FA}, + {0x10FC, 0x10FF}, + {0x13A0, 0x13F5}, + {0x13F8, 0x13FD}, + {0x1C80, 0x1C8A}, + {0x1C90, 0x1CBA}, + {0x1CBD, 0x1CBF}, + {0x1D00, 0x1DBF}, + {0x1E00, 0x1F15}, + {0x1F18, 0x1F1D}, + {0x1F20, 0x1F45}, + {0x1F48, 0x1F4D}, + {0x1F50, 0x1F57}, + {0x1F59, 0x1F59}, + {0x1F5B, 0x1F5B}, + {0x1F5D, 0x1F5D}, + {0x1F5F, 0x1F7D}, + {0x1F80, 0x1FB4}, + {0x1FB6, 0x1FBC}, + {0x1FBE, 0x1FBE}, + {0x1FC2, 0x1FC4}, + {0x1FC6, 0x1FCC}, + {0x1FD0, 0x1FD3}, + {0x1FD6, 0x1FDB}, + {0x1FE0, 0x1FEC}, + {0x1FF2, 0x1FF4}, + {0x1FF6, 0x1FFC}, + {0x2071, 0x2071}, + {0x207F, 0x207F}, + {0x2090, 0x209C}, + {0x2102, 0x2102}, + {0x2107, 0x2107}, + {0x210A, 0x2113}, + {0x2115, 0x2115}, + {0x2119, 0x211D}, + {0x2124, 0x2124}, + {0x2126, 0x2126}, + {0x2128, 0x2128}, + {0x212A, 0x212D}, + {0x212F, 0x2134}, + {0x2139, 0x2139}, + {0x213C, 0x213F}, + {0x2145, 0x2149}, + {0x214E, 0x214E}, + {0x2160, 0x217F}, + {0x2183, 0x2184}, + {0x24B6, 0x24E9}, + {0x2C00, 0x2CE4}, + {0x2CEB, 0x2CEE}, + {0x2CF2, 0x2CF3}, + {0x2D00, 0x2D25}, + {0x2D27, 0x2D27}, + {0x2D2D, 0x2D2D}, + {0xA640, 0xA66D}, + {0xA680, 0xA69D}, + {0xA722, 0xA787}, + {0xA78B, 0xA78E}, + {0xA790, 0xA7DC}, + {0xA7F1, 0xA7F6}, + {0xA7F8, 0xA7FA}, + {0xAB30, 0xAB5A}, + {0xAB5C, 0xAB69}, + {0xAB70, 0xABBF}, + {0xFB00, 0xFB06}, + {0xFB13, 0xFB17}, + {0xFF21, 0xFF3A}, + {0xFF41, 0xFF5A}, + {0x10400, 0x1044F}, + {0x104B0, 0x104D3}, + {0x104D8, 0x104FB}, + {0x10570, 0x1057A}, + {0x1057C, 0x1058A}, + {0x1058C, 0x10592}, + {0x10594, 0x10595}, + {0x10597, 0x105A1}, + {0x105A3, 0x105B1}, + {0x105B3, 0x105B9}, + {0x105BB, 0x105BC}, + {0x10780, 0x10780}, + {0x10783, 0x10785}, + {0x10787, 0x107B0}, + {0x107B2, 0x107BA}, + {0x10C80, 0x10CB2}, + {0x10CC0, 0x10CF2}, + {0x10D50, 0x10D65}, + {0x10D70, 0x10D85}, + {0x118A0, 0x118DF}, + {0x16E40, 0x16E7F}, + {0x16EA0, 0x16EB8}, + {0x16EBB, 0x16ED3}, + {0x1D400, 0x1D454}, + {0x1D456, 0x1D49C}, + {0x1D49E, 0x1D49F}, + {0x1D4A2, 0x1D4A2}, + {0x1D4A5, 0x1D4A6}, + {0x1D4A9, 0x1D4AC}, + {0x1D4AE, 0x1D4B9}, + {0x1D4BB, 0x1D4BB}, + {0x1D4BD, 0x1D4C3}, + {0x1D4C5, 0x1D505}, + {0x1D507, 0x1D50A}, + {0x1D50D, 0x1D514}, + {0x1D516, 0x1D51C}, + {0x1D51E, 0x1D539}, + {0x1D53B, 0x1D53E}, + {0x1D540, 0x1D544}, + {0x1D546, 0x1D546}, + {0x1D54A, 0x1D550}, + {0x1D552, 0x1D6A5}, + {0x1D6A8, 0x1D6C0}, + {0x1D6C2, 0x1D6DA}, + {0x1D6DC, 0x1D6FA}, + {0x1D6FC, 0x1D714}, + {0x1D716, 0x1D734}, + {0x1D736, 0x1D74E}, + {0x1D750, 0x1D76E}, + {0x1D770, 0x1D788}, + {0x1D78A, 0x1D7A8}, + {0x1D7AA, 0x1D7C2}, + {0x1D7C4, 0x1D7CB}, + {0x1DF00, 0x1DF09}, + {0x1DF0B, 0x1DF1E}, + {0x1DF25, 0x1DF2A}, + {0x1E030, 0x1E06D}, + {0x1E900, 0x1E943}, + {0x1F130, 0x1F149}, + {0x1F150, 0x1F169}, + {0x1F170, 0x1F189}, + }, + "Changes_When_Casefolded": { + {0x41, 0x5A}, + {0xB5, 0xB5}, + {0xC0, 0xD6}, + {0xD8, 0xDF}, + {0x100, 0x100}, + {0x102, 0x102}, + {0x104, 0x104}, + {0x106, 0x106}, + {0x108, 0x108}, + {0x10A, 0x10A}, + {0x10C, 0x10C}, + {0x10E, 0x10E}, + {0x110, 0x110}, + {0x112, 0x112}, + {0x114, 0x114}, + {0x116, 0x116}, + {0x118, 0x118}, + {0x11A, 0x11A}, + {0x11C, 0x11C}, + {0x11E, 0x11E}, + {0x120, 0x120}, + {0x122, 0x122}, + {0x124, 0x124}, + {0x126, 0x126}, + {0x128, 0x128}, + {0x12A, 0x12A}, + {0x12C, 0x12C}, + {0x12E, 0x12E}, + {0x130, 0x130}, + {0x132, 0x132}, + {0x134, 0x134}, + {0x136, 0x136}, + {0x139, 0x139}, + {0x13B, 0x13B}, + {0x13D, 0x13D}, + {0x13F, 0x13F}, + {0x141, 0x141}, + {0x143, 0x143}, + {0x145, 0x145}, + {0x147, 0x147}, + {0x149, 0x14A}, + {0x14C, 0x14C}, + {0x14E, 0x14E}, + {0x150, 0x150}, + {0x152, 0x152}, + {0x154, 0x154}, + {0x156, 0x156}, + {0x158, 0x158}, + {0x15A, 0x15A}, + {0x15C, 0x15C}, + {0x15E, 0x15E}, + {0x160, 0x160}, + {0x162, 0x162}, + {0x164, 0x164}, + {0x166, 0x166}, + {0x168, 0x168}, + {0x16A, 0x16A}, + {0x16C, 0x16C}, + {0x16E, 0x16E}, + {0x170, 0x170}, + {0x172, 0x172}, + {0x174, 0x174}, + {0x176, 0x176}, + {0x178, 0x179}, + {0x17B, 0x17B}, + {0x17D, 0x17D}, + {0x17F, 0x17F}, + {0x181, 0x182}, + {0x184, 0x184}, + {0x186, 0x187}, + {0x189, 0x18B}, + {0x18E, 0x191}, + {0x193, 0x194}, + {0x196, 0x198}, + {0x19C, 0x19D}, + {0x19F, 0x1A0}, + {0x1A2, 0x1A2}, + {0x1A4, 0x1A4}, + {0x1A6, 0x1A7}, + {0x1A9, 0x1A9}, + {0x1AC, 0x1AC}, + {0x1AE, 0x1AF}, + {0x1B1, 0x1B3}, + {0x1B5, 0x1B5}, + {0x1B7, 0x1B8}, + {0x1BC, 0x1BC}, + {0x1C4, 0x1C5}, + {0x1C7, 0x1C8}, + {0x1CA, 0x1CB}, + {0x1CD, 0x1CD}, + {0x1CF, 0x1CF}, + {0x1D1, 0x1D1}, + {0x1D3, 0x1D3}, + {0x1D5, 0x1D5}, + {0x1D7, 0x1D7}, + {0x1D9, 0x1D9}, + {0x1DB, 0x1DB}, + {0x1DE, 0x1DE}, + {0x1E0, 0x1E0}, + {0x1E2, 0x1E2}, + {0x1E4, 0x1E4}, + {0x1E6, 0x1E6}, + {0x1E8, 0x1E8}, + {0x1EA, 0x1EA}, + {0x1EC, 0x1EC}, + {0x1EE, 0x1EE}, + {0x1F1, 0x1F2}, + {0x1F4, 0x1F4}, + {0x1F6, 0x1F8}, + {0x1FA, 0x1FA}, + {0x1FC, 0x1FC}, + {0x1FE, 0x1FE}, + {0x200, 0x200}, + {0x202, 0x202}, + {0x204, 0x204}, + {0x206, 0x206}, + {0x208, 0x208}, + {0x20A, 0x20A}, + {0x20C, 0x20C}, + {0x20E, 0x20E}, + {0x210, 0x210}, + {0x212, 0x212}, + {0x214, 0x214}, + {0x216, 0x216}, + {0x218, 0x218}, + {0x21A, 0x21A}, + {0x21C, 0x21C}, + {0x21E, 0x21E}, + {0x220, 0x220}, + {0x222, 0x222}, + {0x224, 0x224}, + {0x226, 0x226}, + {0x228, 0x228}, + {0x22A, 0x22A}, + {0x22C, 0x22C}, + {0x22E, 0x22E}, + {0x230, 0x230}, + {0x232, 0x232}, + {0x23A, 0x23B}, + {0x23D, 0x23E}, + {0x241, 0x241}, + {0x243, 0x246}, + {0x248, 0x248}, + {0x24A, 0x24A}, + {0x24C, 0x24C}, + {0x24E, 0x24E}, + {0x345, 0x345}, + {0x370, 0x370}, + {0x372, 0x372}, + {0x376, 0x376}, + {0x37F, 0x37F}, + {0x386, 0x386}, + {0x388, 0x38A}, + {0x38C, 0x38C}, + {0x38E, 0x38F}, + {0x391, 0x3A1}, + {0x3A3, 0x3AB}, + {0x3C2, 0x3C2}, + {0x3CF, 0x3D1}, + {0x3D5, 0x3D6}, + {0x3D8, 0x3D8}, + {0x3DA, 0x3DA}, + {0x3DC, 0x3DC}, + {0x3DE, 0x3DE}, + {0x3E0, 0x3E0}, + {0x3E2, 0x3E2}, + {0x3E4, 0x3E4}, + {0x3E6, 0x3E6}, + {0x3E8, 0x3E8}, + {0x3EA, 0x3EA}, + {0x3EC, 0x3EC}, + {0x3EE, 0x3EE}, + {0x3F0, 0x3F1}, + {0x3F4, 0x3F5}, + {0x3F7, 0x3F7}, + {0x3F9, 0x3FA}, + {0x3FD, 0x42F}, + {0x460, 0x460}, + {0x462, 0x462}, + {0x464, 0x464}, + {0x466, 0x466}, + {0x468, 0x468}, + {0x46A, 0x46A}, + {0x46C, 0x46C}, + {0x46E, 0x46E}, + {0x470, 0x470}, + {0x472, 0x472}, + {0x474, 0x474}, + {0x476, 0x476}, + {0x478, 0x478}, + {0x47A, 0x47A}, + {0x47C, 0x47C}, + {0x47E, 0x47E}, + {0x480, 0x480}, + {0x48A, 0x48A}, + {0x48C, 0x48C}, + {0x48E, 0x48E}, + {0x490, 0x490}, + {0x492, 0x492}, + {0x494, 0x494}, + {0x496, 0x496}, + {0x498, 0x498}, + {0x49A, 0x49A}, + {0x49C, 0x49C}, + {0x49E, 0x49E}, + {0x4A0, 0x4A0}, + {0x4A2, 0x4A2}, + {0x4A4, 0x4A4}, + {0x4A6, 0x4A6}, + {0x4A8, 0x4A8}, + {0x4AA, 0x4AA}, + {0x4AC, 0x4AC}, + {0x4AE, 0x4AE}, + {0x4B0, 0x4B0}, + {0x4B2, 0x4B2}, + {0x4B4, 0x4B4}, + {0x4B6, 0x4B6}, + {0x4B8, 0x4B8}, + {0x4BA, 0x4BA}, + {0x4BC, 0x4BC}, + {0x4BE, 0x4BE}, + {0x4C0, 0x4C1}, + {0x4C3, 0x4C3}, + {0x4C5, 0x4C5}, + {0x4C7, 0x4C7}, + {0x4C9, 0x4C9}, + {0x4CB, 0x4CB}, + {0x4CD, 0x4CD}, + {0x4D0, 0x4D0}, + {0x4D2, 0x4D2}, + {0x4D4, 0x4D4}, + {0x4D6, 0x4D6}, + {0x4D8, 0x4D8}, + {0x4DA, 0x4DA}, + {0x4DC, 0x4DC}, + {0x4DE, 0x4DE}, + {0x4E0, 0x4E0}, + {0x4E2, 0x4E2}, + {0x4E4, 0x4E4}, + {0x4E6, 0x4E6}, + {0x4E8, 0x4E8}, + {0x4EA, 0x4EA}, + {0x4EC, 0x4EC}, + {0x4EE, 0x4EE}, + {0x4F0, 0x4F0}, + {0x4F2, 0x4F2}, + {0x4F4, 0x4F4}, + {0x4F6, 0x4F6}, + {0x4F8, 0x4F8}, + {0x4FA, 0x4FA}, + {0x4FC, 0x4FC}, + {0x4FE, 0x4FE}, + {0x500, 0x500}, + {0x502, 0x502}, + {0x504, 0x504}, + {0x506, 0x506}, + {0x508, 0x508}, + {0x50A, 0x50A}, + {0x50C, 0x50C}, + {0x50E, 0x50E}, + {0x510, 0x510}, + {0x512, 0x512}, + {0x514, 0x514}, + {0x516, 0x516}, + {0x518, 0x518}, + {0x51A, 0x51A}, + {0x51C, 0x51C}, + {0x51E, 0x51E}, + {0x520, 0x520}, + {0x522, 0x522}, + {0x524, 0x524}, + {0x526, 0x526}, + {0x528, 0x528}, + {0x52A, 0x52A}, + {0x52C, 0x52C}, + {0x52E, 0x52E}, + {0x531, 0x556}, + {0x587, 0x587}, + {0x10A0, 0x10C5}, + {0x10C7, 0x10C7}, + {0x10CD, 0x10CD}, + {0x13F8, 0x13FD}, + {0x1C80, 0x1C89}, + {0x1C90, 0x1CBA}, + {0x1CBD, 0x1CBF}, + {0x1E00, 0x1E00}, + {0x1E02, 0x1E02}, + {0x1E04, 0x1E04}, + {0x1E06, 0x1E06}, + {0x1E08, 0x1E08}, + {0x1E0A, 0x1E0A}, + {0x1E0C, 0x1E0C}, + {0x1E0E, 0x1E0E}, + {0x1E10, 0x1E10}, + {0x1E12, 0x1E12}, + {0x1E14, 0x1E14}, + {0x1E16, 0x1E16}, + {0x1E18, 0x1E18}, + {0x1E1A, 0x1E1A}, + {0x1E1C, 0x1E1C}, + {0x1E1E, 0x1E1E}, + {0x1E20, 0x1E20}, + {0x1E22, 0x1E22}, + {0x1E24, 0x1E24}, + {0x1E26, 0x1E26}, + {0x1E28, 0x1E28}, + {0x1E2A, 0x1E2A}, + {0x1E2C, 0x1E2C}, + {0x1E2E, 0x1E2E}, + {0x1E30, 0x1E30}, + {0x1E32, 0x1E32}, + {0x1E34, 0x1E34}, + {0x1E36, 0x1E36}, + {0x1E38, 0x1E38}, + {0x1E3A, 0x1E3A}, + {0x1E3C, 0x1E3C}, + {0x1E3E, 0x1E3E}, + {0x1E40, 0x1E40}, + {0x1E42, 0x1E42}, + {0x1E44, 0x1E44}, + {0x1E46, 0x1E46}, + {0x1E48, 0x1E48}, + {0x1E4A, 0x1E4A}, + {0x1E4C, 0x1E4C}, + {0x1E4E, 0x1E4E}, + {0x1E50, 0x1E50}, + {0x1E52, 0x1E52}, + {0x1E54, 0x1E54}, + {0x1E56, 0x1E56}, + {0x1E58, 0x1E58}, + {0x1E5A, 0x1E5A}, + {0x1E5C, 0x1E5C}, + {0x1E5E, 0x1E5E}, + {0x1E60, 0x1E60}, + {0x1E62, 0x1E62}, + {0x1E64, 0x1E64}, + {0x1E66, 0x1E66}, + {0x1E68, 0x1E68}, + {0x1E6A, 0x1E6A}, + {0x1E6C, 0x1E6C}, + {0x1E6E, 0x1E6E}, + {0x1E70, 0x1E70}, + {0x1E72, 0x1E72}, + {0x1E74, 0x1E74}, + {0x1E76, 0x1E76}, + {0x1E78, 0x1E78}, + {0x1E7A, 0x1E7A}, + {0x1E7C, 0x1E7C}, + {0x1E7E, 0x1E7E}, + {0x1E80, 0x1E80}, + {0x1E82, 0x1E82}, + {0x1E84, 0x1E84}, + {0x1E86, 0x1E86}, + {0x1E88, 0x1E88}, + {0x1E8A, 0x1E8A}, + {0x1E8C, 0x1E8C}, + {0x1E8E, 0x1E8E}, + {0x1E90, 0x1E90}, + {0x1E92, 0x1E92}, + {0x1E94, 0x1E94}, + {0x1E9A, 0x1E9B}, + {0x1E9E, 0x1E9E}, + {0x1EA0, 0x1EA0}, + {0x1EA2, 0x1EA2}, + {0x1EA4, 0x1EA4}, + {0x1EA6, 0x1EA6}, + {0x1EA8, 0x1EA8}, + {0x1EAA, 0x1EAA}, + {0x1EAC, 0x1EAC}, + {0x1EAE, 0x1EAE}, + {0x1EB0, 0x1EB0}, + {0x1EB2, 0x1EB2}, + {0x1EB4, 0x1EB4}, + {0x1EB6, 0x1EB6}, + {0x1EB8, 0x1EB8}, + {0x1EBA, 0x1EBA}, + {0x1EBC, 0x1EBC}, + {0x1EBE, 0x1EBE}, + {0x1EC0, 0x1EC0}, + {0x1EC2, 0x1EC2}, + {0x1EC4, 0x1EC4}, + {0x1EC6, 0x1EC6}, + {0x1EC8, 0x1EC8}, + {0x1ECA, 0x1ECA}, + {0x1ECC, 0x1ECC}, + {0x1ECE, 0x1ECE}, + {0x1ED0, 0x1ED0}, + {0x1ED2, 0x1ED2}, + {0x1ED4, 0x1ED4}, + {0x1ED6, 0x1ED6}, + {0x1ED8, 0x1ED8}, + {0x1EDA, 0x1EDA}, + {0x1EDC, 0x1EDC}, + {0x1EDE, 0x1EDE}, + {0x1EE0, 0x1EE0}, + {0x1EE2, 0x1EE2}, + {0x1EE4, 0x1EE4}, + {0x1EE6, 0x1EE6}, + {0x1EE8, 0x1EE8}, + {0x1EEA, 0x1EEA}, + {0x1EEC, 0x1EEC}, + {0x1EEE, 0x1EEE}, + {0x1EF0, 0x1EF0}, + {0x1EF2, 0x1EF2}, + {0x1EF4, 0x1EF4}, + {0x1EF6, 0x1EF6}, + {0x1EF8, 0x1EF8}, + {0x1EFA, 0x1EFA}, + {0x1EFC, 0x1EFC}, + {0x1EFE, 0x1EFE}, + {0x1F08, 0x1F0F}, + {0x1F18, 0x1F1D}, + {0x1F28, 0x1F2F}, + {0x1F38, 0x1F3F}, + {0x1F48, 0x1F4D}, + {0x1F59, 0x1F59}, + {0x1F5B, 0x1F5B}, + {0x1F5D, 0x1F5D}, + {0x1F5F, 0x1F5F}, + {0x1F68, 0x1F6F}, + {0x1F80, 0x1FAF}, + {0x1FB2, 0x1FB4}, + {0x1FB7, 0x1FBC}, + {0x1FC2, 0x1FC4}, + {0x1FC7, 0x1FCC}, + {0x1FD8, 0x1FDB}, + {0x1FE8, 0x1FEC}, + {0x1FF2, 0x1FF4}, + {0x1FF7, 0x1FFC}, + {0x2126, 0x2126}, + {0x212A, 0x212B}, + {0x2132, 0x2132}, + {0x2160, 0x216F}, + {0x2183, 0x2183}, + {0x24B6, 0x24CF}, + {0x2C00, 0x2C2F}, + {0x2C60, 0x2C60}, + {0x2C62, 0x2C64}, + {0x2C67, 0x2C67}, + {0x2C69, 0x2C69}, + {0x2C6B, 0x2C6B}, + {0x2C6D, 0x2C70}, + {0x2C72, 0x2C72}, + {0x2C75, 0x2C75}, + {0x2C7E, 0x2C80}, + {0x2C82, 0x2C82}, + {0x2C84, 0x2C84}, + {0x2C86, 0x2C86}, + {0x2C88, 0x2C88}, + {0x2C8A, 0x2C8A}, + {0x2C8C, 0x2C8C}, + {0x2C8E, 0x2C8E}, + {0x2C90, 0x2C90}, + {0x2C92, 0x2C92}, + {0x2C94, 0x2C94}, + {0x2C96, 0x2C96}, + {0x2C98, 0x2C98}, + {0x2C9A, 0x2C9A}, + {0x2C9C, 0x2C9C}, + {0x2C9E, 0x2C9E}, + {0x2CA0, 0x2CA0}, + {0x2CA2, 0x2CA2}, + {0x2CA4, 0x2CA4}, + {0x2CA6, 0x2CA6}, + {0x2CA8, 0x2CA8}, + {0x2CAA, 0x2CAA}, + {0x2CAC, 0x2CAC}, + {0x2CAE, 0x2CAE}, + {0x2CB0, 0x2CB0}, + {0x2CB2, 0x2CB2}, + {0x2CB4, 0x2CB4}, + {0x2CB6, 0x2CB6}, + {0x2CB8, 0x2CB8}, + {0x2CBA, 0x2CBA}, + {0x2CBC, 0x2CBC}, + {0x2CBE, 0x2CBE}, + {0x2CC0, 0x2CC0}, + {0x2CC2, 0x2CC2}, + {0x2CC4, 0x2CC4}, + {0x2CC6, 0x2CC6}, + {0x2CC8, 0x2CC8}, + {0x2CCA, 0x2CCA}, + {0x2CCC, 0x2CCC}, + {0x2CCE, 0x2CCE}, + {0x2CD0, 0x2CD0}, + {0x2CD2, 0x2CD2}, + {0x2CD4, 0x2CD4}, + {0x2CD6, 0x2CD6}, + {0x2CD8, 0x2CD8}, + {0x2CDA, 0x2CDA}, + {0x2CDC, 0x2CDC}, + {0x2CDE, 0x2CDE}, + {0x2CE0, 0x2CE0}, + {0x2CE2, 0x2CE2}, + {0x2CEB, 0x2CEB}, + {0x2CED, 0x2CED}, + {0x2CF2, 0x2CF2}, + {0xA640, 0xA640}, + {0xA642, 0xA642}, + {0xA644, 0xA644}, + {0xA646, 0xA646}, + {0xA648, 0xA648}, + {0xA64A, 0xA64A}, + {0xA64C, 0xA64C}, + {0xA64E, 0xA64E}, + {0xA650, 0xA650}, + {0xA652, 0xA652}, + {0xA654, 0xA654}, + {0xA656, 0xA656}, + {0xA658, 0xA658}, + {0xA65A, 0xA65A}, + {0xA65C, 0xA65C}, + {0xA65E, 0xA65E}, + {0xA660, 0xA660}, + {0xA662, 0xA662}, + {0xA664, 0xA664}, + {0xA666, 0xA666}, + {0xA668, 0xA668}, + {0xA66A, 0xA66A}, + {0xA66C, 0xA66C}, + {0xA680, 0xA680}, + {0xA682, 0xA682}, + {0xA684, 0xA684}, + {0xA686, 0xA686}, + {0xA688, 0xA688}, + {0xA68A, 0xA68A}, + {0xA68C, 0xA68C}, + {0xA68E, 0xA68E}, + {0xA690, 0xA690}, + {0xA692, 0xA692}, + {0xA694, 0xA694}, + {0xA696, 0xA696}, + {0xA698, 0xA698}, + {0xA69A, 0xA69A}, + {0xA722, 0xA722}, + {0xA724, 0xA724}, + {0xA726, 0xA726}, + {0xA728, 0xA728}, + {0xA72A, 0xA72A}, + {0xA72C, 0xA72C}, + {0xA72E, 0xA72E}, + {0xA732, 0xA732}, + {0xA734, 0xA734}, + {0xA736, 0xA736}, + {0xA738, 0xA738}, + {0xA73A, 0xA73A}, + {0xA73C, 0xA73C}, + {0xA73E, 0xA73E}, + {0xA740, 0xA740}, + {0xA742, 0xA742}, + {0xA744, 0xA744}, + {0xA746, 0xA746}, + {0xA748, 0xA748}, + {0xA74A, 0xA74A}, + {0xA74C, 0xA74C}, + {0xA74E, 0xA74E}, + {0xA750, 0xA750}, + {0xA752, 0xA752}, + {0xA754, 0xA754}, + {0xA756, 0xA756}, + {0xA758, 0xA758}, + {0xA75A, 0xA75A}, + {0xA75C, 0xA75C}, + {0xA75E, 0xA75E}, + {0xA760, 0xA760}, + {0xA762, 0xA762}, + {0xA764, 0xA764}, + {0xA766, 0xA766}, + {0xA768, 0xA768}, + {0xA76A, 0xA76A}, + {0xA76C, 0xA76C}, + {0xA76E, 0xA76E}, + {0xA779, 0xA779}, + {0xA77B, 0xA77B}, + {0xA77D, 0xA77E}, + {0xA780, 0xA780}, + {0xA782, 0xA782}, + {0xA784, 0xA784}, + {0xA786, 0xA786}, + {0xA78B, 0xA78B}, + {0xA78D, 0xA78D}, + {0xA790, 0xA790}, + {0xA792, 0xA792}, + {0xA796, 0xA796}, + {0xA798, 0xA798}, + {0xA79A, 0xA79A}, + {0xA79C, 0xA79C}, + {0xA79E, 0xA79E}, + {0xA7A0, 0xA7A0}, + {0xA7A2, 0xA7A2}, + {0xA7A4, 0xA7A4}, + {0xA7A6, 0xA7A6}, + {0xA7A8, 0xA7A8}, + {0xA7AA, 0xA7AE}, + {0xA7B0, 0xA7B4}, + {0xA7B6, 0xA7B6}, + {0xA7B8, 0xA7B8}, + {0xA7BA, 0xA7BA}, + {0xA7BC, 0xA7BC}, + {0xA7BE, 0xA7BE}, + {0xA7C0, 0xA7C0}, + {0xA7C2, 0xA7C2}, + {0xA7C4, 0xA7C7}, + {0xA7C9, 0xA7C9}, + {0xA7CB, 0xA7CC}, + {0xA7CE, 0xA7CE}, + {0xA7D0, 0xA7D0}, + {0xA7D2, 0xA7D2}, + {0xA7D4, 0xA7D4}, + {0xA7D6, 0xA7D6}, + {0xA7D8, 0xA7D8}, + {0xA7DA, 0xA7DA}, + {0xA7DC, 0xA7DC}, + {0xA7F5, 0xA7F5}, + {0xAB70, 0xABBF}, + {0xFB00, 0xFB06}, + {0xFB13, 0xFB17}, + {0xFF21, 0xFF3A}, + {0x10400, 0x10427}, + {0x104B0, 0x104D3}, + {0x10570, 0x1057A}, + {0x1057C, 0x1058A}, + {0x1058C, 0x10592}, + {0x10594, 0x10595}, + {0x10C80, 0x10CB2}, + {0x10D50, 0x10D65}, + {0x118A0, 0x118BF}, + {0x16E40, 0x16E5F}, + {0x16EA0, 0x16EB8}, + {0x1E900, 0x1E921}, + }, + "Changes_When_Casemapped": { + {0x41, 0x5A}, + {0x61, 0x7A}, + {0xB5, 0xB5}, + {0xC0, 0xD6}, + {0xD8, 0xF6}, + {0xF8, 0x137}, + {0x139, 0x18C}, + {0x18E, 0x1A9}, + {0x1AC, 0x1B9}, + {0x1BC, 0x1BD}, + {0x1BF, 0x1BF}, + {0x1C4, 0x220}, + {0x222, 0x233}, + {0x23A, 0x254}, + {0x256, 0x257}, + {0x259, 0x259}, + {0x25B, 0x25C}, + {0x260, 0x261}, + {0x263, 0x266}, + {0x268, 0x26C}, + {0x26F, 0x26F}, + {0x271, 0x272}, + {0x275, 0x275}, + {0x27D, 0x27D}, + {0x280, 0x280}, + {0x282, 0x283}, + {0x287, 0x28C}, + {0x292, 0x292}, + {0x29D, 0x29E}, + {0x345, 0x345}, + {0x370, 0x373}, + {0x376, 0x377}, + {0x37B, 0x37D}, + {0x37F, 0x37F}, + {0x386, 0x386}, + {0x388, 0x38A}, + {0x38C, 0x38C}, + {0x38E, 0x3A1}, + {0x3A3, 0x3D1}, + {0x3D5, 0x3F5}, + {0x3F7, 0x3FB}, + {0x3FD, 0x481}, + {0x48A, 0x52F}, + {0x531, 0x556}, + {0x561, 0x587}, + {0x10A0, 0x10C5}, + {0x10C7, 0x10C7}, + {0x10CD, 0x10CD}, + {0x10D0, 0x10FA}, + {0x10FD, 0x10FF}, + {0x13A0, 0x13F5}, + {0x13F8, 0x13FD}, + {0x1C80, 0x1C8A}, + {0x1C90, 0x1CBA}, + {0x1CBD, 0x1CBF}, + {0x1D79, 0x1D79}, + {0x1D7D, 0x1D7D}, + {0x1D8E, 0x1D8E}, + {0x1E00, 0x1E9B}, + {0x1E9E, 0x1E9E}, + {0x1EA0, 0x1F15}, + {0x1F18, 0x1F1D}, + {0x1F20, 0x1F45}, + {0x1F48, 0x1F4D}, + {0x1F50, 0x1F57}, + {0x1F59, 0x1F59}, + {0x1F5B, 0x1F5B}, + {0x1F5D, 0x1F5D}, + {0x1F5F, 0x1F7D}, + {0x1F80, 0x1FB4}, + {0x1FB6, 0x1FBC}, + {0x1FBE, 0x1FBE}, + {0x1FC2, 0x1FC4}, + {0x1FC6, 0x1FCC}, + {0x1FD0, 0x1FD3}, + {0x1FD6, 0x1FDB}, + {0x1FE0, 0x1FEC}, + {0x1FF2, 0x1FF4}, + {0x1FF6, 0x1FFC}, + {0x2126, 0x2126}, + {0x212A, 0x212B}, + {0x2132, 0x2132}, + {0x214E, 0x214E}, + {0x2160, 0x217F}, + {0x2183, 0x2184}, + {0x24B6, 0x24E9}, + {0x2C00, 0x2C70}, + {0x2C72, 0x2C73}, + {0x2C75, 0x2C76}, + {0x2C7E, 0x2CE3}, + {0x2CEB, 0x2CEE}, + {0x2CF2, 0x2CF3}, + {0x2D00, 0x2D25}, + {0x2D27, 0x2D27}, + {0x2D2D, 0x2D2D}, + {0xA640, 0xA66D}, + {0xA680, 0xA69B}, + {0xA722, 0xA72F}, + {0xA732, 0xA76F}, + {0xA779, 0xA787}, + {0xA78B, 0xA78D}, + {0xA790, 0xA794}, + {0xA796, 0xA7AE}, + {0xA7B0, 0xA7DC}, + {0xA7F5, 0xA7F6}, + {0xAB53, 0xAB53}, + {0xAB70, 0xABBF}, + {0xFB00, 0xFB06}, + {0xFB13, 0xFB17}, + {0xFF21, 0xFF3A}, + {0xFF41, 0xFF5A}, + {0x10400, 0x1044F}, + {0x104B0, 0x104D3}, + {0x104D8, 0x104FB}, + {0x10570, 0x1057A}, + {0x1057C, 0x1058A}, + {0x1058C, 0x10592}, + {0x10594, 0x10595}, + {0x10597, 0x105A1}, + {0x105A3, 0x105B1}, + {0x105B3, 0x105B9}, + {0x105BB, 0x105BC}, + {0x10C80, 0x10CB2}, + {0x10CC0, 0x10CF2}, + {0x10D50, 0x10D65}, + {0x10D70, 0x10D85}, + {0x118A0, 0x118DF}, + {0x16E40, 0x16E7F}, + {0x16EA0, 0x16EB8}, + {0x16EBB, 0x16ED3}, + {0x1E900, 0x1E943}, + }, + "Changes_When_Lowercased": { + {0x41, 0x5A}, + {0xC0, 0xD6}, + {0xD8, 0xDE}, + {0x100, 0x100}, + {0x102, 0x102}, + {0x104, 0x104}, + {0x106, 0x106}, + {0x108, 0x108}, + {0x10A, 0x10A}, + {0x10C, 0x10C}, + {0x10E, 0x10E}, + {0x110, 0x110}, + {0x112, 0x112}, + {0x114, 0x114}, + {0x116, 0x116}, + {0x118, 0x118}, + {0x11A, 0x11A}, + {0x11C, 0x11C}, + {0x11E, 0x11E}, + {0x120, 0x120}, + {0x122, 0x122}, + {0x124, 0x124}, + {0x126, 0x126}, + {0x128, 0x128}, + {0x12A, 0x12A}, + {0x12C, 0x12C}, + {0x12E, 0x12E}, + {0x130, 0x130}, + {0x132, 0x132}, + {0x134, 0x134}, + {0x136, 0x136}, + {0x139, 0x139}, + {0x13B, 0x13B}, + {0x13D, 0x13D}, + {0x13F, 0x13F}, + {0x141, 0x141}, + {0x143, 0x143}, + {0x145, 0x145}, + {0x147, 0x147}, + {0x14A, 0x14A}, + {0x14C, 0x14C}, + {0x14E, 0x14E}, + {0x150, 0x150}, + {0x152, 0x152}, + {0x154, 0x154}, + {0x156, 0x156}, + {0x158, 0x158}, + {0x15A, 0x15A}, + {0x15C, 0x15C}, + {0x15E, 0x15E}, + {0x160, 0x160}, + {0x162, 0x162}, + {0x164, 0x164}, + {0x166, 0x166}, + {0x168, 0x168}, + {0x16A, 0x16A}, + {0x16C, 0x16C}, + {0x16E, 0x16E}, + {0x170, 0x170}, + {0x172, 0x172}, + {0x174, 0x174}, + {0x176, 0x176}, + {0x178, 0x179}, + {0x17B, 0x17B}, + {0x17D, 0x17D}, + {0x181, 0x182}, + {0x184, 0x184}, + {0x186, 0x187}, + {0x189, 0x18B}, + {0x18E, 0x191}, + {0x193, 0x194}, + {0x196, 0x198}, + {0x19C, 0x19D}, + {0x19F, 0x1A0}, + {0x1A2, 0x1A2}, + {0x1A4, 0x1A4}, + {0x1A6, 0x1A7}, + {0x1A9, 0x1A9}, + {0x1AC, 0x1AC}, + {0x1AE, 0x1AF}, + {0x1B1, 0x1B3}, + {0x1B5, 0x1B5}, + {0x1B7, 0x1B8}, + {0x1BC, 0x1BC}, + {0x1C4, 0x1C5}, + {0x1C7, 0x1C8}, + {0x1CA, 0x1CB}, + {0x1CD, 0x1CD}, + {0x1CF, 0x1CF}, + {0x1D1, 0x1D1}, + {0x1D3, 0x1D3}, + {0x1D5, 0x1D5}, + {0x1D7, 0x1D7}, + {0x1D9, 0x1D9}, + {0x1DB, 0x1DB}, + {0x1DE, 0x1DE}, + {0x1E0, 0x1E0}, + {0x1E2, 0x1E2}, + {0x1E4, 0x1E4}, + {0x1E6, 0x1E6}, + {0x1E8, 0x1E8}, + {0x1EA, 0x1EA}, + {0x1EC, 0x1EC}, + {0x1EE, 0x1EE}, + {0x1F1, 0x1F2}, + {0x1F4, 0x1F4}, + {0x1F6, 0x1F8}, + {0x1FA, 0x1FA}, + {0x1FC, 0x1FC}, + {0x1FE, 0x1FE}, + {0x200, 0x200}, + {0x202, 0x202}, + {0x204, 0x204}, + {0x206, 0x206}, + {0x208, 0x208}, + {0x20A, 0x20A}, + {0x20C, 0x20C}, + {0x20E, 0x20E}, + {0x210, 0x210}, + {0x212, 0x212}, + {0x214, 0x214}, + {0x216, 0x216}, + {0x218, 0x218}, + {0x21A, 0x21A}, + {0x21C, 0x21C}, + {0x21E, 0x21E}, + {0x220, 0x220}, + {0x222, 0x222}, + {0x224, 0x224}, + {0x226, 0x226}, + {0x228, 0x228}, + {0x22A, 0x22A}, + {0x22C, 0x22C}, + {0x22E, 0x22E}, + {0x230, 0x230}, + {0x232, 0x232}, + {0x23A, 0x23B}, + {0x23D, 0x23E}, + {0x241, 0x241}, + {0x243, 0x246}, + {0x248, 0x248}, + {0x24A, 0x24A}, + {0x24C, 0x24C}, + {0x24E, 0x24E}, + {0x370, 0x370}, + {0x372, 0x372}, + {0x376, 0x376}, + {0x37F, 0x37F}, + {0x386, 0x386}, + {0x388, 0x38A}, + {0x38C, 0x38C}, + {0x38E, 0x38F}, + {0x391, 0x3A1}, + {0x3A3, 0x3AB}, + {0x3CF, 0x3CF}, + {0x3D8, 0x3D8}, + {0x3DA, 0x3DA}, + {0x3DC, 0x3DC}, + {0x3DE, 0x3DE}, + {0x3E0, 0x3E0}, + {0x3E2, 0x3E2}, + {0x3E4, 0x3E4}, + {0x3E6, 0x3E6}, + {0x3E8, 0x3E8}, + {0x3EA, 0x3EA}, + {0x3EC, 0x3EC}, + {0x3EE, 0x3EE}, + {0x3F4, 0x3F4}, + {0x3F7, 0x3F7}, + {0x3F9, 0x3FA}, + {0x3FD, 0x42F}, + {0x460, 0x460}, + {0x462, 0x462}, + {0x464, 0x464}, + {0x466, 0x466}, + {0x468, 0x468}, + {0x46A, 0x46A}, + {0x46C, 0x46C}, + {0x46E, 0x46E}, + {0x470, 0x470}, + {0x472, 0x472}, + {0x474, 0x474}, + {0x476, 0x476}, + {0x478, 0x478}, + {0x47A, 0x47A}, + {0x47C, 0x47C}, + {0x47E, 0x47E}, + {0x480, 0x480}, + {0x48A, 0x48A}, + {0x48C, 0x48C}, + {0x48E, 0x48E}, + {0x490, 0x490}, + {0x492, 0x492}, + {0x494, 0x494}, + {0x496, 0x496}, + {0x498, 0x498}, + {0x49A, 0x49A}, + {0x49C, 0x49C}, + {0x49E, 0x49E}, + {0x4A0, 0x4A0}, + {0x4A2, 0x4A2}, + {0x4A4, 0x4A4}, + {0x4A6, 0x4A6}, + {0x4A8, 0x4A8}, + {0x4AA, 0x4AA}, + {0x4AC, 0x4AC}, + {0x4AE, 0x4AE}, + {0x4B0, 0x4B0}, + {0x4B2, 0x4B2}, + {0x4B4, 0x4B4}, + {0x4B6, 0x4B6}, + {0x4B8, 0x4B8}, + {0x4BA, 0x4BA}, + {0x4BC, 0x4BC}, + {0x4BE, 0x4BE}, + {0x4C0, 0x4C1}, + {0x4C3, 0x4C3}, + {0x4C5, 0x4C5}, + {0x4C7, 0x4C7}, + {0x4C9, 0x4C9}, + {0x4CB, 0x4CB}, + {0x4CD, 0x4CD}, + {0x4D0, 0x4D0}, + {0x4D2, 0x4D2}, + {0x4D4, 0x4D4}, + {0x4D6, 0x4D6}, + {0x4D8, 0x4D8}, + {0x4DA, 0x4DA}, + {0x4DC, 0x4DC}, + {0x4DE, 0x4DE}, + {0x4E0, 0x4E0}, + {0x4E2, 0x4E2}, + {0x4E4, 0x4E4}, + {0x4E6, 0x4E6}, + {0x4E8, 0x4E8}, + {0x4EA, 0x4EA}, + {0x4EC, 0x4EC}, + {0x4EE, 0x4EE}, + {0x4F0, 0x4F0}, + {0x4F2, 0x4F2}, + {0x4F4, 0x4F4}, + {0x4F6, 0x4F6}, + {0x4F8, 0x4F8}, + {0x4FA, 0x4FA}, + {0x4FC, 0x4FC}, + {0x4FE, 0x4FE}, + {0x500, 0x500}, + {0x502, 0x502}, + {0x504, 0x504}, + {0x506, 0x506}, + {0x508, 0x508}, + {0x50A, 0x50A}, + {0x50C, 0x50C}, + {0x50E, 0x50E}, + {0x510, 0x510}, + {0x512, 0x512}, + {0x514, 0x514}, + {0x516, 0x516}, + {0x518, 0x518}, + {0x51A, 0x51A}, + {0x51C, 0x51C}, + {0x51E, 0x51E}, + {0x520, 0x520}, + {0x522, 0x522}, + {0x524, 0x524}, + {0x526, 0x526}, + {0x528, 0x528}, + {0x52A, 0x52A}, + {0x52C, 0x52C}, + {0x52E, 0x52E}, + {0x531, 0x556}, + {0x10A0, 0x10C5}, + {0x10C7, 0x10C7}, + {0x10CD, 0x10CD}, + {0x13A0, 0x13F5}, + {0x1C89, 0x1C89}, + {0x1C90, 0x1CBA}, + {0x1CBD, 0x1CBF}, + {0x1E00, 0x1E00}, + {0x1E02, 0x1E02}, + {0x1E04, 0x1E04}, + {0x1E06, 0x1E06}, + {0x1E08, 0x1E08}, + {0x1E0A, 0x1E0A}, + {0x1E0C, 0x1E0C}, + {0x1E0E, 0x1E0E}, + {0x1E10, 0x1E10}, + {0x1E12, 0x1E12}, + {0x1E14, 0x1E14}, + {0x1E16, 0x1E16}, + {0x1E18, 0x1E18}, + {0x1E1A, 0x1E1A}, + {0x1E1C, 0x1E1C}, + {0x1E1E, 0x1E1E}, + {0x1E20, 0x1E20}, + {0x1E22, 0x1E22}, + {0x1E24, 0x1E24}, + {0x1E26, 0x1E26}, + {0x1E28, 0x1E28}, + {0x1E2A, 0x1E2A}, + {0x1E2C, 0x1E2C}, + {0x1E2E, 0x1E2E}, + {0x1E30, 0x1E30}, + {0x1E32, 0x1E32}, + {0x1E34, 0x1E34}, + {0x1E36, 0x1E36}, + {0x1E38, 0x1E38}, + {0x1E3A, 0x1E3A}, + {0x1E3C, 0x1E3C}, + {0x1E3E, 0x1E3E}, + {0x1E40, 0x1E40}, + {0x1E42, 0x1E42}, + {0x1E44, 0x1E44}, + {0x1E46, 0x1E46}, + {0x1E48, 0x1E48}, + {0x1E4A, 0x1E4A}, + {0x1E4C, 0x1E4C}, + {0x1E4E, 0x1E4E}, + {0x1E50, 0x1E50}, + {0x1E52, 0x1E52}, + {0x1E54, 0x1E54}, + {0x1E56, 0x1E56}, + {0x1E58, 0x1E58}, + {0x1E5A, 0x1E5A}, + {0x1E5C, 0x1E5C}, + {0x1E5E, 0x1E5E}, + {0x1E60, 0x1E60}, + {0x1E62, 0x1E62}, + {0x1E64, 0x1E64}, + {0x1E66, 0x1E66}, + {0x1E68, 0x1E68}, + {0x1E6A, 0x1E6A}, + {0x1E6C, 0x1E6C}, + {0x1E6E, 0x1E6E}, + {0x1E70, 0x1E70}, + {0x1E72, 0x1E72}, + {0x1E74, 0x1E74}, + {0x1E76, 0x1E76}, + {0x1E78, 0x1E78}, + {0x1E7A, 0x1E7A}, + {0x1E7C, 0x1E7C}, + {0x1E7E, 0x1E7E}, + {0x1E80, 0x1E80}, + {0x1E82, 0x1E82}, + {0x1E84, 0x1E84}, + {0x1E86, 0x1E86}, + {0x1E88, 0x1E88}, + {0x1E8A, 0x1E8A}, + {0x1E8C, 0x1E8C}, + {0x1E8E, 0x1E8E}, + {0x1E90, 0x1E90}, + {0x1E92, 0x1E92}, + {0x1E94, 0x1E94}, + {0x1E9E, 0x1E9E}, + {0x1EA0, 0x1EA0}, + {0x1EA2, 0x1EA2}, + {0x1EA4, 0x1EA4}, + {0x1EA6, 0x1EA6}, + {0x1EA8, 0x1EA8}, + {0x1EAA, 0x1EAA}, + {0x1EAC, 0x1EAC}, + {0x1EAE, 0x1EAE}, + {0x1EB0, 0x1EB0}, + {0x1EB2, 0x1EB2}, + {0x1EB4, 0x1EB4}, + {0x1EB6, 0x1EB6}, + {0x1EB8, 0x1EB8}, + {0x1EBA, 0x1EBA}, + {0x1EBC, 0x1EBC}, + {0x1EBE, 0x1EBE}, + {0x1EC0, 0x1EC0}, + {0x1EC2, 0x1EC2}, + {0x1EC4, 0x1EC4}, + {0x1EC6, 0x1EC6}, + {0x1EC8, 0x1EC8}, + {0x1ECA, 0x1ECA}, + {0x1ECC, 0x1ECC}, + {0x1ECE, 0x1ECE}, + {0x1ED0, 0x1ED0}, + {0x1ED2, 0x1ED2}, + {0x1ED4, 0x1ED4}, + {0x1ED6, 0x1ED6}, + {0x1ED8, 0x1ED8}, + {0x1EDA, 0x1EDA}, + {0x1EDC, 0x1EDC}, + {0x1EDE, 0x1EDE}, + {0x1EE0, 0x1EE0}, + {0x1EE2, 0x1EE2}, + {0x1EE4, 0x1EE4}, + {0x1EE6, 0x1EE6}, + {0x1EE8, 0x1EE8}, + {0x1EEA, 0x1EEA}, + {0x1EEC, 0x1EEC}, + {0x1EEE, 0x1EEE}, + {0x1EF0, 0x1EF0}, + {0x1EF2, 0x1EF2}, + {0x1EF4, 0x1EF4}, + {0x1EF6, 0x1EF6}, + {0x1EF8, 0x1EF8}, + {0x1EFA, 0x1EFA}, + {0x1EFC, 0x1EFC}, + {0x1EFE, 0x1EFE}, + {0x1F08, 0x1F0F}, + {0x1F18, 0x1F1D}, + {0x1F28, 0x1F2F}, + {0x1F38, 0x1F3F}, + {0x1F48, 0x1F4D}, + {0x1F59, 0x1F59}, + {0x1F5B, 0x1F5B}, + {0x1F5D, 0x1F5D}, + {0x1F5F, 0x1F5F}, + {0x1F68, 0x1F6F}, + {0x1F88, 0x1F8F}, + {0x1F98, 0x1F9F}, + {0x1FA8, 0x1FAF}, + {0x1FB8, 0x1FBC}, + {0x1FC8, 0x1FCC}, + {0x1FD8, 0x1FDB}, + {0x1FE8, 0x1FEC}, + {0x1FF8, 0x1FFC}, + {0x2126, 0x2126}, + {0x212A, 0x212B}, + {0x2132, 0x2132}, + {0x2160, 0x216F}, + {0x2183, 0x2183}, + {0x24B6, 0x24CF}, + {0x2C00, 0x2C2F}, + {0x2C60, 0x2C60}, + {0x2C62, 0x2C64}, + {0x2C67, 0x2C67}, + {0x2C69, 0x2C69}, + {0x2C6B, 0x2C6B}, + {0x2C6D, 0x2C70}, + {0x2C72, 0x2C72}, + {0x2C75, 0x2C75}, + {0x2C7E, 0x2C80}, + {0x2C82, 0x2C82}, + {0x2C84, 0x2C84}, + {0x2C86, 0x2C86}, + {0x2C88, 0x2C88}, + {0x2C8A, 0x2C8A}, + {0x2C8C, 0x2C8C}, + {0x2C8E, 0x2C8E}, + {0x2C90, 0x2C90}, + {0x2C92, 0x2C92}, + {0x2C94, 0x2C94}, + {0x2C96, 0x2C96}, + {0x2C98, 0x2C98}, + {0x2C9A, 0x2C9A}, + {0x2C9C, 0x2C9C}, + {0x2C9E, 0x2C9E}, + {0x2CA0, 0x2CA0}, + {0x2CA2, 0x2CA2}, + {0x2CA4, 0x2CA4}, + {0x2CA6, 0x2CA6}, + {0x2CA8, 0x2CA8}, + {0x2CAA, 0x2CAA}, + {0x2CAC, 0x2CAC}, + {0x2CAE, 0x2CAE}, + {0x2CB0, 0x2CB0}, + {0x2CB2, 0x2CB2}, + {0x2CB4, 0x2CB4}, + {0x2CB6, 0x2CB6}, + {0x2CB8, 0x2CB8}, + {0x2CBA, 0x2CBA}, + {0x2CBC, 0x2CBC}, + {0x2CBE, 0x2CBE}, + {0x2CC0, 0x2CC0}, + {0x2CC2, 0x2CC2}, + {0x2CC4, 0x2CC4}, + {0x2CC6, 0x2CC6}, + {0x2CC8, 0x2CC8}, + {0x2CCA, 0x2CCA}, + {0x2CCC, 0x2CCC}, + {0x2CCE, 0x2CCE}, + {0x2CD0, 0x2CD0}, + {0x2CD2, 0x2CD2}, + {0x2CD4, 0x2CD4}, + {0x2CD6, 0x2CD6}, + {0x2CD8, 0x2CD8}, + {0x2CDA, 0x2CDA}, + {0x2CDC, 0x2CDC}, + {0x2CDE, 0x2CDE}, + {0x2CE0, 0x2CE0}, + {0x2CE2, 0x2CE2}, + {0x2CEB, 0x2CEB}, + {0x2CED, 0x2CED}, + {0x2CF2, 0x2CF2}, + {0xA640, 0xA640}, + {0xA642, 0xA642}, + {0xA644, 0xA644}, + {0xA646, 0xA646}, + {0xA648, 0xA648}, + {0xA64A, 0xA64A}, + {0xA64C, 0xA64C}, + {0xA64E, 0xA64E}, + {0xA650, 0xA650}, + {0xA652, 0xA652}, + {0xA654, 0xA654}, + {0xA656, 0xA656}, + {0xA658, 0xA658}, + {0xA65A, 0xA65A}, + {0xA65C, 0xA65C}, + {0xA65E, 0xA65E}, + {0xA660, 0xA660}, + {0xA662, 0xA662}, + {0xA664, 0xA664}, + {0xA666, 0xA666}, + {0xA668, 0xA668}, + {0xA66A, 0xA66A}, + {0xA66C, 0xA66C}, + {0xA680, 0xA680}, + {0xA682, 0xA682}, + {0xA684, 0xA684}, + {0xA686, 0xA686}, + {0xA688, 0xA688}, + {0xA68A, 0xA68A}, + {0xA68C, 0xA68C}, + {0xA68E, 0xA68E}, + {0xA690, 0xA690}, + {0xA692, 0xA692}, + {0xA694, 0xA694}, + {0xA696, 0xA696}, + {0xA698, 0xA698}, + {0xA69A, 0xA69A}, + {0xA722, 0xA722}, + {0xA724, 0xA724}, + {0xA726, 0xA726}, + {0xA728, 0xA728}, + {0xA72A, 0xA72A}, + {0xA72C, 0xA72C}, + {0xA72E, 0xA72E}, + {0xA732, 0xA732}, + {0xA734, 0xA734}, + {0xA736, 0xA736}, + {0xA738, 0xA738}, + {0xA73A, 0xA73A}, + {0xA73C, 0xA73C}, + {0xA73E, 0xA73E}, + {0xA740, 0xA740}, + {0xA742, 0xA742}, + {0xA744, 0xA744}, + {0xA746, 0xA746}, + {0xA748, 0xA748}, + {0xA74A, 0xA74A}, + {0xA74C, 0xA74C}, + {0xA74E, 0xA74E}, + {0xA750, 0xA750}, + {0xA752, 0xA752}, + {0xA754, 0xA754}, + {0xA756, 0xA756}, + {0xA758, 0xA758}, + {0xA75A, 0xA75A}, + {0xA75C, 0xA75C}, + {0xA75E, 0xA75E}, + {0xA760, 0xA760}, + {0xA762, 0xA762}, + {0xA764, 0xA764}, + {0xA766, 0xA766}, + {0xA768, 0xA768}, + {0xA76A, 0xA76A}, + {0xA76C, 0xA76C}, + {0xA76E, 0xA76E}, + {0xA779, 0xA779}, + {0xA77B, 0xA77B}, + {0xA77D, 0xA77E}, + {0xA780, 0xA780}, + {0xA782, 0xA782}, + {0xA784, 0xA784}, + {0xA786, 0xA786}, + {0xA78B, 0xA78B}, + {0xA78D, 0xA78D}, + {0xA790, 0xA790}, + {0xA792, 0xA792}, + {0xA796, 0xA796}, + {0xA798, 0xA798}, + {0xA79A, 0xA79A}, + {0xA79C, 0xA79C}, + {0xA79E, 0xA79E}, + {0xA7A0, 0xA7A0}, + {0xA7A2, 0xA7A2}, + {0xA7A4, 0xA7A4}, + {0xA7A6, 0xA7A6}, + {0xA7A8, 0xA7A8}, + {0xA7AA, 0xA7AE}, + {0xA7B0, 0xA7B4}, + {0xA7B6, 0xA7B6}, + {0xA7B8, 0xA7B8}, + {0xA7BA, 0xA7BA}, + {0xA7BC, 0xA7BC}, + {0xA7BE, 0xA7BE}, + {0xA7C0, 0xA7C0}, + {0xA7C2, 0xA7C2}, + {0xA7C4, 0xA7C7}, + {0xA7C9, 0xA7C9}, + {0xA7CB, 0xA7CC}, + {0xA7CE, 0xA7CE}, + {0xA7D0, 0xA7D0}, + {0xA7D2, 0xA7D2}, + {0xA7D4, 0xA7D4}, + {0xA7D6, 0xA7D6}, + {0xA7D8, 0xA7D8}, + {0xA7DA, 0xA7DA}, + {0xA7DC, 0xA7DC}, + {0xA7F5, 0xA7F5}, + {0xFF21, 0xFF3A}, + {0x10400, 0x10427}, + {0x104B0, 0x104D3}, + {0x10570, 0x1057A}, + {0x1057C, 0x1058A}, + {0x1058C, 0x10592}, + {0x10594, 0x10595}, + {0x10C80, 0x10CB2}, + {0x10D50, 0x10D65}, + {0x118A0, 0x118BF}, + {0x16E40, 0x16E5F}, + {0x16EA0, 0x16EB8}, + {0x1E900, 0x1E921}, + }, + "Changes_When_NFKC_Casefolded": { + {0x41, 0x5A}, + {0xA0, 0xA0}, + {0xA8, 0xA8}, + {0xAA, 0xAA}, + {0xAD, 0xAD}, + {0xAF, 0xAF}, + {0xB2, 0xB5}, + {0xB8, 0xBA}, + {0xBC, 0xBE}, + {0xC0, 0xD6}, + {0xD8, 0xDF}, + {0x100, 0x100}, + {0x102, 0x102}, + {0x104, 0x104}, + {0x106, 0x106}, + {0x108, 0x108}, + {0x10A, 0x10A}, + {0x10C, 0x10C}, + {0x10E, 0x10E}, + {0x110, 0x110}, + {0x112, 0x112}, + {0x114, 0x114}, + {0x116, 0x116}, + {0x118, 0x118}, + {0x11A, 0x11A}, + {0x11C, 0x11C}, + {0x11E, 0x11E}, + {0x120, 0x120}, + {0x122, 0x122}, + {0x124, 0x124}, + {0x126, 0x126}, + {0x128, 0x128}, + {0x12A, 0x12A}, + {0x12C, 0x12C}, + {0x12E, 0x12E}, + {0x130, 0x130}, + {0x132, 0x134}, + {0x136, 0x136}, + {0x139, 0x139}, + {0x13B, 0x13B}, + {0x13D, 0x13D}, + {0x13F, 0x141}, + {0x143, 0x143}, + {0x145, 0x145}, + {0x147, 0x147}, + {0x149, 0x14A}, + {0x14C, 0x14C}, + {0x14E, 0x14E}, + {0x150, 0x150}, + {0x152, 0x152}, + {0x154, 0x154}, + {0x156, 0x156}, + {0x158, 0x158}, + {0x15A, 0x15A}, + {0x15C, 0x15C}, + {0x15E, 0x15E}, + {0x160, 0x160}, + {0x162, 0x162}, + {0x164, 0x164}, + {0x166, 0x166}, + {0x168, 0x168}, + {0x16A, 0x16A}, + {0x16C, 0x16C}, + {0x16E, 0x16E}, + {0x170, 0x170}, + {0x172, 0x172}, + {0x174, 0x174}, + {0x176, 0x176}, + {0x178, 0x179}, + {0x17B, 0x17B}, + {0x17D, 0x17D}, + {0x17F, 0x17F}, + {0x181, 0x182}, + {0x184, 0x184}, + {0x186, 0x187}, + {0x189, 0x18B}, + {0x18E, 0x191}, + {0x193, 0x194}, + {0x196, 0x198}, + {0x19C, 0x19D}, + {0x19F, 0x1A0}, + {0x1A2, 0x1A2}, + {0x1A4, 0x1A4}, + {0x1A6, 0x1A7}, + {0x1A9, 0x1A9}, + {0x1AC, 0x1AC}, + {0x1AE, 0x1AF}, + {0x1B1, 0x1B3}, + {0x1B5, 0x1B5}, + {0x1B7, 0x1B8}, + {0x1BC, 0x1BC}, + {0x1C4, 0x1CD}, + {0x1CF, 0x1CF}, + {0x1D1, 0x1D1}, + {0x1D3, 0x1D3}, + {0x1D5, 0x1D5}, + {0x1D7, 0x1D7}, + {0x1D9, 0x1D9}, + {0x1DB, 0x1DB}, + {0x1DE, 0x1DE}, + {0x1E0, 0x1E0}, + {0x1E2, 0x1E2}, + {0x1E4, 0x1E4}, + {0x1E6, 0x1E6}, + {0x1E8, 0x1E8}, + {0x1EA, 0x1EA}, + {0x1EC, 0x1EC}, + {0x1EE, 0x1EE}, + {0x1F1, 0x1F4}, + {0x1F6, 0x1F8}, + {0x1FA, 0x1FA}, + {0x1FC, 0x1FC}, + {0x1FE, 0x1FE}, + {0x200, 0x200}, + {0x202, 0x202}, + {0x204, 0x204}, + {0x206, 0x206}, + {0x208, 0x208}, + {0x20A, 0x20A}, + {0x20C, 0x20C}, + {0x20E, 0x20E}, + {0x210, 0x210}, + {0x212, 0x212}, + {0x214, 0x214}, + {0x216, 0x216}, + {0x218, 0x218}, + {0x21A, 0x21A}, + {0x21C, 0x21C}, + {0x21E, 0x21E}, + {0x220, 0x220}, + {0x222, 0x222}, + {0x224, 0x224}, + {0x226, 0x226}, + {0x228, 0x228}, + {0x22A, 0x22A}, + {0x22C, 0x22C}, + {0x22E, 0x22E}, + {0x230, 0x230}, + {0x232, 0x232}, + {0x23A, 0x23B}, + {0x23D, 0x23E}, + {0x241, 0x241}, + {0x243, 0x246}, + {0x248, 0x248}, + {0x24A, 0x24A}, + {0x24C, 0x24C}, + {0x24E, 0x24E}, + {0x2B0, 0x2B8}, + {0x2D8, 0x2DD}, + {0x2E0, 0x2E4}, + {0x340, 0x341}, + {0x343, 0x345}, + {0x34F, 0x34F}, + {0x370, 0x370}, + {0x372, 0x372}, + {0x374, 0x374}, + {0x376, 0x376}, + {0x37A, 0x37A}, + {0x37E, 0x37F}, + {0x384, 0x38A}, + {0x38C, 0x38C}, + {0x38E, 0x38F}, + {0x391, 0x3A1}, + {0x3A3, 0x3AB}, + {0x3C2, 0x3C2}, + {0x3CF, 0x3D6}, + {0x3D8, 0x3D8}, + {0x3DA, 0x3DA}, + {0x3DC, 0x3DC}, + {0x3DE, 0x3DE}, + {0x3E0, 0x3E0}, + {0x3E2, 0x3E2}, + {0x3E4, 0x3E4}, + {0x3E6, 0x3E6}, + {0x3E8, 0x3E8}, + {0x3EA, 0x3EA}, + {0x3EC, 0x3EC}, + {0x3EE, 0x3EE}, + {0x3F0, 0x3F2}, + {0x3F4, 0x3F5}, + {0x3F7, 0x3F7}, + {0x3F9, 0x3FA}, + {0x3FD, 0x42F}, + {0x460, 0x460}, + {0x462, 0x462}, + {0x464, 0x464}, + {0x466, 0x466}, + {0x468, 0x468}, + {0x46A, 0x46A}, + {0x46C, 0x46C}, + {0x46E, 0x46E}, + {0x470, 0x470}, + {0x472, 0x472}, + {0x474, 0x474}, + {0x476, 0x476}, + {0x478, 0x478}, + {0x47A, 0x47A}, + {0x47C, 0x47C}, + {0x47E, 0x47E}, + {0x480, 0x480}, + {0x48A, 0x48A}, + {0x48C, 0x48C}, + {0x48E, 0x48E}, + {0x490, 0x490}, + {0x492, 0x492}, + {0x494, 0x494}, + {0x496, 0x496}, + {0x498, 0x498}, + {0x49A, 0x49A}, + {0x49C, 0x49C}, + {0x49E, 0x49E}, + {0x4A0, 0x4A0}, + {0x4A2, 0x4A2}, + {0x4A4, 0x4A4}, + {0x4A6, 0x4A6}, + {0x4A8, 0x4A8}, + {0x4AA, 0x4AA}, + {0x4AC, 0x4AC}, + {0x4AE, 0x4AE}, + {0x4B0, 0x4B0}, + {0x4B2, 0x4B2}, + {0x4B4, 0x4B4}, + {0x4B6, 0x4B6}, + {0x4B8, 0x4B8}, + {0x4BA, 0x4BA}, + {0x4BC, 0x4BC}, + {0x4BE, 0x4BE}, + {0x4C0, 0x4C1}, + {0x4C3, 0x4C3}, + {0x4C5, 0x4C5}, + {0x4C7, 0x4C7}, + {0x4C9, 0x4C9}, + {0x4CB, 0x4CB}, + {0x4CD, 0x4CD}, + {0x4D0, 0x4D0}, + {0x4D2, 0x4D2}, + {0x4D4, 0x4D4}, + {0x4D6, 0x4D6}, + {0x4D8, 0x4D8}, + {0x4DA, 0x4DA}, + {0x4DC, 0x4DC}, + {0x4DE, 0x4DE}, + {0x4E0, 0x4E0}, + {0x4E2, 0x4E2}, + {0x4E4, 0x4E4}, + {0x4E6, 0x4E6}, + {0x4E8, 0x4E8}, + {0x4EA, 0x4EA}, + {0x4EC, 0x4EC}, + {0x4EE, 0x4EE}, + {0x4F0, 0x4F0}, + {0x4F2, 0x4F2}, + {0x4F4, 0x4F4}, + {0x4F6, 0x4F6}, + {0x4F8, 0x4F8}, + {0x4FA, 0x4FA}, + {0x4FC, 0x4FC}, + {0x4FE, 0x4FE}, + {0x500, 0x500}, + {0x502, 0x502}, + {0x504, 0x504}, + {0x506, 0x506}, + {0x508, 0x508}, + {0x50A, 0x50A}, + {0x50C, 0x50C}, + {0x50E, 0x50E}, + {0x510, 0x510}, + {0x512, 0x512}, + {0x514, 0x514}, + {0x516, 0x516}, + {0x518, 0x518}, + {0x51A, 0x51A}, + {0x51C, 0x51C}, + {0x51E, 0x51E}, + {0x520, 0x520}, + {0x522, 0x522}, + {0x524, 0x524}, + {0x526, 0x526}, + {0x528, 0x528}, + {0x52A, 0x52A}, + {0x52C, 0x52C}, + {0x52E, 0x52E}, + {0x531, 0x556}, + {0x587, 0x587}, + {0x61C, 0x61C}, + {0x675, 0x678}, + {0x958, 0x95F}, + {0x9DC, 0x9DD}, + {0x9DF, 0x9DF}, + {0xA33, 0xA33}, + {0xA36, 0xA36}, + {0xA59, 0xA5B}, + {0xA5E, 0xA5E}, + {0xB5C, 0xB5D}, + {0xE33, 0xE33}, + {0xEB3, 0xEB3}, + {0xEDC, 0xEDD}, + {0xF0C, 0xF0C}, + {0xF43, 0xF43}, + {0xF4D, 0xF4D}, + {0xF52, 0xF52}, + {0xF57, 0xF57}, + {0xF5C, 0xF5C}, + {0xF69, 0xF69}, + {0xF73, 0xF73}, + {0xF75, 0xF79}, + {0xF81, 0xF81}, + {0xF93, 0xF93}, + {0xF9D, 0xF9D}, + {0xFA2, 0xFA2}, + {0xFA7, 0xFA7}, + {0xFAC, 0xFAC}, + {0xFB9, 0xFB9}, + {0x10A0, 0x10C5}, + {0x10C7, 0x10C7}, + {0x10CD, 0x10CD}, + {0x10FC, 0x10FC}, + {0x115F, 0x1160}, + {0x13F8, 0x13FD}, + {0x17B4, 0x17B5}, + {0x180B, 0x180F}, + {0x1C80, 0x1C89}, + {0x1C90, 0x1CBA}, + {0x1CBD, 0x1CBF}, + {0x1D2C, 0x1D2E}, + {0x1D30, 0x1D3A}, + {0x1D3C, 0x1D4D}, + {0x1D4F, 0x1D6A}, + {0x1D78, 0x1D78}, + {0x1D9B, 0x1DBF}, + {0x1E00, 0x1E00}, + {0x1E02, 0x1E02}, + {0x1E04, 0x1E04}, + {0x1E06, 0x1E06}, + {0x1E08, 0x1E08}, + {0x1E0A, 0x1E0A}, + {0x1E0C, 0x1E0C}, + {0x1E0E, 0x1E0E}, + {0x1E10, 0x1E10}, + {0x1E12, 0x1E12}, + {0x1E14, 0x1E14}, + {0x1E16, 0x1E16}, + {0x1E18, 0x1E18}, + {0x1E1A, 0x1E1A}, + {0x1E1C, 0x1E1C}, + {0x1E1E, 0x1E1E}, + {0x1E20, 0x1E20}, + {0x1E22, 0x1E22}, + {0x1E24, 0x1E24}, + {0x1E26, 0x1E26}, + {0x1E28, 0x1E28}, + {0x1E2A, 0x1E2A}, + {0x1E2C, 0x1E2C}, + {0x1E2E, 0x1E2E}, + {0x1E30, 0x1E30}, + {0x1E32, 0x1E32}, + {0x1E34, 0x1E34}, + {0x1E36, 0x1E36}, + {0x1E38, 0x1E38}, + {0x1E3A, 0x1E3A}, + {0x1E3C, 0x1E3C}, + {0x1E3E, 0x1E3E}, + {0x1E40, 0x1E40}, + {0x1E42, 0x1E42}, + {0x1E44, 0x1E44}, + {0x1E46, 0x1E46}, + {0x1E48, 0x1E48}, + {0x1E4A, 0x1E4A}, + {0x1E4C, 0x1E4C}, + {0x1E4E, 0x1E4E}, + {0x1E50, 0x1E50}, + {0x1E52, 0x1E52}, + {0x1E54, 0x1E54}, + {0x1E56, 0x1E56}, + {0x1E58, 0x1E58}, + {0x1E5A, 0x1E5A}, + {0x1E5C, 0x1E5C}, + {0x1E5E, 0x1E5E}, + {0x1E60, 0x1E60}, + {0x1E62, 0x1E62}, + {0x1E64, 0x1E64}, + {0x1E66, 0x1E66}, + {0x1E68, 0x1E68}, + {0x1E6A, 0x1E6A}, + {0x1E6C, 0x1E6C}, + {0x1E6E, 0x1E6E}, + {0x1E70, 0x1E70}, + {0x1E72, 0x1E72}, + {0x1E74, 0x1E74}, + {0x1E76, 0x1E76}, + {0x1E78, 0x1E78}, + {0x1E7A, 0x1E7A}, + {0x1E7C, 0x1E7C}, + {0x1E7E, 0x1E7E}, + {0x1E80, 0x1E80}, + {0x1E82, 0x1E82}, + {0x1E84, 0x1E84}, + {0x1E86, 0x1E86}, + {0x1E88, 0x1E88}, + {0x1E8A, 0x1E8A}, + {0x1E8C, 0x1E8C}, + {0x1E8E, 0x1E8E}, + {0x1E90, 0x1E90}, + {0x1E92, 0x1E92}, + {0x1E94, 0x1E94}, + {0x1E9A, 0x1E9B}, + {0x1E9E, 0x1E9E}, + {0x1EA0, 0x1EA0}, + {0x1EA2, 0x1EA2}, + {0x1EA4, 0x1EA4}, + {0x1EA6, 0x1EA6}, + {0x1EA8, 0x1EA8}, + {0x1EAA, 0x1EAA}, + {0x1EAC, 0x1EAC}, + {0x1EAE, 0x1EAE}, + {0x1EB0, 0x1EB0}, + {0x1EB2, 0x1EB2}, + {0x1EB4, 0x1EB4}, + {0x1EB6, 0x1EB6}, + {0x1EB8, 0x1EB8}, + {0x1EBA, 0x1EBA}, + {0x1EBC, 0x1EBC}, + {0x1EBE, 0x1EBE}, + {0x1EC0, 0x1EC0}, + {0x1EC2, 0x1EC2}, + {0x1EC4, 0x1EC4}, + {0x1EC6, 0x1EC6}, + {0x1EC8, 0x1EC8}, + {0x1ECA, 0x1ECA}, + {0x1ECC, 0x1ECC}, + {0x1ECE, 0x1ECE}, + {0x1ED0, 0x1ED0}, + {0x1ED2, 0x1ED2}, + {0x1ED4, 0x1ED4}, + {0x1ED6, 0x1ED6}, + {0x1ED8, 0x1ED8}, + {0x1EDA, 0x1EDA}, + {0x1EDC, 0x1EDC}, + {0x1EDE, 0x1EDE}, + {0x1EE0, 0x1EE0}, + {0x1EE2, 0x1EE2}, + {0x1EE4, 0x1EE4}, + {0x1EE6, 0x1EE6}, + {0x1EE8, 0x1EE8}, + {0x1EEA, 0x1EEA}, + {0x1EEC, 0x1EEC}, + {0x1EEE, 0x1EEE}, + {0x1EF0, 0x1EF0}, + {0x1EF2, 0x1EF2}, + {0x1EF4, 0x1EF4}, + {0x1EF6, 0x1EF6}, + {0x1EF8, 0x1EF8}, + {0x1EFA, 0x1EFA}, + {0x1EFC, 0x1EFC}, + {0x1EFE, 0x1EFE}, + {0x1F08, 0x1F0F}, + {0x1F18, 0x1F1D}, + {0x1F28, 0x1F2F}, + {0x1F38, 0x1F3F}, + {0x1F48, 0x1F4D}, + {0x1F59, 0x1F59}, + {0x1F5B, 0x1F5B}, + {0x1F5D, 0x1F5D}, + {0x1F5F, 0x1F5F}, + {0x1F68, 0x1F6F}, + {0x1F71, 0x1F71}, + {0x1F73, 0x1F73}, + {0x1F75, 0x1F75}, + {0x1F77, 0x1F77}, + {0x1F79, 0x1F79}, + {0x1F7B, 0x1F7B}, + {0x1F7D, 0x1F7D}, + {0x1F80, 0x1FAF}, + {0x1FB2, 0x1FB4}, + {0x1FB7, 0x1FC4}, + {0x1FC7, 0x1FCF}, + {0x1FD3, 0x1FD3}, + {0x1FD8, 0x1FDB}, + {0x1FDD, 0x1FDF}, + {0x1FE3, 0x1FE3}, + {0x1FE8, 0x1FEF}, + {0x1FF2, 0x1FF4}, + {0x1FF7, 0x1FFE}, + {0x2000, 0x200F}, + {0x2011, 0x2011}, + {0x2017, 0x2017}, + {0x2024, 0x2026}, + {0x202A, 0x202F}, + {0x2033, 0x2034}, + {0x2036, 0x2037}, + {0x203C, 0x203C}, + {0x203E, 0x203E}, + {0x2047, 0x2049}, + {0x2057, 0x2057}, + {0x205F, 0x2071}, + {0x2074, 0x208E}, + {0x2090, 0x209C}, + {0x20A8, 0x20A8}, + {0x2100, 0x2103}, + {0x2105, 0x2107}, + {0x2109, 0x2113}, + {0x2115, 0x2116}, + {0x2119, 0x211D}, + {0x2120, 0x2122}, + {0x2124, 0x2124}, + {0x2126, 0x2126}, + {0x2128, 0x2128}, + {0x212A, 0x212D}, + {0x212F, 0x2139}, + {0x213B, 0x2140}, + {0x2145, 0x2149}, + {0x2150, 0x217F}, + {0x2183, 0x2183}, + {0x2189, 0x2189}, + {0x222C, 0x222D}, + {0x222F, 0x2230}, + {0x2329, 0x232A}, + {0x2460, 0x24EA}, + {0x2A0C, 0x2A0C}, + {0x2A74, 0x2A76}, + {0x2ADC, 0x2ADC}, + {0x2C00, 0x2C2F}, + {0x2C60, 0x2C60}, + {0x2C62, 0x2C64}, + {0x2C67, 0x2C67}, + {0x2C69, 0x2C69}, + {0x2C6B, 0x2C6B}, + {0x2C6D, 0x2C70}, + {0x2C72, 0x2C72}, + {0x2C75, 0x2C75}, + {0x2C7C, 0x2C80}, + {0x2C82, 0x2C82}, + {0x2C84, 0x2C84}, + {0x2C86, 0x2C86}, + {0x2C88, 0x2C88}, + {0x2C8A, 0x2C8A}, + {0x2C8C, 0x2C8C}, + {0x2C8E, 0x2C8E}, + {0x2C90, 0x2C90}, + {0x2C92, 0x2C92}, + {0x2C94, 0x2C94}, + {0x2C96, 0x2C96}, + {0x2C98, 0x2C98}, + {0x2C9A, 0x2C9A}, + {0x2C9C, 0x2C9C}, + {0x2C9E, 0x2C9E}, + {0x2CA0, 0x2CA0}, + {0x2CA2, 0x2CA2}, + {0x2CA4, 0x2CA4}, + {0x2CA6, 0x2CA6}, + {0x2CA8, 0x2CA8}, + {0x2CAA, 0x2CAA}, + {0x2CAC, 0x2CAC}, + {0x2CAE, 0x2CAE}, + {0x2CB0, 0x2CB0}, + {0x2CB2, 0x2CB2}, + {0x2CB4, 0x2CB4}, + {0x2CB6, 0x2CB6}, + {0x2CB8, 0x2CB8}, + {0x2CBA, 0x2CBA}, + {0x2CBC, 0x2CBC}, + {0x2CBE, 0x2CBE}, + {0x2CC0, 0x2CC0}, + {0x2CC2, 0x2CC2}, + {0x2CC4, 0x2CC4}, + {0x2CC6, 0x2CC6}, + {0x2CC8, 0x2CC8}, + {0x2CCA, 0x2CCA}, + {0x2CCC, 0x2CCC}, + {0x2CCE, 0x2CCE}, + {0x2CD0, 0x2CD0}, + {0x2CD2, 0x2CD2}, + {0x2CD4, 0x2CD4}, + {0x2CD6, 0x2CD6}, + {0x2CD8, 0x2CD8}, + {0x2CDA, 0x2CDA}, + {0x2CDC, 0x2CDC}, + {0x2CDE, 0x2CDE}, + {0x2CE0, 0x2CE0}, + {0x2CE2, 0x2CE2}, + {0x2CEB, 0x2CEB}, + {0x2CED, 0x2CED}, + {0x2CF2, 0x2CF2}, + {0x2D6F, 0x2D6F}, + {0x2E9F, 0x2E9F}, + {0x2EF3, 0x2EF3}, + {0x2F00, 0x2FD5}, + {0x3000, 0x3000}, + {0x3036, 0x3036}, + {0x3038, 0x303A}, + {0x309B, 0x309C}, + {0x309F, 0x309F}, + {0x30FF, 0x30FF}, + {0x3131, 0x318E}, + {0x3192, 0x319F}, + {0x3200, 0x321E}, + {0x3220, 0x3247}, + {0x3250, 0x327E}, + {0x3280, 0x33FF}, + {0xA640, 0xA640}, + {0xA642, 0xA642}, + {0xA644, 0xA644}, + {0xA646, 0xA646}, + {0xA648, 0xA648}, + {0xA64A, 0xA64A}, + {0xA64C, 0xA64C}, + {0xA64E, 0xA64E}, + {0xA650, 0xA650}, + {0xA652, 0xA652}, + {0xA654, 0xA654}, + {0xA656, 0xA656}, + {0xA658, 0xA658}, + {0xA65A, 0xA65A}, + {0xA65C, 0xA65C}, + {0xA65E, 0xA65E}, + {0xA660, 0xA660}, + {0xA662, 0xA662}, + {0xA664, 0xA664}, + {0xA666, 0xA666}, + {0xA668, 0xA668}, + {0xA66A, 0xA66A}, + {0xA66C, 0xA66C}, + {0xA680, 0xA680}, + {0xA682, 0xA682}, + {0xA684, 0xA684}, + {0xA686, 0xA686}, + {0xA688, 0xA688}, + {0xA68A, 0xA68A}, + {0xA68C, 0xA68C}, + {0xA68E, 0xA68E}, + {0xA690, 0xA690}, + {0xA692, 0xA692}, + {0xA694, 0xA694}, + {0xA696, 0xA696}, + {0xA698, 0xA698}, + {0xA69A, 0xA69A}, + {0xA69C, 0xA69D}, + {0xA722, 0xA722}, + {0xA724, 0xA724}, + {0xA726, 0xA726}, + {0xA728, 0xA728}, + {0xA72A, 0xA72A}, + {0xA72C, 0xA72C}, + {0xA72E, 0xA72E}, + {0xA732, 0xA732}, + {0xA734, 0xA734}, + {0xA736, 0xA736}, + {0xA738, 0xA738}, + {0xA73A, 0xA73A}, + {0xA73C, 0xA73C}, + {0xA73E, 0xA73E}, + {0xA740, 0xA740}, + {0xA742, 0xA742}, + {0xA744, 0xA744}, + {0xA746, 0xA746}, + {0xA748, 0xA748}, + {0xA74A, 0xA74A}, + {0xA74C, 0xA74C}, + {0xA74E, 0xA74E}, + {0xA750, 0xA750}, + {0xA752, 0xA752}, + {0xA754, 0xA754}, + {0xA756, 0xA756}, + {0xA758, 0xA758}, + {0xA75A, 0xA75A}, + {0xA75C, 0xA75C}, + {0xA75E, 0xA75E}, + {0xA760, 0xA760}, + {0xA762, 0xA762}, + {0xA764, 0xA764}, + {0xA766, 0xA766}, + {0xA768, 0xA768}, + {0xA76A, 0xA76A}, + {0xA76C, 0xA76C}, + {0xA76E, 0xA76E}, + {0xA770, 0xA770}, + {0xA779, 0xA779}, + {0xA77B, 0xA77B}, + {0xA77D, 0xA77E}, + {0xA780, 0xA780}, + {0xA782, 0xA782}, + {0xA784, 0xA784}, + {0xA786, 0xA786}, + {0xA78B, 0xA78B}, + {0xA78D, 0xA78D}, + {0xA790, 0xA790}, + {0xA792, 0xA792}, + {0xA796, 0xA796}, + {0xA798, 0xA798}, + {0xA79A, 0xA79A}, + {0xA79C, 0xA79C}, + {0xA79E, 0xA79E}, + {0xA7A0, 0xA7A0}, + {0xA7A2, 0xA7A2}, + {0xA7A4, 0xA7A4}, + {0xA7A6, 0xA7A6}, + {0xA7A8, 0xA7A8}, + {0xA7AA, 0xA7AE}, + {0xA7B0, 0xA7B4}, + {0xA7B6, 0xA7B6}, + {0xA7B8, 0xA7B8}, + {0xA7BA, 0xA7BA}, + {0xA7BC, 0xA7BC}, + {0xA7BE, 0xA7BE}, + {0xA7C0, 0xA7C0}, + {0xA7C2, 0xA7C2}, + {0xA7C4, 0xA7C7}, + {0xA7C9, 0xA7C9}, + {0xA7CB, 0xA7CC}, + {0xA7CE, 0xA7CE}, + {0xA7D0, 0xA7D0}, + {0xA7D2, 0xA7D2}, + {0xA7D4, 0xA7D4}, + {0xA7D6, 0xA7D6}, + {0xA7D8, 0xA7D8}, + {0xA7DA, 0xA7DA}, + {0xA7DC, 0xA7DC}, + {0xA7F1, 0xA7F5}, + {0xA7F8, 0xA7F9}, + {0xAB5C, 0xAB5F}, + {0xAB69, 0xAB69}, + {0xAB70, 0xABBF}, + {0xF900, 0xFA0D}, + {0xFA10, 0xFA10}, + {0xFA12, 0xFA12}, + {0xFA15, 0xFA1E}, + {0xFA20, 0xFA20}, + {0xFA22, 0xFA22}, + {0xFA25, 0xFA26}, + {0xFA2A, 0xFA6D}, + {0xFA70, 0xFAD9}, + {0xFB00, 0xFB06}, + {0xFB13, 0xFB17}, + {0xFB1D, 0xFB1D}, + {0xFB1F, 0xFB36}, + {0xFB38, 0xFB3C}, + {0xFB3E, 0xFB3E}, + {0xFB40, 0xFB41}, + {0xFB43, 0xFB44}, + {0xFB46, 0xFBB1}, + {0xFBD3, 0xFD3D}, + {0xFD50, 0xFD8F}, + {0xFD92, 0xFDC7}, + {0xFDF0, 0xFDFC}, + {0xFE00, 0xFE19}, + {0xFE30, 0xFE44}, + {0xFE47, 0xFE52}, + {0xFE54, 0xFE66}, + {0xFE68, 0xFE6B}, + {0xFE70, 0xFE72}, + {0xFE74, 0xFE74}, + {0xFE76, 0xFEFC}, + {0xFEFF, 0xFEFF}, + {0xFF01, 0xFFBE}, + {0xFFC2, 0xFFC7}, + {0xFFCA, 0xFFCF}, + {0xFFD2, 0xFFD7}, + {0xFFDA, 0xFFDC}, + {0xFFE0, 0xFFE6}, + {0xFFE8, 0xFFEE}, + {0xFFF0, 0xFFF8}, + {0x10400, 0x10427}, + {0x104B0, 0x104D3}, + {0x10570, 0x1057A}, + {0x1057C, 0x1058A}, + {0x1058C, 0x10592}, + {0x10594, 0x10595}, + {0x10781, 0x10785}, + {0x10787, 0x107B0}, + {0x107B2, 0x107BA}, + {0x10C80, 0x10CB2}, + {0x10D50, 0x10D65}, + {0x118A0, 0x118BF}, + {0x16E40, 0x16E5F}, + {0x16EA0, 0x16EB8}, + {0x1BCA0, 0x1BCA3}, + {0x1CCD6, 0x1CCF9}, + {0x1D15E, 0x1D164}, + {0x1D173, 0x1D17A}, + {0x1D1BB, 0x1D1C0}, + {0x1D400, 0x1D454}, + {0x1D456, 0x1D49C}, + {0x1D49E, 0x1D49F}, + {0x1D4A2, 0x1D4A2}, + {0x1D4A5, 0x1D4A6}, + {0x1D4A9, 0x1D4AC}, + {0x1D4AE, 0x1D4B9}, + {0x1D4BB, 0x1D4BB}, + {0x1D4BD, 0x1D4C3}, + {0x1D4C5, 0x1D505}, + {0x1D507, 0x1D50A}, + {0x1D50D, 0x1D514}, + {0x1D516, 0x1D51C}, + {0x1D51E, 0x1D539}, + {0x1D53B, 0x1D53E}, + {0x1D540, 0x1D544}, + {0x1D546, 0x1D546}, + {0x1D54A, 0x1D550}, + {0x1D552, 0x1D6A5}, + {0x1D6A8, 0x1D7CB}, + {0x1D7CE, 0x1D7FF}, + {0x1E030, 0x1E06D}, + {0x1E900, 0x1E921}, + {0x1EE00, 0x1EE03}, + {0x1EE05, 0x1EE1F}, + {0x1EE21, 0x1EE22}, + {0x1EE24, 0x1EE24}, + {0x1EE27, 0x1EE27}, + {0x1EE29, 0x1EE32}, + {0x1EE34, 0x1EE37}, + {0x1EE39, 0x1EE39}, + {0x1EE3B, 0x1EE3B}, + {0x1EE42, 0x1EE42}, + {0x1EE47, 0x1EE47}, + {0x1EE49, 0x1EE49}, + {0x1EE4B, 0x1EE4B}, + {0x1EE4D, 0x1EE4F}, + {0x1EE51, 0x1EE52}, + {0x1EE54, 0x1EE54}, + {0x1EE57, 0x1EE57}, + {0x1EE59, 0x1EE59}, + {0x1EE5B, 0x1EE5B}, + {0x1EE5D, 0x1EE5D}, + {0x1EE5F, 0x1EE5F}, + {0x1EE61, 0x1EE62}, + {0x1EE64, 0x1EE64}, + {0x1EE67, 0x1EE6A}, + {0x1EE6C, 0x1EE72}, + {0x1EE74, 0x1EE77}, + {0x1EE79, 0x1EE7C}, + {0x1EE7E, 0x1EE7E}, + {0x1EE80, 0x1EE89}, + {0x1EE8B, 0x1EE9B}, + {0x1EEA1, 0x1EEA3}, + {0x1EEA5, 0x1EEA9}, + {0x1EEAB, 0x1EEBB}, + {0x1F100, 0x1F10A}, + {0x1F110, 0x1F12E}, + {0x1F130, 0x1F14F}, + {0x1F16A, 0x1F16C}, + {0x1F190, 0x1F190}, + {0x1F200, 0x1F202}, + {0x1F210, 0x1F23B}, + {0x1F240, 0x1F248}, + {0x1F250, 0x1F251}, + {0x1FBF0, 0x1FBF9}, + {0x2F800, 0x2FA1D}, + {0xE0000, 0xE0FFF}, + }, + "Changes_When_Titlecased": { + {0x61, 0x7A}, + {0xB5, 0xB5}, + {0xDF, 0xF6}, + {0xF8, 0xFF}, + {0x101, 0x101}, + {0x103, 0x103}, + {0x105, 0x105}, + {0x107, 0x107}, + {0x109, 0x109}, + {0x10B, 0x10B}, + {0x10D, 0x10D}, + {0x10F, 0x10F}, + {0x111, 0x111}, + {0x113, 0x113}, + {0x115, 0x115}, + {0x117, 0x117}, + {0x119, 0x119}, + {0x11B, 0x11B}, + {0x11D, 0x11D}, + {0x11F, 0x11F}, + {0x121, 0x121}, + {0x123, 0x123}, + {0x125, 0x125}, + {0x127, 0x127}, + {0x129, 0x129}, + {0x12B, 0x12B}, + {0x12D, 0x12D}, + {0x12F, 0x12F}, + {0x131, 0x131}, + {0x133, 0x133}, + {0x135, 0x135}, + {0x137, 0x137}, + {0x13A, 0x13A}, + {0x13C, 0x13C}, + {0x13E, 0x13E}, + {0x140, 0x140}, + {0x142, 0x142}, + {0x144, 0x144}, + {0x146, 0x146}, + {0x148, 0x149}, + {0x14B, 0x14B}, + {0x14D, 0x14D}, + {0x14F, 0x14F}, + {0x151, 0x151}, + {0x153, 0x153}, + {0x155, 0x155}, + {0x157, 0x157}, + {0x159, 0x159}, + {0x15B, 0x15B}, + {0x15D, 0x15D}, + {0x15F, 0x15F}, + {0x161, 0x161}, + {0x163, 0x163}, + {0x165, 0x165}, + {0x167, 0x167}, + {0x169, 0x169}, + {0x16B, 0x16B}, + {0x16D, 0x16D}, + {0x16F, 0x16F}, + {0x171, 0x171}, + {0x173, 0x173}, + {0x175, 0x175}, + {0x177, 0x177}, + {0x17A, 0x17A}, + {0x17C, 0x17C}, + {0x17E, 0x180}, + {0x183, 0x183}, + {0x185, 0x185}, + {0x188, 0x188}, + {0x18C, 0x18C}, + {0x192, 0x192}, + {0x195, 0x195}, + {0x199, 0x19B}, + {0x19E, 0x19E}, + {0x1A1, 0x1A1}, + {0x1A3, 0x1A3}, + {0x1A5, 0x1A5}, + {0x1A8, 0x1A8}, + {0x1AD, 0x1AD}, + {0x1B0, 0x1B0}, + {0x1B4, 0x1B4}, + {0x1B6, 0x1B6}, + {0x1B9, 0x1B9}, + {0x1BD, 0x1BD}, + {0x1BF, 0x1BF}, + {0x1C4, 0x1C4}, + {0x1C6, 0x1C7}, + {0x1C9, 0x1CA}, + {0x1CC, 0x1CC}, + {0x1CE, 0x1CE}, + {0x1D0, 0x1D0}, + {0x1D2, 0x1D2}, + {0x1D4, 0x1D4}, + {0x1D6, 0x1D6}, + {0x1D8, 0x1D8}, + {0x1DA, 0x1DA}, + {0x1DC, 0x1DD}, + {0x1DF, 0x1DF}, + {0x1E1, 0x1E1}, + {0x1E3, 0x1E3}, + {0x1E5, 0x1E5}, + {0x1E7, 0x1E7}, + {0x1E9, 0x1E9}, + {0x1EB, 0x1EB}, + {0x1ED, 0x1ED}, + {0x1EF, 0x1F1}, + {0x1F3, 0x1F3}, + {0x1F5, 0x1F5}, + {0x1F9, 0x1F9}, + {0x1FB, 0x1FB}, + {0x1FD, 0x1FD}, + {0x1FF, 0x1FF}, + {0x201, 0x201}, + {0x203, 0x203}, + {0x205, 0x205}, + {0x207, 0x207}, + {0x209, 0x209}, + {0x20B, 0x20B}, + {0x20D, 0x20D}, + {0x20F, 0x20F}, + {0x211, 0x211}, + {0x213, 0x213}, + {0x215, 0x215}, + {0x217, 0x217}, + {0x219, 0x219}, + {0x21B, 0x21B}, + {0x21D, 0x21D}, + {0x21F, 0x21F}, + {0x223, 0x223}, + {0x225, 0x225}, + {0x227, 0x227}, + {0x229, 0x229}, + {0x22B, 0x22B}, + {0x22D, 0x22D}, + {0x22F, 0x22F}, + {0x231, 0x231}, + {0x233, 0x233}, + {0x23C, 0x23C}, + {0x23F, 0x240}, + {0x242, 0x242}, + {0x247, 0x247}, + {0x249, 0x249}, + {0x24B, 0x24B}, + {0x24D, 0x24D}, + {0x24F, 0x254}, + {0x256, 0x257}, + {0x259, 0x259}, + {0x25B, 0x25C}, + {0x260, 0x261}, + {0x263, 0x266}, + {0x268, 0x26C}, + {0x26F, 0x26F}, + {0x271, 0x272}, + {0x275, 0x275}, + {0x27D, 0x27D}, + {0x280, 0x280}, + {0x282, 0x283}, + {0x287, 0x28C}, + {0x292, 0x292}, + {0x29D, 0x29E}, + {0x345, 0x345}, + {0x371, 0x371}, + {0x373, 0x373}, + {0x377, 0x377}, + {0x37B, 0x37D}, + {0x390, 0x390}, + {0x3AC, 0x3CE}, + {0x3D0, 0x3D1}, + {0x3D5, 0x3D7}, + {0x3D9, 0x3D9}, + {0x3DB, 0x3DB}, + {0x3DD, 0x3DD}, + {0x3DF, 0x3DF}, + {0x3E1, 0x3E1}, + {0x3E3, 0x3E3}, + {0x3E5, 0x3E5}, + {0x3E7, 0x3E7}, + {0x3E9, 0x3E9}, + {0x3EB, 0x3EB}, + {0x3ED, 0x3ED}, + {0x3EF, 0x3F3}, + {0x3F5, 0x3F5}, + {0x3F8, 0x3F8}, + {0x3FB, 0x3FB}, + {0x430, 0x45F}, + {0x461, 0x461}, + {0x463, 0x463}, + {0x465, 0x465}, + {0x467, 0x467}, + {0x469, 0x469}, + {0x46B, 0x46B}, + {0x46D, 0x46D}, + {0x46F, 0x46F}, + {0x471, 0x471}, + {0x473, 0x473}, + {0x475, 0x475}, + {0x477, 0x477}, + {0x479, 0x479}, + {0x47B, 0x47B}, + {0x47D, 0x47D}, + {0x47F, 0x47F}, + {0x481, 0x481}, + {0x48B, 0x48B}, + {0x48D, 0x48D}, + {0x48F, 0x48F}, + {0x491, 0x491}, + {0x493, 0x493}, + {0x495, 0x495}, + {0x497, 0x497}, + {0x499, 0x499}, + {0x49B, 0x49B}, + {0x49D, 0x49D}, + {0x49F, 0x49F}, + {0x4A1, 0x4A1}, + {0x4A3, 0x4A3}, + {0x4A5, 0x4A5}, + {0x4A7, 0x4A7}, + {0x4A9, 0x4A9}, + {0x4AB, 0x4AB}, + {0x4AD, 0x4AD}, + {0x4AF, 0x4AF}, + {0x4B1, 0x4B1}, + {0x4B3, 0x4B3}, + {0x4B5, 0x4B5}, + {0x4B7, 0x4B7}, + {0x4B9, 0x4B9}, + {0x4BB, 0x4BB}, + {0x4BD, 0x4BD}, + {0x4BF, 0x4BF}, + {0x4C2, 0x4C2}, + {0x4C4, 0x4C4}, + {0x4C6, 0x4C6}, + {0x4C8, 0x4C8}, + {0x4CA, 0x4CA}, + {0x4CC, 0x4CC}, + {0x4CE, 0x4CF}, + {0x4D1, 0x4D1}, + {0x4D3, 0x4D3}, + {0x4D5, 0x4D5}, + {0x4D7, 0x4D7}, + {0x4D9, 0x4D9}, + {0x4DB, 0x4DB}, + {0x4DD, 0x4DD}, + {0x4DF, 0x4DF}, + {0x4E1, 0x4E1}, + {0x4E3, 0x4E3}, + {0x4E5, 0x4E5}, + {0x4E7, 0x4E7}, + {0x4E9, 0x4E9}, + {0x4EB, 0x4EB}, + {0x4ED, 0x4ED}, + {0x4EF, 0x4EF}, + {0x4F1, 0x4F1}, + {0x4F3, 0x4F3}, + {0x4F5, 0x4F5}, + {0x4F7, 0x4F7}, + {0x4F9, 0x4F9}, + {0x4FB, 0x4FB}, + {0x4FD, 0x4FD}, + {0x4FF, 0x4FF}, + {0x501, 0x501}, + {0x503, 0x503}, + {0x505, 0x505}, + {0x507, 0x507}, + {0x509, 0x509}, + {0x50B, 0x50B}, + {0x50D, 0x50D}, + {0x50F, 0x50F}, + {0x511, 0x511}, + {0x513, 0x513}, + {0x515, 0x515}, + {0x517, 0x517}, + {0x519, 0x519}, + {0x51B, 0x51B}, + {0x51D, 0x51D}, + {0x51F, 0x51F}, + {0x521, 0x521}, + {0x523, 0x523}, + {0x525, 0x525}, + {0x527, 0x527}, + {0x529, 0x529}, + {0x52B, 0x52B}, + {0x52D, 0x52D}, + {0x52F, 0x52F}, + {0x561, 0x587}, + {0x13F8, 0x13FD}, + {0x1C80, 0x1C88}, + {0x1C8A, 0x1C8A}, + {0x1D79, 0x1D79}, + {0x1D7D, 0x1D7D}, + {0x1D8E, 0x1D8E}, + {0x1E01, 0x1E01}, + {0x1E03, 0x1E03}, + {0x1E05, 0x1E05}, + {0x1E07, 0x1E07}, + {0x1E09, 0x1E09}, + {0x1E0B, 0x1E0B}, + {0x1E0D, 0x1E0D}, + {0x1E0F, 0x1E0F}, + {0x1E11, 0x1E11}, + {0x1E13, 0x1E13}, + {0x1E15, 0x1E15}, + {0x1E17, 0x1E17}, + {0x1E19, 0x1E19}, + {0x1E1B, 0x1E1B}, + {0x1E1D, 0x1E1D}, + {0x1E1F, 0x1E1F}, + {0x1E21, 0x1E21}, + {0x1E23, 0x1E23}, + {0x1E25, 0x1E25}, + {0x1E27, 0x1E27}, + {0x1E29, 0x1E29}, + {0x1E2B, 0x1E2B}, + {0x1E2D, 0x1E2D}, + {0x1E2F, 0x1E2F}, + {0x1E31, 0x1E31}, + {0x1E33, 0x1E33}, + {0x1E35, 0x1E35}, + {0x1E37, 0x1E37}, + {0x1E39, 0x1E39}, + {0x1E3B, 0x1E3B}, + {0x1E3D, 0x1E3D}, + {0x1E3F, 0x1E3F}, + {0x1E41, 0x1E41}, + {0x1E43, 0x1E43}, + {0x1E45, 0x1E45}, + {0x1E47, 0x1E47}, + {0x1E49, 0x1E49}, + {0x1E4B, 0x1E4B}, + {0x1E4D, 0x1E4D}, + {0x1E4F, 0x1E4F}, + {0x1E51, 0x1E51}, + {0x1E53, 0x1E53}, + {0x1E55, 0x1E55}, + {0x1E57, 0x1E57}, + {0x1E59, 0x1E59}, + {0x1E5B, 0x1E5B}, + {0x1E5D, 0x1E5D}, + {0x1E5F, 0x1E5F}, + {0x1E61, 0x1E61}, + {0x1E63, 0x1E63}, + {0x1E65, 0x1E65}, + {0x1E67, 0x1E67}, + {0x1E69, 0x1E69}, + {0x1E6B, 0x1E6B}, + {0x1E6D, 0x1E6D}, + {0x1E6F, 0x1E6F}, + {0x1E71, 0x1E71}, + {0x1E73, 0x1E73}, + {0x1E75, 0x1E75}, + {0x1E77, 0x1E77}, + {0x1E79, 0x1E79}, + {0x1E7B, 0x1E7B}, + {0x1E7D, 0x1E7D}, + {0x1E7F, 0x1E7F}, + {0x1E81, 0x1E81}, + {0x1E83, 0x1E83}, + {0x1E85, 0x1E85}, + {0x1E87, 0x1E87}, + {0x1E89, 0x1E89}, + {0x1E8B, 0x1E8B}, + {0x1E8D, 0x1E8D}, + {0x1E8F, 0x1E8F}, + {0x1E91, 0x1E91}, + {0x1E93, 0x1E93}, + {0x1E95, 0x1E9B}, + {0x1EA1, 0x1EA1}, + {0x1EA3, 0x1EA3}, + {0x1EA5, 0x1EA5}, + {0x1EA7, 0x1EA7}, + {0x1EA9, 0x1EA9}, + {0x1EAB, 0x1EAB}, + {0x1EAD, 0x1EAD}, + {0x1EAF, 0x1EAF}, + {0x1EB1, 0x1EB1}, + {0x1EB3, 0x1EB3}, + {0x1EB5, 0x1EB5}, + {0x1EB7, 0x1EB7}, + {0x1EB9, 0x1EB9}, + {0x1EBB, 0x1EBB}, + {0x1EBD, 0x1EBD}, + {0x1EBF, 0x1EBF}, + {0x1EC1, 0x1EC1}, + {0x1EC3, 0x1EC3}, + {0x1EC5, 0x1EC5}, + {0x1EC7, 0x1EC7}, + {0x1EC9, 0x1EC9}, + {0x1ECB, 0x1ECB}, + {0x1ECD, 0x1ECD}, + {0x1ECF, 0x1ECF}, + {0x1ED1, 0x1ED1}, + {0x1ED3, 0x1ED3}, + {0x1ED5, 0x1ED5}, + {0x1ED7, 0x1ED7}, + {0x1ED9, 0x1ED9}, + {0x1EDB, 0x1EDB}, + {0x1EDD, 0x1EDD}, + {0x1EDF, 0x1EDF}, + {0x1EE1, 0x1EE1}, + {0x1EE3, 0x1EE3}, + {0x1EE5, 0x1EE5}, + {0x1EE7, 0x1EE7}, + {0x1EE9, 0x1EE9}, + {0x1EEB, 0x1EEB}, + {0x1EED, 0x1EED}, + {0x1EEF, 0x1EEF}, + {0x1EF1, 0x1EF1}, + {0x1EF3, 0x1EF3}, + {0x1EF5, 0x1EF5}, + {0x1EF7, 0x1EF7}, + {0x1EF9, 0x1EF9}, + {0x1EFB, 0x1EFB}, + {0x1EFD, 0x1EFD}, + {0x1EFF, 0x1F07}, + {0x1F10, 0x1F15}, + {0x1F20, 0x1F27}, + {0x1F30, 0x1F37}, + {0x1F40, 0x1F45}, + {0x1F50, 0x1F57}, + {0x1F60, 0x1F67}, + {0x1F70, 0x1F7D}, + {0x1F80, 0x1F87}, + {0x1F90, 0x1F97}, + {0x1FA0, 0x1FA7}, + {0x1FB0, 0x1FB4}, + {0x1FB6, 0x1FB7}, + {0x1FBE, 0x1FBE}, + {0x1FC2, 0x1FC4}, + {0x1FC6, 0x1FC7}, + {0x1FD0, 0x1FD3}, + {0x1FD6, 0x1FD7}, + {0x1FE0, 0x1FE7}, + {0x1FF2, 0x1FF4}, + {0x1FF6, 0x1FF7}, + {0x214E, 0x214E}, + {0x2170, 0x217F}, + {0x2184, 0x2184}, + {0x24D0, 0x24E9}, + {0x2C30, 0x2C5F}, + {0x2C61, 0x2C61}, + {0x2C65, 0x2C66}, + {0x2C68, 0x2C68}, + {0x2C6A, 0x2C6A}, + {0x2C6C, 0x2C6C}, + {0x2C73, 0x2C73}, + {0x2C76, 0x2C76}, + {0x2C81, 0x2C81}, + {0x2C83, 0x2C83}, + {0x2C85, 0x2C85}, + {0x2C87, 0x2C87}, + {0x2C89, 0x2C89}, + {0x2C8B, 0x2C8B}, + {0x2C8D, 0x2C8D}, + {0x2C8F, 0x2C8F}, + {0x2C91, 0x2C91}, + {0x2C93, 0x2C93}, + {0x2C95, 0x2C95}, + {0x2C97, 0x2C97}, + {0x2C99, 0x2C99}, + {0x2C9B, 0x2C9B}, + {0x2C9D, 0x2C9D}, + {0x2C9F, 0x2C9F}, + {0x2CA1, 0x2CA1}, + {0x2CA3, 0x2CA3}, + {0x2CA5, 0x2CA5}, + {0x2CA7, 0x2CA7}, + {0x2CA9, 0x2CA9}, + {0x2CAB, 0x2CAB}, + {0x2CAD, 0x2CAD}, + {0x2CAF, 0x2CAF}, + {0x2CB1, 0x2CB1}, + {0x2CB3, 0x2CB3}, + {0x2CB5, 0x2CB5}, + {0x2CB7, 0x2CB7}, + {0x2CB9, 0x2CB9}, + {0x2CBB, 0x2CBB}, + {0x2CBD, 0x2CBD}, + {0x2CBF, 0x2CBF}, + {0x2CC1, 0x2CC1}, + {0x2CC3, 0x2CC3}, + {0x2CC5, 0x2CC5}, + {0x2CC7, 0x2CC7}, + {0x2CC9, 0x2CC9}, + {0x2CCB, 0x2CCB}, + {0x2CCD, 0x2CCD}, + {0x2CCF, 0x2CCF}, + {0x2CD1, 0x2CD1}, + {0x2CD3, 0x2CD3}, + {0x2CD5, 0x2CD5}, + {0x2CD7, 0x2CD7}, + {0x2CD9, 0x2CD9}, + {0x2CDB, 0x2CDB}, + {0x2CDD, 0x2CDD}, + {0x2CDF, 0x2CDF}, + {0x2CE1, 0x2CE1}, + {0x2CE3, 0x2CE3}, + {0x2CEC, 0x2CEC}, + {0x2CEE, 0x2CEE}, + {0x2CF3, 0x2CF3}, + {0x2D00, 0x2D25}, + {0x2D27, 0x2D27}, + {0x2D2D, 0x2D2D}, + {0xA641, 0xA641}, + {0xA643, 0xA643}, + {0xA645, 0xA645}, + {0xA647, 0xA647}, + {0xA649, 0xA649}, + {0xA64B, 0xA64B}, + {0xA64D, 0xA64D}, + {0xA64F, 0xA64F}, + {0xA651, 0xA651}, + {0xA653, 0xA653}, + {0xA655, 0xA655}, + {0xA657, 0xA657}, + {0xA659, 0xA659}, + {0xA65B, 0xA65B}, + {0xA65D, 0xA65D}, + {0xA65F, 0xA65F}, + {0xA661, 0xA661}, + {0xA663, 0xA663}, + {0xA665, 0xA665}, + {0xA667, 0xA667}, + {0xA669, 0xA669}, + {0xA66B, 0xA66B}, + {0xA66D, 0xA66D}, + {0xA681, 0xA681}, + {0xA683, 0xA683}, + {0xA685, 0xA685}, + {0xA687, 0xA687}, + {0xA689, 0xA689}, + {0xA68B, 0xA68B}, + {0xA68D, 0xA68D}, + {0xA68F, 0xA68F}, + {0xA691, 0xA691}, + {0xA693, 0xA693}, + {0xA695, 0xA695}, + {0xA697, 0xA697}, + {0xA699, 0xA699}, + {0xA69B, 0xA69B}, + {0xA723, 0xA723}, + {0xA725, 0xA725}, + {0xA727, 0xA727}, + {0xA729, 0xA729}, + {0xA72B, 0xA72B}, + {0xA72D, 0xA72D}, + {0xA72F, 0xA72F}, + {0xA733, 0xA733}, + {0xA735, 0xA735}, + {0xA737, 0xA737}, + {0xA739, 0xA739}, + {0xA73B, 0xA73B}, + {0xA73D, 0xA73D}, + {0xA73F, 0xA73F}, + {0xA741, 0xA741}, + {0xA743, 0xA743}, + {0xA745, 0xA745}, + {0xA747, 0xA747}, + {0xA749, 0xA749}, + {0xA74B, 0xA74B}, + {0xA74D, 0xA74D}, + {0xA74F, 0xA74F}, + {0xA751, 0xA751}, + {0xA753, 0xA753}, + {0xA755, 0xA755}, + {0xA757, 0xA757}, + {0xA759, 0xA759}, + {0xA75B, 0xA75B}, + {0xA75D, 0xA75D}, + {0xA75F, 0xA75F}, + {0xA761, 0xA761}, + {0xA763, 0xA763}, + {0xA765, 0xA765}, + {0xA767, 0xA767}, + {0xA769, 0xA769}, + {0xA76B, 0xA76B}, + {0xA76D, 0xA76D}, + {0xA76F, 0xA76F}, + {0xA77A, 0xA77A}, + {0xA77C, 0xA77C}, + {0xA77F, 0xA77F}, + {0xA781, 0xA781}, + {0xA783, 0xA783}, + {0xA785, 0xA785}, + {0xA787, 0xA787}, + {0xA78C, 0xA78C}, + {0xA791, 0xA791}, + {0xA793, 0xA794}, + {0xA797, 0xA797}, + {0xA799, 0xA799}, + {0xA79B, 0xA79B}, + {0xA79D, 0xA79D}, + {0xA79F, 0xA79F}, + {0xA7A1, 0xA7A1}, + {0xA7A3, 0xA7A3}, + {0xA7A5, 0xA7A5}, + {0xA7A7, 0xA7A7}, + {0xA7A9, 0xA7A9}, + {0xA7B5, 0xA7B5}, + {0xA7B7, 0xA7B7}, + {0xA7B9, 0xA7B9}, + {0xA7BB, 0xA7BB}, + {0xA7BD, 0xA7BD}, + {0xA7BF, 0xA7BF}, + {0xA7C1, 0xA7C1}, + {0xA7C3, 0xA7C3}, + {0xA7C8, 0xA7C8}, + {0xA7CA, 0xA7CA}, + {0xA7CD, 0xA7CD}, + {0xA7CF, 0xA7CF}, + {0xA7D1, 0xA7D1}, + {0xA7D3, 0xA7D3}, + {0xA7D5, 0xA7D5}, + {0xA7D7, 0xA7D7}, + {0xA7D9, 0xA7D9}, + {0xA7DB, 0xA7DB}, + {0xA7F6, 0xA7F6}, + {0xAB53, 0xAB53}, + {0xAB70, 0xABBF}, + {0xFB00, 0xFB06}, + {0xFB13, 0xFB17}, + {0xFF41, 0xFF5A}, + {0x10428, 0x1044F}, + {0x104D8, 0x104FB}, + {0x10597, 0x105A1}, + {0x105A3, 0x105B1}, + {0x105B3, 0x105B9}, + {0x105BB, 0x105BC}, + {0x10CC0, 0x10CF2}, + {0x10D70, 0x10D85}, + {0x118C0, 0x118DF}, + {0x16E60, 0x16E7F}, + {0x16EBB, 0x16ED3}, + {0x1E922, 0x1E943}, + }, + "Changes_When_Uppercased": { + {0x61, 0x7A}, + {0xB5, 0xB5}, + {0xDF, 0xF6}, + {0xF8, 0xFF}, + {0x101, 0x101}, + {0x103, 0x103}, + {0x105, 0x105}, + {0x107, 0x107}, + {0x109, 0x109}, + {0x10B, 0x10B}, + {0x10D, 0x10D}, + {0x10F, 0x10F}, + {0x111, 0x111}, + {0x113, 0x113}, + {0x115, 0x115}, + {0x117, 0x117}, + {0x119, 0x119}, + {0x11B, 0x11B}, + {0x11D, 0x11D}, + {0x11F, 0x11F}, + {0x121, 0x121}, + {0x123, 0x123}, + {0x125, 0x125}, + {0x127, 0x127}, + {0x129, 0x129}, + {0x12B, 0x12B}, + {0x12D, 0x12D}, + {0x12F, 0x12F}, + {0x131, 0x131}, + {0x133, 0x133}, + {0x135, 0x135}, + {0x137, 0x137}, + {0x13A, 0x13A}, + {0x13C, 0x13C}, + {0x13E, 0x13E}, + {0x140, 0x140}, + {0x142, 0x142}, + {0x144, 0x144}, + {0x146, 0x146}, + {0x148, 0x149}, + {0x14B, 0x14B}, + {0x14D, 0x14D}, + {0x14F, 0x14F}, + {0x151, 0x151}, + {0x153, 0x153}, + {0x155, 0x155}, + {0x157, 0x157}, + {0x159, 0x159}, + {0x15B, 0x15B}, + {0x15D, 0x15D}, + {0x15F, 0x15F}, + {0x161, 0x161}, + {0x163, 0x163}, + {0x165, 0x165}, + {0x167, 0x167}, + {0x169, 0x169}, + {0x16B, 0x16B}, + {0x16D, 0x16D}, + {0x16F, 0x16F}, + {0x171, 0x171}, + {0x173, 0x173}, + {0x175, 0x175}, + {0x177, 0x177}, + {0x17A, 0x17A}, + {0x17C, 0x17C}, + {0x17E, 0x180}, + {0x183, 0x183}, + {0x185, 0x185}, + {0x188, 0x188}, + {0x18C, 0x18C}, + {0x192, 0x192}, + {0x195, 0x195}, + {0x199, 0x19B}, + {0x19E, 0x19E}, + {0x1A1, 0x1A1}, + {0x1A3, 0x1A3}, + {0x1A5, 0x1A5}, + {0x1A8, 0x1A8}, + {0x1AD, 0x1AD}, + {0x1B0, 0x1B0}, + {0x1B4, 0x1B4}, + {0x1B6, 0x1B6}, + {0x1B9, 0x1B9}, + {0x1BD, 0x1BD}, + {0x1BF, 0x1BF}, + {0x1C5, 0x1C6}, + {0x1C8, 0x1C9}, + {0x1CB, 0x1CC}, + {0x1CE, 0x1CE}, + {0x1D0, 0x1D0}, + {0x1D2, 0x1D2}, + {0x1D4, 0x1D4}, + {0x1D6, 0x1D6}, + {0x1D8, 0x1D8}, + {0x1DA, 0x1DA}, + {0x1DC, 0x1DD}, + {0x1DF, 0x1DF}, + {0x1E1, 0x1E1}, + {0x1E3, 0x1E3}, + {0x1E5, 0x1E5}, + {0x1E7, 0x1E7}, + {0x1E9, 0x1E9}, + {0x1EB, 0x1EB}, + {0x1ED, 0x1ED}, + {0x1EF, 0x1F0}, + {0x1F2, 0x1F3}, + {0x1F5, 0x1F5}, + {0x1F9, 0x1F9}, + {0x1FB, 0x1FB}, + {0x1FD, 0x1FD}, + {0x1FF, 0x1FF}, + {0x201, 0x201}, + {0x203, 0x203}, + {0x205, 0x205}, + {0x207, 0x207}, + {0x209, 0x209}, + {0x20B, 0x20B}, + {0x20D, 0x20D}, + {0x20F, 0x20F}, + {0x211, 0x211}, + {0x213, 0x213}, + {0x215, 0x215}, + {0x217, 0x217}, + {0x219, 0x219}, + {0x21B, 0x21B}, + {0x21D, 0x21D}, + {0x21F, 0x21F}, + {0x223, 0x223}, + {0x225, 0x225}, + {0x227, 0x227}, + {0x229, 0x229}, + {0x22B, 0x22B}, + {0x22D, 0x22D}, + {0x22F, 0x22F}, + {0x231, 0x231}, + {0x233, 0x233}, + {0x23C, 0x23C}, + {0x23F, 0x240}, + {0x242, 0x242}, + {0x247, 0x247}, + {0x249, 0x249}, + {0x24B, 0x24B}, + {0x24D, 0x24D}, + {0x24F, 0x254}, + {0x256, 0x257}, + {0x259, 0x259}, + {0x25B, 0x25C}, + {0x260, 0x261}, + {0x263, 0x266}, + {0x268, 0x26C}, + {0x26F, 0x26F}, + {0x271, 0x272}, + {0x275, 0x275}, + {0x27D, 0x27D}, + {0x280, 0x280}, + {0x282, 0x283}, + {0x287, 0x28C}, + {0x292, 0x292}, + {0x29D, 0x29E}, + {0x345, 0x345}, + {0x371, 0x371}, + {0x373, 0x373}, + {0x377, 0x377}, + {0x37B, 0x37D}, + {0x390, 0x390}, + {0x3AC, 0x3CE}, + {0x3D0, 0x3D1}, + {0x3D5, 0x3D7}, + {0x3D9, 0x3D9}, + {0x3DB, 0x3DB}, + {0x3DD, 0x3DD}, + {0x3DF, 0x3DF}, + {0x3E1, 0x3E1}, + {0x3E3, 0x3E3}, + {0x3E5, 0x3E5}, + {0x3E7, 0x3E7}, + {0x3E9, 0x3E9}, + {0x3EB, 0x3EB}, + {0x3ED, 0x3ED}, + {0x3EF, 0x3F3}, + {0x3F5, 0x3F5}, + {0x3F8, 0x3F8}, + {0x3FB, 0x3FB}, + {0x430, 0x45F}, + {0x461, 0x461}, + {0x463, 0x463}, + {0x465, 0x465}, + {0x467, 0x467}, + {0x469, 0x469}, + {0x46B, 0x46B}, + {0x46D, 0x46D}, + {0x46F, 0x46F}, + {0x471, 0x471}, + {0x473, 0x473}, + {0x475, 0x475}, + {0x477, 0x477}, + {0x479, 0x479}, + {0x47B, 0x47B}, + {0x47D, 0x47D}, + {0x47F, 0x47F}, + {0x481, 0x481}, + {0x48B, 0x48B}, + {0x48D, 0x48D}, + {0x48F, 0x48F}, + {0x491, 0x491}, + {0x493, 0x493}, + {0x495, 0x495}, + {0x497, 0x497}, + {0x499, 0x499}, + {0x49B, 0x49B}, + {0x49D, 0x49D}, + {0x49F, 0x49F}, + {0x4A1, 0x4A1}, + {0x4A3, 0x4A3}, + {0x4A5, 0x4A5}, + {0x4A7, 0x4A7}, + {0x4A9, 0x4A9}, + {0x4AB, 0x4AB}, + {0x4AD, 0x4AD}, + {0x4AF, 0x4AF}, + {0x4B1, 0x4B1}, + {0x4B3, 0x4B3}, + {0x4B5, 0x4B5}, + {0x4B7, 0x4B7}, + {0x4B9, 0x4B9}, + {0x4BB, 0x4BB}, + {0x4BD, 0x4BD}, + {0x4BF, 0x4BF}, + {0x4C2, 0x4C2}, + {0x4C4, 0x4C4}, + {0x4C6, 0x4C6}, + {0x4C8, 0x4C8}, + {0x4CA, 0x4CA}, + {0x4CC, 0x4CC}, + {0x4CE, 0x4CF}, + {0x4D1, 0x4D1}, + {0x4D3, 0x4D3}, + {0x4D5, 0x4D5}, + {0x4D7, 0x4D7}, + {0x4D9, 0x4D9}, + {0x4DB, 0x4DB}, + {0x4DD, 0x4DD}, + {0x4DF, 0x4DF}, + {0x4E1, 0x4E1}, + {0x4E3, 0x4E3}, + {0x4E5, 0x4E5}, + {0x4E7, 0x4E7}, + {0x4E9, 0x4E9}, + {0x4EB, 0x4EB}, + {0x4ED, 0x4ED}, + {0x4EF, 0x4EF}, + {0x4F1, 0x4F1}, + {0x4F3, 0x4F3}, + {0x4F5, 0x4F5}, + {0x4F7, 0x4F7}, + {0x4F9, 0x4F9}, + {0x4FB, 0x4FB}, + {0x4FD, 0x4FD}, + {0x4FF, 0x4FF}, + {0x501, 0x501}, + {0x503, 0x503}, + {0x505, 0x505}, + {0x507, 0x507}, + {0x509, 0x509}, + {0x50B, 0x50B}, + {0x50D, 0x50D}, + {0x50F, 0x50F}, + {0x511, 0x511}, + {0x513, 0x513}, + {0x515, 0x515}, + {0x517, 0x517}, + {0x519, 0x519}, + {0x51B, 0x51B}, + {0x51D, 0x51D}, + {0x51F, 0x51F}, + {0x521, 0x521}, + {0x523, 0x523}, + {0x525, 0x525}, + {0x527, 0x527}, + {0x529, 0x529}, + {0x52B, 0x52B}, + {0x52D, 0x52D}, + {0x52F, 0x52F}, + {0x561, 0x587}, + {0x10D0, 0x10FA}, + {0x10FD, 0x10FF}, + {0x13F8, 0x13FD}, + {0x1C80, 0x1C88}, + {0x1C8A, 0x1C8A}, + {0x1D79, 0x1D79}, + {0x1D7D, 0x1D7D}, + {0x1D8E, 0x1D8E}, + {0x1E01, 0x1E01}, + {0x1E03, 0x1E03}, + {0x1E05, 0x1E05}, + {0x1E07, 0x1E07}, + {0x1E09, 0x1E09}, + {0x1E0B, 0x1E0B}, + {0x1E0D, 0x1E0D}, + {0x1E0F, 0x1E0F}, + {0x1E11, 0x1E11}, + {0x1E13, 0x1E13}, + {0x1E15, 0x1E15}, + {0x1E17, 0x1E17}, + {0x1E19, 0x1E19}, + {0x1E1B, 0x1E1B}, + {0x1E1D, 0x1E1D}, + {0x1E1F, 0x1E1F}, + {0x1E21, 0x1E21}, + {0x1E23, 0x1E23}, + {0x1E25, 0x1E25}, + {0x1E27, 0x1E27}, + {0x1E29, 0x1E29}, + {0x1E2B, 0x1E2B}, + {0x1E2D, 0x1E2D}, + {0x1E2F, 0x1E2F}, + {0x1E31, 0x1E31}, + {0x1E33, 0x1E33}, + {0x1E35, 0x1E35}, + {0x1E37, 0x1E37}, + {0x1E39, 0x1E39}, + {0x1E3B, 0x1E3B}, + {0x1E3D, 0x1E3D}, + {0x1E3F, 0x1E3F}, + {0x1E41, 0x1E41}, + {0x1E43, 0x1E43}, + {0x1E45, 0x1E45}, + {0x1E47, 0x1E47}, + {0x1E49, 0x1E49}, + {0x1E4B, 0x1E4B}, + {0x1E4D, 0x1E4D}, + {0x1E4F, 0x1E4F}, + {0x1E51, 0x1E51}, + {0x1E53, 0x1E53}, + {0x1E55, 0x1E55}, + {0x1E57, 0x1E57}, + {0x1E59, 0x1E59}, + {0x1E5B, 0x1E5B}, + {0x1E5D, 0x1E5D}, + {0x1E5F, 0x1E5F}, + {0x1E61, 0x1E61}, + {0x1E63, 0x1E63}, + {0x1E65, 0x1E65}, + {0x1E67, 0x1E67}, + {0x1E69, 0x1E69}, + {0x1E6B, 0x1E6B}, + {0x1E6D, 0x1E6D}, + {0x1E6F, 0x1E6F}, + {0x1E71, 0x1E71}, + {0x1E73, 0x1E73}, + {0x1E75, 0x1E75}, + {0x1E77, 0x1E77}, + {0x1E79, 0x1E79}, + {0x1E7B, 0x1E7B}, + {0x1E7D, 0x1E7D}, + {0x1E7F, 0x1E7F}, + {0x1E81, 0x1E81}, + {0x1E83, 0x1E83}, + {0x1E85, 0x1E85}, + {0x1E87, 0x1E87}, + {0x1E89, 0x1E89}, + {0x1E8B, 0x1E8B}, + {0x1E8D, 0x1E8D}, + {0x1E8F, 0x1E8F}, + {0x1E91, 0x1E91}, + {0x1E93, 0x1E93}, + {0x1E95, 0x1E9B}, + {0x1EA1, 0x1EA1}, + {0x1EA3, 0x1EA3}, + {0x1EA5, 0x1EA5}, + {0x1EA7, 0x1EA7}, + {0x1EA9, 0x1EA9}, + {0x1EAB, 0x1EAB}, + {0x1EAD, 0x1EAD}, + {0x1EAF, 0x1EAF}, + {0x1EB1, 0x1EB1}, + {0x1EB3, 0x1EB3}, + {0x1EB5, 0x1EB5}, + {0x1EB7, 0x1EB7}, + {0x1EB9, 0x1EB9}, + {0x1EBB, 0x1EBB}, + {0x1EBD, 0x1EBD}, + {0x1EBF, 0x1EBF}, + {0x1EC1, 0x1EC1}, + {0x1EC3, 0x1EC3}, + {0x1EC5, 0x1EC5}, + {0x1EC7, 0x1EC7}, + {0x1EC9, 0x1EC9}, + {0x1ECB, 0x1ECB}, + {0x1ECD, 0x1ECD}, + {0x1ECF, 0x1ECF}, + {0x1ED1, 0x1ED1}, + {0x1ED3, 0x1ED3}, + {0x1ED5, 0x1ED5}, + {0x1ED7, 0x1ED7}, + {0x1ED9, 0x1ED9}, + {0x1EDB, 0x1EDB}, + {0x1EDD, 0x1EDD}, + {0x1EDF, 0x1EDF}, + {0x1EE1, 0x1EE1}, + {0x1EE3, 0x1EE3}, + {0x1EE5, 0x1EE5}, + {0x1EE7, 0x1EE7}, + {0x1EE9, 0x1EE9}, + {0x1EEB, 0x1EEB}, + {0x1EED, 0x1EED}, + {0x1EEF, 0x1EEF}, + {0x1EF1, 0x1EF1}, + {0x1EF3, 0x1EF3}, + {0x1EF5, 0x1EF5}, + {0x1EF7, 0x1EF7}, + {0x1EF9, 0x1EF9}, + {0x1EFB, 0x1EFB}, + {0x1EFD, 0x1EFD}, + {0x1EFF, 0x1F07}, + {0x1F10, 0x1F15}, + {0x1F20, 0x1F27}, + {0x1F30, 0x1F37}, + {0x1F40, 0x1F45}, + {0x1F50, 0x1F57}, + {0x1F60, 0x1F67}, + {0x1F70, 0x1F7D}, + {0x1F80, 0x1FB4}, + {0x1FB6, 0x1FB7}, + {0x1FBC, 0x1FBC}, + {0x1FBE, 0x1FBE}, + {0x1FC2, 0x1FC4}, + {0x1FC6, 0x1FC7}, + {0x1FCC, 0x1FCC}, + {0x1FD0, 0x1FD3}, + {0x1FD6, 0x1FD7}, + {0x1FE0, 0x1FE7}, + {0x1FF2, 0x1FF4}, + {0x1FF6, 0x1FF7}, + {0x1FFC, 0x1FFC}, + {0x214E, 0x214E}, + {0x2170, 0x217F}, + {0x2184, 0x2184}, + {0x24D0, 0x24E9}, + {0x2C30, 0x2C5F}, + {0x2C61, 0x2C61}, + {0x2C65, 0x2C66}, + {0x2C68, 0x2C68}, + {0x2C6A, 0x2C6A}, + {0x2C6C, 0x2C6C}, + {0x2C73, 0x2C73}, + {0x2C76, 0x2C76}, + {0x2C81, 0x2C81}, + {0x2C83, 0x2C83}, + {0x2C85, 0x2C85}, + {0x2C87, 0x2C87}, + {0x2C89, 0x2C89}, + {0x2C8B, 0x2C8B}, + {0x2C8D, 0x2C8D}, + {0x2C8F, 0x2C8F}, + {0x2C91, 0x2C91}, + {0x2C93, 0x2C93}, + {0x2C95, 0x2C95}, + {0x2C97, 0x2C97}, + {0x2C99, 0x2C99}, + {0x2C9B, 0x2C9B}, + {0x2C9D, 0x2C9D}, + {0x2C9F, 0x2C9F}, + {0x2CA1, 0x2CA1}, + {0x2CA3, 0x2CA3}, + {0x2CA5, 0x2CA5}, + {0x2CA7, 0x2CA7}, + {0x2CA9, 0x2CA9}, + {0x2CAB, 0x2CAB}, + {0x2CAD, 0x2CAD}, + {0x2CAF, 0x2CAF}, + {0x2CB1, 0x2CB1}, + {0x2CB3, 0x2CB3}, + {0x2CB5, 0x2CB5}, + {0x2CB7, 0x2CB7}, + {0x2CB9, 0x2CB9}, + {0x2CBB, 0x2CBB}, + {0x2CBD, 0x2CBD}, + {0x2CBF, 0x2CBF}, + {0x2CC1, 0x2CC1}, + {0x2CC3, 0x2CC3}, + {0x2CC5, 0x2CC5}, + {0x2CC7, 0x2CC7}, + {0x2CC9, 0x2CC9}, + {0x2CCB, 0x2CCB}, + {0x2CCD, 0x2CCD}, + {0x2CCF, 0x2CCF}, + {0x2CD1, 0x2CD1}, + {0x2CD3, 0x2CD3}, + {0x2CD5, 0x2CD5}, + {0x2CD7, 0x2CD7}, + {0x2CD9, 0x2CD9}, + {0x2CDB, 0x2CDB}, + {0x2CDD, 0x2CDD}, + {0x2CDF, 0x2CDF}, + {0x2CE1, 0x2CE1}, + {0x2CE3, 0x2CE3}, + {0x2CEC, 0x2CEC}, + {0x2CEE, 0x2CEE}, + {0x2CF3, 0x2CF3}, + {0x2D00, 0x2D25}, + {0x2D27, 0x2D27}, + {0x2D2D, 0x2D2D}, + {0xA641, 0xA641}, + {0xA643, 0xA643}, + {0xA645, 0xA645}, + {0xA647, 0xA647}, + {0xA649, 0xA649}, + {0xA64B, 0xA64B}, + {0xA64D, 0xA64D}, + {0xA64F, 0xA64F}, + {0xA651, 0xA651}, + {0xA653, 0xA653}, + {0xA655, 0xA655}, + {0xA657, 0xA657}, + {0xA659, 0xA659}, + {0xA65B, 0xA65B}, + {0xA65D, 0xA65D}, + {0xA65F, 0xA65F}, + {0xA661, 0xA661}, + {0xA663, 0xA663}, + {0xA665, 0xA665}, + {0xA667, 0xA667}, + {0xA669, 0xA669}, + {0xA66B, 0xA66B}, + {0xA66D, 0xA66D}, + {0xA681, 0xA681}, + {0xA683, 0xA683}, + {0xA685, 0xA685}, + {0xA687, 0xA687}, + {0xA689, 0xA689}, + {0xA68B, 0xA68B}, + {0xA68D, 0xA68D}, + {0xA68F, 0xA68F}, + {0xA691, 0xA691}, + {0xA693, 0xA693}, + {0xA695, 0xA695}, + {0xA697, 0xA697}, + {0xA699, 0xA699}, + {0xA69B, 0xA69B}, + {0xA723, 0xA723}, + {0xA725, 0xA725}, + {0xA727, 0xA727}, + {0xA729, 0xA729}, + {0xA72B, 0xA72B}, + {0xA72D, 0xA72D}, + {0xA72F, 0xA72F}, + {0xA733, 0xA733}, + {0xA735, 0xA735}, + {0xA737, 0xA737}, + {0xA739, 0xA739}, + {0xA73B, 0xA73B}, + {0xA73D, 0xA73D}, + {0xA73F, 0xA73F}, + {0xA741, 0xA741}, + {0xA743, 0xA743}, + {0xA745, 0xA745}, + {0xA747, 0xA747}, + {0xA749, 0xA749}, + {0xA74B, 0xA74B}, + {0xA74D, 0xA74D}, + {0xA74F, 0xA74F}, + {0xA751, 0xA751}, + {0xA753, 0xA753}, + {0xA755, 0xA755}, + {0xA757, 0xA757}, + {0xA759, 0xA759}, + {0xA75B, 0xA75B}, + {0xA75D, 0xA75D}, + {0xA75F, 0xA75F}, + {0xA761, 0xA761}, + {0xA763, 0xA763}, + {0xA765, 0xA765}, + {0xA767, 0xA767}, + {0xA769, 0xA769}, + {0xA76B, 0xA76B}, + {0xA76D, 0xA76D}, + {0xA76F, 0xA76F}, + {0xA77A, 0xA77A}, + {0xA77C, 0xA77C}, + {0xA77F, 0xA77F}, + {0xA781, 0xA781}, + {0xA783, 0xA783}, + {0xA785, 0xA785}, + {0xA787, 0xA787}, + {0xA78C, 0xA78C}, + {0xA791, 0xA791}, + {0xA793, 0xA794}, + {0xA797, 0xA797}, + {0xA799, 0xA799}, + {0xA79B, 0xA79B}, + {0xA79D, 0xA79D}, + {0xA79F, 0xA79F}, + {0xA7A1, 0xA7A1}, + {0xA7A3, 0xA7A3}, + {0xA7A5, 0xA7A5}, + {0xA7A7, 0xA7A7}, + {0xA7A9, 0xA7A9}, + {0xA7B5, 0xA7B5}, + {0xA7B7, 0xA7B7}, + {0xA7B9, 0xA7B9}, + {0xA7BB, 0xA7BB}, + {0xA7BD, 0xA7BD}, + {0xA7BF, 0xA7BF}, + {0xA7C1, 0xA7C1}, + {0xA7C3, 0xA7C3}, + {0xA7C8, 0xA7C8}, + {0xA7CA, 0xA7CA}, + {0xA7CD, 0xA7CD}, + {0xA7CF, 0xA7CF}, + {0xA7D1, 0xA7D1}, + {0xA7D3, 0xA7D3}, + {0xA7D5, 0xA7D5}, + {0xA7D7, 0xA7D7}, + {0xA7D9, 0xA7D9}, + {0xA7DB, 0xA7DB}, + {0xA7F6, 0xA7F6}, + {0xAB53, 0xAB53}, + {0xAB70, 0xABBF}, + {0xFB00, 0xFB06}, + {0xFB13, 0xFB17}, + {0xFF41, 0xFF5A}, + {0x10428, 0x1044F}, + {0x104D8, 0x104FB}, + {0x10597, 0x105A1}, + {0x105A3, 0x105B1}, + {0x105B3, 0x105B9}, + {0x105BB, 0x105BC}, + {0x10CC0, 0x10CF2}, + {0x10D70, 0x10D85}, + {0x118C0, 0x118DF}, + {0x16E60, 0x16E7F}, + {0x16EBB, 0x16ED3}, + {0x1E922, 0x1E943}, + }, + "Default_Ignorable_Code_Point": { + {0xAD, 0xAD}, + {0x34F, 0x34F}, + {0x61C, 0x61C}, + {0x115F, 0x1160}, + {0x17B4, 0x17B5}, + {0x180B, 0x180F}, + {0x200B, 0x200F}, + {0x202A, 0x202E}, + {0x2060, 0x206F}, + {0x3164, 0x3164}, + {0xFE00, 0xFE0F}, + {0xFEFF, 0xFEFF}, + {0xFFA0, 0xFFA0}, + {0xFFF0, 0xFFF8}, + {0x1BCA0, 0x1BCA3}, + {0x1D173, 0x1D17A}, + {0xE0000, 0xE0FFF}, + }, + "Grapheme_Base": { + {0x20, 0x7E}, + {0xA0, 0xAC}, + {0xAE, 0x2FF}, + {0x370, 0x377}, + {0x37A, 0x37F}, + {0x384, 0x38A}, + {0x38C, 0x38C}, + {0x38E, 0x3A1}, + {0x3A3, 0x482}, + {0x48A, 0x52F}, + {0x531, 0x556}, + {0x559, 0x58A}, + {0x58D, 0x58F}, + {0x5BE, 0x5BE}, + {0x5C0, 0x5C0}, + {0x5C3, 0x5C3}, + {0x5C6, 0x5C6}, + {0x5D0, 0x5EA}, + {0x5EF, 0x5F4}, + {0x606, 0x60F}, + {0x61B, 0x61B}, + {0x61D, 0x64A}, + {0x660, 0x66F}, + {0x671, 0x6D5}, + {0x6DE, 0x6DE}, + {0x6E5, 0x6E6}, + {0x6E9, 0x6E9}, + {0x6EE, 0x70D}, + {0x710, 0x710}, + {0x712, 0x72F}, + {0x74D, 0x7A5}, + {0x7B1, 0x7B1}, + {0x7C0, 0x7EA}, + {0x7F4, 0x7FA}, + {0x7FE, 0x815}, + {0x81A, 0x81A}, + {0x824, 0x824}, + {0x828, 0x828}, + {0x830, 0x83E}, + {0x840, 0x858}, + {0x85E, 0x85E}, + {0x860, 0x86A}, + {0x870, 0x88F}, + {0x8A0, 0x8C9}, + {0x903, 0x939}, + {0x93B, 0x93B}, + {0x93D, 0x940}, + {0x949, 0x94C}, + {0x94E, 0x950}, + {0x958, 0x961}, + {0x964, 0x980}, + {0x982, 0x983}, + {0x985, 0x98C}, + {0x98F, 0x990}, + {0x993, 0x9A8}, + {0x9AA, 0x9B0}, + {0x9B2, 0x9B2}, + {0x9B6, 0x9B9}, + {0x9BD, 0x9BD}, + {0x9BF, 0x9C0}, + {0x9C7, 0x9C8}, + {0x9CB, 0x9CC}, + {0x9CE, 0x9CE}, + {0x9DC, 0x9DD}, + {0x9DF, 0x9E1}, + {0x9E6, 0x9FD}, + {0xA03, 0xA03}, + {0xA05, 0xA0A}, + {0xA0F, 0xA10}, + {0xA13, 0xA28}, + {0xA2A, 0xA30}, + {0xA32, 0xA33}, + {0xA35, 0xA36}, + {0xA38, 0xA39}, + {0xA3E, 0xA40}, + {0xA59, 0xA5C}, + {0xA5E, 0xA5E}, + {0xA66, 0xA6F}, + {0xA72, 0xA74}, + {0xA76, 0xA76}, + {0xA83, 0xA83}, + {0xA85, 0xA8D}, + {0xA8F, 0xA91}, + {0xA93, 0xAA8}, + {0xAAA, 0xAB0}, + {0xAB2, 0xAB3}, + {0xAB5, 0xAB9}, + {0xABD, 0xAC0}, + {0xAC9, 0xAC9}, + {0xACB, 0xACC}, + {0xAD0, 0xAD0}, + {0xAE0, 0xAE1}, + {0xAE6, 0xAF1}, + {0xAF9, 0xAF9}, + {0xB02, 0xB03}, + {0xB05, 0xB0C}, + {0xB0F, 0xB10}, + {0xB13, 0xB28}, + {0xB2A, 0xB30}, + {0xB32, 0xB33}, + {0xB35, 0xB39}, + {0xB3D, 0xB3D}, + {0xB40, 0xB40}, + {0xB47, 0xB48}, + {0xB4B, 0xB4C}, + {0xB5C, 0xB5D}, + {0xB5F, 0xB61}, + {0xB66, 0xB77}, + {0xB83, 0xB83}, + {0xB85, 0xB8A}, + {0xB8E, 0xB90}, + {0xB92, 0xB95}, + {0xB99, 0xB9A}, + {0xB9C, 0xB9C}, + {0xB9E, 0xB9F}, + {0xBA3, 0xBA4}, + {0xBA8, 0xBAA}, + {0xBAE, 0xBB9}, + {0xBBF, 0xBBF}, + {0xBC1, 0xBC2}, + {0xBC6, 0xBC8}, + {0xBCA, 0xBCC}, + {0xBD0, 0xBD0}, + {0xBE6, 0xBFA}, + {0xC01, 0xC03}, + {0xC05, 0xC0C}, + {0xC0E, 0xC10}, + {0xC12, 0xC28}, + {0xC2A, 0xC39}, + {0xC3D, 0xC3D}, + {0xC41, 0xC44}, + {0xC58, 0xC5A}, + {0xC5C, 0xC5D}, + {0xC60, 0xC61}, + {0xC66, 0xC6F}, + {0xC77, 0xC80}, + {0xC82, 0xC8C}, + {0xC8E, 0xC90}, + {0xC92, 0xCA8}, + {0xCAA, 0xCB3}, + {0xCB5, 0xCB9}, + {0xCBD, 0xCBE}, + {0xCC1, 0xCC1}, + {0xCC3, 0xCC4}, + {0xCDC, 0xCDE}, + {0xCE0, 0xCE1}, + {0xCE6, 0xCEF}, + {0xCF1, 0xCF3}, + {0xD02, 0xD0C}, + {0xD0E, 0xD10}, + {0xD12, 0xD3A}, + {0xD3D, 0xD3D}, + {0xD3F, 0xD40}, + {0xD46, 0xD48}, + {0xD4A, 0xD4C}, + {0xD4E, 0xD4F}, + {0xD54, 0xD56}, + {0xD58, 0xD61}, + {0xD66, 0xD7F}, + {0xD82, 0xD83}, + {0xD85, 0xD96}, + {0xD9A, 0xDB1}, + {0xDB3, 0xDBB}, + {0xDBD, 0xDBD}, + {0xDC0, 0xDC6}, + {0xDD0, 0xDD1}, + {0xDD8, 0xDDE}, + {0xDE6, 0xDEF}, + {0xDF2, 0xDF4}, + {0xE01, 0xE30}, + {0xE32, 0xE33}, + {0xE3F, 0xE46}, + {0xE4F, 0xE5B}, + {0xE81, 0xE82}, + {0xE84, 0xE84}, + {0xE86, 0xE8A}, + {0xE8C, 0xEA3}, + {0xEA5, 0xEA5}, + {0xEA7, 0xEB0}, + {0xEB2, 0xEB3}, + {0xEBD, 0xEBD}, + {0xEC0, 0xEC4}, + {0xEC6, 0xEC6}, + {0xED0, 0xED9}, + {0xEDC, 0xEDF}, + {0xF00, 0xF17}, + {0xF1A, 0xF34}, + {0xF36, 0xF36}, + {0xF38, 0xF38}, + {0xF3A, 0xF47}, + {0xF49, 0xF6C}, + {0xF7F, 0xF7F}, + {0xF85, 0xF85}, + {0xF88, 0xF8C}, + {0xFBE, 0xFC5}, + {0xFC7, 0xFCC}, + {0xFCE, 0xFDA}, + {0x1000, 0x102C}, + {0x1031, 0x1031}, + {0x1038, 0x1038}, + {0x103B, 0x103C}, + {0x103F, 0x1057}, + {0x105A, 0x105D}, + {0x1061, 0x1070}, + {0x1075, 0x1081}, + {0x1083, 0x1084}, + {0x1087, 0x108C}, + {0x108E, 0x109C}, + {0x109E, 0x10C5}, + {0x10C7, 0x10C7}, + {0x10CD, 0x10CD}, + {0x10D0, 0x1248}, + {0x124A, 0x124D}, + {0x1250, 0x1256}, + {0x1258, 0x1258}, + {0x125A, 0x125D}, + {0x1260, 0x1288}, + {0x128A, 0x128D}, + {0x1290, 0x12B0}, + {0x12B2, 0x12B5}, + {0x12B8, 0x12BE}, + {0x12C0, 0x12C0}, + {0x12C2, 0x12C5}, + {0x12C8, 0x12D6}, + {0x12D8, 0x1310}, + {0x1312, 0x1315}, + {0x1318, 0x135A}, + {0x1360, 0x137C}, + {0x1380, 0x1399}, + {0x13A0, 0x13F5}, + {0x13F8, 0x13FD}, + {0x1400, 0x169C}, + {0x16A0, 0x16F8}, + {0x1700, 0x1711}, + {0x171F, 0x1731}, + {0x1735, 0x1736}, + {0x1740, 0x1751}, + {0x1760, 0x176C}, + {0x176E, 0x1770}, + {0x1780, 0x17B3}, + {0x17B6, 0x17B6}, + {0x17BE, 0x17C5}, + {0x17C7, 0x17C8}, + {0x17D4, 0x17DC}, + {0x17E0, 0x17E9}, + {0x17F0, 0x17F9}, + {0x1800, 0x180A}, + {0x1810, 0x1819}, + {0x1820, 0x1878}, + {0x1880, 0x1884}, + {0x1887, 0x18A8}, + {0x18AA, 0x18AA}, + {0x18B0, 0x18F5}, + {0x1900, 0x191E}, + {0x1923, 0x1926}, + {0x1929, 0x192B}, + {0x1930, 0x1931}, + {0x1933, 0x1938}, + {0x1940, 0x1940}, + {0x1944, 0x196D}, + {0x1970, 0x1974}, + {0x1980, 0x19AB}, + {0x19B0, 0x19C9}, + {0x19D0, 0x19DA}, + {0x19DE, 0x1A16}, + {0x1A19, 0x1A1A}, + {0x1A1E, 0x1A55}, + {0x1A57, 0x1A57}, + {0x1A61, 0x1A61}, + {0x1A63, 0x1A64}, + {0x1A6D, 0x1A72}, + {0x1A80, 0x1A89}, + {0x1A90, 0x1A99}, + {0x1AA0, 0x1AAD}, + {0x1B04, 0x1B33}, + {0x1B3E, 0x1B41}, + {0x1B45, 0x1B4C}, + {0x1B4E, 0x1B6A}, + {0x1B74, 0x1B7F}, + {0x1B82, 0x1BA1}, + {0x1BA6, 0x1BA7}, + {0x1BAE, 0x1BE5}, + {0x1BE7, 0x1BE7}, + {0x1BEA, 0x1BEC}, + {0x1BEE, 0x1BEE}, + {0x1BFC, 0x1C2B}, + {0x1C34, 0x1C35}, + {0x1C3B, 0x1C49}, + {0x1C4D, 0x1C8A}, + {0x1C90, 0x1CBA}, + {0x1CBD, 0x1CC7}, + {0x1CD3, 0x1CD3}, + {0x1CE1, 0x1CE1}, + {0x1CE9, 0x1CEC}, + {0x1CEE, 0x1CF3}, + {0x1CF5, 0x1CF7}, + {0x1CFA, 0x1CFA}, + {0x1D00, 0x1DBF}, + {0x1E00, 0x1F15}, + {0x1F18, 0x1F1D}, + {0x1F20, 0x1F45}, + {0x1F48, 0x1F4D}, + {0x1F50, 0x1F57}, + {0x1F59, 0x1F59}, + {0x1F5B, 0x1F5B}, + {0x1F5D, 0x1F5D}, + {0x1F5F, 0x1F7D}, + {0x1F80, 0x1FB4}, + {0x1FB6, 0x1FC4}, + {0x1FC6, 0x1FD3}, + {0x1FD6, 0x1FDB}, + {0x1FDD, 0x1FEF}, + {0x1FF2, 0x1FF4}, + {0x1FF6, 0x1FFE}, + {0x2000, 0x200A}, + {0x2010, 0x2027}, + {0x202F, 0x205F}, + {0x2070, 0x2071}, + {0x2074, 0x208E}, + {0x2090, 0x209C}, + {0x20A0, 0x20C1}, + {0x2100, 0x218B}, + {0x2190, 0x2429}, + {0x2440, 0x244A}, + {0x2460, 0x2B73}, + {0x2B76, 0x2CEE}, + {0x2CF2, 0x2CF3}, + {0x2CF9, 0x2D25}, + {0x2D27, 0x2D27}, + {0x2D2D, 0x2D2D}, + {0x2D30, 0x2D67}, + {0x2D6F, 0x2D70}, + {0x2D80, 0x2D96}, + {0x2DA0, 0x2DA6}, + {0x2DA8, 0x2DAE}, + {0x2DB0, 0x2DB6}, + {0x2DB8, 0x2DBE}, + {0x2DC0, 0x2DC6}, + {0x2DC8, 0x2DCE}, + {0x2DD0, 0x2DD6}, + {0x2DD8, 0x2DDE}, + {0x2E00, 0x2E5D}, + {0x2E80, 0x2E99}, + {0x2E9B, 0x2EF3}, + {0x2F00, 0x2FD5}, + {0x2FF0, 0x3029}, + {0x3030, 0x303F}, + {0x3041, 0x3096}, + {0x309B, 0x30FF}, + {0x3105, 0x312F}, + {0x3131, 0x318E}, + {0x3190, 0x31E5}, + {0x31EF, 0x321E}, + {0x3220, 0xA48C}, + {0xA490, 0xA4C6}, + {0xA4D0, 0xA62B}, + {0xA640, 0xA66E}, + {0xA673, 0xA673}, + {0xA67E, 0xA69D}, + {0xA6A0, 0xA6EF}, + {0xA6F2, 0xA6F7}, + {0xA700, 0xA7DC}, + {0xA7F1, 0xA801}, + {0xA803, 0xA805}, + {0xA807, 0xA80A}, + {0xA80C, 0xA824}, + {0xA827, 0xA82B}, + {0xA830, 0xA839}, + {0xA840, 0xA877}, + {0xA880, 0xA8C3}, + {0xA8CE, 0xA8D9}, + {0xA8F2, 0xA8FE}, + {0xA900, 0xA925}, + {0xA92E, 0xA946}, + {0xA952, 0xA952}, + {0xA95F, 0xA97C}, + {0xA983, 0xA9B2}, + {0xA9B4, 0xA9B5}, + {0xA9BA, 0xA9BB}, + {0xA9BE, 0xA9BF}, + {0xA9C1, 0xA9CD}, + {0xA9CF, 0xA9D9}, + {0xA9DE, 0xA9E4}, + {0xA9E6, 0xA9FE}, + {0xAA00, 0xAA28}, + {0xAA2F, 0xAA30}, + {0xAA33, 0xAA34}, + {0xAA40, 0xAA42}, + {0xAA44, 0xAA4B}, + {0xAA4D, 0xAA4D}, + {0xAA50, 0xAA59}, + {0xAA5C, 0xAA7B}, + {0xAA7D, 0xAAAF}, + {0xAAB1, 0xAAB1}, + {0xAAB5, 0xAAB6}, + {0xAAB9, 0xAABD}, + {0xAAC0, 0xAAC0}, + {0xAAC2, 0xAAC2}, + {0xAADB, 0xAAEB}, + {0xAAEE, 0xAAF5}, + {0xAB01, 0xAB06}, + {0xAB09, 0xAB0E}, + {0xAB11, 0xAB16}, + {0xAB20, 0xAB26}, + {0xAB28, 0xAB2E}, + {0xAB30, 0xAB6B}, + {0xAB70, 0xABE4}, + {0xABE6, 0xABE7}, + {0xABE9, 0xABEC}, + {0xABF0, 0xABF9}, + {0xAC00, 0xD7A3}, + {0xD7B0, 0xD7C6}, + {0xD7CB, 0xD7FB}, + {0xF900, 0xFA6D}, + {0xFA70, 0xFAD9}, + {0xFB00, 0xFB06}, + {0xFB13, 0xFB17}, + {0xFB1D, 0xFB1D}, + {0xFB1F, 0xFB36}, + {0xFB38, 0xFB3C}, + {0xFB3E, 0xFB3E}, + {0xFB40, 0xFB41}, + {0xFB43, 0xFB44}, + {0xFB46, 0xFDCF}, + {0xFDF0, 0xFDFF}, + {0xFE10, 0xFE19}, + {0xFE30, 0xFE52}, + {0xFE54, 0xFE66}, + {0xFE68, 0xFE6B}, + {0xFE70, 0xFE74}, + {0xFE76, 0xFEFC}, + {0xFF01, 0xFF9D}, + {0xFFA0, 0xFFBE}, + {0xFFC2, 0xFFC7}, + {0xFFCA, 0xFFCF}, + {0xFFD2, 0xFFD7}, + {0xFFDA, 0xFFDC}, + {0xFFE0, 0xFFE6}, + {0xFFE8, 0xFFEE}, + {0xFFFC, 0xFFFD}, + {0x10000, 0x1000B}, + {0x1000D, 0x10026}, + {0x10028, 0x1003A}, + {0x1003C, 0x1003D}, + {0x1003F, 0x1004D}, + {0x10050, 0x1005D}, + {0x10080, 0x100FA}, + {0x10100, 0x10102}, + {0x10107, 0x10133}, + {0x10137, 0x1018E}, + {0x10190, 0x1019C}, + {0x101A0, 0x101A0}, + {0x101D0, 0x101FC}, + {0x10280, 0x1029C}, + {0x102A0, 0x102D0}, + {0x102E1, 0x102FB}, + {0x10300, 0x10323}, + {0x1032D, 0x1034A}, + {0x10350, 0x10375}, + {0x10380, 0x1039D}, + {0x1039F, 0x103C3}, + {0x103C8, 0x103D5}, + {0x10400, 0x1049D}, + {0x104A0, 0x104A9}, + {0x104B0, 0x104D3}, + {0x104D8, 0x104FB}, + {0x10500, 0x10527}, + {0x10530, 0x10563}, + {0x1056F, 0x1057A}, + {0x1057C, 0x1058A}, + {0x1058C, 0x10592}, + {0x10594, 0x10595}, + {0x10597, 0x105A1}, + {0x105A3, 0x105B1}, + {0x105B3, 0x105B9}, + {0x105BB, 0x105BC}, + {0x105C0, 0x105F3}, + {0x10600, 0x10736}, + {0x10740, 0x10755}, + {0x10760, 0x10767}, + {0x10780, 0x10785}, + {0x10787, 0x107B0}, + {0x107B2, 0x107BA}, + {0x10800, 0x10805}, + {0x10808, 0x10808}, + {0x1080A, 0x10835}, + {0x10837, 0x10838}, + {0x1083C, 0x1083C}, + {0x1083F, 0x10855}, + {0x10857, 0x1089E}, + {0x108A7, 0x108AF}, + {0x108E0, 0x108F2}, + {0x108F4, 0x108F5}, + {0x108FB, 0x1091B}, + {0x1091F, 0x10939}, + {0x1093F, 0x10959}, + {0x10980, 0x109B7}, + {0x109BC, 0x109CF}, + {0x109D2, 0x10A00}, + {0x10A10, 0x10A13}, + {0x10A15, 0x10A17}, + {0x10A19, 0x10A35}, + {0x10A40, 0x10A48}, + {0x10A50, 0x10A58}, + {0x10A60, 0x10A9F}, + {0x10AC0, 0x10AE4}, + {0x10AEB, 0x10AF6}, + {0x10B00, 0x10B35}, + {0x10B39, 0x10B55}, + {0x10B58, 0x10B72}, + {0x10B78, 0x10B91}, + {0x10B99, 0x10B9C}, + {0x10BA9, 0x10BAF}, + {0x10C00, 0x10C48}, + {0x10C80, 0x10CB2}, + {0x10CC0, 0x10CF2}, + {0x10CFA, 0x10D23}, + {0x10D30, 0x10D39}, + {0x10D40, 0x10D65}, + {0x10D6E, 0x10D85}, + {0x10D8E, 0x10D8F}, + {0x10E60, 0x10E7E}, + {0x10E80, 0x10EA9}, + {0x10EAD, 0x10EAD}, + {0x10EB0, 0x10EB1}, + {0x10EC2, 0x10EC7}, + {0x10ED0, 0x10ED8}, + {0x10F00, 0x10F27}, + {0x10F30, 0x10F45}, + {0x10F51, 0x10F59}, + {0x10F70, 0x10F81}, + {0x10F86, 0x10F89}, + {0x10FB0, 0x10FCB}, + {0x10FE0, 0x10FF6}, + {0x11000, 0x11000}, + {0x11002, 0x11037}, + {0x11047, 0x1104D}, + {0x11052, 0x1106F}, + {0x11071, 0x11072}, + {0x11075, 0x11075}, + {0x11082, 0x110B2}, + {0x110B7, 0x110B8}, + {0x110BB, 0x110BC}, + {0x110BE, 0x110C1}, + {0x110D0, 0x110E8}, + {0x110F0, 0x110F9}, + {0x11103, 0x11126}, + {0x1112C, 0x1112C}, + {0x11136, 0x11147}, + {0x11150, 0x11172}, + {0x11174, 0x11176}, + {0x11182, 0x111B5}, + {0x111BF, 0x111BF}, + {0x111C1, 0x111C8}, + {0x111CD, 0x111CE}, + {0x111D0, 0x111DF}, + {0x111E1, 0x111F4}, + {0x11200, 0x11211}, + {0x11213, 0x1122E}, + {0x11232, 0x11233}, + {0x11238, 0x1123D}, + {0x1123F, 0x11240}, + {0x11280, 0x11286}, + {0x11288, 0x11288}, + {0x1128A, 0x1128D}, + {0x1128F, 0x1129D}, + {0x1129F, 0x112A9}, + {0x112B0, 0x112DE}, + {0x112E0, 0x112E2}, + {0x112F0, 0x112F9}, + {0x11302, 0x11303}, + {0x11305, 0x1130C}, + {0x1130F, 0x11310}, + {0x11313, 0x11328}, + {0x1132A, 0x11330}, + {0x11332, 0x11333}, + {0x11335, 0x11339}, + {0x1133D, 0x1133D}, + {0x1133F, 0x1133F}, + {0x11341, 0x11344}, + {0x11347, 0x11348}, + {0x1134B, 0x1134C}, + {0x11350, 0x11350}, + {0x1135D, 0x11363}, + {0x11380, 0x11389}, + {0x1138B, 0x1138B}, + {0x1138E, 0x1138E}, + {0x11390, 0x113B5}, + {0x113B7, 0x113B7}, + {0x113B9, 0x113BA}, + {0x113CA, 0x113CA}, + {0x113CC, 0x113CD}, + {0x113D1, 0x113D1}, + {0x113D3, 0x113D5}, + {0x113D7, 0x113D8}, + {0x11400, 0x11437}, + {0x11440, 0x11441}, + {0x11445, 0x11445}, + {0x11447, 0x1145B}, + {0x1145D, 0x1145D}, + {0x1145F, 0x11461}, + {0x11480, 0x114AF}, + {0x114B1, 0x114B2}, + {0x114B9, 0x114B9}, + {0x114BB, 0x114BC}, + {0x114BE, 0x114BE}, + {0x114C1, 0x114C1}, + {0x114C4, 0x114C7}, + {0x114D0, 0x114D9}, + {0x11580, 0x115AE}, + {0x115B0, 0x115B1}, + {0x115B8, 0x115BB}, + {0x115BE, 0x115BE}, + {0x115C1, 0x115DB}, + {0x11600, 0x11632}, + {0x1163B, 0x1163C}, + {0x1163E, 0x1163E}, + {0x11641, 0x11644}, + {0x11650, 0x11659}, + {0x11660, 0x1166C}, + {0x11680, 0x116AA}, + {0x116AC, 0x116AC}, + {0x116AE, 0x116AF}, + {0x116B8, 0x116B9}, + {0x116C0, 0x116C9}, + {0x116D0, 0x116E3}, + {0x11700, 0x1171A}, + {0x1171E, 0x1171E}, + {0x11720, 0x11721}, + {0x11726, 0x11726}, + {0x11730, 0x11746}, + {0x11800, 0x1182E}, + {0x11838, 0x11838}, + {0x1183B, 0x1183B}, + {0x118A0, 0x118F2}, + {0x118FF, 0x11906}, + {0x11909, 0x11909}, + {0x1190C, 0x11913}, + {0x11915, 0x11916}, + {0x11918, 0x1192F}, + {0x11931, 0x11935}, + {0x11937, 0x11938}, + {0x1193F, 0x11942}, + {0x11944, 0x11946}, + {0x11950, 0x11959}, + {0x119A0, 0x119A7}, + {0x119AA, 0x119D3}, + {0x119DC, 0x119DF}, + {0x119E1, 0x119E4}, + {0x11A00, 0x11A00}, + {0x11A0B, 0x11A32}, + {0x11A39, 0x11A3A}, + {0x11A3F, 0x11A46}, + {0x11A50, 0x11A50}, + {0x11A57, 0x11A58}, + {0x11A5C, 0x11A89}, + {0x11A97, 0x11A97}, + {0x11A9A, 0x11AA2}, + {0x11AB0, 0x11AF8}, + {0x11B00, 0x11B09}, + {0x11B61, 0x11B61}, + {0x11B65, 0x11B65}, + {0x11B67, 0x11B67}, + {0x11BC0, 0x11BE1}, + {0x11BF0, 0x11BF9}, + {0x11C00, 0x11C08}, + {0x11C0A, 0x11C2F}, + {0x11C3E, 0x11C3E}, + {0x11C40, 0x11C45}, + {0x11C50, 0x11C6C}, + {0x11C70, 0x11C8F}, + {0x11CA9, 0x11CA9}, + {0x11CB1, 0x11CB1}, + {0x11CB4, 0x11CB4}, + {0x11D00, 0x11D06}, + {0x11D08, 0x11D09}, + {0x11D0B, 0x11D30}, + {0x11D46, 0x11D46}, + {0x11D50, 0x11D59}, + {0x11D60, 0x11D65}, + {0x11D67, 0x11D68}, + {0x11D6A, 0x11D8E}, + {0x11D93, 0x11D94}, + {0x11D96, 0x11D96}, + {0x11D98, 0x11D98}, + {0x11DA0, 0x11DA9}, + {0x11DB0, 0x11DDB}, + {0x11DE0, 0x11DE9}, + {0x11EE0, 0x11EF2}, + {0x11EF5, 0x11EF8}, + {0x11F02, 0x11F10}, + {0x11F12, 0x11F35}, + {0x11F3E, 0x11F3F}, + {0x11F43, 0x11F59}, + {0x11FB0, 0x11FB0}, + {0x11FC0, 0x11FF1}, + {0x11FFF, 0x12399}, + {0x12400, 0x1246E}, + {0x12470, 0x12474}, + {0x12480, 0x12543}, + {0x12F90, 0x12FF2}, + {0x13000, 0x1342F}, + {0x13441, 0x13446}, + {0x13460, 0x143FA}, + {0x14400, 0x14646}, + {0x16100, 0x1611D}, + {0x1612A, 0x1612C}, + {0x16130, 0x16139}, + {0x16800, 0x16A38}, + {0x16A40, 0x16A5E}, + {0x16A60, 0x16A69}, + {0x16A6E, 0x16ABE}, + {0x16AC0, 0x16AC9}, + {0x16AD0, 0x16AED}, + {0x16AF5, 0x16AF5}, + {0x16B00, 0x16B2F}, + {0x16B37, 0x16B45}, + {0x16B50, 0x16B59}, + {0x16B5B, 0x16B61}, + {0x16B63, 0x16B77}, + {0x16B7D, 0x16B8F}, + {0x16D40, 0x16D79}, + {0x16E40, 0x16E9A}, + {0x16EA0, 0x16EB8}, + {0x16EBB, 0x16ED3}, + {0x16F00, 0x16F4A}, + {0x16F50, 0x16F87}, + {0x16F93, 0x16F9F}, + {0x16FE0, 0x16FE3}, + {0x16FF2, 0x16FF6}, + {0x17000, 0x18CD5}, + {0x18CFF, 0x18D1E}, + {0x18D80, 0x18DF2}, + {0x1AFF0, 0x1AFF3}, + {0x1AFF5, 0x1AFFB}, + {0x1AFFD, 0x1AFFE}, + {0x1B000, 0x1B122}, + {0x1B132, 0x1B132}, + {0x1B150, 0x1B152}, + {0x1B155, 0x1B155}, + {0x1B164, 0x1B167}, + {0x1B170, 0x1B2FB}, + {0x1BC00, 0x1BC6A}, + {0x1BC70, 0x1BC7C}, + {0x1BC80, 0x1BC88}, + {0x1BC90, 0x1BC99}, + {0x1BC9C, 0x1BC9C}, + {0x1BC9F, 0x1BC9F}, + {0x1CC00, 0x1CCFC}, + {0x1CD00, 0x1CEB3}, + {0x1CEBA, 0x1CED0}, + {0x1CEE0, 0x1CEF0}, + {0x1CF50, 0x1CFC3}, + {0x1D000, 0x1D0F5}, + {0x1D100, 0x1D126}, + {0x1D129, 0x1D164}, + {0x1D16A, 0x1D16C}, + {0x1D183, 0x1D184}, + {0x1D18C, 0x1D1A9}, + {0x1D1AE, 0x1D1EA}, + {0x1D200, 0x1D241}, + {0x1D245, 0x1D245}, + {0x1D2C0, 0x1D2D3}, + {0x1D2E0, 0x1D2F3}, + {0x1D300, 0x1D356}, + {0x1D360, 0x1D378}, + {0x1D400, 0x1D454}, + {0x1D456, 0x1D49C}, + {0x1D49E, 0x1D49F}, + {0x1D4A2, 0x1D4A2}, + {0x1D4A5, 0x1D4A6}, + {0x1D4A9, 0x1D4AC}, + {0x1D4AE, 0x1D4B9}, + {0x1D4BB, 0x1D4BB}, + {0x1D4BD, 0x1D4C3}, + {0x1D4C5, 0x1D505}, + {0x1D507, 0x1D50A}, + {0x1D50D, 0x1D514}, + {0x1D516, 0x1D51C}, + {0x1D51E, 0x1D539}, + {0x1D53B, 0x1D53E}, + {0x1D540, 0x1D544}, + {0x1D546, 0x1D546}, + {0x1D54A, 0x1D550}, + {0x1D552, 0x1D6A5}, + {0x1D6A8, 0x1D7CB}, + {0x1D7CE, 0x1D9FF}, + {0x1DA37, 0x1DA3A}, + {0x1DA6D, 0x1DA74}, + {0x1DA76, 0x1DA83}, + {0x1DA85, 0x1DA8B}, + {0x1DF00, 0x1DF1E}, + {0x1DF25, 0x1DF2A}, + {0x1E030, 0x1E06D}, + {0x1E100, 0x1E12C}, + {0x1E137, 0x1E13D}, + {0x1E140, 0x1E149}, + {0x1E14E, 0x1E14F}, + {0x1E290, 0x1E2AD}, + {0x1E2C0, 0x1E2EB}, + {0x1E2F0, 0x1E2F9}, + {0x1E2FF, 0x1E2FF}, + {0x1E4D0, 0x1E4EB}, + {0x1E4F0, 0x1E4F9}, + {0x1E5D0, 0x1E5ED}, + {0x1E5F0, 0x1E5FA}, + {0x1E5FF, 0x1E5FF}, + {0x1E6C0, 0x1E6DE}, + {0x1E6E0, 0x1E6E2}, + {0x1E6E4, 0x1E6E5}, + {0x1E6E7, 0x1E6ED}, + {0x1E6F0, 0x1E6F4}, + {0x1E6FE, 0x1E6FF}, + {0x1E7E0, 0x1E7E6}, + {0x1E7E8, 0x1E7EB}, + {0x1E7ED, 0x1E7EE}, + {0x1E7F0, 0x1E7FE}, + {0x1E800, 0x1E8C4}, + {0x1E8C7, 0x1E8CF}, + {0x1E900, 0x1E943}, + {0x1E94B, 0x1E94B}, + {0x1E950, 0x1E959}, + {0x1E95E, 0x1E95F}, + {0x1EC71, 0x1ECB4}, + {0x1ED01, 0x1ED3D}, + {0x1EE00, 0x1EE03}, + {0x1EE05, 0x1EE1F}, + {0x1EE21, 0x1EE22}, + {0x1EE24, 0x1EE24}, + {0x1EE27, 0x1EE27}, + {0x1EE29, 0x1EE32}, + {0x1EE34, 0x1EE37}, + {0x1EE39, 0x1EE39}, + {0x1EE3B, 0x1EE3B}, + {0x1EE42, 0x1EE42}, + {0x1EE47, 0x1EE47}, + {0x1EE49, 0x1EE49}, + {0x1EE4B, 0x1EE4B}, + {0x1EE4D, 0x1EE4F}, + {0x1EE51, 0x1EE52}, + {0x1EE54, 0x1EE54}, + {0x1EE57, 0x1EE57}, + {0x1EE59, 0x1EE59}, + {0x1EE5B, 0x1EE5B}, + {0x1EE5D, 0x1EE5D}, + {0x1EE5F, 0x1EE5F}, + {0x1EE61, 0x1EE62}, + {0x1EE64, 0x1EE64}, + {0x1EE67, 0x1EE6A}, + {0x1EE6C, 0x1EE72}, + {0x1EE74, 0x1EE77}, + {0x1EE79, 0x1EE7C}, + {0x1EE7E, 0x1EE7E}, + {0x1EE80, 0x1EE89}, + {0x1EE8B, 0x1EE9B}, + {0x1EEA1, 0x1EEA3}, + {0x1EEA5, 0x1EEA9}, + {0x1EEAB, 0x1EEBB}, + {0x1EEF0, 0x1EEF1}, + {0x1F000, 0x1F02B}, + {0x1F030, 0x1F093}, + {0x1F0A0, 0x1F0AE}, + {0x1F0B1, 0x1F0BF}, + {0x1F0C1, 0x1F0CF}, + {0x1F0D1, 0x1F0F5}, + {0x1F100, 0x1F1AD}, + {0x1F1E6, 0x1F202}, + {0x1F210, 0x1F23B}, + {0x1F240, 0x1F248}, + {0x1F250, 0x1F251}, + {0x1F260, 0x1F265}, + {0x1F300, 0x1F6D8}, + {0x1F6DC, 0x1F6EC}, + {0x1F6F0, 0x1F6FC}, + {0x1F700, 0x1F7D9}, + {0x1F7E0, 0x1F7EB}, + {0x1F7F0, 0x1F7F0}, + {0x1F800, 0x1F80B}, + {0x1F810, 0x1F847}, + {0x1F850, 0x1F859}, + {0x1F860, 0x1F887}, + {0x1F890, 0x1F8AD}, + {0x1F8B0, 0x1F8BB}, + {0x1F8C0, 0x1F8C1}, + {0x1F8D0, 0x1F8D8}, + {0x1F900, 0x1FA57}, + {0x1FA60, 0x1FA6D}, + {0x1FA70, 0x1FA7C}, + {0x1FA80, 0x1FA8A}, + {0x1FA8E, 0x1FAC6}, + {0x1FAC8, 0x1FAC8}, + {0x1FACD, 0x1FADC}, + {0x1FADF, 0x1FAEA}, + {0x1FAEF, 0x1FAF8}, + {0x1FB00, 0x1FB92}, + {0x1FB94, 0x1FBFA}, + {0x20000, 0x2A6DF}, + {0x2A700, 0x2B81D}, + {0x2B820, 0x2CEAD}, + {0x2CEB0, 0x2EBE0}, + {0x2EBF0, 0x2EE5D}, + {0x2F800, 0x2FA1D}, + {0x30000, 0x3134A}, + {0x31350, 0x33479}, + }, + "Grapheme_Extend": { + {0x300, 0x36F}, + {0x483, 0x489}, + {0x591, 0x5BD}, + {0x5BF, 0x5BF}, + {0x5C1, 0x5C2}, + {0x5C4, 0x5C5}, + {0x5C7, 0x5C7}, + {0x610, 0x61A}, + {0x64B, 0x65F}, + {0x670, 0x670}, + {0x6D6, 0x6DC}, + {0x6DF, 0x6E4}, + {0x6E7, 0x6E8}, + {0x6EA, 0x6ED}, + {0x711, 0x711}, + {0x730, 0x74A}, + {0x7A6, 0x7B0}, + {0x7EB, 0x7F3}, + {0x7FD, 0x7FD}, + {0x816, 0x819}, + {0x81B, 0x823}, + {0x825, 0x827}, + {0x829, 0x82D}, + {0x859, 0x85B}, + {0x897, 0x89F}, + {0x8CA, 0x8E1}, + {0x8E3, 0x902}, + {0x93A, 0x93A}, + {0x93C, 0x93C}, + {0x941, 0x948}, + {0x94D, 0x94D}, + {0x951, 0x957}, + {0x962, 0x963}, + {0x981, 0x981}, + {0x9BC, 0x9BC}, + {0x9BE, 0x9BE}, + {0x9C1, 0x9C4}, + {0x9CD, 0x9CD}, + {0x9D7, 0x9D7}, + {0x9E2, 0x9E3}, + {0x9FE, 0x9FE}, + {0xA01, 0xA02}, + {0xA3C, 0xA3C}, + {0xA41, 0xA42}, + {0xA47, 0xA48}, + {0xA4B, 0xA4D}, + {0xA51, 0xA51}, + {0xA70, 0xA71}, + {0xA75, 0xA75}, + {0xA81, 0xA82}, + {0xABC, 0xABC}, + {0xAC1, 0xAC5}, + {0xAC7, 0xAC8}, + {0xACD, 0xACD}, + {0xAE2, 0xAE3}, + {0xAFA, 0xAFF}, + {0xB01, 0xB01}, + {0xB3C, 0xB3C}, + {0xB3E, 0xB3F}, + {0xB41, 0xB44}, + {0xB4D, 0xB4D}, + {0xB55, 0xB57}, + {0xB62, 0xB63}, + {0xB82, 0xB82}, + {0xBBE, 0xBBE}, + {0xBC0, 0xBC0}, + {0xBCD, 0xBCD}, + {0xBD7, 0xBD7}, + {0xC00, 0xC00}, + {0xC04, 0xC04}, + {0xC3C, 0xC3C}, + {0xC3E, 0xC40}, + {0xC46, 0xC48}, + {0xC4A, 0xC4D}, + {0xC55, 0xC56}, + {0xC62, 0xC63}, + {0xC81, 0xC81}, + {0xCBC, 0xCBC}, + {0xCBF, 0xCC0}, + {0xCC2, 0xCC2}, + {0xCC6, 0xCC8}, + {0xCCA, 0xCCD}, + {0xCD5, 0xCD6}, + {0xCE2, 0xCE3}, + {0xD00, 0xD01}, + {0xD3B, 0xD3C}, + {0xD3E, 0xD3E}, + {0xD41, 0xD44}, + {0xD4D, 0xD4D}, + {0xD57, 0xD57}, + {0xD62, 0xD63}, + {0xD81, 0xD81}, + {0xDCA, 0xDCA}, + {0xDCF, 0xDCF}, + {0xDD2, 0xDD4}, + {0xDD6, 0xDD6}, + {0xDDF, 0xDDF}, + {0xE31, 0xE31}, + {0xE34, 0xE3A}, + {0xE47, 0xE4E}, + {0xEB1, 0xEB1}, + {0xEB4, 0xEBC}, + {0xEC8, 0xECE}, + {0xF18, 0xF19}, + {0xF35, 0xF35}, + {0xF37, 0xF37}, + {0xF39, 0xF39}, + {0xF71, 0xF7E}, + {0xF80, 0xF84}, + {0xF86, 0xF87}, + {0xF8D, 0xF97}, + {0xF99, 0xFBC}, + {0xFC6, 0xFC6}, + {0x102D, 0x1030}, + {0x1032, 0x1037}, + {0x1039, 0x103A}, + {0x103D, 0x103E}, + {0x1058, 0x1059}, + {0x105E, 0x1060}, + {0x1071, 0x1074}, + {0x1082, 0x1082}, + {0x1085, 0x1086}, + {0x108D, 0x108D}, + {0x109D, 0x109D}, + {0x135D, 0x135F}, + {0x1712, 0x1715}, + {0x1732, 0x1734}, + {0x1752, 0x1753}, + {0x1772, 0x1773}, + {0x17B4, 0x17B5}, + {0x17B7, 0x17BD}, + {0x17C6, 0x17C6}, + {0x17C9, 0x17D3}, + {0x17DD, 0x17DD}, + {0x180B, 0x180D}, + {0x180F, 0x180F}, + {0x1885, 0x1886}, + {0x18A9, 0x18A9}, + {0x1920, 0x1922}, + {0x1927, 0x1928}, + {0x1932, 0x1932}, + {0x1939, 0x193B}, + {0x1A17, 0x1A18}, + {0x1A1B, 0x1A1B}, + {0x1A56, 0x1A56}, + {0x1A58, 0x1A5E}, + {0x1A60, 0x1A60}, + {0x1A62, 0x1A62}, + {0x1A65, 0x1A6C}, + {0x1A73, 0x1A7C}, + {0x1A7F, 0x1A7F}, + {0x1AB0, 0x1ADD}, + {0x1AE0, 0x1AEB}, + {0x1B00, 0x1B03}, + {0x1B34, 0x1B3D}, + {0x1B42, 0x1B44}, + {0x1B6B, 0x1B73}, + {0x1B80, 0x1B81}, + {0x1BA2, 0x1BA5}, + {0x1BA8, 0x1BAD}, + {0x1BE6, 0x1BE6}, + {0x1BE8, 0x1BE9}, + {0x1BED, 0x1BED}, + {0x1BEF, 0x1BF3}, + {0x1C2C, 0x1C33}, + {0x1C36, 0x1C37}, + {0x1CD0, 0x1CD2}, + {0x1CD4, 0x1CE0}, + {0x1CE2, 0x1CE8}, + {0x1CED, 0x1CED}, + {0x1CF4, 0x1CF4}, + {0x1CF8, 0x1CF9}, + {0x1DC0, 0x1DFF}, + {0x200C, 0x200C}, + {0x20D0, 0x20F0}, + {0x2CEF, 0x2CF1}, + {0x2D7F, 0x2D7F}, + {0x2DE0, 0x2DFF}, + {0x302A, 0x302F}, + {0x3099, 0x309A}, + {0xA66F, 0xA672}, + {0xA674, 0xA67D}, + {0xA69E, 0xA69F}, + {0xA6F0, 0xA6F1}, + {0xA802, 0xA802}, + {0xA806, 0xA806}, + {0xA80B, 0xA80B}, + {0xA825, 0xA826}, + {0xA82C, 0xA82C}, + {0xA8C4, 0xA8C5}, + {0xA8E0, 0xA8F1}, + {0xA8FF, 0xA8FF}, + {0xA926, 0xA92D}, + {0xA947, 0xA951}, + {0xA953, 0xA953}, + {0xA980, 0xA982}, + {0xA9B3, 0xA9B3}, + {0xA9B6, 0xA9B9}, + {0xA9BC, 0xA9BD}, + {0xA9C0, 0xA9C0}, + {0xA9E5, 0xA9E5}, + {0xAA29, 0xAA2E}, + {0xAA31, 0xAA32}, + {0xAA35, 0xAA36}, + {0xAA43, 0xAA43}, + {0xAA4C, 0xAA4C}, + {0xAA7C, 0xAA7C}, + {0xAAB0, 0xAAB0}, + {0xAAB2, 0xAAB4}, + {0xAAB7, 0xAAB8}, + {0xAABE, 0xAABF}, + {0xAAC1, 0xAAC1}, + {0xAAEC, 0xAAED}, + {0xAAF6, 0xAAF6}, + {0xABE5, 0xABE5}, + {0xABE8, 0xABE8}, + {0xABED, 0xABED}, + {0xFB1E, 0xFB1E}, + {0xFE00, 0xFE0F}, + {0xFE20, 0xFE2F}, + {0xFF9E, 0xFF9F}, + {0x101FD, 0x101FD}, + {0x102E0, 0x102E0}, + {0x10376, 0x1037A}, + {0x10A01, 0x10A03}, + {0x10A05, 0x10A06}, + {0x10A0C, 0x10A0F}, + {0x10A38, 0x10A3A}, + {0x10A3F, 0x10A3F}, + {0x10AE5, 0x10AE6}, + {0x10D24, 0x10D27}, + {0x10D69, 0x10D6D}, + {0x10EAB, 0x10EAC}, + {0x10EFA, 0x10EFF}, + {0x10F46, 0x10F50}, + {0x10F82, 0x10F85}, + {0x11001, 0x11001}, + {0x11038, 0x11046}, + {0x11070, 0x11070}, + {0x11073, 0x11074}, + {0x1107F, 0x11081}, + {0x110B3, 0x110B6}, + {0x110B9, 0x110BA}, + {0x110C2, 0x110C2}, + {0x11100, 0x11102}, + {0x11127, 0x1112B}, + {0x1112D, 0x11134}, + {0x11173, 0x11173}, + {0x11180, 0x11181}, + {0x111B6, 0x111BE}, + {0x111C0, 0x111C0}, + {0x111C9, 0x111CC}, + {0x111CF, 0x111CF}, + {0x1122F, 0x11231}, + {0x11234, 0x11237}, + {0x1123E, 0x1123E}, + {0x11241, 0x11241}, + {0x112DF, 0x112DF}, + {0x112E3, 0x112EA}, + {0x11300, 0x11301}, + {0x1133B, 0x1133C}, + {0x1133E, 0x1133E}, + {0x11340, 0x11340}, + {0x1134D, 0x1134D}, + {0x11357, 0x11357}, + {0x11366, 0x1136C}, + {0x11370, 0x11374}, + {0x113B8, 0x113B8}, + {0x113BB, 0x113C0}, + {0x113C2, 0x113C2}, + {0x113C5, 0x113C5}, + {0x113C7, 0x113C9}, + {0x113CE, 0x113D0}, + {0x113D2, 0x113D2}, + {0x113E1, 0x113E2}, + {0x11438, 0x1143F}, + {0x11442, 0x11444}, + {0x11446, 0x11446}, + {0x1145E, 0x1145E}, + {0x114B0, 0x114B0}, + {0x114B3, 0x114B8}, + {0x114BA, 0x114BA}, + {0x114BD, 0x114BD}, + {0x114BF, 0x114C0}, + {0x114C2, 0x114C3}, + {0x115AF, 0x115AF}, + {0x115B2, 0x115B5}, + {0x115BC, 0x115BD}, + {0x115BF, 0x115C0}, + {0x115DC, 0x115DD}, + {0x11633, 0x1163A}, + {0x1163D, 0x1163D}, + {0x1163F, 0x11640}, + {0x116AB, 0x116AB}, + {0x116AD, 0x116AD}, + {0x116B0, 0x116B7}, + {0x1171D, 0x1171D}, + {0x1171F, 0x1171F}, + {0x11722, 0x11725}, + {0x11727, 0x1172B}, + {0x1182F, 0x11837}, + {0x11839, 0x1183A}, + {0x11930, 0x11930}, + {0x1193B, 0x1193E}, + {0x11943, 0x11943}, + {0x119D4, 0x119D7}, + {0x119DA, 0x119DB}, + {0x119E0, 0x119E0}, + {0x11A01, 0x11A0A}, + {0x11A33, 0x11A38}, + {0x11A3B, 0x11A3E}, + {0x11A47, 0x11A47}, + {0x11A51, 0x11A56}, + {0x11A59, 0x11A5B}, + {0x11A8A, 0x11A96}, + {0x11A98, 0x11A99}, + {0x11B60, 0x11B60}, + {0x11B62, 0x11B64}, + {0x11B66, 0x11B66}, + {0x11C30, 0x11C36}, + {0x11C38, 0x11C3D}, + {0x11C3F, 0x11C3F}, + {0x11C92, 0x11CA7}, + {0x11CAA, 0x11CB0}, + {0x11CB2, 0x11CB3}, + {0x11CB5, 0x11CB6}, + {0x11D31, 0x11D36}, + {0x11D3A, 0x11D3A}, + {0x11D3C, 0x11D3D}, + {0x11D3F, 0x11D45}, + {0x11D47, 0x11D47}, + {0x11D90, 0x11D91}, + {0x11D95, 0x11D95}, + {0x11D97, 0x11D97}, + {0x11EF3, 0x11EF4}, + {0x11F00, 0x11F01}, + {0x11F36, 0x11F3A}, + {0x11F40, 0x11F42}, + {0x11F5A, 0x11F5A}, + {0x13440, 0x13440}, + {0x13447, 0x13455}, + {0x1611E, 0x16129}, + {0x1612D, 0x1612F}, + {0x16AF0, 0x16AF4}, + {0x16B30, 0x16B36}, + {0x16F4F, 0x16F4F}, + {0x16F8F, 0x16F92}, + {0x16FE4, 0x16FE4}, + {0x16FF0, 0x16FF1}, + {0x1BC9D, 0x1BC9E}, + {0x1CF00, 0x1CF2D}, + {0x1CF30, 0x1CF46}, + {0x1D165, 0x1D169}, + {0x1D16D, 0x1D172}, + {0x1D17B, 0x1D182}, + {0x1D185, 0x1D18B}, + {0x1D1AA, 0x1D1AD}, + {0x1D242, 0x1D244}, + {0x1DA00, 0x1DA36}, + {0x1DA3B, 0x1DA6C}, + {0x1DA75, 0x1DA75}, + {0x1DA84, 0x1DA84}, + {0x1DA9B, 0x1DA9F}, + {0x1DAA1, 0x1DAAF}, + {0x1E000, 0x1E006}, + {0x1E008, 0x1E018}, + {0x1E01B, 0x1E021}, + {0x1E023, 0x1E024}, + {0x1E026, 0x1E02A}, + {0x1E08F, 0x1E08F}, + {0x1E130, 0x1E136}, + {0x1E2AE, 0x1E2AE}, + {0x1E2EC, 0x1E2EF}, + {0x1E4EC, 0x1E4EF}, + {0x1E5EE, 0x1E5EF}, + {0x1E6E3, 0x1E6E3}, + {0x1E6E6, 0x1E6E6}, + {0x1E6EE, 0x1E6EF}, + {0x1E6F5, 0x1E6F5}, + {0x1E8D0, 0x1E8D6}, + {0x1E944, 0x1E94A}, + {0xE0020, 0xE007F}, + {0xE0100, 0xE01EF}, + }, + "ID_Continue": { + {0x30, 0x39}, + {0x41, 0x5A}, + {0x5F, 0x5F}, + {0x61, 0x7A}, + {0xAA, 0xAA}, + {0xB5, 0xB5}, + {0xB7, 0xB7}, + {0xBA, 0xBA}, + {0xC0, 0xD6}, + {0xD8, 0xF6}, + {0xF8, 0x2C1}, + {0x2C6, 0x2D1}, + {0x2E0, 0x2E4}, + {0x2EC, 0x2EC}, + {0x2EE, 0x2EE}, + {0x300, 0x374}, + {0x376, 0x377}, + {0x37A, 0x37D}, + {0x37F, 0x37F}, + {0x386, 0x38A}, + {0x38C, 0x38C}, + {0x38E, 0x3A1}, + {0x3A3, 0x3F5}, + {0x3F7, 0x481}, + {0x483, 0x487}, + {0x48A, 0x52F}, + {0x531, 0x556}, + {0x559, 0x559}, + {0x560, 0x588}, + {0x591, 0x5BD}, + {0x5BF, 0x5BF}, + {0x5C1, 0x5C2}, + {0x5C4, 0x5C5}, + {0x5C7, 0x5C7}, + {0x5D0, 0x5EA}, + {0x5EF, 0x5F2}, + {0x610, 0x61A}, + {0x620, 0x669}, + {0x66E, 0x6D3}, + {0x6D5, 0x6DC}, + {0x6DF, 0x6E8}, + {0x6EA, 0x6FC}, + {0x6FF, 0x6FF}, + {0x710, 0x74A}, + {0x74D, 0x7B1}, + {0x7C0, 0x7F5}, + {0x7FA, 0x7FA}, + {0x7FD, 0x7FD}, + {0x800, 0x82D}, + {0x840, 0x85B}, + {0x860, 0x86A}, + {0x870, 0x887}, + {0x889, 0x88F}, + {0x897, 0x8E1}, + {0x8E3, 0x963}, + {0x966, 0x96F}, + {0x971, 0x983}, + {0x985, 0x98C}, + {0x98F, 0x990}, + {0x993, 0x9A8}, + {0x9AA, 0x9B0}, + {0x9B2, 0x9B2}, + {0x9B6, 0x9B9}, + {0x9BC, 0x9C4}, + {0x9C7, 0x9C8}, + {0x9CB, 0x9CE}, + {0x9D7, 0x9D7}, + {0x9DC, 0x9DD}, + {0x9DF, 0x9E3}, + {0x9E6, 0x9F1}, + {0x9FC, 0x9FC}, + {0x9FE, 0x9FE}, + {0xA01, 0xA03}, + {0xA05, 0xA0A}, + {0xA0F, 0xA10}, + {0xA13, 0xA28}, + {0xA2A, 0xA30}, + {0xA32, 0xA33}, + {0xA35, 0xA36}, + {0xA38, 0xA39}, + {0xA3C, 0xA3C}, + {0xA3E, 0xA42}, + {0xA47, 0xA48}, + {0xA4B, 0xA4D}, + {0xA51, 0xA51}, + {0xA59, 0xA5C}, + {0xA5E, 0xA5E}, + {0xA66, 0xA75}, + {0xA81, 0xA83}, + {0xA85, 0xA8D}, + {0xA8F, 0xA91}, + {0xA93, 0xAA8}, + {0xAAA, 0xAB0}, + {0xAB2, 0xAB3}, + {0xAB5, 0xAB9}, + {0xABC, 0xAC5}, + {0xAC7, 0xAC9}, + {0xACB, 0xACD}, + {0xAD0, 0xAD0}, + {0xAE0, 0xAE3}, + {0xAE6, 0xAEF}, + {0xAF9, 0xAFF}, + {0xB01, 0xB03}, + {0xB05, 0xB0C}, + {0xB0F, 0xB10}, + {0xB13, 0xB28}, + {0xB2A, 0xB30}, + {0xB32, 0xB33}, + {0xB35, 0xB39}, + {0xB3C, 0xB44}, + {0xB47, 0xB48}, + {0xB4B, 0xB4D}, + {0xB55, 0xB57}, + {0xB5C, 0xB5D}, + {0xB5F, 0xB63}, + {0xB66, 0xB6F}, + {0xB71, 0xB71}, + {0xB82, 0xB83}, + {0xB85, 0xB8A}, + {0xB8E, 0xB90}, + {0xB92, 0xB95}, + {0xB99, 0xB9A}, + {0xB9C, 0xB9C}, + {0xB9E, 0xB9F}, + {0xBA3, 0xBA4}, + {0xBA8, 0xBAA}, + {0xBAE, 0xBB9}, + {0xBBE, 0xBC2}, + {0xBC6, 0xBC8}, + {0xBCA, 0xBCD}, + {0xBD0, 0xBD0}, + {0xBD7, 0xBD7}, + {0xBE6, 0xBEF}, + {0xC00, 0xC0C}, + {0xC0E, 0xC10}, + {0xC12, 0xC28}, + {0xC2A, 0xC39}, + {0xC3C, 0xC44}, + {0xC46, 0xC48}, + {0xC4A, 0xC4D}, + {0xC55, 0xC56}, + {0xC58, 0xC5A}, + {0xC5C, 0xC5D}, + {0xC60, 0xC63}, + {0xC66, 0xC6F}, + {0xC80, 0xC83}, + {0xC85, 0xC8C}, + {0xC8E, 0xC90}, + {0xC92, 0xCA8}, + {0xCAA, 0xCB3}, + {0xCB5, 0xCB9}, + {0xCBC, 0xCC4}, + {0xCC6, 0xCC8}, + {0xCCA, 0xCCD}, + {0xCD5, 0xCD6}, + {0xCDC, 0xCDE}, + {0xCE0, 0xCE3}, + {0xCE6, 0xCEF}, + {0xCF1, 0xCF3}, + {0xD00, 0xD0C}, + {0xD0E, 0xD10}, + {0xD12, 0xD44}, + {0xD46, 0xD48}, + {0xD4A, 0xD4E}, + {0xD54, 0xD57}, + {0xD5F, 0xD63}, + {0xD66, 0xD6F}, + {0xD7A, 0xD7F}, + {0xD81, 0xD83}, + {0xD85, 0xD96}, + {0xD9A, 0xDB1}, + {0xDB3, 0xDBB}, + {0xDBD, 0xDBD}, + {0xDC0, 0xDC6}, + {0xDCA, 0xDCA}, + {0xDCF, 0xDD4}, + {0xDD6, 0xDD6}, + {0xDD8, 0xDDF}, + {0xDE6, 0xDEF}, + {0xDF2, 0xDF3}, + {0xE01, 0xE3A}, + {0xE40, 0xE4E}, + {0xE50, 0xE59}, + {0xE81, 0xE82}, + {0xE84, 0xE84}, + {0xE86, 0xE8A}, + {0xE8C, 0xEA3}, + {0xEA5, 0xEA5}, + {0xEA7, 0xEBD}, + {0xEC0, 0xEC4}, + {0xEC6, 0xEC6}, + {0xEC8, 0xECE}, + {0xED0, 0xED9}, + {0xEDC, 0xEDF}, + {0xF00, 0xF00}, + {0xF18, 0xF19}, + {0xF20, 0xF29}, + {0xF35, 0xF35}, + {0xF37, 0xF37}, + {0xF39, 0xF39}, + {0xF3E, 0xF47}, + {0xF49, 0xF6C}, + {0xF71, 0xF84}, + {0xF86, 0xF97}, + {0xF99, 0xFBC}, + {0xFC6, 0xFC6}, + {0x1000, 0x1049}, + {0x1050, 0x109D}, + {0x10A0, 0x10C5}, + {0x10C7, 0x10C7}, + {0x10CD, 0x10CD}, + {0x10D0, 0x10FA}, + {0x10FC, 0x1248}, + {0x124A, 0x124D}, + {0x1250, 0x1256}, + {0x1258, 0x1258}, + {0x125A, 0x125D}, + {0x1260, 0x1288}, + {0x128A, 0x128D}, + {0x1290, 0x12B0}, + {0x12B2, 0x12B5}, + {0x12B8, 0x12BE}, + {0x12C0, 0x12C0}, + {0x12C2, 0x12C5}, + {0x12C8, 0x12D6}, + {0x12D8, 0x1310}, + {0x1312, 0x1315}, + {0x1318, 0x135A}, + {0x135D, 0x135F}, + {0x1369, 0x1371}, + {0x1380, 0x138F}, + {0x13A0, 0x13F5}, + {0x13F8, 0x13FD}, + {0x1401, 0x166C}, + {0x166F, 0x167F}, + {0x1681, 0x169A}, + {0x16A0, 0x16EA}, + {0x16EE, 0x16F8}, + {0x1700, 0x1715}, + {0x171F, 0x1734}, + {0x1740, 0x1753}, + {0x1760, 0x176C}, + {0x176E, 0x1770}, + {0x1772, 0x1773}, + {0x1780, 0x17D3}, + {0x17D7, 0x17D7}, + {0x17DC, 0x17DD}, + {0x17E0, 0x17E9}, + {0x180B, 0x180D}, + {0x180F, 0x1819}, + {0x1820, 0x1878}, + {0x1880, 0x18AA}, + {0x18B0, 0x18F5}, + {0x1900, 0x191E}, + {0x1920, 0x192B}, + {0x1930, 0x193B}, + {0x1946, 0x196D}, + {0x1970, 0x1974}, + {0x1980, 0x19AB}, + {0x19B0, 0x19C9}, + {0x19D0, 0x19DA}, + {0x1A00, 0x1A1B}, + {0x1A20, 0x1A5E}, + {0x1A60, 0x1A7C}, + {0x1A7F, 0x1A89}, + {0x1A90, 0x1A99}, + {0x1AA7, 0x1AA7}, + {0x1AB0, 0x1ABD}, + {0x1ABF, 0x1ADD}, + {0x1AE0, 0x1AEB}, + {0x1B00, 0x1B4C}, + {0x1B50, 0x1B59}, + {0x1B6B, 0x1B73}, + {0x1B80, 0x1BF3}, + {0x1C00, 0x1C37}, + {0x1C40, 0x1C49}, + {0x1C4D, 0x1C7D}, + {0x1C80, 0x1C8A}, + {0x1C90, 0x1CBA}, + {0x1CBD, 0x1CBF}, + {0x1CD0, 0x1CD2}, + {0x1CD4, 0x1CFA}, + {0x1D00, 0x1F15}, + {0x1F18, 0x1F1D}, + {0x1F20, 0x1F45}, + {0x1F48, 0x1F4D}, + {0x1F50, 0x1F57}, + {0x1F59, 0x1F59}, + {0x1F5B, 0x1F5B}, + {0x1F5D, 0x1F5D}, + {0x1F5F, 0x1F7D}, + {0x1F80, 0x1FB4}, + {0x1FB6, 0x1FBC}, + {0x1FBE, 0x1FBE}, + {0x1FC2, 0x1FC4}, + {0x1FC6, 0x1FCC}, + {0x1FD0, 0x1FD3}, + {0x1FD6, 0x1FDB}, + {0x1FE0, 0x1FEC}, + {0x1FF2, 0x1FF4}, + {0x1FF6, 0x1FFC}, + {0x200C, 0x200D}, + {0x203F, 0x2040}, + {0x2054, 0x2054}, + {0x2071, 0x2071}, + {0x207F, 0x207F}, + {0x2090, 0x209C}, + {0x20D0, 0x20DC}, + {0x20E1, 0x20E1}, + {0x20E5, 0x20F0}, + {0x2102, 0x2102}, + {0x2107, 0x2107}, + {0x210A, 0x2113}, + {0x2115, 0x2115}, + {0x2118, 0x211D}, + {0x2124, 0x2124}, + {0x2126, 0x2126}, + {0x2128, 0x2128}, + {0x212A, 0x2139}, + {0x213C, 0x213F}, + {0x2145, 0x2149}, + {0x214E, 0x214E}, + {0x2160, 0x2188}, + {0x2C00, 0x2CE4}, + {0x2CEB, 0x2CF3}, + {0x2D00, 0x2D25}, + {0x2D27, 0x2D27}, + {0x2D2D, 0x2D2D}, + {0x2D30, 0x2D67}, + {0x2D6F, 0x2D6F}, + {0x2D7F, 0x2D96}, + {0x2DA0, 0x2DA6}, + {0x2DA8, 0x2DAE}, + {0x2DB0, 0x2DB6}, + {0x2DB8, 0x2DBE}, + {0x2DC0, 0x2DC6}, + {0x2DC8, 0x2DCE}, + {0x2DD0, 0x2DD6}, + {0x2DD8, 0x2DDE}, + {0x2DE0, 0x2DFF}, + {0x3005, 0x3007}, + {0x3021, 0x302F}, + {0x3031, 0x3035}, + {0x3038, 0x303C}, + {0x3041, 0x3096}, + {0x3099, 0x309F}, + {0x30A1, 0x30FF}, + {0x3105, 0x312F}, + {0x3131, 0x318E}, + {0x31A0, 0x31BF}, + {0x31F0, 0x31FF}, + {0x3400, 0x4DBF}, + {0x4E00, 0xA48C}, + {0xA4D0, 0xA4FD}, + {0xA500, 0xA60C}, + {0xA610, 0xA62B}, + {0xA640, 0xA66F}, + {0xA674, 0xA67D}, + {0xA67F, 0xA6F1}, + {0xA717, 0xA71F}, + {0xA722, 0xA788}, + {0xA78B, 0xA7DC}, + {0xA7F1, 0xA827}, + {0xA82C, 0xA82C}, + {0xA840, 0xA873}, + {0xA880, 0xA8C5}, + {0xA8D0, 0xA8D9}, + {0xA8E0, 0xA8F7}, + {0xA8FB, 0xA8FB}, + {0xA8FD, 0xA92D}, + {0xA930, 0xA953}, + {0xA960, 0xA97C}, + {0xA980, 0xA9C0}, + {0xA9CF, 0xA9D9}, + {0xA9E0, 0xA9FE}, + {0xAA00, 0xAA36}, + {0xAA40, 0xAA4D}, + {0xAA50, 0xAA59}, + {0xAA60, 0xAA76}, + {0xAA7A, 0xAAC2}, + {0xAADB, 0xAADD}, + {0xAAE0, 0xAAEF}, + {0xAAF2, 0xAAF6}, + {0xAB01, 0xAB06}, + {0xAB09, 0xAB0E}, + {0xAB11, 0xAB16}, + {0xAB20, 0xAB26}, + {0xAB28, 0xAB2E}, + {0xAB30, 0xAB5A}, + {0xAB5C, 0xAB69}, + {0xAB70, 0xABEA}, + {0xABEC, 0xABED}, + {0xABF0, 0xABF9}, + {0xAC00, 0xD7A3}, + {0xD7B0, 0xD7C6}, + {0xD7CB, 0xD7FB}, + {0xF900, 0xFA6D}, + {0xFA70, 0xFAD9}, + {0xFB00, 0xFB06}, + {0xFB13, 0xFB17}, + {0xFB1D, 0xFB28}, + {0xFB2A, 0xFB36}, + {0xFB38, 0xFB3C}, + {0xFB3E, 0xFB3E}, + {0xFB40, 0xFB41}, + {0xFB43, 0xFB44}, + {0xFB46, 0xFBB1}, + {0xFBD3, 0xFD3D}, + {0xFD50, 0xFD8F}, + {0xFD92, 0xFDC7}, + {0xFDF0, 0xFDFB}, + {0xFE00, 0xFE0F}, + {0xFE20, 0xFE2F}, + {0xFE33, 0xFE34}, + {0xFE4D, 0xFE4F}, + {0xFE70, 0xFE74}, + {0xFE76, 0xFEFC}, + {0xFF10, 0xFF19}, + {0xFF21, 0xFF3A}, + {0xFF3F, 0xFF3F}, + {0xFF41, 0xFF5A}, + {0xFF65, 0xFFBE}, + {0xFFC2, 0xFFC7}, + {0xFFCA, 0xFFCF}, + {0xFFD2, 0xFFD7}, + {0xFFDA, 0xFFDC}, + {0x10000, 0x1000B}, + {0x1000D, 0x10026}, + {0x10028, 0x1003A}, + {0x1003C, 0x1003D}, + {0x1003F, 0x1004D}, + {0x10050, 0x1005D}, + {0x10080, 0x100FA}, + {0x10140, 0x10174}, + {0x101FD, 0x101FD}, + {0x10280, 0x1029C}, + {0x102A0, 0x102D0}, + {0x102E0, 0x102E0}, + {0x10300, 0x1031F}, + {0x1032D, 0x1034A}, + {0x10350, 0x1037A}, + {0x10380, 0x1039D}, + {0x103A0, 0x103C3}, + {0x103C8, 0x103CF}, + {0x103D1, 0x103D5}, + {0x10400, 0x1049D}, + {0x104A0, 0x104A9}, + {0x104B0, 0x104D3}, + {0x104D8, 0x104FB}, + {0x10500, 0x10527}, + {0x10530, 0x10563}, + {0x10570, 0x1057A}, + {0x1057C, 0x1058A}, + {0x1058C, 0x10592}, + {0x10594, 0x10595}, + {0x10597, 0x105A1}, + {0x105A3, 0x105B1}, + {0x105B3, 0x105B9}, + {0x105BB, 0x105BC}, + {0x105C0, 0x105F3}, + {0x10600, 0x10736}, + {0x10740, 0x10755}, + {0x10760, 0x10767}, + {0x10780, 0x10785}, + {0x10787, 0x107B0}, + {0x107B2, 0x107BA}, + {0x10800, 0x10805}, + {0x10808, 0x10808}, + {0x1080A, 0x10835}, + {0x10837, 0x10838}, + {0x1083C, 0x1083C}, + {0x1083F, 0x10855}, + {0x10860, 0x10876}, + {0x10880, 0x1089E}, + {0x108E0, 0x108F2}, + {0x108F4, 0x108F5}, + {0x10900, 0x10915}, + {0x10920, 0x10939}, + {0x10940, 0x10959}, + {0x10980, 0x109B7}, + {0x109BE, 0x109BF}, + {0x10A00, 0x10A03}, + {0x10A05, 0x10A06}, + {0x10A0C, 0x10A13}, + {0x10A15, 0x10A17}, + {0x10A19, 0x10A35}, + {0x10A38, 0x10A3A}, + {0x10A3F, 0x10A3F}, + {0x10A60, 0x10A7C}, + {0x10A80, 0x10A9C}, + {0x10AC0, 0x10AC7}, + {0x10AC9, 0x10AE6}, + {0x10B00, 0x10B35}, + {0x10B40, 0x10B55}, + {0x10B60, 0x10B72}, + {0x10B80, 0x10B91}, + {0x10C00, 0x10C48}, + {0x10C80, 0x10CB2}, + {0x10CC0, 0x10CF2}, + {0x10D00, 0x10D27}, + {0x10D30, 0x10D39}, + {0x10D40, 0x10D65}, + {0x10D69, 0x10D6D}, + {0x10D6F, 0x10D85}, + {0x10E80, 0x10EA9}, + {0x10EAB, 0x10EAC}, + {0x10EB0, 0x10EB1}, + {0x10EC2, 0x10EC7}, + {0x10EFA, 0x10F1C}, + {0x10F27, 0x10F27}, + {0x10F30, 0x10F50}, + {0x10F70, 0x10F85}, + {0x10FB0, 0x10FC4}, + {0x10FE0, 0x10FF6}, + {0x11000, 0x11046}, + {0x11066, 0x11075}, + {0x1107F, 0x110BA}, + {0x110C2, 0x110C2}, + {0x110D0, 0x110E8}, + {0x110F0, 0x110F9}, + {0x11100, 0x11134}, + {0x11136, 0x1113F}, + {0x11144, 0x11147}, + {0x11150, 0x11173}, + {0x11176, 0x11176}, + {0x11180, 0x111C4}, + {0x111C9, 0x111CC}, + {0x111CE, 0x111DA}, + {0x111DC, 0x111DC}, + {0x11200, 0x11211}, + {0x11213, 0x11237}, + {0x1123E, 0x11241}, + {0x11280, 0x11286}, + {0x11288, 0x11288}, + {0x1128A, 0x1128D}, + {0x1128F, 0x1129D}, + {0x1129F, 0x112A8}, + {0x112B0, 0x112EA}, + {0x112F0, 0x112F9}, + {0x11300, 0x11303}, + {0x11305, 0x1130C}, + {0x1130F, 0x11310}, + {0x11313, 0x11328}, + {0x1132A, 0x11330}, + {0x11332, 0x11333}, + {0x11335, 0x11339}, + {0x1133B, 0x11344}, + {0x11347, 0x11348}, + {0x1134B, 0x1134D}, + {0x11350, 0x11350}, + {0x11357, 0x11357}, + {0x1135D, 0x11363}, + {0x11366, 0x1136C}, + {0x11370, 0x11374}, + {0x11380, 0x11389}, + {0x1138B, 0x1138B}, + {0x1138E, 0x1138E}, + {0x11390, 0x113B5}, + {0x113B7, 0x113C0}, + {0x113C2, 0x113C2}, + {0x113C5, 0x113C5}, + {0x113C7, 0x113CA}, + {0x113CC, 0x113D3}, + {0x113E1, 0x113E2}, + {0x11400, 0x1144A}, + {0x11450, 0x11459}, + {0x1145E, 0x11461}, + {0x11480, 0x114C5}, + {0x114C7, 0x114C7}, + {0x114D0, 0x114D9}, + {0x11580, 0x115B5}, + {0x115B8, 0x115C0}, + {0x115D8, 0x115DD}, + {0x11600, 0x11640}, + {0x11644, 0x11644}, + {0x11650, 0x11659}, + {0x11680, 0x116B8}, + {0x116C0, 0x116C9}, + {0x116D0, 0x116E3}, + {0x11700, 0x1171A}, + {0x1171D, 0x1172B}, + {0x11730, 0x11739}, + {0x11740, 0x11746}, + {0x11800, 0x1183A}, + {0x118A0, 0x118E9}, + {0x118FF, 0x11906}, + {0x11909, 0x11909}, + {0x1190C, 0x11913}, + {0x11915, 0x11916}, + {0x11918, 0x11935}, + {0x11937, 0x11938}, + {0x1193B, 0x11943}, + {0x11950, 0x11959}, + {0x119A0, 0x119A7}, + {0x119AA, 0x119D7}, + {0x119DA, 0x119E1}, + {0x119E3, 0x119E4}, + {0x11A00, 0x11A3E}, + {0x11A47, 0x11A47}, + {0x11A50, 0x11A99}, + {0x11A9D, 0x11A9D}, + {0x11AB0, 0x11AF8}, + {0x11B60, 0x11B67}, + {0x11BC0, 0x11BE0}, + {0x11BF0, 0x11BF9}, + {0x11C00, 0x11C08}, + {0x11C0A, 0x11C36}, + {0x11C38, 0x11C40}, + {0x11C50, 0x11C59}, + {0x11C72, 0x11C8F}, + {0x11C92, 0x11CA7}, + {0x11CA9, 0x11CB6}, + {0x11D00, 0x11D06}, + {0x11D08, 0x11D09}, + {0x11D0B, 0x11D36}, + {0x11D3A, 0x11D3A}, + {0x11D3C, 0x11D3D}, + {0x11D3F, 0x11D47}, + {0x11D50, 0x11D59}, + {0x11D60, 0x11D65}, + {0x11D67, 0x11D68}, + {0x11D6A, 0x11D8E}, + {0x11D90, 0x11D91}, + {0x11D93, 0x11D98}, + {0x11DA0, 0x11DA9}, + {0x11DB0, 0x11DDB}, + {0x11DE0, 0x11DE9}, + {0x11EE0, 0x11EF6}, + {0x11F00, 0x11F10}, + {0x11F12, 0x11F3A}, + {0x11F3E, 0x11F42}, + {0x11F50, 0x11F5A}, + {0x11FB0, 0x11FB0}, + {0x12000, 0x12399}, + {0x12400, 0x1246E}, + {0x12480, 0x12543}, + {0x12F90, 0x12FF0}, + {0x13000, 0x1342F}, + {0x13440, 0x13455}, + {0x13460, 0x143FA}, + {0x14400, 0x14646}, + {0x16100, 0x16139}, + {0x16800, 0x16A38}, + {0x16A40, 0x16A5E}, + {0x16A60, 0x16A69}, + {0x16A70, 0x16ABE}, + {0x16AC0, 0x16AC9}, + {0x16AD0, 0x16AED}, + {0x16AF0, 0x16AF4}, + {0x16B00, 0x16B36}, + {0x16B40, 0x16B43}, + {0x16B50, 0x16B59}, + {0x16B63, 0x16B77}, + {0x16B7D, 0x16B8F}, + {0x16D40, 0x16D6C}, + {0x16D70, 0x16D79}, + {0x16E40, 0x16E7F}, + {0x16EA0, 0x16EB8}, + {0x16EBB, 0x16ED3}, + {0x16F00, 0x16F4A}, + {0x16F4F, 0x16F87}, + {0x16F8F, 0x16F9F}, + {0x16FE0, 0x16FE1}, + {0x16FE3, 0x16FE4}, + {0x16FF0, 0x16FF6}, + {0x17000, 0x18CD5}, + {0x18CFF, 0x18D1E}, + {0x18D80, 0x18DF2}, + {0x1AFF0, 0x1AFF3}, + {0x1AFF5, 0x1AFFB}, + {0x1AFFD, 0x1AFFE}, + {0x1B000, 0x1B122}, + {0x1B132, 0x1B132}, + {0x1B150, 0x1B152}, + {0x1B155, 0x1B155}, + {0x1B164, 0x1B167}, + {0x1B170, 0x1B2FB}, + {0x1BC00, 0x1BC6A}, + {0x1BC70, 0x1BC7C}, + {0x1BC80, 0x1BC88}, + {0x1BC90, 0x1BC99}, + {0x1BC9D, 0x1BC9E}, + {0x1CCF0, 0x1CCF9}, + {0x1CF00, 0x1CF2D}, + {0x1CF30, 0x1CF46}, + {0x1D165, 0x1D169}, + {0x1D16D, 0x1D172}, + {0x1D17B, 0x1D182}, + {0x1D185, 0x1D18B}, + {0x1D1AA, 0x1D1AD}, + {0x1D242, 0x1D244}, + {0x1D400, 0x1D454}, + {0x1D456, 0x1D49C}, + {0x1D49E, 0x1D49F}, + {0x1D4A2, 0x1D4A2}, + {0x1D4A5, 0x1D4A6}, + {0x1D4A9, 0x1D4AC}, + {0x1D4AE, 0x1D4B9}, + {0x1D4BB, 0x1D4BB}, + {0x1D4BD, 0x1D4C3}, + {0x1D4C5, 0x1D505}, + {0x1D507, 0x1D50A}, + {0x1D50D, 0x1D514}, + {0x1D516, 0x1D51C}, + {0x1D51E, 0x1D539}, + {0x1D53B, 0x1D53E}, + {0x1D540, 0x1D544}, + {0x1D546, 0x1D546}, + {0x1D54A, 0x1D550}, + {0x1D552, 0x1D6A5}, + {0x1D6A8, 0x1D6C0}, + {0x1D6C2, 0x1D6DA}, + {0x1D6DC, 0x1D6FA}, + {0x1D6FC, 0x1D714}, + {0x1D716, 0x1D734}, + {0x1D736, 0x1D74E}, + {0x1D750, 0x1D76E}, + {0x1D770, 0x1D788}, + {0x1D78A, 0x1D7A8}, + {0x1D7AA, 0x1D7C2}, + {0x1D7C4, 0x1D7CB}, + {0x1D7CE, 0x1D7FF}, + {0x1DA00, 0x1DA36}, + {0x1DA3B, 0x1DA6C}, + {0x1DA75, 0x1DA75}, + {0x1DA84, 0x1DA84}, + {0x1DA9B, 0x1DA9F}, + {0x1DAA1, 0x1DAAF}, + {0x1DF00, 0x1DF1E}, + {0x1DF25, 0x1DF2A}, + {0x1E000, 0x1E006}, + {0x1E008, 0x1E018}, + {0x1E01B, 0x1E021}, + {0x1E023, 0x1E024}, + {0x1E026, 0x1E02A}, + {0x1E030, 0x1E06D}, + {0x1E08F, 0x1E08F}, + {0x1E100, 0x1E12C}, + {0x1E130, 0x1E13D}, + {0x1E140, 0x1E149}, + {0x1E14E, 0x1E14E}, + {0x1E290, 0x1E2AE}, + {0x1E2C0, 0x1E2F9}, + {0x1E4D0, 0x1E4F9}, + {0x1E5D0, 0x1E5FA}, + {0x1E6C0, 0x1E6DE}, + {0x1E6E0, 0x1E6F5}, + {0x1E6FE, 0x1E6FF}, + {0x1E7E0, 0x1E7E6}, + {0x1E7E8, 0x1E7EB}, + {0x1E7ED, 0x1E7EE}, + {0x1E7F0, 0x1E7FE}, + {0x1E800, 0x1E8C4}, + {0x1E8D0, 0x1E8D6}, + {0x1E900, 0x1E94B}, + {0x1E950, 0x1E959}, + {0x1EE00, 0x1EE03}, + {0x1EE05, 0x1EE1F}, + {0x1EE21, 0x1EE22}, + {0x1EE24, 0x1EE24}, + {0x1EE27, 0x1EE27}, + {0x1EE29, 0x1EE32}, + {0x1EE34, 0x1EE37}, + {0x1EE39, 0x1EE39}, + {0x1EE3B, 0x1EE3B}, + {0x1EE42, 0x1EE42}, + {0x1EE47, 0x1EE47}, + {0x1EE49, 0x1EE49}, + {0x1EE4B, 0x1EE4B}, + {0x1EE4D, 0x1EE4F}, + {0x1EE51, 0x1EE52}, + {0x1EE54, 0x1EE54}, + {0x1EE57, 0x1EE57}, + {0x1EE59, 0x1EE59}, + {0x1EE5B, 0x1EE5B}, + {0x1EE5D, 0x1EE5D}, + {0x1EE5F, 0x1EE5F}, + {0x1EE61, 0x1EE62}, + {0x1EE64, 0x1EE64}, + {0x1EE67, 0x1EE6A}, + {0x1EE6C, 0x1EE72}, + {0x1EE74, 0x1EE77}, + {0x1EE79, 0x1EE7C}, + {0x1EE7E, 0x1EE7E}, + {0x1EE80, 0x1EE89}, + {0x1EE8B, 0x1EE9B}, + {0x1EEA1, 0x1EEA3}, + {0x1EEA5, 0x1EEA9}, + {0x1EEAB, 0x1EEBB}, + {0x1FBF0, 0x1FBF9}, + {0x20000, 0x2A6DF}, + {0x2A700, 0x2B81D}, + {0x2B820, 0x2CEAD}, + {0x2CEB0, 0x2EBE0}, + {0x2EBF0, 0x2EE5D}, + {0x2F800, 0x2FA1D}, + {0x30000, 0x3134A}, + {0x31350, 0x33479}, + {0xE0100, 0xE01EF}, + }, + "ID_Start": { + {0x41, 0x5A}, + {0x61, 0x7A}, + {0xAA, 0xAA}, + {0xB5, 0xB5}, + {0xBA, 0xBA}, + {0xC0, 0xD6}, + {0xD8, 0xF6}, + {0xF8, 0x2C1}, + {0x2C6, 0x2D1}, + {0x2E0, 0x2E4}, + {0x2EC, 0x2EC}, + {0x2EE, 0x2EE}, + {0x370, 0x374}, + {0x376, 0x377}, + {0x37A, 0x37D}, + {0x37F, 0x37F}, + {0x386, 0x386}, + {0x388, 0x38A}, + {0x38C, 0x38C}, + {0x38E, 0x3A1}, + {0x3A3, 0x3F5}, + {0x3F7, 0x481}, + {0x48A, 0x52F}, + {0x531, 0x556}, + {0x559, 0x559}, + {0x560, 0x588}, + {0x5D0, 0x5EA}, + {0x5EF, 0x5F2}, + {0x620, 0x64A}, + {0x66E, 0x66F}, + {0x671, 0x6D3}, + {0x6D5, 0x6D5}, + {0x6E5, 0x6E6}, + {0x6EE, 0x6EF}, + {0x6FA, 0x6FC}, + {0x6FF, 0x6FF}, + {0x710, 0x710}, + {0x712, 0x72F}, + {0x74D, 0x7A5}, + {0x7B1, 0x7B1}, + {0x7CA, 0x7EA}, + {0x7F4, 0x7F5}, + {0x7FA, 0x7FA}, + {0x800, 0x815}, + {0x81A, 0x81A}, + {0x824, 0x824}, + {0x828, 0x828}, + {0x840, 0x858}, + {0x860, 0x86A}, + {0x870, 0x887}, + {0x889, 0x88F}, + {0x8A0, 0x8C9}, + {0x904, 0x939}, + {0x93D, 0x93D}, + {0x950, 0x950}, + {0x958, 0x961}, + {0x971, 0x980}, + {0x985, 0x98C}, + {0x98F, 0x990}, + {0x993, 0x9A8}, + {0x9AA, 0x9B0}, + {0x9B2, 0x9B2}, + {0x9B6, 0x9B9}, + {0x9BD, 0x9BD}, + {0x9CE, 0x9CE}, + {0x9DC, 0x9DD}, + {0x9DF, 0x9E1}, + {0x9F0, 0x9F1}, + {0x9FC, 0x9FC}, + {0xA05, 0xA0A}, + {0xA0F, 0xA10}, + {0xA13, 0xA28}, + {0xA2A, 0xA30}, + {0xA32, 0xA33}, + {0xA35, 0xA36}, + {0xA38, 0xA39}, + {0xA59, 0xA5C}, + {0xA5E, 0xA5E}, + {0xA72, 0xA74}, + {0xA85, 0xA8D}, + {0xA8F, 0xA91}, + {0xA93, 0xAA8}, + {0xAAA, 0xAB0}, + {0xAB2, 0xAB3}, + {0xAB5, 0xAB9}, + {0xABD, 0xABD}, + {0xAD0, 0xAD0}, + {0xAE0, 0xAE1}, + {0xAF9, 0xAF9}, + {0xB05, 0xB0C}, + {0xB0F, 0xB10}, + {0xB13, 0xB28}, + {0xB2A, 0xB30}, + {0xB32, 0xB33}, + {0xB35, 0xB39}, + {0xB3D, 0xB3D}, + {0xB5C, 0xB5D}, + {0xB5F, 0xB61}, + {0xB71, 0xB71}, + {0xB83, 0xB83}, + {0xB85, 0xB8A}, + {0xB8E, 0xB90}, + {0xB92, 0xB95}, + {0xB99, 0xB9A}, + {0xB9C, 0xB9C}, + {0xB9E, 0xB9F}, + {0xBA3, 0xBA4}, + {0xBA8, 0xBAA}, + {0xBAE, 0xBB9}, + {0xBD0, 0xBD0}, + {0xC05, 0xC0C}, + {0xC0E, 0xC10}, + {0xC12, 0xC28}, + {0xC2A, 0xC39}, + {0xC3D, 0xC3D}, + {0xC58, 0xC5A}, + {0xC5C, 0xC5D}, + {0xC60, 0xC61}, + {0xC80, 0xC80}, + {0xC85, 0xC8C}, + {0xC8E, 0xC90}, + {0xC92, 0xCA8}, + {0xCAA, 0xCB3}, + {0xCB5, 0xCB9}, + {0xCBD, 0xCBD}, + {0xCDC, 0xCDE}, + {0xCE0, 0xCE1}, + {0xCF1, 0xCF2}, + {0xD04, 0xD0C}, + {0xD0E, 0xD10}, + {0xD12, 0xD3A}, + {0xD3D, 0xD3D}, + {0xD4E, 0xD4E}, + {0xD54, 0xD56}, + {0xD5F, 0xD61}, + {0xD7A, 0xD7F}, + {0xD85, 0xD96}, + {0xD9A, 0xDB1}, + {0xDB3, 0xDBB}, + {0xDBD, 0xDBD}, + {0xDC0, 0xDC6}, + {0xE01, 0xE30}, + {0xE32, 0xE33}, + {0xE40, 0xE46}, + {0xE81, 0xE82}, + {0xE84, 0xE84}, + {0xE86, 0xE8A}, + {0xE8C, 0xEA3}, + {0xEA5, 0xEA5}, + {0xEA7, 0xEB0}, + {0xEB2, 0xEB3}, + {0xEBD, 0xEBD}, + {0xEC0, 0xEC4}, + {0xEC6, 0xEC6}, + {0xEDC, 0xEDF}, + {0xF00, 0xF00}, + {0xF40, 0xF47}, + {0xF49, 0xF6C}, + {0xF88, 0xF8C}, + {0x1000, 0x102A}, + {0x103F, 0x103F}, + {0x1050, 0x1055}, + {0x105A, 0x105D}, + {0x1061, 0x1061}, + {0x1065, 0x1066}, + {0x106E, 0x1070}, + {0x1075, 0x1081}, + {0x108E, 0x108E}, + {0x10A0, 0x10C5}, + {0x10C7, 0x10C7}, + {0x10CD, 0x10CD}, + {0x10D0, 0x10FA}, + {0x10FC, 0x1248}, + {0x124A, 0x124D}, + {0x1250, 0x1256}, + {0x1258, 0x1258}, + {0x125A, 0x125D}, + {0x1260, 0x1288}, + {0x128A, 0x128D}, + {0x1290, 0x12B0}, + {0x12B2, 0x12B5}, + {0x12B8, 0x12BE}, + {0x12C0, 0x12C0}, + {0x12C2, 0x12C5}, + {0x12C8, 0x12D6}, + {0x12D8, 0x1310}, + {0x1312, 0x1315}, + {0x1318, 0x135A}, + {0x1380, 0x138F}, + {0x13A0, 0x13F5}, + {0x13F8, 0x13FD}, + {0x1401, 0x166C}, + {0x166F, 0x167F}, + {0x1681, 0x169A}, + {0x16A0, 0x16EA}, + {0x16EE, 0x16F8}, + {0x1700, 0x1711}, + {0x171F, 0x1731}, + {0x1740, 0x1751}, + {0x1760, 0x176C}, + {0x176E, 0x1770}, + {0x1780, 0x17B3}, + {0x17D7, 0x17D7}, + {0x17DC, 0x17DC}, + {0x1820, 0x1878}, + {0x1880, 0x18A8}, + {0x18AA, 0x18AA}, + {0x18B0, 0x18F5}, + {0x1900, 0x191E}, + {0x1950, 0x196D}, + {0x1970, 0x1974}, + {0x1980, 0x19AB}, + {0x19B0, 0x19C9}, + {0x1A00, 0x1A16}, + {0x1A20, 0x1A54}, + {0x1AA7, 0x1AA7}, + {0x1B05, 0x1B33}, + {0x1B45, 0x1B4C}, + {0x1B83, 0x1BA0}, + {0x1BAE, 0x1BAF}, + {0x1BBA, 0x1BE5}, + {0x1C00, 0x1C23}, + {0x1C4D, 0x1C4F}, + {0x1C5A, 0x1C7D}, + {0x1C80, 0x1C8A}, + {0x1C90, 0x1CBA}, + {0x1CBD, 0x1CBF}, + {0x1CE9, 0x1CEC}, + {0x1CEE, 0x1CF3}, + {0x1CF5, 0x1CF6}, + {0x1CFA, 0x1CFA}, + {0x1D00, 0x1DBF}, + {0x1E00, 0x1F15}, + {0x1F18, 0x1F1D}, + {0x1F20, 0x1F45}, + {0x1F48, 0x1F4D}, + {0x1F50, 0x1F57}, + {0x1F59, 0x1F59}, + {0x1F5B, 0x1F5B}, + {0x1F5D, 0x1F5D}, + {0x1F5F, 0x1F7D}, + {0x1F80, 0x1FB4}, + {0x1FB6, 0x1FBC}, + {0x1FBE, 0x1FBE}, + {0x1FC2, 0x1FC4}, + {0x1FC6, 0x1FCC}, + {0x1FD0, 0x1FD3}, + {0x1FD6, 0x1FDB}, + {0x1FE0, 0x1FEC}, + {0x1FF2, 0x1FF4}, + {0x1FF6, 0x1FFC}, + {0x2071, 0x2071}, + {0x207F, 0x207F}, + {0x2090, 0x209C}, + {0x2102, 0x2102}, + {0x2107, 0x2107}, + {0x210A, 0x2113}, + {0x2115, 0x2115}, + {0x2118, 0x211D}, + {0x2124, 0x2124}, + {0x2126, 0x2126}, + {0x2128, 0x2128}, + {0x212A, 0x2139}, + {0x213C, 0x213F}, + {0x2145, 0x2149}, + {0x214E, 0x214E}, + {0x2160, 0x2188}, + {0x2C00, 0x2CE4}, + {0x2CEB, 0x2CEE}, + {0x2CF2, 0x2CF3}, + {0x2D00, 0x2D25}, + {0x2D27, 0x2D27}, + {0x2D2D, 0x2D2D}, + {0x2D30, 0x2D67}, + {0x2D6F, 0x2D6F}, + {0x2D80, 0x2D96}, + {0x2DA0, 0x2DA6}, + {0x2DA8, 0x2DAE}, + {0x2DB0, 0x2DB6}, + {0x2DB8, 0x2DBE}, + {0x2DC0, 0x2DC6}, + {0x2DC8, 0x2DCE}, + {0x2DD0, 0x2DD6}, + {0x2DD8, 0x2DDE}, + {0x3005, 0x3007}, + {0x3021, 0x3029}, + {0x3031, 0x3035}, + {0x3038, 0x303C}, + {0x3041, 0x3096}, + {0x309B, 0x309F}, + {0x30A1, 0x30FA}, + {0x30FC, 0x30FF}, + {0x3105, 0x312F}, + {0x3131, 0x318E}, + {0x31A0, 0x31BF}, + {0x31F0, 0x31FF}, + {0x3400, 0x4DBF}, + {0x4E00, 0xA48C}, + {0xA4D0, 0xA4FD}, + {0xA500, 0xA60C}, + {0xA610, 0xA61F}, + {0xA62A, 0xA62B}, + {0xA640, 0xA66E}, + {0xA67F, 0xA69D}, + {0xA6A0, 0xA6EF}, + {0xA717, 0xA71F}, + {0xA722, 0xA788}, + {0xA78B, 0xA7DC}, + {0xA7F1, 0xA801}, + {0xA803, 0xA805}, + {0xA807, 0xA80A}, + {0xA80C, 0xA822}, + {0xA840, 0xA873}, + {0xA882, 0xA8B3}, + {0xA8F2, 0xA8F7}, + {0xA8FB, 0xA8FB}, + {0xA8FD, 0xA8FE}, + {0xA90A, 0xA925}, + {0xA930, 0xA946}, + {0xA960, 0xA97C}, + {0xA984, 0xA9B2}, + {0xA9CF, 0xA9CF}, + {0xA9E0, 0xA9E4}, + {0xA9E6, 0xA9EF}, + {0xA9FA, 0xA9FE}, + {0xAA00, 0xAA28}, + {0xAA40, 0xAA42}, + {0xAA44, 0xAA4B}, + {0xAA60, 0xAA76}, + {0xAA7A, 0xAA7A}, + {0xAA7E, 0xAAAF}, + {0xAAB1, 0xAAB1}, + {0xAAB5, 0xAAB6}, + {0xAAB9, 0xAABD}, + {0xAAC0, 0xAAC0}, + {0xAAC2, 0xAAC2}, + {0xAADB, 0xAADD}, + {0xAAE0, 0xAAEA}, + {0xAAF2, 0xAAF4}, + {0xAB01, 0xAB06}, + {0xAB09, 0xAB0E}, + {0xAB11, 0xAB16}, + {0xAB20, 0xAB26}, + {0xAB28, 0xAB2E}, + {0xAB30, 0xAB5A}, + {0xAB5C, 0xAB69}, + {0xAB70, 0xABE2}, + {0xAC00, 0xD7A3}, + {0xD7B0, 0xD7C6}, + {0xD7CB, 0xD7FB}, + {0xF900, 0xFA6D}, + {0xFA70, 0xFAD9}, + {0xFB00, 0xFB06}, + {0xFB13, 0xFB17}, + {0xFB1D, 0xFB1D}, + {0xFB1F, 0xFB28}, + {0xFB2A, 0xFB36}, + {0xFB38, 0xFB3C}, + {0xFB3E, 0xFB3E}, + {0xFB40, 0xFB41}, + {0xFB43, 0xFB44}, + {0xFB46, 0xFBB1}, + {0xFBD3, 0xFD3D}, + {0xFD50, 0xFD8F}, + {0xFD92, 0xFDC7}, + {0xFDF0, 0xFDFB}, + {0xFE70, 0xFE74}, + {0xFE76, 0xFEFC}, + {0xFF21, 0xFF3A}, + {0xFF41, 0xFF5A}, + {0xFF66, 0xFFBE}, + {0xFFC2, 0xFFC7}, + {0xFFCA, 0xFFCF}, + {0xFFD2, 0xFFD7}, + {0xFFDA, 0xFFDC}, + {0x10000, 0x1000B}, + {0x1000D, 0x10026}, + {0x10028, 0x1003A}, + {0x1003C, 0x1003D}, + {0x1003F, 0x1004D}, + {0x10050, 0x1005D}, + {0x10080, 0x100FA}, + {0x10140, 0x10174}, + {0x10280, 0x1029C}, + {0x102A0, 0x102D0}, + {0x10300, 0x1031F}, + {0x1032D, 0x1034A}, + {0x10350, 0x10375}, + {0x10380, 0x1039D}, + {0x103A0, 0x103C3}, + {0x103C8, 0x103CF}, + {0x103D1, 0x103D5}, + {0x10400, 0x1049D}, + {0x104B0, 0x104D3}, + {0x104D8, 0x104FB}, + {0x10500, 0x10527}, + {0x10530, 0x10563}, + {0x10570, 0x1057A}, + {0x1057C, 0x1058A}, + {0x1058C, 0x10592}, + {0x10594, 0x10595}, + {0x10597, 0x105A1}, + {0x105A3, 0x105B1}, + {0x105B3, 0x105B9}, + {0x105BB, 0x105BC}, + {0x105C0, 0x105F3}, + {0x10600, 0x10736}, + {0x10740, 0x10755}, + {0x10760, 0x10767}, + {0x10780, 0x10785}, + {0x10787, 0x107B0}, + {0x107B2, 0x107BA}, + {0x10800, 0x10805}, + {0x10808, 0x10808}, + {0x1080A, 0x10835}, + {0x10837, 0x10838}, + {0x1083C, 0x1083C}, + {0x1083F, 0x10855}, + {0x10860, 0x10876}, + {0x10880, 0x1089E}, + {0x108E0, 0x108F2}, + {0x108F4, 0x108F5}, + {0x10900, 0x10915}, + {0x10920, 0x10939}, + {0x10940, 0x10959}, + {0x10980, 0x109B7}, + {0x109BE, 0x109BF}, + {0x10A00, 0x10A00}, + {0x10A10, 0x10A13}, + {0x10A15, 0x10A17}, + {0x10A19, 0x10A35}, + {0x10A60, 0x10A7C}, + {0x10A80, 0x10A9C}, + {0x10AC0, 0x10AC7}, + {0x10AC9, 0x10AE4}, + {0x10B00, 0x10B35}, + {0x10B40, 0x10B55}, + {0x10B60, 0x10B72}, + {0x10B80, 0x10B91}, + {0x10C00, 0x10C48}, + {0x10C80, 0x10CB2}, + {0x10CC0, 0x10CF2}, + {0x10D00, 0x10D23}, + {0x10D4A, 0x10D65}, + {0x10D6F, 0x10D85}, + {0x10E80, 0x10EA9}, + {0x10EB0, 0x10EB1}, + {0x10EC2, 0x10EC7}, + {0x10F00, 0x10F1C}, + {0x10F27, 0x10F27}, + {0x10F30, 0x10F45}, + {0x10F70, 0x10F81}, + {0x10FB0, 0x10FC4}, + {0x10FE0, 0x10FF6}, + {0x11003, 0x11037}, + {0x11071, 0x11072}, + {0x11075, 0x11075}, + {0x11083, 0x110AF}, + {0x110D0, 0x110E8}, + {0x11103, 0x11126}, + {0x11144, 0x11144}, + {0x11147, 0x11147}, + {0x11150, 0x11172}, + {0x11176, 0x11176}, + {0x11183, 0x111B2}, + {0x111C1, 0x111C4}, + {0x111DA, 0x111DA}, + {0x111DC, 0x111DC}, + {0x11200, 0x11211}, + {0x11213, 0x1122B}, + {0x1123F, 0x11240}, + {0x11280, 0x11286}, + {0x11288, 0x11288}, + {0x1128A, 0x1128D}, + {0x1128F, 0x1129D}, + {0x1129F, 0x112A8}, + {0x112B0, 0x112DE}, + {0x11305, 0x1130C}, + {0x1130F, 0x11310}, + {0x11313, 0x11328}, + {0x1132A, 0x11330}, + {0x11332, 0x11333}, + {0x11335, 0x11339}, + {0x1133D, 0x1133D}, + {0x11350, 0x11350}, + {0x1135D, 0x11361}, + {0x11380, 0x11389}, + {0x1138B, 0x1138B}, + {0x1138E, 0x1138E}, + {0x11390, 0x113B5}, + {0x113B7, 0x113B7}, + {0x113D1, 0x113D1}, + {0x113D3, 0x113D3}, + {0x11400, 0x11434}, + {0x11447, 0x1144A}, + {0x1145F, 0x11461}, + {0x11480, 0x114AF}, + {0x114C4, 0x114C5}, + {0x114C7, 0x114C7}, + {0x11580, 0x115AE}, + {0x115D8, 0x115DB}, + {0x11600, 0x1162F}, + {0x11644, 0x11644}, + {0x11680, 0x116AA}, + {0x116B8, 0x116B8}, + {0x11700, 0x1171A}, + {0x11740, 0x11746}, + {0x11800, 0x1182B}, + {0x118A0, 0x118DF}, + {0x118FF, 0x11906}, + {0x11909, 0x11909}, + {0x1190C, 0x11913}, + {0x11915, 0x11916}, + {0x11918, 0x1192F}, + {0x1193F, 0x1193F}, + {0x11941, 0x11941}, + {0x119A0, 0x119A7}, + {0x119AA, 0x119D0}, + {0x119E1, 0x119E1}, + {0x119E3, 0x119E3}, + {0x11A00, 0x11A00}, + {0x11A0B, 0x11A32}, + {0x11A3A, 0x11A3A}, + {0x11A50, 0x11A50}, + {0x11A5C, 0x11A89}, + {0x11A9D, 0x11A9D}, + {0x11AB0, 0x11AF8}, + {0x11BC0, 0x11BE0}, + {0x11C00, 0x11C08}, + {0x11C0A, 0x11C2E}, + {0x11C40, 0x11C40}, + {0x11C72, 0x11C8F}, + {0x11D00, 0x11D06}, + {0x11D08, 0x11D09}, + {0x11D0B, 0x11D30}, + {0x11D46, 0x11D46}, + {0x11D60, 0x11D65}, + {0x11D67, 0x11D68}, + {0x11D6A, 0x11D89}, + {0x11D98, 0x11D98}, + {0x11DB0, 0x11DDB}, + {0x11EE0, 0x11EF2}, + {0x11F02, 0x11F02}, + {0x11F04, 0x11F10}, + {0x11F12, 0x11F33}, + {0x11FB0, 0x11FB0}, + {0x12000, 0x12399}, + {0x12400, 0x1246E}, + {0x12480, 0x12543}, + {0x12F90, 0x12FF0}, + {0x13000, 0x1342F}, + {0x13441, 0x13446}, + {0x13460, 0x143FA}, + {0x14400, 0x14646}, + {0x16100, 0x1611D}, + {0x16800, 0x16A38}, + {0x16A40, 0x16A5E}, + {0x16A70, 0x16ABE}, + {0x16AD0, 0x16AED}, + {0x16B00, 0x16B2F}, + {0x16B40, 0x16B43}, + {0x16B63, 0x16B77}, + {0x16B7D, 0x16B8F}, + {0x16D40, 0x16D6C}, + {0x16E40, 0x16E7F}, + {0x16EA0, 0x16EB8}, + {0x16EBB, 0x16ED3}, + {0x16F00, 0x16F4A}, + {0x16F50, 0x16F50}, + {0x16F93, 0x16F9F}, + {0x16FE0, 0x16FE1}, + {0x16FE3, 0x16FE3}, + {0x16FF2, 0x16FF6}, + {0x17000, 0x18CD5}, + {0x18CFF, 0x18D1E}, + {0x18D80, 0x18DF2}, + {0x1AFF0, 0x1AFF3}, + {0x1AFF5, 0x1AFFB}, + {0x1AFFD, 0x1AFFE}, + {0x1B000, 0x1B122}, + {0x1B132, 0x1B132}, + {0x1B150, 0x1B152}, + {0x1B155, 0x1B155}, + {0x1B164, 0x1B167}, + {0x1B170, 0x1B2FB}, + {0x1BC00, 0x1BC6A}, + {0x1BC70, 0x1BC7C}, + {0x1BC80, 0x1BC88}, + {0x1BC90, 0x1BC99}, + {0x1D400, 0x1D454}, + {0x1D456, 0x1D49C}, + {0x1D49E, 0x1D49F}, + {0x1D4A2, 0x1D4A2}, + {0x1D4A5, 0x1D4A6}, + {0x1D4A9, 0x1D4AC}, + {0x1D4AE, 0x1D4B9}, + {0x1D4BB, 0x1D4BB}, + {0x1D4BD, 0x1D4C3}, + {0x1D4C5, 0x1D505}, + {0x1D507, 0x1D50A}, + {0x1D50D, 0x1D514}, + {0x1D516, 0x1D51C}, + {0x1D51E, 0x1D539}, + {0x1D53B, 0x1D53E}, + {0x1D540, 0x1D544}, + {0x1D546, 0x1D546}, + {0x1D54A, 0x1D550}, + {0x1D552, 0x1D6A5}, + {0x1D6A8, 0x1D6C0}, + {0x1D6C2, 0x1D6DA}, + {0x1D6DC, 0x1D6FA}, + {0x1D6FC, 0x1D714}, + {0x1D716, 0x1D734}, + {0x1D736, 0x1D74E}, + {0x1D750, 0x1D76E}, + {0x1D770, 0x1D788}, + {0x1D78A, 0x1D7A8}, + {0x1D7AA, 0x1D7C2}, + {0x1D7C4, 0x1D7CB}, + {0x1DF00, 0x1DF1E}, + {0x1DF25, 0x1DF2A}, + {0x1E030, 0x1E06D}, + {0x1E100, 0x1E12C}, + {0x1E137, 0x1E13D}, + {0x1E14E, 0x1E14E}, + {0x1E290, 0x1E2AD}, + {0x1E2C0, 0x1E2EB}, + {0x1E4D0, 0x1E4EB}, + {0x1E5D0, 0x1E5ED}, + {0x1E5F0, 0x1E5F0}, + {0x1E6C0, 0x1E6DE}, + {0x1E6E0, 0x1E6E2}, + {0x1E6E4, 0x1E6E5}, + {0x1E6E7, 0x1E6ED}, + {0x1E6F0, 0x1E6F4}, + {0x1E6FE, 0x1E6FF}, + {0x1E7E0, 0x1E7E6}, + {0x1E7E8, 0x1E7EB}, + {0x1E7ED, 0x1E7EE}, + {0x1E7F0, 0x1E7FE}, + {0x1E800, 0x1E8C4}, + {0x1E900, 0x1E943}, + {0x1E94B, 0x1E94B}, + {0x1EE00, 0x1EE03}, + {0x1EE05, 0x1EE1F}, + {0x1EE21, 0x1EE22}, + {0x1EE24, 0x1EE24}, + {0x1EE27, 0x1EE27}, + {0x1EE29, 0x1EE32}, + {0x1EE34, 0x1EE37}, + {0x1EE39, 0x1EE39}, + {0x1EE3B, 0x1EE3B}, + {0x1EE42, 0x1EE42}, + {0x1EE47, 0x1EE47}, + {0x1EE49, 0x1EE49}, + {0x1EE4B, 0x1EE4B}, + {0x1EE4D, 0x1EE4F}, + {0x1EE51, 0x1EE52}, + {0x1EE54, 0x1EE54}, + {0x1EE57, 0x1EE57}, + {0x1EE59, 0x1EE59}, + {0x1EE5B, 0x1EE5B}, + {0x1EE5D, 0x1EE5D}, + {0x1EE5F, 0x1EE5F}, + {0x1EE61, 0x1EE62}, + {0x1EE64, 0x1EE64}, + {0x1EE67, 0x1EE6A}, + {0x1EE6C, 0x1EE72}, + {0x1EE74, 0x1EE77}, + {0x1EE79, 0x1EE7C}, + {0x1EE7E, 0x1EE7E}, + {0x1EE80, 0x1EE89}, + {0x1EE8B, 0x1EE9B}, + {0x1EEA1, 0x1EEA3}, + {0x1EEA5, 0x1EEA9}, + {0x1EEAB, 0x1EEBB}, + {0x20000, 0x2A6DF}, + {0x2A700, 0x2B81D}, + {0x2B820, 0x2CEAD}, + {0x2CEB0, 0x2EBE0}, + {0x2EBF0, 0x2EE5D}, + {0x2F800, 0x2FA1D}, + {0x30000, 0x3134A}, + {0x31350, 0x33479}, + }, + "Lowercase": { + {0x61, 0x7A}, + {0xAA, 0xAA}, + {0xB5, 0xB5}, + {0xBA, 0xBA}, + {0xDF, 0xF6}, + {0xF8, 0xFF}, + {0x101, 0x101}, + {0x103, 0x103}, + {0x105, 0x105}, + {0x107, 0x107}, + {0x109, 0x109}, + {0x10B, 0x10B}, + {0x10D, 0x10D}, + {0x10F, 0x10F}, + {0x111, 0x111}, + {0x113, 0x113}, + {0x115, 0x115}, + {0x117, 0x117}, + {0x119, 0x119}, + {0x11B, 0x11B}, + {0x11D, 0x11D}, + {0x11F, 0x11F}, + {0x121, 0x121}, + {0x123, 0x123}, + {0x125, 0x125}, + {0x127, 0x127}, + {0x129, 0x129}, + {0x12B, 0x12B}, + {0x12D, 0x12D}, + {0x12F, 0x12F}, + {0x131, 0x131}, + {0x133, 0x133}, + {0x135, 0x135}, + {0x137, 0x138}, + {0x13A, 0x13A}, + {0x13C, 0x13C}, + {0x13E, 0x13E}, + {0x140, 0x140}, + {0x142, 0x142}, + {0x144, 0x144}, + {0x146, 0x146}, + {0x148, 0x149}, + {0x14B, 0x14B}, + {0x14D, 0x14D}, + {0x14F, 0x14F}, + {0x151, 0x151}, + {0x153, 0x153}, + {0x155, 0x155}, + {0x157, 0x157}, + {0x159, 0x159}, + {0x15B, 0x15B}, + {0x15D, 0x15D}, + {0x15F, 0x15F}, + {0x161, 0x161}, + {0x163, 0x163}, + {0x165, 0x165}, + {0x167, 0x167}, + {0x169, 0x169}, + {0x16B, 0x16B}, + {0x16D, 0x16D}, + {0x16F, 0x16F}, + {0x171, 0x171}, + {0x173, 0x173}, + {0x175, 0x175}, + {0x177, 0x177}, + {0x17A, 0x17A}, + {0x17C, 0x17C}, + {0x17E, 0x180}, + {0x183, 0x183}, + {0x185, 0x185}, + {0x188, 0x188}, + {0x18C, 0x18D}, + {0x192, 0x192}, + {0x195, 0x195}, + {0x199, 0x19B}, + {0x19E, 0x19E}, + {0x1A1, 0x1A1}, + {0x1A3, 0x1A3}, + {0x1A5, 0x1A5}, + {0x1A8, 0x1A8}, + {0x1AA, 0x1AB}, + {0x1AD, 0x1AD}, + {0x1B0, 0x1B0}, + {0x1B4, 0x1B4}, + {0x1B6, 0x1B6}, + {0x1B9, 0x1BA}, + {0x1BD, 0x1BF}, + {0x1C6, 0x1C6}, + {0x1C9, 0x1C9}, + {0x1CC, 0x1CC}, + {0x1CE, 0x1CE}, + {0x1D0, 0x1D0}, + {0x1D2, 0x1D2}, + {0x1D4, 0x1D4}, + {0x1D6, 0x1D6}, + {0x1D8, 0x1D8}, + {0x1DA, 0x1DA}, + {0x1DC, 0x1DD}, + {0x1DF, 0x1DF}, + {0x1E1, 0x1E1}, + {0x1E3, 0x1E3}, + {0x1E5, 0x1E5}, + {0x1E7, 0x1E7}, + {0x1E9, 0x1E9}, + {0x1EB, 0x1EB}, + {0x1ED, 0x1ED}, + {0x1EF, 0x1F0}, + {0x1F3, 0x1F3}, + {0x1F5, 0x1F5}, + {0x1F9, 0x1F9}, + {0x1FB, 0x1FB}, + {0x1FD, 0x1FD}, + {0x1FF, 0x1FF}, + {0x201, 0x201}, + {0x203, 0x203}, + {0x205, 0x205}, + {0x207, 0x207}, + {0x209, 0x209}, + {0x20B, 0x20B}, + {0x20D, 0x20D}, + {0x20F, 0x20F}, + {0x211, 0x211}, + {0x213, 0x213}, + {0x215, 0x215}, + {0x217, 0x217}, + {0x219, 0x219}, + {0x21B, 0x21B}, + {0x21D, 0x21D}, + {0x21F, 0x21F}, + {0x221, 0x221}, + {0x223, 0x223}, + {0x225, 0x225}, + {0x227, 0x227}, + {0x229, 0x229}, + {0x22B, 0x22B}, + {0x22D, 0x22D}, + {0x22F, 0x22F}, + {0x231, 0x231}, + {0x233, 0x239}, + {0x23C, 0x23C}, + {0x23F, 0x240}, + {0x242, 0x242}, + {0x247, 0x247}, + {0x249, 0x249}, + {0x24B, 0x24B}, + {0x24D, 0x24D}, + {0x24F, 0x293}, + {0x296, 0x2B8}, + {0x2C0, 0x2C1}, + {0x2E0, 0x2E4}, + {0x345, 0x345}, + {0x371, 0x371}, + {0x373, 0x373}, + {0x377, 0x377}, + {0x37A, 0x37D}, + {0x390, 0x390}, + {0x3AC, 0x3CE}, + {0x3D0, 0x3D1}, + {0x3D5, 0x3D7}, + {0x3D9, 0x3D9}, + {0x3DB, 0x3DB}, + {0x3DD, 0x3DD}, + {0x3DF, 0x3DF}, + {0x3E1, 0x3E1}, + {0x3E3, 0x3E3}, + {0x3E5, 0x3E5}, + {0x3E7, 0x3E7}, + {0x3E9, 0x3E9}, + {0x3EB, 0x3EB}, + {0x3ED, 0x3ED}, + {0x3EF, 0x3F3}, + {0x3F5, 0x3F5}, + {0x3F8, 0x3F8}, + {0x3FB, 0x3FC}, + {0x430, 0x45F}, + {0x461, 0x461}, + {0x463, 0x463}, + {0x465, 0x465}, + {0x467, 0x467}, + {0x469, 0x469}, + {0x46B, 0x46B}, + {0x46D, 0x46D}, + {0x46F, 0x46F}, + {0x471, 0x471}, + {0x473, 0x473}, + {0x475, 0x475}, + {0x477, 0x477}, + {0x479, 0x479}, + {0x47B, 0x47B}, + {0x47D, 0x47D}, + {0x47F, 0x47F}, + {0x481, 0x481}, + {0x48B, 0x48B}, + {0x48D, 0x48D}, + {0x48F, 0x48F}, + {0x491, 0x491}, + {0x493, 0x493}, + {0x495, 0x495}, + {0x497, 0x497}, + {0x499, 0x499}, + {0x49B, 0x49B}, + {0x49D, 0x49D}, + {0x49F, 0x49F}, + {0x4A1, 0x4A1}, + {0x4A3, 0x4A3}, + {0x4A5, 0x4A5}, + {0x4A7, 0x4A7}, + {0x4A9, 0x4A9}, + {0x4AB, 0x4AB}, + {0x4AD, 0x4AD}, + {0x4AF, 0x4AF}, + {0x4B1, 0x4B1}, + {0x4B3, 0x4B3}, + {0x4B5, 0x4B5}, + {0x4B7, 0x4B7}, + {0x4B9, 0x4B9}, + {0x4BB, 0x4BB}, + {0x4BD, 0x4BD}, + {0x4BF, 0x4BF}, + {0x4C2, 0x4C2}, + {0x4C4, 0x4C4}, + {0x4C6, 0x4C6}, + {0x4C8, 0x4C8}, + {0x4CA, 0x4CA}, + {0x4CC, 0x4CC}, + {0x4CE, 0x4CF}, + {0x4D1, 0x4D1}, + {0x4D3, 0x4D3}, + {0x4D5, 0x4D5}, + {0x4D7, 0x4D7}, + {0x4D9, 0x4D9}, + {0x4DB, 0x4DB}, + {0x4DD, 0x4DD}, + {0x4DF, 0x4DF}, + {0x4E1, 0x4E1}, + {0x4E3, 0x4E3}, + {0x4E5, 0x4E5}, + {0x4E7, 0x4E7}, + {0x4E9, 0x4E9}, + {0x4EB, 0x4EB}, + {0x4ED, 0x4ED}, + {0x4EF, 0x4EF}, + {0x4F1, 0x4F1}, + {0x4F3, 0x4F3}, + {0x4F5, 0x4F5}, + {0x4F7, 0x4F7}, + {0x4F9, 0x4F9}, + {0x4FB, 0x4FB}, + {0x4FD, 0x4FD}, + {0x4FF, 0x4FF}, + {0x501, 0x501}, + {0x503, 0x503}, + {0x505, 0x505}, + {0x507, 0x507}, + {0x509, 0x509}, + {0x50B, 0x50B}, + {0x50D, 0x50D}, + {0x50F, 0x50F}, + {0x511, 0x511}, + {0x513, 0x513}, + {0x515, 0x515}, + {0x517, 0x517}, + {0x519, 0x519}, + {0x51B, 0x51B}, + {0x51D, 0x51D}, + {0x51F, 0x51F}, + {0x521, 0x521}, + {0x523, 0x523}, + {0x525, 0x525}, + {0x527, 0x527}, + {0x529, 0x529}, + {0x52B, 0x52B}, + {0x52D, 0x52D}, + {0x52F, 0x52F}, + {0x560, 0x588}, + {0x10D0, 0x10FA}, + {0x10FC, 0x10FF}, + {0x13F8, 0x13FD}, + {0x1C80, 0x1C88}, + {0x1C8A, 0x1C8A}, + {0x1D00, 0x1DBF}, + {0x1E01, 0x1E01}, + {0x1E03, 0x1E03}, + {0x1E05, 0x1E05}, + {0x1E07, 0x1E07}, + {0x1E09, 0x1E09}, + {0x1E0B, 0x1E0B}, + {0x1E0D, 0x1E0D}, + {0x1E0F, 0x1E0F}, + {0x1E11, 0x1E11}, + {0x1E13, 0x1E13}, + {0x1E15, 0x1E15}, + {0x1E17, 0x1E17}, + {0x1E19, 0x1E19}, + {0x1E1B, 0x1E1B}, + {0x1E1D, 0x1E1D}, + {0x1E1F, 0x1E1F}, + {0x1E21, 0x1E21}, + {0x1E23, 0x1E23}, + {0x1E25, 0x1E25}, + {0x1E27, 0x1E27}, + {0x1E29, 0x1E29}, + {0x1E2B, 0x1E2B}, + {0x1E2D, 0x1E2D}, + {0x1E2F, 0x1E2F}, + {0x1E31, 0x1E31}, + {0x1E33, 0x1E33}, + {0x1E35, 0x1E35}, + {0x1E37, 0x1E37}, + {0x1E39, 0x1E39}, + {0x1E3B, 0x1E3B}, + {0x1E3D, 0x1E3D}, + {0x1E3F, 0x1E3F}, + {0x1E41, 0x1E41}, + {0x1E43, 0x1E43}, + {0x1E45, 0x1E45}, + {0x1E47, 0x1E47}, + {0x1E49, 0x1E49}, + {0x1E4B, 0x1E4B}, + {0x1E4D, 0x1E4D}, + {0x1E4F, 0x1E4F}, + {0x1E51, 0x1E51}, + {0x1E53, 0x1E53}, + {0x1E55, 0x1E55}, + {0x1E57, 0x1E57}, + {0x1E59, 0x1E59}, + {0x1E5B, 0x1E5B}, + {0x1E5D, 0x1E5D}, + {0x1E5F, 0x1E5F}, + {0x1E61, 0x1E61}, + {0x1E63, 0x1E63}, + {0x1E65, 0x1E65}, + {0x1E67, 0x1E67}, + {0x1E69, 0x1E69}, + {0x1E6B, 0x1E6B}, + {0x1E6D, 0x1E6D}, + {0x1E6F, 0x1E6F}, + {0x1E71, 0x1E71}, + {0x1E73, 0x1E73}, + {0x1E75, 0x1E75}, + {0x1E77, 0x1E77}, + {0x1E79, 0x1E79}, + {0x1E7B, 0x1E7B}, + {0x1E7D, 0x1E7D}, + {0x1E7F, 0x1E7F}, + {0x1E81, 0x1E81}, + {0x1E83, 0x1E83}, + {0x1E85, 0x1E85}, + {0x1E87, 0x1E87}, + {0x1E89, 0x1E89}, + {0x1E8B, 0x1E8B}, + {0x1E8D, 0x1E8D}, + {0x1E8F, 0x1E8F}, + {0x1E91, 0x1E91}, + {0x1E93, 0x1E93}, + {0x1E95, 0x1E9D}, + {0x1E9F, 0x1E9F}, + {0x1EA1, 0x1EA1}, + {0x1EA3, 0x1EA3}, + {0x1EA5, 0x1EA5}, + {0x1EA7, 0x1EA7}, + {0x1EA9, 0x1EA9}, + {0x1EAB, 0x1EAB}, + {0x1EAD, 0x1EAD}, + {0x1EAF, 0x1EAF}, + {0x1EB1, 0x1EB1}, + {0x1EB3, 0x1EB3}, + {0x1EB5, 0x1EB5}, + {0x1EB7, 0x1EB7}, + {0x1EB9, 0x1EB9}, + {0x1EBB, 0x1EBB}, + {0x1EBD, 0x1EBD}, + {0x1EBF, 0x1EBF}, + {0x1EC1, 0x1EC1}, + {0x1EC3, 0x1EC3}, + {0x1EC5, 0x1EC5}, + {0x1EC7, 0x1EC7}, + {0x1EC9, 0x1EC9}, + {0x1ECB, 0x1ECB}, + {0x1ECD, 0x1ECD}, + {0x1ECF, 0x1ECF}, + {0x1ED1, 0x1ED1}, + {0x1ED3, 0x1ED3}, + {0x1ED5, 0x1ED5}, + {0x1ED7, 0x1ED7}, + {0x1ED9, 0x1ED9}, + {0x1EDB, 0x1EDB}, + {0x1EDD, 0x1EDD}, + {0x1EDF, 0x1EDF}, + {0x1EE1, 0x1EE1}, + {0x1EE3, 0x1EE3}, + {0x1EE5, 0x1EE5}, + {0x1EE7, 0x1EE7}, + {0x1EE9, 0x1EE9}, + {0x1EEB, 0x1EEB}, + {0x1EED, 0x1EED}, + {0x1EEF, 0x1EEF}, + {0x1EF1, 0x1EF1}, + {0x1EF3, 0x1EF3}, + {0x1EF5, 0x1EF5}, + {0x1EF7, 0x1EF7}, + {0x1EF9, 0x1EF9}, + {0x1EFB, 0x1EFB}, + {0x1EFD, 0x1EFD}, + {0x1EFF, 0x1F07}, + {0x1F10, 0x1F15}, + {0x1F20, 0x1F27}, + {0x1F30, 0x1F37}, + {0x1F40, 0x1F45}, + {0x1F50, 0x1F57}, + {0x1F60, 0x1F67}, + {0x1F70, 0x1F7D}, + {0x1F80, 0x1F87}, + {0x1F90, 0x1F97}, + {0x1FA0, 0x1FA7}, + {0x1FB0, 0x1FB4}, + {0x1FB6, 0x1FB7}, + {0x1FBE, 0x1FBE}, + {0x1FC2, 0x1FC4}, + {0x1FC6, 0x1FC7}, + {0x1FD0, 0x1FD3}, + {0x1FD6, 0x1FD7}, + {0x1FE0, 0x1FE7}, + {0x1FF2, 0x1FF4}, + {0x1FF6, 0x1FF7}, + {0x2071, 0x2071}, + {0x207F, 0x207F}, + {0x2090, 0x209C}, + {0x210A, 0x210A}, + {0x210E, 0x210F}, + {0x2113, 0x2113}, + {0x212F, 0x212F}, + {0x2134, 0x2134}, + {0x2139, 0x2139}, + {0x213C, 0x213D}, + {0x2146, 0x2149}, + {0x214E, 0x214E}, + {0x2170, 0x217F}, + {0x2184, 0x2184}, + {0x24D0, 0x24E9}, + {0x2C30, 0x2C5F}, + {0x2C61, 0x2C61}, + {0x2C65, 0x2C66}, + {0x2C68, 0x2C68}, + {0x2C6A, 0x2C6A}, + {0x2C6C, 0x2C6C}, + {0x2C71, 0x2C71}, + {0x2C73, 0x2C74}, + {0x2C76, 0x2C7D}, + {0x2C81, 0x2C81}, + {0x2C83, 0x2C83}, + {0x2C85, 0x2C85}, + {0x2C87, 0x2C87}, + {0x2C89, 0x2C89}, + {0x2C8B, 0x2C8B}, + {0x2C8D, 0x2C8D}, + {0x2C8F, 0x2C8F}, + {0x2C91, 0x2C91}, + {0x2C93, 0x2C93}, + {0x2C95, 0x2C95}, + {0x2C97, 0x2C97}, + {0x2C99, 0x2C99}, + {0x2C9B, 0x2C9B}, + {0x2C9D, 0x2C9D}, + {0x2C9F, 0x2C9F}, + {0x2CA1, 0x2CA1}, + {0x2CA3, 0x2CA3}, + {0x2CA5, 0x2CA5}, + {0x2CA7, 0x2CA7}, + {0x2CA9, 0x2CA9}, + {0x2CAB, 0x2CAB}, + {0x2CAD, 0x2CAD}, + {0x2CAF, 0x2CAF}, + {0x2CB1, 0x2CB1}, + {0x2CB3, 0x2CB3}, + {0x2CB5, 0x2CB5}, + {0x2CB7, 0x2CB7}, + {0x2CB9, 0x2CB9}, + {0x2CBB, 0x2CBB}, + {0x2CBD, 0x2CBD}, + {0x2CBF, 0x2CBF}, + {0x2CC1, 0x2CC1}, + {0x2CC3, 0x2CC3}, + {0x2CC5, 0x2CC5}, + {0x2CC7, 0x2CC7}, + {0x2CC9, 0x2CC9}, + {0x2CCB, 0x2CCB}, + {0x2CCD, 0x2CCD}, + {0x2CCF, 0x2CCF}, + {0x2CD1, 0x2CD1}, + {0x2CD3, 0x2CD3}, + {0x2CD5, 0x2CD5}, + {0x2CD7, 0x2CD7}, + {0x2CD9, 0x2CD9}, + {0x2CDB, 0x2CDB}, + {0x2CDD, 0x2CDD}, + {0x2CDF, 0x2CDF}, + {0x2CE1, 0x2CE1}, + {0x2CE3, 0x2CE4}, + {0x2CEC, 0x2CEC}, + {0x2CEE, 0x2CEE}, + {0x2CF3, 0x2CF3}, + {0x2D00, 0x2D25}, + {0x2D27, 0x2D27}, + {0x2D2D, 0x2D2D}, + {0xA641, 0xA641}, + {0xA643, 0xA643}, + {0xA645, 0xA645}, + {0xA647, 0xA647}, + {0xA649, 0xA649}, + {0xA64B, 0xA64B}, + {0xA64D, 0xA64D}, + {0xA64F, 0xA64F}, + {0xA651, 0xA651}, + {0xA653, 0xA653}, + {0xA655, 0xA655}, + {0xA657, 0xA657}, + {0xA659, 0xA659}, + {0xA65B, 0xA65B}, + {0xA65D, 0xA65D}, + {0xA65F, 0xA65F}, + {0xA661, 0xA661}, + {0xA663, 0xA663}, + {0xA665, 0xA665}, + {0xA667, 0xA667}, + {0xA669, 0xA669}, + {0xA66B, 0xA66B}, + {0xA66D, 0xA66D}, + {0xA681, 0xA681}, + {0xA683, 0xA683}, + {0xA685, 0xA685}, + {0xA687, 0xA687}, + {0xA689, 0xA689}, + {0xA68B, 0xA68B}, + {0xA68D, 0xA68D}, + {0xA68F, 0xA68F}, + {0xA691, 0xA691}, + {0xA693, 0xA693}, + {0xA695, 0xA695}, + {0xA697, 0xA697}, + {0xA699, 0xA699}, + {0xA69B, 0xA69D}, + {0xA723, 0xA723}, + {0xA725, 0xA725}, + {0xA727, 0xA727}, + {0xA729, 0xA729}, + {0xA72B, 0xA72B}, + {0xA72D, 0xA72D}, + {0xA72F, 0xA731}, + {0xA733, 0xA733}, + {0xA735, 0xA735}, + {0xA737, 0xA737}, + {0xA739, 0xA739}, + {0xA73B, 0xA73B}, + {0xA73D, 0xA73D}, + {0xA73F, 0xA73F}, + {0xA741, 0xA741}, + {0xA743, 0xA743}, + {0xA745, 0xA745}, + {0xA747, 0xA747}, + {0xA749, 0xA749}, + {0xA74B, 0xA74B}, + {0xA74D, 0xA74D}, + {0xA74F, 0xA74F}, + {0xA751, 0xA751}, + {0xA753, 0xA753}, + {0xA755, 0xA755}, + {0xA757, 0xA757}, + {0xA759, 0xA759}, + {0xA75B, 0xA75B}, + {0xA75D, 0xA75D}, + {0xA75F, 0xA75F}, + {0xA761, 0xA761}, + {0xA763, 0xA763}, + {0xA765, 0xA765}, + {0xA767, 0xA767}, + {0xA769, 0xA769}, + {0xA76B, 0xA76B}, + {0xA76D, 0xA76D}, + {0xA76F, 0xA778}, + {0xA77A, 0xA77A}, + {0xA77C, 0xA77C}, + {0xA77F, 0xA77F}, + {0xA781, 0xA781}, + {0xA783, 0xA783}, + {0xA785, 0xA785}, + {0xA787, 0xA787}, + {0xA78C, 0xA78C}, + {0xA78E, 0xA78E}, + {0xA791, 0xA791}, + {0xA793, 0xA795}, + {0xA797, 0xA797}, + {0xA799, 0xA799}, + {0xA79B, 0xA79B}, + {0xA79D, 0xA79D}, + {0xA79F, 0xA79F}, + {0xA7A1, 0xA7A1}, + {0xA7A3, 0xA7A3}, + {0xA7A5, 0xA7A5}, + {0xA7A7, 0xA7A7}, + {0xA7A9, 0xA7A9}, + {0xA7AF, 0xA7AF}, + {0xA7B5, 0xA7B5}, + {0xA7B7, 0xA7B7}, + {0xA7B9, 0xA7B9}, + {0xA7BB, 0xA7BB}, + {0xA7BD, 0xA7BD}, + {0xA7BF, 0xA7BF}, + {0xA7C1, 0xA7C1}, + {0xA7C3, 0xA7C3}, + {0xA7C8, 0xA7C8}, + {0xA7CA, 0xA7CA}, + {0xA7CD, 0xA7CD}, + {0xA7CF, 0xA7CF}, + {0xA7D1, 0xA7D1}, + {0xA7D3, 0xA7D3}, + {0xA7D5, 0xA7D5}, + {0xA7D7, 0xA7D7}, + {0xA7D9, 0xA7D9}, + {0xA7DB, 0xA7DB}, + {0xA7F1, 0xA7F4}, + {0xA7F6, 0xA7F6}, + {0xA7F8, 0xA7FA}, + {0xAB30, 0xAB5A}, + {0xAB5C, 0xAB69}, + {0xAB70, 0xABBF}, + {0xFB00, 0xFB06}, + {0xFB13, 0xFB17}, + {0xFF41, 0xFF5A}, + {0x10428, 0x1044F}, + {0x104D8, 0x104FB}, + {0x10597, 0x105A1}, + {0x105A3, 0x105B1}, + {0x105B3, 0x105B9}, + {0x105BB, 0x105BC}, + {0x10780, 0x10780}, + {0x10783, 0x10785}, + {0x10787, 0x107B0}, + {0x107B2, 0x107BA}, + {0x10CC0, 0x10CF2}, + {0x10D70, 0x10D85}, + {0x118C0, 0x118DF}, + {0x16E60, 0x16E7F}, + {0x16EBB, 0x16ED3}, + {0x1D41A, 0x1D433}, + {0x1D44E, 0x1D454}, + {0x1D456, 0x1D467}, + {0x1D482, 0x1D49B}, + {0x1D4B6, 0x1D4B9}, + {0x1D4BB, 0x1D4BB}, + {0x1D4BD, 0x1D4C3}, + {0x1D4C5, 0x1D4CF}, + {0x1D4EA, 0x1D503}, + {0x1D51E, 0x1D537}, + {0x1D552, 0x1D56B}, + {0x1D586, 0x1D59F}, + {0x1D5BA, 0x1D5D3}, + {0x1D5EE, 0x1D607}, + {0x1D622, 0x1D63B}, + {0x1D656, 0x1D66F}, + {0x1D68A, 0x1D6A5}, + {0x1D6C2, 0x1D6DA}, + {0x1D6DC, 0x1D6E1}, + {0x1D6FC, 0x1D714}, + {0x1D716, 0x1D71B}, + {0x1D736, 0x1D74E}, + {0x1D750, 0x1D755}, + {0x1D770, 0x1D788}, + {0x1D78A, 0x1D78F}, + {0x1D7AA, 0x1D7C2}, + {0x1D7C4, 0x1D7C9}, + {0x1D7CB, 0x1D7CB}, + {0x1DF00, 0x1DF09}, + {0x1DF0B, 0x1DF1E}, + {0x1DF25, 0x1DF2A}, + {0x1E030, 0x1E06D}, + {0x1E922, 0x1E943}, + }, + "Uppercase": { + {0x41, 0x5A}, + {0xC0, 0xD6}, + {0xD8, 0xDE}, + {0x100, 0x100}, + {0x102, 0x102}, + {0x104, 0x104}, + {0x106, 0x106}, + {0x108, 0x108}, + {0x10A, 0x10A}, + {0x10C, 0x10C}, + {0x10E, 0x10E}, + {0x110, 0x110}, + {0x112, 0x112}, + {0x114, 0x114}, + {0x116, 0x116}, + {0x118, 0x118}, + {0x11A, 0x11A}, + {0x11C, 0x11C}, + {0x11E, 0x11E}, + {0x120, 0x120}, + {0x122, 0x122}, + {0x124, 0x124}, + {0x126, 0x126}, + {0x128, 0x128}, + {0x12A, 0x12A}, + {0x12C, 0x12C}, + {0x12E, 0x12E}, + {0x130, 0x130}, + {0x132, 0x132}, + {0x134, 0x134}, + {0x136, 0x136}, + {0x139, 0x139}, + {0x13B, 0x13B}, + {0x13D, 0x13D}, + {0x13F, 0x13F}, + {0x141, 0x141}, + {0x143, 0x143}, + {0x145, 0x145}, + {0x147, 0x147}, + {0x14A, 0x14A}, + {0x14C, 0x14C}, + {0x14E, 0x14E}, + {0x150, 0x150}, + {0x152, 0x152}, + {0x154, 0x154}, + {0x156, 0x156}, + {0x158, 0x158}, + {0x15A, 0x15A}, + {0x15C, 0x15C}, + {0x15E, 0x15E}, + {0x160, 0x160}, + {0x162, 0x162}, + {0x164, 0x164}, + {0x166, 0x166}, + {0x168, 0x168}, + {0x16A, 0x16A}, + {0x16C, 0x16C}, + {0x16E, 0x16E}, + {0x170, 0x170}, + {0x172, 0x172}, + {0x174, 0x174}, + {0x176, 0x176}, + {0x178, 0x179}, + {0x17B, 0x17B}, + {0x17D, 0x17D}, + {0x181, 0x182}, + {0x184, 0x184}, + {0x186, 0x187}, + {0x189, 0x18B}, + {0x18E, 0x191}, + {0x193, 0x194}, + {0x196, 0x198}, + {0x19C, 0x19D}, + {0x19F, 0x1A0}, + {0x1A2, 0x1A2}, + {0x1A4, 0x1A4}, + {0x1A6, 0x1A7}, + {0x1A9, 0x1A9}, + {0x1AC, 0x1AC}, + {0x1AE, 0x1AF}, + {0x1B1, 0x1B3}, + {0x1B5, 0x1B5}, + {0x1B7, 0x1B8}, + {0x1BC, 0x1BC}, + {0x1C4, 0x1C4}, + {0x1C7, 0x1C7}, + {0x1CA, 0x1CA}, + {0x1CD, 0x1CD}, + {0x1CF, 0x1CF}, + {0x1D1, 0x1D1}, + {0x1D3, 0x1D3}, + {0x1D5, 0x1D5}, + {0x1D7, 0x1D7}, + {0x1D9, 0x1D9}, + {0x1DB, 0x1DB}, + {0x1DE, 0x1DE}, + {0x1E0, 0x1E0}, + {0x1E2, 0x1E2}, + {0x1E4, 0x1E4}, + {0x1E6, 0x1E6}, + {0x1E8, 0x1E8}, + {0x1EA, 0x1EA}, + {0x1EC, 0x1EC}, + {0x1EE, 0x1EE}, + {0x1F1, 0x1F1}, + {0x1F4, 0x1F4}, + {0x1F6, 0x1F8}, + {0x1FA, 0x1FA}, + {0x1FC, 0x1FC}, + {0x1FE, 0x1FE}, + {0x200, 0x200}, + {0x202, 0x202}, + {0x204, 0x204}, + {0x206, 0x206}, + {0x208, 0x208}, + {0x20A, 0x20A}, + {0x20C, 0x20C}, + {0x20E, 0x20E}, + {0x210, 0x210}, + {0x212, 0x212}, + {0x214, 0x214}, + {0x216, 0x216}, + {0x218, 0x218}, + {0x21A, 0x21A}, + {0x21C, 0x21C}, + {0x21E, 0x21E}, + {0x220, 0x220}, + {0x222, 0x222}, + {0x224, 0x224}, + {0x226, 0x226}, + {0x228, 0x228}, + {0x22A, 0x22A}, + {0x22C, 0x22C}, + {0x22E, 0x22E}, + {0x230, 0x230}, + {0x232, 0x232}, + {0x23A, 0x23B}, + {0x23D, 0x23E}, + {0x241, 0x241}, + {0x243, 0x246}, + {0x248, 0x248}, + {0x24A, 0x24A}, + {0x24C, 0x24C}, + {0x24E, 0x24E}, + {0x370, 0x370}, + {0x372, 0x372}, + {0x376, 0x376}, + {0x37F, 0x37F}, + {0x386, 0x386}, + {0x388, 0x38A}, + {0x38C, 0x38C}, + {0x38E, 0x38F}, + {0x391, 0x3A1}, + {0x3A3, 0x3AB}, + {0x3CF, 0x3CF}, + {0x3D2, 0x3D4}, + {0x3D8, 0x3D8}, + {0x3DA, 0x3DA}, + {0x3DC, 0x3DC}, + {0x3DE, 0x3DE}, + {0x3E0, 0x3E0}, + {0x3E2, 0x3E2}, + {0x3E4, 0x3E4}, + {0x3E6, 0x3E6}, + {0x3E8, 0x3E8}, + {0x3EA, 0x3EA}, + {0x3EC, 0x3EC}, + {0x3EE, 0x3EE}, + {0x3F4, 0x3F4}, + {0x3F7, 0x3F7}, + {0x3F9, 0x3FA}, + {0x3FD, 0x42F}, + {0x460, 0x460}, + {0x462, 0x462}, + {0x464, 0x464}, + {0x466, 0x466}, + {0x468, 0x468}, + {0x46A, 0x46A}, + {0x46C, 0x46C}, + {0x46E, 0x46E}, + {0x470, 0x470}, + {0x472, 0x472}, + {0x474, 0x474}, + {0x476, 0x476}, + {0x478, 0x478}, + {0x47A, 0x47A}, + {0x47C, 0x47C}, + {0x47E, 0x47E}, + {0x480, 0x480}, + {0x48A, 0x48A}, + {0x48C, 0x48C}, + {0x48E, 0x48E}, + {0x490, 0x490}, + {0x492, 0x492}, + {0x494, 0x494}, + {0x496, 0x496}, + {0x498, 0x498}, + {0x49A, 0x49A}, + {0x49C, 0x49C}, + {0x49E, 0x49E}, + {0x4A0, 0x4A0}, + {0x4A2, 0x4A2}, + {0x4A4, 0x4A4}, + {0x4A6, 0x4A6}, + {0x4A8, 0x4A8}, + {0x4AA, 0x4AA}, + {0x4AC, 0x4AC}, + {0x4AE, 0x4AE}, + {0x4B0, 0x4B0}, + {0x4B2, 0x4B2}, + {0x4B4, 0x4B4}, + {0x4B6, 0x4B6}, + {0x4B8, 0x4B8}, + {0x4BA, 0x4BA}, + {0x4BC, 0x4BC}, + {0x4BE, 0x4BE}, + {0x4C0, 0x4C1}, + {0x4C3, 0x4C3}, + {0x4C5, 0x4C5}, + {0x4C7, 0x4C7}, + {0x4C9, 0x4C9}, + {0x4CB, 0x4CB}, + {0x4CD, 0x4CD}, + {0x4D0, 0x4D0}, + {0x4D2, 0x4D2}, + {0x4D4, 0x4D4}, + {0x4D6, 0x4D6}, + {0x4D8, 0x4D8}, + {0x4DA, 0x4DA}, + {0x4DC, 0x4DC}, + {0x4DE, 0x4DE}, + {0x4E0, 0x4E0}, + {0x4E2, 0x4E2}, + {0x4E4, 0x4E4}, + {0x4E6, 0x4E6}, + {0x4E8, 0x4E8}, + {0x4EA, 0x4EA}, + {0x4EC, 0x4EC}, + {0x4EE, 0x4EE}, + {0x4F0, 0x4F0}, + {0x4F2, 0x4F2}, + {0x4F4, 0x4F4}, + {0x4F6, 0x4F6}, + {0x4F8, 0x4F8}, + {0x4FA, 0x4FA}, + {0x4FC, 0x4FC}, + {0x4FE, 0x4FE}, + {0x500, 0x500}, + {0x502, 0x502}, + {0x504, 0x504}, + {0x506, 0x506}, + {0x508, 0x508}, + {0x50A, 0x50A}, + {0x50C, 0x50C}, + {0x50E, 0x50E}, + {0x510, 0x510}, + {0x512, 0x512}, + {0x514, 0x514}, + {0x516, 0x516}, + {0x518, 0x518}, + {0x51A, 0x51A}, + {0x51C, 0x51C}, + {0x51E, 0x51E}, + {0x520, 0x520}, + {0x522, 0x522}, + {0x524, 0x524}, + {0x526, 0x526}, + {0x528, 0x528}, + {0x52A, 0x52A}, + {0x52C, 0x52C}, + {0x52E, 0x52E}, + {0x531, 0x556}, + {0x10A0, 0x10C5}, + {0x10C7, 0x10C7}, + {0x10CD, 0x10CD}, + {0x13A0, 0x13F5}, + {0x1C89, 0x1C89}, + {0x1C90, 0x1CBA}, + {0x1CBD, 0x1CBF}, + {0x1E00, 0x1E00}, + {0x1E02, 0x1E02}, + {0x1E04, 0x1E04}, + {0x1E06, 0x1E06}, + {0x1E08, 0x1E08}, + {0x1E0A, 0x1E0A}, + {0x1E0C, 0x1E0C}, + {0x1E0E, 0x1E0E}, + {0x1E10, 0x1E10}, + {0x1E12, 0x1E12}, + {0x1E14, 0x1E14}, + {0x1E16, 0x1E16}, + {0x1E18, 0x1E18}, + {0x1E1A, 0x1E1A}, + {0x1E1C, 0x1E1C}, + {0x1E1E, 0x1E1E}, + {0x1E20, 0x1E20}, + {0x1E22, 0x1E22}, + {0x1E24, 0x1E24}, + {0x1E26, 0x1E26}, + {0x1E28, 0x1E28}, + {0x1E2A, 0x1E2A}, + {0x1E2C, 0x1E2C}, + {0x1E2E, 0x1E2E}, + {0x1E30, 0x1E30}, + {0x1E32, 0x1E32}, + {0x1E34, 0x1E34}, + {0x1E36, 0x1E36}, + {0x1E38, 0x1E38}, + {0x1E3A, 0x1E3A}, + {0x1E3C, 0x1E3C}, + {0x1E3E, 0x1E3E}, + {0x1E40, 0x1E40}, + {0x1E42, 0x1E42}, + {0x1E44, 0x1E44}, + {0x1E46, 0x1E46}, + {0x1E48, 0x1E48}, + {0x1E4A, 0x1E4A}, + {0x1E4C, 0x1E4C}, + {0x1E4E, 0x1E4E}, + {0x1E50, 0x1E50}, + {0x1E52, 0x1E52}, + {0x1E54, 0x1E54}, + {0x1E56, 0x1E56}, + {0x1E58, 0x1E58}, + {0x1E5A, 0x1E5A}, + {0x1E5C, 0x1E5C}, + {0x1E5E, 0x1E5E}, + {0x1E60, 0x1E60}, + {0x1E62, 0x1E62}, + {0x1E64, 0x1E64}, + {0x1E66, 0x1E66}, + {0x1E68, 0x1E68}, + {0x1E6A, 0x1E6A}, + {0x1E6C, 0x1E6C}, + {0x1E6E, 0x1E6E}, + {0x1E70, 0x1E70}, + {0x1E72, 0x1E72}, + {0x1E74, 0x1E74}, + {0x1E76, 0x1E76}, + {0x1E78, 0x1E78}, + {0x1E7A, 0x1E7A}, + {0x1E7C, 0x1E7C}, + {0x1E7E, 0x1E7E}, + {0x1E80, 0x1E80}, + {0x1E82, 0x1E82}, + {0x1E84, 0x1E84}, + {0x1E86, 0x1E86}, + {0x1E88, 0x1E88}, + {0x1E8A, 0x1E8A}, + {0x1E8C, 0x1E8C}, + {0x1E8E, 0x1E8E}, + {0x1E90, 0x1E90}, + {0x1E92, 0x1E92}, + {0x1E94, 0x1E94}, + {0x1E9E, 0x1E9E}, + {0x1EA0, 0x1EA0}, + {0x1EA2, 0x1EA2}, + {0x1EA4, 0x1EA4}, + {0x1EA6, 0x1EA6}, + {0x1EA8, 0x1EA8}, + {0x1EAA, 0x1EAA}, + {0x1EAC, 0x1EAC}, + {0x1EAE, 0x1EAE}, + {0x1EB0, 0x1EB0}, + {0x1EB2, 0x1EB2}, + {0x1EB4, 0x1EB4}, + {0x1EB6, 0x1EB6}, + {0x1EB8, 0x1EB8}, + {0x1EBA, 0x1EBA}, + {0x1EBC, 0x1EBC}, + {0x1EBE, 0x1EBE}, + {0x1EC0, 0x1EC0}, + {0x1EC2, 0x1EC2}, + {0x1EC4, 0x1EC4}, + {0x1EC6, 0x1EC6}, + {0x1EC8, 0x1EC8}, + {0x1ECA, 0x1ECA}, + {0x1ECC, 0x1ECC}, + {0x1ECE, 0x1ECE}, + {0x1ED0, 0x1ED0}, + {0x1ED2, 0x1ED2}, + {0x1ED4, 0x1ED4}, + {0x1ED6, 0x1ED6}, + {0x1ED8, 0x1ED8}, + {0x1EDA, 0x1EDA}, + {0x1EDC, 0x1EDC}, + {0x1EDE, 0x1EDE}, + {0x1EE0, 0x1EE0}, + {0x1EE2, 0x1EE2}, + {0x1EE4, 0x1EE4}, + {0x1EE6, 0x1EE6}, + {0x1EE8, 0x1EE8}, + {0x1EEA, 0x1EEA}, + {0x1EEC, 0x1EEC}, + {0x1EEE, 0x1EEE}, + {0x1EF0, 0x1EF0}, + {0x1EF2, 0x1EF2}, + {0x1EF4, 0x1EF4}, + {0x1EF6, 0x1EF6}, + {0x1EF8, 0x1EF8}, + {0x1EFA, 0x1EFA}, + {0x1EFC, 0x1EFC}, + {0x1EFE, 0x1EFE}, + {0x1F08, 0x1F0F}, + {0x1F18, 0x1F1D}, + {0x1F28, 0x1F2F}, + {0x1F38, 0x1F3F}, + {0x1F48, 0x1F4D}, + {0x1F59, 0x1F59}, + {0x1F5B, 0x1F5B}, + {0x1F5D, 0x1F5D}, + {0x1F5F, 0x1F5F}, + {0x1F68, 0x1F6F}, + {0x1FB8, 0x1FBB}, + {0x1FC8, 0x1FCB}, + {0x1FD8, 0x1FDB}, + {0x1FE8, 0x1FEC}, + {0x1FF8, 0x1FFB}, + {0x2102, 0x2102}, + {0x2107, 0x2107}, + {0x210B, 0x210D}, + {0x2110, 0x2112}, + {0x2115, 0x2115}, + {0x2119, 0x211D}, + {0x2124, 0x2124}, + {0x2126, 0x2126}, + {0x2128, 0x2128}, + {0x212A, 0x212D}, + {0x2130, 0x2133}, + {0x213E, 0x213F}, + {0x2145, 0x2145}, + {0x2160, 0x216F}, + {0x2183, 0x2183}, + {0x24B6, 0x24CF}, + {0x2C00, 0x2C2F}, + {0x2C60, 0x2C60}, + {0x2C62, 0x2C64}, + {0x2C67, 0x2C67}, + {0x2C69, 0x2C69}, + {0x2C6B, 0x2C6B}, + {0x2C6D, 0x2C70}, + {0x2C72, 0x2C72}, + {0x2C75, 0x2C75}, + {0x2C7E, 0x2C80}, + {0x2C82, 0x2C82}, + {0x2C84, 0x2C84}, + {0x2C86, 0x2C86}, + {0x2C88, 0x2C88}, + {0x2C8A, 0x2C8A}, + {0x2C8C, 0x2C8C}, + {0x2C8E, 0x2C8E}, + {0x2C90, 0x2C90}, + {0x2C92, 0x2C92}, + {0x2C94, 0x2C94}, + {0x2C96, 0x2C96}, + {0x2C98, 0x2C98}, + {0x2C9A, 0x2C9A}, + {0x2C9C, 0x2C9C}, + {0x2C9E, 0x2C9E}, + {0x2CA0, 0x2CA0}, + {0x2CA2, 0x2CA2}, + {0x2CA4, 0x2CA4}, + {0x2CA6, 0x2CA6}, + {0x2CA8, 0x2CA8}, + {0x2CAA, 0x2CAA}, + {0x2CAC, 0x2CAC}, + {0x2CAE, 0x2CAE}, + {0x2CB0, 0x2CB0}, + {0x2CB2, 0x2CB2}, + {0x2CB4, 0x2CB4}, + {0x2CB6, 0x2CB6}, + {0x2CB8, 0x2CB8}, + {0x2CBA, 0x2CBA}, + {0x2CBC, 0x2CBC}, + {0x2CBE, 0x2CBE}, + {0x2CC0, 0x2CC0}, + {0x2CC2, 0x2CC2}, + {0x2CC4, 0x2CC4}, + {0x2CC6, 0x2CC6}, + {0x2CC8, 0x2CC8}, + {0x2CCA, 0x2CCA}, + {0x2CCC, 0x2CCC}, + {0x2CCE, 0x2CCE}, + {0x2CD0, 0x2CD0}, + {0x2CD2, 0x2CD2}, + {0x2CD4, 0x2CD4}, + {0x2CD6, 0x2CD6}, + {0x2CD8, 0x2CD8}, + {0x2CDA, 0x2CDA}, + {0x2CDC, 0x2CDC}, + {0x2CDE, 0x2CDE}, + {0x2CE0, 0x2CE0}, + {0x2CE2, 0x2CE2}, + {0x2CEB, 0x2CEB}, + {0x2CED, 0x2CED}, + {0x2CF2, 0x2CF2}, + {0xA640, 0xA640}, + {0xA642, 0xA642}, + {0xA644, 0xA644}, + {0xA646, 0xA646}, + {0xA648, 0xA648}, + {0xA64A, 0xA64A}, + {0xA64C, 0xA64C}, + {0xA64E, 0xA64E}, + {0xA650, 0xA650}, + {0xA652, 0xA652}, + {0xA654, 0xA654}, + {0xA656, 0xA656}, + {0xA658, 0xA658}, + {0xA65A, 0xA65A}, + {0xA65C, 0xA65C}, + {0xA65E, 0xA65E}, + {0xA660, 0xA660}, + {0xA662, 0xA662}, + {0xA664, 0xA664}, + {0xA666, 0xA666}, + {0xA668, 0xA668}, + {0xA66A, 0xA66A}, + {0xA66C, 0xA66C}, + {0xA680, 0xA680}, + {0xA682, 0xA682}, + {0xA684, 0xA684}, + {0xA686, 0xA686}, + {0xA688, 0xA688}, + {0xA68A, 0xA68A}, + {0xA68C, 0xA68C}, + {0xA68E, 0xA68E}, + {0xA690, 0xA690}, + {0xA692, 0xA692}, + {0xA694, 0xA694}, + {0xA696, 0xA696}, + {0xA698, 0xA698}, + {0xA69A, 0xA69A}, + {0xA722, 0xA722}, + {0xA724, 0xA724}, + {0xA726, 0xA726}, + {0xA728, 0xA728}, + {0xA72A, 0xA72A}, + {0xA72C, 0xA72C}, + {0xA72E, 0xA72E}, + {0xA732, 0xA732}, + {0xA734, 0xA734}, + {0xA736, 0xA736}, + {0xA738, 0xA738}, + {0xA73A, 0xA73A}, + {0xA73C, 0xA73C}, + {0xA73E, 0xA73E}, + {0xA740, 0xA740}, + {0xA742, 0xA742}, + {0xA744, 0xA744}, + {0xA746, 0xA746}, + {0xA748, 0xA748}, + {0xA74A, 0xA74A}, + {0xA74C, 0xA74C}, + {0xA74E, 0xA74E}, + {0xA750, 0xA750}, + {0xA752, 0xA752}, + {0xA754, 0xA754}, + {0xA756, 0xA756}, + {0xA758, 0xA758}, + {0xA75A, 0xA75A}, + {0xA75C, 0xA75C}, + {0xA75E, 0xA75E}, + {0xA760, 0xA760}, + {0xA762, 0xA762}, + {0xA764, 0xA764}, + {0xA766, 0xA766}, + {0xA768, 0xA768}, + {0xA76A, 0xA76A}, + {0xA76C, 0xA76C}, + {0xA76E, 0xA76E}, + {0xA779, 0xA779}, + {0xA77B, 0xA77B}, + {0xA77D, 0xA77E}, + {0xA780, 0xA780}, + {0xA782, 0xA782}, + {0xA784, 0xA784}, + {0xA786, 0xA786}, + {0xA78B, 0xA78B}, + {0xA78D, 0xA78D}, + {0xA790, 0xA790}, + {0xA792, 0xA792}, + {0xA796, 0xA796}, + {0xA798, 0xA798}, + {0xA79A, 0xA79A}, + {0xA79C, 0xA79C}, + {0xA79E, 0xA79E}, + {0xA7A0, 0xA7A0}, + {0xA7A2, 0xA7A2}, + {0xA7A4, 0xA7A4}, + {0xA7A6, 0xA7A6}, + {0xA7A8, 0xA7A8}, + {0xA7AA, 0xA7AE}, + {0xA7B0, 0xA7B4}, + {0xA7B6, 0xA7B6}, + {0xA7B8, 0xA7B8}, + {0xA7BA, 0xA7BA}, + {0xA7BC, 0xA7BC}, + {0xA7BE, 0xA7BE}, + {0xA7C0, 0xA7C0}, + {0xA7C2, 0xA7C2}, + {0xA7C4, 0xA7C7}, + {0xA7C9, 0xA7C9}, + {0xA7CB, 0xA7CC}, + {0xA7CE, 0xA7CE}, + {0xA7D0, 0xA7D0}, + {0xA7D2, 0xA7D2}, + {0xA7D4, 0xA7D4}, + {0xA7D6, 0xA7D6}, + {0xA7D8, 0xA7D8}, + {0xA7DA, 0xA7DA}, + {0xA7DC, 0xA7DC}, + {0xA7F5, 0xA7F5}, + {0xFF21, 0xFF3A}, + {0x10400, 0x10427}, + {0x104B0, 0x104D3}, + {0x10570, 0x1057A}, + {0x1057C, 0x1058A}, + {0x1058C, 0x10592}, + {0x10594, 0x10595}, + {0x10C80, 0x10CB2}, + {0x10D50, 0x10D65}, + {0x118A0, 0x118BF}, + {0x16E40, 0x16E5F}, + {0x16EA0, 0x16EB8}, + {0x1D400, 0x1D419}, + {0x1D434, 0x1D44D}, + {0x1D468, 0x1D481}, + {0x1D49C, 0x1D49C}, + {0x1D49E, 0x1D49F}, + {0x1D4A2, 0x1D4A2}, + {0x1D4A5, 0x1D4A6}, + {0x1D4A9, 0x1D4AC}, + {0x1D4AE, 0x1D4B5}, + {0x1D4D0, 0x1D4E9}, + {0x1D504, 0x1D505}, + {0x1D507, 0x1D50A}, + {0x1D50D, 0x1D514}, + {0x1D516, 0x1D51C}, + {0x1D538, 0x1D539}, + {0x1D53B, 0x1D53E}, + {0x1D540, 0x1D544}, + {0x1D546, 0x1D546}, + {0x1D54A, 0x1D550}, + {0x1D56C, 0x1D585}, + {0x1D5A0, 0x1D5B9}, + {0x1D5D4, 0x1D5ED}, + {0x1D608, 0x1D621}, + {0x1D63C, 0x1D655}, + {0x1D670, 0x1D689}, + {0x1D6A8, 0x1D6C0}, + {0x1D6E2, 0x1D6FA}, + {0x1D71C, 0x1D734}, + {0x1D756, 0x1D76E}, + {0x1D790, 0x1D7A8}, + {0x1D7CA, 0x1D7CA}, + {0x1E900, 0x1E921}, + {0x1F130, 0x1F149}, + {0x1F150, 0x1F169}, + {0x1F170, 0x1F189}, + }, + "XID_Continue": { + {0x30, 0x39}, + {0x41, 0x5A}, + {0x5F, 0x5F}, + {0x61, 0x7A}, + {0xAA, 0xAA}, + {0xB5, 0xB5}, + {0xB7, 0xB7}, + {0xBA, 0xBA}, + {0xC0, 0xD6}, + {0xD8, 0xF6}, + {0xF8, 0x2C1}, + {0x2C6, 0x2D1}, + {0x2E0, 0x2E4}, + {0x2EC, 0x2EC}, + {0x2EE, 0x2EE}, + {0x300, 0x374}, + {0x376, 0x377}, + {0x37B, 0x37D}, + {0x37F, 0x37F}, + {0x386, 0x38A}, + {0x38C, 0x38C}, + {0x38E, 0x3A1}, + {0x3A3, 0x3F5}, + {0x3F7, 0x481}, + {0x483, 0x487}, + {0x48A, 0x52F}, + {0x531, 0x556}, + {0x559, 0x559}, + {0x560, 0x588}, + {0x591, 0x5BD}, + {0x5BF, 0x5BF}, + {0x5C1, 0x5C2}, + {0x5C4, 0x5C5}, + {0x5C7, 0x5C7}, + {0x5D0, 0x5EA}, + {0x5EF, 0x5F2}, + {0x610, 0x61A}, + {0x620, 0x669}, + {0x66E, 0x6D3}, + {0x6D5, 0x6DC}, + {0x6DF, 0x6E8}, + {0x6EA, 0x6FC}, + {0x6FF, 0x6FF}, + {0x710, 0x74A}, + {0x74D, 0x7B1}, + {0x7C0, 0x7F5}, + {0x7FA, 0x7FA}, + {0x7FD, 0x7FD}, + {0x800, 0x82D}, + {0x840, 0x85B}, + {0x860, 0x86A}, + {0x870, 0x887}, + {0x889, 0x88F}, + {0x897, 0x8E1}, + {0x8E3, 0x963}, + {0x966, 0x96F}, + {0x971, 0x983}, + {0x985, 0x98C}, + {0x98F, 0x990}, + {0x993, 0x9A8}, + {0x9AA, 0x9B0}, + {0x9B2, 0x9B2}, + {0x9B6, 0x9B9}, + {0x9BC, 0x9C4}, + {0x9C7, 0x9C8}, + {0x9CB, 0x9CE}, + {0x9D7, 0x9D7}, + {0x9DC, 0x9DD}, + {0x9DF, 0x9E3}, + {0x9E6, 0x9F1}, + {0x9FC, 0x9FC}, + {0x9FE, 0x9FE}, + {0xA01, 0xA03}, + {0xA05, 0xA0A}, + {0xA0F, 0xA10}, + {0xA13, 0xA28}, + {0xA2A, 0xA30}, + {0xA32, 0xA33}, + {0xA35, 0xA36}, + {0xA38, 0xA39}, + {0xA3C, 0xA3C}, + {0xA3E, 0xA42}, + {0xA47, 0xA48}, + {0xA4B, 0xA4D}, + {0xA51, 0xA51}, + {0xA59, 0xA5C}, + {0xA5E, 0xA5E}, + {0xA66, 0xA75}, + {0xA81, 0xA83}, + {0xA85, 0xA8D}, + {0xA8F, 0xA91}, + {0xA93, 0xAA8}, + {0xAAA, 0xAB0}, + {0xAB2, 0xAB3}, + {0xAB5, 0xAB9}, + {0xABC, 0xAC5}, + {0xAC7, 0xAC9}, + {0xACB, 0xACD}, + {0xAD0, 0xAD0}, + {0xAE0, 0xAE3}, + {0xAE6, 0xAEF}, + {0xAF9, 0xAFF}, + {0xB01, 0xB03}, + {0xB05, 0xB0C}, + {0xB0F, 0xB10}, + {0xB13, 0xB28}, + {0xB2A, 0xB30}, + {0xB32, 0xB33}, + {0xB35, 0xB39}, + {0xB3C, 0xB44}, + {0xB47, 0xB48}, + {0xB4B, 0xB4D}, + {0xB55, 0xB57}, + {0xB5C, 0xB5D}, + {0xB5F, 0xB63}, + {0xB66, 0xB6F}, + {0xB71, 0xB71}, + {0xB82, 0xB83}, + {0xB85, 0xB8A}, + {0xB8E, 0xB90}, + {0xB92, 0xB95}, + {0xB99, 0xB9A}, + {0xB9C, 0xB9C}, + {0xB9E, 0xB9F}, + {0xBA3, 0xBA4}, + {0xBA8, 0xBAA}, + {0xBAE, 0xBB9}, + {0xBBE, 0xBC2}, + {0xBC6, 0xBC8}, + {0xBCA, 0xBCD}, + {0xBD0, 0xBD0}, + {0xBD7, 0xBD7}, + {0xBE6, 0xBEF}, + {0xC00, 0xC0C}, + {0xC0E, 0xC10}, + {0xC12, 0xC28}, + {0xC2A, 0xC39}, + {0xC3C, 0xC44}, + {0xC46, 0xC48}, + {0xC4A, 0xC4D}, + {0xC55, 0xC56}, + {0xC58, 0xC5A}, + {0xC5C, 0xC5D}, + {0xC60, 0xC63}, + {0xC66, 0xC6F}, + {0xC80, 0xC83}, + {0xC85, 0xC8C}, + {0xC8E, 0xC90}, + {0xC92, 0xCA8}, + {0xCAA, 0xCB3}, + {0xCB5, 0xCB9}, + {0xCBC, 0xCC4}, + {0xCC6, 0xCC8}, + {0xCCA, 0xCCD}, + {0xCD5, 0xCD6}, + {0xCDC, 0xCDE}, + {0xCE0, 0xCE3}, + {0xCE6, 0xCEF}, + {0xCF1, 0xCF3}, + {0xD00, 0xD0C}, + {0xD0E, 0xD10}, + {0xD12, 0xD44}, + {0xD46, 0xD48}, + {0xD4A, 0xD4E}, + {0xD54, 0xD57}, + {0xD5F, 0xD63}, + {0xD66, 0xD6F}, + {0xD7A, 0xD7F}, + {0xD81, 0xD83}, + {0xD85, 0xD96}, + {0xD9A, 0xDB1}, + {0xDB3, 0xDBB}, + {0xDBD, 0xDBD}, + {0xDC0, 0xDC6}, + {0xDCA, 0xDCA}, + {0xDCF, 0xDD4}, + {0xDD6, 0xDD6}, + {0xDD8, 0xDDF}, + {0xDE6, 0xDEF}, + {0xDF2, 0xDF3}, + {0xE01, 0xE3A}, + {0xE40, 0xE4E}, + {0xE50, 0xE59}, + {0xE81, 0xE82}, + {0xE84, 0xE84}, + {0xE86, 0xE8A}, + {0xE8C, 0xEA3}, + {0xEA5, 0xEA5}, + {0xEA7, 0xEBD}, + {0xEC0, 0xEC4}, + {0xEC6, 0xEC6}, + {0xEC8, 0xECE}, + {0xED0, 0xED9}, + {0xEDC, 0xEDF}, + {0xF00, 0xF00}, + {0xF18, 0xF19}, + {0xF20, 0xF29}, + {0xF35, 0xF35}, + {0xF37, 0xF37}, + {0xF39, 0xF39}, + {0xF3E, 0xF47}, + {0xF49, 0xF6C}, + {0xF71, 0xF84}, + {0xF86, 0xF97}, + {0xF99, 0xFBC}, + {0xFC6, 0xFC6}, + {0x1000, 0x1049}, + {0x1050, 0x109D}, + {0x10A0, 0x10C5}, + {0x10C7, 0x10C7}, + {0x10CD, 0x10CD}, + {0x10D0, 0x10FA}, + {0x10FC, 0x1248}, + {0x124A, 0x124D}, + {0x1250, 0x1256}, + {0x1258, 0x1258}, + {0x125A, 0x125D}, + {0x1260, 0x1288}, + {0x128A, 0x128D}, + {0x1290, 0x12B0}, + {0x12B2, 0x12B5}, + {0x12B8, 0x12BE}, + {0x12C0, 0x12C0}, + {0x12C2, 0x12C5}, + {0x12C8, 0x12D6}, + {0x12D8, 0x1310}, + {0x1312, 0x1315}, + {0x1318, 0x135A}, + {0x135D, 0x135F}, + {0x1369, 0x1371}, + {0x1380, 0x138F}, + {0x13A0, 0x13F5}, + {0x13F8, 0x13FD}, + {0x1401, 0x166C}, + {0x166F, 0x167F}, + {0x1681, 0x169A}, + {0x16A0, 0x16EA}, + {0x16EE, 0x16F8}, + {0x1700, 0x1715}, + {0x171F, 0x1734}, + {0x1740, 0x1753}, + {0x1760, 0x176C}, + {0x176E, 0x1770}, + {0x1772, 0x1773}, + {0x1780, 0x17D3}, + {0x17D7, 0x17D7}, + {0x17DC, 0x17DD}, + {0x17E0, 0x17E9}, + {0x180B, 0x180D}, + {0x180F, 0x1819}, + {0x1820, 0x1878}, + {0x1880, 0x18AA}, + {0x18B0, 0x18F5}, + {0x1900, 0x191E}, + {0x1920, 0x192B}, + {0x1930, 0x193B}, + {0x1946, 0x196D}, + {0x1970, 0x1974}, + {0x1980, 0x19AB}, + {0x19B0, 0x19C9}, + {0x19D0, 0x19DA}, + {0x1A00, 0x1A1B}, + {0x1A20, 0x1A5E}, + {0x1A60, 0x1A7C}, + {0x1A7F, 0x1A89}, + {0x1A90, 0x1A99}, + {0x1AA7, 0x1AA7}, + {0x1AB0, 0x1ABD}, + {0x1ABF, 0x1ADD}, + {0x1AE0, 0x1AEB}, + {0x1B00, 0x1B4C}, + {0x1B50, 0x1B59}, + {0x1B6B, 0x1B73}, + {0x1B80, 0x1BF3}, + {0x1C00, 0x1C37}, + {0x1C40, 0x1C49}, + {0x1C4D, 0x1C7D}, + {0x1C80, 0x1C8A}, + {0x1C90, 0x1CBA}, + {0x1CBD, 0x1CBF}, + {0x1CD0, 0x1CD2}, + {0x1CD4, 0x1CFA}, + {0x1D00, 0x1F15}, + {0x1F18, 0x1F1D}, + {0x1F20, 0x1F45}, + {0x1F48, 0x1F4D}, + {0x1F50, 0x1F57}, + {0x1F59, 0x1F59}, + {0x1F5B, 0x1F5B}, + {0x1F5D, 0x1F5D}, + {0x1F5F, 0x1F7D}, + {0x1F80, 0x1FB4}, + {0x1FB6, 0x1FBC}, + {0x1FBE, 0x1FBE}, + {0x1FC2, 0x1FC4}, + {0x1FC6, 0x1FCC}, + {0x1FD0, 0x1FD3}, + {0x1FD6, 0x1FDB}, + {0x1FE0, 0x1FEC}, + {0x1FF2, 0x1FF4}, + {0x1FF6, 0x1FFC}, + {0x200C, 0x200D}, + {0x203F, 0x2040}, + {0x2054, 0x2054}, + {0x2071, 0x2071}, + {0x207F, 0x207F}, + {0x2090, 0x209C}, + {0x20D0, 0x20DC}, + {0x20E1, 0x20E1}, + {0x20E5, 0x20F0}, + {0x2102, 0x2102}, + {0x2107, 0x2107}, + {0x210A, 0x2113}, + {0x2115, 0x2115}, + {0x2118, 0x211D}, + {0x2124, 0x2124}, + {0x2126, 0x2126}, + {0x2128, 0x2128}, + {0x212A, 0x2139}, + {0x213C, 0x213F}, + {0x2145, 0x2149}, + {0x214E, 0x214E}, + {0x2160, 0x2188}, + {0x2C00, 0x2CE4}, + {0x2CEB, 0x2CF3}, + {0x2D00, 0x2D25}, + {0x2D27, 0x2D27}, + {0x2D2D, 0x2D2D}, + {0x2D30, 0x2D67}, + {0x2D6F, 0x2D6F}, + {0x2D7F, 0x2D96}, + {0x2DA0, 0x2DA6}, + {0x2DA8, 0x2DAE}, + {0x2DB0, 0x2DB6}, + {0x2DB8, 0x2DBE}, + {0x2DC0, 0x2DC6}, + {0x2DC8, 0x2DCE}, + {0x2DD0, 0x2DD6}, + {0x2DD8, 0x2DDE}, + {0x2DE0, 0x2DFF}, + {0x3005, 0x3007}, + {0x3021, 0x302F}, + {0x3031, 0x3035}, + {0x3038, 0x303C}, + {0x3041, 0x3096}, + {0x3099, 0x309A}, + {0x309D, 0x309F}, + {0x30A1, 0x30FF}, + {0x3105, 0x312F}, + {0x3131, 0x318E}, + {0x31A0, 0x31BF}, + {0x31F0, 0x31FF}, + {0x3400, 0x4DBF}, + {0x4E00, 0xA48C}, + {0xA4D0, 0xA4FD}, + {0xA500, 0xA60C}, + {0xA610, 0xA62B}, + {0xA640, 0xA66F}, + {0xA674, 0xA67D}, + {0xA67F, 0xA6F1}, + {0xA717, 0xA71F}, + {0xA722, 0xA788}, + {0xA78B, 0xA7DC}, + {0xA7F1, 0xA827}, + {0xA82C, 0xA82C}, + {0xA840, 0xA873}, + {0xA880, 0xA8C5}, + {0xA8D0, 0xA8D9}, + {0xA8E0, 0xA8F7}, + {0xA8FB, 0xA8FB}, + {0xA8FD, 0xA92D}, + {0xA930, 0xA953}, + {0xA960, 0xA97C}, + {0xA980, 0xA9C0}, + {0xA9CF, 0xA9D9}, + {0xA9E0, 0xA9FE}, + {0xAA00, 0xAA36}, + {0xAA40, 0xAA4D}, + {0xAA50, 0xAA59}, + {0xAA60, 0xAA76}, + {0xAA7A, 0xAAC2}, + {0xAADB, 0xAADD}, + {0xAAE0, 0xAAEF}, + {0xAAF2, 0xAAF6}, + {0xAB01, 0xAB06}, + {0xAB09, 0xAB0E}, + {0xAB11, 0xAB16}, + {0xAB20, 0xAB26}, + {0xAB28, 0xAB2E}, + {0xAB30, 0xAB5A}, + {0xAB5C, 0xAB69}, + {0xAB70, 0xABEA}, + {0xABEC, 0xABED}, + {0xABF0, 0xABF9}, + {0xAC00, 0xD7A3}, + {0xD7B0, 0xD7C6}, + {0xD7CB, 0xD7FB}, + {0xF900, 0xFA6D}, + {0xFA70, 0xFAD9}, + {0xFB00, 0xFB06}, + {0xFB13, 0xFB17}, + {0xFB1D, 0xFB28}, + {0xFB2A, 0xFB36}, + {0xFB38, 0xFB3C}, + {0xFB3E, 0xFB3E}, + {0xFB40, 0xFB41}, + {0xFB43, 0xFB44}, + {0xFB46, 0xFBB1}, + {0xFBD3, 0xFC5D}, + {0xFC64, 0xFD3D}, + {0xFD50, 0xFD8F}, + {0xFD92, 0xFDC7}, + {0xFDF0, 0xFDF9}, + {0xFE00, 0xFE0F}, + {0xFE20, 0xFE2F}, + {0xFE33, 0xFE34}, + {0xFE4D, 0xFE4F}, + {0xFE71, 0xFE71}, + {0xFE73, 0xFE73}, + {0xFE77, 0xFE77}, + {0xFE79, 0xFE79}, + {0xFE7B, 0xFE7B}, + {0xFE7D, 0xFE7D}, + {0xFE7F, 0xFEFC}, + {0xFF10, 0xFF19}, + {0xFF21, 0xFF3A}, + {0xFF3F, 0xFF3F}, + {0xFF41, 0xFF5A}, + {0xFF65, 0xFFBE}, + {0xFFC2, 0xFFC7}, + {0xFFCA, 0xFFCF}, + {0xFFD2, 0xFFD7}, + {0xFFDA, 0xFFDC}, + {0x10000, 0x1000B}, + {0x1000D, 0x10026}, + {0x10028, 0x1003A}, + {0x1003C, 0x1003D}, + {0x1003F, 0x1004D}, + {0x10050, 0x1005D}, + {0x10080, 0x100FA}, + {0x10140, 0x10174}, + {0x101FD, 0x101FD}, + {0x10280, 0x1029C}, + {0x102A0, 0x102D0}, + {0x102E0, 0x102E0}, + {0x10300, 0x1031F}, + {0x1032D, 0x1034A}, + {0x10350, 0x1037A}, + {0x10380, 0x1039D}, + {0x103A0, 0x103C3}, + {0x103C8, 0x103CF}, + {0x103D1, 0x103D5}, + {0x10400, 0x1049D}, + {0x104A0, 0x104A9}, + {0x104B0, 0x104D3}, + {0x104D8, 0x104FB}, + {0x10500, 0x10527}, + {0x10530, 0x10563}, + {0x10570, 0x1057A}, + {0x1057C, 0x1058A}, + {0x1058C, 0x10592}, + {0x10594, 0x10595}, + {0x10597, 0x105A1}, + {0x105A3, 0x105B1}, + {0x105B3, 0x105B9}, + {0x105BB, 0x105BC}, + {0x105C0, 0x105F3}, + {0x10600, 0x10736}, + {0x10740, 0x10755}, + {0x10760, 0x10767}, + {0x10780, 0x10785}, + {0x10787, 0x107B0}, + {0x107B2, 0x107BA}, + {0x10800, 0x10805}, + {0x10808, 0x10808}, + {0x1080A, 0x10835}, + {0x10837, 0x10838}, + {0x1083C, 0x1083C}, + {0x1083F, 0x10855}, + {0x10860, 0x10876}, + {0x10880, 0x1089E}, + {0x108E0, 0x108F2}, + {0x108F4, 0x108F5}, + {0x10900, 0x10915}, + {0x10920, 0x10939}, + {0x10940, 0x10959}, + {0x10980, 0x109B7}, + {0x109BE, 0x109BF}, + {0x10A00, 0x10A03}, + {0x10A05, 0x10A06}, + {0x10A0C, 0x10A13}, + {0x10A15, 0x10A17}, + {0x10A19, 0x10A35}, + {0x10A38, 0x10A3A}, + {0x10A3F, 0x10A3F}, + {0x10A60, 0x10A7C}, + {0x10A80, 0x10A9C}, + {0x10AC0, 0x10AC7}, + {0x10AC9, 0x10AE6}, + {0x10B00, 0x10B35}, + {0x10B40, 0x10B55}, + {0x10B60, 0x10B72}, + {0x10B80, 0x10B91}, + {0x10C00, 0x10C48}, + {0x10C80, 0x10CB2}, + {0x10CC0, 0x10CF2}, + {0x10D00, 0x10D27}, + {0x10D30, 0x10D39}, + {0x10D40, 0x10D65}, + {0x10D69, 0x10D6D}, + {0x10D6F, 0x10D85}, + {0x10E80, 0x10EA9}, + {0x10EAB, 0x10EAC}, + {0x10EB0, 0x10EB1}, + {0x10EC2, 0x10EC7}, + {0x10EFA, 0x10F1C}, + {0x10F27, 0x10F27}, + {0x10F30, 0x10F50}, + {0x10F70, 0x10F85}, + {0x10FB0, 0x10FC4}, + {0x10FE0, 0x10FF6}, + {0x11000, 0x11046}, + {0x11066, 0x11075}, + {0x1107F, 0x110BA}, + {0x110C2, 0x110C2}, + {0x110D0, 0x110E8}, + {0x110F0, 0x110F9}, + {0x11100, 0x11134}, + {0x11136, 0x1113F}, + {0x11144, 0x11147}, + {0x11150, 0x11173}, + {0x11176, 0x11176}, + {0x11180, 0x111C4}, + {0x111C9, 0x111CC}, + {0x111CE, 0x111DA}, + {0x111DC, 0x111DC}, + {0x11200, 0x11211}, + {0x11213, 0x11237}, + {0x1123E, 0x11241}, + {0x11280, 0x11286}, + {0x11288, 0x11288}, + {0x1128A, 0x1128D}, + {0x1128F, 0x1129D}, + {0x1129F, 0x112A8}, + {0x112B0, 0x112EA}, + {0x112F0, 0x112F9}, + {0x11300, 0x11303}, + {0x11305, 0x1130C}, + {0x1130F, 0x11310}, + {0x11313, 0x11328}, + {0x1132A, 0x11330}, + {0x11332, 0x11333}, + {0x11335, 0x11339}, + {0x1133B, 0x11344}, + {0x11347, 0x11348}, + {0x1134B, 0x1134D}, + {0x11350, 0x11350}, + {0x11357, 0x11357}, + {0x1135D, 0x11363}, + {0x11366, 0x1136C}, + {0x11370, 0x11374}, + {0x11380, 0x11389}, + {0x1138B, 0x1138B}, + {0x1138E, 0x1138E}, + {0x11390, 0x113B5}, + {0x113B7, 0x113C0}, + {0x113C2, 0x113C2}, + {0x113C5, 0x113C5}, + {0x113C7, 0x113CA}, + {0x113CC, 0x113D3}, + {0x113E1, 0x113E2}, + {0x11400, 0x1144A}, + {0x11450, 0x11459}, + {0x1145E, 0x11461}, + {0x11480, 0x114C5}, + {0x114C7, 0x114C7}, + {0x114D0, 0x114D9}, + {0x11580, 0x115B5}, + {0x115B8, 0x115C0}, + {0x115D8, 0x115DD}, + {0x11600, 0x11640}, + {0x11644, 0x11644}, + {0x11650, 0x11659}, + {0x11680, 0x116B8}, + {0x116C0, 0x116C9}, + {0x116D0, 0x116E3}, + {0x11700, 0x1171A}, + {0x1171D, 0x1172B}, + {0x11730, 0x11739}, + {0x11740, 0x11746}, + {0x11800, 0x1183A}, + {0x118A0, 0x118E9}, + {0x118FF, 0x11906}, + {0x11909, 0x11909}, + {0x1190C, 0x11913}, + {0x11915, 0x11916}, + {0x11918, 0x11935}, + {0x11937, 0x11938}, + {0x1193B, 0x11943}, + {0x11950, 0x11959}, + {0x119A0, 0x119A7}, + {0x119AA, 0x119D7}, + {0x119DA, 0x119E1}, + {0x119E3, 0x119E4}, + {0x11A00, 0x11A3E}, + {0x11A47, 0x11A47}, + {0x11A50, 0x11A99}, + {0x11A9D, 0x11A9D}, + {0x11AB0, 0x11AF8}, + {0x11B60, 0x11B67}, + {0x11BC0, 0x11BE0}, + {0x11BF0, 0x11BF9}, + {0x11C00, 0x11C08}, + {0x11C0A, 0x11C36}, + {0x11C38, 0x11C40}, + {0x11C50, 0x11C59}, + {0x11C72, 0x11C8F}, + {0x11C92, 0x11CA7}, + {0x11CA9, 0x11CB6}, + {0x11D00, 0x11D06}, + {0x11D08, 0x11D09}, + {0x11D0B, 0x11D36}, + {0x11D3A, 0x11D3A}, + {0x11D3C, 0x11D3D}, + {0x11D3F, 0x11D47}, + {0x11D50, 0x11D59}, + {0x11D60, 0x11D65}, + {0x11D67, 0x11D68}, + {0x11D6A, 0x11D8E}, + {0x11D90, 0x11D91}, + {0x11D93, 0x11D98}, + {0x11DA0, 0x11DA9}, + {0x11DB0, 0x11DDB}, + {0x11DE0, 0x11DE9}, + {0x11EE0, 0x11EF6}, + {0x11F00, 0x11F10}, + {0x11F12, 0x11F3A}, + {0x11F3E, 0x11F42}, + {0x11F50, 0x11F5A}, + {0x11FB0, 0x11FB0}, + {0x12000, 0x12399}, + {0x12400, 0x1246E}, + {0x12480, 0x12543}, + {0x12F90, 0x12FF0}, + {0x13000, 0x1342F}, + {0x13440, 0x13455}, + {0x13460, 0x143FA}, + {0x14400, 0x14646}, + {0x16100, 0x16139}, + {0x16800, 0x16A38}, + {0x16A40, 0x16A5E}, + {0x16A60, 0x16A69}, + {0x16A70, 0x16ABE}, + {0x16AC0, 0x16AC9}, + {0x16AD0, 0x16AED}, + {0x16AF0, 0x16AF4}, + {0x16B00, 0x16B36}, + {0x16B40, 0x16B43}, + {0x16B50, 0x16B59}, + {0x16B63, 0x16B77}, + {0x16B7D, 0x16B8F}, + {0x16D40, 0x16D6C}, + {0x16D70, 0x16D79}, + {0x16E40, 0x16E7F}, + {0x16EA0, 0x16EB8}, + {0x16EBB, 0x16ED3}, + {0x16F00, 0x16F4A}, + {0x16F4F, 0x16F87}, + {0x16F8F, 0x16F9F}, + {0x16FE0, 0x16FE1}, + {0x16FE3, 0x16FE4}, + {0x16FF0, 0x16FF6}, + {0x17000, 0x18CD5}, + {0x18CFF, 0x18D1E}, + {0x18D80, 0x18DF2}, + {0x1AFF0, 0x1AFF3}, + {0x1AFF5, 0x1AFFB}, + {0x1AFFD, 0x1AFFE}, + {0x1B000, 0x1B122}, + {0x1B132, 0x1B132}, + {0x1B150, 0x1B152}, + {0x1B155, 0x1B155}, + {0x1B164, 0x1B167}, + {0x1B170, 0x1B2FB}, + {0x1BC00, 0x1BC6A}, + {0x1BC70, 0x1BC7C}, + {0x1BC80, 0x1BC88}, + {0x1BC90, 0x1BC99}, + {0x1BC9D, 0x1BC9E}, + {0x1CCF0, 0x1CCF9}, + {0x1CF00, 0x1CF2D}, + {0x1CF30, 0x1CF46}, + {0x1D165, 0x1D169}, + {0x1D16D, 0x1D172}, + {0x1D17B, 0x1D182}, + {0x1D185, 0x1D18B}, + {0x1D1AA, 0x1D1AD}, + {0x1D242, 0x1D244}, + {0x1D400, 0x1D454}, + {0x1D456, 0x1D49C}, + {0x1D49E, 0x1D49F}, + {0x1D4A2, 0x1D4A2}, + {0x1D4A5, 0x1D4A6}, + {0x1D4A9, 0x1D4AC}, + {0x1D4AE, 0x1D4B9}, + {0x1D4BB, 0x1D4BB}, + {0x1D4BD, 0x1D4C3}, + {0x1D4C5, 0x1D505}, + {0x1D507, 0x1D50A}, + {0x1D50D, 0x1D514}, + {0x1D516, 0x1D51C}, + {0x1D51E, 0x1D539}, + {0x1D53B, 0x1D53E}, + {0x1D540, 0x1D544}, + {0x1D546, 0x1D546}, + {0x1D54A, 0x1D550}, + {0x1D552, 0x1D6A5}, + {0x1D6A8, 0x1D6C0}, + {0x1D6C2, 0x1D6DA}, + {0x1D6DC, 0x1D6FA}, + {0x1D6FC, 0x1D714}, + {0x1D716, 0x1D734}, + {0x1D736, 0x1D74E}, + {0x1D750, 0x1D76E}, + {0x1D770, 0x1D788}, + {0x1D78A, 0x1D7A8}, + {0x1D7AA, 0x1D7C2}, + {0x1D7C4, 0x1D7CB}, + {0x1D7CE, 0x1D7FF}, + {0x1DA00, 0x1DA36}, + {0x1DA3B, 0x1DA6C}, + {0x1DA75, 0x1DA75}, + {0x1DA84, 0x1DA84}, + {0x1DA9B, 0x1DA9F}, + {0x1DAA1, 0x1DAAF}, + {0x1DF00, 0x1DF1E}, + {0x1DF25, 0x1DF2A}, + {0x1E000, 0x1E006}, + {0x1E008, 0x1E018}, + {0x1E01B, 0x1E021}, + {0x1E023, 0x1E024}, + {0x1E026, 0x1E02A}, + {0x1E030, 0x1E06D}, + {0x1E08F, 0x1E08F}, + {0x1E100, 0x1E12C}, + {0x1E130, 0x1E13D}, + {0x1E140, 0x1E149}, + {0x1E14E, 0x1E14E}, + {0x1E290, 0x1E2AE}, + {0x1E2C0, 0x1E2F9}, + {0x1E4D0, 0x1E4F9}, + {0x1E5D0, 0x1E5FA}, + {0x1E6C0, 0x1E6DE}, + {0x1E6E0, 0x1E6F5}, + {0x1E6FE, 0x1E6FF}, + {0x1E7E0, 0x1E7E6}, + {0x1E7E8, 0x1E7EB}, + {0x1E7ED, 0x1E7EE}, + {0x1E7F0, 0x1E7FE}, + {0x1E800, 0x1E8C4}, + {0x1E8D0, 0x1E8D6}, + {0x1E900, 0x1E94B}, + {0x1E950, 0x1E959}, + {0x1EE00, 0x1EE03}, + {0x1EE05, 0x1EE1F}, + {0x1EE21, 0x1EE22}, + {0x1EE24, 0x1EE24}, + {0x1EE27, 0x1EE27}, + {0x1EE29, 0x1EE32}, + {0x1EE34, 0x1EE37}, + {0x1EE39, 0x1EE39}, + {0x1EE3B, 0x1EE3B}, + {0x1EE42, 0x1EE42}, + {0x1EE47, 0x1EE47}, + {0x1EE49, 0x1EE49}, + {0x1EE4B, 0x1EE4B}, + {0x1EE4D, 0x1EE4F}, + {0x1EE51, 0x1EE52}, + {0x1EE54, 0x1EE54}, + {0x1EE57, 0x1EE57}, + {0x1EE59, 0x1EE59}, + {0x1EE5B, 0x1EE5B}, + {0x1EE5D, 0x1EE5D}, + {0x1EE5F, 0x1EE5F}, + {0x1EE61, 0x1EE62}, + {0x1EE64, 0x1EE64}, + {0x1EE67, 0x1EE6A}, + {0x1EE6C, 0x1EE72}, + {0x1EE74, 0x1EE77}, + {0x1EE79, 0x1EE7C}, + {0x1EE7E, 0x1EE7E}, + {0x1EE80, 0x1EE89}, + {0x1EE8B, 0x1EE9B}, + {0x1EEA1, 0x1EEA3}, + {0x1EEA5, 0x1EEA9}, + {0x1EEAB, 0x1EEBB}, + {0x1FBF0, 0x1FBF9}, + {0x20000, 0x2A6DF}, + {0x2A700, 0x2B81D}, + {0x2B820, 0x2CEAD}, + {0x2CEB0, 0x2EBE0}, + {0x2EBF0, 0x2EE5D}, + {0x2F800, 0x2FA1D}, + {0x30000, 0x3134A}, + {0x31350, 0x33479}, + {0xE0100, 0xE01EF}, + }, + "XID_Start": { + {0x41, 0x5A}, + {0x61, 0x7A}, + {0xAA, 0xAA}, + {0xB5, 0xB5}, + {0xBA, 0xBA}, + {0xC0, 0xD6}, + {0xD8, 0xF6}, + {0xF8, 0x2C1}, + {0x2C6, 0x2D1}, + {0x2E0, 0x2E4}, + {0x2EC, 0x2EC}, + {0x2EE, 0x2EE}, + {0x370, 0x374}, + {0x376, 0x377}, + {0x37B, 0x37D}, + {0x37F, 0x37F}, + {0x386, 0x386}, + {0x388, 0x38A}, + {0x38C, 0x38C}, + {0x38E, 0x3A1}, + {0x3A3, 0x3F5}, + {0x3F7, 0x481}, + {0x48A, 0x52F}, + {0x531, 0x556}, + {0x559, 0x559}, + {0x560, 0x588}, + {0x5D0, 0x5EA}, + {0x5EF, 0x5F2}, + {0x620, 0x64A}, + {0x66E, 0x66F}, + {0x671, 0x6D3}, + {0x6D5, 0x6D5}, + {0x6E5, 0x6E6}, + {0x6EE, 0x6EF}, + {0x6FA, 0x6FC}, + {0x6FF, 0x6FF}, + {0x710, 0x710}, + {0x712, 0x72F}, + {0x74D, 0x7A5}, + {0x7B1, 0x7B1}, + {0x7CA, 0x7EA}, + {0x7F4, 0x7F5}, + {0x7FA, 0x7FA}, + {0x800, 0x815}, + {0x81A, 0x81A}, + {0x824, 0x824}, + {0x828, 0x828}, + {0x840, 0x858}, + {0x860, 0x86A}, + {0x870, 0x887}, + {0x889, 0x88F}, + {0x8A0, 0x8C9}, + {0x904, 0x939}, + {0x93D, 0x93D}, + {0x950, 0x950}, + {0x958, 0x961}, + {0x971, 0x980}, + {0x985, 0x98C}, + {0x98F, 0x990}, + {0x993, 0x9A8}, + {0x9AA, 0x9B0}, + {0x9B2, 0x9B2}, + {0x9B6, 0x9B9}, + {0x9BD, 0x9BD}, + {0x9CE, 0x9CE}, + {0x9DC, 0x9DD}, + {0x9DF, 0x9E1}, + {0x9F0, 0x9F1}, + {0x9FC, 0x9FC}, + {0xA05, 0xA0A}, + {0xA0F, 0xA10}, + {0xA13, 0xA28}, + {0xA2A, 0xA30}, + {0xA32, 0xA33}, + {0xA35, 0xA36}, + {0xA38, 0xA39}, + {0xA59, 0xA5C}, + {0xA5E, 0xA5E}, + {0xA72, 0xA74}, + {0xA85, 0xA8D}, + {0xA8F, 0xA91}, + {0xA93, 0xAA8}, + {0xAAA, 0xAB0}, + {0xAB2, 0xAB3}, + {0xAB5, 0xAB9}, + {0xABD, 0xABD}, + {0xAD0, 0xAD0}, + {0xAE0, 0xAE1}, + {0xAF9, 0xAF9}, + {0xB05, 0xB0C}, + {0xB0F, 0xB10}, + {0xB13, 0xB28}, + {0xB2A, 0xB30}, + {0xB32, 0xB33}, + {0xB35, 0xB39}, + {0xB3D, 0xB3D}, + {0xB5C, 0xB5D}, + {0xB5F, 0xB61}, + {0xB71, 0xB71}, + {0xB83, 0xB83}, + {0xB85, 0xB8A}, + {0xB8E, 0xB90}, + {0xB92, 0xB95}, + {0xB99, 0xB9A}, + {0xB9C, 0xB9C}, + {0xB9E, 0xB9F}, + {0xBA3, 0xBA4}, + {0xBA8, 0xBAA}, + {0xBAE, 0xBB9}, + {0xBD0, 0xBD0}, + {0xC05, 0xC0C}, + {0xC0E, 0xC10}, + {0xC12, 0xC28}, + {0xC2A, 0xC39}, + {0xC3D, 0xC3D}, + {0xC58, 0xC5A}, + {0xC5C, 0xC5D}, + {0xC60, 0xC61}, + {0xC80, 0xC80}, + {0xC85, 0xC8C}, + {0xC8E, 0xC90}, + {0xC92, 0xCA8}, + {0xCAA, 0xCB3}, + {0xCB5, 0xCB9}, + {0xCBD, 0xCBD}, + {0xCDC, 0xCDE}, + {0xCE0, 0xCE1}, + {0xCF1, 0xCF2}, + {0xD04, 0xD0C}, + {0xD0E, 0xD10}, + {0xD12, 0xD3A}, + {0xD3D, 0xD3D}, + {0xD4E, 0xD4E}, + {0xD54, 0xD56}, + {0xD5F, 0xD61}, + {0xD7A, 0xD7F}, + {0xD85, 0xD96}, + {0xD9A, 0xDB1}, + {0xDB3, 0xDBB}, + {0xDBD, 0xDBD}, + {0xDC0, 0xDC6}, + {0xE01, 0xE30}, + {0xE32, 0xE32}, + {0xE40, 0xE46}, + {0xE81, 0xE82}, + {0xE84, 0xE84}, + {0xE86, 0xE8A}, + {0xE8C, 0xEA3}, + {0xEA5, 0xEA5}, + {0xEA7, 0xEB0}, + {0xEB2, 0xEB2}, + {0xEBD, 0xEBD}, + {0xEC0, 0xEC4}, + {0xEC6, 0xEC6}, + {0xEDC, 0xEDF}, + {0xF00, 0xF00}, + {0xF40, 0xF47}, + {0xF49, 0xF6C}, + {0xF88, 0xF8C}, + {0x1000, 0x102A}, + {0x103F, 0x103F}, + {0x1050, 0x1055}, + {0x105A, 0x105D}, + {0x1061, 0x1061}, + {0x1065, 0x1066}, + {0x106E, 0x1070}, + {0x1075, 0x1081}, + {0x108E, 0x108E}, + {0x10A0, 0x10C5}, + {0x10C7, 0x10C7}, + {0x10CD, 0x10CD}, + {0x10D0, 0x10FA}, + {0x10FC, 0x1248}, + {0x124A, 0x124D}, + {0x1250, 0x1256}, + {0x1258, 0x1258}, + {0x125A, 0x125D}, + {0x1260, 0x1288}, + {0x128A, 0x128D}, + {0x1290, 0x12B0}, + {0x12B2, 0x12B5}, + {0x12B8, 0x12BE}, + {0x12C0, 0x12C0}, + {0x12C2, 0x12C5}, + {0x12C8, 0x12D6}, + {0x12D8, 0x1310}, + {0x1312, 0x1315}, + {0x1318, 0x135A}, + {0x1380, 0x138F}, + {0x13A0, 0x13F5}, + {0x13F8, 0x13FD}, + {0x1401, 0x166C}, + {0x166F, 0x167F}, + {0x1681, 0x169A}, + {0x16A0, 0x16EA}, + {0x16EE, 0x16F8}, + {0x1700, 0x1711}, + {0x171F, 0x1731}, + {0x1740, 0x1751}, + {0x1760, 0x176C}, + {0x176E, 0x1770}, + {0x1780, 0x17B3}, + {0x17D7, 0x17D7}, + {0x17DC, 0x17DC}, + {0x1820, 0x1878}, + {0x1880, 0x18A8}, + {0x18AA, 0x18AA}, + {0x18B0, 0x18F5}, + {0x1900, 0x191E}, + {0x1950, 0x196D}, + {0x1970, 0x1974}, + {0x1980, 0x19AB}, + {0x19B0, 0x19C9}, + {0x1A00, 0x1A16}, + {0x1A20, 0x1A54}, + {0x1AA7, 0x1AA7}, + {0x1B05, 0x1B33}, + {0x1B45, 0x1B4C}, + {0x1B83, 0x1BA0}, + {0x1BAE, 0x1BAF}, + {0x1BBA, 0x1BE5}, + {0x1C00, 0x1C23}, + {0x1C4D, 0x1C4F}, + {0x1C5A, 0x1C7D}, + {0x1C80, 0x1C8A}, + {0x1C90, 0x1CBA}, + {0x1CBD, 0x1CBF}, + {0x1CE9, 0x1CEC}, + {0x1CEE, 0x1CF3}, + {0x1CF5, 0x1CF6}, + {0x1CFA, 0x1CFA}, + {0x1D00, 0x1DBF}, + {0x1E00, 0x1F15}, + {0x1F18, 0x1F1D}, + {0x1F20, 0x1F45}, + {0x1F48, 0x1F4D}, + {0x1F50, 0x1F57}, + {0x1F59, 0x1F59}, + {0x1F5B, 0x1F5B}, + {0x1F5D, 0x1F5D}, + {0x1F5F, 0x1F7D}, + {0x1F80, 0x1FB4}, + {0x1FB6, 0x1FBC}, + {0x1FBE, 0x1FBE}, + {0x1FC2, 0x1FC4}, + {0x1FC6, 0x1FCC}, + {0x1FD0, 0x1FD3}, + {0x1FD6, 0x1FDB}, + {0x1FE0, 0x1FEC}, + {0x1FF2, 0x1FF4}, + {0x1FF6, 0x1FFC}, + {0x2071, 0x2071}, + {0x207F, 0x207F}, + {0x2090, 0x209C}, + {0x2102, 0x2102}, + {0x2107, 0x2107}, + {0x210A, 0x2113}, + {0x2115, 0x2115}, + {0x2118, 0x211D}, + {0x2124, 0x2124}, + {0x2126, 0x2126}, + {0x2128, 0x2128}, + {0x212A, 0x2139}, + {0x213C, 0x213F}, + {0x2145, 0x2149}, + {0x214E, 0x214E}, + {0x2160, 0x2188}, + {0x2C00, 0x2CE4}, + {0x2CEB, 0x2CEE}, + {0x2CF2, 0x2CF3}, + {0x2D00, 0x2D25}, + {0x2D27, 0x2D27}, + {0x2D2D, 0x2D2D}, + {0x2D30, 0x2D67}, + {0x2D6F, 0x2D6F}, + {0x2D80, 0x2D96}, + {0x2DA0, 0x2DA6}, + {0x2DA8, 0x2DAE}, + {0x2DB0, 0x2DB6}, + {0x2DB8, 0x2DBE}, + {0x2DC0, 0x2DC6}, + {0x2DC8, 0x2DCE}, + {0x2DD0, 0x2DD6}, + {0x2DD8, 0x2DDE}, + {0x3005, 0x3007}, + {0x3021, 0x3029}, + {0x3031, 0x3035}, + {0x3038, 0x303C}, + {0x3041, 0x3096}, + {0x309D, 0x309F}, + {0x30A1, 0x30FA}, + {0x30FC, 0x30FF}, + {0x3105, 0x312F}, + {0x3131, 0x318E}, + {0x31A0, 0x31BF}, + {0x31F0, 0x31FF}, + {0x3400, 0x4DBF}, + {0x4E00, 0xA48C}, + {0xA4D0, 0xA4FD}, + {0xA500, 0xA60C}, + {0xA610, 0xA61F}, + {0xA62A, 0xA62B}, + {0xA640, 0xA66E}, + {0xA67F, 0xA69D}, + {0xA6A0, 0xA6EF}, + {0xA717, 0xA71F}, + {0xA722, 0xA788}, + {0xA78B, 0xA7DC}, + {0xA7F1, 0xA801}, + {0xA803, 0xA805}, + {0xA807, 0xA80A}, + {0xA80C, 0xA822}, + {0xA840, 0xA873}, + {0xA882, 0xA8B3}, + {0xA8F2, 0xA8F7}, + {0xA8FB, 0xA8FB}, + {0xA8FD, 0xA8FE}, + {0xA90A, 0xA925}, + {0xA930, 0xA946}, + {0xA960, 0xA97C}, + {0xA984, 0xA9B2}, + {0xA9CF, 0xA9CF}, + {0xA9E0, 0xA9E4}, + {0xA9E6, 0xA9EF}, + {0xA9FA, 0xA9FE}, + {0xAA00, 0xAA28}, + {0xAA40, 0xAA42}, + {0xAA44, 0xAA4B}, + {0xAA60, 0xAA76}, + {0xAA7A, 0xAA7A}, + {0xAA7E, 0xAAAF}, + {0xAAB1, 0xAAB1}, + {0xAAB5, 0xAAB6}, + {0xAAB9, 0xAABD}, + {0xAAC0, 0xAAC0}, + {0xAAC2, 0xAAC2}, + {0xAADB, 0xAADD}, + {0xAAE0, 0xAAEA}, + {0xAAF2, 0xAAF4}, + {0xAB01, 0xAB06}, + {0xAB09, 0xAB0E}, + {0xAB11, 0xAB16}, + {0xAB20, 0xAB26}, + {0xAB28, 0xAB2E}, + {0xAB30, 0xAB5A}, + {0xAB5C, 0xAB69}, + {0xAB70, 0xABE2}, + {0xAC00, 0xD7A3}, + {0xD7B0, 0xD7C6}, + {0xD7CB, 0xD7FB}, + {0xF900, 0xFA6D}, + {0xFA70, 0xFAD9}, + {0xFB00, 0xFB06}, + {0xFB13, 0xFB17}, + {0xFB1D, 0xFB1D}, + {0xFB1F, 0xFB28}, + {0xFB2A, 0xFB36}, + {0xFB38, 0xFB3C}, + {0xFB3E, 0xFB3E}, + {0xFB40, 0xFB41}, + {0xFB43, 0xFB44}, + {0xFB46, 0xFBB1}, + {0xFBD3, 0xFC5D}, + {0xFC64, 0xFD3D}, + {0xFD50, 0xFD8F}, + {0xFD92, 0xFDC7}, + {0xFDF0, 0xFDF9}, + {0xFE71, 0xFE71}, + {0xFE73, 0xFE73}, + {0xFE77, 0xFE77}, + {0xFE79, 0xFE79}, + {0xFE7B, 0xFE7B}, + {0xFE7D, 0xFE7D}, + {0xFE7F, 0xFEFC}, + {0xFF21, 0xFF3A}, + {0xFF41, 0xFF5A}, + {0xFF66, 0xFF9D}, + {0xFFA0, 0xFFBE}, + {0xFFC2, 0xFFC7}, + {0xFFCA, 0xFFCF}, + {0xFFD2, 0xFFD7}, + {0xFFDA, 0xFFDC}, + {0x10000, 0x1000B}, + {0x1000D, 0x10026}, + {0x10028, 0x1003A}, + {0x1003C, 0x1003D}, + {0x1003F, 0x1004D}, + {0x10050, 0x1005D}, + {0x10080, 0x100FA}, + {0x10140, 0x10174}, + {0x10280, 0x1029C}, + {0x102A0, 0x102D0}, + {0x10300, 0x1031F}, + {0x1032D, 0x1034A}, + {0x10350, 0x10375}, + {0x10380, 0x1039D}, + {0x103A0, 0x103C3}, + {0x103C8, 0x103CF}, + {0x103D1, 0x103D5}, + {0x10400, 0x1049D}, + {0x104B0, 0x104D3}, + {0x104D8, 0x104FB}, + {0x10500, 0x10527}, + {0x10530, 0x10563}, + {0x10570, 0x1057A}, + {0x1057C, 0x1058A}, + {0x1058C, 0x10592}, + {0x10594, 0x10595}, + {0x10597, 0x105A1}, + {0x105A3, 0x105B1}, + {0x105B3, 0x105B9}, + {0x105BB, 0x105BC}, + {0x105C0, 0x105F3}, + {0x10600, 0x10736}, + {0x10740, 0x10755}, + {0x10760, 0x10767}, + {0x10780, 0x10785}, + {0x10787, 0x107B0}, + {0x107B2, 0x107BA}, + {0x10800, 0x10805}, + {0x10808, 0x10808}, + {0x1080A, 0x10835}, + {0x10837, 0x10838}, + {0x1083C, 0x1083C}, + {0x1083F, 0x10855}, + {0x10860, 0x10876}, + {0x10880, 0x1089E}, + {0x108E0, 0x108F2}, + {0x108F4, 0x108F5}, + {0x10900, 0x10915}, + {0x10920, 0x10939}, + {0x10940, 0x10959}, + {0x10980, 0x109B7}, + {0x109BE, 0x109BF}, + {0x10A00, 0x10A00}, + {0x10A10, 0x10A13}, + {0x10A15, 0x10A17}, + {0x10A19, 0x10A35}, + {0x10A60, 0x10A7C}, + {0x10A80, 0x10A9C}, + {0x10AC0, 0x10AC7}, + {0x10AC9, 0x10AE4}, + {0x10B00, 0x10B35}, + {0x10B40, 0x10B55}, + {0x10B60, 0x10B72}, + {0x10B80, 0x10B91}, + {0x10C00, 0x10C48}, + {0x10C80, 0x10CB2}, + {0x10CC0, 0x10CF2}, + {0x10D00, 0x10D23}, + {0x10D4A, 0x10D65}, + {0x10D6F, 0x10D85}, + {0x10E80, 0x10EA9}, + {0x10EB0, 0x10EB1}, + {0x10EC2, 0x10EC7}, + {0x10F00, 0x10F1C}, + {0x10F27, 0x10F27}, + {0x10F30, 0x10F45}, + {0x10F70, 0x10F81}, + {0x10FB0, 0x10FC4}, + {0x10FE0, 0x10FF6}, + {0x11003, 0x11037}, + {0x11071, 0x11072}, + {0x11075, 0x11075}, + {0x11083, 0x110AF}, + {0x110D0, 0x110E8}, + {0x11103, 0x11126}, + {0x11144, 0x11144}, + {0x11147, 0x11147}, + {0x11150, 0x11172}, + {0x11176, 0x11176}, + {0x11183, 0x111B2}, + {0x111C1, 0x111C4}, + {0x111DA, 0x111DA}, + {0x111DC, 0x111DC}, + {0x11200, 0x11211}, + {0x11213, 0x1122B}, + {0x1123F, 0x11240}, + {0x11280, 0x11286}, + {0x11288, 0x11288}, + {0x1128A, 0x1128D}, + {0x1128F, 0x1129D}, + {0x1129F, 0x112A8}, + {0x112B0, 0x112DE}, + {0x11305, 0x1130C}, + {0x1130F, 0x11310}, + {0x11313, 0x11328}, + {0x1132A, 0x11330}, + {0x11332, 0x11333}, + {0x11335, 0x11339}, + {0x1133D, 0x1133D}, + {0x11350, 0x11350}, + {0x1135D, 0x11361}, + {0x11380, 0x11389}, + {0x1138B, 0x1138B}, + {0x1138E, 0x1138E}, + {0x11390, 0x113B5}, + {0x113B7, 0x113B7}, + {0x113D1, 0x113D1}, + {0x113D3, 0x113D3}, + {0x11400, 0x11434}, + {0x11447, 0x1144A}, + {0x1145F, 0x11461}, + {0x11480, 0x114AF}, + {0x114C4, 0x114C5}, + {0x114C7, 0x114C7}, + {0x11580, 0x115AE}, + {0x115D8, 0x115DB}, + {0x11600, 0x1162F}, + {0x11644, 0x11644}, + {0x11680, 0x116AA}, + {0x116B8, 0x116B8}, + {0x11700, 0x1171A}, + {0x11740, 0x11746}, + {0x11800, 0x1182B}, + {0x118A0, 0x118DF}, + {0x118FF, 0x11906}, + {0x11909, 0x11909}, + {0x1190C, 0x11913}, + {0x11915, 0x11916}, + {0x11918, 0x1192F}, + {0x1193F, 0x1193F}, + {0x11941, 0x11941}, + {0x119A0, 0x119A7}, + {0x119AA, 0x119D0}, + {0x119E1, 0x119E1}, + {0x119E3, 0x119E3}, + {0x11A00, 0x11A00}, + {0x11A0B, 0x11A32}, + {0x11A3A, 0x11A3A}, + {0x11A50, 0x11A50}, + {0x11A5C, 0x11A89}, + {0x11A9D, 0x11A9D}, + {0x11AB0, 0x11AF8}, + {0x11BC0, 0x11BE0}, + {0x11C00, 0x11C08}, + {0x11C0A, 0x11C2E}, + {0x11C40, 0x11C40}, + {0x11C72, 0x11C8F}, + {0x11D00, 0x11D06}, + {0x11D08, 0x11D09}, + {0x11D0B, 0x11D30}, + {0x11D46, 0x11D46}, + {0x11D60, 0x11D65}, + {0x11D67, 0x11D68}, + {0x11D6A, 0x11D89}, + {0x11D98, 0x11D98}, + {0x11DB0, 0x11DDB}, + {0x11EE0, 0x11EF2}, + {0x11F02, 0x11F02}, + {0x11F04, 0x11F10}, + {0x11F12, 0x11F33}, + {0x11FB0, 0x11FB0}, + {0x12000, 0x12399}, + {0x12400, 0x1246E}, + {0x12480, 0x12543}, + {0x12F90, 0x12FF0}, + {0x13000, 0x1342F}, + {0x13441, 0x13446}, + {0x13460, 0x143FA}, + {0x14400, 0x14646}, + {0x16100, 0x1611D}, + {0x16800, 0x16A38}, + {0x16A40, 0x16A5E}, + {0x16A70, 0x16ABE}, + {0x16AD0, 0x16AED}, + {0x16B00, 0x16B2F}, + {0x16B40, 0x16B43}, + {0x16B63, 0x16B77}, + {0x16B7D, 0x16B8F}, + {0x16D40, 0x16D6C}, + {0x16E40, 0x16E7F}, + {0x16EA0, 0x16EB8}, + {0x16EBB, 0x16ED3}, + {0x16F00, 0x16F4A}, + {0x16F50, 0x16F50}, + {0x16F93, 0x16F9F}, + {0x16FE0, 0x16FE1}, + {0x16FE3, 0x16FE3}, + {0x16FF2, 0x16FF6}, + {0x17000, 0x18CD5}, + {0x18CFF, 0x18D1E}, + {0x18D80, 0x18DF2}, + {0x1AFF0, 0x1AFF3}, + {0x1AFF5, 0x1AFFB}, + {0x1AFFD, 0x1AFFE}, + {0x1B000, 0x1B122}, + {0x1B132, 0x1B132}, + {0x1B150, 0x1B152}, + {0x1B155, 0x1B155}, + {0x1B164, 0x1B167}, + {0x1B170, 0x1B2FB}, + {0x1BC00, 0x1BC6A}, + {0x1BC70, 0x1BC7C}, + {0x1BC80, 0x1BC88}, + {0x1BC90, 0x1BC99}, + {0x1D400, 0x1D454}, + {0x1D456, 0x1D49C}, + {0x1D49E, 0x1D49F}, + {0x1D4A2, 0x1D4A2}, + {0x1D4A5, 0x1D4A6}, + {0x1D4A9, 0x1D4AC}, + {0x1D4AE, 0x1D4B9}, + {0x1D4BB, 0x1D4BB}, + {0x1D4BD, 0x1D4C3}, + {0x1D4C5, 0x1D505}, + {0x1D507, 0x1D50A}, + {0x1D50D, 0x1D514}, + {0x1D516, 0x1D51C}, + {0x1D51E, 0x1D539}, + {0x1D53B, 0x1D53E}, + {0x1D540, 0x1D544}, + {0x1D546, 0x1D546}, + {0x1D54A, 0x1D550}, + {0x1D552, 0x1D6A5}, + {0x1D6A8, 0x1D6C0}, + {0x1D6C2, 0x1D6DA}, + {0x1D6DC, 0x1D6FA}, + {0x1D6FC, 0x1D714}, + {0x1D716, 0x1D734}, + {0x1D736, 0x1D74E}, + {0x1D750, 0x1D76E}, + {0x1D770, 0x1D788}, + {0x1D78A, 0x1D7A8}, + {0x1D7AA, 0x1D7C2}, + {0x1D7C4, 0x1D7CB}, + {0x1DF00, 0x1DF1E}, + {0x1DF25, 0x1DF2A}, + {0x1E030, 0x1E06D}, + {0x1E100, 0x1E12C}, + {0x1E137, 0x1E13D}, + {0x1E14E, 0x1E14E}, + {0x1E290, 0x1E2AD}, + {0x1E2C0, 0x1E2EB}, + {0x1E4D0, 0x1E4EB}, + {0x1E5D0, 0x1E5ED}, + {0x1E5F0, 0x1E5F0}, + {0x1E6C0, 0x1E6DE}, + {0x1E6E0, 0x1E6E2}, + {0x1E6E4, 0x1E6E5}, + {0x1E6E7, 0x1E6ED}, + {0x1E6F0, 0x1E6F4}, + {0x1E6FE, 0x1E6FF}, + {0x1E7E0, 0x1E7E6}, + {0x1E7E8, 0x1E7EB}, + {0x1E7ED, 0x1E7EE}, + {0x1E7F0, 0x1E7FE}, + {0x1E800, 0x1E8C4}, + {0x1E900, 0x1E943}, + {0x1E94B, 0x1E94B}, + {0x1EE00, 0x1EE03}, + {0x1EE05, 0x1EE1F}, + {0x1EE21, 0x1EE22}, + {0x1EE24, 0x1EE24}, + {0x1EE27, 0x1EE27}, + {0x1EE29, 0x1EE32}, + {0x1EE34, 0x1EE37}, + {0x1EE39, 0x1EE39}, + {0x1EE3B, 0x1EE3B}, + {0x1EE42, 0x1EE42}, + {0x1EE47, 0x1EE47}, + {0x1EE49, 0x1EE49}, + {0x1EE4B, 0x1EE4B}, + {0x1EE4D, 0x1EE4F}, + {0x1EE51, 0x1EE52}, + {0x1EE54, 0x1EE54}, + {0x1EE57, 0x1EE57}, + {0x1EE59, 0x1EE59}, + {0x1EE5B, 0x1EE5B}, + {0x1EE5D, 0x1EE5D}, + {0x1EE5F, 0x1EE5F}, + {0x1EE61, 0x1EE62}, + {0x1EE64, 0x1EE64}, + {0x1EE67, 0x1EE6A}, + {0x1EE6C, 0x1EE72}, + {0x1EE74, 0x1EE77}, + {0x1EE79, 0x1EE7C}, + {0x1EE7E, 0x1EE7E}, + {0x1EE80, 0x1EE89}, + {0x1EE8B, 0x1EE9B}, + {0x1EEA1, 0x1EEA3}, + {0x1EEA5, 0x1EEA9}, + {0x1EEAB, 0x1EEBB}, + {0x20000, 0x2A6DF}, + {0x2A700, 0x2B81D}, + {0x2B820, 0x2CEAD}, + {0x2CEB0, 0x2EBE0}, + {0x2EBF0, 0x2EE5D}, + {0x2F800, 0x2FA1D}, + {0x30000, 0x3134A}, + {0x31350, 0x33479}, + }, +} + +// Explicit Script_Extensions membership; all other characters default to Script. + +var ecmaScriptExtensions = map[string][]SingleRange{ + "Adlam": { + {0x61F, 0x61F}, + {0x640, 0x640}, + {0x204F, 0x204F}, + {0x2E41, 0x2E41}, + }, + "Arabic": { + {0x60C, 0x60C}, + {0x61B, 0x61C}, + {0x61F, 0x61F}, + {0x640, 0x640}, + {0x64B, 0x655}, + {0x660, 0x669}, + {0x670, 0x670}, + {0x6D4, 0x6D4}, + {0x204F, 0x204F}, + {0x2E41, 0x2E41}, + {0xFD3E, 0xFD3F}, + {0xFDF2, 0xFDF2}, + {0xFDFD, 0xFDFD}, + {0x102E0, 0x102FB}, + }, + "Armenian": { + {0x308, 0x308}, + {0x589, 0x589}, + }, + "Avestan": { + {0xB7, 0xB7}, + {0x2E30, 0x2E31}, + }, + "Bengali": { + {0x2BC, 0x2BC}, + {0x951, 0x952}, + {0x964, 0x965}, + {0x9E6, 0x9EF}, + {0x1CD0, 0x1CD0}, + {0x1CD2, 0x1CD2}, + {0x1CD5, 0x1CD6}, + {0x1CD8, 0x1CD8}, + {0x1CE1, 0x1CE1}, + {0x1CEA, 0x1CEA}, + {0x1CED, 0x1CED}, + {0x1CF2, 0x1CF2}, + {0x1CF5, 0x1CF7}, + {0xA8F1, 0xA8F1}, + }, + "Bopomofo": { + {0x2C7, 0x2C7}, + {0x2C9, 0x2CB}, + {0x2D9, 0x2D9}, + {0x3001, 0x3003}, + {0x3008, 0x3011}, + {0x3013, 0x301F}, + {0x302A, 0x302D}, + {0x3030, 0x3030}, + {0x3037, 0x3037}, + {0x30FB, 0x30FB}, + {0xFE45, 0xFE46}, + {0xFF61, 0xFF65}, + }, + "Buginese": { + {0xA9CF, 0xA9CF}, + }, + "Buhid": { + {0x1735, 0x1736}, + }, + "Carian": { + {0xB7, 0xB7}, + {0x205A, 0x205A}, + {0x205D, 0x205D}, + {0x2E31, 0x2E31}, + }, + "Caucasian_Albanian": { + {0x304, 0x304}, + {0x331, 0x331}, + {0x35E, 0x35E}, + }, + "Chakma": { + {0x9E6, 0x9EF}, + {0x1040, 0x1049}, + }, + "Cherokee": { + {0x300, 0x302}, + {0x304, 0x304}, + {0x30B, 0x30C}, + {0x323, 0x324}, + {0x330, 0x331}, + }, + "Coptic": { + {0xB7, 0xB7}, + {0x300, 0x300}, + {0x304, 0x305}, + {0x307, 0x307}, + {0x374, 0x375}, + {0x2E17, 0x2E17}, + {0x102E0, 0x102FB}, + }, + "Cypriot": { + {0x10100, 0x10102}, + {0x10107, 0x10133}, + {0x10137, 0x1013F}, + }, + "Cypro_Minoan": { + {0x10100, 0x10101}, + }, + "Cyrillic": { + {0x2BC, 0x2BC}, + {0x300, 0x302}, + {0x304, 0x304}, + {0x306, 0x306}, + {0x308, 0x308}, + {0x30B, 0x30B}, + {0x311, 0x311}, + {0x483, 0x487}, + {0x1DF8, 0x1DF8}, + {0x2E43, 0x2E43}, + {0xA66F, 0xA66F}, + }, + "Devanagari": { + {0x2BC, 0x2BC}, + {0x951, 0x952}, + {0x964, 0x96F}, + {0x1CD0, 0x1CF6}, + {0x1CF8, 0x1CF9}, + {0x20F0, 0x20F0}, + {0xA830, 0xA839}, + {0xA8F1, 0xA8F1}, + {0xA8F3, 0xA8F3}, + }, + "Dogra": { + {0x964, 0x96F}, + {0xA830, 0xA839}, + }, + "Duployan": { + {0xB7, 0xB7}, + {0x307, 0x308}, + {0x30A, 0x30A}, + {0x323, 0x324}, + {0x2E3C, 0x2E3C}, + {0x1BCA0, 0x1BCA3}, + }, + "Elbasan": { + {0xB7, 0xB7}, + {0x305, 0x305}, + }, + "Ethiopic": { + {0x30E, 0x30E}, + }, + "Garay": { + {0x60C, 0x60C}, + {0x61B, 0x61B}, + {0x61F, 0x61F}, + }, + "Georgian": { + {0xB7, 0xB7}, + {0x589, 0x589}, + {0x10FB, 0x10FB}, + {0x205A, 0x205A}, + {0x2E31, 0x2E31}, + }, + "Glagolitic": { + {0xB7, 0xB7}, + {0x303, 0x303}, + {0x305, 0x305}, + {0x484, 0x484}, + {0x487, 0x487}, + {0x589, 0x589}, + {0x10FB, 0x10FB}, + {0x205A, 0x205A}, + {0x2E43, 0x2E43}, + {0xA66F, 0xA66F}, + }, + "Gothic": { + {0xB7, 0xB7}, + {0x304, 0x305}, + {0x308, 0x308}, + {0x331, 0x331}, + }, + "Grantha": { + {0x951, 0x952}, + {0x964, 0x965}, + {0xBE6, 0xBF3}, + {0x1CD0, 0x1CD0}, + {0x1CD2, 0x1CD3}, + {0x1CF2, 0x1CF4}, + {0x1CF8, 0x1CF9}, + {0x20F0, 0x20F0}, + {0x11301, 0x11301}, + {0x11303, 0x11303}, + {0x1133B, 0x1133C}, + {0x11FD0, 0x11FD1}, + {0x11FD3, 0x11FD3}, + }, + "Greek": { + {0xB7, 0xB7}, + {0x300, 0x301}, + {0x304, 0x304}, + {0x306, 0x306}, + {0x308, 0x308}, + {0x313, 0x313}, + {0x342, 0x342}, + {0x345, 0x345}, + {0x374, 0x375}, + {0x1DC0, 0x1DC1}, + {0x205D, 0x205D}, + }, + "Gujarati": { + {0x951, 0x952}, + {0x964, 0x965}, + {0xAE6, 0xAEF}, + {0xA830, 0xA839}, + }, + "Gunjala_Gondi": { + {0xB7, 0xB7}, + {0x964, 0x965}, + }, + "Gurmukhi": { + {0x951, 0x952}, + {0x964, 0x965}, + {0xA66, 0xA6F}, + {0xA830, 0xA839}, + }, + "Gurung_Khema": { + {0x965, 0x965}, + }, + "Han": { + {0xB7, 0xB7}, + {0x2FF0, 0x2FFF}, + {0x3001, 0x3003}, + {0x3006, 0x3006}, + {0x3008, 0x3011}, + {0x3013, 0x301F}, + {0x302A, 0x302D}, + {0x3030, 0x3030}, + {0x3037, 0x3037}, + {0x303C, 0x303F}, + {0x30FB, 0x30FB}, + {0x3190, 0x319F}, + {0x31C0, 0x31E5}, + {0x31EF, 0x31EF}, + {0x3220, 0x3247}, + {0x3280, 0x32B0}, + {0x32C0, 0x32CB}, + {0x32FF, 0x32FF}, + {0x3358, 0x3370}, + {0x337B, 0x337F}, + {0x33E0, 0x33FE}, + {0xA700, 0xA707}, + {0xFE45, 0xFE46}, + {0xFF61, 0xFF65}, + {0x1D360, 0x1D371}, + {0x1F250, 0x1F251}, + }, + "Hangul": { + {0x3001, 0x3003}, + {0x3008, 0x3011}, + {0x3013, 0x301F}, + {0x3030, 0x3030}, + {0x3037, 0x3037}, + {0x30FB, 0x30FB}, + {0xFE45, 0xFE46}, + {0xFF61, 0xFF65}, + }, + "Hanifi_Rohingya": { + {0x60C, 0x60C}, + {0x61B, 0x61B}, + {0x61F, 0x61F}, + {0x640, 0x640}, + {0x6D4, 0x6D4}, + }, + "Hanunoo": { + {0x1735, 0x1736}, + }, + "Hebrew": { + {0x307, 0x308}, + }, + "Hiragana": { + {0x3001, 0x3003}, + {0x3008, 0x3011}, + {0x3013, 0x301F}, + {0x3030, 0x3035}, + {0x3037, 0x3037}, + {0x303C, 0x303D}, + {0x3099, 0x309C}, + {0x30A0, 0x30A0}, + {0x30FB, 0x30FC}, + {0xFE45, 0xFE46}, + {0xFF61, 0xFF65}, + {0xFF70, 0xFF70}, + {0xFF9E, 0xFF9F}, + }, + "Javanese": { + {0xA9CF, 0xA9CF}, + }, + "Kaithi": { + {0x966, 0x96F}, + {0x2E31, 0x2E31}, + {0xA830, 0xA839}, + }, + "Kannada": { + {0x951, 0x952}, + {0x964, 0x965}, + {0xCE6, 0xCEF}, + {0x1CD0, 0x1CD0}, + {0x1CD2, 0x1CD3}, + {0x1CDA, 0x1CDA}, + {0x1CF2, 0x1CF2}, + {0x1CF4, 0x1CF4}, + {0xA830, 0xA835}, + }, + "Katakana": { + {0x305, 0x305}, + {0x323, 0x323}, + {0x3001, 0x3003}, + {0x3008, 0x3011}, + {0x3013, 0x301F}, + {0x3030, 0x3035}, + {0x3037, 0x3037}, + {0x303C, 0x303D}, + {0x3099, 0x309C}, + {0x30A0, 0x30A0}, + {0x30FB, 0x30FC}, + {0xFE45, 0xFE46}, + {0xFF61, 0xFF65}, + {0xFF70, 0xFF70}, + {0xFF9E, 0xFF9F}, + }, + "Kayah_Li": { + {0xA92E, 0xA92E}, + }, + "Khojki": { + {0xAE6, 0xAEF}, + {0xA830, 0xA839}, + }, + "Khudawadi": { + {0x964, 0x965}, + {0xA830, 0xA839}, + }, + "Latin": { + {0xB7, 0xB7}, + {0x2BC, 0x2BC}, + {0x2C7, 0x2C7}, + {0x2C9, 0x2CB}, + {0x2CD, 0x2CD}, + {0x2D7, 0x2D7}, + {0x2D9, 0x2D9}, + {0x300, 0x30E}, + {0x310, 0x311}, + {0x313, 0x313}, + {0x323, 0x325}, + {0x32D, 0x32E}, + {0x330, 0x331}, + {0x358, 0x358}, + {0x35E, 0x35E}, + {0x363, 0x36F}, + {0x485, 0x486}, + {0x951, 0x952}, + {0x10FB, 0x10FB}, + {0x1DF8, 0x1DF8}, + {0x202F, 0x202F}, + {0x20F0, 0x20F0}, + {0x2E17, 0x2E17}, + {0xA700, 0xA707}, + {0xA92E, 0xA92E}, + }, + "Limbu": { + {0x965, 0x965}, + }, + "Linear_A": { + {0x10107, 0x10133}, + }, + "Linear_B": { + {0x10100, 0x10102}, + {0x10107, 0x10133}, + {0x10137, 0x1013F}, + }, + "Lisu": { + {0x2BC, 0x2BC}, + {0x2CD, 0x2CD}, + {0x300A, 0x300B}, + }, + "Lycian": { + {0x205A, 0x205A}, + }, + "Lydian": { + {0xB7, 0xB7}, + {0x2E31, 0x2E31}, + }, + "Mahajani": { + {0xB7, 0xB7}, + {0x964, 0x96F}, + {0xA830, 0xA839}, + }, + "Malayalam": { + {0x951, 0x952}, + {0x964, 0x965}, + {0x1CDA, 0x1CDA}, + {0x1CF2, 0x1CF2}, + {0xA830, 0xA832}, + }, + "Mandaic": { + {0x640, 0x640}, + }, + "Manichaean": { + {0x640, 0x640}, + {0x10AF2, 0x10AF2}, + }, + "Masaram_Gondi": { + {0x964, 0x965}, + }, + "Meroitic_Hieroglyphs": { + {0x205D, 0x205D}, + }, + "Modi": { + {0xA830, 0xA839}, + }, + "Mongolian": { + {0x1802, 0x1803}, + {0x1805, 0x1805}, + {0x202F, 0x202F}, + {0x3001, 0x3002}, + {0x3008, 0x300B}, + }, + "Multani": { + {0xA66, 0xA6F}, + }, + "Myanmar": { + {0x1040, 0x1049}, + {0xA92E, 0xA92E}, + }, + "Nandinagari": { + {0x951, 0x951}, + {0x964, 0x965}, + {0xCE6, 0xCEF}, + {0x1CE9, 0x1CE9}, + {0x1CF2, 0x1CF2}, + {0x1CFA, 0x1CFA}, + {0xA830, 0xA835}, + }, + "Newa": { + {0x951, 0x952}, + {0x1CD5, 0x1CD5}, + {0x1CD7, 0x1CD8}, + {0x1CE2, 0x1CE2}, + {0x1CE9, 0x1CE9}, + {0x1CEB, 0x1CEB}, + {0x1CED, 0x1CED}, + }, + "Nko": { + {0x60C, 0x60C}, + {0x61B, 0x61B}, + {0x61F, 0x61F}, + {0xFD3E, 0xFD3F}, + }, + "Ol_Onal": { + {0x964, 0x965}, + }, + "Old_Hungarian": { + {0x205A, 0x205A}, + {0x205D, 0x205D}, + {0x2E31, 0x2E31}, + {0x2E41, 0x2E41}, + }, + "Old_Permic": { + {0xB7, 0xB7}, + {0x300, 0x300}, + {0x306, 0x308}, + {0x313, 0x313}, + {0x483, 0x483}, + }, + "Old_Turkic": { + {0x205A, 0x205A}, + {0x2E30, 0x2E30}, + }, + "Old_Uyghur": { + {0x640, 0x640}, + {0x10AF2, 0x10AF2}, + }, + "Oriya": { + {0x951, 0x952}, + {0x964, 0x965}, + {0x1CDA, 0x1CDA}, + {0x1CF2, 0x1CF2}, + }, + "Osage": { + {0x301, 0x301}, + {0x304, 0x304}, + {0x30B, 0x30B}, + {0x358, 0x358}, + }, + "Phags_Pa": { + {0x1802, 0x1803}, + {0x1805, 0x1805}, + {0x202F, 0x202F}, + {0x3002, 0x3002}, + }, + "Psalter_Pahlavi": { + {0x640, 0x640}, + }, + "Runic": { + {0x16EB, 0x16ED}, + }, + "Samaritan": { + {0x2E31, 0x2E31}, + }, + "Sharada": { + {0x951, 0x951}, + {0x1CD7, 0x1CD7}, + {0x1CD9, 0x1CD9}, + {0x1CDC, 0x1CDD}, + {0x1CE0, 0x1CE0}, + {0x1CEA, 0x1CEA}, + {0x1CED, 0x1CED}, + {0xA830, 0xA835}, + {0xA838, 0xA838}, + }, + "Shavian": { + {0xB7, 0xB7}, + }, + "Sinhala": { + {0x964, 0x965}, + {0x1CF2, 0x1CF2}, + }, + "Sogdian": { + {0x640, 0x640}, + }, + "Sunuwar": { + {0x300, 0x301}, + {0x303, 0x303}, + {0x30D, 0x30D}, + {0x310, 0x310}, + {0x32D, 0x32D}, + {0x331, 0x331}, + }, + "Syloti_Nagri": { + {0x964, 0x965}, + {0x9E6, 0x9EF}, + }, + "Syriac": { + {0x303, 0x304}, + {0x307, 0x308}, + {0x30A, 0x30A}, + {0x323, 0x325}, + {0x32D, 0x32E}, + {0x330, 0x331}, + {0x60C, 0x60C}, + {0x61B, 0x61C}, + {0x61F, 0x61F}, + {0x640, 0x640}, + {0x64B, 0x655}, + {0x670, 0x670}, + {0x1DF8, 0x1DF8}, + {0x1DFA, 0x1DFA}, + }, + "Tagalog": { + {0x1735, 0x1736}, + }, + "Tagbanwa": { + {0x1735, 0x1736}, + }, + "Tai_Le": { + {0x300, 0x301}, + {0x307, 0x308}, + {0x30C, 0x30C}, + {0x1040, 0x1049}, + }, + "Takri": { + {0x964, 0x965}, + {0xA830, 0xA839}, + }, + "Tamil": { + {0x951, 0x952}, + {0x964, 0x965}, + {0xBE6, 0xBF3}, + {0x1CDA, 0x1CDA}, + {0xA8F3, 0xA8F3}, + {0x11301, 0x11301}, + {0x11303, 0x11303}, + {0x1133B, 0x1133C}, + {0x11FD0, 0x11FD1}, + {0x11FD3, 0x11FD3}, + }, + "Tangut": { + {0x2FF0, 0x2FFF}, + {0x31EF, 0x31EF}, + }, + "Telugu": { + {0x951, 0x952}, + {0x964, 0x965}, + {0x1CD5, 0x1CD6}, + {0x1CD8, 0x1CD8}, + {0x1CDA, 0x1CDA}, + {0x1CF2, 0x1CF2}, + }, + "Thaana": { + {0x60C, 0x60C}, + {0x61B, 0x61C}, + {0x61F, 0x61F}, + {0x660, 0x669}, + {0xFDF2, 0xFDF2}, + {0xFDFD, 0xFDFD}, + }, + "Thai": { + {0x2BC, 0x2BC}, + {0x2D7, 0x2D7}, + {0x303, 0x303}, + {0x331, 0x331}, + }, + "Tibetan": { + {0x3008, 0x300B}, + }, + "Tifinagh": { + {0x302, 0x302}, + {0x304, 0x304}, + {0x306, 0x309}, + {0x323, 0x323}, + }, + "Tirhuta": { + {0x951, 0x952}, + {0x964, 0x965}, + {0x1CD5, 0x1CD5}, + {0x1CE2, 0x1CE2}, + {0x1CF2, 0x1CF2}, + {0xA830, 0xA839}, + }, + "Todhri": { + {0x301, 0x301}, + {0x304, 0x304}, + {0x307, 0x307}, + {0x311, 0x311}, + {0x313, 0x313}, + {0x35E, 0x35E}, + }, + "Toto": { + {0x2BC, 0x2BC}, + }, + "Tulu_Tigalari": { + {0xCE6, 0xCEF}, + {0x1CF2, 0x1CF2}, + {0x1CF4, 0x1CF4}, + {0xA830, 0xA835}, + {0xA8F1, 0xA8F1}, + }, + "Yezidi": { + {0x60C, 0x60C}, + {0x61B, 0x61B}, + {0x61F, 0x61F}, + {0x660, 0x669}, + }, + "Yi": { + {0x3001, 0x3002}, + {0x3008, 0x3011}, + {0x3014, 0x301B}, + {0x30FB, 0x30FB}, + {0xFF61, 0xFF65}, + }, +} + +// All characters whose Script_Extensions overrides their Script value. +var ecmaScriptExtensionOverrides = []SingleRange{ + {0xB7, 0xB7}, + {0x2BC, 0x2BC}, + {0x2C7, 0x2C7}, + {0x2C9, 0x2CB}, + {0x2CD, 0x2CD}, + {0x2D7, 0x2D7}, + {0x2D9, 0x2D9}, + {0x300, 0x30E}, + {0x310, 0x311}, + {0x313, 0x313}, + {0x323, 0x325}, + {0x32D, 0x32E}, + {0x330, 0x331}, + {0x342, 0x342}, + {0x345, 0x345}, + {0x358, 0x358}, + {0x35E, 0x35E}, + {0x363, 0x36F}, + {0x374, 0x375}, + {0x483, 0x487}, + {0x589, 0x589}, + {0x60C, 0x60C}, + {0x61B, 0x61C}, + {0x61F, 0x61F}, + {0x640, 0x640}, + {0x64B, 0x655}, + {0x660, 0x669}, + {0x670, 0x670}, + {0x6D4, 0x6D4}, + {0x951, 0x952}, + {0x964, 0x96F}, + {0x9E6, 0x9EF}, + {0xA66, 0xA6F}, + {0xAE6, 0xAEF}, + {0xBE6, 0xBF3}, + {0xCE6, 0xCEF}, + {0x1040, 0x1049}, + {0x10FB, 0x10FB}, + {0x16EB, 0x16ED}, + {0x1735, 0x1736}, + {0x1802, 0x1803}, + {0x1805, 0x1805}, + {0x1CD0, 0x1CFA}, + {0x1DC0, 0x1DC1}, + {0x1DF8, 0x1DF8}, + {0x1DFA, 0x1DFA}, + {0x202F, 0x202F}, + {0x204F, 0x204F}, + {0x205A, 0x205A}, + {0x205D, 0x205D}, + {0x20F0, 0x20F0}, + {0x2E17, 0x2E17}, + {0x2E30, 0x2E31}, + {0x2E3C, 0x2E3C}, + {0x2E41, 0x2E41}, + {0x2E43, 0x2E43}, + {0x2FF0, 0x2FFF}, + {0x3001, 0x3003}, + {0x3006, 0x3006}, + {0x3008, 0x3011}, + {0x3013, 0x301F}, + {0x302A, 0x302D}, + {0x3030, 0x3035}, + {0x3037, 0x3037}, + {0x303C, 0x303F}, + {0x3099, 0x309C}, + {0x30A0, 0x30A0}, + {0x30FB, 0x30FC}, + {0x3190, 0x319F}, + {0x31C0, 0x31E5}, + {0x31EF, 0x31EF}, + {0x3220, 0x3247}, + {0x3280, 0x32B0}, + {0x32C0, 0x32CB}, + {0x32FF, 0x32FF}, + {0x3358, 0x3370}, + {0x337B, 0x337F}, + {0x33E0, 0x33FE}, + {0xA66F, 0xA66F}, + {0xA700, 0xA707}, + {0xA830, 0xA839}, + {0xA8F1, 0xA8F1}, + {0xA8F3, 0xA8F3}, + {0xA92E, 0xA92E}, + {0xA9CF, 0xA9CF}, + {0xFD3E, 0xFD3F}, + {0xFDF2, 0xFDF2}, + {0xFDFD, 0xFDFD}, + {0xFE45, 0xFE46}, + {0xFF61, 0xFF65}, + {0xFF70, 0xFF70}, + {0xFF9E, 0xFF9F}, + {0x10100, 0x10102}, + {0x10107, 0x10133}, + {0x10137, 0x1013F}, + {0x102E0, 0x102FB}, + {0x10AF2, 0x10AF2}, + {0x11301, 0x11301}, + {0x11303, 0x11303}, + {0x1133B, 0x1133C}, + {0x11FD0, 0x11FD1}, + {0x11FD3, 0x11FD3}, + {0x1BCA0, 0x1BCA3}, + {0x1D360, 0x1D371}, + {0x1F250, 0x1F251}, +} diff --git a/vendor/github.com/dlclark/regexp2/syntax/escape.go b/vendor/github.com/dlclark/regexp2/v2/syntax/escape.go similarity index 90% rename from vendor/github.com/dlclark/regexp2/syntax/escape.go rename to vendor/github.com/dlclark/regexp2/v2/syntax/escape.go index 609df1073..f5f10bf9f 100644 --- a/vendor/github.com/dlclark/regexp2/syntax/escape.go +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/escape.go @@ -19,7 +19,7 @@ const meta = `\.+*?()|[]{}^$# ` func escape(b *bytes.Buffer, r rune, force bool) { if unicode.IsPrint(r) { - if strings.IndexRune(meta, r) >= 0 || force { + if strings.ContainsRune(meta, r) || force { b.WriteRune('\\') } b.WriteRune(r) @@ -28,7 +28,8 @@ func escape(b *bytes.Buffer, r rune, force bool) { switch r { case '\a': - b.WriteString(`\a`) + // \a is an identity escape in non-Unicode ECMAScript patterns. + b.WriteString(`\x07`) case '\f': b.WriteString(`\f`) case '\n': @@ -70,7 +71,7 @@ func Unescape(input string) (string, error) { if p.rightMost() { return "", p.getErr(ErrIllegalEndEscape) } - r, err := p.scanCharEscape() + r, err := p.scanCharEscape(false) if err != nil { return "", err } diff --git a/vendor/github.com/dlclark/regexp2/syntax/fuzz.go b/vendor/github.com/dlclark/regexp2/v2/syntax/fuzz.go similarity index 80% rename from vendor/github.com/dlclark/regexp2/syntax/fuzz.go rename to vendor/github.com/dlclark/regexp2/v2/syntax/fuzz.go index ee863866d..41cf8852b 100644 --- a/vendor/github.com/dlclark/regexp2/syntax/fuzz.go +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/fuzz.go @@ -1,3 +1,4 @@ +//go:build gofuzz // +build gofuzz package syntax @@ -5,7 +6,7 @@ package syntax // Fuzz is the input point for go-fuzz func Fuzz(data []byte) int { sdata := string(data) - tree, err := Parse(sdata, RegexOptions(0)) + tree, err := Parse(sdata, ParseOptions{}) if err != nil { return 0 } diff --git a/vendor/github.com/dlclark/regexp2/v2/syntax/grapheme.go b/vendor/github.com/dlclark/regexp2/v2/syntax/grapheme.go new file mode 100644 index 000000000..c4faf3553 --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/grapheme.go @@ -0,0 +1,294 @@ +package syntax + +import "unicode" + +type graphemeBreakClass uint8 + +const ( + graphemeOther graphemeBreakClass = iota + graphemeCR + graphemeLF + graphemeControl + graphemeExtend + graphemeZWJ + graphemeRegionalIndicator + graphemePrepend + graphemeSpacingMark + graphemeL + graphemeV + graphemeT + graphemeLV + graphemeLVT +) + +type indicConjunctBreakClass uint8 + +const ( + indicNone indicConjunctBreakClass = iota + indicConsonant + indicExtend + indicLinker +) + +type graphemeProperties struct { + breakClass graphemeBreakClass + indicClass indicConjunctBreakClass + extendedPictographic bool +} + +// NextGraphemeClusterBoundary returns the first extended-grapheme boundary +// after start, or -1 when start is not a valid input position. It implements +// the Unicode 17 rules from UAX #29 with a small state machine, avoiding the +// backtracking and repeated character-class probes of an equivalent regexp. +func NextGraphemeClusterBoundary(text []rune, start int) int { + if start < 0 || start >= len(text) { + return -1 + } + + previous := graphemePropertiesFor(text[start]) + state := graphemeForwardState{} + state.consume(previous) + + for pos := start + 1; pos < len(text); pos++ { + current := graphemePropertiesFor(text[pos]) + if isGraphemeBoundaryForward(previous.breakClass, current, state) { + return pos + } + state.consume(current) + previous = current + } + return len(text) +} + +// PreviousGraphemeClusterBoundary returns the first extended-grapheme boundary +// before end, or -1 when end is not a valid input position. +func PreviousGraphemeClusterBoundary(text []rune, end int) int { + if end <= 0 || end > len(text) { + return -1 + } + for pos := end - 1; pos > 0; pos-- { + if isGraphemeBoundary(text, pos) { + return pos + } + } + return 0 +} + +type graphemeForwardState struct { + regionalIndicatorCount int + extendedPictographicRun bool + zwjAfterPictographic bool + indicConsonantRun bool + indicLinkerSeen bool +} + +func (s *graphemeForwardState) consume(properties graphemeProperties) { + if properties.breakClass == graphemeRegionalIndicator { + s.regionalIndicatorCount++ + } else { + s.regionalIndicatorCount = 0 + } + + if properties.breakClass == graphemeZWJ { + s.zwjAfterPictographic = s.extendedPictographicRun + } else { + s.zwjAfterPictographic = false + } + if properties.extendedPictographic { + s.extendedPictographicRun = true + } else if properties.breakClass != graphemeExtend { + s.extendedPictographicRun = false + } + + switch properties.indicClass { + case indicConsonant: + s.indicConsonantRun = true + s.indicLinkerSeen = false + case indicExtend: + // Extend preserves a preceding consonant/linker run. + case indicLinker: + if s.indicConsonantRun { + s.indicLinkerSeen = true + } + default: + s.indicConsonantRun = false + s.indicLinkerSeen = false + } +} + +func isGraphemeBoundaryForward(previous graphemeBreakClass, current graphemeProperties, state graphemeForwardState) bool { + if previous == graphemeCR && current.breakClass == graphemeLF { // GB3 + return false + } + if isGraphemeControl(previous) || isGraphemeControl(current.breakClass) { // GB4, GB5 + return true + } + if hangulNoBreak(previous, current.breakClass) { // GB6, GB7, GB8 + return false + } + if current.breakClass == graphemeExtend || current.breakClass == graphemeZWJ || current.breakClass == graphemeSpacingMark { // GB9, GB9a + return false + } + if previous == graphemePrepend { // GB9b + return false + } + if current.indicClass == indicConsonant && state.indicConsonantRun && state.indicLinkerSeen { // GB9c + return false + } + if current.extendedPictographic && state.zwjAfterPictographic { // GB11 + return false + } + if previous == graphemeRegionalIndicator && current.breakClass == graphemeRegionalIndicator && state.regionalIndicatorCount%2 == 1 { // GB12, GB13 + return false + } + return true +} + +func isGraphemeBoundary(text []rune, pos int) bool { + previous := graphemePropertiesFor(text[pos-1]) + current := graphemePropertiesFor(text[pos]) + if previous.breakClass == graphemeCR && current.breakClass == graphemeLF { // GB3 + return false + } + if isGraphemeControl(previous.breakClass) || isGraphemeControl(current.breakClass) { // GB4, GB5 + return true + } + if hangulNoBreak(previous.breakClass, current.breakClass) { // GB6, GB7, GB8 + return false + } + if current.breakClass == graphemeExtend || current.breakClass == graphemeZWJ || current.breakClass == graphemeSpacingMark { // GB9, GB9a + return false + } + if previous.breakClass == graphemePrepend { // GB9b + return false + } + if current.indicClass == indicConsonant && hasIndicConjunctBefore(text, pos) { // GB9c + return false + } + if current.extendedPictographic && hasExtendedPictographicZWJBefore(text, pos) { // GB11 + return false + } + if previous.breakClass == graphemeRegionalIndicator && current.breakClass == graphemeRegionalIndicator { // GB12, GB13 + count := 0 + for i := pos - 1; i >= 0 && graphemeClass(text[i]) == graphemeRegionalIndicator; i-- { + count++ + } + return count%2 == 0 + } + return true +} + +func hasIndicConjunctBefore(text []rune, pos int) bool { + linkerSeen := false + for i := pos - 1; i >= 0; i-- { + switch indicClass(text[i]) { + case indicExtend: + continue + case indicLinker: + linkerSeen = true + continue + case indicConsonant: + return linkerSeen + default: + return false + } + } + return false +} + +func hasExtendedPictographicZWJBefore(text []rune, pos int) bool { + i := pos - 1 + if i < 0 || graphemeClass(text[i]) != graphemeZWJ { + return false + } + for i--; i >= 0 && graphemeClass(text[i]) == graphemeExtend; i-- { + } + return i >= 0 && unicode.Is(unicodeAliasExtended_Pictographic, text[i]) +} + +func isGraphemeControl(class graphemeBreakClass) bool { + return class == graphemeCR || class == graphemeLF || class == graphemeControl +} + +func hangulNoBreak(previous, current graphemeBreakClass) bool { + return previous == graphemeL && (current == graphemeL || current == graphemeV || current == graphemeLV || current == graphemeLVT) || + (previous == graphemeLV || previous == graphemeV) && (current == graphemeV || current == graphemeT) || + (previous == graphemeLVT || previous == graphemeT) && current == graphemeT +} + +func indicClass(ch rune) indicConjunctBreakClass { + if ch < 0x300 { + return indicNone + } + if unicode.Is(unicodeAliasIndic_Conjunct_Break_Consonant, ch) { + return indicConsonant + } + if unicode.Is(unicodeAliasIndic_Conjunct_Break_Linker, ch) { + return indicLinker + } + if unicode.Is(unicodeAliasIndic_Conjunct_Break_Extend, ch) { + return indicExtend + } + return indicNone +} + +func graphemePropertiesFor(ch rune) graphemeProperties { + if ch <= unicode.MaxASCII { + return graphemeProperties{breakClass: graphemeClass(ch)} + } + return graphemeProperties{ + breakClass: graphemeClass(ch), + indicClass: indicClass(ch), + extendedPictographic: ch >= 0xA9 && unicode.Is(unicodeAliasExtended_Pictographic, ch), + } +} + +func graphemeClass(ch rune) graphemeBreakClass { + if ch <= unicode.MaxASCII { + switch ch { + case '\r': + return graphemeCR + case '\n': + return graphemeLF + default: + if ch < ' ' || ch == 0x7F { + return graphemeControl + } + return graphemeOther + } + } + if ch == 0x200D { + return graphemeZWJ + } + if ch >= 0x1F1E6 && ch <= 0x1F1FF { + return graphemeRegionalIndicator + } + if ch >= 0xAC00 && ch <= 0xD7A3 { + if (ch-0xAC00)%28 == 0 { + return graphemeLV + } + return graphemeLVT + } + if ch >= 0x1100 && ch <= 0x115F || ch >= 0xA960 && ch <= 0xA97C { + return graphemeL + } + if ch >= 0x1160 && ch <= 0x11A7 || ch >= 0xD7B0 && ch <= 0xD7C6 { + return graphemeV + } + if ch >= 0x11A8 && ch <= 0x11FF || ch >= 0xD7CB && ch <= 0xD7FB { + return graphemeT + } + if unicode.Is(unicodeAliasGrapheme_Cluster_Break_Control, ch) { + return graphemeControl + } + if unicode.Is(unicodeAliasGrapheme_Cluster_Break_Extend, ch) { + return graphemeExtend + } + if unicode.Is(unicodeAliasGrapheme_Cluster_Break_Prepend, ch) { + return graphemePrepend + } + if unicode.Is(unicodeAliasGrapheme_Cluster_Break_SpacingMark, ch) { + return graphemeSpacingMark + } + return graphemeOther +} diff --git a/vendor/github.com/dlclark/regexp2/v2/syntax/optimizations.go b/vendor/github.com/dlclark/regexp2/v2/syntax/optimizations.go new file mode 100644 index 000000000..e839188af --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/optimizations.go @@ -0,0 +1,746 @@ +package syntax + +import ( + "bytes" + "cmp" + "fmt" + "slices" +) + +type FindOptimizations struct { + rightToLeft bool + asciiLookups [][]uint + + FindMode FindNextStartingPositionMode + LeadingAnchor NodeType + TrailingAnchor NodeType + MinRequiredLength int + MaxPossibleLength int + LeadingPrefix string + LeadingPrefixRunes []rune + LeadingPrefixASCII bool + LeadingPrefixes []string + LeadingPrefixesRunes [][]rune + //LeadingStrings *helpers.StringSearchValues + + FixedDistanceLiteral FixedDistanceLiteral + FixedDistanceSets []FixedDistanceSet + LiteralAfterLoop *LiteralAfterLoop + LandmarkChain *RequiredLandmarkChain + LeadingPrefixFirstRunes []rune + LeadingPrefixFirstASCII *[2]uint64 +} + +type LiteralAfterLoop struct { + String string + StringRunes []rune + StringASCII bool + StringIgnoreCase bool + Char rune + Chars []rune + CharsASCII *[2]uint64 + + LoopNode *RegexNode +} + +type FixedDistanceSet struct { + Set *CharSet + Chars []rune + CharsASCII *[2]uint64 + Negated bool + Range *SingleRange + Distance int +} + +type FixedDistanceLiteral struct { + S string + Runes []rune + C rune + Distance int +} + +type RequiredLandmarkChain struct { + // LeadingLoopSet is the unbounded leading set loop that precedes every + // landmark in the original concatenation. At run time, after the first + // landmark alternative is found, the scanner walks backward over this set + // to recover the earliest plausible regex start position. + LeadingLoopSet *CharSet + + // Anchors are the distinct zero-width assertions between the leading loop + // and the first landmark. The VM tests them where the first landmark's + // alternative starts. + Anchors []NodeType + + // Landmarks must all be found, in slice order, for the chain prefilter to + // produce a candidate. Alternatives can overlap, so the runner uses bounds + // that hold for whichever alternative the VM uses. + Landmarks []RequiredLandmark +} + +type RequiredLandmark struct { + // Alternatives describes the shapes that can satisfy this single required + // landmark. A landmark matches when any one alternative matches at a + // position in the input. + Alternatives []RequiredLandmarkAlternative +} + +type RequiredLandmarkAlternative struct { + // Literal is the core token for literal alternatives. When non-empty, it + // must match exactly at the candidate core position, and Set must be nil. + Literal []rune + + // Set is the core token for character-class alternatives. When non-nil, it + // must match between MinRepeat and MaxRepeat runes at the candidate core + // position, and Literal must be empty. The analyzer only builds set + // alternatives for non-negated sets that can be cheaply enumerated, but the + // runner uses Set for membership checks. + Set *CharSet + + // LeadingWhitespaceSet is the optional or required whitespace immediately + // before the core token. If RequireWhitespaceBefore is true, at least one + // rune from this set must precede the core. For the first landmark, the + // runner rewinds over contiguous runes from this set before rewinding over + // LeadingLoopSet, if this alternative's core starts at the found core or + // right after a run of this set from there. + LeadingWhitespaceSet *CharSet + + // TrailingWhitespaceSet is the optional or required whitespace immediately + // after the core token. If RequireWhitespaceAfter is true, at least one rune + // from this set must follow the core. The runner validates the requirement, + // but does not consume optional trailing whitespace into the landmark end. + TrailingWhitespaceSet *CharSet + + // MinRepeat and MaxRepeat describe the core token width. Literal alternatives + // use 1..1 regardless of literal length because the literal is matched as one + // fixed core token; Set alternatives use the source set repetition. + MinRepeat int + MaxRepeat int + + RequireWhitespaceBefore bool + RequireWhitespaceAfter bool +} + +type FindNextStartingPositionMode int + +const ( + NoSearch FindNextStartingPositionMode = iota + // A "beginning" anchor at the beginning of the pattern. + LeadingAnchor_LeftToRight_Beginning + // A "start" anchor at the beginning of the pattern. + LeadingAnchor_LeftToRight_Start + // An "endz" anchor at the beginning of the pattern. This is rare. + LeadingAnchor_LeftToRight_EndZ + // An "end" anchor at the beginning of the pattern. This is rare. + LeadingAnchor_LeftToRight_End + // A "beginning" anchor at the beginning of the right-to-left pattern. + LeadingAnchor_RightToLeft_Beginning + // A "start" anchor at the beginning of the right-to-left pattern. + LeadingAnchor_RightToLeft_Start + // An "endz" anchor at the beginning of the right-to-left pattern. This is rare. + LeadingAnchor_RightToLeft_EndZ + // An "end" anchor at the beginning of the right-to-left pattern. This is rare. + LeadingAnchor_RightToLeft_End + // An "end" anchor at the end of the pattern, with the pattern always matching a fixed-length expression. + TrailingAnchor_FixedLength_LeftToRight_End + // An "endz" anchor at the end of the pattern, with the pattern always matching a fixed-length expression. + TrailingAnchor_FixedLength_LeftToRight_EndZ + // A multi-character substring at the beginning of the pattern. + LeadingString_LeftToRight + // A multi-character substring at the beginning of the right-to-left pattern. + LeadingString_RightToLeft + // A multi-character ordinal case-insensitive substring at the beginning of the pattern. + LeadingString_OrdinalIgnoreCase_LeftToRight + // Multiple leading prefix strings + LeadingStrings_LeftToRight + // Multiple leading ordinal case-insensitive prefix strings + LeadingStrings_OrdinalIgnoreCase_LeftToRight + + // A set starting the pattern. + LeadingSet_LeftToRight + // A set starting the right-to-left pattern. + LeadingSet_RightToLeft + + // A single character at the start of the right-to-left pattern. + LeadingChar_RightToLeft + + // A single character at a fixed distance from the start of the pattern. + FixedDistanceChar_LeftToRight + // A multi-character case-sensitive string at a fixed distance from the start of the pattern. + FixedDistanceString_LeftToRight + + // One or more sets at a fixed distance from the start of the pattern. + FixedDistanceSets_LeftToRight + + // A literal (single character, multi-char string, or set with small number of characters) after a non-overlapping set loop at the start of the pattern. + LiteralAfterLoop_LeftToRight + + // A sequence of required landmarks after a leading loop. + RequiredLandmarkChain_LeftToRight +) + +func (m FindNextStartingPositionMode) String() string { + switch m { + case NoSearch: + return "NoSearch" + case LeadingAnchor_LeftToRight_Beginning: + return "LeadingAnchor_LeftToRight_Beginning" + case LeadingAnchor_LeftToRight_Start: + return "LeadingAnchor_LeftToRight_Start" + case LeadingAnchor_LeftToRight_EndZ: + return "LeadingAnchor_LeftToRight_EndZ" + case LeadingAnchor_LeftToRight_End: + return "LeadingAnchor_LeftToRight_End" + case LeadingAnchor_RightToLeft_Beginning: + return "LeadingAnchor_RightToLeft_Beginning" + case LeadingAnchor_RightToLeft_Start: + return "LeadingAnchor_RightToLeft_Start" + case LeadingAnchor_RightToLeft_EndZ: + return "LeadingAnchor_RightToLeft_EndZ" + case LeadingAnchor_RightToLeft_End: + return "LeadingAnchor_RightToLeft_End" + case TrailingAnchor_FixedLength_LeftToRight_End: + return "TrailingAnchor_FixedLength_LeftToRight_End" + case TrailingAnchor_FixedLength_LeftToRight_EndZ: + return "TrailingAnchor_FixedLength_LeftToRight_EndZ" + case LeadingString_LeftToRight: + return "LeadingString_LeftToRight" + case LeadingString_RightToLeft: + return "LeadingString_RightToLeft" + case LeadingString_OrdinalIgnoreCase_LeftToRight: + return "LeadingString_OrdinalIgnoreCase_LeftToRight" + case LeadingStrings_LeftToRight: + return "LeadingStrings_LeftToRight" + case LeadingStrings_OrdinalIgnoreCase_LeftToRight: + return "LeadingStrings_OrdinalIgnoreCase_LeftToRight" + case LeadingSet_LeftToRight: + return "LeadingSet_LeftToRight" + case LeadingSet_RightToLeft: + return "LeadingSet_RightToLeft" + case LeadingChar_RightToLeft: + return "LeadingChar_RightToLeft" + case FixedDistanceChar_LeftToRight: + return "FixedDistanceChar_LeftToRight" + case FixedDistanceString_LeftToRight: + return "FixedDistanceString_LeftToRight" + case FixedDistanceSets_LeftToRight: + return "FixedDistanceSets_LeftToRight" + case LiteralAfterLoop_LeftToRight: + return "LiteralAfterLoop_LeftToRight" + case RequiredLandmarkChain_LeftToRight: + return "RequiredLandmarkChain_LeftToRight" + default: + return fmt.Sprintf("FindNextStartingPositionMode(%d)", int(m)) + } +} + +func (f *FindOptimizations) Dump() string { + buf := &bytes.Buffer{} + if f == nil { + fmt.Fprintln(buf, "Find mode: n/a") + return buf.String() + } + + fmt.Fprintf(buf, "Find mode: %s\n", f.FindMode) + fmt.Fprintf(buf, "Min length: %d\n", f.MinRequiredLength) + if f.MaxPossibleLength > 0 { + fmt.Fprintf(buf, "Max length: %d\n", f.MaxPossibleLength) + } + + switch f.FindMode { + case LeadingAnchor_LeftToRight_Beginning, LeadingAnchor_LeftToRight_Start, + LeadingAnchor_LeftToRight_EndZ, LeadingAnchor_LeftToRight_End, + LeadingAnchor_RightToLeft_Beginning, LeadingAnchor_RightToLeft_Start, + LeadingAnchor_RightToLeft_EndZ, LeadingAnchor_RightToLeft_End: + fmt.Fprintf(buf, "Anchor: %v\n", f.LeadingAnchor) + + case TrailingAnchor_FixedLength_LeftToRight_End, TrailingAnchor_FixedLength_LeftToRight_EndZ: + fmt.Fprintf(buf, "Anchor: %v\n", f.TrailingAnchor) + + case LeadingString_LeftToRight, LeadingString_RightToLeft, LeadingString_OrdinalIgnoreCase_LeftToRight: + fmt.Fprintf(buf, "Prefix: %q\n", f.LeadingPrefix) + + case LeadingStrings_LeftToRight, LeadingStrings_OrdinalIgnoreCase_LeftToRight: + fmt.Fprintf(buf, "Prefixes: %q\n", f.LeadingPrefixes) + + case FixedDistanceChar_LeftToRight: + fmt.Fprintf(buf, "Literal: %q at distance %d\n", f.FixedDistanceLiteral.C, f.FixedDistanceLiteral.Distance) + + case FixedDistanceString_LeftToRight: + fmt.Fprintf(buf, "Literal: %q at distance %d\n", f.FixedDistanceLiteral.S, f.FixedDistanceLiteral.Distance) + + case FixedDistanceSets_LeftToRight: + for i, set := range f.FixedDistanceSets { + fmt.Fprintf(buf, "Set[%d]: distance=%d %s\n", i, set.Distance, fixedDistanceSetDescription(set)) + } + + case LiteralAfterLoop_LeftToRight: + fmt.Fprintf(buf, "Literal: %s\n", literalAfterLoopDescription(f.LiteralAfterLoop)) + + case RequiredLandmarkChain_LeftToRight: + fmt.Fprintf(buf, "Landmarks: %s\n", landmarkChainDescription(f.LandmarkChain)) + } + + return buf.String() +} + +func fixedDistanceSetDescription(set FixedDistanceSet) string { + switch { + case len(set.Chars) > 0: + return fmt.Sprintf("chars=%q negated=%t", string(set.Chars), set.Negated) + case set.Range != nil: + return fmt.Sprintf("range=%q-%q negated=%t", set.Range.First, set.Range.Last, set.Negated) + case set.Set != nil: + return fmt.Sprintf("set=%s", set.Set.String()) + default: + return "set=" + } +} + +func literalAfterLoopDescription(literal *LiteralAfterLoop) string { + if literal == nil { + return "" + } + loopSet := "" + if literal.LoopNode != nil && literal.LoopNode.Set != nil { + loopSet = literal.LoopNode.Set.String() + } + switch { + case literal.String != "": + return fmt.Sprintf("string=%q ignoreCase=%t after loop set %s", literal.String, literal.StringIgnoreCase, loopSet) + case len(literal.Chars) > 0: + return fmt.Sprintf("chars=%q after loop set %s", string(literal.Chars), loopSet) + default: + return fmt.Sprintf("char=%q after loop set %s", literal.Char, loopSet) + } +} + +func landmarkChainDescription(chain *RequiredLandmarkChain) string { + if chain == nil { + return "" + } + loopSet := "" + if chain.LeadingLoopSet != nil { + loopSet = chain.LeadingLoopSet.String() + } + buf := &bytes.Buffer{} + fmt.Fprintf(buf, "leadingLoop=%s", loopSet) + for i, landmark := range chain.Landmarks { + fmt.Fprintf(buf, " landmark[%d]=", i) + for j, alt := range landmark.Alternatives { + if j > 0 { + buf.WriteString("|") + } + buf.WriteString(requiredLandmarkAlternativeDescription(alt)) + } + } + return buf.String() +} + +func requiredLandmarkAlternativeDescription(alt RequiredLandmarkAlternative) string { + core := "" + switch { + case len(alt.Literal) > 0: + core = fmt.Sprintf("literal=%q", string(alt.Literal)) + case alt.Set != nil: + core = fmt.Sprintf("set=%s repeat=%d..%d", alt.Set.String(), alt.MinRepeat, alt.MaxRepeat) + default: + core = "" + } + if alt.LeadingWhitespaceSet != nil { + core += fmt.Sprintf(" leadingWhitespace=%s required=%t", alt.LeadingWhitespaceSet.String(), alt.RequireWhitespaceBefore) + } + if alt.TrailingWhitespaceSet != nil { + core += fmt.Sprintf(" trailingWhitespace=%s required=%t", alt.TrailingWhitespaceSet.String(), alt.RequireWhitespaceAfter) + } + return core +} + +func newFindOptimizations(tree *RegexTree, opt ParseOptions) *FindOptimizations { + f := newFindOptimizationsForNode(tree.Root, opt, false) + + if !f.rightToLeft && !f.isUseful() { + if positiveLookahead, _ := findLeadingPositiveLookahead(tree.Root); positiveLookahead != nil { + positiveLookaheadOpts := newFindOptimizationsForNode(positiveLookahead.Children[0], opt, true) + + // Lookaheads don't currently factor into the whole-pattern length analysis, + // as they can overlap with the rest of the expression. Keep the whole-pattern + // minimum if it's larger, and preserve any max from the original expression. + positiveLookaheadOpts.MinRequiredLength = max(f.MinRequiredLength, positiveLookaheadOpts.MinRequiredLength) + positiveLookaheadOpts.MaxPossibleLength = f.MaxPossibleLength + f = positiveLookaheadOpts + } + } + + f.prepareSearchLiterals() + f.prepareSearchSets() + return f +} + +// Decode and classify pattern-only search data before sharing the compiled regex. +func (f *FindOptimizations) prepareSearchLiterals() { + switch f.FindMode { + case LeadingString_LeftToRight, LeadingString_OrdinalIgnoreCase_LeftToRight: + f.LeadingPrefixRunes = []rune(f.LeadingPrefix) + f.LeadingPrefixASCII = isASCIIText(f.LeadingPrefix) + case FixedDistanceString_LeftToRight: + f.FixedDistanceLiteral.Runes = []rune(f.FixedDistanceLiteral.S) + case LiteralAfterLoop_LeftToRight: + literal := f.LiteralAfterLoop + if literal.String != "" { + literal.StringRunes = []rune(literal.String) + literal.StringASCII = isASCIIText(literal.String) + } + } +} + +// Small searches keep their direct comparisons; larger ASCII needles share +// a membership mask across every resumed search. General Unicode needles +// retain the rune list. Large character classes already have their own bitmap. +func (f *FindOptimizations) prepareSearchSets() { + f.LeadingPrefixFirstASCII = asciiSearchMask(f.LeadingPrefixFirstRunes) + for i := range f.FixedDistanceSets { + set := &f.FixedDistanceSets[i] + if len(set.Chars) <= 5 { + set.CharsASCII = asciiSearchMask(set.Chars) + } + } + if f.LiteralAfterLoop != nil { + f.LiteralAfterLoop.CharsASCII = asciiSearchMask(f.LiteralAfterLoop.Chars) + } +} + +func asciiSearchMask(chars []rune) *[2]uint64 { + if len(chars) <= 3 { + return nil + } + var mask [2]uint64 + for _, ch := range chars { + if uint32(ch) >= 128 { + return nil + } + mask[ch>>6] |= 1 << (uint(ch) & 63) + } + return &mask +} + +func isASCIIText(s string) bool { + for i := 0; i < len(s); i++ { + if s[i] >= 128 { + return false + } + } + return true +} + +func newFindOptimizationsForNode(root *RegexNode, opt ParseOptions, isLeadingPartial bool) *FindOptimizations { + f := &FindOptimizations{ + rightToLeft: opt.RegexOptions&RightToLeft != 0, + MinRequiredLength: root.ComputeMinLength(), + LeadingAnchor: findLeadingOrTrailingAnchor(root, true), + MaxPossibleLength: -1, + } + + if f.rightToLeft && f.LeadingAnchor == NtBol { + // Filter out Bol for RightToLeft, as we don't currently optimize for it. + f.LeadingAnchor = NtUnknown + } + + f.FindMode = getFindMode(f.rightToLeft, f.LeadingAnchor) + if f.FindMode != NoSearch { + return f + } + + // Compute any anchor trailing the expression. If there is one, and we can also compute a fixed length + // for the whole expression, we can use that to quickly jump to the right location in the input. + if !f.rightToLeft && !isLeadingPartial { + f.TrailingAnchor = findLeadingOrTrailingAnchor(root, false) + if f.TrailingAnchor == NtEnd || f.TrailingAnchor == NtEndZ { + f.MaxPossibleLength = root.computeMaxLength() + if f.MinRequiredLength == f.MaxPossibleLength { + if f.TrailingAnchor == NtEnd { + f.FindMode = TrailingAnchor_FixedLength_LeftToRight_End + } else { + f.FindMode = TrailingAnchor_FixedLength_LeftToRight_EndZ + } + return f + } + } + } + + // If there's a leading substring, just use IndexOf and inherit all of its optimizations. + prefix := findPrefix(root) + if len(prefix) > 1 { + f.LeadingPrefix = prefix + if f.rightToLeft { + f.FindMode = LeadingString_RightToLeft + } else { + f.FindMode = LeadingString_LeftToRight + } + return f + } + + // At this point there are no fast-searchable anchors or case-sensitive prefixes. We can now analyze the + // pattern for sets and then use any found sets to determine what kind of search to perform. + + // If we're generating code, then the code generation process already handles sets that reduce to a single literal, + // so we can simplify and just always go for the sets. + dfa := false //(opt&NonBacktracking) != 0 + codeGen := opt.CodeGen && !dfa // for now, we never generate code for NonBacktracking, so treat it as non-codegen + interpreter := !codeGen && !dfa + //usesRfoTryFind := !codeGen + + // For interpreter, we want to employ optimizations, but we don't want to make construction significantly + // more expensive. regexp2cg can opt into more expensive analysis with OptionIsCodeGen. So for the + // interpreter we focus only on creating a set for the first character. Same for right-to-left, which + // is used very rarely and thus we don't need to invest in special-casing it. + if f.rightToLeft { + // Determine a set for anything that can possibly start the expression. + set := findFirstCharClass(root) + if set != nil { + var chars []rune + if !set.IsNegated() { + // See if the set is limited to holding only a few characters. + chars = set.GetSetChars(5) + } + + if !codeGen && len(chars) == 1 { + // The set contains one and only one character, meaning every match starts + // with the same literal value (potentially case-insensitive). Search for that. + f.FixedDistanceLiteral.C = chars[0] + f.FindMode = LeadingChar_RightToLeft + } else { + // The set may match multiple characters. Search for that. + f.FixedDistanceSets = []FixedDistanceSet{{ + Chars: chars, + Set: set, + Distance: 0, + }} + f.FindMode = LeadingSet_RightToLeft + f.asciiLookups = make([][]uint, 1) + } + } + return f + } + + // We're now left-to-right only. + + prefix = findPrefixOrdinalCaseInsensitive(root) + if len(prefix) > 1 { + f.LeadingPrefix = prefix + f.FindMode = LeadingString_OrdinalIgnoreCase_LeftToRight + return f + } + + // We're now left-to-right only and looking for multiple prefixes and/or sets. + + // Multiple leading strings let the finder jump between candidate prefixes. + // Case-sensitive prefixes are cheap to collect and help the interpreter. + // Case-insensitive prefix explosion is still limited to code generation. + if prefixes := findPrefixes(root, false); len(prefixes) > 1 { + f.LeadingPrefixes = prefixes + f.LeadingPrefixesRunes = toRunePrefixes(prefixes) + f.LeadingPrefixFirstRunes = leadingPrefixFirstRunes(f.LeadingPrefixesRunes) + f.FindMode = LeadingStrings_LeftToRight + return f + } + if !interpreter { + ciPrefixes := findPrefixes(root, true) + if len(ciPrefixes) > 1 { + f.LeadingPrefixes = ciPrefixes + f.LeadingPrefixesRunes = toRunePrefixes(ciPrefixes) + f.LeadingPrefixFirstRunes = leadingPrefixFirstRunes(f.LeadingPrefixesRunes) + f.FindMode = LeadingStrings_OrdinalIgnoreCase_LeftToRight + return f + } + } + + // Build up a list of all of the sets that are a fixed distance from the start of the expression. + fixedDistanceSets := findFixedDistanceSets(root, !interpreter) + + // See if we can make a string of at least two characters long out of those sets. We should have already caught + // one at the beginning of the pattern, but there may be one hiding at a non-zero fixed distance into the pattern. + if len(fixedDistanceSets) > 0 { + bestFixedDistanceString := findFixedDistanceString(fixedDistanceSets) + if bestFixedDistanceString != nil { + f.FindMode = FixedDistanceString_LeftToRight + f.FixedDistanceLiteral = *bestFixedDistanceString + return f + } + } + + // A landmark chain is more selective than a single leading set for shapes like + // /name-separator host-separator domain/. Prefer it before falling back to + // one-position or one-literal candidate searches. + if landmarkChain := findRequiredLandmarkChain(root); landmarkChain != nil { + f.FindMode = RequiredLandmarkChain_LeftToRight + f.LandmarkChain = landmarkChain + return f + } + + // As a backup, see if we can find a literal after a leading atomic loop. That might be better than whatever sets we find, so + // we want to know whether we have one in our pocket before deciding whether to use a leading set (we'll prefer a leading + // set if it's something for which we can search efficiently). + literalAfterLoop := findLiteralFollowingLeadingLoop(root) + + // If we got such sets, we'll likely use them. However, if the best of them is something that doesn't support an efficient + // search and we did successfully find a literal after an atomic loop we could search instead, we prefer the efficient search. + // For example, if we have a negated set, we will still prefer the literal-after-an-atomic-loop because negated sets typically + // contain _many_ characters (e.g. [^a] is everything but 'a') and are thus more likely to very quickly match, which means any + // vectorization employed is less likely to kick in and be worth the startup overhead. + if len(fixedDistanceSets) > 0 { + // Sort the sets by "quality", such that whatever set is first is the one deemed most efficient to use. + // In some searches, we may use multiple sets, so we want the subsequent ones to also be the efficiency runners-up. + slices.SortFunc(fixedDistanceSets, compareFixedDistanceSetsByQuality) + + // If there is no literal after the loop, use whatever set we got. + // If there is a literal after the loop, consider it to be better than a negated set and better than a set with many characters. + if literalAfterLoop == nil || (len(fixedDistanceSets[0].Chars) > 0 && !fixedDistanceSets[0].Negated) { + // Determine whether to do searching based on one or more sets or on a single literal. Code-generated engines + // don't need to special-case literals as they already do codegen to create the optimal lookup based on + // the set's characteristics. + if !codeGen && len(fixedDistanceSets) == 1 && len(fixedDistanceSets[0].Chars) == 1 && + !fixedDistanceSets[0].Negated { + f.FixedDistanceLiteral = FixedDistanceLiteral{ + C: fixedDistanceSets[0].Chars[0], + Distance: fixedDistanceSets[0].Distance, + } + f.FindMode = FixedDistanceChar_LeftToRight + } else { + // Limit how many sets we use to avoid doing lots of unnecessary work. The list was already + // sorted from best to worst, so just keep the first ones up to our limit. + const MaxSetsToUse = 3 // arbitrary tuned limit + if len(fixedDistanceSets) > MaxSetsToUse { + fixedDistanceSets = fixedDistanceSets[:MaxSetsToUse] + } + + // Store the sets, and compute which mode to use. + f.FixedDistanceSets = fixedDistanceSets + if len(fixedDistanceSets) == 1 && fixedDistanceSets[0].Distance == 0 { + f.FindMode = LeadingSet_LeftToRight + } else { + f.FindMode = FixedDistanceSets_LeftToRight + } + f.asciiLookups = make([][]uint, len(fixedDistanceSets)) + } + return f + } + } + + // If we found a literal we can search for after a leading set loop, use it. + if literalAfterLoop != nil { + f.FindMode = LiteralAfterLoop_LeftToRight + f.LiteralAfterLoop = literalAfterLoop + f.asciiLookups = make([][]uint, 1) + } + + return f +} + +func (f *FindOptimizations) isUseful() bool { + return f.FindMode != NoSearch || f.LeadingAnchor == NtBol +} + +func toRunePrefixes(prefixes []string) [][]rune { + if len(prefixes) == 0 { + return nil + } + runes := make([][]rune, len(prefixes)) + for i, prefix := range prefixes { + runes[i] = []rune(prefix) + } + return runes +} + +func leadingPrefixFirstRunes(prefixes [][]rune) []rune { + first := make([]rune, 0, len(prefixes)) + for _, prefix := range prefixes { + if len(prefix) > 0 && !slices.Contains(first, prefix[0]) { + first = append(first, prefix[0]) + } + } + return first +} + +func getFindMode(rtl bool, t NodeType) FindNextStartingPositionMode { + if rtl { + switch t { + case NtBeginning: + return LeadingAnchor_RightToLeft_Beginning + case NtStart: + return LeadingAnchor_RightToLeft_Start + case NtEnd: + return LeadingAnchor_RightToLeft_End + case NtEndZ: + return LeadingAnchor_RightToLeft_EndZ + } + } else { + switch t { + case NtBeginning: + return LeadingAnchor_LeftToRight_Beginning + case NtStart: + return LeadingAnchor_LeftToRight_Start + case NtEnd: + return LeadingAnchor_LeftToRight_End + case NtEndZ: + return LeadingAnchor_LeftToRight_EndZ + } + } + + return NoSearch +} + +// Analyzes a list of fixed-distance sets to extract a case-sensitive string at a fixed distance. +func findFixedDistanceString(fixedDistanceSets []FixedDistanceSet) *FixedDistanceLiteral { + var best *FixedDistanceLiteral + + // A result string must be at least two characters in length; therefore we require at least that many sets. + if len(fixedDistanceSets) >= 2 { + // We're walking the sets from beginning to end, so we need them sorted by distance. + slices.SortFunc(fixedDistanceSets, func(s1, s2 FixedDistanceSet) int { + return cmp.Compare(s1.Distance, s2.Distance) + }) + + vsb := &bytes.Buffer{} + + // Looking for strings of length >= 2 + start := -1 + for i := 0; i < len(fixedDistanceSets)+1; i++ { + chars := []rune(nil) + if i < len(fixedDistanceSets) { + chars = fixedDistanceSets[i].Chars + } + invalidChars := len(chars) != 1 || fixedDistanceSets[i].Negated + + // If the current set ends a sequence (or we've walked off the end), see whether + // what we've gathered constitues a valid string, and if it's better than the + // best we've already seen, store it. Regardless, reset the sequence in order + // to continue analyzing. + if invalidChars || (i > 0 && fixedDistanceSets[i].Distance != fixedDistanceSets[i-1].Distance+1) { + bestLen := 2 + if best != nil { + bestLen = len(best.S) + } + if start != -1 && i-start >= bestLen { + best = &FixedDistanceLiteral{ + S: vsb.String(), + Distance: fixedDistanceSets[start].Distance, + } + } + + vsb.Reset() + start = -1 + if invalidChars { + continue + } + } + + if start == -1 { + start = i + } + + vsb.WriteRune(chars[0]) + } + } + + return best +} diff --git a/vendor/github.com/dlclark/regexp2/syntax/parser.go b/vendor/github.com/dlclark/regexp2/v2/syntax/parser.go similarity index 59% rename from vendor/github.com/dlclark/regexp2/syntax/parser.go rename to vendor/github.com/dlclark/regexp2/v2/syntax/parser.go index 4ff0aaa83..056723207 100644 --- a/vendor/github.com/dlclark/regexp2/syntax/parser.go +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/parser.go @@ -3,26 +3,25 @@ package syntax import ( "fmt" "math" - "os" "sort" "strconv" + "strings" "unicode" + "unicode/utf16" ) type RegexOptions int32 const ( IgnoreCase RegexOptions = 0x0001 // "i" - Multiline = 0x0002 // "m" - ExplicitCapture = 0x0004 // "n" - Compiled = 0x0008 // "c" - Singleline = 0x0010 // "s" - IgnorePatternWhitespace = 0x0020 // "x" - RightToLeft = 0x0040 // "r" - Debug = 0x0080 // "d" - ECMAScript = 0x0100 // "e" - RE2 = 0x0200 // RE2 compat mode - Unicode = 0x0400 // "u" + Multiline RegexOptions = 0x0002 // "m" + ExplicitCapture RegexOptions = 0x0004 // "n" + Singleline RegexOptions = 0x0010 // "s" + IgnorePatternWhitespace RegexOptions = 0x0020 // "x" + RightToLeft RegexOptions = 0x0040 // "r" + ECMAScript RegexOptions = 0x0100 // "e" + RE2 RegexOptions = 0x0200 // RE2 compat mode + Unicode RegexOptions = 0x0400 // "u" ) func optionFromCode(ch rune) RegexOptions { @@ -40,8 +39,6 @@ func optionFromCode(ch rune) RegexOptions { return Singleline case 'x', 'X': return IgnorePatternWhitespace - case 'd', 'D': - return Debug case 'e', 'E': return ECMAScript case 'u', 'U': @@ -83,10 +80,13 @@ const ( ErrMissingBrace = "missing closing }" ErrInvalidRepeatOp = "invalid nested repetition operator" ErrMissingRepeatArgument = "missing argument to repetition operator" + ErrQuantifiedAssertion = "assertion cannot be quantified" ErrConditionalExpression = "illegal conditional (?(...)) expression" ErrTooManyAlternates = "too many | in (?()|)" ErrUnrecognizedGrouping = "unrecognized grouping construct: (%v" ErrInvalidGroupName = "invalid group name: group names must begin with a word character and have a matching terminator" + ErrInvalidECMAGroupName = "invalid capture group name" + ErrDuplicateGroupName = "duplicate capture group name" ErrCapNumNotZero = "capture number cannot be zero" ErrUndefinedBackRef = "reference to undefined group number %v" ErrUndefinedNameRef = "reference to undefined group name %v" @@ -104,7 +104,8 @@ const ( ErrTooFewHex = "insufficient hexadecimal digits" ErrInvalidHex = "hex values may not be larger than 0x10FFFF" ErrMalformedNameRef = "malformed \\k<...> named back reference" - ErrBadClassInCharRange = "cannot include class \\%v in character range" + ErrBadClassInCharRange = "cannot include class \\%c in character range" + ErrShorthandClassInCharRange = "cannot create range with shorthand escape sequence \\%v" ErrUnterminatedBracket = "unterminated [] set" ErrSubtractionMustBeLast = "a subtraction must be the last element in a character class" ErrReversedCharRange = "[%c-%c] range in reverse order" @@ -115,17 +116,16 @@ func (e ErrorCode) String() string { } type parser struct { - stack *regexNode - group *regexNode - alternation *regexNode - concatenation *regexNode - unit *regexNode + stack *RegexNode + group *RegexNode + alternation *RegexNode + concatenation *RegexNode + unit *RegexNode patternRaw string pattern []rune - currentPos int - specialCase *unicode.SpecialCase + currentPos int autocap int capcount int @@ -134,6 +134,12 @@ type parser struct { caps map[int]int capnames map[string]int + // ECMAScript names can refer to multiple distinct capture slots. + namedCaptures map[string][]int + duplicateNames bool + capturePaths map[string][]captureAlternative + + maintainCaptureOrder bool capnumlist []int capnamelist []string @@ -143,16 +149,28 @@ type parser struct { ignoreNextParen bool } +type captureAlternative struct { + group int + branch int +} + +type ParseOptions struct { + RegexOptions RegexOptions + MaintainCaptureOrder bool + CodeGen bool +} + const ( maxValueDiv10 int = math.MaxInt32 / 10 maxValueMod10 = math.MaxInt32 % 10 ) // Parse converts a regex string into a parse tree -func Parse(re string, op RegexOptions) (*RegexTree, error) { +func Parse(re string, op ParseOptions) (*RegexTree, error) { p := parser{ - options: op, - caps: make(map[int]int), + options: op.RegexOptions, + caps: make(map[int]int), + maintainCaptureOrder: op.MaintainCaptureOrder || (op.RegexOptions&ECMAScript) != 0, } p.setPattern(re) @@ -160,25 +178,22 @@ func Parse(re string, op RegexOptions) (*RegexTree, error) { return nil, err } - p.reset(op) + p.reset(op.RegexOptions) root, err := p.scanRegex() if err != nil { return nil, err } tree := &RegexTree{ - root: root, - caps: p.caps, - capnumlist: p.capnumlist, - captop: p.captop, + Root: root, + Caps: p.caps, + Capnumlist: p.capnumlist, + Captop: p.captop, Capnames: p.capnames, Caplist: p.capnamelist, - options: op, - } - - if tree.options&Debug > 0 { - os.Stdout.WriteString(tree.Dump()) + Options: op.RegexOptions, } + tree.FindOptimizations = newFindOptimizations(tree, op) return tree, nil } @@ -212,18 +227,123 @@ func (p *parser) noteCaptureSlot(i, pos int) { } } -func (p *parser) noteCaptureName(name string, pos int) { +// checkCapturePath enforces ECMAScript 2025 §22.2.1.1's duplicate-name early +// error using §22.2.1.4 MightBothParticipate: a common disjunction must separate +// the declarations. Check the original grammar before reductions change it. +// https://tc39.es/ecma262/2025/multipage/text-processing.html#sec-static-semantics-mightbothparticipate +func (p *parser) checkCapturePath(name string, path []captureAlternative) error { + if len(p.namedCaptures[name]) < 2 { + return nil + } + if p.capturePaths == nil { + p.capturePaths = make(map[string][]captureAlternative) + } + // Declarations in each alternative are contiguous in source order. If + // any pair can participate together, an adjacent pair can too. + previous := p.capturePaths[name] + if len(previous) != 0 { + separated := false + for i := 0; i < len(previous) && i < len(path); i++ { + if previous[i].group != path[i].group { + break + } + if previous[i].branch != path[i].branch { + separated = true + break + } + } + if !separated { + return p.getErr(ErrDuplicateGroupName) + } + } + p.capturePaths[name] = append(previous[:0], path...) + return nil +} + +// ECMAScript 2025 §22.2.2.7.2 BackreferenceMatcher selects the sole defined +// capture among the named slots (step 1.6) and consumes nothing if none is +// defined (step 1.7). Concatenating numeric references has the same effect. +// https://tc39.es/ecma262/2025/multipage/text-processing.html#sec-backreferencematcher +func (p *parser) namedReference(name string) *RegexNode { + slots := p.namedCaptures[name] + if !p.useOptionE() || len(slots) < 2 { + return newRegexNodeM(NtRef, p.options, p.captureSlotFromName(name)) + } + node := newRegexNode(NtConcatenate, p.options) + for _, slot := range slots { + node.addChild(newRegexNodeM(NtRef, p.options, slot)) + } + return node +} + +// ECMAScript 2025 §22.2.2.3.1 RepeatMatcher, step 4, clears the quantified +// atom's captures before each iteration. Resets stay distinct from references +// so boolean compilation can omit unobserved slots; full compilation emits +// a dedicated reset instruction with backtracking restore. +// https://tc39.es/ecma262/2025/multipage/text-processing.html#sec-repeatmatcher +func (p *parser) resetQuantifiedCaptures(atom *RegexNode) *RegexNode { + var slots []int + stack := []*RegexNode{atom} + for len(stack) > 0 { + node := stack[len(stack)-1] + stack = stack[:len(stack)-1] + if node.T == NtCapture && node.M > 0 { + slots = append(slots, node.M) + } + stack = append(stack, node.Children...) + } + if len(slots) == 0 { + return atom + } + sequence := newRegexNode(NtConcatenate, atom.Options) + for _, slot := range slots { + sequence.addChild(newRegexNodeM(NtResetCapture, atom.Options, slot)) + } + sequence.addChild(atom) + return sequence +} + +func (p *parser) noteCaptureName(name string, pos int) error { if p.capnames == nil { p.capnames = make(map[string]int) } + if p.useOptionE() { + // §22.2.1.3 CountLeftCapturingParensBefore assigns each declaration + // its own number in source order, including duplicate names. Keeping + // the first number in capnames is regexp2's static API lookup policy. + if p.namedCaptures == nil { + p.namedCaptures = make(map[string][]int) + } + slot := p.consumeAutocap() + p.noteCaptureSlot(slot, pos) + if _, ok := p.capnames[name]; !ok { + p.capnames[name] = slot + } else { + p.duplicateNames = true + } + p.namedCaptures[name] = append(p.namedCaptures[name], slot) + return nil + } if _, ok := p.capnames[name]; !ok { - p.capnames[name] = pos + if p.maintainCaptureOrder { + slot := p.consumeAutocap() + p.capnames[name] = slot + p.noteCaptureSlot(slot, pos) + } else { + p.capnames[name] = pos + } p.capnamelist = append(p.capnamelist, name) } + return nil } func (p *parser) assignNameSlots() { + if p.maintainCaptureOrder { + p.assignOrderedNameSlots() + return + } + if p.capnames != nil { for _, name := range p.capnamelist { for p.isCaptureSlot(p.autocap) { @@ -293,12 +413,78 @@ func (p *parser) assignNameSlots() { } } +func (p *parser) assignOrderedNameSlots() { + if !p.useOptionE() && p.capnames == nil && p.capcount == p.captop { + return + } + + if p.capcount < p.captop { + p.capnumlist = make([]int, p.capcount) + i := 0 + for k := range p.caps { + p.capnumlist[i] = k + i++ + } + sort.Ints(p.capnumlist) + } + + names := p.capnamelist + p.capnamelist = make([]string, p.capcount) + if p.capnames == nil { + p.capnames = make(map[string]int, p.capcount) + } + if p.useOptionE() { + for name, slots := range p.namedCaptures { + for _, slot := range slots { + p.capnamelist[slot] = name + } + } + return + } + + for _, name := range names { + slot := p.capnames[name] + index := slot + if p.capnumlist != nil { + for i, capnum := range p.capnumlist { + if capnum == slot { + index = i + break + } + } + } + p.capnamelist[index] = name + } + + for i := 0; i < p.capcount; i++ { + slot := i + if p.capnumlist != nil { + slot = p.capnumlist[i] + } + if p.useOptionE() { + continue + } + if p.capnamelist[i] == "" { + p.capnamelist[i] = strconv.Itoa(slot) + } + if _, ok := p.capnames[p.capnamelist[i]]; !ok { + p.capnames[p.capnamelist[i]] = slot + } + } +} + func (p *parser) consumeAutocap() int { r := p.autocap p.autocap++ return r } +func (p *parser) consumeCaptureSlot(capnum int) { + if p.maintainCaptureOrder && capnum == p.autocap { + p.consumeAutocap() + } +} + // CountCaptures is a prescanner for deducing the slots used for // captures by doing a partial tokenization of the pattern. func (p *parser) countCaptures() error { @@ -314,17 +500,17 @@ func (p *parser) countCaptures() error { switch ch { case '\\': if p.charsRight() > 0 { - p.scanBackslash(true) + _, _ = p.scanBackslash(true) } case '#': if p.useOptionX() { p.moveLeft() - p.scanBlank() + _ = p.scanBlank() } case '[': - p.scanCharSet(false, true) + _, _ = p.scanCharSet(false, true) case ')': if !p.emptyOptionsStack() { @@ -334,7 +520,7 @@ func (p *parser) countCaptures() error { case '(': if p.charsRight() >= 2 && p.rightChar(1) == '#' && p.rightChar(0) == '?' { p.moveLeft() - p.scanBlank() + _ = p.scanBlank() } else { p.pushOptions() if p.charsRight() > 0 && p.rightChar(0) == '?' { @@ -347,15 +533,27 @@ func (p *parser) countCaptures() error { p.moveRight(1) ch = p.rightChar(0) - if ch != '0' && IsWordChar(ch) { - if ch >= '1' && ch <= '9' { + if ch != '0' && p.isGroupNameStartChar(ch) { + if ch >= '1' && ch <= '9' && !p.useOptionE() { dec, err := p.scanDecimal() if err != nil { return err } - p.noteCaptureSlot(dec, pos) + if p.maintainCaptureOrder { + if err = p.noteCaptureName(strconv.Itoa(dec), pos); err != nil { + return err + } + } else { + p.noteCaptureSlot(dec, pos) + } } else { - p.noteCaptureName(p.scanCapname(), pos) + capname, err := p.scanCapname() + if err != nil { + return err + } + if err = p.noteCaptureName(capname, pos); err != nil { + return err + } } } } else if p.useRE2() && p.charsRight() > 2 && (p.rightChar(0) == 'P' && p.rightChar(1) == '<') { @@ -363,7 +561,13 @@ func (p *parser) countCaptures() error { p.moveRight(2) ch = p.rightChar(0) if IsWordChar(ch) { - p.noteCaptureName(p.scanCapname(), pos) + capname, err := p.scanCapname() + if err != nil { + return err + } + if err = p.noteCaptureName(capname, pos); err != nil { + return err + } } } else { @@ -416,11 +620,16 @@ func (p *parser) reset(topopts RegexOptions) { p.stack = nil } -func (p *parser) scanRegex() (*regexNode, error) { - ch := '@' // nonspecial ch, means at beginning +func (p *parser) scanRegex() (*RegexNode, error) { + var ch rune // nonspecial ch, means at beginning isQuant := false - p.startGroup(newRegexNodeMN(ntCapture, p.options, 0, -1)) + p.startGroup(newRegexNodeMN(NtCapture, p.options, 0, -1)) + var path []captureAlternative + if p.duplicateNames { + path = []captureAlternative{{}} + } + nextGroup := 0 for p.charsRight() > 0 { wasPrevQuantifier := isQuant @@ -437,8 +646,7 @@ func (p *parser) scanRegex() (*regexNode, error) { if p.useOptionX() { for p.charsRight() > 0 { ch = p.rightChar(0) - //UGLY: clean up, this is ugly - if !(!isStopperX(ch) || (ch == '{' && !p.isTrueQuantifier())) { + if isStopperX(ch) && (ch != '{' || p.isTrueQuantifier()) { break } p.moveRight(1) @@ -446,7 +654,7 @@ func (p *parser) scanRegex() (*regexNode, error) { } else { for p.charsRight() > 0 { ch = p.rightChar(0) - if !(!isSpecial(ch) || ch == '{' && !p.isTrueQuantifier()) { + if isSpecial(ch) && (ch != '{' || p.isTrueQuantifier()) { break } p.moveRight(1) @@ -455,7 +663,9 @@ func (p *parser) scanRegex() (*regexNode, error) { endpos := p.textpos() - p.scanBlank() + if err := p.scanBlank(); err != nil { + return nil, err + } if p.charsRight() == 0 { ch = '!' // nonspecial, means at end @@ -497,6 +707,15 @@ func (p *parser) scanRegex() (*regexNode, error) { p.addUnitSet(cc) case '(': + if p.useRE2() && p.charsRight() >= 3 && p.rightChar(0) == '?' && p.rightChar(1) == 'P' && p.rightChar(2) == '=' { + n, err := p.scanPythonNamedBackref() + if err != nil { + return nil, err + } + p.addUnitNode(n) + break + } + p.pushOptions() if grouper, err := p.scanGroupOpen(); err != nil { @@ -504,6 +723,18 @@ func (p *parser) scanRegex() (*regexNode, error) { } else if grouper == nil { p.popKeepOptions() } else { + if p.duplicateNames && grouper.T == NtCapture { + name := p.capnamelist[grouper.M] + if name != "" { + if err := p.checkCapturePath(name, path); err != nil { + return nil, err + } + } + } + if p.duplicateNames { + nextGroup++ + path = append(path, captureAlternative{group: nextGroup}) + } p.pushGroup() p.startGroup(grouper) } @@ -511,6 +742,9 @@ func (p *parser) scanRegex() (*regexNode, error) { continue case '|': + if p.duplicateNames { + path[len(path)-1].branch++ + } p.addAlternate() goto ContinueOuterScan @@ -526,30 +760,43 @@ func (p *parser) scanRegex() (*regexNode, error) { return nil, err } p.popOptions() + if p.duplicateNames { + path = path[:len(path)-1] + } if p.unit == nil { goto ContinueOuterScan } case '\\': + quoted := !p.useOptionE() && p.charsRight() > 0 && p.rightChar(0) == 'Q' n, err := p.scanBackslash(false) if err != nil { return nil, err } - p.addUnitNode(n) + if quoted { + p.addQuotedUnit(n) + } else { + p.addUnitNode(n) + } case '^': if p.useOptionM() { - p.addUnitType(ntBol) + p.addUnitType(NtBol) } else { - p.addUnitType(ntBeginning) + p.addUnitType(NtBeginning) } case '$': if p.useOptionM() { - p.addUnitType(ntEol) + p.addUnitType(NtEol) + } else if p.useRE2() || p.useOptionE() { + // RE2 and EcmaScript define $ as "asserts position at the end of the string" + // PCRE/.NET adds "or before the line terminator right at the end of the string (if any)" + // which is NtEnd, not NtEndZ + p.addUnitType(NtEnd) } else { - p.addUnitType(ntEndZ) + p.addUnitType(NtEndZ) } case '.': @@ -588,12 +835,16 @@ func (p *parser) scanRegex() (*regexNode, error) { goto ContinueOuterScan } + if p.useOptionE() && p.unit != nil && !p.isECMAQuantifiable(p.unit) { + return nil, p.getErr(ErrQuantifiedAssertion) + } + ch = p.moveRightGetChar() // Handle quantifiers for p.unit != nil { var min, max int - var lazy bool + var lazy, possessive bool switch ch { case '*': @@ -644,18 +895,19 @@ func (p *parser) scanRegex() (*regexNode, error) { return nil, err } - if p.charsRight() == 0 || p.rightChar(0) != '?' { - lazy = false - } else { + if p.charsRight() > 0 && p.rightChar(0) == '?' { p.moveRight(1) lazy = true + } else if p.charsRight() > 0 && p.rightChar(0) == '+' && !p.useOptionE() { + p.moveRight(1) + possessive = true } if min > max { return nil, p.getErr(ErrInvalidRepeatSize) } - p.addConcatenate3(lazy, min, max) + p.addConcatenate3(lazy, possessive, min, max) } ContinueOuterScan: @@ -672,17 +924,17 @@ BreakOuterScan: return nil, err } - return p.unit, nil + return p.unit.finalOptimize(), nil } /* * Simple parsing for replacement patterns */ -func (p *parser) scanReplacement() (*regexNode, error) { +func (p *parser) scanReplacement() (*RegexNode, error) { var c, startpos int - p.concatenation = newRegexNode(ntConcatenate, p.options) + p.concatenation = newRegexNode(NtConcatenate, p.options) for { c = p.charsRight() @@ -705,6 +957,12 @@ func (p *parser) scanReplacement() (*regexNode, error) { if err != nil { return nil, err } + if n.T == NtConcatenate { + for _, child := range n.Children { + p.concatenation.addChild(child) + } + continue + } p.addUnitNode(n) } p.addConcatenate() @@ -717,9 +975,9 @@ func (p *parser) scanReplacement() (*regexNode, error) { /* * Scans $ patterns recognized within replacement patterns */ -func (p *parser) scanDollar() (*regexNode, error) { +func (p *parser) scanDollar() (*RegexNode, error) { if p.charsRight() == 0 { - return newRegexNodeCh(ntOne, p.options, '$'), nil + return newRegexNodeCh(NtOne, p.options, '$'), nil } ch := p.rightChar(0) @@ -767,7 +1025,7 @@ func (p *parser) scanDollar() (*regexNode, error) { } p.textto(lastEndPos) if capnum >= 0 { - return newRegexNodeM(ntRef, p.options, capnum), nil + return newRegexNodeM(NtRef, p.options, capnum), nil } } else { capnum, err := p.scanDecimal() @@ -776,16 +1034,19 @@ func (p *parser) scanDollar() (*regexNode, error) { } if !angled || p.charsRight() > 0 && p.moveRightGetChar() == '}' { if p.isCaptureSlot(capnum) { - return newRegexNodeM(ntRef, p.options, capnum), nil + return newRegexNodeM(NtRef, p.options, capnum), nil } } } - } else if angled && IsWordChar(ch) { - capname := p.scanCapname() + } else if angled && p.isGroupNameStartChar(ch) { + capname, err := p.scanCapname() + if err != nil { + return nil, err + } if p.charsRight() > 0 && p.moveRightGetChar() == '}' { if p.isCaptureName(capname) { - return newRegexNodeM(ntRef, p.options, p.captureSlotFromName(capname)), nil + return p.namedReference(capname), nil } } } else if !angled { @@ -794,7 +1055,7 @@ func (p *parser) scanDollar() (*regexNode, error) { switch ch { case '$': p.moveRight(1) - return newRegexNodeCh(ntOne, p.options, '$'), nil + return newRegexNodeCh(NtOne, p.options, '$'), nil case '&': capnum = 0 case '`': @@ -809,22 +1070,56 @@ func (p *parser) scanDollar() (*regexNode, error) { if capnum != 1 { p.moveRight(1) - return newRegexNodeM(ntRef, p.options, capnum), nil + return newRegexNodeM(NtRef, p.options, capnum), nil } } // unrecognized $: literalize p.textto(backpos) - return newRegexNodeCh(ntOne, p.options, '$'), nil + return newRegexNodeCh(NtOne, p.options, '$'), nil +} + +func (p *parser) isGroupNameStartChar(ch rune) bool { + if p.useOptionE() { + return IsECMAIdentifierStartChar(ch) || ch == '\\' + } + return IsWordChar(ch) +} + +func (p *parser) scanPythonNamedBackref() (*RegexNode, error) { + p.moveRight(3) + if p.charsRight() == 0 { + return nil, p.getErr(ErrMalformedNameRef) + } + + ch := p.rightChar(0) + if !p.isGroupNameStartChar(ch) { + return nil, p.getErr(ErrInvalidGroupName) + } + + capname, err := p.scanCapname() + if err != nil { + return nil, err + } + + if capname == "" || p.charsRight() == 0 || p.moveRightGetChar() != ')' { + return nil, p.getErr(ErrMalformedNameRef) + } + + if !p.isCaptureName(capname) { + return nil, p.getErr(ErrUndefinedNameRef, capname) + } + + return p.namedReference(capname), nil } // scanGroupOpen scans chars following a '(' (not counting the '('), and returns // a RegexNode for the type of group scanned, or nil if the group // simply changed options (?cimsx-cimsx) or was a comment (#...). -func (p *parser) scanGroupOpen() (*regexNode, error) { +func (p *parser) scanGroupOpen() (*RegexNode, error) { var ch rune - var nt nodeType + var nt NodeType var err error close := '>' start := p.textpos() @@ -836,32 +1131,28 @@ func (p *parser) scanGroupOpen() (*regexNode, error) { if p.charsRight() == 0 || p.rightChar(0) != '?' || (p.rightChar(0) == '?' && (p.charsRight() > 1 && p.rightChar(1) == ')')) { if p.useOptionN() || p.ignoreNextParen { p.ignoreNextParen = false - return newRegexNode(ntGroup, p.options), nil + return newRegexNode(NtGroup, p.options), nil } - return newRegexNodeMN(ntCapture, p.options, p.consumeAutocap(), -1), nil + return newRegexNodeMN(NtCapture, p.options, p.consumeAutocap(), -1), nil } p.moveRight(1) - for { - if p.charsRight() == 0 { - break - } - + for p.charsRight() > 0 { switch ch = p.moveRightGetChar(); ch { case ':': - nt = ntGroup + nt = NtGroup case '=': p.options &= ^RightToLeft - nt = ntRequire + nt = NtPosLook case '!': p.options &= ^RightToLeft - nt = ntPrevent + nt = NtNegLook case '>': - nt = ntGreedy + nt = NtAtomic case '\'': close = '\'' @@ -879,7 +1170,7 @@ func (p *parser) scanGroupOpen() (*regexNode, error) { } p.options |= RightToLeft - nt = ntRequire + nt = NtPosLook case '!': if close == '\'' { @@ -887,7 +1178,7 @@ func (p *parser) scanGroupOpen() (*regexNode, error) { } p.options |= RightToLeft - nt = ntPrevent + nt = NtNegLook default: p.moveLeft() @@ -897,7 +1188,7 @@ func (p *parser) scanGroupOpen() (*regexNode, error) { // grab part before - - if ch >= '0' && ch <= '9' { + if ch >= '0' && ch <= '9' && !p.useOptionE() { if capnum, err = p.scanDecimal(); err != nil { return nil, err } @@ -907,33 +1198,46 @@ func (p *parser) scanGroupOpen() (*regexNode, error) { } // check if we have bogus characters after the number - if p.charsRight() > 0 && !(p.rightChar(0) == close || p.rightChar(0) == '-') { + if p.charsRight() > 0 && p.rightChar(0) != close && p.rightChar(0) != '-' { return nil, p.getErr(ErrInvalidGroupName) } if capnum == 0 { return nil, p.getErr(ErrCapNumNotZero) } - } else if IsWordChar(ch) { - capname := p.scanCapname() + } else if p.isGroupNameStartChar(ch) { + capname, err := p.scanCapname() + if err != nil { + return nil, err + } if p.isCaptureName(capname) { - capnum = p.captureSlotFromName(capname) + if p.useOptionE() { + capnum = p.autocap + } else { + capnum = p.captureSlotFromName(capname) + } } // check if we have bogus character after the name - if p.charsRight() > 0 && !(p.rightChar(0) == close || p.rightChar(0) == '-') { + if p.charsRight() > 0 && p.rightChar(0) != close && p.rightChar(0) != '-' { + if p.useOptionE() { + return nil, p.getErr(ErrInvalidECMAGroupName) + } return nil, p.getErr(ErrInvalidGroupName) } } else if ch == '-' { proceed = true } else { // bad group name - starts with something other than a word character and isn't a number + if p.useOptionE() { + return nil, p.getErr(ErrInvalidECMAGroupName) + } return nil, p.getErr(ErrInvalidGroupName) } // grab part after - if any - if (capnum != -1 || proceed == true) && p.charsRight() > 0 && p.rightChar(0) == '-' { + if !p.useOptionE() && (capnum != -1 || proceed) && p.charsRight() > 0 && p.rightChar(0) == '-' { p.moveRight(1) //no more chars left, no closing char, etc @@ -956,7 +1260,10 @@ func (p *parser) scanGroupOpen() (*regexNode, error) { return nil, p.getErr(ErrInvalidGroupName) } } else if IsWordChar(ch) { - uncapname := p.scanCapname() + uncapname, err := p.scanCapname() + if err != nil { + return nil, err + } if !p.isCaptureName(uncapname) { return nil, p.getErr(ErrUndefinedNameRef, uncapname) @@ -976,7 +1283,8 @@ func (p *parser) scanGroupOpen() (*regexNode, error) { // actually make the node if (capnum != -1 || uncapnum != -1) && p.charsRight() > 0 && p.moveRightGetChar() == close { - return newRegexNodeMN(ntCapture, p.options, capnum, uncapnum), nil + p.consumeCaptureSlot(capnum) + return newRegexNodeMN(NtCapture, p.options, capnum, uncapnum), nil } goto BreakRecognize } @@ -996,7 +1304,7 @@ func (p *parser) scanGroupOpen() (*regexNode, error) { } if p.charsRight() > 0 && p.moveRightGetChar() == ')' { if p.isCaptureSlot(capnum) { - return newRegexNodeM(ntTestref, p.options, capnum), nil + return newRegexNodeM(NtBackRefCond, p.options, capnum), nil } return nil, p.getErr(ErrUndefinedReference, capnum) } @@ -1004,15 +1312,18 @@ func (p *parser) scanGroupOpen() (*regexNode, error) { return nil, p.getErr(ErrMalformedReference, capnum) } else if IsWordChar(ch) { - capname := p.scanCapname() + capname, err := p.scanCapname() + if err != nil { + return nil, err + } if p.isCaptureName(capname) && p.charsRight() > 0 && p.moveRightGetChar() == ')' { - return newRegexNodeM(ntTestref, p.options, p.captureSlotFromName(capname)), nil + return newRegexNodeM(NtBackRefCond, p.options, p.captureSlotFromName(capname)), nil } } } // not a backref - nt = ntTestgroup + nt = NtExprCond p.textto(parenPos - 1) // jump to the start of the parentheses p.ignoreNextParen = true // but make sure we don't try to capture the insides @@ -1051,10 +1362,17 @@ func (p *parser) scanGroupOpen() (*regexNode, error) { if IsWordChar(ch) { capnum := -1 - capname := p.scanCapname() + capname, err := p.scanCapname() + if err != nil { + return nil, err + } if p.isCaptureName(capname) { - capnum = p.captureSlotFromName(capname) + if p.useOptionE() { + capnum = p.autocap + } else { + capnum = p.captureSlotFromName(capname) + } } // check if we have bogus character after the name @@ -1065,7 +1383,8 @@ func (p *parser) scanGroupOpen() (*regexNode, error) { // actually make the node if capnum != -1 && p.charsRight() > 0 && p.moveRightGetChar() == '>' { - return newRegexNodeMN(ntCapture, p.options, capnum, -1), nil + p.consumeCaptureSlot(capnum) + return newRegexNodeMN(NtCapture, p.options, capnum, -1), nil } goto BreakRecognize @@ -1081,9 +1400,9 @@ func (p *parser) scanGroupOpen() (*regexNode, error) { default: p.moveLeft() - nt = ntGroup + nt = NtGroup // disallow options in the children of a testgroup node - if p.group.t != ntTestgroup { + if p.group.T != NtExprCond { p.scanOptions() } if p.charsRight() == 0 { @@ -1111,84 +1430,185 @@ BreakRecognize: } // scans backslash specials and basics -func (p *parser) scanBackslash(scanOnly bool) (*regexNode, error) { +func (p *parser) scanBackslash(scanOnly bool) (*RegexNode, error) { if p.charsRight() == 0 { return nil, p.getErr(ErrIllegalEndEscape) } switch ch := p.rightChar(0); ch { - case 'b', 'B', 'A', 'G', 'Z', 'z': + case 'Q': + if p.useOptionE() { + return p.scanBasicBackslash(scanOnly) + } + p.moveRight(1) + quoted := p.scanQuoted() + if scanOnly { + return nil, nil + } + return newRegexNodeStr(NtMulti, p.options&^IgnoreCase, quoted), nil + + case 'R': + if p.useOptionE() || p.useRE2() { + return p.scanBasicBackslash(scanOnly) + } + p.moveRight(1) + if scanOnly { + return nil, nil + } + return newUnicodeNewlineNode(p.options), nil + + case 'X': + if p.useOptionE() || p.useRE2() { + return p.scanBasicBackslash(scanOnly) + } + p.moveRight(1) + if scanOnly { + return nil, nil + } + return newRegexNode(NtGrapheme, p.options), nil + + case 'A', 'G', 'Z', 'z': + if p.useOptionE() && !p.useOptionU() { + return p.scanBasicBackslash(scanOnly) + } + p.moveRight(1) + return newRegexNode(p.typeFromCode(ch), p.options), nil + + case 'b', 'B': p.moveRight(1) return newRegexNode(p.typeFromCode(ch), p.options), nil case 'w': p.moveRight(1) - if p.useOptionE() || p.useRE2() { - return newRegexNodeSet(ntSet, p.options, ECMAWordClass()), nil + if p.useOptionE() { + return newRegexNodeSet(NtSet, p.options, ecmaWordClass(p.options, false)), nil + } + if p.useRE2() { + return newRegexNodeSet(NtSet, p.options, ECMAWordClass()), nil } - return newRegexNodeSet(ntSet, p.options, WordClass()), nil + return newRegexNodeSet(NtSet, p.options, WordClass()), nil case 'W': p.moveRight(1) - if p.useOptionE() || p.useRE2() { - return newRegexNodeSet(ntSet, p.options, NotECMAWordClass()), nil + if p.useOptionE() { + return newRegexNodeSet(NtSet, p.options, ecmaWordClass(p.options, true)), nil + } + if p.useRE2() { + return newRegexNodeSet(NtSet, p.options, NotECMAWordClass()), nil } - return newRegexNodeSet(ntSet, p.options, NotWordClass()), nil + return newRegexNodeSet(NtSet, p.options, NotWordClass()), nil case 's': p.moveRight(1) if p.useOptionE() { - return newRegexNodeSet(ntSet, p.options, ECMASpaceClass()), nil + return newRegexNodeSet(NtSet, p.options, ECMASpaceClass()), nil } else if p.useRE2() { - return newRegexNodeSet(ntSet, p.options, RE2SpaceClass()), nil + return newRegexNodeSet(NtSet, p.options, RE2SpaceClass()), nil } - return newRegexNodeSet(ntSet, p.options, SpaceClass()), nil + return newRegexNodeSet(NtSet, p.options, SpaceClass()), nil case 'S': p.moveRight(1) if p.useOptionE() { - return newRegexNodeSet(ntSet, p.options, NotECMASpaceClass()), nil + return newRegexNodeSet(NtSet, p.options, NotECMASpaceClass()), nil } else if p.useRE2() { - return newRegexNodeSet(ntSet, p.options, NotRE2SpaceClass()), nil + return newRegexNodeSet(NtSet, p.options, NotRE2SpaceClass()), nil } - return newRegexNodeSet(ntSet, p.options, NotSpaceClass()), nil + return newRegexNodeSet(NtSet, p.options, NotSpaceClass()), nil case 'd': p.moveRight(1) if p.useOptionE() || p.useRE2() { - return newRegexNodeSet(ntSet, p.options, ECMADigitClass()), nil + return newRegexNodeSet(NtSet, p.options, ECMADigitClass()), nil } - return newRegexNodeSet(ntSet, p.options, DigitClass()), nil + return newRegexNodeSet(NtSet, p.options, DigitClass()), nil case 'D': p.moveRight(1) if p.useOptionE() || p.useRE2() { - return newRegexNodeSet(ntSet, p.options, NotECMADigitClass()), nil + return newRegexNodeSet(NtSet, p.options, NotECMADigitClass()), nil } - return newRegexNodeSet(ntSet, p.options, NotDigitClass()), nil + return newRegexNodeSet(NtSet, p.options, NotDigitClass()), nil case 'p', 'P': + // skip if we're in ECMAScript mode WITHOUT unicode flag + if p.useOptionE() && !p.useOptionU() { + return p.scanBasicBackslash(scanOnly) + } + p.moveRight(1) prop, err := p.parseProperty() if err != nil { return nil, err } cc := &CharSet{} - cc.addCategory(prop, (ch != 'p'), p.useOptionI(), p.patternRaw) - if p.useOptionI() { + p.addProperty(cc, prop, (ch != 'p'), p.useOptionI()) + if p.useOptionI() && !p.useOptionE() { cc.addLowercase() } - return newRegexNodeSet(ntSet, p.options, cc), nil + return newRegexNodeSet(NtSet, p.options, cc), nil default: return p.scanBasicBackslash(scanOnly) } } +// newUnicodeNewlineNode constructs \R from existing general-purpose nodes. +// Its branches have disjoint starting sets, and the optional LF is atomic, so +// reduction can remove the outer atomic wrapper without changing semantics. +func newUnicodeNewlineNode(options RegexOptions) *RegexNode { + options &^= IgnoreCase + + lead, optional := '\r', '\n' + if options&RightToLeft != 0 { + // Stored concatenations are already in execution order. In RTL, consume + // LF first and then the optional preceding CR. + lead, optional = '\n', '\r' + } + + newlines := &CharSet{} + for _, ch := range []rune{'\n', '\v', '\f', '\u0085', '\u2028', '\u2029'} { + if ch != lead { + newlines.addChar(ch) + } + } + if '\r' != lead { + newlines.addChar('\r') + } + + crlf := newRegexNode(NtConcatenate, options) + crlf.addChild(newRegexNodeCh(NtOne, options, lead)) + crlf.addChild(newRegexNodeCh(NtOne, options, optional).makeQuantifier(false, 0, 1)) + + alternate := newRegexNode(NtAlternate, options) + alternate.addChild(newRegexNodeSet(NtSet, options, newlines)) + alternate.addChild(crlf) + + atomic := newRegexNode(NtAtomic, options) + atomic.addChild(alternate) + return atomic +} + +// scanQuoted scans the literal text after \Q through the next \E, or through +// the end of the pattern when there is no terminator. +func (p *parser) scanQuoted() []rune { + start := p.textpos() + var quoted []rune + for p.charsRight() > 0 { + if p.rightChar(0) == '\\' && p.charsRight() > 1 && p.rightChar(1) == 'E' { + quoted = append(quoted, p.pattern[start:p.textpos()]...) + p.moveRight(2) + return quoted + } + p.moveRight(1) + } + return append(quoted, p.pattern[start:p.textpos()]...) +} + // Scans \-style backreferences and character escapes -func (p *parser) scanBasicBackslash(scanOnly bool) (*regexNode, error) { +func (p *parser) scanBasicBackslash(scanOnly bool) (*RegexNode, error) { if p.charsRight() == 0 { return nil, p.getErr(ErrIllegalEndEscape) } @@ -1205,7 +1625,7 @@ func (p *parser) scanBasicBackslash(scanOnly bool) (*regexNode, error) { // there is at least one group name in the regexp. // See https://www.ecma-international.org/ecma-262/#sec-isvalidregularexpressionliteral, step 7. // Note, during the first (scanOnly) run we may not have all group names scanned, but that's ok. - if ch == 'k' && (!p.useOptionE() || len(p.capnames) > 0) { + if ch == 'k' && (!p.useOptionE() || p.useOptionU() || len(p.capnames) > 0) { if p.charsRight() >= 2 { p.moveRight(1) ch = p.moveRightGetChar() @@ -1249,7 +1669,7 @@ func (p *parser) scanBasicBackslash(scanOnly bool) (*regexNode, error) { if p.charsRight() > 0 && p.moveRightGetChar() == close { if p.isCaptureSlot(capnum) { - return newRegexNodeM(ntRef, p.options, capnum), nil + return newRegexNodeM(NtRef, p.options, capnum), nil } return nil, p.getErr(ErrUndefinedBackRef, capnum) } @@ -1264,14 +1684,17 @@ func (p *parser) scanBasicBackslash(scanOnly bool) (*regexNode, error) { } if p.isCaptureSlot(capnum) { - return newRegexNodeM(ntRef, p.options, capnum), nil + return newRegexNodeM(NtRef, p.options, capnum), nil } if capnum <= 9 && !p.useOptionE() { return nil, p.getErr(ErrUndefinedBackRef, capnum) } } else if angled { - capname := p.scanCapname() + capname, err := p.scanCapname() + if err != nil { + return nil, err + } if capname != "" && p.charsRight() > 0 && p.moveRightGetChar() == close { @@ -1280,7 +1703,7 @@ func (p *parser) scanBasicBackslash(scanOnly bool) (*regexNode, error) { } if p.isCaptureName(capname) { - return newRegexNodeM(ntRef, p.options, p.captureSlotFromName(capname)), nil + return p.namedReference(capname), nil } return nil, p.getErr(ErrUndefinedNameRef, capname) } else { @@ -1293,7 +1716,7 @@ func (p *parser) scanBasicBackslash(scanOnly bool) (*regexNode, error) { // Not backreference: must be char code p.textto(backpos) - ch, err := p.scanCharEscape() + ch, err := p.scanCharEscape(false) if err != nil { return nil, err } @@ -1302,24 +1725,25 @@ func (p *parser) scanBasicBackslash(scanOnly bool) (*regexNode, error) { return nil, nil } - if p.useOptionI() { + if p.useOptionI() && !p.useOptionE() { ch = unicode.ToLower(ch) } - return newRegexNodeCh(ntOne, p.options, ch), nil + return newRegexNodeCh(NtOne, p.options, ch), nil } // Scans X for \p{X} or \P{X} func (p *parser) parseProperty() (string, error) { // RE2 and PCRE supports \pX syntax (no {} and only 1 letter unicode cats supported) // since this is purely additive syntax it's not behind a flag - if p.charsRight() >= 1 && p.rightChar(0) != '{' { + if p.charsRight() >= 1 && p.rightChar(0) != '{' && (!p.useOptionE() || !p.useOptionU()) { ch := string(p.moveRightGetChar()) // check if it's a valid cat - if !isValidUnicodeCat(ch) { + canonical, ok := canonicalUnicodeCatName(ch) + if !ok { return "", p.getErr(ErrUnknownSlashP, ch) } - return ch, nil + return canonical, nil } if p.charsRight() < 3 { @@ -1333,7 +1757,7 @@ func (p *parser) parseProperty() (string, error) { startpos := p.textpos() for p.charsRight() > 0 { ch = p.moveRightGetChar() - if !(IsWordChar(ch) || ch == '-') { + if !IsWordChar(ch) && ch != '-' && ch != '=' { p.moveLeft() break } @@ -1344,36 +1768,41 @@ func (p *parser) parseProperty() (string, error) { return "", p.getErr(ErrIncompleteSlashP) } - if !isValidUnicodeCat(capname) { + resolve := canonicalUnicodeCatName + if p.useOptionE() && p.useOptionU() { + resolve = canonicalECMAProperty + } + canonical, ok := resolve(capname) + if !ok { return "", p.getErr(ErrUnknownSlashP, capname) } - return capname, nil + return canonical, nil } // Returns ReNode type for zero-length assertions with a \ code. -func (p *parser) typeFromCode(ch rune) nodeType { +func (p *parser) typeFromCode(ch rune) NodeType { switch ch { case 'b': if p.useOptionE() { - return ntECMABoundary + return NtECMABoundary } - return ntBoundary + return NtBoundary case 'B': if p.useOptionE() { - return ntNonECMABoundary + return NtNonECMABoundary } - return ntNonboundary + return NtNonboundary case 'A': - return ntBeginning + return NtBeginning case 'G': - return ntStart + return NtStart case 'Z': - return ntEndZ + return NtEndZ case 'z': - return ntEnd + return NtEnd default: - return ntNothing + return NtNothing } } @@ -1425,7 +1854,72 @@ func (p *parser) scanBlank() error { return nil } -func (p *parser) scanCapname() string { +func (p *parser) scanECMACapname() (string, error) { + startpos := p.textpos() + var sb strings.Builder + hasEscape := false + index := 0 + + for p.charsRight() > 0 { + savedpos := p.textpos() + ch := p.moveRightGetChar() + var err error + escaped := false + + if ch == '\\' { + if p.charsRight() == 0 || p.rightChar(0) != 'u' { + return "", p.getErr(ErrInvalidECMAGroupName) + } + escaped = true + p.moveRight(1) + if p.charsRight() > 0 && p.rightChar(0) == '{' { + p.moveRight(1) + ch, err = p.scanHexUntilBrace() + } else { + ch, err = p.scanHex(4) + if err == nil && ch >= 0xD800 && ch <= 0xDBFF && p.charsRight() >= 6 && p.rightChar(0) == '\\' && p.rightChar(1) == 'u' { + pos := p.textpos() + p.moveRight(2) + if lo, err := p.scanHex(4); err == nil && lo >= 0xDC00 && lo <= 0xDFFF { + ch = utf16.DecodeRune(ch, lo) + } else { + p.textto(pos) + } + } + } + if err != nil { + return "", err + } + if !hasEscape { + sb.WriteString(string(p.pattern[startpos:savedpos])) + hasEscape = true + } + } + + valid := IsECMAIdentifierChar(ch) + if index == 0 { + valid = IsECMAIdentifierStartChar(ch) + } + if !valid { + if escaped { + return "", p.getErr(ErrInvalidECMAGroupName) + } + p.textto(savedpos) + break + } + if hasEscape { + sb.WriteRune(ch) + } + index++ + } + + if hasEscape { + return sb.String(), nil + } + return string(p.pattern[startpos:p.textpos()]), nil +} + +func (p *parser) scanWord() string { startpos := p.textpos() for p.charsRight() > 0 { @@ -1438,13 +1932,23 @@ func (p *parser) scanCapname() string { return string(p.pattern[startpos:p.textpos()]) } +func (p *parser) scanCapname() (string, error) { + if p.useOptionE() { + return p.scanECMACapname() + } + + return p.scanWord(), nil +} + // Scans contents of [] (not including []'s), and converts to a set. func (p *parser) scanCharSet(caseInsensitive, scanOnly bool) (*CharSet, error) { - ch := '\x00' + var ch rune chPrev := '\x00' + var classPrev rune // ECMAScript range's left class escape, or zero for a character. inRange := false firstChar := true closed := false + var quoted []rune var cc *CharSet if !scanOnly { @@ -1458,11 +1962,34 @@ func (p *parser) scanCharSet(caseInsensitive, scanOnly bool) (*CharSet, error) { } } - for ; p.charsRight() > 0; firstChar = false { + for ; p.charsRight() > 0 || len(quoted) > 0; firstChar = false { fTranslatedChar := false - ch = p.moveRightGetChar() + var classEscape rune + for { + if len(quoted) > 0 { + ch = quoted[0] + quoted = quoted[1:] + fTranslatedChar = true + break + } + ch = p.moveRightGetChar() + if ch == '\\' && !p.useOptionE() && p.charsRight() > 0 && p.rightChar(0) == 'Q' { + p.moveRight(1) + quoted = p.scanQuoted() + if len(quoted) == 0 { + if p.charsRight() == 0 { + break + } + continue + } + continue + } + break + } if ch == ']' { - if !firstChar { + if fTranslatedChar { + // A quoted closing bracket is an ordinary class member. + } else if !firstChar { closed = true break } else if p.useOptionE() { @@ -1473,53 +2000,68 @@ func (p *parser) scanCharSet(caseInsensitive, scanOnly bool) (*CharSet, error) { break } - } else if ch == '\\' && p.charsRight() > 0 { + } else if ch == '\\' && !fTranslatedChar && p.charsRight() > 0 { switch ch = p.moveRightGetChar(); ch { - case 'D', 'd': + case 'D', 'd', 'S', 's', 'W', 'w': if !scanOnly { - if inRange { + if inRange && !p.useOptionE() { return nil, p.getErr(ErrBadClassInCharRange, ch) } - cc.addDigit(p.useOptionE() || p.useRE2(), ch == 'D', p.patternRaw) - } - continue - - case 'S', 's': - if !scanOnly { - if inRange { - return nil, p.getErr(ErrBadClassInCharRange, ch) + switch ch { + case 'D', 'd': + cc.addDigit(p.useOptionE() || p.useRE2(), ch == 'D') + case 'S', 's': + cc.addSpace(p.useOptionE(), p.useRE2(), ch == 'S') + case 'W', 'w': + if p.useOptionE() { + cc.addRanges(ecmaWordClass(p.options, ch == 'W').ranges) + } else { + cc.addWord(p.useRE2(), ch == 'W') + } } - cc.addSpace(p.useOptionE(), p.useRE2(), ch == 'S') } - continue - - case 'W', 'w': - if !scanOnly { - if inRange { - return nil, p.getErr(ErrBadClassInCharRange, ch) - } - - cc.addWord(p.useOptionE() || p.useRE2(), ch == 'W') + if !p.useOptionE() { + continue } - continue + // Class escapes participate in ECMAScript's range grammar just + // like character atoms. Their sets have already been added. + classEscape = ch case 'p', 'P': + if p.useOptionE() && !p.useOptionU() { + // Identity escapes use ordinary class-member and range handling. + fTranslatedChar = true + break + } if !scanOnly { - if inRange { - return nil, p.getErr(ErrBadClassInCharRange, ch) - } prop, err := p.parseProperty() if err != nil { return nil, err } - cc.addCategory(prop, (ch != 'p'), caseInsensitive, p.patternRaw) + if inRange { + return nil, p.getErr(ErrShorthandClassInCharRange, string(ch)) + } + p.addProperty(cc, prop, (ch != 'p'), caseInsensitive) } else { - p.parseProperty() + if _, err := p.parseProperty(); err != nil { + return nil, err + } + } + if p.useOptionE() && p.useOptionU() && p.charsRight() >= 2 && p.rightChar(0) == '-' && p.rightChar(1) != ']' { + // A property escape denotes a set, so it cannot start a range. + // https://tc39.es/ecma262/#sec-patterns-static-semantics-early-errors + return nil, p.getErr(ErrShorthandClassInCharRange, string(ch)) } continue case '-': + if p.useOptionE() { + // An escaped hyphen is a character atom, including at either + // endpoint of a range; only an unescaped hyphen separates them. + fTranslatedChar = true + break + } if !scanOnly { cc.addRange(ch, ch) } @@ -1528,14 +2070,13 @@ func (p *parser) scanCharSet(caseInsensitive, scanOnly bool) (*CharSet, error) { default: p.moveLeft() var err error - ch, err = p.scanCharEscape() // non-literal character + ch, err = p.scanCharEscape(true) // non-literal character if err != nil { return nil, err } fTranslatedChar = true - break // this break will only break out of the switch } - } else if ch == '[' { + } else if ch == '[' && !fTranslatedChar && !p.useOptionE() { // This is code for Posix style properties - [:Ll:] or [:IsTibetan:]. // It currently doesn't do anything other than skip the whole thing! if p.charsRight() > 0 && p.rightChar(0) == ':' && !inRange { @@ -1548,7 +2089,7 @@ func (p *parser) scanCharSet(caseInsensitive, scanOnly bool) (*CharSet, error) { p.moveRight(1) } - nm := p.scanCapname() // snag the name + nm := p.scanWord() // snag the name if !scanOnly && p.useRE2() { // look up the name since these are valid for RE2 // add the group based on the name @@ -1568,7 +2109,23 @@ func (p *parser) scanCharSet(caseInsensitive, scanOnly bool) (*CharSet, error) { if inRange { inRange = false if !scanOnly { - if ch == '[' && !fTranslatedChar && !firstChar { + if classPrev != 0 || classEscape != 0 { + // Annex B's CharacterRangeOrUnion consumes both endpoints, + // even when a class escape turns the range into a union. + if p.useOptionU() { + if classPrev != 0 { + return nil, p.getErr(ErrBadClassInCharRange, classPrev) + } + return nil, p.getErr(ErrBadClassInCharRange, classEscape) + } + if classPrev == 0 { + cc.addChar(chPrev) + } + if classEscape == 0 { + cc.addChar(ch) + } + cc.addChar('-') + } else if ch == '[' && !fTranslatedChar && !firstChar && !p.useOptionE() { // We thought we were in a range, but we're actually starting a subtraction. // In that case, we'll add chPrev to our char class, skip the opening [, and // scan the new character class recursively. @@ -1593,9 +2150,10 @@ func (p *parser) scanCharSet(caseInsensitive, scanOnly bool) (*CharSet, error) { } else if p.charsRight() >= 2 && p.rightChar(0) == '-' && p.rightChar(1) != ']' { // this could be the start of a range chPrev = ch + classPrev = classEscape inRange = true p.moveRight(1) - } else if p.charsRight() >= 1 && ch == '-' && !fTranslatedChar && p.rightChar(0) == '[' && !firstChar { + } else if p.charsRight() >= 1 && ch == '-' && !fTranslatedChar && p.rightChar(0) == '[' && !firstChar && !p.useOptionE() { // we aren't in a range, and now there is a subtraction. Usually this happens // only when a subtraction follows a range, like [a-z-[b]] if !scanOnly { @@ -1611,10 +2169,10 @@ func (p *parser) scanCharSet(caseInsensitive, scanOnly bool) (*CharSet, error) { } } else { p.moveRight(1) - p.scanCharSet(caseInsensitive, true) + _, _ = p.scanCharSet(caseInsensitive, true) } } else { - if !scanOnly { + if !scanOnly && classEscape == 0 { cc.addRange(ch, ch) } } @@ -1624,7 +2182,7 @@ func (p *parser) scanCharSet(caseInsensitive, scanOnly bool) (*CharSet, error) { return nil, p.getErr(ErrUnterminatedBracket) } - if !scanOnly && caseInsensitive { + if !scanOnly && caseInsensitive && !p.useOptionE() { cc.addLowercase() } @@ -1659,17 +2217,18 @@ func isOnlyTopOption(option RegexOptions) bool { return option == RightToLeft || option == ECMAScript || option == RE2 } -// Scans cimsx-cimsx option string, stops at the first unrecognized char. +// Scans imnsxu-imnsxu option string, stops at the first unrecognized char. func (p *parser) scanOptions() { for off := false; p.charsRight() > 0; p.moveRight(1) { ch := p.rightChar(0) - if ch == '-' { + switch ch { + case '-': off = true - } else if ch == '+' { + case '+': off = false - } else { + default: option := optionFromCode(ch) if option == 0 || isOnlyTopOption(option) { return @@ -1685,10 +2244,19 @@ func (p *parser) scanOptions() { } // Scans \ code for escape codes that map to single unicode chars. -func (p *parser) scanCharEscape() (r rune, err error) { +func (p *parser) scanCharEscape(inClass bool) (r rune, err error) { ch := p.moveRightGetChar() + if ch >= '0' && ch <= '9' && p.useOptionE() && p.useOptionU() { + // Unicode mode has no legacy octal or decimal identity escapes; + // only \0 not followed by a digit remains. + if ch == '0' && (p.charsRight() == 0 || p.rightChar(0) < '0' || p.rightChar(0) > '9') { + return 0, nil + } + return 0, p.getErr(ErrUnrecognizedEscape, string(ch)) + } + if ch >= '0' && ch <= '7' { p.moveLeft() return p.scanOctal(), nil @@ -1709,18 +2277,38 @@ func (p *parser) scanCharEscape() (r rune, err error) { r, err = p.scanHex(2) } case 'u': - // ECMAscript suppot \u{HEX} only if `u` is also set + // ECMAscript support \u{HEX} only if `u` is also set if p.useOptionE() && p.useOptionU() && p.charsRight() > 0 && p.rightChar(0) == '{' { p.moveRight(1) return p.scanHexUntilBrace() } else { r, err = p.scanHex(4) + if err == nil && p.useOptionE() && p.useOptionU() && r >= 0xD800 && r <= 0xDBFF && + p.charsRight() >= 6 && p.rightChar(0) == '\\' && p.rightChar(1) == 'u' { + // Only adjacent four-hex escapes combine. Restore the cursor + // for a non-low or malformed follower so it is parsed normally, + // including its own early error, on the next scan. + pos := p.textpos() + p.moveRight(2) + low, pairErr := p.scanHex(4) + if pairErr == nil && low >= 0xDC00 && low <= 0xDFFF { + r = utf16.DecodeRune(r, low) + } else { + p.textto(pos) + } + } } case 'a': + if p.useOptionE() && !p.useOptionU() { + return ch, nil + } return '\u0007', nil case 'b': return '\b', nil case 'e': + if p.useOptionE() && !p.useOptionU() { + return ch, nil + } return '\u001B', nil case 'f': return '\f', nil @@ -1733,20 +2321,55 @@ func (p *parser) scanCharEscape() (r rune, err error) { case 'v': return '\u000B', nil case 'c': + if p.useOptionE() { + return p.scanECMAControl(inClass) + } r, err = p.scanControl() default: + if p.useOptionE() && !p.useOptionU() && ch == 'k' && len(p.namedCaptures) > 0 { + return 0, p.getErr(ErrUnrecognizedEscape, string(ch)) + } if !p.useOptionE() && !p.useRE2() && IsWordChar(ch) { return 0, p.getErr(ErrUnrecognizedEscape, string(ch)) } return ch, nil } - if err != nil && p.useOptionE() { + // Annex B's fallback to a literal character applies only without the + // Unicode flag; in Unicode mode escape errors are early errors. + if err != nil && p.useOptionE() && !p.useOptionU() { p.textto(pos) return ch, nil } return } +// scanECMAControl implements Annex B's control escapes. +func (p *parser) scanECMAControl(inClass bool) (rune, error) { + if p.useOptionU() { + // Unicode mode requires a control letter; Annex B's leniency + // (digits and '_' inside classes) does not apply. + if p.charsRight() == 0 { + return 0, p.getErr(ErrMissingControl) + } + c := p.rightChar(0) + if !(c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z') { + return 0, p.getErr(ErrUnrecognizedControl) + } + } + if p.charsRight() > 0 { + ch := p.rightChar(0) + if ch >= 'A' && ch <= 'Z' || ch >= 'a' && ch <= 'z' || + inClass && (ch >= '0' && ch <= '9' || ch == '_') { + p.moveRight(1) + return ch % 32, nil + } + } + // Only the backslash is an atom; c and its following syntax are scanned + // normally, including in the capture prescan. + p.moveLeft() + return '\\', nil +} + // Grabs and converts an ascii control character func (p *parser) scanControl() (rune, error) { if p.charsRight() <= 0 { @@ -2010,49 +2633,87 @@ func (p *parser) addConcatenate() { } // Finish the current quantifiable (when a quantifier is found) -func (p *parser) addConcatenate3(lazy bool, min, max int) { - p.concatenation.addChild(p.unit.makeQuantifier(lazy, min, max)) +func (p *parser) addConcatenate3(lazy, possessive bool, min, max int) { + if p.useOptionE() { + p.unit = p.resetQuantifiedCaptures(p.unit) + } + node := p.unit.makeQuantifier(lazy, min, max) + if possessive { + atomic := newRegexNode(NtAtomic, p.options) + atomic.addChild(node) + node = atomic + } + p.concatenation.addChild(node) p.unit = nil } -// Sets the current unit to a single char node -func (p *parser) addUnitOne(ch rune) { - if p.useOptionI() { - ch = unicode.ToLower(ch) +// addQuotedUnit adds the literal characters scanned by \Q...\E. All but the +// final character are completed immediately so a following quantifier applies +// to the final literal character, just as if each character had been escaped. +func (p *parser) addQuotedUnit(node *RegexNode) { + quoted := node.Str + if len(quoted) == 0 { + p.restoreLastUnit() + if p.unit == nil { + p.unit = newRegexNode(NtEmpty, p.options) + } + return + } + for _, ch := range quoted[:len(quoted)-1] { + p.concatenation.addChild(newRegexNodeCh(NtOne, p.options, ch)) } + p.unit = newRegexNodeCh(NtOne, p.options, quoted[len(quoted)-1]) +} - p.unit = newRegexNodeCh(ntOne, p.options, ch) +// restoreLastUnit makes an immediately preceding literal quantifiable again +// when an empty \Q\E appears between it and its quantifier. +func (p *parser) restoreLastUnit() { + if len(p.concatenation.Children) == 0 { + return + } + last := len(p.concatenation.Children) - 1 + node := p.concatenation.Children[last] + p.concatenation.Children = p.concatenation.Children[:last] + node.Parent = nil + if node.T == NtMulti && len(node.Str) > 1 { + prefix := append([]rune(nil), node.Str[:len(node.Str)-1]...) + p.concatenation.addChild(newRegexNodeStr(NtMulti, node.Options, prefix)) + p.unit = newRegexNodeCh(NtOne, p.options, node.Str[len(node.Str)-1]) + return + } + p.unit = node +} + +// Sets the current unit to a single char node +func (p *parser) addUnitOne(ch rune) { + p.unit = newRegexNodeCh(NtOne, p.options, ch) } // Sets the current unit to a single inverse-char node func (p *parser) addUnitNotone(ch rune) { - if p.useOptionI() { - ch = unicode.ToLower(ch) - } - - p.unit = newRegexNodeCh(ntNotone, p.options, ch) + p.unit = newRegexNodeCh(NtNotone, p.options, ch) } // Sets the current unit to a single set node func (p *parser) addUnitSet(set *CharSet) { - p.unit = newRegexNodeSet(ntSet, p.options, set) + p.unit = newRegexNodeSet(NtSet, p.options, set) } // Sets the current unit to a subtree -func (p *parser) addUnitNode(node *regexNode) { +func (p *parser) addUnitNode(node *RegexNode) { p.unit = node } // Sets the current unit to an assertion of the specified type -func (p *parser) addUnitType(t nodeType) { +func (p *parser) addUnitType(t NodeType) { p.unit = newRegexNode(t, p.options) } // Finish the current group (in response to a ')' or end) func (p *parser) addGroup() error { - if p.group.t == ntTestgroup || p.group.t == ntTestref { + if p.group.T == NtExprCond || p.group.T == NtBackRefCond { p.group.addChild(p.concatenation.reverseLeft()) - if (p.group.t == ntTestref && len(p.group.children) > 2) || len(p.group.children) > 3 { + if (p.group.T == NtBackRefCond && len(p.group.Children) > 2) || len(p.group.Children) > 3 { return p.getErr(ErrTooManyAlternates) } } else { @@ -2085,57 +2746,51 @@ func (p *parser) pushOptions() { // Add a string to the last concatenate. func (p *parser) addToConcatenate(pos, cch int, isReplacement bool) { - var node *regexNode - if cch == 0 { return } + if cch == 1 { + var node *RegexNode - if cch > 1 { - str := make([]rune, cch) - copy(str, p.pattern[pos:pos+cch]) - - if p.useOptionI() && !isReplacement { - // We do the ToLower character by character for consistency. With surrogate chars, doing - // a ToLower on the entire string could actually change the surrogate pair. This is more correct - // linguistically, but since Regex doesn't support surrogates, it's more important to be - // consistent. - for i := 0; i < len(str); i++ { - str[i] = unicode.ToLower(str[i]) - } - } - - node = newRegexNodeStr(ntMulti, p.options, str) - } else { - ch := p.charAt(pos) - - if p.useOptionI() && !isReplacement { - ch = unicode.ToLower(ch) + if isReplacement { + node = newRegexNodeCh(NtOne, p.options&^IgnoreCase, p.pattern[pos]) + } else { + node = newRegexNodeCh(NtOne, p.options, p.pattern[pos]) } + p.concatenation.addChild(node) + return + } - node = newRegexNodeCh(ntOne, p.options, ch) + if cch > 1 && (!p.useOptionI() || isReplacement || !anyParticipateInCaseConversion(p.pattern[pos:pos+cch])) { + str := make([]rune, cch) + copy(str, p.pattern[pos:pos+cch]) + p.concatenation.addChild(newRegexNodeStr(NtMulti, p.options&^IgnoreCase, str)) + return } - p.concatenation.addChild(node) + // each letter gets an upper-lower range + for i := pos; i < pos+cch; i++ { + p.concatenation.addChild(newRegexNodeCh(NtOne, p.options, p.pattern[i])) + } } // Push the parser state (in response to an open paren) func (p *parser) pushGroup() { - p.group.next = p.stack - p.alternation.next = p.group - p.concatenation.next = p.alternation + p.group.Parent = p.stack + p.alternation.Parent = p.group + p.concatenation.Parent = p.alternation p.stack = p.concatenation } // Remember the pushed state (in response to a ')') func (p *parser) popGroup() error { p.concatenation = p.stack - p.alternation = p.concatenation.next - p.group = p.alternation.next - p.stack = p.group.next + p.alternation = p.concatenation.Parent + p.group = p.alternation.Parent + p.stack = p.group.Parent // The first () inside a Testgroup group goes directly to the group - if p.group.t == ntTestgroup && len(p.group.children) == 0 { + if p.group.T == NtExprCond && len(p.group.Children) == 0 { if p.unit == nil { return p.getErr(ErrConditionalExpression) } @@ -2152,33 +2807,33 @@ func (p *parser) emptyStack() bool { } // Start a new round for the parser state (in response to an open paren or string start) -func (p *parser) startGroup(openGroup *regexNode) { +func (p *parser) startGroup(openGroup *RegexNode) { p.group = openGroup - p.alternation = newRegexNode(ntAlternate, p.options) - p.concatenation = newRegexNode(ntConcatenate, p.options) + p.alternation = newRegexNode(NtAlternate, p.options) + p.concatenation = newRegexNode(NtConcatenate, p.options) } // Finish the current concatenation (in response to a |) func (p *parser) addAlternate() { // The | parts inside a Testgroup group go directly to the group - if p.group.t == ntTestgroup || p.group.t == ntTestref { + if p.group.T == NtExprCond || p.group.T == NtBackRefCond { p.group.addChild(p.concatenation.reverseLeft()) } else { p.alternation.addChild(p.concatenation.reverseLeft()) } - p.concatenation = newRegexNode(ntConcatenate, p.options) + p.concatenation = newRegexNode(NtConcatenate, p.options) } // For categorizing ascii characters. const ( Q byte = 5 // quantifier - S = 4 // ordinary stopper - Z = 3 // ScanBlank stopper - X = 2 // whitespace - E = 1 // should be escaped + S byte = 4 // ordinary stopper + Z byte = 3 // ScanBlank stopper + X byte = 2 // whitespace + E byte = 1 // should be escaped ) var _category = []byte{ @@ -2211,6 +2866,17 @@ func isQuantifier(ch rune) bool { return (ch <= '{' && _category[ch] >= Q) } +// Returns false for assertions, which cannot be quantified in ECMAScript except for lookaheads without the Unicode option. +func (p *parser) isECMAQuantifiable(n *RegexNode) bool { + switch n.T { + case NtBol, NtEol, NtBeginning, NtEndZ, NtEnd, NtBoundary, NtNonboundary, NtECMABoundary, NtNonECMABoundary: + return false + case NtPosLook, NtNegLook: + return n.Options&RightToLeft == 0 && !p.useOptionU() + } + return true +} + func (p *parser) isTrueQuantifier() bool { nChars := p.charsRight() if nChars == 0 { diff --git a/vendor/github.com/dlclark/regexp2/syntax/prefix.go b/vendor/github.com/dlclark/regexp2/v2/syntax/prefix.go similarity index 71% rename from vendor/github.com/dlclark/regexp2/syntax/prefix.go rename to vendor/github.com/dlclark/regexp2/v2/syntax/prefix.go index f67168862..f0b0d1b3b 100644 --- a/vendor/github.com/dlclark/regexp2/syntax/prefix.go +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/prefix.go @@ -45,19 +45,19 @@ type regexFcd struct { * and after each child of an interior node, and at each leaf. */ func (s *regexFcd) regexFCFromRegexTree(tree *RegexTree) *regexFc { - curNode := tree.root + curNode := tree.Root curChild := 0 for { - if len(curNode.children) == 0 { + if len(curNode.Children) == 0 { // This is a leaf node - s.calculateFC(curNode.t, curNode, 0) - } else if curChild < len(curNode.children) && !s.skipAllChildren { + s.calculateFC(curNode.T, curNode, 0) + } else if curChild < len(curNode.Children) && !s.skipAllChildren { // This is an interior node, and we have more children to analyze - s.calculateFC(curNode.t|beforeChild, curNode, curChild) + s.calculateFC(curNode.T|BeforeChild, curNode, curChild) if !s.skipchild { - curNode = curNode.children[curChild] + curNode = curNode.Children[curChild] // this stack is how we get a depth first walk of the tree. s.pushInt(curChild) curChild = 0 @@ -77,9 +77,9 @@ func (s *regexFcd) regexFCFromRegexTree(tree *RegexTree) *regexFc { } curChild = s.popInt() - curNode = curNode.next + curNode = curNode.Parent - s.calculateFC(curNode.t|afterChild, curNode, curChild) + s.calculateFC(curNode.T|AfterChild, curNode, curChild) if s.failed { return nil } @@ -153,35 +153,32 @@ func (s *regexFcd) skipChild() { } // FC computation and shortcut cases for each node type -func (s *regexFcd) calculateFC(nt nodeType, node *regexNode, CurIndex int) { +func (s *regexFcd) calculateFC(nt NodeType, node *RegexNode, CurIndex int) { //fmt.Printf("NodeType: %v, CurIndex: %v, Desc: %v\n", nt, CurIndex, node.description()) ci := false rtl := false - if nt <= ntRef { - if (node.options & IgnoreCase) != 0 { + if nt <= NtRef { + if (node.Options & IgnoreCase) != 0 { ci = true } - if (node.options & RightToLeft) != 0 { + if (node.Options & RightToLeft) != 0 { rtl = true } } switch nt { - case ntConcatenate | beforeChild, ntAlternate | beforeChild, ntTestref | beforeChild, ntLoop | beforeChild, ntLazyloop | beforeChild: - break + case NtConcatenate | BeforeChild, NtAlternate | BeforeChild, NtBackRefCond | BeforeChild, NtLoop | BeforeChild, NtLazyloop | BeforeChild: - case ntTestgroup | beforeChild: + case NtExprCond | BeforeChild: if CurIndex == 0 { s.skipChild() } - break - case ntEmpty: + case NtEmpty, NtResetCapture: s.pushFC(regexFc{nullable: true}) - break - case ntConcatenate | afterChild: + case NtConcatenate | AfterChild: if CurIndex != 0 { child := s.popFC() cumul := s.topFC() @@ -193,81 +190,69 @@ func (s *regexFcd) calculateFC(nt nodeType, node *regexNode, CurIndex int) { if !fc.nullable { s.skipAllChildren = true } - break - case ntTestgroup | afterChild: + case NtExprCond | AfterChild: if CurIndex > 1 { child := s.popFC() cumul := s.topFC() s.failed = !cumul.addFC(*child, false) } - break - case ntAlternate | afterChild, ntTestref | afterChild: + case NtAlternate | AfterChild, NtBackRefCond | AfterChild: if CurIndex != 0 { child := s.popFC() cumul := s.topFC() s.failed = !cumul.addFC(*child, false) } - break - case ntLoop | afterChild, ntLazyloop | afterChild: - if node.m == 0 { + case NtLoop | AfterChild, NtLazyloop | AfterChild: + if node.M == 0 { fc := s.topFC() fc.nullable = true } - break - case ntGroup | beforeChild, ntGroup | afterChild, ntCapture | beforeChild, ntCapture | afterChild, ntGreedy | beforeChild, ntGreedy | afterChild: - break + case NtGroup | BeforeChild, NtGroup | AfterChild, NtCapture | BeforeChild, NtCapture | AfterChild, NtAtomic | BeforeChild, NtAtomic | AfterChild: - case ntRequire | beforeChild, ntPrevent | beforeChild: + case NtPosLook | BeforeChild, NtNegLook | BeforeChild: s.skipChild() s.pushFC(regexFc{nullable: true}) - break - case ntRequire | afterChild, ntPrevent | afterChild: - break + case NtPosLook | AfterChild, NtNegLook | AfterChild: - case ntOne, ntNotone: - s.pushFC(newRegexFc(node.ch, nt == ntNotone, false, ci)) - break + case NtOne, NtNotone: + s.pushFC(newRegexFc(node.Ch, nt == NtNotone, false, ci)) - case ntOneloop, ntOnelazy: - s.pushFC(newRegexFc(node.ch, false, node.m == 0, ci)) - break + case NtOneloop, NtOnelazy, NtOneloopatomic: + s.pushFC(newRegexFc(node.Ch, false, node.M == 0, ci)) - case ntNotoneloop, ntNotonelazy: - s.pushFC(newRegexFc(node.ch, true, node.m == 0, ci)) - break + case NtNotoneloop, NtNotonelazy, NtNotoneloopatomic: + s.pushFC(newRegexFc(node.Ch, true, node.M == 0, ci)) - case ntMulti: - if len(node.str) == 0 { + case NtMulti: + if len(node.Str) == 0 { s.pushFC(regexFc{nullable: true}) } else if !rtl { - s.pushFC(newRegexFc(node.str[0], false, false, ci)) + s.pushFC(newRegexFc(node.Str[0], false, false, ci)) } else { - s.pushFC(newRegexFc(node.str[len(node.str)-1], false, false, ci)) + s.pushFC(newRegexFc(node.Str[len(node.Str)-1], false, false, ci)) } - break - case ntSet: - s.pushFC(regexFc{cc: node.set.Copy(), nullable: false, caseInsensitive: ci}) - break + case NtSet: + s.pushFC(regexFc{cc: node.Set.Copy(), nullable: false, caseInsensitive: ci}) - case ntSetloop, ntSetlazy: - s.pushFC(regexFc{cc: node.set.Copy(), nullable: node.m == 0, caseInsensitive: ci}) - break + case NtSetloop, NtSetlazy, NtSetloopatomic: + s.pushFC(regexFc{cc: node.Set.Copy(), nullable: node.M == 0, caseInsensitive: ci}) - case ntRef: + case NtGrapheme: + s.pushFC(regexFc{cc: *AnyClass(), nullable: false}) + + case NtRef: s.pushFC(regexFc{cc: *AnyClass(), nullable: true, caseInsensitive: false}) - break - case ntNothing, ntBol, ntEol, ntBoundary, ntNonboundary, ntECMABoundary, ntNonECMABoundary, ntBeginning, ntStart, ntEndZ, ntEnd: + case NtNothing, NtBol, NtEol, NtBoundary, NtNonboundary, NtECMABoundary, NtNonECMABoundary, NtBeginning, NtStart, NtEndZ, NtEnd, NtUpdateBumpalong: s.pushFC(regexFc{nullable: true}) - break default: panic(fmt.Sprintf("unexpected op code: %v", nt)) @@ -334,57 +319,57 @@ func (r *regexFc) addFC(fc regexFc, concatenate bool) bool { // This is a related computation: it takes a RegexTree and computes the // leading substring if it sees one. It's quite trivial and gives up easily. func getPrefix(tree *RegexTree) *Prefix { - var concatNode *regexNode + var concatNode *RegexNode nextChild := 0 - curNode := tree.root + curNode := tree.Root for { - switch curNode.t { - case ntConcatenate: - if len(curNode.children) > 0 { + switch curNode.T { + case NtConcatenate: + if len(curNode.Children) > 0 { concatNode = curNode nextChild = 0 } - case ntGreedy, ntCapture: - curNode = curNode.children[0] + case NtAtomic, NtCapture: + curNode = curNode.Children[0] concatNode = nil continue - case ntOneloop, ntOnelazy: - if curNode.m > 0 { + case NtOneloop, NtOnelazy: + if curNode.M > 0 { return &Prefix{ - PrefixStr: repeat(curNode.ch, curNode.m), - CaseInsensitive: (curNode.options & IgnoreCase) != 0, + PrefixStr: repeat(curNode.Ch, curNode.M), + CaseInsensitive: (curNode.Options & IgnoreCase) != 0, } } return nil - case ntOne: + case NtOne: return &Prefix{ - PrefixStr: []rune{curNode.ch}, - CaseInsensitive: (curNode.options & IgnoreCase) != 0, + PrefixStr: []rune{curNode.Ch}, + CaseInsensitive: (curNode.Options & IgnoreCase) != 0, } - case ntMulti: + case NtMulti: return &Prefix{ - PrefixStr: curNode.str, - CaseInsensitive: (curNode.options & IgnoreCase) != 0, + PrefixStr: curNode.Str, + CaseInsensitive: (curNode.Options & IgnoreCase) != 0, } - case ntBol, ntEol, ntBoundary, ntECMABoundary, ntBeginning, ntStart, - ntEndZ, ntEnd, ntEmpty, ntRequire, ntPrevent: + case NtBol, NtEol, NtBoundary, NtECMABoundary, NtBeginning, NtStart, + NtEndZ, NtEnd, NtEmpty, NtResetCapture, NtPosLook, NtNegLook: default: return nil } - if concatNode == nil || nextChild >= len(concatNode.children) { + if concatNode == nil || nextChild >= len(concatNode.Children) { return nil } - curNode = concatNode.children[nextChild] + curNode = concatNode.Children[nextChild] nextChild++ } } @@ -674,9 +659,9 @@ func (b *BmPrefix) Scan(text []rune, index, beglimit, endlimit int) int { } if chTest != chMatch { - if chTest < 128 { + if uint32(chTest) < 128 { advance = b.negativeASCII[chTest] - } else if chTest < 0xffff && len(b.negativeUnicode) > 0 { + } else if uint32(chTest) < 0xffff && len(b.negativeUnicode) > 0 { unicodeLookup = b.negativeUnicode[chTest>>8] if len(unicodeLookup) > 0 { advance = unicodeLookup[chTest&0xFF] @@ -712,9 +697,9 @@ func (b *BmPrefix) Scan(text []rune, index, beglimit, endlimit int) int { if chTest != b.pattern[match] { advance = b.positive[match] - if chTest < 128 { + if uint32(chTest) < 128 { test2 = (match - startmatch) + b.negativeASCII[chTest] - } else if chTest < 0xffff && len(b.negativeUnicode) > 0 { + } else if uint32(chTest) < 0xffff && len(b.negativeUnicode) > 0 { unicodeLookup = b.negativeUnicode[chTest>>8] if len(unicodeLookup) > 0 { test2 = (match - startmatch) + unicodeLookup[chTest&0xFF] @@ -788,71 +773,71 @@ type AnchorLoc int16 // where the regex can be pegged const ( AnchorBeginning AnchorLoc = 0x0001 - AnchorBol = 0x0002 - AnchorStart = 0x0004 - AnchorEol = 0x0008 - AnchorEndZ = 0x0010 - AnchorEnd = 0x0020 - AnchorBoundary = 0x0040 - AnchorECMABoundary = 0x0080 + AnchorBol AnchorLoc = 0x0002 + AnchorStart AnchorLoc = 0x0004 + AnchorEol AnchorLoc = 0x0008 + AnchorEndZ AnchorLoc = 0x0010 + AnchorEnd AnchorLoc = 0x0020 + AnchorBoundary AnchorLoc = 0x0040 + AnchorECMABoundary AnchorLoc = 0x0080 ) func getAnchors(tree *RegexTree) AnchorLoc { - var concatNode *regexNode + var concatNode *RegexNode nextChild, result := 0, AnchorLoc(0) - curNode := tree.root + curNode := tree.Root for { - switch curNode.t { - case ntConcatenate: - if len(curNode.children) > 0 { + switch curNode.T { + case NtConcatenate: + if len(curNode.Children) > 0 { concatNode = curNode nextChild = 0 } - case ntGreedy, ntCapture: - curNode = curNode.children[0] + case NtAtomic, NtCapture: + curNode = curNode.Children[0] concatNode = nil continue - case ntBol, ntEol, ntBoundary, ntECMABoundary, ntBeginning, - ntStart, ntEndZ, ntEnd: - return result | anchorFromType(curNode.t) + case NtBol, NtEol, NtBoundary, NtECMABoundary, NtBeginning, + NtStart, NtEndZ, NtEnd: + return result | anchorFromType(curNode.T) - case ntEmpty, ntRequire, ntPrevent: + case NtEmpty, NtResetCapture, NtPosLook, NtNegLook: default: return result } - if concatNode == nil || nextChild >= len(concatNode.children) { + if concatNode == nil || nextChild >= len(concatNode.Children) { return result } - curNode = concatNode.children[nextChild] + curNode = concatNode.Children[nextChild] nextChild++ } } -func anchorFromType(t nodeType) AnchorLoc { +func anchorFromType(t NodeType) AnchorLoc { switch t { - case ntBol: + case NtBol: return AnchorBol - case ntEol: + case NtEol: return AnchorEol - case ntBoundary: + case NtBoundary: return AnchorBoundary - case ntECMABoundary: + case NtECMABoundary: return AnchorECMABoundary - case ntBeginning: + case NtBeginning: return AnchorBeginning - case ntStart: + case NtStart: return AnchorStart - case ntEndZ: + case NtEndZ: return AnchorEndZ - case ntEnd: + case NtEnd: return AnchorEnd default: return 0 @@ -863,28 +848,28 @@ func anchorFromType(t nodeType) AnchorLoc { func (anchors AnchorLoc) String() string { buf := &bytes.Buffer{} - if 0 != (anchors & AnchorBeginning) { + if (anchors & AnchorBeginning) != 0 { buf.WriteString(", Beginning") } - if 0 != (anchors & AnchorStart) { + if (anchors & AnchorStart) != 0 { buf.WriteString(", Start") } - if 0 != (anchors & AnchorBol) { + if (anchors & AnchorBol) != 0 { buf.WriteString(", Bol") } - if 0 != (anchors & AnchorBoundary) { + if (anchors & AnchorBoundary) != 0 { buf.WriteString(", Boundary") } - if 0 != (anchors & AnchorECMABoundary) { + if (anchors & AnchorECMABoundary) != 0 { buf.WriteString(", ECMABoundary") } - if 0 != (anchors & AnchorEol) { + if (anchors & AnchorEol) != 0 { buf.WriteString(", Eol") } - if 0 != (anchors & AnchorEnd) { + if (anchors & AnchorEnd) != 0 { buf.WriteString(", End") } - if 0 != (anchors & AnchorEndZ) { + if (anchors & AnchorEndZ) != 0 { buf.WriteString(", EndZ") } @@ -894,3 +879,68 @@ func (anchors AnchorLoc) String() string { } return "None" } + +func findLeadingOrTrailingAnchor(node *RegexNode, leading bool) NodeType { + for { + switch node.T { + case NtBol, NtEol, NtBeginning, NtStart, NtEndZ, NtEnd, NtBoundary, NtECMABoundary: + // anchor found + return node.T + case NtAtomic, NtCapture: + // For groups, continue exploring the sole child. + node = node.Children[0] + continue + case NtConcatenate: + // For concatenations, we expect primarily to explore its first (for leading) or last (for trailing) child, + // but we can also skip over certain kinds of nodes (e.g. Empty), and thus iterate through its children backward + // looking for the last we shouldn't skip. + var child *RegexNode + + if leading { + for i := 0; i < len(node.Children); i++ { + t := node.Children[i].T + if t != NtEmpty && t != NtPosLook && t != NtNegLook { + child = node.Children[i] + break + } + } + } else { + for i := len(node.Children) - 1; i >= 0; i-- { + t := node.Children[i].T + if t != NtEmpty && t != NtPosLook && t != NtNegLook { + child = node.Children[i] + break + } + } + } + if child != nil { + node = child + continue + } + + case NtAlternate: + // For alternations, every branch needs to lead or trail with the same anchor. + + // Get the leading/trailing anchor of the first branch. If there isn't one, bail. + anchor := findLeadingOrTrailingAnchor(node.Children[0], leading) + if anchor == NtUnknown { + return NtUnknown + } + + // Look at each subsequent branch and validate it has the same leading or trailing + // anchor. If any doesn't, bail. + for i := 1; i < len(node.Children); i++ { + if findLeadingOrTrailingAnchor(node.Children[i], leading) != anchor { + return NtUnknown + } + } + + // All branches have the same leading/trailing anchor. Return it. + return anchor + + } + + // no anchor + return NtUnknown + } +} diff --git a/vendor/github.com/dlclark/regexp2/v2/syntax/prefixanalyzer.go b/vendor/github.com/dlclark/regexp2/v2/syntax/prefixanalyzer.go new file mode 100644 index 000000000..9a768c443 --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/prefixanalyzer.go @@ -0,0 +1,1495 @@ +package syntax + +import ( + "bytes" + "cmp" + "math" + "slices" + "strings" + "unicode" + "unicode/utf8" + "unsafe" +) + +// Computes a character class for the first character in tree. This uses a more robust algorithm +// than is used by TryFindFixedLiterals and thus can find starting sets it couldn't. For example, +// fixed literals won't find the starting set for a*b, as the a isn't guaranteed and the b is at a +// variable position, but this will find [ab] as it's instead looking for anything that under any +// circumstance could possibly start a match. +func findFirstCharClass(root *RegexNode) *CharSet { + // Explore the graph, adding found chars into a result set, which is lazily initialized so that + // we can initialize it to a parsed set if we discover one first (this is helpful not just for allocation + // but because it enables supporting starting negated sets, which wouldn't work if they had to be merged + // into a non-negated default set). If the operation returns true, we successfully explore all relevant nodes + // in the graph. If it returns false, we were unable to successfully explore all relevant nodes, typically + // due to conflicts when trying to add characters into the result set, e.g. we may have read a negated set + // and were then unable to merge into that a subsequent non-negated set. If it returns null, it means the + // whole pattern was nullable such that it could match an empty string, in which case we + // can't make any statements about what begins a match. + var cc *CharSet + if tryFindFirstCharClass(root, &cc) == 1 { + return cc + } + return nil +} + +// Walks the nodes of the expression looking for any node that could possibly match the first +// character of a match, e.g. in `a*b*c+d`, we'd find [abc], or in `(abc|d*e)?[fgh]`, we'd find +// [adefgh]. The function is called for each node, recurring into children where appropriate, +// and returns: +// - 1 if the child was successfully processed and represents a stopping point, e.g. a single +// char loop with a minimum bound greater than 0 such that nothing after that node in a +// concatenation could possibly match the first character. +// - 0 if the child failed to be processed but needed to be, such that the results can't +// be trusted. If any node returns false, the whole operation fails. +// - -1 if the child was successfully processed but doesn't represent a stopping point, i.e. +// it's zero-width (e.g. empty, a lookaround, an anchor, etc.) or it could be zero-width +// (e.g. a loop with a min bound of 0). A concatenation processing a child that returns +// -1 needs to keep processing the next child. +func tryFindFirstCharClass(node *RegexNode, ccIn **CharSet) int { + cc := *ccIn + + switch node.T { + // Base cases where we have results to add to the result set. Add the values into the result set, if possible. + // If this is a loop and it has a lower bound of 0, then it's zero-width, so return null. + case NtOne, NtOneloop, NtOnelazy, NtOneloopatomic: + if cc == nil { + cc = &CharSet{} + *ccIn = cc + } + if cc.IsMergeable() { + cc.addChar(node.Ch) + if node.T == NtOne || node.M > 0 { + return 1 + } + return -1 + } + return 0 + + case NtNotone, NtNotoneloop, NtNotonelazy, NtNotoneloopatomic: + if cc == nil { + cc = &CharSet{} + cc.addChar(node.Ch) + cc.negate = true + *ccIn = cc + } else if cc.IsMergeable() { + // Union the complement ranges with the accumulated characters + // before canonicalizing; negating the accumulator would exclude them. + if node.Ch > 0 { + cc.ranges = append(cc.ranges, SingleRange{0, node.Ch - 1}) + } + if node.Ch < unicode.MaxRune { + cc.ranges = append(cc.ranges, SingleRange{node.Ch + 1, unicode.MaxRune}) + } + cc.canonicalize() + } else { + return 0 + } + if node.T == NtNotone || node.M > 0 { + return 1 + } + return -1 + + case NtSet, NtSetloop, NtSetlazy, NtSetloopatomic: + { + setSuccess := false + if cc == nil { + cp := node.Set.Copy() + *ccIn = &cp + setSuccess = true + } else if cc.IsMergeable() && node.Set.IsMergeable() { + cc.addSet(*node.Set) + setSuccess = true + } + if !setSuccess { + return 0 + } else if node.T == NtSet || node.M > 0 { + return 1 + } + return -1 + } + + case NtMulti: + if cc == nil { + cc = &CharSet{} + *ccIn = cc + } + if cc.IsMergeable() { + if node.Options&RightToLeft != 0 { + cc.addChar(node.Str[len(node.Str)-1]) + } else { + cc.addChar(node.Str[0]) + } + return 1 + } + return 0 + + case NtGrapheme: + // Every rune can begin a grapheme, so there is no useful candidate + // restriction to derive. + return 0 + + // Zero-width elements. These don't contribute to the starting set, so return null to indicate a caller + // should keep looking past them. + case NtEmpty, NtResetCapture, NtNothing, NtBol, NtEol, NtBoundary, NtNonboundary, NtECMABoundary, NtNonECMABoundary, + NtBeginning, NtStart, NtEndZ, NtEnd, NtUpdateBumpalong, NtPosLook, NtNegLook: + return -1 + + // Groups. These don't contribute anything of their own, and are just pass-throughs to their children. + case NtAtomic, NtCapture: + return tryFindFirstCharClass(node.Children[0], ccIn) + + // Loops. Like groups, these are mostly pass-through: if the child fails, then the whole operation needs + // to fail, and if the child is nullable, then the loop is as well. However, if the child succeeds but + // the loop has a lower bound of 0, then the loop is still nullable. + case NtLoop, NtLazyloop: + val := tryFindFirstCharClass(node.Children[0], ccIn) + if val <= 0 || node.M != 0 { + return val + } + return -1 + + // Concatenation. Loop through the children as long as they're nullable. The moment a child returns true, + // we don't need or want to look further, as that child represents non-zero-width and nothing beyond it can + // contribute to the starting character set. The moment a child returns false, we need to fail the whole thing. + // If every child is nullable, then the concatenation is also nullable. + case NtConcatenate: + for i := 0; i < len(node.Children); i++ { + childResult := tryFindFirstCharClass(node.Children[i], ccIn) + if childResult != -1 { + return childResult + } + } + return -1 + + // Alternation. Every child is its own fork/branch and contributes to the starting set. As with concatenation, + // the moment any child fails, fail. And if any child is nullable, the alternation is also nullable (since that + // zero-width path could be taken). Otherwise, if every branch returns true, so too does the alternation. + case NtAlternate: + anyChildWasNull := false + for i := 0; i < len(node.Children); i++ { + childResult := tryFindFirstCharClass(node.Children[i], ccIn) + switch childResult { + case -1: + anyChildWasNull = true + case 0: + return 0 + } + } + if anyChildWasNull { + return -1 + } + return 1 + + // Conditionals. Just like alternation for their "yes"/"no" child branches. If either returns false, return false. + // If either is nullable, this is nullable. If both return true, return true. + case NtBackRefCond, NtExprCond: + branchStart := 1 + if node.T == NtBackRefCond { + branchStart = 0 + } + // conditional without all the branches + if branchStart+1 >= len(node.Children) { + return -1 + } + start := tryFindFirstCharClass(node.Children[branchStart], ccIn) + next := tryFindFirstCharClass(node.Children[branchStart+1], ccIn) + if start == -1 || next == -1 { + return -1 + } + if start == 0 || next == 0 { + return 0 + } + return 1 + + // Backreferences. We can't easily make any claims about what content they might match, so just give up. + case NtRef: + return 0 + } + + // Unknown node. + return 0 +} + +// Computes the leading ordinal case-insensitive substring in node +func findPrefixOrdinalCaseInsensitive(node *RegexNode) string { + for { + // Search down the left side of the tree looking for a concatenation. If we find one, + // ask it for any ordinal case-insensitive prefix it has. + switch node.T { + case NtLoop, NtLazyloop: + if node.M <= 0 { + return "" + } + fallthrough + case NtAtomic, NtCapture: + node = node.Children[0] + continue + + case NtConcatenate: + _, _, caseInsensitiveString := node.TryGetOrdinalCaseInsensitiveString(0, len(node.Children), true) + return caseInsensitiveString + + default: + return "" + } + } +} + +// Computes the leading substring in node may be empty. +func findPrefix(node *RegexNode) string { + vsb := &bytes.Buffer{} + tryFindPrefix(node, vsb) + return vsb.String() +} + +// tryFindPrefix stops copying a loop body once another copy would make the prefix longer than this. +const maxLoopPrefixLength = 256 + +// Processes the node, adding any prefix text to the builder. +// Returns whether processing should continue with subsequent nodes. +func tryFindPrefix(node *RegexNode, vsb *bytes.Buffer) bool { + // We don't bother to handle reversed input, so process at most one node + // when handling RightToLeft. + rtl := (node.Options & RightToLeft) != 0 + + switch node.T { + // Concatenation + case NtConcatenate: + for i := 0; i < len(node.Children); i++ { + if !tryFindPrefix(node.Children[i], vsb) { + return false + } + } + return !rtl + // Alternation: find a string that's a shared prefix of all branches + case NtAlternate: + // for RTL we'd need to be matching the suffixes of the alternation cases + if rtl { + return false + } + + // Store the initial branch into the target builder, keeping track + // of how much was appended. Any of this contents that doesn't overlap + // will every other branch will be removed before returning. + initialLength := vsb.Len() + tryFindPrefix(node.Children[0], vsb) + addedLength := vsb.Len() - initialLength + + // Then explore the rest of the branches, finding the length + // of prefix they all share in common with the initial branch. + if addedLength != 0 { + alternateSb := &bytes.Buffer{} + vsbSlice := vsb.Bytes()[initialLength : initialLength+addedLength] + + // Process each branch. If we reach a point where we've proven there's + // no overlap, we can bail early. + for i := 1; i < len(node.Children) && addedLength != 0; i++ { + alternateSb.Reset() + + // Process the branch into a temporary builder. + tryFindPrefix(node.Children[i], alternateSb) + + // Find how much overlap there is between this branch's prefix + // and the smallest amount of prefix that overlapped with all + // the previously seen branches. + addedLength = commonPrefixLen(vsbSlice[:addedLength], alternateSb.Bytes()) + } + + // Then cull back on what was added based on the other branches, + // without ending partway through a UTF-8 encoded rune. + for addedLength < len(vsbSlice) && !utf8.RuneStart(vsbSlice[addedLength]) { + addedLength-- + } + vsb.Truncate(initialLength + addedLength) + } + + // Don't explore anything after the alternation. We could make this work if desirable, + // but it's currently not worth the extra complication. The entire contents of every + // branch would need to be identical other than zero-width anchors/assertions. + return false + + // One character + case NtOne: + vsb.WriteRune(node.Ch) + return !rtl + + // Multiple characters + case NtMulti: + vsb.WriteString(string(node.Str)) + return !rtl + + // Loop of one character + case NtOneloop /*NtOneloopatomic,*/, NtOnelazy: + if node.M <= 0 { + return false + } + // arbitrary cut-off to avoid creating super long strings unnecessarily + count := 32 + if node.M < count { + count = node.M + } + vsb.WriteString(strings.Repeat(string(node.Ch), count)) + return count == node.N && !rtl + + // Loop of a node + case NtLoop, NtLazyloop: + if node.M <= 0 { + return false + } + + // arbitrary cut-off to avoid creating super long strings unnecessarily + limit := 4 + if node.M < limit { + limit = node.M + } + + // Once the body is fully processed, further iterations add the same text, so + // copy it rather than processing the body again, which can be exponential in + // the nesting depth. + start := vsb.Len() + if !tryFindPrefix(node.Children[0], vsb) { + return false + } + if limit > 1 { + body := bytes.Clone(vsb.Bytes()[start:]) + for i := 1; i < limit; i++ { + if vsb.Len()+len(body) > maxLoopPrefixLength { + return false + } + vsb.Write(body) + } + } + return limit == node.N && !rtl + + // Grouping nodes for which we only care about their single child + case NtAtomic, NtCapture: + return tryFindPrefix(node.Children[0], vsb) + + // Zero-width anchors and assertions + case NtBol, NtEol, NtBoundary, NtECMABoundary, NtNonboundary, NtNonECMABoundary, NtBeginning, + NtStart, NtEndZ, NtEnd, NtEmpty, NtUpdateBumpalong, NtPosLook, NtNegLook: + return true + } + // Give up for anything else + return false +} + +// commonPrefixLen returns the length of the common prefix of two strings. +func commonPrefixLen(a, b []byte) int { + commonLen := min(len(a), len(b)) + i := 0 + // Optimization: load and compare word-sized chunks at a time. + // This is about 6x faster than the naive approach when len > 64. + // + // TODO(adonovan): further optimizations are possible, + // at the cost of portability, for example by: + // - better elimination of bounds checks; + // - use of uint64 instead of an array may result in better + // registerization, and allows computing the final portion + // from the bitmask: + // + // cmp := load64le(a, i) ^ load64le(b, i) + // if cmp != 0 { + // return i + bits.LeadingZeros64(cmp)/8 + // } + // + // - use of vector instructions in the manner of + // runtime.cmpstring, which is expected to achieve 3x + // further improvement when len > 32. + // + const wordsize = int(unsafe.Sizeof(uint(0))) + var aword, bword [wordsize]byte + for i+wordsize <= commonLen { + copy(aword[:], a[i:i+wordsize]) + copy(bword[:], b[i:i+wordsize]) + if aword != bword { + break + } + i += wordsize + } + // naive implementation + for i < commonLen { + if a[i] != b[i] { + return i + } + i++ + } + return i +} +func min(x, y int) int { + if x < y { + return x + } else { + return y + } +} +func max(x, y int) int { + if x > y { + return x + } else { + return y + } +} + +// Minimum string length for prefixes to be useful. If any prefix has length 1, +// then we're generally better off just using IndexOfAny with chars. +const minPrefixLength = 2 + +// Arbitrary string length limit (with some wiggle room) to avoid creating strings that are longer than is useful and consuming too much memory. +const maxPrefixLength = 8 + +// Arbitrary limit on the number of prefixes to find. If we find more than this, we're likely to be spending too much time finding prefixes that won't be useful. +const maxPrefixes = 16 + +// Finds an array of multiple prefixes that a node can begin with. +// If a fixed set of prefixes is found, such that a match for this node is guaranteed to begin +// with one of those prefixes, an array of those prefixes is returned. Otherwise, null. +func findPrefixes(node *RegexNode, ignoreCase bool) []string { + + // Analyze the node to find prefixes. + results := []*bytes.Buffer{{}} + findPrefixesCore(node, &results, ignoreCase) + + // If we found too many prefixes or if any found is too short, fail. + if len(results) > maxPrefixes || slices.ContainsFunc(results, func(sb *bytes.Buffer) bool { return sb.Len() < minPrefixLength }) { + return nil + } + + // Return the prefixes. + resultStrings := make([]string, len(results)) + for i := 0; i < len(results); i++ { + resultStrings[i] = results[i].String() + } + return resultStrings +} + +// Updates the results list with found prefixes. All existing strings in the list are treated as existing +// discovered prefixes prior to the node being processed. The method returns true if subsequent nodes after +// this one should be examined, or returns false if they shouldn't be because the node wasn't guaranteed +// to be fully processed. +func findPrefixesCore(node *RegexNode, res *[]*bytes.Buffer, ignoreCase bool) bool { + results := *res + // If we're too deep to analyze further, we can't trust what we've already computed, so stop iterating. + // Also bail if any of our results is already hitting the threshold, or if this node is RTL, which is + // not worth the complexity of handling. + // Or if we've already discovered more than the allowed number of prefixes. + + if slices.ContainsFunc(results, func(sb *bytes.Buffer) bool { return sb.Len() >= maxPrefixLength }) || + (node.Options&RightToLeft) != 0 || + len(results) > maxPrefixes { + return false + } + + // These limits are approximations. We'll stop trying to make strings longer once we exceed the max length, + // and if we exceed the max number of prefixes by a non-trivial amount, we'll fail the operation. + // limit how many chars we get from a set based on the max prefixes we care about + //setChars := make([]rune, 0, maxPrefixes) + + // Loop down the left side of the tree, looking for a starting node we can handle. We only loop through + // atomic and capture nodes, as the child is guaranteed to execute once, as well as loops with a positive + // minimum and thus at least one guaranteed iteration. + for { + switch node.T { + // These nodes are all guaranteed to execute at least once, so we can just + // skip through them to their child. + case NtAtomic, NtCapture: + node = node.Children[0] + continue + + // Zero-width anchors and assertions don't impact a prefix and may be skipped over. + case NtBol, NtEol, NtBoundary, NtECMABoundary, NtNonboundary, NtNonECMABoundary, + NtBeginning, NtStart, NtEndZ, NtEnd, NtEmpty, NtUpdateBumpalong, + NtPosLook, NtNegLook: + return true + + // If we hit a single character, we can just return that character. + // This is only relevant for case-sensitive searches, as for case-insensitive we'd have sets for anything + // that produces a different result when case-folded, or for strings composed entirely of characters that + // don't participate in case conversion. Single character loops are handled the same as single characters + // up to the min iteration limit. We can continue processing after them as well if they're repeaters such + // that their min and max are the same. + case NtOne, NtOneloop, NtOnelazy, NtOneloopatomic: + if !ignoreCase || !participatesInCaseConversion(node.Ch) { + reps := maxPrefixLength + if node.T == NtOne { + reps = 1 + } else if node.M < reps { + reps = node.M + } + if reps == 1 { + for _, sb := range results { + sb.WriteRune(node.Ch) + } + } else { + for _, sb := range results { + sb.WriteString(strings.Repeat(string(node.Ch), reps)) + } + } + return node.T == NtOne || reps == node.N + } + + // If we hit a string, we can just return that string. + // As with One above, this is only relevant for case-sensitive searches. + case NtMulti: + if !ignoreCase { + for _, sb := range results { + sb.WriteString(string(node.Str)) + } + } else { + // If we're ignoring case, then only append up through characters that don't participate in case conversion. + // If there are any beyond that, we can't go further and need to stop with what we have. + for _, c := range node.Str { + if participatesInCaseConversion(c) { + return false + } + + for _, sb := range results { + sb.WriteRune(c) + } + } + } + return true + + // For case-sensitive, try to extract the characters that comprise it, and if there are + // any and there aren't more than the max number of prefixes, we can return + // them each as a prefix. Effectively, this is an alternation of the characters + // that comprise the set. For case-insensitive, we need the set to be two ASCII letters that case fold to the same thing. + // As with One and loops, set loops are handled the same as sets up to the min iteration limit. + case NtSet, NtSetloop, NtSetlazy, NtSetloopatomic: + if node.Set == nil || node.Set.IsNegated() { + return false + } + + setChars := node.Set.GetSetChars(maxPrefixes) + + if len(setChars) == 0 { + return false + } + + reps := maxPrefixLength + if node.T == NtSet { + reps = 1 + } else if node.M < reps { + reps = node.M + } + if !ignoreCase { + for rep := 0; rep < reps; rep++ { + existingCount := len(results) + if existingCount*len(setChars) > maxPrefixes { + return false + } + + // Duplicate all of the existing strings for all of the new suffixes, other than the first. + for _, suffix := range setChars[1:] { + for existing := 0; existing < existingCount; existing++ { + newSb := bytes.NewBuffer(slices.Clone(results[existing].Bytes())) + newSb.WriteRune(suffix) + results = append(results, newSb) + } + } + *res = results + + // Then append the first suffix to all of the existing strings. + for existing := 0; existing < existingCount; existing++ { + results[existing].WriteRune(setChars[0]) + } + } + } else { + // For ignore-case, we currently only handle the simple (but common) case of a single + // ASCII character that case folds to the same char. + ok, setChars := node.Set.containsAsciiIgnoreCaseCharacter() + if !ok { + return false + } + + // Append it to each. + for _, sb := range results { + sb.WriteString(strings.Repeat(string(setChars[1]), reps)) + } + } + + *res = results + return node.T == NtSet || reps == node.N + + case NtConcatenate: + for i := 0; i < len(node.Children); i++ { + if !findPrefixesCore(node.Children[i], res, ignoreCase) { + return false + } + } + + return true + + // We can append any guaranteed iterations as if they were a concatenation. + case NtLoop, NtLazyloop: + if node.M > 0 { + // MaxPrefixLength here is somewhat arbitrary, as a single loop iteration could yield multiple chars + limit := maxPrefixLength + if node.M < limit { + limit = node.M + } + for i := 0; i < limit; i++ { + if !findPrefixesCore(node.Children[0], res, ignoreCase) { + return false + } + } + return limit == node.N + } + + // For alternations, we need to find a prefix for every branch; if we can't compute a + // prefix for any one branch, we can't trust the results and need to give up, since we don't + // know if our set of prefixes is complete. + case NtAlternate: + + // If there are more children than our maximum, just give up immediately, as we + // won't be able to get a prefix for every branch and have it be within our max. + if len(node.Children) > maxPrefixes { + return false + } + + // Build up the list of all prefixes across all branches. + var allBranchResults []*bytes.Buffer + alternateBranchResults := []*bytes.Buffer{{}} + for i := 0; i < len(node.Children); i++ { + findPrefixesCore(node.Children[i], &alternateBranchResults, ignoreCase) + + // If we now have too many results, bail. + if len(allBranchResults)+len(alternateBranchResults) > maxPrefixes { + return false + } + + for _, sb := range alternateBranchResults { + // If a branch yields an empty prefix, then none of the other branches + // matter, e.g. if the pattern is abc(def|ghi|), then this would result + // in prefixes abcdef, abcghi, and abc, and since abc is a prefix of both + // abcdef and abcghi, the former two would never be used. + if sb.Len() == 0 { + return false + } + } + + if allBranchResults == nil { + allBranchResults = alternateBranchResults + alternateBranchResults = []*bytes.Buffer{{}} + } else { + allBranchResults = append(allBranchResults, alternateBranchResults...) + alternateBranchResults = []*bytes.Buffer{{}} + } + } + + // At this point, we know we can successfully incorporate the alternation's results + // into the main results. + + // If the results are currently empty (meaning a single empty StringBuilder), we can remove + // that builder and just replace the results with the alternation's results. We would otherwise + // be creating a dot product of every builder in the results with every branch's result, which + // is logically the same thing. + if len(results) == 1 && results[0].Len() == 0 { + results = allBranchResults + } else { + existingCount := len(results) + + // Duplicate all of the existing strings for all of the new suffixes, other than the first. + for i := 1; i < len(allBranchResults); i++ { + suffix := allBranchResults[i] + for existing := 0; existing < existingCount; existing++ { + newSb := &bytes.Buffer{} + newSb.Write(results[existing].Bytes()) + newSb.Write(suffix.Bytes()) + results = append(results, newSb) + } + } + + // Then append the first suffix to all of the existing strings. + for existing := 0; existing < existingCount; existing++ { + results[existing].Write(allBranchResults[0].Bytes()) + } + } + *res = results + + // We don't know that we fully processed every branch, so we can't iterate through what comes after this node. + // The results were successfully updated, but return false to indicate that nothing after this node should be examined. + } + return false + } +} + +const maxLoopExpansion = 20 // arbitrary cut-off to avoid loops adding significant overhead to processing +const maxFixedResults = 50 // arbitrary cut-off to avoid generating lots of sets unnecessarily + +// Finds sets at fixed-offsets from the beginning of the pattern/ +// set "thorough" to true to spend more time finding sets (e.g. through alternations); false to do a faster analysis that's potentially more incomplete. +// Returns the array of found sets, or null if there aren't any. +func findFixedDistanceSets(root *RegexNode, thorough bool) []FixedDistanceSet { + + // Find all fixed-distance sets. + results := []FixedDistanceSet{} + distance := 0 + tryFindRawFixedSets(root, &results, &distance, thorough) + + // Remove any sets that match everything; they're not helpful. (This check exists primarily to weed + // out use of . in Singleline mode, but also filters out explicit sets like [\s\S].) + results = slices.DeleteFunc(results, func(s FixedDistanceSet) bool { return s.Set.IsAnything() }) + + // If we don't have any results, try harder to compute one for the starting character. + // This is a more involved computation that can find things the fixed-distance investigation + // doesn't. + if len(results) == 0 { + // weed out match-all, same as above + c := findFirstCharClass(root) + if c == nil || c.IsAnything() { + return nil + } + + results = append(results, FixedDistanceSet{Set: c, Distance: 0}) + } + + // For every entry, try to get the chars that make up the set, if there are few enough. + // For any for which we couldn't get the small chars list, see if we can get other useful info. + //scratch := make([]rune, 0, 128) + for i := 0; i < len(results); i++ { + result := results[i] + result.Negated = result.Set.IsNegated() + + // prefer IndexOfAny for tiny sets of 1 or 2 elements + if r := result.Set.GetIfNRanges(1); len(r) == 1 && r[0].Last-r[0].First > 1 { + result.Range = &r[0] + } else { + scratch := result.Set.GetSetChars(128) + if len(scratch) > 0 { + result.Chars = scratch + } + } + + results[i] = result + } + + return results +} + +// Starting from the specified root node, populates results with any characters at a fixed distance +// from the node's starting position. The function returns true if the entire contents of the node +// is at a fixed distance, in which case distance will have been updated to include the full length +// of the node. If it returns false, the node isn't entirely fixed, in which case subsequent nodes +// shouldn't be examined and distance should no longer be trusted. However, regardless of whether it +// returns true or false, it may have populated results, and all populated results are valid. All +// FixedDistanceSet result will only have its Set string and Distance populated; the rest is left +// to be populated by FindFixedDistanceSets after this returns. +func tryFindRawFixedSets(node *RegexNode, res *[]FixedDistanceSet, distance *int, thorough bool) bool { + results := *res + if node.Options&RightToLeft != 0 { + return false + } + + switch node.T { + case NtOne: + if len(results) < maxFixedResults { + set := &CharSet{} + set.addChar(node.Ch) + results = append(results, FixedDistanceSet{Set: set, Distance: *distance}) + *res = results + *distance++ + return true + } + return false + + case NtOnelazy, NtOneloop, NtOneloopatomic: + if node.M > 0 { + set := &CharSet{} + set.addChar(node.Ch) + minIterations := maxLoopExpansion + if node.M < minIterations { + minIterations = node.M + } + i := 0 + for ; i < minIterations && len(results) < maxFixedResults; i++ { + results = append(results, FixedDistanceSet{Set: set, Distance: *distance}) + *distance++ + } + *res = results + return i == node.M && i == node.N + } + + case NtMulti: + i := 0 + for ; i < len(node.Str) && len(results) < maxFixedResults; i++ { + set := &CharSet{} + set.addChar(node.Str[i]) + results = append(results, FixedDistanceSet{Set: set, Distance: *distance}) + *distance++ + } + *res = results + return i == len(node.Str) + + case NtSet: + if len(results) < maxFixedResults { + results = append(results, FixedDistanceSet{Set: node.Set, Distance: *distance}) + *res = results + *distance++ + return true + } + return false + + case NtSetlazy, NtSetloop, NtSetloopatomic: + if node.M > 0 { + minIterations := maxLoopExpansion + if node.M < minIterations { + minIterations = node.M + } + i := 0 + for ; i < minIterations && len(results) < maxFixedResults; i++ { + results = append(results, FixedDistanceSet{Set: node.Set, Distance: *distance}) + *distance++ + } + *res = results + return i == node.M && i == node.N + } + + case NtNotone: + // We could create a set out of Notone, but it will be of little value in helping to improve + // the speed of finding the first place to match, as almost every character will match it. + *distance++ + return true + + case NtNotonelazy, NtNotoneloop, NtNotoneloopatomic: + if node.M == node.N { + *distance += node.M + return true + } + case NtBeginning, NtBol, NtBoundary, NtECMABoundary, NtEmpty, NtResetCapture, NtEnd, NtEndZ, NtEol, + NtNonboundary, NtNonECMABoundary, NtUpdateBumpalong, + NtStart, NtNegLook, NtPosLook: + // Zero-width anchors and assertions. In theory, for PositiveLookaround and NegativeLookaround we could also + // investigate them and use the learned knowledge to impact the generated sets, at least for lookaheads. + // For now, we don't bother. + return true + + case NtAtomic, NtGroup, NtCapture: + return tryFindRawFixedSets(node.Children[0], res, distance, thorough) + + case NtLazyloop, NtLoop: + if node.M > 0 { + // This effectively only iterates the loop once. If deemed valuable, + // it could be updated in the future to duplicate the found results + // (updated to incorporate distance from previous iterations) and + // summed distance for all node.M iterations. If node.M == node.N, + // this would then also allow continued evaluation of the rest of the + // expression after the loop. + tryFindRawFixedSets(node.Children[0], res, distance, thorough) + return false + } + + case NtConcatenate: + for i := 0; i < len(node.Children); i++ { + if !tryFindRawFixedSets(node.Children[i], res, distance, thorough) { + return false + } + } + return true + + case NtAlternate: + if thorough { + allSameSize := true + sameDistance := -1 + var combined = make(map[int]struct { + Set *CharSet + Count int + }) + var localResults []FixedDistanceSet + + for i := 0; i < len(node.Children); i++ { + localResults = []FixedDistanceSet{} + localDistance := 0 + allSameSize = allSameSize && tryFindRawFixedSets(node.Children[i], &localResults, &localDistance, thorough) + + if len(localResults) == 0 { + return false + } + + if allSameSize { + if sameDistance == -1 { + sameDistance = localDistance + } else if sameDistance != localDistance { + allSameSize = false + } + } + + for _, fixedSet := range localResults { + if v, ok := combined[fixedSet.Distance]; ok { + if v.Set.IsMergeable() && fixedSet.Set.IsMergeable() { + v.Set.addSet(*fixedSet.Set) + v.Count++ + combined[fixedSet.Distance] = v + } + } else { + setCopy := fixedSet.Set.Copy() + combined[fixedSet.Distance] = struct { + Set *CharSet + Count int + }{Set: &setCopy, Count: 1} + } + } + } + + for k, v := range combined { + if len(results) >= maxFixedResults { + allSameSize = false + break + } + + if v.Count == len(node.Children) { + results = append(results, FixedDistanceSet{Set: v.Set, Distance: k + *distance}) + } + } + *res = results + + if allSameSize { + *distance += sameDistance + return true + } + + return false + } + } + return false +} + +// CompareFunc for a set of fixed-distance set results from best to worst quality. +func compareFixedDistanceSetsByQuality(s1, s2 FixedDistanceSet) int { + // Finally, try to move the "best" results to be earlier. "best" here are ones we're able to search + // for the fastest and that have the best chance of matching as few false positives as possible. + s1RangeLength := getRangeLength(s1.Range, s1.Negated) + s2RangeLength := getRangeLength(s2.Range, s2.Negated) + + // If one set is negated and the other isn't, prefer the non-negated set. In general, negated + // sets are large and thus likely to match more frequently, making them slower to search for. + if s1.Negated != s2.Negated { + if s2.Negated { + return -1 + } + return 1 + } + + // If we extracted only a few chars and the sets are negated, they both represent very large + // sets that are difficult to compare for quality. + if !s1.Negated { + // If both have chars, prioritize the one with the smaller frequency for those chars. + if len(s1.Chars) > 0 && len(s2.Chars) > 0 { + // Prefer sets with less frequent values. The frequency is only an approximation, + // used as a tie-breaker when we'd otherwise effectively be picking randomly. + // True frequencies will vary widely based on the actual data being searched, the language of the data, etc. + s1Frequency := sumFrequencies(s1.Chars) + s2Frequency := sumFrequencies(s2.Chars) + + if s1Frequency != s2Frequency { + return cmp.Compare(s1Frequency, s2Frequency) + } + + if !isAsciiRunes(s1.Chars) && !isAsciiRunes(s2.Chars) { + // Prefer the set with fewer values. + return cmp.Compare(len(s1.Chars), len(s2.Chars)) + } + } + + // If one has chars and the other has a range, prefer the shorter set. + if (len(s1.Chars) > 0 && s2RangeLength > 0) || (s1RangeLength > 0 && len(s2.Chars) > 0) { + s1Len := s1RangeLength + if len(s1.Chars) > s1Len { + s1Len = len(s1.Chars) + } + s2Len := s2RangeLength + if len(s2.Chars) > s2Len { + s2Len = len(s2.Chars) + } + c := cmp.Compare(s1Len, s2Len) + if c != 0 { + return c + } + + // If lengths are the same, prefer the chars. + if len(s1.Chars) > 0 { + return -1 + } + return 1 + } + + // If one has chars and the other doesn't, prioritize the one with chars. + if (len(s1.Chars) > 0) != (len(s2.Chars) > 0) { + if len(s1.Chars) > 0 { + return -1 + } + return 1 + } + } + + // If one has a range and the other doesn't, prioritize the one with a range. + if (s1RangeLength > 0) != (s2RangeLength > 0) { + if s1RangeLength > 0 { + return -1 + } + return 1 + } + + // If both have ranges, prefer the one that includes fewer characters. + if s1RangeLength > 0 { + return cmp.Compare(s1RangeLength, s2RangeLength) + } + + // As a tiebreaker, prioritize the earlier one. + return cmp.Compare(s1.Distance, s2.Distance) +} + +func getRangeLength(r *SingleRange, negated bool) int { + if r == nil { + return 0 + } + if negated { + return int(unicode.MaxRune - (r.Last - r.First)) + } + return int(r.Last - r.First + 1) +} + +func sumFrequencies(chars []rune) float32 { + var sum float32 + for _, c := range chars { + // Lookup each character in the table. Values >= 128 are ignored + // and thus we'll get skew in the data. It's already a gross approximation, though, + // and it is primarily meant for disambiguation of ASCII letters. + if c < unicode.MaxASCII { + sum += frequency[c] + } + } + return sum +} + +// Percent occurrences in source text (100 * char count / total count) +var frequency = []float32{ + 0.000 /* '\x00' */, 0.000 /* '\x01' */, 0.000 /* '\x02' */, 0.000 /* '\x03' */, 0.000 /* '\x04' */, 0.000 /* '\x05' */, 0.000 /* '\x06' */, 0.000, /* '\x07' */ + 0.000 /* '\x08' */, 0.001 /* '\x09' */, 0.000 /* '\x0A' */, 0.000 /* '\x0B' */, 0.000 /* '\x0C' */, 0.000 /* '\x0D' */, 0.000 /* '\x0E' */, 0.000, /* '\x0F' */ + 0.000 /* '\x10' */, 0.000 /* '\x11' */, 0.000 /* '\x12' */, 0.000 /* '\x13' */, 0.003 /* '\x14' */, 0.000 /* '\x15' */, 0.000 /* '\x16' */, 0.000, /* '\x17' */ + 0.000 /* '\x18' */, 0.004 /* '\x19' */, 0.000 /* '\x1A' */, 0.000 /* '\x1B' */, 0.006 /* '\x1C' */, 0.006 /* '\x1D' */, 0.000 /* '\x1E' */, 0.000, /* '\x1F' */ + 8.952 /* ' ' */, 0.065 /* ' !' */, 0.420 /* ' "' */, 0.010 /* ' #' */, 0.011 /* ' $' */, 0.005 /* ' %' */, 0.070 /* ' &' */, 0.050, /* ' '' */ + 3.911 /* ' (' */, 3.910 /* ' )' */, 0.356 /* ' *' */, 2.775 /* ' +' */, 1.411 /* ' ,' */, 0.173 /* ' -' */, 2.054 /* ' .' */, 0.677, /* ' /' */ + 1.199 /* ' 0' */, 0.870 /* ' 1' */, 0.729 /* ' 2' */, 0.491 /* ' 3' */, 0.335 /* ' 4' */, 0.269 /* ' 5' */, 0.435 /* ' 6' */, 0.240, /* ' 7' */ + 0.234 /* ' 8' */, 0.196 /* ' 9' */, 0.144 /* ' :' */, 0.983 /* ' ;' */, 0.357 /* ' <' */, 0.661 /* ' =' */, 0.371 /* ' >' */, 0.088, /* ' ?' */ + 0.007 /* ' @' */, 0.763 /* ' A' */, 0.229 /* ' B' */, 0.551 /* ' C' */, 0.306 /* ' D' */, 0.449 /* ' E' */, 0.337 /* ' F' */, 0.162, /* ' G' */ + 0.131 /* ' H' */, 0.489 /* ' I' */, 0.031 /* ' J' */, 0.035 /* ' K' */, 0.301 /* ' L' */, 0.205 /* ' M' */, 0.253 /* ' N' */, 0.228, /* ' O' */ + 0.288 /* ' P' */, 0.034 /* ' Q' */, 0.380 /* ' R' */, 0.730 /* ' S' */, 0.675 /* ' T' */, 0.265 /* ' U' */, 0.309 /* ' V' */, 0.137, /* ' W' */ + 0.084 /* ' X' */, 0.023 /* ' Y' */, 0.023 /* ' Z' */, 0.591 /* ' [' */, 0.085 /* ' \' */, 0.590 /* ' ]' */, 0.013 /* ' ^' */, 0.797, /* ' _' */ + 0.001 /* ' `' */, 4.596 /* ' a' */, 1.296 /* ' b' */, 2.081 /* ' c' */, 2.005 /* ' d' */, 6.903 /* ' e' */, 1.494 /* ' f' */, 1.019, /* ' g' */ + 1.024 /* ' h' */, 3.750 /* ' i' */, 0.286 /* ' j' */, 0.439 /* ' k' */, 2.913 /* ' l' */, 1.459 /* ' m' */, 3.908 /* ' n' */, 3.230, /* ' o' */ + 1.444 /* ' p' */, 0.231 /* ' q' */, 4.220 /* ' r' */, 3.924 /* ' s' */, 5.312 /* ' t' */, 2.112 /* ' u' */, 0.737 /* ' v' */, 0.573, /* ' w' */ + 0.992 /* ' x' */, 1.067 /* ' y' */, 0.181 /* ' z' */, 0.391 /* ' {' */, 0.056 /* ' |' */, 0.391 /* ' }' */, 0.002 /* ' ~' */, 0.000, /* '\x7F' */ +} + +// The above table was generated programmatically with the following. This can be augmented to incorporate additional data sources, +// though it is only intended to be a rough approximation use when tie-breaking and we'd otherwise be picking randomly, so, it's something. +// The frequencies may be wildly inaccurate when used with data sources different in nature than the training set, in which case we shouldn't +// be much worse off than just picking randomly: +// +// using System.Runtime.InteropServices; +// +// var counts = new Dictionary(); +// +// (string, string)[] rootsAndExtensions = new[] +// { +// (@"d:\repos\runtime\src\", "*.cs"), // C# files in dotnet/runtime +// (@"d:\Top25GutenbergBooks", "*.txt"), // Top 25 most popular books on Project Gutenberg +// }; +// +// foreach ((string root, string ext) in rootsAndExtensions) +// foreach (string path in Directory.EnumerateFiles(root, ext, SearchOption.AllDirectories)) +// foreach (string line in File.ReadLines(path)) +// foreach (char c in line.AsSpan().Trim()) +// CollectionsMarshal.GetValueRefOrAddDefault(counts, (byte)c, out _)++; +// +// long total = counts.Sum(i => i.Value); +// +// Console.WriteLine("/// Percent occurrences in source text (100 * char count / total count)."); +// Console.WriteLine("private static ReadOnlySpan Frequency =>"); +// Console.WriteLine("["); +// int i = 0; +// for (int row = 0; row < 16; row++) +// { +// Console.Write(" "); +// for (int col = 0; col < 8; col++) +// { +// counts.TryGetValue((byte)i, out long charCount); +// float frequency = (float)(charCount / (double)total) * 100; +// Console.Write($" {frequency:N3}f /* '{(i >= 32 && i < 127 ? $" {(char)i}" : $"\\x{i:X2}")}' */,"); +// i++; +// } +// Console.WriteLine(); +// } +// Console.WriteLine("];"); + +// / +// / Analyzes the pattern for a leading set loop followed by a non-overlapping literal. If such a pattern is found, an implementation +// / can search for the literal and then walk backward through all matches for the loop until the beginning is found. +// / +func findLiteralFollowingLeadingLoop(node *RegexNode) *LiteralAfterLoop { + if (node.Options & RightToLeft) != 0 { + // As a simplification, ignore RightToLeft. + return nil + } + + // Find the first concatenation. We traverse through atomic and capture nodes as they don't effect flow control. (We don't + // want to explore loops, even if they have a guaranteed iteration, because we may use information about the node to then + // skip the node's execution in the matching algorithm, and we would need to special-case only skipping the first iteration.) + for node.T == NtAtomic || node.T == NtCapture { + node = node.Children[0] + } + if node.T != NtConcatenate { + return nil + } + + // Bail if the first node isn't a set loop. We treat any kind of set loop (Setloop, Setloopatomic, and Setlazy) + // the same because of two important constraints: the loop must not have an upper bound, and the literal we look + // for immediately following it must not overlap. With those constraints, all three of these kinds of loops will + // end up having the same semantics; in fact, if atomic optimizations are used, we will have converted Setloop + // into a Setloopatomic (but those optimizations are disabled for NonBacktracking in general). This + // could also be made to support Oneloopatomic and Notoneloopatomic, but the scenarios for that are rare. + firstChild := node.Children[0] + for firstChild.T == NtAtomic || firstChild.T == NtCapture { + firstChild = firstChild.Children[0] + } + if (firstChild.T != NtSetloop && firstChild.T != NtSetloopatomic && firstChild.T != NtSetlazy) || + firstChild.N != math.MaxInt32 { + return nil + } + + // Get the subsequent node. An UpdateBumpalong may have been added as an optimization, but it doesn't have an + // impact on semantics and we can skip it. + nextChild := node.Children[1] + if nextChild.T == NtUpdateBumpalong { + if len(node.Children) == 2 { + // If the UpdateBumpalong is the last node, nothing meaningful follows the set loop. + return nil + } + nextChild = node.Children[2] + } + nextChild = unwrapImmediateLiteralAfterLoopNode(nextChild) + if nextChild == nil { + return nil + } + + // Is the set loop followed by a case-sensitive string we can search for? + if prefix := findPrefix(nextChild); len(prefix) >= 1 { + // The literal can be searched for as either a single char or as a string. + // But we need to make sure that its starting character isn't part of the preceding + // set, as then we can't know for certain where the set loop ends. + if firstChild.Set.CharIn(rune(prefix[0])) { + return nil + } else if len(prefix) == 1 { + return &LiteralAfterLoop{ + LoopNode: firstChild, + Char: rune(prefix[0]), + } + } + return &LiteralAfterLoop{ + LoopNode: firstChild, + String: prefix, + } + } + + // Is the set loop followed by an ordinal case-insensitive string we can search for? We could + // search for a string with at least one char, but if it has only one, we're better off just + // searching as a set, so we look for strings with at least two chars. + if ordinalCaseInsensitivePrefix := findPrefixOrdinalCaseInsensitive(nextChild); len(ordinalCaseInsensitivePrefix) >= 2 { + // The literal can be searched for as a case-insensitive string. As with ordinal above, + // though, we need to make sure its starting character isn't part of the previous set. + // If that starting character participates in case conversion, then we need to test out + // both casings (FindPrefixOrdinalCaseInsensitive will only return strings composed of + // characters that either are ASCII or that don't participate in case conversion). + ch, _ := utf8.DecodeRuneInString(ordinalCaseInsensitivePrefix) + if participatesInCaseConversion(ch) { + if firstChild.Set.CharIn(ch|0x20) || + firstChild.Set.CharIn(ch&^0x20) { + return nil + } + } else if firstChild.Set.CharIn(ch) { + return nil + } + + return &LiteralAfterLoop{ + LoopNode: firstChild, + String: ordinalCaseInsensitivePrefix, + StringIgnoreCase: true, + } + } + + // If the resulting node is a set with at least one iteration, we can search for it. + if nextChild.IsSetFamily() && + !nextChild.Set.IsNegated() && + (nextChild.T == NtSet || nextChild.M >= 1) { + // maximum number of chars optimized by IndexOfAny + chars := nextChild.Set.GetSetChars(5) + if len(chars) > 0 { + for _, c := range chars { + if firstChild.Set.CharIn(c) { + return nil + } + } + + return &LiteralAfterLoop{ + LoopNode: firstChild, + Chars: chars, + } + } + } + + // Otherwise, we couldn't find the pattern of an atomic set loop followed by a literal. + return nil +} + +func unwrapImmediateLiteralAfterLoopNode(node *RegexNode) *RegexNode { + for { + node = unwrapTransparentNodes(node) + if node == nil { + return nil + } + if node.T != NtConcatenate { + return node + } + if len(node.Children) == 0 { + return nil + } + node = node.Children[0] + } +} + +func findRequiredLandmarkChain(node *RegexNode) *RequiredLandmarkChain { + if (node.Options & RightToLeft) != 0 { + return nil + } + + node = unwrapTransparentNodes(node) + if node.T != NtConcatenate || len(node.Children) < 4 { + return nil + } + + firstChild := unwrapTransparentNodes(node.Children[0]) + if !isUnboundedSetLoop(firstChild) { + return nil + } + + // Collect landmarks that must appear in order later in the match. This is a + // conservative prefilter: if any child cannot be described as a detectable + // landmark, we skip that child rather than making it part of the chain. + landmarks := make([]RequiredLandmark, 0, 2) + var anchors []NodeType + for _, child := range node.Children[1:] { + if landmark, ok := extractRequiredLandmark(child); ok { + landmarks = append(landmarks, landmark) + } else if len(landmarks) == 0 { + if !isZeroWidthLandmarkGap(child) { + return nil + } + // The runner tests ECMAScript boundaries without the extra word + // characters of IgnoreCase|Unicode, so leave those out: fewer + // anchors only means fewer starts are skipped. + if child = unwrapTransparentNodes(child); child != nil && isLandmarkAnchor(child.T) && !slices.Contains(anchors, child.T) && + !((child.T == NtECMABoundary || child.T == NtNonECMABoundary) && hasECMAWordCharExtras(child.Options)) { + anchors = append(anchors, child.T) + } + } + } + if len(landmarks) < 2 { + return nil + } + + return &RequiredLandmarkChain{ + LeadingLoopSet: firstChild.Set, + Anchors: anchors, + Landmarks: landmarks, + } +} + +func isLandmarkAnchor(t NodeType) bool { + switch t { + case NtBeginning, NtBol, NtStart, NtEndZ, NtEnd, NtEol, + NtBoundary, NtNonboundary, NtECMABoundary, NtNonECMABoundary: + return true + default: + return false + } +} + +func isZeroWidthLandmarkGap(node *RegexNode) bool { + node = unwrapTransparentNodes(node) + if node == nil { + return true + } + switch node.T { + case NtEmpty, NtResetCapture, NtUpdateBumpalong: + return true + default: + return isLandmarkAnchor(node.T) + } +} + +func unwrapTransparentNodes(node *RegexNode) *RegexNode { + for node != nil && (node.T == NtAtomic || node.T == NtCapture || node.T == NtGroup) && len(node.Children) == 1 { + node = node.Children[0] + } + return node +} + +func isUnboundedSetLoop(node *RegexNode) bool { + return node != nil && + (node.T == NtSetloop || node.T == NtSetloopatomic || node.T == NtSetlazy) && + node.Set != nil && + node.N == math.MaxInt32 +} + +func extractRequiredLandmark(node *RegexNode) (RequiredLandmark, bool) { + node = unwrapTransparentNodes(node) + if node == nil { + return RequiredLandmark{}, false + } + + if node.T != NtAlternate { + alt, ok := extractRequiredLandmarkAlternative(node) + if !ok { + return RequiredLandmark{}, false + } + return RequiredLandmark{Alternatives: []RequiredLandmarkAlternative{alt}}, true + } + + landmark := RequiredLandmark{Alternatives: make([]RequiredLandmarkAlternative, 0, len(node.Children))} + for _, child := range node.Children { + alt, ok := extractRequiredLandmarkAlternative(child) + if !ok { + return RequiredLandmark{}, false + } + landmark.Alternatives = append(landmark.Alternatives, alt) + } + return landmark, len(landmark.Alternatives) > 0 +} + +func extractRequiredLandmarkAlternative(node *RegexNode) (RequiredLandmarkAlternative, bool) { + node = unwrapTransparentNodes(node) + if node == nil { + return RequiredLandmarkAlternative{}, false + } + + children := []*RegexNode{node} + if node.T == NtConcatenate { + children = node.Children + } + + alt := RequiredLandmarkAlternative{} + i := 0 + if i < len(children) { + if whitespaceSet, min, ok := whitespaceLoop(children[i]); ok { + alt.LeadingWhitespaceSet = whitespaceSet + alt.RequireWhitespaceBefore = min > 0 + i++ + } + } + if i >= len(children) { + return RequiredLandmarkAlternative{}, false + } + + // The core of a landmark must be a literal or a bounded, enumerable set + // repetition. The VM still validates the full regex after this prefilter + // returns a candidate. + core := unwrapTransparentNodes(children[i]) + switch core.T { + case NtOne: + alt.Literal = []rune{core.Ch} + alt.MinRepeat = 1 + alt.MaxRepeat = 1 + case NtMulti: + alt.Literal = core.Str + alt.MinRepeat = 1 + alt.MaxRepeat = 1 + case NtSet, NtSetloop, NtSetloopatomic, NtSetlazy: + if core.Set == nil { + return RequiredLandmarkAlternative{}, false + } + if core.T == NtSet { + alt.MinRepeat = 1 + alt.MaxRepeat = 1 + } else if core.M > 0 && core.N != math.MaxInt32 { + alt.MinRepeat = core.M + alt.MaxRepeat = core.N + } else { + return RequiredLandmarkAlternative{}, false + } + chars := core.Set.GetSetChars(8) + if len(chars) == 0 || core.Set.IsNegated() { + return RequiredLandmarkAlternative{}, false + } + alt.Set = core.Set + default: + return RequiredLandmarkAlternative{}, false + } + i++ + + if i < len(children) { + if whitespaceSet, min, ok := whitespaceLoop(children[i]); ok { + alt.TrailingWhitespaceSet = whitespaceSet + alt.RequireWhitespaceAfter = min > 0 + i++ + } + } + if i != len(children) { + return RequiredLandmarkAlternative{}, false + } + return alt, true +} + +func whitespaceLoop(node *RegexNode) (*CharSet, int, bool) { + node = unwrapTransparentNodes(node) + if node != nil && + (node.T == NtSetloop || node.T == NtSetloopatomic || node.T == NtSetlazy) && + node.Set != nil && + node.N == math.MaxInt32 && + (node.Set.Equals(SpaceClass()) || node.Set.Equals(ECMASpaceClass()) || node.Set.Equals(RE2SpaceClass())) { + return node.Set, node.M, true + } + return nil, 0, false +} + +// Returns a leading positive lookahead if found and whether to keep examining subsequent nodes in a concatenation. +func findLeadingPositiveLookahead(node *RegexNode) (*RegexNode, bool) { + for { + if node.Options&RightToLeft != 0 { + return nil, false + } + + switch node.T { + case NtPosLook: + return node, false + + case NtBol, NtEol, NtBeginning, NtStart, NtEndZ, NtEnd, + NtBoundary, NtECMABoundary, NtNegLook, NtEmpty: + return nil, true + + case NtAtomic, NtCapture: + node = node.Children[0] + continue + + case NtLoop, NtLazyloop: + if node.M < 1 { + return nil, false + } + lookahead, _ := findLeadingPositiveLookahead(node.Children[0]) + return lookahead, false + + case NtConcatenate: + for i := 0; i < len(node.Children); i++ { + lookahead, keepLooking := findLeadingPositiveLookahead(node.Children[i]) + if lookahead != nil || !keepLooking { + return lookahead, false + } + } + return nil, true + + default: + return nil, false + } + } +} diff --git a/vendor/github.com/dlclark/regexp2/v2/syntax/replacerdata.go b/vendor/github.com/dlclark/regexp2/v2/syntax/replacerdata.go new file mode 100644 index 000000000..ca0186988 --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/replacerdata.go @@ -0,0 +1,123 @@ +package syntax + +import ( + "bytes" + "errors" +) + +type ReplacerData struct { + Rep string + Strings []string + Rules []int +} + +const ( + replaceSpecials = 4 + replaceLeftPortion = -1 + replaceRightPortion = -2 + replaceLastGroup = -3 + replaceWholeString = -4 +) + +// ErrReplacementError is a general error during parsing the replacement text +var ErrReplacementError = errors.New("replacement pattern error") + +// NewReplacerData will populate a reusable replacer data struct based on the given replacement string +// and the capture group data from a regexp +func NewReplacerData(rep string, caps map[int]int, capsize int, capnames map[string]int, op RegexOptions) (*ReplacerData, error) { + return newReplacerData(rep, caps, capsize, capnames, op, nil) +} + +// NewReplacerDataWithGroupNames is like NewReplacerData, with group names in +// capture-slot order so duplicate ECMAScript names resolve all their slots. +// Numeric replacement references still select individual groups. +func NewReplacerDataWithGroupNames(rep string, caps map[int]int, capsize int, capnames map[string]int, op RegexOptions, groupNames []string) (*ReplacerData, error) { + var namedCaptures map[string][]int + if op&ECMAScript != 0 { + namedCaptures = make(map[string][]int) + numbers := make([]int, len(groupNames)) + for i := range numbers { + numbers[i] = i + } + for number, slot := range caps { + numbers[slot] = number + } + for slot, name := range groupNames { + if name != "" { + namedCaptures[name] = append(namedCaptures[name], numbers[slot]) + } + } + } + return NewReplacerDataWithGroupNumbers(rep, caps, capsize, capnames, op, namedCaptures) +} + +// NewReplacerDataWithGroupNumbers is like NewReplacerData, with ECMAScript +// duplicate names mapped to their public group numbers in declaration order. +// The map and its slices are read only during this call and may be reused. +// Numeric replacement references still select individual groups. +func NewReplacerDataWithGroupNumbers(rep string, caps map[int]int, capsize int, capnames map[string]int, op RegexOptions, groupNumbers map[string][]int) (*ReplacerData, error) { + return newReplacerData(rep, caps, capsize, capnames, op, groupNumbers) +} + +func newReplacerData(rep string, caps map[int]int, capsize int, capnames map[string]int, op RegexOptions, namedCaptures map[string][]int) (*ReplacerData, error) { + p := parser{ + options: op, + caps: caps, + capsize: capsize, + capnames: capnames, + namedCaptures: namedCaptures, + } + p.setPattern(rep) + concat, err := p.scanReplacement() + if err != nil { + return nil, err + } + + if concat.T != NtConcatenate { + panic(ErrReplacementError) + } + + sb := &bytes.Buffer{} + var ( + strings []string + rules []int + ) + + for _, child := range concat.Children { + switch child.T { + case NtMulti: + child.writeStrToBuf(sb) + + case NtOne: + sb.WriteRune(child.Ch) + + case NtRef: + if sb.Len() > 0 { + rules = append(rules, len(strings)) + strings = append(strings, sb.String()) + sb.Reset() + } + slot := child.M + + if len(caps) > 0 && slot >= 0 { + slot = caps[slot] + } + + rules = append(rules, -replaceSpecials-1-slot) + + default: + panic(ErrReplacementError) + } + } + + if sb.Len() > 0 { + rules = append(rules, len(strings)) + strings = append(strings, sb.String()) + } + + return &ReplacerData{ + Rep: rep, + Strings: strings, + Rules: rules, + }, nil +} diff --git a/vendor/github.com/dlclark/regexp2/v2/syntax/tree.go b/vendor/github.com/dlclark/regexp2/v2/syntax/tree.go new file mode 100644 index 000000000..1c0324252 --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/tree.go @@ -0,0 +1,2511 @@ +package syntax + +import ( + "bytes" + "fmt" + "math" + "strconv" + "strings" + "unicode" + + "slices" +) + +// Arbitrary number of repetitions of the same character when we'd prefer to represent that as a repeater of that character rather than a string. +const MultiVsRepeaterLimit = 64 + +type RegexTree struct { + Root *RegexNode + Caps map[int]int + Capnumlist []int + Captop int + Capnames map[string]int + Caplist []string + Options RegexOptions + FindOptimizations *FindOptimizations +} + +// It is built into a parsed tree for a regular expression. + +// Implementation notes: +// +// Since the node tree is a temporary data structure only used +// during compilation of the regexp to integer codes, it's +// designed for clarity and convenience rather than +// space efficiency. +// +// RegexNodes are built into a tree, linked by the n.children list. +// Each node also has a n.parent and n.ichild member indicating +// its parent and which child # it is in its parent's list. +// +// RegexNodes come in as many types as there are constructs in +// a regular expression, for example, "concatenate", "alternate", +// "one", "rept", "group". There are also node types for basic +// peephole optimizations, e.g., "onerep", "notsetrep", etc. +// +// Because perl 5 allows "lookback" groups that scan backwards, +// each node also gets a "direction". Normally the value of +// boolean n.backward = false. +// +// On the parse stack, each tree has a "role" - basically, the +// nonterminal in the grammar that the parser has currently +// assigned to the tree. That code is stored in n.role. +// +// Finally, some of the different kinds of nodes have data. +// Two integers (for the looping constructs) are stored in +// n.operands, an an object (either a string or a set) +// is stored in n.data +type RegexNode struct { + T NodeType + Children []*RegexNode + Str []rune + Set *CharSet + Ch rune + M int + N int + Options RegexOptions + Parent *RegexNode +} + +type NodeType int32 + +const ( + // The following are leaves, and correspond to primitive operations + NtUnknown NodeType = -1 + //NtOnerep NodeType = 0 // lef,back char,min,max a {n} + //NtNotonerep NodeType = 1 // lef,back char,min,max .{n} + //NtSetrep NodeType = 2 // lef,back set,min,max [\d]{n} + NtOneloop NodeType = 3 // lef,back char,min,max a {,n} + NtNotoneloop NodeType = 4 // lef,back char,min,max .{,n} + NtSetloop NodeType = 5 // lef,back set,min,max [\d]{,n} + NtOnelazy NodeType = 6 // lef,back char,min,max a {,n}? + NtNotonelazy NodeType = 7 // lef,back char,min,max .{,n}? + NtSetlazy NodeType = 8 // lef,back set,min,max [\d]{,n}? + NtOne NodeType = 9 // lef char a + NtNotone NodeType = 10 // lef char [^a] + NtSet NodeType = 11 // lef set [a-z\s] \w \s \d + NtMulti NodeType = 12 // lef string abcd + NtRef NodeType = 13 // lef group \# + NtBol NodeType = 14 // ^ + NtEol NodeType = 15 // $ + NtBoundary NodeType = 16 // \b + NtNonboundary NodeType = 17 // \B + NtBeginning NodeType = 18 // \A + NtStart NodeType = 19 // \G + NtEndZ NodeType = 20 // \Z + NtEnd NodeType = 21 // \Z + + // Interior nodes do not correspond to primitive operations, but + // control structures compositing other operations + + // Concat and alternate take n children, and can run forward or backwards + + NtNothing NodeType = 22 // [] + NtEmpty NodeType = 23 // () + NtAlternate NodeType = 24 // a|b + NtConcatenate NodeType = 25 // ab + NtLoop NodeType = 26 // m,x * + ? {,} + NtLazyloop NodeType = 27 // m,x *? +? ?? {,}? + NtCapture NodeType = 28 // n () + NtGroup NodeType = 29 // (?:) + NtPosLook NodeType = 30 // (?=) (?<=) + NtNegLook NodeType = 31 // (?!) (?) (?<) + NtBackRefCond NodeType = 33 // (?(n) | ) + NtExprCond NodeType = 34 // (?(...) | ) + + NtECMABoundary NodeType = 41 // \b + NtNonECMABoundary NodeType = 42 // \B + + // Atomic loop of the specified character. + // Operand 0 is the character. Operand 1 is the max iteration count. + NtOneloopatomic NodeType = 43 + // Atomic loop of a single character other than the one specified. + // Operand 0 is the character. Operand 1 is the max iteration count. + NtNotoneloopatomic NodeType = 44 + // Atomic loop of a single character matching the specified set + // Operand 0 is index into the strings table of the character class description. Operand 1 is the repetition count. + NtSetloopatomic NodeType = 45 + // Updates the bumpalong position to the current position. + NtUpdateBumpalong NodeType = 46 + // Matches one Unicode extended grapheme cluster (\X). + NtGrapheme NodeType = 47 + // Implements ECMAScript 2025 §22.2.2.3.1 RepeatMatcher, step 4: + // clears capture M before an iteration, with backtracking restore. + // Unlike a reference or balancing group, this does not observe its value. + NtResetCapture NodeType = 48 +) + +func newRegexNode(t NodeType, opt RegexOptions) *RegexNode { + return &RegexNode{ + T: t, + Options: opt, + } +} + +func newRegexNodeCh(t NodeType, opt RegexOptions, ch rune) *RegexNode { + return nodeWithCaseConversion(&RegexNode{ + T: t, + Options: opt, + Ch: ch, + }) +} + +func newRegexNodeStr(t NodeType, opt RegexOptions, str []rune) *RegexNode { + return &RegexNode{ + T: t, + Options: opt, + Str: str, + } +} + +func newRegexNodeSet(t NodeType, opt RegexOptions, set *CharSet) *RegexNode { + return nodeWithCaseConversion(&RegexNode{ + T: t, + Options: opt, + Set: set, + }) +} + +func newRegexNodeM(t NodeType, opt RegexOptions, m int) *RegexNode { + return &RegexNode{ + T: t, + Options: opt, + M: m, + } +} +func newRegexNodeMN(t NodeType, opt RegexOptions, m, n int) *RegexNode { + return &RegexNode{ + T: t, + Options: opt, + M: m, + N: n, + } +} + +func nodeWithCaseConversion(n *RegexNode) *RegexNode { + // if opts are ignore case and our rune is impacted by casing + // then we need to switch our type to the set version + // NtOne = NtSet + if n.Options&IgnoreCase == 0 { + return n + } + + if n.Ch > 0 { + ch := n.Ch + folds := unicode.IsLower(ch) || unicode.IsUpper(ch) + if n.Options&ECMAScript != 0 { + folds = unicode.SimpleFold(ch) != ch + } + if folds { + set := &CharSet{} + set.addChar(ch) + set.addCaseEquivalences(n.Options) + t := NtSet + + switch n.T { + case NtOneloop, NtNotoneloop: + t = NtSetloop + case NtOnelazy, NtNotonelazy: + t = NtSetlazy + } + set.negate = n.IsNotoneFamily() + + return &RegexNode{ + T: t, + Options: n.Options & ^IgnoreCase, + Set: set, + } + } + } else if n.Set != nil { + // just to be safe we don't modify the original set pointer + // just in case it's used in a case-sensitive area + s := n.Set.Copy() + s.addCaseEquivalences(n.Options) + n.Set = &s + n.Options &= ^IgnoreCase + } + + return n +} + +func (n *RegexNode) IsSetFamily() bool { + return n.T == NtSet || n.T == NtSetloop || n.T == NtSetlazy || n.T == NtSetloopatomic +} +func (n *RegexNode) IsOneFamily() bool { + return n.T == NtOne || n.T == NtOneloop || n.T == NtOnelazy || n.T == NtOneloopatomic +} +func (n *RegexNode) IsNotoneFamily() bool { + return n.T == NtNotone || n.T == NtNotoneloop || n.T == NtNotonelazy || n.T == NtNotoneloopatomic +} + +func (n *RegexNode) IsSetloopFamily() bool { + return n.T == NtSetloop || n.T == NtSetlazy || n.T == NtSetloopatomic +} +func (n *RegexNode) IsOneloopFamily() bool { + return n.T == NtOneloop || n.T == NtOnelazy || n.T == NtOneloopatomic +} +func (n *RegexNode) IsNotoneloopFamily() bool { + return n.T == NtNotoneloop || n.T == NtNotonelazy || n.T == NtNotoneloopatomic +} + +func (n *RegexNode) IsAtomicloopFamily() bool { + return n.T == NtOneloopatomic || n.T == NtNotoneloopatomic || n.T == NtSetloopatomic +} + +func (n *RegexNode) writeStrToBuf(buf *bytes.Buffer) { + for i := 0; i < len(n.Str); i++ { + buf.WriteRune(n.Str[i]) + } +} + +func (n *RegexNode) addChild(child *RegexNode) { + child.Parent = n + reduced := child.reduce() + reduced.Parent = n + n.Children = append(n.Children, reduced) + reduced.Parent = n +} + +func (n *RegexNode) insertChildren(afterIndex int, nodes []*RegexNode) { + for _, c := range nodes { + c.Parent = n + } + n.Children = slices.Insert(n.Children, afterIndex, nodes...) + //newChildren := make([]*RegexNode, 0, len(n.Children)+len(nodes)) + //n.Children = append(append(append(newChildren, n.Children[:afterIndex]...), nodes...), n.Children[afterIndex:]...) +} + +// removes children including the start but not the end index +func (n *RegexNode) removeChildren(startIndex, endIndex int) { + n.Children = append(n.Children[:startIndex], n.Children[endIndex:]...) +} + +func (n *RegexNode) ReplaceChild(index int, newChild *RegexNode) { + newChild.Parent = n // so that the child can see its parent while being reduced + newChild = newChild.reduce() + newChild.Parent = n // in case Reduce returns a different node that needs to be reparented + + n.Children[index] = newChild +} + +// Pass type as OneLazy or OneLoop +func (n *RegexNode) makeRep(t NodeType, min, max int) { + n.T += (t - NtOne) + n.M = min + n.N = max +} + +// Performs additional optimizations on an entire tree prior to being used. +// +// Some optimizations are performed by the parser while parsing, and others are performed +// as nodes are being added to the tree. The optimizations here expect the tree to be fully +// formed, as they inspect relationships between nodes that may not have been in place as +// individual nodes were being processed/added to the tree. +func (n *RegexNode) finalOptimize() *RegexNode { + rootNode := n + + // Only apply optimization when LTR to avoid needing additional code for the much rarer RTL case. + // Also only apply these optimizations when not using NonBacktracking, as these optimizations are + // all about avoiding things that are impactful for the backtracking engines but nops for non-backtracking. + if n.Options&RightToLeft == 0 { + // Optimization: eliminate backtracking for loops. + // For any single-character loop (Oneloop, Notoneloop, Setloop), see if we can automatically convert + // that into its atomic counterpart (Oneloopatomic, Notoneloopatomic, Setloopatomic) based on what + // comes after it in the expression tree. + rootNode.findAndMakeLoopsAtomic() + + // Optimization: backtracking removal at expression end. + // If we find backtracking construct at the end of the regex, we can instead make it non-backtracking, + // since nothing would ever backtrack into it anyway. Doing this then makes the construct available + // to implementations that don't support backtracking. + rootNode.eliminateEndingBacktracking() + + // Optimization: unnecessary re-processing of starting loops. + // If an expression is guaranteed to begin with a single-character unbounded loop that isn't part of an alternation (in which case it + // wouldn't be guaranteed to be at the beginning) or a capture (in which case a back reference could be influenced by its length), then we + // can update the tree with a temporary node to indicate that the implementation should use that node's ending position in the input text + // as the next starting position at which to start the next match. This avoids redoing matches we've already performed, e.g. matching + // "\w+@dot.net" against "is this a valid address@dot.net", the \w+ will initially match the "is" and then will fail to match the "@". + // Rather than bumping the scan loop by 1 and trying again to match at the "s", we can instead start at the " ". For functional correctness + // we can only consider unbounded loops, as to be able to start at the end of the loop we need the loop to have consumed all possible matches; + // otherwise, you could end up with a pattern like "a{1,3}b" matching against "aaaabc", which should match, but if we pre-emptively stop consuming + // after the first three a's and re-start from that position, we'll end up failing the match even though it should have succeeded. We can also + // apply this optimization to non-atomic loops: even though backtracking could be necessary, such backtracking would be handled within the processing + // of a single starting position. Lazy loops similarly benefit, as a failed match will result in exploring the exact same search space as with + // a greedy loop, just in the opposite order (and a successful match will overwrite the bumpalong position); we need to avoid atomic lazy loops, + // however, as they will only end up as a repeater for the minimum length and thus will effectively end up with a non-infinite upper bound, which + // we've already outlined is problematic. + node := rootNode.Children[0] // skip implicit root capture node + atomicByAncestry := true // the root is implicitly atomic because nothing comes after it (same for the implicit root capture) + for { + if node.T == NtAtomic { + node = node.Children[0] + continue + } else if node.T == NtConcatenate { + atomicByAncestry = false + node = node.Children[0] + continue + } else if node.N == math.MaxInt32 && + ((node.T == NtOneloop || node.T == NtOneloopatomic || node.T == NtNotoneloop || node.T == NtNotoneloopatomic || node.T == NtSetloop || node.T == NtSetloopatomic) || + ((node.T == NtOnelazy || node.T == NtNotonelazy || node.T == NtSetlazy) && !atomicByAncestry)) { + + if node.Parent != nil && node.Parent.T == NtConcatenate { + node.Parent.Children = slices.Insert(node.Parent.Children, 1, &RegexNode{T: NtUpdateBumpalong, Options: node.Options, Parent: node.Parent}) + } + } + + break + } + + } + + //debug helper + //rootNode.ValidateFinalTreeInvariants() + + // Done optimizing. Return the final tree. + return rootNode +} + +// Finds {one/notone/set}loop nodes in the concatenation that can be automatically upgraded +// to {one/notone/set}loopatomic nodes. Such changes avoid potential useless backtracking. +// e.g. A*B (where sets A and B don't overlap) => (?>A*)B. +func (n *RegexNode) findAndMakeLoopsAtomic() { + if n.Options&RightToLeft != 0 { + // RTL is so rare, we don't need to spend additional time/code optimizing for it. + return + } + + // For all node types that have children, recur into each of those children. + for i := 0; i < len(n.Children); i++ { + n.Children[i].findAndMakeLoopsAtomic() + } + + // If this isn't a concatenation, nothing more to do. + if n.T != NtConcatenate { + return + } + + // This is a concatenation. Iterate through each pair of nodes in the concatenation seeing whether we can + // make the first node (or its right-most child) atomic based on the second node (or its left-most child). + for i := 0; i < len(n.Children)-1; i++ { + n.Children[i].processNode(n.Children[i+1]) + } +} + +func (node *RegexNode) processNode(subsequent *RegexNode) { + // Skip down the node past irrelevant nodes. + for { + // We can always recur into captures and into the last node of concatenations. + if node.T == NtCapture || node.T == NtConcatenate { + node = node.Children[len(node.Children)-1] + continue + } + + // For loops with at least one guaranteed iteration, we can recur into them, but + // we need to be careful not to just always do so; the ending node of a loop can only + // be made atomic if what comes after the loop but also the beginning of the loop are + // compatible for the optimization. + if node.T == NtLoop { + loopDescendent := node.FindLastExpressionInLoopForAutoAtomic() + if loopDescendent != nil { + node = loopDescendent + continue + } + } + + // Can't skip any further. + break + } + + // If the node can be changed to atomic based on what comes after it, do so. + switch node.T { + case NtOneloop, NtNotoneloop, NtSetloop: + if node.canBeMadeAtomic(subsequent, true, false) { + // The greedy loop doesn't overlap with what comes after it, which means giving anything it matches back will not + // help the overall match to succeed, which means it can simply become atomic to match as much as possible. The call + // to CanBeMadeAtomic passes iterateNullableSubsequent=true because, in a pattern like a*b*c*, when analyzing a*, we + // want to examine the b* and the c* rather than just giving up after seeing that b* is nullable; in order to make + // the a* atomic, we need to know that anything that could possibly come after the loop doesn't overlap. + node.makeLoopAtomic() + } + + case NtOnelazy, NtNotonelazy, NtSetlazy: + if node.canBeMadeAtomic(subsequent, false, true) { + // The lazy loop doesn't overlap with what comes after it, which means it needs to match as much as its allowed + // to match in order for there to be a possibility that what comes next matches (if it doesn't match as much + // as it's allowed and there was still more it could match, then what comes next is guaranteed to not match, + // since it doesn't match any of the same things the loop matches). We don't want to just make the lazy loop + // atomic, as an atomic lazy loop matches as little as possible, not as much as possible. Instead, we want to + // make the lazy loop into an atomic greedy loop. Note that when we check CanBeMadeAtomic, we need to set + // "iterateNullableSubsequent" to false so that we only inspect non-nullable subsequent nodes. For example, + // given a pattern like a*?b, we want to upgrade that loop to being greedy atomic, e.g. (?>a*)b. But given a + // pattern like a*?b*, the subsequent node is nullable, which means it doesn't have to be part of a match, which + // means the a*? could match by itself, in which case as it's lazy it needs to match as few a's as possible, e.g. + // a+?b* against the input "aaaab" should match "a", not "aaaa" nor "aaaab". (Technically for lazy, we only need to prevent + // walking off the end of the pattern, but it's not currently worth complicating the implementation for that case.) + // allowLazy is set to true so that the implementation will analyze rather than ignore this node; generally lazy nodes + // are ignored due to making them atomic not generally being a sound change, but here we're explicitly choosing to + // given the circumstances. + node.T -= NtOnelazy - NtOneloop // lazy to greedy + node.makeLoopAtomic() + } + + case NtAlternate, NtBackRefCond, NtExprCond: + // In the case of alternation, we can't change the alternation node itself + // based on what comes after it (at least not with more complicated analysis + // that factors in all branches together), but we can look at each individual + // branch, and analyze ending loops in each branch individually to see if they + // can be made atomic. Then if we do end up backtracking into the alternation, + // we at least won't need to backtrack into that loop. The same is true for + // conditionals, though we don't want to process the condition expression + // itself, as it's already considered atomic and handled as part of ReduceExpressionConditional. + b := 0 + if node.T == NtExprCond { + b = 1 + } + for ; b < len(node.Children); b++ { + node.Children[b].processNode(subsequent) + } + + } +} + +func (n *RegexNode) reduce() *RegexNode { + // Remove IgnoreCase option from everything except a Backreference and an + // ECMAScript \b or \B whose word characters depend on it + if n.T != NtRef && !((n.T == NtECMABoundary || n.T == NtNonECMABoundary) && hasECMAWordCharExtras(n.Options)) { + n.Options &= ^IgnoreCase + } + switch n.T { + case NtAlternate: + return n.reduceAlternation() + case NtAtomic: + return n.reduceAtomic() + case NtConcatenate: + return n.reduceConcatenation() + case NtGroup: + return n.reduceGroup() + case NtLoop, NtLazyloop: + return n.reduceRep() + case NtPosLook, NtNegLook: + return n.reduceLookaround() + case NtSet, NtSetloop, NtSetlazy, NtSetloopatomic: + return n.reduceSet() + case NtExprCond: + return n.reduceExpressionConditional() + case NtBackRefCond: + return n.reduceBackreferenceConditional() + default: + return n + } +} + +// / Optimizations for positive and negative lookaheads/behinds. +func (n *RegexNode) reduceLookaround() *RegexNode { + // A lookaround is a zero-width atomic assertion. + // As it's atomic, nothing will backtrack into it, and we can + // eliminate any ending backtracking from it. + n.eliminateEndingBacktracking() + + // A positive lookaround wrapped around an empty is a nop, and we can reduce it + // to simply Empty. A developer typically doesn't write this, but rather it evolves + // due to optimizations resulting in empty. + + // A negative lookaround wrapped around an empty child, i.e. (?!), is + // sometimes used as a way to insert a guaranteed no-match into the expression, + // often as part of a conditional. We can reduce it to simply Nothing. + + if n.Children[0].T == NtEmpty { + if n.T == NtPosLook { + n.T = NtEmpty + } else { + n.T = NtNothing + } + n.Children = nil + } + + return n +} + +// Optimizations for backreference conditionals. +func (n *RegexNode) reduceBackreferenceConditional() *RegexNode { + // This isn't so much an optimization as it is changing the tree for consistency. We want + // all engines to be able to trust that every backreference conditional will have two children, + // even though it's optional in the syntax. If it's missing a "not matched" branch, + // we add one that will match empty. + if len(n.Children) == 1 { + n.addChild(&RegexNode{T: NtEmpty, Options: n.Options}) + } + + return n +} + +// / Optimizations for expression conditionals. +func (n *RegexNode) reduceExpressionConditional() *RegexNode { + // This isn't so much an optimization as it is changing the tree for consistency. We want + // all engines to be able to trust that every expression conditional will have three children, + // even though it's optional in the syntax. If it's missing a "not matched" branch, + // we add one that will match empty. + if len(n.Children) == 2 { + n.addChild(&RegexNode{T: NtEmpty, Options: n.Options}) + } + + // It's common for the condition to be an explicit positive lookahead, as specifying + // that eliminates any ambiguity in syntax as to whether the expression is to be matched + // as an expression or to be a reference to a capture group. After parsing, however, + // there's no ambiguity, and we can remove an extra level of positive lookahead, as the + // engines need to treat the condition as a zero-width positive, atomic assertion regardless. + condition := n.Children[0] + if condition.T == NtPosLook && (condition.Options&RightToLeft) == 0 { + n.ReplaceChild(0, condition.Children[0]) + } + + // We can also eliminate any ending backtracking in the condition, as the condition + // is considered to be a positive lookahead, which is an atomic zero-width assertion. + condition = n.Children[0] + condition.eliminateEndingBacktracking() + + return n +} + +// Remove unnecessary atomic nodes, and make appropriate descendents of the atomic node themselves atomic. +// e.g. (?>(?>(?>a*))) => (?>a*) +// e.g. (?>(abc*)*) => (?>(abc(?>c*))*) +func (n *RegexNode) reduceAtomic() *RegexNode { + atomic := n + child := n.Children[0] + for child.T == NtAtomic { + atomic = child + child = atomic.Children[0] + } + + switch child.T { + // If the child is empty/nothing, there's nothing to be made atomic so the Atomic + // node can simply be removed. + case NtEmpty, NtNothing: + return child + + // If the child is already atomic, we can just remove the atomic node. + case NtOneloopatomic, NtNotoneloopatomic, NtSetloopatomic: + return child + + // If an atomic subexpression contains only a {one/notone/set}{loop/lazy}, + // change it to be an {one/notone/set}loopatomic and remove the atomic node. + case NtOneloop, NtNotoneloop, NtSetloop, NtOnelazy, NtNotonelazy, NtSetlazy: + child.makeLoopAtomic() + return child + + // Alternations have a variety of possible optimizations that can be applied + // iff they're atomic. + case NtAlternate: + if (n.Options & RightToLeft) == 0 { + branches := child.Children + + // If an alternation is atomic and its first branch is Empty, the whole thing + // is a nop, as Empty will match everything trivially, and no backtracking + // into the node will be performed, making the remaining branches irrelevant. + if branches[0].T == NtEmpty { + return &RegexNode{T: NtEmpty, Options: child.Options} + } + + // Similarly, we can trim off any branches after an Empty, as they'll never be used. + // An Empty will match anything, and thus branches after that would only be used + // if we backtracked into it and advanced passed the Empty after trying the Empty... + // but if the alternation is atomic, such backtracking won't happen. + for i := 1; i < len(branches)-1; i++ { + if branches[i].T == NtEmpty { + branches = slices.Delete(branches, i+1, len(branches)) + break + } + } + + // If an alternation is atomic, we won't ever backtrack back into it, which + // means order matters but not repetition. With backtracking, it would be incorrect + // to convert an expression like "hi|there|hello" into "hi|hello|there", as doing + // so could then change the order of results if we matched "hi" and then failed + // based on what came after it, and both "hello" and "there" could be successful + // with what came later. But without backtracking, we can reorder "hi|there|hello" + // to instead be "hi|hello|there", as "hello" and "there" can't match the same text, + // and once this atomic alternation has matched, we won't try another branch. This + // reordering is valuable as it then enables further optimizations, e.g. + // "hi|there|hello" => "hi|hello|there" => "h(?:i|ello)|there", which means we only + // need to check the 'h' once in case it's not an 'h', and it's easier to employ different + // code gen that, for example, switches on first character of the branches, enabling faster + // choice of branch without always having to walk through each. + reordered := false + for start := 0; start < len(branches); start++ { + // Get the node that may start our range. If it's a one, multi, or concat of those, proceed. + startNode := branches[start] + if startNode.findBranchOneOrMultiStart() == nil { + continue + } + + // Find the contiguous range of nodes from this point that are similarly one, multi, or concat of those. + endExclusive := start + 1 + for endExclusive < len(branches) && branches[endExclusive].findBranchOneOrMultiStart() != nil { + endExclusive++ + } + + // If there's at least 3, there may be something to reorder (we won't reorder anything + // before the starting position, and so only 2 items is considered ordered). + if endExclusive-start >= 3 { + compare := start + for compare < endExclusive { + // Get the starting character + c := branches[compare].findBranchOneOrMultiStart().FirstCharOfOneOrMulti() + + // Move compare to point to the last branch that has the same starting value. + for compare < endExclusive && branches[compare].findBranchOneOrMultiStart().FirstCharOfOneOrMulti() == c { + compare++ + } + + // Compare now points to the first node that doesn't match the starting node. + // If we've walked off our range, there's nothing left to reorder. + if compare < endExclusive { + // There may be something to reorder. See if there are any other nodes that begin with the same character. + for next := compare + 1; next < endExclusive; next++ { + nextChild := branches[next] + if nextChild.findBranchOneOrMultiStart().FirstCharOfOneOrMulti() == c { + branches = slices.Delete(branches, next, next+1) + branches = slices.Insert(branches, compare, nextChild) + compare++ + reordered = true + } + } + } + } + } + + // Move to the end of the range we've now explored. endExclusive is not a viable + // starting position either, and the start++ for the loop will thus take us to + // the next potential place to start a range. + start = endExclusive + } + child.Children = branches + // If anything was reordered, there may be new optimization opportunities inside + // of the alternation, so reduce it again. + if reordered { + atomic.ReplaceChild(0, child) + child = atomic.Children[0] + } + } + fallthrough + + // For everything else, try to reduce ending backtracking of the last contained expression. + default: + child.eliminateEndingBacktracking() + if child.T == NtAlternate && child.hasDisjointStartingSets() && child.hasOnlyIntrinsicallyAtomicBranches() { + return child + } + return atomic + } +} + +// hasDisjointStartingSets reports whether every branch is non-nullable and +// begins with a character set that cannot overlap any other branch. In that +// case, once one branch has matched, no sibling branch could match the same +// starting position. +func (n *RegexNode) hasDisjointStartingSets() bool { + _, ok := n.disjointStartingSets() + return ok +} + +// disjointStartingSets returns the non-nullable first-character set for each +// branch when all of those sets are pairwise disjoint. +func (n *RegexNode) disjointStartingSets() ([]*CharSet, bool) { + sets := make([]*CharSet, 0, len(n.Children)) + for _, branch := range n.Children { + var set *CharSet + if tryFindFirstCharClass(branch, &set) != 1 || set == nil { + return nil, false + } + for _, previous := range sets { + if set.MayOverlap(previous) { + return nil, false + } + } + sets = append(sets, set) + } + return sets, true +} + +// disjointAtomicBranchSets returns the first-character sets when an +// alternation can select a branch without leaving a backtracking choice. +func (n *RegexNode) disjointAtomicBranchSets() ([]*CharSet, bool) { + if n.T != NtAlternate || !n.hasOnlyIntrinsicallyAtomicBranches() { + return nil, false + } + return n.disjointStartingSets() +} + +// dispatchCandidates returns disjoint branch sets and the leading nodes that +// can be folded into a consuming Dispatch instruction. +func (n *RegexNode) dispatchCandidates() ([]*CharSet, []*RegexNode, []bool, bool) { + if len(n.Children) >= 1<<16 { + return nil, nil, nil, false + } + sets, ok := n.disjointAtomicBranchSets() + if !ok { + return nil, nil, nil, false + } + + leaders := make([]*RegexNode, len(n.Children)) + complete := make([]bool, len(n.Children)) + for i := range leaders { + branch := n.Children[i] + leader := branch + if leader.T == NtConcatenate && len(leader.Children) > 0 { + leader = leader.Children[0] + } + switch leader.T { + case NtOne, NtNotone, NtSet, NtMulti: + leaders[i] = leader + default: + return nil, nil, nil, false + } + complete[i] = leader == branch && (leader.T != NtMulti || len(leader.Str) == 1) + } + return sets, leaders, complete, true +} + +func (n *RegexNode) hasOnlyIntrinsicallyAtomicBranches() bool { + for _, branch := range n.Children { + if !branch.isIntrinsicallyAtomic() { + return false + } + } + return true +} + +// isIntrinsicallyAtomic reports whether a successful match of this node has no +// alternative input-consuming path to explore if something later fails. +func (n *RegexNode) isIntrinsicallyAtomic() bool { + switch n.T { + case NtOne, NtNotone, NtSet, NtMulti, NtRef, NtGrapheme, + NtBol, NtEol, NtBoundary, NtNonboundary, NtECMABoundary, NtNonECMABoundary, + NtBeginning, NtStart, NtEndZ, NtEnd, NtNothing, NtEmpty, NtUpdateBumpalong, NtResetCapture, + NtOneloopatomic, NtNotoneloopatomic, NtSetloopatomic, + NtPosLook, NtNegLook, NtAtomic: + return true + + case NtOneloop, NtNotoneloop, NtSetloop, NtOnelazy, NtNotonelazy, NtSetlazy: + return n.M == n.N + + case NtCapture, NtGroup: + return len(n.Children) == 1 && n.Children[0].isIntrinsicallyAtomic() + + case NtConcatenate: + for _, child := range n.Children { + if !child.isIntrinsicallyAtomic() { + return false + } + } + return true + } + return false +} + +func (n *RegexNode) makeLoopAtomic() { + + switch n.T { + case NtOneloop, NtNotoneloop, NtSetloop: + // For loops, we simply change the Type to the atomic variant. + // Atomic greedy loops should consume as many values as they can. + n.T += NtOneloopatomic - NtOneloop + + case NtOnelazy, NtNotonelazy, NtSetlazy: + // For lazy, we not only change the Type, we also lower the max number of iterations + // to the minimum number of iterations, creating a repeater, as they should end up + // matching as little as possible. + n.T += NtOneloopatomic - NtOnelazy + n.N = n.M + if n.N == 0 { + // If moving the max to be the same as the min dropped it to 0, there's no + // work to be done for this node, and we can make it Empty. + n.T = NtEmpty + n.Str = nil + n.Ch = 0x0 + } else if n.T == NtOneloopatomic && n.N >= 2 && n.N <= MultiVsRepeaterLimit { + // If this is now a One repeater with a small enough length, + // make it a Multi instead, as they're better optimized down the line. + n.T = NtMulti + n.Str = []rune(strings.Repeat(string(n.Ch), n.N)) + n.Ch = 0x0 + n.M = 0 + n.N = 0 + } + } +} + +// Converts nodes at the end of the node tree to be atomic. +// The correctness of this optimization depends on nothing being able to backtrack into +// the provided node. That means it must be at the root of the overall expression, or +// it must be an Atomic node that nothing will backtrack into by the very nature of Atomic. +func (n *RegexNode) eliminateEndingBacktracking() { + // Walk the tree starting from the current node. + node := n + for { + switch node.T { + // {One/Notone/Set}loops can be upgraded to {One/Notone/Set}loopatomic nodes, e.g. [abc]* => (?>[abc]*). + // And {One/Notone/Set}lazys can similarly be upgraded to be atomic, which really makes them into repeaters + // or even empty nodes. + case NtOneloop, NtNotoneloop, NtSetloop, NtOnelazy, NtNotonelazy, NtSetlazy: + node.makeLoopAtomic() + + // Just because a particular node is atomic doesn't mean all its descendants are. + // Process them as well. Lookarounds are implicitly atomic. + case NtAtomic, NtPosLook, NtNegLook: + node = node.Children[0] + continue + + case NtCapture, NtConcatenate: + // For Capture and Concatenate, we just recur into their last child (only child in the case + // of Capture). However, if the child is an alternation or loop, we can also make the + // node itself atomic by wrapping it in an Atomic node. Since we later check to see whether a + // node is atomic based on its parent or grandparent, we don't bother wrapping such a node in + // an Atomic one if its grandparent is already Atomic. + // e.g. [xyz](?:abc|def) => [xyz](?>abc|def) + + // validate grandparent isn't atomic + existingChild := node.Children[len(node.Children)-1] + if (existingChild.T == NtAlternate || existingChild.T == NtBackRefCond || + existingChild.T == NtExprCond || existingChild.T == NtLoop || + existingChild.T == NtLazyloop) && + (node.Parent == nil || node.Parent.T != NtAtomic) { + + atomic := &RegexNode{T: NtAtomic, Options: existingChild.Options} + atomic.addChild(existingChild) + node.ReplaceChild(len(node.Children)-1, atomic) + } + node = existingChild + continue + + // For alternate, we can recur into each branch separately. We use this iteration for the first branch. + // Conditionals are just like alternations in this regard. + // e.g. abc*|def* => ab(?>c*)|de(?>f*) + case NtAlternate, NtBackRefCond, NtExprCond: + + branches := len(node.Children) + for i := 1; i < branches; i++ { + node.Children[i].eliminateEndingBacktracking() + } + + // ReduceExpressionConditional will have already applied ending backtracking removal + if node.T != NtExprCond { + node = node.Children[0] + continue + } + + // For {Lazy}Loop, we search to see if there's a viable last expression, and iff there + // is we recur into processing it. Also, as with the single-char lazy loops, LazyLoop + // can have its max iteration count dropped to its min iteration count, as there's no + // reason for it to match more than the minimal at the end; that in turn makes it a + // repeater, which results in better code generation. + // e.g. (?:abc*)* => (?:ab(?>c*))* + // e.g. (abc*?)+? => (ab){1} + case NtLazyloop: + node.N = node.M + fallthrough + case NtLoop: + if node.N == 1 { + // ECMAScript RepeatMatcher rejects an optional empty iteration. + // Its body must retain backtracking so a consuming alternative + // can still succeed, even when nothing follows the loop. + if node.Options&ECMAScript != 0 && node.M == 0 && node.Children[0].ComputeMinLength() == 0 { + break + } + // If the loop has a max iteration count of 1 (e.g. it's an optional node), + // there's no possibility for conflict between multiple iterations, so + // we can process it. + node = node.Children[0] + continue + } + + loopDescendent := node.FindLastExpressionInLoopForAutoAtomic() + if loopDescendent != nil { + node = loopDescendent + continue // loop around to process node + } + + } + + break + } +} + +// Recurs into the last expression of a loop node, looking to see if it can find a node +// that could be made atomic _assuming_ the conditions exist for it with the loop's ancestors. +// Returns The found node that should be explored further for auto-atomicity; null if it doesn't exist. +func (n *RegexNode) FindLastExpressionInLoopForAutoAtomic() *RegexNode { + node := n + + // Start by looking at the loop's sole child. + node = node.Children[0] + + // Skip past captures. + for node.T == NtCapture { + node = node.Children[0] + } + + // If the loop's body is a concatenate, we can skip to its last child iff that + // last child doesn't conflict with the first child, since this whole concatenation + // could be repeated, such that the first node ends up following the last. For + // example, in the expression (a+[def])*, the last child is [def] and the first is + // a+, which can't possibly overlap with [def]. In contrast, if we had (a+[ade])*, + // [ade] could potentially match the starting 'a'. + if node.T == NtConcatenate { + concatCount := len(node.Children) + lastConcatChild := node.Children[concatCount-1] + if lastConcatChild.canBeMadeAtomic(node.Children[0], false, false) { + return lastConcatChild + } + } + + // Otherwise, the loop has nothing that can participate in auto-atomicity. + return nil +} + +// containsLineBreak reports whether the set holds a character that $ can match +// before in Multiline mode (see IsLineBreak). +func (c *CharSet) containsLineBreak(options RegexOptions) bool { + if options&ECMAScript == 0 { + return c.CharIn('\n') + } + return c.CharIn('\n') || c.CharIn('\r') || c.CharIn('\u2028') || c.CharIn('\u2029') +} + +// Determines whether a node can be switched to an atomic loop. +// +// The node following is subsequent, used to determine whether it overlaps. +// iterateNullableSubsequent is whether to allow examining nodes beyond subsequent. +// allowLazy is whether lazy loops in addition to greedy loops should be considered for atomicity. +func (n *RegexNode) canBeMadeAtomic(subsequent *RegexNode, iterateNullableSubsequent, allowLazy bool) bool { + // In most case, we'll simply check the node against whatever subsequent is. However, in case + // subsequent ends up being a loop with a min bound of 0, we'll also need to evaluate the node + // against whatever comes after subsequent. In that case, we'll walk the tree to find the + // next subsequent, and we'll loop around against to perform the comparison again. + for { + // Skip the successor down to the closest node that's guaranteed to follow it. + childCount := len(subsequent.Children) + for ; childCount > 0; childCount = len(subsequent.Children) { + if subsequent.T == NtConcatenate || subsequent.T == NtCapture || + subsequent.T == NtAtomic || + (subsequent.T == NtPosLook && subsequent.Options&RightToLeft == 0) || + ((subsequent.T == NtLoop || subsequent.T == NtLazyloop) && subsequent.M > 0) { + subsequent = subsequent.Children[0] + continue + } + + break + } + + // If the current node's options don't match the subsequent node, then we cannot make it atomic. + // This applies to RightToLeft for lookbehinds, as well as patterns that enable/disable global flags in the middle of the pattern. + // reduce keeps IgnoreCase only on an ECMAScript \b or \B that also has Unicode, to choose its word characters; the + // boundary checks below hold for either set of word characters, so leave it out of the comparison. + subsequentOptions := subsequent.Options + if subsequent.T == NtECMABoundary || subsequent.T == NtNonECMABoundary { + subsequentOptions &^= IgnoreCase + } + if n.Options != subsequentOptions { + return false + } + + // The Multi and end anchor checks below assume left-to-right matching. + if n.Options&RightToLeft != 0 && + (subsequent.T == NtMulti || subsequent.T == NtEnd || subsequent.T == NtEndZ || subsequent.T == NtEol) { + return false + } + + // If the successor is an alternation, all of its children need to be evaluated, since any of them + // could come after this node. If any of them fail the optimization, then the whole node fails. + // This applies to expression conditionals as well, as long as they have both a yes and a no branch (if there's + // only a yes branch, we'd need to also check whatever comes after the conditional). It doesn't apply to + // backreference conditionals, as the condition itself is unknown statically and could overlap with the + // loop being considered for atomicity. + if subsequent.T == NtAlternate || (subsequent.T == NtExprCond && childCount == 3) { + // condition, yes, and no branch + for i := 0; i < childCount; i++ { + if !n.canBeMadeAtomic(subsequent.Children[i], iterateNullableSubsequent, false) { + return false + } + } + return true + } + + // If this node is a {one/notone/set}loop, see if it overlaps with its successor in the concatenation. + // If it doesn't, then we can upgrade it to being a {one/notone/set}loopatomic. + // Doing so avoids unnecessary backtracking. + if n.T == NtOneloop || (n.T == NtOnelazy && allowLazy) { + + if (subsequent.T == NtOne && n.Ch != subsequent.Ch) || + (subsequent.T == NtNotone && n.Ch == subsequent.Ch) || + (subsequent.T == NtSet && !subsequent.Set.CharIn(n.Ch)) || + (subsequent.IsOneFamily() && subsequent.M > 0 && n.Ch != subsequent.Ch) || + (subsequent.IsNotoneFamily() && subsequent.M > 0 && n.Ch == subsequent.Ch) || + (subsequent.IsSetFamily() && subsequent.M > 0 && !subsequent.Set.CharIn(n.Ch)) || + (subsequent.T == NtMulti && n.Ch != subsequent.Str[0]) || + (subsequent.T == NtEnd) || + (subsequent.T == NtEndZ && n.Ch != '\n') || + (subsequent.T == NtEol && !IsLineBreak(n.Options, n.Ch)) { + return true + } + + // The loop can be made atomic based on this subsequent node, but we'll need to evaluate the next one as well. + // A \b after a loop of word characters fails at every position backtracking would give back. There is no such + // rule for \B: it holds at each of those positions, between two of the loop's characters. + if (subsequent.IsOneloopFamily() && subsequent.M == 0 && n.Ch != subsequent.Ch) || + (subsequent.IsNotoneloopFamily() && subsequent.M == 0 && n.Ch == subsequent.Ch) || + (subsequent.IsSetloopFamily() && subsequent.M == 0 && !subsequent.Set.CharIn(n.Ch)) || + (subsequent.T == NtBoundary && n.M > 0 && IsWordChar(n.Ch)) || + (subsequent.T == NtECMABoundary && n.M > 0 && IsECMAWordCharWithOptions(subsequent.Options, n.Ch)) { + goto end + } + + return false + + } else if n.T == NtNotoneloop || (n.T == NtNotonelazy && allowLazy) { + if (subsequent.T == NtOne && n.Ch == subsequent.Ch) || + (subsequent.IsOneFamily() && subsequent.M > 0 && n.Ch == subsequent.Ch) || + (subsequent.T == NtMulti && n.Ch == subsequent.Str[0]) || + (subsequent.T == NtEnd) { + return true + } + + // The loop can be made atomic based on this subsequent node, but we'll need to evaluate the next one as well. + if subsequent.IsOneloopFamily() && subsequent.M == 0 && n.Ch == subsequent.Ch { + goto end + } + + return false + } else if n.T == NtSetloop || (n.T == NtSetlazy && allowLazy) { + if (subsequent.T == NtOne && !n.Set.CharIn(subsequent.Ch)) || + (subsequent.T == NtSet && !n.Set.MayOverlap(subsequent.Set)) || + (subsequent.IsOneloopFamily() && subsequent.M > 0 && !n.Set.CharIn(subsequent.Ch)) || + (subsequent.IsSetloopFamily() && subsequent.M > 0 && !n.Set.MayOverlap(subsequent.Set)) || + (subsequent.T == NtMulti && !n.Set.CharIn(subsequent.Str[0])) || + (subsequent.T == NtEnd) || + (subsequent.T == NtEndZ && !n.Set.CharIn('\n')) || + (subsequent.T == NtEol && !n.Set.containsLineBreak(n.Options)) { + return true + } + + if (subsequent.IsOneloopFamily() && subsequent.M == 0 && !n.Set.CharIn(subsequent.Ch)) || + (subsequent.IsSetloopFamily() && subsequent.M == 0 && !subsequent.Set.MayOverlap(n.Set)) || + (subsequent.T == NtBoundary && n.M > 0 && (n.Set.Equals(WordClass()) || n.Set.Equals(DigitClass()))) || + (subsequent.T == NtECMABoundary && n.M > 0 && (n.Set.Equals(ECMAWordClass()) || n.Set.Equals(ECMADigitClass()))) { + // The loop can be made atomic based on this subsequent node, but we'll need to evaluate the next one as well. + goto end + } + return false + } else { + return false + } + + end: + // We only get here if the node could be made atomic based on subsequent but subsequent has a lower bound of zero + // and thus we need to move subsequent to be the next node in sequence and loop around to try again. + if !iterateNullableSubsequent { + return false + } + + // To be conservative, we only walk up through a very limited set of constructs (even though we may have walked + // down through more, like loops), looking for the next concatenation that we're not at the end of, at + // which point subsequent becomes whatever node is next in that concatenation. + for { + parent := subsequent.Parent + if parent == nil { + // If we hit the root, we're at the end of the expression, at which point nothing could backtrack + // in and we can declare success. + return true + } + + switch parent.T { + case NtAtomic, NtAlternate, NtCapture: + subsequent = parent + continue + + case NtConcatenate: + peers := parent.Children + currentIndex := slices.Index(peers, subsequent) + + if currentIndex+1 == len(peers) { + subsequent = parent + continue + } else { + subsequent = peers[currentIndex+1] + } + + default: + // Anything else, we don't know what to do, so we have to assume it could conflict with the loop. + return false + } + + break + } + } +} + +// Basic optimization. Single-letter alternations can be replaced +// by faster set specifications, and nested alternations with no +// intervening operators can be flattened: +// +// a|b|c|def|g|h -> [a-c]|def|[gh] +// apple|(?:orange|pear)|grape -> apple|orange|pear|grape +func (n *RegexNode) reduceAlternation() *RegexNode { + if len(n.Children) == 0 { + return newRegexNode(NtNothing, n.Options) + } + if len(n.Children) == 1 { + return n.Children[0] + } + n.reduceSingleLetterAndNestedAlternations() + + node := n.replaceNodeIfUnnecessary() + if node.T == NtAlternate { + node = node.extractCommonPrefixText() + if node.T == NtAlternate { + node = node.extractCommonPrefixOneNotoneSet() + if node.T == NtAlternate { + node = node.removeRedundantEmptiesAndNothings() + } + } + } + return node +} + +// Analyzes all the branches of the alternation for text that's identical at the beginning +// of every branch. That text is then pulled out into its own one or multi node in a +// concatenation with the alternation (whose branches are updated to remove that prefix). +// This is valuable for a few reasons. One, it exposes potentially more text to the +// expression prefix analyzer used to influence FindFirstChar. Second, it exposes more +// potential alternation optimizations, e.g. if the same prefix is followed in two branches +// by sets that can be merged. Third, it reduces the amount of duplicated comparisons required +// if we end up backtracking into subsequent branches. +// e.g. abc|ade => a(?bc|de) +func (n *RegexNode) extractCommonPrefixText() *RegexNode { + // To keep things relatively simple, we currently only handle: + // - Left to right (e.g. we don't process alternations in lookbehinds) + // - Branches that are one or multi nodes, or that are concatenations beginning with one or multi nodes. + // - All branches having the same options. + + // Only extract left-to-right prefixes. + if (n.Options & RightToLeft) != 0 { + return n + } + + for startingIndex := 0; startingIndex < len(n.Children)-1; startingIndex++ { + // Process the first branch to get the maximum possible common string. + startingNode := n.Children[startingIndex].findBranchOneOrMultiStart() + if startingNode == nil { + return n + } + + startingNodeOptions := startingNode.Options + startingSpan := startingNode.Str + if startingNode.T == NtOne { + startingSpan = []rune{startingNode.Ch} + } + + // Now compare the rest of the branches against it. + endingIndex := startingIndex + 1 + for ; endingIndex < len(n.Children); endingIndex++ { + // Get the starting node of the next branch. + startingNode = n.Children[endingIndex].findBranchOneOrMultiStart() + if startingNode == nil || startingNode.Options != startingNodeOptions { + break + } + + // See if the new branch's prefix has a shared prefix with the current one. + // If it does, shorten to that; if it doesn't, bail. + if startingNode.T == NtOne { + if startingSpan[0] != startingNode.Ch { + break + } + + if len(startingSpan) != 1 { + startingSpan = startingSpan[0:1] + } + } else { + minLength := len(startingSpan) + if len(startingNode.Str) < minLength { + minLength = len(startingNode.Str) + } + c := 0 + for c < minLength && startingSpan[c] == startingNode.Str[c] { + c++ + } + + if c == 0 { + break + } + + startingSpan = startingSpan[0:c] + } + } + + // When we get here, we have a starting string prefix shared by all branches + // in the range [startingIndex, endingIndex). + if endingIndex-startingIndex <= 1 { + // There's nothing to consolidate for this starting node. + continue + } + + // We should be able to consolidate something for the nodes in the range [startingIndex, endingIndex). + + // Create a new node of the form: + // Concatenation(prefix, Alternation(each | node | with | prefix | removed)) + // that replaces all these branches in this alternation. + var prefix *RegexNode + if len(startingSpan) == 1 { + prefix = &RegexNode{T: NtOne, Options: startingNodeOptions, Ch: startingSpan[0]} + } else { + prefix = &RegexNode{T: NtMulti, Options: startingNodeOptions, Str: slices.Clone(startingSpan)} + } + + newAlternate := &RegexNode{T: NtAlternate, Options: startingNodeOptions} + for i := startingIndex; i < endingIndex; i++ { + branch := n.Children[i] + if branch.T == NtConcatenate { + branch.Children[0].processOneOrMulti(startingSpan) + } else { + branch.processOneOrMulti(startingSpan) + } + branch = branch.reduce() + newAlternate.addChild(branch) + } + + if n.Parent != nil && n.Parent.T == NtAtomic { + var atomic = &RegexNode{T: NtAtomic, Options: startingNodeOptions} + atomic.addChild(newAlternate) + newAlternate = atomic + } + + newConcat := &RegexNode{T: NtConcatenate, Options: startingNodeOptions} + newConcat.addChild(prefix) + newConcat.addChild(newAlternate) + n.ReplaceChild(startingIndex, newConcat) + n.Children = slices.Delete(n.Children, startingIndex+1, endingIndex) + } + + if len(n.Children) == 1 { + return n.Children[0] + } + + return n +} + +// This function optimizes out prefix nodes from alternation branches that are +// the same across multiple contiguous branches. +// e.g. \w12|\d34|\d56|\w78|\w90 => \w12|\d(?:34|56)|\w(?:78|90) +func (n *RegexNode) extractCommonPrefixOneNotoneSet() *RegexNode { + // Only process left-to-right prefixes. + if (n.Options & RightToLeft) != 0 { + return n + } + + // Only handle the case where each branch is a concatenation + for _, child := range n.Children { + if child.T != NtConcatenate || len(child.Children) < 2 { + return n + } + } + + for startingIndex := 0; startingIndex < len(n.Children)-1; startingIndex++ { + // Only handle the case where each branch begins with the same One, Notone, or Set (individual or loop). + // Note that while we can do this for individual characters, fixed length loops, and atomic loops, doing + // it for non-atomic variable length loops could change behavior as each branch could otherwise have a + // different number of characters consumed by the loop based on what's after it. + required := n.Children[startingIndex].Children[0] + + if (!required.IsOneFamily() && !required.IsNotoneFamily() && !required.IsSetFamily()) || + required.M != required.N { + // skip if it's not one of these scenarios + continue + } + + // Only handle the case where each branch begins with the exact same node value + endingIndex := startingIndex + 1 + for ; endingIndex < len(n.Children); endingIndex++ { + other := n.Children[endingIndex].Children[0] + if required.T != other.T || + required.Options != other.Options || + required.M != other.M || + required.N != other.N || + required.Ch != other.Ch || + !slices.Equal(required.Str, other.Str) || + !required.Set.Equals(other.Set) { + break + } + } + + if endingIndex-startingIndex <= 1 { + // Nothing to extract from this starting index. + continue + } + + // Remove the prefix node from every branch, adding it to a new alternation + newAlternate := &RegexNode{T: NtAlternate, Options: n.Options} + for i := startingIndex; i < endingIndex; i++ { + n.Children[i].Children = slices.Delete(n.Children[i].Children, 0, 1) + newAlternate.addChild(n.Children[i]) + } + + // If this alternation is wrapped as atomic, we need to do the same for the new alternation. + if n.Parent != nil && n.Parent.T == NtAtomic { + atomic := &RegexNode{T: NtAtomic, Options: n.Options} + atomic.addChild(newAlternate) + newAlternate = atomic + } + + // Now create a concatenation of the prefix node with the new alternation for the combined + // branches, and replace all of the branches in this alternation with that new concatenation. + newConcat := &RegexNode{T: NtConcatenate, Options: n.Options} + newConcat.addChild(required) + newConcat.addChild(newAlternate) + n.ReplaceChild(startingIndex, newConcat) + n.Children = slices.Delete(n.Children, startingIndex+1, endingIndex) + } + + return n.replaceNodeIfUnnecessary() +} + +// Removes unnecessary Empty and Nothing nodes from the alternation. A Nothing will never +// match, so it can be removed entirely, and an Empty can be removed if there's a previous +// Empty in the alternation: it's an extreme case of just having a repeated branch in an +// alternation, and while we don't check for all duplicates, checking for empty is easy. +func (n *RegexNode) removeRedundantEmptiesAndNothings() *RegexNode { + children := n.Children + + i, j := 0, 0 + seenEmpty := false + for i < len(children) { + child := children[i] + if child.T == NtNothing || (child.T == NtEmpty && seenEmpty) { + i++ + continue + } + if child.T == NtEmpty { + seenEmpty = true + } + children[j] = children[i] + i++ + j++ + } + + n.Children = slices.Delete(children, j, len(children)) + return n.replaceNodeIfUnnecessary() +} + +// Remove the starting text from the one or multi node. This may end up changing +// the type of the node to be Empty if the starting text matches the node's full value. +func (n *RegexNode) processOneOrMulti(startingSpan []rune) { + if n.T == NtOne { + n.T = NtEmpty + n.Ch = 0x0 + } else { + if len(n.Str) == len(startingSpan) { + n.T = NtEmpty + n.Str = nil + } else if len(n.Str)-1 == len(startingSpan) { + n.T = NtOne + n.Ch = n.Str[len(n.Str)-1] + n.Str = nil + } else { + n.Str = n.Str[len(startingSpan):] + } + } +} + +// Finds the starting one or multi of the branch, if it has one; otherwise, returns null. +// For simplicity, this only considers branches that are One or Multi, or a Concatenation +// beginning with a One or Multi. We don't traverse more than one level to avoid the +// complication of then having to later update that hierarchy when removing the prefix, +// but it could be done in the future if proven beneficial enough. +func (n *RegexNode) findBranchOneOrMultiStart() *RegexNode { + branch := n + if n.T == NtConcatenate { + branch = n.Children[0] + } + if branch.T == NtOne || branch.T == NtMulti { + return branch + } + return nil +} + +func (n *RegexNode) reduceSingleLetterAndNestedAlternations() { + + wasLastSet := false + lastNodeCannotMerge := false + var optionsLast RegexOptions + var i, j int + + for i, j = 0, 0; i < len(n.Children); i, j = i+1, j+1 { + at := n.Children[i] + + if j < i { + n.Children[j] = at + } + + for { + if at.T == NtAlternate { + n.insertChildren(i+1, at.Children) + j-- + } else if at.T == NtSet || at.T == NtOne { + // Cannot merge sets if L or I options differ, or if either are negated. + optionsAt := at.Options & (RightToLeft | IgnoreCase) + + if at.T == NtSet { + if !wasLastSet || optionsLast != optionsAt || lastNodeCannotMerge || !at.Set.IsMergeable() { + wasLastSet = true + lastNodeCannotMerge = !at.Set.IsMergeable() + optionsLast = optionsAt + break + } + } else if !wasLastSet || optionsLast != optionsAt || lastNodeCannotMerge { + wasLastSet = true + lastNodeCannotMerge = false + optionsLast = optionsAt + break + } + + // The last node was a Set or a One, we're a Set or One and our options are the same. + // Merge the two nodes. + j-- + prev := n.Children[j] + + var prevCharClass *CharSet + if prev.T == NtOne { + prevCharClass = &CharSet{} + prevCharClass.addChar(prev.Ch) + } else { + prevCharClass = prev.Set + } + + if at.T == NtOne { + prevCharClass.addChar(at.Ch) + } else { + prevCharClass.addSet(*at.Set) + } + + prev.T = NtSet + prev.Set = prevCharClass + if prev.Options&IgnoreCase != 0 { + prev.Options &= ^IgnoreCase + } + } else if at.T == NtNothing { + j-- + } else { + wasLastSet = false + lastNodeCannotMerge = false + } + break + } + } + + if j < i { + n.removeChildren(j, i) + } +} + +func (n *RegexNode) reduceConcatenation() *RegexNode { + // Eliminate empties and concat adjacent strings/chars + + if len(n.Children) == 0 { + return newRegexNode(NtEmpty, n.Options) + } + // remove concat + if len(n.Children) == 1 { + return n.Children[0] + } + + // If any node in the concatenation is a Nothing, the concatenation itself is a Nothing. + for i := 0; i < len(n.Children); i++ { + child := n.Children[i] + if child.T == NtNothing { + return child + } + } + + // Coalesce adjacent loops. This helps to minimize work done by the interpreter, minimize code gen, + // and also help to reduce catastrophic backtracking. + n.reduceConcatenationWithAdjacentLoops() + + // Coalesce adjacent characters/strings. This is done after the adjacent loop coalescing so that + // a One adjacent to both a Multi and a Loop prefers being folded into the Loop rather than into + // the Multi. Doing so helps with auto-atomicity when it's later applied. + n.reduceConcatenationWithAdjacentStrings() + + // If the concatenation is now empty, return an empty node, or if it's got a single child, return that child. + // Otherwise, return this. + return n.replaceNodeIfUnnecessary() +} + +func addMinLength(x, y int) int { + const maxMinLength = math.MaxInt32 - 1 + if x >= maxMinLength || y >= maxMinLength || x > maxMinLength-y { + return maxMinLength + } + return x + y +} + +func multiplyMinLength(x, y int) int { + const maxMinLength = math.MaxInt32 - 1 + if x == 0 || y == 0 { + return 0 + } + if x >= maxMinLength || y >= maxMinLength || x > maxMinLength/y { + return maxMinLength + } + return x * y +} + +func addMaxLength(x, y int) int { + if x < 0 || y < 0 || x >= math.MaxInt32 || y >= math.MaxInt32 || x > (math.MaxInt32-1)-y { + return -1 + } + return x + y +} + +func multiplyMaxLength(x, y int) int { + if x < 0 || y < 0 { + return -1 + } + if x == 0 || y == 0 { + return 0 + } + if x >= math.MaxInt32 || y >= math.MaxInt32 || x > (math.MaxInt32-1)/y { + return -1 + } + return x * y +} + +func maxLessThanTwiceMin(max, min int) bool { + if min <= math.MaxInt32/2 { + return max < min*2 + } + return max != math.MaxInt32 +} + +func canCombineCounts(nodeMin, nodeMax, nextMin, nextMax int) bool { + // We shouldn't have an infinite minimum; bail if we find one. Also check for the + // degenerate case where we'd make the min overflow or go infinite when it wasn't already. + if nodeMin == math.MaxInt32 || + nextMin == math.MaxInt32 || + addMaxLength(nodeMin, nextMin) < 0 { + return false + } + + // Similar overflow / go infinite check for max (which can be infinite). + if nodeMax != math.MaxInt32 && + nextMax != math.MaxInt32 && + addMaxLength(nodeMax, nextMax) < 0 { + return false + } + + return true +} + +// Combine adjacent loops. +// e.g. a*a*a* => a* +// e.g. a+ab => a{2,}b +func (n *RegexNode) reduceConcatenationWithAdjacentLoops() { + current, next, nextSave := 0, 1, 1 + + for next < len(n.Children) { + currentNode := n.Children[current] + nextNode := n.Children[next] + + if currentNode.Options == nextNode.Options { + // Coalescing a loop with its same type + if ((currentNode.IsOneloopFamily() || currentNode.IsNotoneloopFamily()) && nextNode.T == currentNode.T && currentNode.Ch == nextNode.Ch) || + (currentNode.IsSetloopFamily() && currentNode.T == nextNode.T && currentNode.Set.Equals(nextNode.Set)) { + if nextNode.M > 0 && currentNode.IsAtomicloopFamily() { + // Atomic loops can only be combined if the second loop has no lower bound, as if it has a lower bound, + // combining them changes behavior. Uncombined, the first loop can consume all matching items; + // the second loop might then not be able to meet its minimum and fail. But if they're combined, the combined + // minimum of the sole loop could now be met, introducing matches where there shouldn't have been any. + goto End + } + + if !canCombineCounts(currentNode.M, currentNode.N, nextNode.M, nextNode.N) { + goto End + } + currentNode.M += nextNode.M + if currentNode.N != math.MaxInt32 { + if nextNode.N == math.MaxInt32 { + currentNode.N = math.MaxInt32 + } else { + currentNode.N += nextNode.N + } + } + next++ + continue + + } else if ((currentNode.T == NtOneloop || currentNode.T == NtOnelazy) && nextNode.T == NtOne && currentNode.Ch == nextNode.Ch) || + ((currentNode.T == NtNotoneloop || currentNode.T == NtNotonelazy) && nextNode.T == NtNotone && currentNode.Ch == nextNode.Ch) || + ((currentNode.T == NtSetloop || currentNode.T == NtSetlazy) && nextNode.T == NtSet && currentNode.Set.Equals(nextNode.Set)) { + // Coalescing a loop with an additional item of the same type + if canCombineCounts(currentNode.M, currentNode.N, 1, 1) { + currentNode.M++ + if currentNode.N != math.MaxInt32 { + currentNode.N++ + } + next++ + continue + } + } else if (currentNode.T == NtOneloop || currentNode.T == NtOnelazy) && nextNode.T == NtMulti && + nextNode.Options&RightToLeft == 0 && // RTL multi nodes don't have their text reversed + currentNode.Ch == nextNode.Str[0] { + // Coalescing a loop with a subsequent string + // Determine how many of the multi's characters can be combined. + // We already checked for the first, so we know it's at least one. + matchingCharsInMulti := 1 + for matchingCharsInMulti < len(nextNode.Str) && currentNode.Ch == nextNode.Str[matchingCharsInMulti] { + matchingCharsInMulti++ + } + + if canCombineCounts(currentNode.M, currentNode.N, matchingCharsInMulti, matchingCharsInMulti) { + // Update the loop's bounds to include those characters from the multi + currentNode.M += matchingCharsInMulti + if currentNode.N != math.MaxInt32 { + currentNode.N += matchingCharsInMulti + } + + // If it was the full multi, skip/remove the multi and continue processing this loop. + if len(nextNode.Str) == matchingCharsInMulti { + next++ + continue + } + + // Otherwise, trim the characters from the multiple that were absorbed into the loop. + // If it now only has a single character, it becomes a One. + if len(nextNode.Str)-matchingCharsInMulti == 1 { + nextNode.T = NtOne + nextNode.Ch = nextNode.Str[len(nextNode.Str)-1] + nextNode.Str = nil + } else { + nextNode.Str = nextNode.Str[matchingCharsInMulti:] + } + } + + // NOTE: We could add support for coalescing a string with a subsequent loop, but the benefits of that + // are limited. Pulling a subsequent string's prefix back into the loop helps with making the loop atomic, + // but if the loop is after the string, pulling the suffix of the string forward into the loop may actually + // be a deoptimization as those characters could end up matching more slowly as part of loop matching. + + } else if (currentNode.T == NtOne && nextNode.IsOneloopFamily() && currentNode.Ch == nextNode.Ch) || + (currentNode.T == NtNotone && nextNode.IsNotoneloopFamily() && currentNode.Ch == nextNode.Ch) || + (currentNode.T == NtSet && nextNode.IsSetloopFamily() && currentNode.Set.Equals(nextNode.Set)) { + // Coalescing an individual item with a loop. + if canCombineCounts(1, 1, nextNode.M, nextNode.N) { + currentNode.T = nextNode.T + currentNode.M = nextNode.M + 1 + if nextNode.N == math.MaxInt32 { + currentNode.N = math.MaxInt32 + } else { + currentNode.N = nextNode.N + 1 + } + next++ + continue + } + } else if (currentNode.T == NtNotone && nextNode.T == NtNotone && currentNode.Ch == nextNode.Ch) || + (currentNode.T == NtSet && nextNode.T == NtSet && currentNode.Set.Equals(nextNode.Set)) { + // Coalescing an individual item with another individual item. + // We don't coalesce adjacent One nodes into a Oneloop as we'd rather they be joined into a Multi. + currentNode.makeRep(NtOneloop, 2, 2) + next++ + continue + } + + End: + } + + n.Children[nextSave] = n.Children[next] + nextSave++ + current = next + next++ + } + + if nextSave < len(n.Children) { + n.Children = slices.Delete(n.Children, nextSave, len(n.Children)) + } +} + +// Basic optimization. Adjacent strings can be concatenated. +// +// (?:abc)(?:def) -> abcdef +func (n *RegexNode) reduceConcatenationWithAdjacentStrings() { + var optionsLast RegexOptions + var optionsAt RegexOptions + var i, j int + + wasLastString := false + + for i, j = 0, 0; i < len(n.Children); i, j = i+1, j+1 { + var at, prev *RegexNode + + at = n.Children[i] + + if j < i { + n.Children[j] = at + } + + if at.T == NtConcatenate && + ((at.Options & RightToLeft) == (n.Options & RightToLeft)) { + for k := 0; k < len(at.Children); k++ { + at.Children[k].Parent = n + } + + //insert at.children at i+1 index in n.children + n.insertChildren(i+1, at.Children) + + j-- + } else if at.T == NtMulti || at.T == NtOne { + // Cannot merge strings if L or I options differ + optionsAt = at.Options & (RightToLeft | IgnoreCase) + + if !wasLastString || optionsLast != optionsAt { + wasLastString = true + optionsLast = optionsAt + continue + } + + j-- + prev = n.Children[j] + + if prev.T == NtOne { + prev.T = NtMulti + prev.Str = []rune{prev.Ch} + } + + if (optionsAt & RightToLeft) == 0 { + if at.T == NtOne { + prev.Str = append(prev.Str, at.Ch) + } else { + prev.Str = append(prev.Str, at.Str...) + } + } else { + if at.T == NtOne { + // insert at the front by expanding our slice, copying the data over, and then setting the value + prev.Str = append(prev.Str, 0) + copy(prev.Str[1:], prev.Str) + prev.Str[0] = at.Ch + } else { + //insert at the front...this one we'll make a new slice and copy both into it + merge := make([]rune, len(prev.Str)+len(at.Str)) + copy(merge, at.Str) + copy(merge[len(at.Str):], prev.Str) + prev.Str = merge + } + } + } else if at.T == NtEmpty { + j-- + } else { + wasLastString = false + } + } + + if j < i { + // remove indices j through i from the children + n.removeChildren(j, i) + } +} + +// Nested repeaters just get multiplied with each other if they're not +// too lumpy +func (n *RegexNode) reduceRep() *RegexNode { + // Repeating a literal empty expression has no observable effect. In addition to + // being unnecessary, retaining the loop would require one backtracking frame per + // mandatory iteration even though no input is consumed. + if len(n.Children) == 1 && n.Children[0].T == NtEmpty { + return n.Children[0] + } + + u := n + t := n.T + min := n.M + max := n.N + + for len(u.Children) > 0 { + child := u.Children[0] + + // multiply reps of the same type only + if child.T != t { + valid := false + if t == NtLoop { + switch child.T { + case NtOneloop, NtOneloopatomic, NtNotoneloop, + NtNotoneloopatomic, NtSetloop, NtSetloopatomic: + valid = true + } + } else { + switch child.T { + case NtOnelazy, NtNotonelazy, NtSetlazy: + valid = true + } + } + if !valid { + break + } + } + + // child can be too lumpy to blur, e.g., (a {100,105}) {3} or (a {2,})? + // [but things like (a {2,})+ are not too lumpy...] + if u.M == 0 && child.M > 1 || maxLessThanTwiceMin(child.N, child.M) { + break + } + + u = child + if u.M > 0 { + if (math.MaxInt32-1)/u.M < min { + u.M = math.MaxInt32 + } else { + u.M *= min + } + } + if u.N > 0 { + if (math.MaxInt32-1)/u.N < max { + u.N = math.MaxInt32 + } else { + u.N *= max + } + } + } + + if min == math.MaxInt32 { + return newRegexNode(NtNothing, n.Options) + } + + // If the Loop or Lazyloop now only has one child node and its a Set, One, or Notone, + // reduce to just Setloop/lazy, Oneloop/lazy, or Notoneloop/lazy. The parser will + // generally have only produced the latter, but other reductions could have exposed + // this. + if len(u.Children) == 1 { + child := u.Children[0] + switch child.T { + case NtOne, NtNotone, NtSet: + if u.T == NtLazyloop { + child.makeRep(NtOnelazy, u.M, u.N) + } else { + child.makeRep(NtOneloop, u.M, u.N) + } + u = child + } + } + + return u + +} + +// Simple optimization. If a concatenation or alternation has only +// one child strip out the intermediate node. If it has zero children, +// turn it into an empty. +func (n *RegexNode) replaceNodeIfUnnecessary() *RegexNode { + switch len(n.Children) { + case 0: + emptyType := NtEmpty + if n.T == NtAlternate { + emptyType = NtNothing + } + return newRegexNode(emptyType, n.Options) + case 1: + return n.Children[0] + default: + return n + } +} + +func (n *RegexNode) reduceGroup() *RegexNode { + u := n + + for u.T == NtGroup { + u = u.Children[0] + } + + return u +} + +// Simple optimization. If a set is a singleton, an inverse singleton, +// or empty, it's transformed accordingly. +func (n *RegexNode) reduceSet() *RegexNode { + // Extract empty-set, one and not-one case as special + if n.Set != nil { + n.Set.simplify() + } + + if n.Set == nil { + n.T = NtNothing + } else if n.Set.IsSingleton() { + n.Ch = n.Set.SingletonChar() + n.Set = nil + n.T += (NtOne - NtSet) + } else if n.Set.IsSingletonInverse() { + n.Ch = n.Set.SingletonChar() + n.Set = nil + n.T += (NtNotone - NtSet) + } + + return n +} + +func (n *RegexNode) reverseLeft() *RegexNode { + if n.Options&RightToLeft != 0 && n.T == NtConcatenate && len(n.Children) > 0 { + //reverse children order + for left, right := 0, len(n.Children)-1; left < right; left, right = left+1, right-1 { + n.Children[left], n.Children[right] = n.Children[right], n.Children[left] + } + } + + return n +} + +func (n *RegexNode) makeQuantifier(lazy bool, min, max int) *RegexNode { + // Certain cases of repeaters (min == max) can be handled specially + if min == 0 && max == 0 { + // The node is repeated 0 times, so it's actually empty. + return newRegexNode(NtEmpty, n.Options) + } + + if min == 1 && max == 1 { + // The node is repeated 1 time, so it's not actually a repeater. + return n + } + + if min == max && max <= MultiVsRepeaterLimit && n.T == NtOne { + // The same character is repeated a fixed number of times, so it's actually a multi. + // While this could remain a repeater, multis are more readily optimized later in + // processing. The counts used here in real-world expressions are invariably small (e.g. 4), + // but we set an upper bound just to avoid creating really large strings. + n.T = NtMulti + n.Str = []rune(strings.Repeat(string(n.Ch), max)) + n.Ch = 0 + return n + } + + switch n.T { + case NtOne, NtNotone, NtSet: + if lazy { + n.makeRep(NtOnelazy, min, max) + } else { + n.makeRep(NtOneloop, min, max) + } + return n + + default: + var t NodeType + if lazy { + t = NtLazyloop + } else { + t = NtLoop + } + result := newRegexNodeMN(t, n.Options, min, max) + result.addChild(n) + return result + } +} + +// Computes a min bound on the required length of any string that could possibly match. +// If the result is 0, there is no minimum we can enforce. +func (n *RegexNode) ComputeMinLength() int { + switch n.T { + case NtOne, NtNotone, NtSet, NtGrapheme: + // single char + return 1 + case NtMulti: + // Every character in the string needs to match. + return len(n.Str) + case NtNotonelazy, NtNotoneloop, NtNotoneloopatomic, + NtOnelazy, NtOneloop, NtOneloopatomic, NtSetlazy, NtSetloop, NtSetloopatomic: + // One character repeated at least M times. + return n.M + case NtLazyloop, NtLoop: + // A node graph repeated at least M times. + return multiplyMinLength(n.M, n.Children[0].ComputeMinLength()) + case NtAlternate: + // The minimum required length for any of the alternation's branches. + childCount := len(n.Children) + min := n.Children[0].ComputeMinLength() + for i := 1; i < childCount && min > 0; i++ { + newMin := n.Children[i].ComputeMinLength() + if newMin < min { + min = newMin + } + } + return min + case NtBackRefCond: + // Minimum of its yes and no branches. The backreference doesn't add to the length. + b1 := n.Children[0].ComputeMinLength() + if len(n.Children) == 1 { + return b1 + } + b2 := n.Children[1].ComputeMinLength() + if b1 < b2 { + return b1 + } + return b2 + case NtExprCond: + // Minimum of its yes and no branches. The condition is a zero-width assertion. + if len(n.Children) == 2 { + return n.Children[1].ComputeMinLength() + } + b1 := n.Children[1].ComputeMinLength() + b2 := n.Children[2].ComputeMinLength() + if b1 < b2 { + return b1 + } + return b2 + case NtConcatenate: + // The sum of all of the concatenation's children. + sum := 0 + for i := 0; i < len(n.Children); i++ { + sum = addMinLength(sum, n.Children[i].ComputeMinLength()) + } + return sum + case NtAtomic, NtCapture, NtGroup: + // For groups, we just delegate to the sole child. + return n.Children[0].ComputeMinLength() + case NtEmpty, NtNothing, NtResetCapture, + NtBeginning, NtBol, NtBoundary, NtECMABoundary, NtEnd, NtEndZ, NtEol, + NtNonboundary, NtNonECMABoundary, NtStart, NtNegLook, NtPosLook, NtRef: + // Nothing to match. In the future, we could potentially use Nothing to say that the min length + // is infinite, but that would require a different structure, as that would only apply if the + // Nothing match is required in all cases (rather than, say, as one branch of an alternation). + } + return 0 +} + +// Computes a maximum length of any string that could possibly match. +// or -1 if the length may not always be the same. +func (n *RegexNode) computeMaxLength() int { + switch n.T { + case NtOne, NtNotone, NtSet: + return 1 + case NtGrapheme: + return -1 + case NtMulti: + return len(n.Str) + case NtNotonelazy, NtNotoneloop, NtNotoneloopatomic, + NtOnelazy, NtOneloop, NtOneloopatomic, + NtSetlazy, NtSetloop, NtSetloopatomic: + // Return the max number of iterations if there's an upper bound, or null if it's infinite + if n.N == math.MaxInt32 { + return -1 + } + return n.N + case NtLazyloop, NtLoop: + if n.N == math.MaxInt32 { + return -1 + } + // A node graph repeated a fixed number of times + if c := n.Children[0].computeMaxLength(); c >= 0 { + return multiplyMaxLength(n.N, c) + } + case NtAlternate: + // The maximum length of any child branch, as long as they all have one. + c := n.Children[0].computeMaxLength() + + if c < 0 { + return -1 + } + for i := 1; i < len(n.Children); i++ { + c2 := n.Children[i].computeMaxLength() + if c2 < 0 { + return -1 + } + + c = max(c, c2) + } + return c + case NtBackRefCond: + // The maximum length of either child branch, as long as they both have one. + b1 := n.Children[0].computeMaxLength() + if b1 < 0 { + return -1 + } + b2 := n.Children[1].computeMaxLength() + if b2 < 0 { + return -1 + } + return max(b1, b2) + + case NtExprCond: + // The condition for an expression conditional is a zero-width assertion. + b1 := n.Children[1].computeMaxLength() + if b1 < 0 { + return -1 + } + b2 := n.Children[2].computeMaxLength() + if b2 < 0 { + return -1 + } + return max(b1, b2) + + case NtConcatenate: + // The sum of all of the concatenation's children's max lengths, as long as they all have one. + sum := 0 + for i := 0; i < len(n.Children); i++ { + c := n.Children[i].computeMaxLength() + if c < 0 { + return -1 + } + sum = addMaxLength(sum, c) + if sum < 0 { + return -1 + } + } + return sum + + case NtAtomic, NtCapture: + // For groups, we just delegate to the sole child. + return n.Children[0].computeMaxLength() + case NtEmpty, NtNothing, NtUpdateBumpalong, NtResetCapture, + NtBeginning, NtBol, NtBoundary, NtECMABoundary, NtEnd, NtEndZ, NtEol, + NtNonboundary, NtNonECMABoundary, NtStart, NtNegLook, NtPosLook: + //zero-width + return 0 + + case NtRef: + // Requires matching data available only at run-time. In the future, we could choose to find + // and follow the capture group this aligns with, while being careful not to end up in an + // infinite cycle. + return -1 + } + + return -1 +} + +// debug functions + +var typeStr = []string{ + "Onerep", "Notonerep", "Setrep", + "Oneloop", "Notoneloop", "Setloop", + "Onelazy", "Notonelazy", "Setlazy", + "One", "Notone", "Set", + "Multi", "Ref", + "Bol", "Eol", "Boundary", "Nonboundary", + "Beginning", "Start", "EndZ", "End", + "Nothing", "Empty", + "Alternate", "Concatenate", + "Loop", "Lazyloop", + "Capture", "Group", "PosLook", "NegLook", "Atomic", + "BackRefCond", "ExprCond", + "Unknown", "Unknown", "Unknown", + "Unknown", "Unknown", "Unknown", + "ECMABoundary", "NonECMABoundary", + "OneloopAtomic", "NotoneloopAtomic", "SetloopAtomic", + "UpdateBumpalong", + "Grapheme", + "ResetCapture", +} + +func (n *RegexNode) Description() string { + buf := &bytes.Buffer{} + + buf.WriteString(typeStr[n.T]) + + if (n.Options & ExplicitCapture) != 0 { + buf.WriteString("-C") + } + if (n.Options & IgnoreCase) != 0 { + buf.WriteString("-I") + } + if (n.Options & RightToLeft) != 0 { + buf.WriteString("-L") + } + if (n.Options & Multiline) != 0 { + buf.WriteString("-M") + } + if (n.Options & Singleline) != 0 { + buf.WriteString("-S") + } + if (n.Options & IgnorePatternWhitespace) != 0 { + buf.WriteString("-X") + } + if (n.Options & ECMAScript) != 0 { + buf.WriteString("-E") + } + + switch n.T { + case NtOneloop, NtOneloopatomic, NtNotoneloop, NtOnelazy, NtNotonelazy, NtOne, NtNotone, NtNotoneloopatomic: + buf.WriteString("(Ch = " + CharDescription(n.Ch) + ")") + case NtCapture: + buf.WriteString("(index = " + strconv.Itoa(n.M) + ", unindex = " + strconv.Itoa(n.N) + ")") + case NtRef, NtBackRefCond, NtResetCapture: + buf.WriteString("(index = " + strconv.Itoa(n.M) + ")") + case NtMulti: + fmt.Fprintf(buf, "(String = %#v)", string(n.Str)) + case NtSet, NtSetloop, NtSetlazy, NtSetloopatomic: + buf.WriteString("(Set = " + n.Set.String() + ")") + } + + switch n.T { + case NtOneloop, NtNotoneloop, NtOnelazy, NtNotonelazy, NtSetloop, NtSetlazy, NtLoop, NtLazyloop, + NtOneloopatomic, NtNotoneloopatomic, NtSetloopatomic: + + buf.WriteString("(Min = ") + buf.WriteString(strconv.Itoa(n.M)) + buf.WriteString(", Max = ") + if n.N == math.MaxInt32 { + buf.WriteString("inf") + } else { + buf.WriteString(strconv.Itoa(n.N)) + } + buf.WriteString(")") + } + + return buf.String() +} + +var padSpace = []byte(" ") + +func (t *RegexTree) Dump() string { + return t.Root.dump() +} + +func (n *RegexNode) dump() string { + var stack []int + CurNode := n + CurChild := 0 + + buf := bytes.NewBufferString(CurNode.Description()) + buf.WriteRune('\n') + + for { + if CurNode.Children != nil && CurChild < len(CurNode.Children) { + stack = append(stack, CurChild+1) + CurNode = CurNode.Children[CurChild] + CurChild = 0 + + Depth := len(stack) + if Depth > 32 { + Depth = 32 + } + buf.Write(padSpace[:Depth]) + buf.WriteString(CurNode.Description()) + buf.WriteRune('\n') + } else { + if len(stack) == 0 { + break + } + + CurChild = stack[len(stack)-1] + stack = stack[:len(stack)-1] + CurNode = CurNode.Parent + } + } + return buf.String() +} + +// Determines whether the specified child index of a concatenation begins a sequence whose values +// should be used to perform an ordinal case-insensitive comparison. +// +// When consumeZeroWidthNodes is false, the consumer needs the semantics of matching the produced string to fully represent +// the semantics of all the consumed nodes, which means nodes can be consumed iff they produce text that's represented +// by the resulting string. When true, the resulting string needs to fully represent all valid matches at that position, +// but it can have false positives, which means the resulting string doesn't need to fully represent all zero-width nodes +// consumed. true is only valid when used as part of a search to determine where to try a full match, not as part of +// actual matching logic. +// consumeZeroWidthNodes = false +func (n *RegexNode) TryGetOrdinalCaseInsensitiveString(childIndex int, exclusiveChildBound int, consumeZeroWidthNodes bool) (success bool, nodesConsumed int, caseInsensitiveString string) { + vsb := &strings.Builder{} + + // We're looking in particular for sets of ASCII characters, so we focus only on sets with two characters in them, e.g. [Aa]. + //twoChars := make([]rune, 0, 2) + + // Iterate from the child index to the exclusive upper bound. + var i int + for i = childIndex; i < exclusiveChildBound; i++ { + child := n.Children[i] + + if child.T == NtOne { + // We only want to include ASCII characters, and only if they don't participate in case conversion + // such that they only case to themselves and nothing other cases to them. Otherwise, including + // them would potentially cause us to match against things not allowed by the pattern. + if child.Ch >= unicode.MaxASCII || participatesInCaseConversion(child.Ch) { + break + } + + vsb.WriteRune(child.Ch) + } else if child.T == NtMulti { + // As with NtOne, the string needs to be composed solely of ASCII characters that + // don't participate in case conversion. + hasNonAscii := slices.ContainsFunc(child.Str, func(ch rune) bool { return ch > unicode.MaxASCII }) + if hasNonAscii || anyParticipatesInCaseConversion(string(child.Str)) { + break + } + + vsb.WriteString(string(child.Str)) + } else if child.T == NtSet || + ((child.T == NtSetloop || child.T == NtSetlazy || child.T == NtSetloopatomic) && child.M == child.N) { + // In particular we want to look for sets that contain only the upper and lowercase variant + // of the same ASCII letter. + ok, twoChars := child.Set.containsAsciiIgnoreCaseCharacter() + if !ok { + break + } + + count := child.M + if child.T == NtSet { + count = 1 + } + vsb.WriteString(strings.Repeat(string(twoChars[0]|0x20), count)) + } else if child.T == NtEmpty { + // Skip over empty nodes, as they're pure nops. They would ideally have been optimized away, + // but can still remain in some situations. + } else if consumeZeroWidthNodes && + // anchors + (child.T == NtBeginning || child.T == NtBol || child.T == NtStart || + // boundaries + child.T == NtBoundary || child.T == NtECMABoundary || child.T == NtNonboundary || child.T == NtNonECMABoundary || + // lookarounds + child.T == NtNegLook || child.T == NtPosLook || + // logic + child.T == NtUpdateBumpalong) { + // Skip over zero-width nodes that might be reasonable at the beginning of or within a substring. + // We can only do these if consumeZeroWidthNodes is true, as otherwise we'd be producing a string that + // may not fully represent the semantics of this portion of the pattern. + } else { + break + } + } + + // If we found at least two characters, consider it a sequence found. It's possible + // they all came from the same node, so this could be a sequence of just one node. + if vsb.Len() >= 2 { + return true, i - childIndex, vsb.String() + } + + // No sequence found. + return false, 0, "" +} + +func (child *RegexNode) canJoinLengthCheck() bool { + if child.T == NtOne || child.T == NtNotone || child.T == NtSet || child.T == NtMulti { + return true + } + if (child.IsSetloopFamily() || child.IsNotoneloopFamily() || child.IsOneloopFamily()) && + child.M == child.N { + return true + } + + return false +} + +// Determine whether the specified child node is the beginning of a sequence that can +// trivially have length checks combined in order to avoid bounds checks. +// requiredLength is The sum of all the fixed lengths for the nodes in the sequence. +// exclusiveEnd is The index of the node just after the last one in the sequence. +// returns true if more than one node can have their length checks combined; otherwise, false. +// +// There are additional node types for which we can prove a fixed length, e.g. examining all branches +// of an alternation and returning true if all their lengths are equal. However, the primary purpose +// of this method is to avoid bounds checks by consolidating length checks that guard accesses to +// strings/spans for which the JIT can see a fixed index within bounds, and alternations employ +// patterns that defeat that (e.g. reassigning the span in question). As such, the implementation +// remains focused on only a core subset of nodes that are a) likely to be used in concatenations and +// b) employ simple patterns of checks. +func (n *RegexNode) TryGetJoinableLengthCheckChildRange(childIndex int, requiredLength *int, exclusiveEnd *int) bool { + + child := n.Children[childIndex] + if child.canJoinLengthCheck() { + *requiredLength = child.ComputeMinLength() + + for *exclusiveEnd = childIndex + 1; *exclusiveEnd < len(n.Children); *exclusiveEnd++ { + child = n.Children[*exclusiveEnd] + if !child.canJoinLengthCheck() { + break + } + + *requiredLength += child.ComputeMinLength() + } + + if *exclusiveEnd-childIndex > 1 { + return true + } + } + + *requiredLength = 0 + *exclusiveEnd = 0 + return false +} + +type StartingLiteral struct { + Range SingleRange + String []rune + SetChars []rune + Negated bool +} + +func (n *RegexNode) FindStartingLiteral() *StartingLiteral { + node := n.FindStartingLiteralNode(true) + if node == nil { + return nil + } + + if node.IsOneFamily() { + return &StartingLiteral{Range: SingleRange{node.Ch, node.Ch}, Negated: false} + } + if node.IsNotoneFamily() { + return &StartingLiteral{Range: SingleRange{node.Ch, node.Ch}, Negated: true} + } + if node.IsSetFamily() { + ranges := node.Set.GetIfNRanges(1) + if len(ranges) == 1 && ranges[0].Last-ranges[0].First > 1 { + return &StartingLiteral{Range: ranges[0], Negated: node.Set.IsNegated()} + } + setChars := node.Set.GetSetChars(128) + if len(setChars) > 0 { + return &StartingLiteral{SetChars: setChars, Negated: node.Set.IsNegated()} + } + } + if node.T == NtMulti { + return &StartingLiteral{String: node.Str} + } + + return nil +} + +// Finds the guaranteed beginning literal(s) of the node, or null if none exists. +// allowZeroWidth = true +func (n *RegexNode) FindStartingLiteralNode(allowZeroWidth bool) *RegexNode { + node := n + for { + if node != nil && node.Options&RightToLeft == 0 { + switch node.T { + case NtOne, NtNotone, NtMulti, NtSet: + return node + + case NtOneloop, NtOneloopatomic, NtOnelazy, + NtNotoneloop, NtNotoneloopatomic, NtNotonelazy, + NtSetloop, NtSetloopatomic, NtSetlazy: + if node.M > 0 { + return node + } + + case NtAtomic, NtConcatenate, NtCapture, NtGroup: + node = node.Children[0] + continue + case NtLoop, NtLazyloop: + node = node.Children[0] + continue + case NtPosLook: + if allowZeroWidth { + node = node.Children[0] + continue + } + } + } + + return nil + } +} + +// Gets the character that begins a One or Multi. +func (n *RegexNode) FirstCharOfOneOrMulti() rune { + if n.IsOneFamily() { + return n.Ch + } + return n.Str[0] +} diff --git a/vendor/github.com/dlclark/regexp2/v2/syntax/unicode_alias_tables.go b/vendor/github.com/dlclark/regexp2/v2/syntax/unicode_alias_tables.go new file mode 100644 index 000000000..7a231d7bd --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/unicode_alias_tables.go @@ -0,0 +1,6594 @@ +package syntax + +import "unicode" + +const unicodePropertyTableVersion = "17.0.0" +const goUnicodeTableVersion = unicode.Version + +// Unicode property alias tables generated from Unicode 17.0.0 data. +// +// At generation time, the Go standard library Unicode tables used for scripts, +// general categories, category aliases, and built-in properties are Unicode +// 15.0.0 in the supported Go toolchain. These package-local tables +// intentionally use Unicode 17.0.0 for commonly updated properties, especially Emoji and +// Extended_Pictographic. +// +// Sources: +// - PropertyAliases.txt +// - PropertyValueAliases.txt +// - DerivedCoreProperties.txt +// - emoji/emoji-data.txt +// - auxiliary/GraphemeBreakProperty.txt +// - auxiliary/WordBreakProperty.txt +// - auxiliary/SentenceBreakProperty.txt +var unicodeAliasCategories = map[string]*unicode.RangeTable{ + "Emoji": unicodeAliasEmoji, + "Emoji_Component": unicodeAliasEmoji_Component, + "Emoji_Modifier": unicodeAliasEmoji_Modifier, + "Emoji_Modifier_Base": unicodeAliasEmoji_Modifier_Base, + "Emoji_Presentation": unicodeAliasEmoji_Presentation, + "Extended_Pictographic": unicodeAliasExtended_Pictographic, + "Grapheme_Cluster_Break=CR": unicodeAliasGrapheme_Cluster_Break_CR, + "Grapheme_Cluster_Break=Control": unicodeAliasGrapheme_Cluster_Break_Control, + "Grapheme_Cluster_Break=Extend": unicodeAliasGrapheme_Cluster_Break_Extend, + "Grapheme_Cluster_Break=L": unicodeAliasGrapheme_Cluster_Break_L, + "Grapheme_Cluster_Break=LF": unicodeAliasGrapheme_Cluster_Break_LF, + "Grapheme_Cluster_Break=LV": unicodeAliasGrapheme_Cluster_Break_LV, + "Grapheme_Cluster_Break=LVT": unicodeAliasGrapheme_Cluster_Break_LVT, + "Grapheme_Cluster_Break=Prepend": unicodeAliasGrapheme_Cluster_Break_Prepend, + "Grapheme_Cluster_Break=Regional_Indicator": unicodeAliasGrapheme_Cluster_Break_Regional_Indicator, + "Grapheme_Cluster_Break=SpacingMark": unicodeAliasGrapheme_Cluster_Break_SpacingMark, + "Grapheme_Cluster_Break=T": unicodeAliasGrapheme_Cluster_Break_T, + "Grapheme_Cluster_Break=V": unicodeAliasGrapheme_Cluster_Break_V, + "Grapheme_Cluster_Break=ZWJ": unicodeAliasGrapheme_Cluster_Break_ZWJ, + "Indic_Conjunct_Break=Consonant": unicodeAliasIndic_Conjunct_Break_Consonant, + "Indic_Conjunct_Break=Extend": unicodeAliasIndic_Conjunct_Break_Extend, + "Indic_Conjunct_Break=Linker": unicodeAliasIndic_Conjunct_Break_Linker, + "Math": unicodeAliasMath, + "Sentence_Break=ATerm": unicodeAliasSentence_Break_ATerm, + "Sentence_Break=CR": unicodeAliasSentence_Break_CR, + "Sentence_Break=Close": unicodeAliasSentence_Break_Close, + "Sentence_Break=Extend": unicodeAliasSentence_Break_Extend, + "Sentence_Break=Format": unicodeAliasSentence_Break_Format, + "Sentence_Break=LF": unicodeAliasSentence_Break_LF, + "Sentence_Break=Lower": unicodeAliasSentence_Break_Lower, + "Sentence_Break=Numeric": unicodeAliasSentence_Break_Numeric, + "Sentence_Break=OLetter": unicodeAliasSentence_Break_OLetter, + "Sentence_Break=SContinue": unicodeAliasSentence_Break_SContinue, + "Sentence_Break=STerm": unicodeAliasSentence_Break_STerm, + "Sentence_Break=Sep": unicodeAliasSentence_Break_Sep, + "Sentence_Break=Sp": unicodeAliasSentence_Break_Sp, + "Sentence_Break=Upper": unicodeAliasSentence_Break_Upper, + "Word_Break=ALetter": unicodeAliasWord_Break_ALetter, + "Word_Break=CR": unicodeAliasWord_Break_CR, + "Word_Break=Double_Quote": unicodeAliasWord_Break_Double_Quote, + "Word_Break=Extend": unicodeAliasWord_Break_Extend, + "Word_Break=ExtendNumLet": unicodeAliasWord_Break_ExtendNumLet, + "Word_Break=Format": unicodeAliasWord_Break_Format, + "Word_Break=Hebrew_Letter": unicodeAliasWord_Break_Hebrew_Letter, + "Word_Break=Katakana": unicodeAliasWord_Break_Katakana, + "Word_Break=LF": unicodeAliasWord_Break_LF, + "Word_Break=MidLetter": unicodeAliasWord_Break_MidLetter, + "Word_Break=MidNum": unicodeAliasWord_Break_MidNum, + "Word_Break=MidNumLet": unicodeAliasWord_Break_MidNumLet, + "Word_Break=Newline": unicodeAliasWord_Break_Newline, + "Word_Break=Numeric": unicodeAliasWord_Break_Numeric, + "Word_Break=Regional_Indicator": unicodeAliasWord_Break_Regional_Indicator, + "Word_Break=Single_Quote": unicodeAliasWord_Break_Single_Quote, + "Word_Break=WSegSpace": unicodeAliasWord_Break_WSegSpace, + "Word_Break=ZWJ": unicodeAliasWord_Break_ZWJ, +} + +var unicodeSupportedPropertyAliases = map[string]string{ + "ebase": "Emoji_Modifier_Base", + "ecomp": "Emoji_Component", + "emod": "Emoji_Modifier", + "emoji": "Emoji", + "emojicomponent": "Emoji_Component", + "emojimodifier": "Emoji_Modifier", + "emojimodifierbase": "Emoji_Modifier_Base", + "emojipresentation": "Emoji_Presentation", + "epres": "Emoji_Presentation", + "extendedpictographic": "Extended_Pictographic", + "extpict": "Extended_Pictographic", + "gcb": "Grapheme_Cluster_Break", + "graphemeclusterbreak": "Grapheme_Cluster_Break", + "incb": "Indic_Conjunct_Break", + "indicconjunctbreak": "Indic_Conjunct_Break", + "math": "Math", + "sb": "Sentence_Break", + "sentencebreak": "Sentence_Break", + "wb": "Word_Break", + "wordbreak": "Word_Break", +} + +var unicodeSupportedPropertyValueAliases = map[string]map[string]string{ + "Grapheme_Cluster_Break": { + "cn": "Control", + "control": "Control", + "cr": "CR", + "ex": "Extend", + "extend": "Extend", + "l": "L", + "lf": "LF", + "lv": "LV", + "lvt": "LVT", + "pp": "Prepend", + "prepend": "Prepend", + "regionalindicator": "Regional_Indicator", + "ri": "Regional_Indicator", + "sm": "SpacingMark", + "spacingmark": "SpacingMark", + "t": "T", + "v": "V", + "zwj": "ZWJ", + }, + "Indic_Conjunct_Break": { + "consonant": "Consonant", + "extend": "Extend", + "linker": "Linker", + }, + "Sentence_Break": { + "at": "ATerm", + "aterm": "ATerm", + "cl": "Close", + "close": "Close", + "cr": "CR", + "ex": "Extend", + "extend": "Extend", + "fo": "Format", + "format": "Format", + "le": "OLetter", + "lf": "LF", + "lo": "Lower", + "lower": "Lower", + "nu": "Numeric", + "numeric": "Numeric", + "oletter": "OLetter", + "sc": "SContinue", + "scontinue": "SContinue", + "se": "Sep", + "sep": "Sep", + "sp": "Sp", + "st": "STerm", + "sterm": "STerm", + "up": "Upper", + "upper": "Upper", + }, + "Word_Break": { + "aletter": "ALetter", + "cr": "CR", + "doublequote": "Double_Quote", + "dq": "Double_Quote", + "ex": "ExtendNumLet", + "extend": "Extend", + "extendnumlet": "ExtendNumLet", + "fo": "Format", + "format": "Format", + "hebrewletter": "Hebrew_Letter", + "hl": "Hebrew_Letter", + "ka": "Katakana", + "katakana": "Katakana", + "le": "ALetter", + "lf": "LF", + "mb": "MidNumLet", + "midletter": "MidLetter", + "midnum": "MidNum", + "midnumlet": "MidNumLet", + "ml": "MidLetter", + "mn": "MidNum", + "newline": "Newline", + "nl": "Newline", + "nu": "Numeric", + "numeric": "Numeric", + "regionalindicator": "Regional_Indicator", + "ri": "Regional_Indicator", + "singlequote": "Single_Quote", + "sq": "Single_Quote", + "wsegspace": "WSegSpace", + "zwj": "ZWJ", + }, +} + +var unicodeBarePropertyValueAliases = map[string]string{ + "extendnumlet": "Word_Break=ExtendNumLet", + "hebrewletter": "Word_Break=Hebrew_Letter", + "regionalindicator": "Grapheme_Cluster_Break=Regional_Indicator", + "ri": "Grapheme_Cluster_Break=Regional_Indicator", + "wsegspace": "Word_Break=WSegSpace", +} + +var unicodeAliasEmoji = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x23, Hi: 0x23, Stride: 1}, + {Lo: 0x2A, Hi: 0x2A, Stride: 1}, + {Lo: 0x30, Hi: 0x39, Stride: 1}, + {Lo: 0xA9, Hi: 0xA9, Stride: 1}, + {Lo: 0xAE, Hi: 0xAE, Stride: 1}, + {Lo: 0x203C, Hi: 0x203C, Stride: 1}, + {Lo: 0x2049, Hi: 0x2049, Stride: 1}, + {Lo: 0x2122, Hi: 0x2122, Stride: 1}, + {Lo: 0x2139, Hi: 0x2139, Stride: 1}, + {Lo: 0x2194, Hi: 0x2199, Stride: 1}, + {Lo: 0x21A9, Hi: 0x21AA, Stride: 1}, + {Lo: 0x231A, Hi: 0x231B, Stride: 1}, + {Lo: 0x2328, Hi: 0x2328, Stride: 1}, + {Lo: 0x23CF, Hi: 0x23CF, Stride: 1}, + {Lo: 0x23E9, Hi: 0x23F3, Stride: 1}, + {Lo: 0x23F8, Hi: 0x23FA, Stride: 1}, + {Lo: 0x24C2, Hi: 0x24C2, Stride: 1}, + {Lo: 0x25AA, Hi: 0x25AB, Stride: 1}, + {Lo: 0x25B6, Hi: 0x25B6, Stride: 1}, + {Lo: 0x25C0, Hi: 0x25C0, Stride: 1}, + {Lo: 0x25FB, Hi: 0x25FE, Stride: 1}, + {Lo: 0x2600, Hi: 0x2604, Stride: 1}, + {Lo: 0x260E, Hi: 0x260E, Stride: 1}, + {Lo: 0x2611, Hi: 0x2611, Stride: 1}, + {Lo: 0x2614, Hi: 0x2615, Stride: 1}, + {Lo: 0x2618, Hi: 0x2618, Stride: 1}, + {Lo: 0x261D, Hi: 0x261D, Stride: 1}, + {Lo: 0x2620, Hi: 0x2620, Stride: 1}, + {Lo: 0x2622, Hi: 0x2623, Stride: 1}, + {Lo: 0x2626, Hi: 0x2626, Stride: 1}, + {Lo: 0x262A, Hi: 0x262A, Stride: 1}, + {Lo: 0x262E, Hi: 0x262F, Stride: 1}, + {Lo: 0x2638, Hi: 0x263A, Stride: 1}, + {Lo: 0x2640, Hi: 0x2640, Stride: 1}, + {Lo: 0x2642, Hi: 0x2642, Stride: 1}, + {Lo: 0x2648, Hi: 0x2653, Stride: 1}, + {Lo: 0x265F, Hi: 0x2660, Stride: 1}, + {Lo: 0x2663, Hi: 0x2663, Stride: 1}, + {Lo: 0x2665, Hi: 0x2666, Stride: 1}, + {Lo: 0x2668, Hi: 0x2668, Stride: 1}, + {Lo: 0x267B, Hi: 0x267B, Stride: 1}, + {Lo: 0x267E, Hi: 0x267F, Stride: 1}, + {Lo: 0x2692, Hi: 0x2697, Stride: 1}, + {Lo: 0x2699, Hi: 0x2699, Stride: 1}, + {Lo: 0x269B, Hi: 0x269C, Stride: 1}, + {Lo: 0x26A0, Hi: 0x26A1, Stride: 1}, + {Lo: 0x26A7, Hi: 0x26A7, Stride: 1}, + {Lo: 0x26AA, Hi: 0x26AB, Stride: 1}, + {Lo: 0x26B0, Hi: 0x26B1, Stride: 1}, + {Lo: 0x26BD, Hi: 0x26BE, Stride: 1}, + {Lo: 0x26C4, Hi: 0x26C5, Stride: 1}, + {Lo: 0x26C8, Hi: 0x26C8, Stride: 1}, + {Lo: 0x26CE, Hi: 0x26CF, Stride: 1}, + {Lo: 0x26D1, Hi: 0x26D1, Stride: 1}, + {Lo: 0x26D3, Hi: 0x26D4, Stride: 1}, + {Lo: 0x26E9, Hi: 0x26EA, Stride: 1}, + {Lo: 0x26F0, Hi: 0x26F5, Stride: 1}, + {Lo: 0x26F7, Hi: 0x26FA, Stride: 1}, + {Lo: 0x26FD, Hi: 0x26FD, Stride: 1}, + {Lo: 0x2702, Hi: 0x2702, Stride: 1}, + {Lo: 0x2705, Hi: 0x2705, Stride: 1}, + {Lo: 0x2708, Hi: 0x270D, Stride: 1}, + {Lo: 0x270F, Hi: 0x270F, Stride: 1}, + {Lo: 0x2712, Hi: 0x2712, Stride: 1}, + {Lo: 0x2714, Hi: 0x2714, Stride: 1}, + {Lo: 0x2716, Hi: 0x2716, Stride: 1}, + {Lo: 0x271D, Hi: 0x271D, Stride: 1}, + {Lo: 0x2721, Hi: 0x2721, Stride: 1}, + {Lo: 0x2728, Hi: 0x2728, Stride: 1}, + {Lo: 0x2733, Hi: 0x2734, Stride: 1}, + {Lo: 0x2744, Hi: 0x2744, Stride: 1}, + {Lo: 0x2747, Hi: 0x2747, Stride: 1}, + {Lo: 0x274C, Hi: 0x274C, Stride: 1}, + {Lo: 0x274E, Hi: 0x274E, Stride: 1}, + {Lo: 0x2753, Hi: 0x2755, Stride: 1}, + {Lo: 0x2757, Hi: 0x2757, Stride: 1}, + {Lo: 0x2763, Hi: 0x2764, Stride: 1}, + {Lo: 0x2795, Hi: 0x2797, Stride: 1}, + {Lo: 0x27A1, Hi: 0x27A1, Stride: 1}, + {Lo: 0x27B0, Hi: 0x27B0, Stride: 1}, + {Lo: 0x27BF, Hi: 0x27BF, Stride: 1}, + {Lo: 0x2934, Hi: 0x2935, Stride: 1}, + {Lo: 0x2B05, Hi: 0x2B07, Stride: 1}, + {Lo: 0x2B1B, Hi: 0x2B1C, Stride: 1}, + {Lo: 0x2B50, Hi: 0x2B50, Stride: 1}, + {Lo: 0x2B55, Hi: 0x2B55, Stride: 1}, + {Lo: 0x3030, Hi: 0x3030, Stride: 1}, + {Lo: 0x303D, Hi: 0x303D, Stride: 1}, + {Lo: 0x3297, Hi: 0x3297, Stride: 1}, + {Lo: 0x3299, Hi: 0x3299, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x1F004, Hi: 0x1F004, Stride: 1}, + {Lo: 0x1F0CF, Hi: 0x1F0CF, Stride: 1}, + {Lo: 0x1F170, Hi: 0x1F171, Stride: 1}, + {Lo: 0x1F17E, Hi: 0x1F17F, Stride: 1}, + {Lo: 0x1F18E, Hi: 0x1F18E, Stride: 1}, + {Lo: 0x1F191, Hi: 0x1F19A, Stride: 1}, + {Lo: 0x1F1E6, Hi: 0x1F1FF, Stride: 1}, + {Lo: 0x1F201, Hi: 0x1F202, Stride: 1}, + {Lo: 0x1F21A, Hi: 0x1F21A, Stride: 1}, + {Lo: 0x1F22F, Hi: 0x1F22F, Stride: 1}, + {Lo: 0x1F232, Hi: 0x1F23A, Stride: 1}, + {Lo: 0x1F250, Hi: 0x1F251, Stride: 1}, + {Lo: 0x1F300, Hi: 0x1F321, Stride: 1}, + {Lo: 0x1F324, Hi: 0x1F393, Stride: 1}, + {Lo: 0x1F396, Hi: 0x1F397, Stride: 1}, + {Lo: 0x1F399, Hi: 0x1F39B, Stride: 1}, + {Lo: 0x1F39E, Hi: 0x1F3F0, Stride: 1}, + {Lo: 0x1F3F3, Hi: 0x1F3F5, Stride: 1}, + {Lo: 0x1F3F7, Hi: 0x1F4FD, Stride: 1}, + {Lo: 0x1F4FF, Hi: 0x1F53D, Stride: 1}, + {Lo: 0x1F549, Hi: 0x1F54E, Stride: 1}, + {Lo: 0x1F550, Hi: 0x1F567, Stride: 1}, + {Lo: 0x1F56F, Hi: 0x1F570, Stride: 1}, + {Lo: 0x1F573, Hi: 0x1F57A, Stride: 1}, + {Lo: 0x1F587, Hi: 0x1F587, Stride: 1}, + {Lo: 0x1F58A, Hi: 0x1F58D, Stride: 1}, + {Lo: 0x1F590, Hi: 0x1F590, Stride: 1}, + {Lo: 0x1F595, Hi: 0x1F596, Stride: 1}, + {Lo: 0x1F5A4, Hi: 0x1F5A5, Stride: 1}, + {Lo: 0x1F5A8, Hi: 0x1F5A8, Stride: 1}, + {Lo: 0x1F5B1, Hi: 0x1F5B2, Stride: 1}, + {Lo: 0x1F5BC, Hi: 0x1F5BC, Stride: 1}, + {Lo: 0x1F5C2, Hi: 0x1F5C4, Stride: 1}, + {Lo: 0x1F5D1, Hi: 0x1F5D3, Stride: 1}, + {Lo: 0x1F5DC, Hi: 0x1F5DE, Stride: 1}, + {Lo: 0x1F5E1, Hi: 0x1F5E1, Stride: 1}, + {Lo: 0x1F5E3, Hi: 0x1F5E3, Stride: 1}, + {Lo: 0x1F5E8, Hi: 0x1F5E8, Stride: 1}, + {Lo: 0x1F5EF, Hi: 0x1F5EF, Stride: 1}, + {Lo: 0x1F5F3, Hi: 0x1F5F3, Stride: 1}, + {Lo: 0x1F5FA, Hi: 0x1F64F, Stride: 1}, + {Lo: 0x1F680, Hi: 0x1F6C5, Stride: 1}, + {Lo: 0x1F6CB, Hi: 0x1F6D2, Stride: 1}, + {Lo: 0x1F6D5, Hi: 0x1F6D8, Stride: 1}, + {Lo: 0x1F6DC, Hi: 0x1F6E5, Stride: 1}, + {Lo: 0x1F6E9, Hi: 0x1F6E9, Stride: 1}, + {Lo: 0x1F6EB, Hi: 0x1F6EC, Stride: 1}, + {Lo: 0x1F6F0, Hi: 0x1F6F0, Stride: 1}, + {Lo: 0x1F6F3, Hi: 0x1F6FC, Stride: 1}, + {Lo: 0x1F7E0, Hi: 0x1F7EB, Stride: 1}, + {Lo: 0x1F7F0, Hi: 0x1F7F0, Stride: 1}, + {Lo: 0x1F90C, Hi: 0x1F93A, Stride: 1}, + {Lo: 0x1F93C, Hi: 0x1F945, Stride: 1}, + {Lo: 0x1F947, Hi: 0x1F9FF, Stride: 1}, + {Lo: 0x1FA70, Hi: 0x1FA7C, Stride: 1}, + {Lo: 0x1FA80, Hi: 0x1FA8A, Stride: 1}, + {Lo: 0x1FA8E, Hi: 0x1FAC6, Stride: 1}, + {Lo: 0x1FAC8, Hi: 0x1FAC8, Stride: 1}, + {Lo: 0x1FACD, Hi: 0x1FADC, Stride: 1}, + {Lo: 0x1FADF, Hi: 0x1FAEA, Stride: 1}, + {Lo: 0x1FAEF, Hi: 0x1FAF8, Stride: 1}, + }, +} + +var unicodeAliasEmoji_Component = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x23, Hi: 0x23, Stride: 1}, + {Lo: 0x2A, Hi: 0x2A, Stride: 1}, + {Lo: 0x30, Hi: 0x39, Stride: 1}, + {Lo: 0x200D, Hi: 0x200D, Stride: 1}, + {Lo: 0x20E3, Hi: 0x20E3, Stride: 1}, + {Lo: 0xFE0F, Hi: 0xFE0F, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x1F1E6, Hi: 0x1F1FF, Stride: 1}, + {Lo: 0x1F3FB, Hi: 0x1F3FF, Stride: 1}, + {Lo: 0x1F9B0, Hi: 0x1F9B3, Stride: 1}, + {Lo: 0xE0020, Hi: 0xE007F, Stride: 1}, + }, +} + +var unicodeAliasEmoji_Modifier = &unicode.RangeTable{ + R32: []unicode.Range32{ + {Lo: 0x1F3FB, Hi: 0x1F3FF, Stride: 1}, + }, +} + +var unicodeAliasEmoji_Modifier_Base = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x261D, Hi: 0x261D, Stride: 1}, + {Lo: 0x26F9, Hi: 0x26F9, Stride: 1}, + {Lo: 0x270A, Hi: 0x270D, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x1F385, Hi: 0x1F385, Stride: 1}, + {Lo: 0x1F3C2, Hi: 0x1F3C4, Stride: 1}, + {Lo: 0x1F3C7, Hi: 0x1F3C7, Stride: 1}, + {Lo: 0x1F3CA, Hi: 0x1F3CC, Stride: 1}, + {Lo: 0x1F442, Hi: 0x1F443, Stride: 1}, + {Lo: 0x1F446, Hi: 0x1F450, Stride: 1}, + {Lo: 0x1F466, Hi: 0x1F478, Stride: 1}, + {Lo: 0x1F47C, Hi: 0x1F47C, Stride: 1}, + {Lo: 0x1F481, Hi: 0x1F483, Stride: 1}, + {Lo: 0x1F485, Hi: 0x1F487, Stride: 1}, + {Lo: 0x1F48F, Hi: 0x1F48F, Stride: 1}, + {Lo: 0x1F491, Hi: 0x1F491, Stride: 1}, + {Lo: 0x1F4AA, Hi: 0x1F4AA, Stride: 1}, + {Lo: 0x1F574, Hi: 0x1F575, Stride: 1}, + {Lo: 0x1F57A, Hi: 0x1F57A, Stride: 1}, + {Lo: 0x1F590, Hi: 0x1F590, Stride: 1}, + {Lo: 0x1F595, Hi: 0x1F596, Stride: 1}, + {Lo: 0x1F645, Hi: 0x1F647, Stride: 1}, + {Lo: 0x1F64B, Hi: 0x1F64F, Stride: 1}, + {Lo: 0x1F6A3, Hi: 0x1F6A3, Stride: 1}, + {Lo: 0x1F6B4, Hi: 0x1F6B6, Stride: 1}, + {Lo: 0x1F6C0, Hi: 0x1F6C0, Stride: 1}, + {Lo: 0x1F6CC, Hi: 0x1F6CC, Stride: 1}, + {Lo: 0x1F90C, Hi: 0x1F90C, Stride: 1}, + {Lo: 0x1F90F, Hi: 0x1F90F, Stride: 1}, + {Lo: 0x1F918, Hi: 0x1F91F, Stride: 1}, + {Lo: 0x1F926, Hi: 0x1F926, Stride: 1}, + {Lo: 0x1F930, Hi: 0x1F939, Stride: 1}, + {Lo: 0x1F93C, Hi: 0x1F93E, Stride: 1}, + {Lo: 0x1F977, Hi: 0x1F977, Stride: 1}, + {Lo: 0x1F9B5, Hi: 0x1F9B6, Stride: 1}, + {Lo: 0x1F9B8, Hi: 0x1F9B9, Stride: 1}, + {Lo: 0x1F9BB, Hi: 0x1F9BB, Stride: 1}, + {Lo: 0x1F9CD, Hi: 0x1F9CF, Stride: 1}, + {Lo: 0x1F9D1, Hi: 0x1F9DD, Stride: 1}, + {Lo: 0x1FAC3, Hi: 0x1FAC5, Stride: 1}, + {Lo: 0x1FAF0, Hi: 0x1FAF8, Stride: 1}, + }, +} + +var unicodeAliasEmoji_Presentation = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x231A, Hi: 0x231B, Stride: 1}, + {Lo: 0x23E9, Hi: 0x23EC, Stride: 1}, + {Lo: 0x23F0, Hi: 0x23F0, Stride: 1}, + {Lo: 0x23F3, Hi: 0x23F3, Stride: 1}, + {Lo: 0x25FD, Hi: 0x25FE, Stride: 1}, + {Lo: 0x2614, Hi: 0x2615, Stride: 1}, + {Lo: 0x2648, Hi: 0x2653, Stride: 1}, + {Lo: 0x267F, Hi: 0x267F, Stride: 1}, + {Lo: 0x2693, Hi: 0x2693, Stride: 1}, + {Lo: 0x26A1, Hi: 0x26A1, Stride: 1}, + {Lo: 0x26AA, Hi: 0x26AB, Stride: 1}, + {Lo: 0x26BD, Hi: 0x26BE, Stride: 1}, + {Lo: 0x26C4, Hi: 0x26C5, Stride: 1}, + {Lo: 0x26CE, Hi: 0x26CE, Stride: 1}, + {Lo: 0x26D4, Hi: 0x26D4, Stride: 1}, + {Lo: 0x26EA, Hi: 0x26EA, Stride: 1}, + {Lo: 0x26F2, Hi: 0x26F3, Stride: 1}, + {Lo: 0x26F5, Hi: 0x26F5, Stride: 1}, + {Lo: 0x26FA, Hi: 0x26FA, Stride: 1}, + {Lo: 0x26FD, Hi: 0x26FD, Stride: 1}, + {Lo: 0x2705, Hi: 0x2705, Stride: 1}, + {Lo: 0x270A, Hi: 0x270B, Stride: 1}, + {Lo: 0x2728, Hi: 0x2728, Stride: 1}, + {Lo: 0x274C, Hi: 0x274C, Stride: 1}, + {Lo: 0x274E, Hi: 0x274E, Stride: 1}, + {Lo: 0x2753, Hi: 0x2755, Stride: 1}, + {Lo: 0x2757, Hi: 0x2757, Stride: 1}, + {Lo: 0x2795, Hi: 0x2797, Stride: 1}, + {Lo: 0x27B0, Hi: 0x27B0, Stride: 1}, + {Lo: 0x27BF, Hi: 0x27BF, Stride: 1}, + {Lo: 0x2B1B, Hi: 0x2B1C, Stride: 1}, + {Lo: 0x2B50, Hi: 0x2B50, Stride: 1}, + {Lo: 0x2B55, Hi: 0x2B55, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x1F004, Hi: 0x1F004, Stride: 1}, + {Lo: 0x1F0CF, Hi: 0x1F0CF, Stride: 1}, + {Lo: 0x1F18E, Hi: 0x1F18E, Stride: 1}, + {Lo: 0x1F191, Hi: 0x1F19A, Stride: 1}, + {Lo: 0x1F1E6, Hi: 0x1F1FF, Stride: 1}, + {Lo: 0x1F201, Hi: 0x1F201, Stride: 1}, + {Lo: 0x1F21A, Hi: 0x1F21A, Stride: 1}, + {Lo: 0x1F22F, Hi: 0x1F22F, Stride: 1}, + {Lo: 0x1F232, Hi: 0x1F236, Stride: 1}, + {Lo: 0x1F238, Hi: 0x1F23A, Stride: 1}, + {Lo: 0x1F250, Hi: 0x1F251, Stride: 1}, + {Lo: 0x1F300, Hi: 0x1F320, Stride: 1}, + {Lo: 0x1F32D, Hi: 0x1F335, Stride: 1}, + {Lo: 0x1F337, Hi: 0x1F37C, Stride: 1}, + {Lo: 0x1F37E, Hi: 0x1F393, Stride: 1}, + {Lo: 0x1F3A0, Hi: 0x1F3CA, Stride: 1}, + {Lo: 0x1F3CF, Hi: 0x1F3D3, Stride: 1}, + {Lo: 0x1F3E0, Hi: 0x1F3F0, Stride: 1}, + {Lo: 0x1F3F4, Hi: 0x1F3F4, Stride: 1}, + {Lo: 0x1F3F8, Hi: 0x1F43E, Stride: 1}, + {Lo: 0x1F440, Hi: 0x1F440, Stride: 1}, + {Lo: 0x1F442, Hi: 0x1F4FC, Stride: 1}, + {Lo: 0x1F4FF, Hi: 0x1F53D, Stride: 1}, + {Lo: 0x1F54B, Hi: 0x1F54E, Stride: 1}, + {Lo: 0x1F550, Hi: 0x1F567, Stride: 1}, + {Lo: 0x1F57A, Hi: 0x1F57A, Stride: 1}, + {Lo: 0x1F595, Hi: 0x1F596, Stride: 1}, + {Lo: 0x1F5A4, Hi: 0x1F5A4, Stride: 1}, + {Lo: 0x1F5FB, Hi: 0x1F64F, Stride: 1}, + {Lo: 0x1F680, Hi: 0x1F6C5, Stride: 1}, + {Lo: 0x1F6CC, Hi: 0x1F6CC, Stride: 1}, + {Lo: 0x1F6D0, Hi: 0x1F6D2, Stride: 1}, + {Lo: 0x1F6D5, Hi: 0x1F6D8, Stride: 1}, + {Lo: 0x1F6DC, Hi: 0x1F6DF, Stride: 1}, + {Lo: 0x1F6EB, Hi: 0x1F6EC, Stride: 1}, + {Lo: 0x1F6F4, Hi: 0x1F6FC, Stride: 1}, + {Lo: 0x1F7E0, Hi: 0x1F7EB, Stride: 1}, + {Lo: 0x1F7F0, Hi: 0x1F7F0, Stride: 1}, + {Lo: 0x1F90C, Hi: 0x1F93A, Stride: 1}, + {Lo: 0x1F93C, Hi: 0x1F945, Stride: 1}, + {Lo: 0x1F947, Hi: 0x1F9FF, Stride: 1}, + {Lo: 0x1FA70, Hi: 0x1FA7C, Stride: 1}, + {Lo: 0x1FA80, Hi: 0x1FA8A, Stride: 1}, + {Lo: 0x1FA8E, Hi: 0x1FAC6, Stride: 1}, + {Lo: 0x1FAC8, Hi: 0x1FAC8, Stride: 1}, + {Lo: 0x1FACD, Hi: 0x1FADC, Stride: 1}, + {Lo: 0x1FADF, Hi: 0x1FAEA, Stride: 1}, + {Lo: 0x1FAEF, Hi: 0x1FAF8, Stride: 1}, + }, +} + +var unicodeAliasExtended_Pictographic = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0xA9, Hi: 0xA9, Stride: 1}, + {Lo: 0xAE, Hi: 0xAE, Stride: 1}, + {Lo: 0x203C, Hi: 0x203C, Stride: 1}, + {Lo: 0x2049, Hi: 0x2049, Stride: 1}, + {Lo: 0x2122, Hi: 0x2122, Stride: 1}, + {Lo: 0x2139, Hi: 0x2139, Stride: 1}, + {Lo: 0x2194, Hi: 0x2199, Stride: 1}, + {Lo: 0x21A9, Hi: 0x21AA, Stride: 1}, + {Lo: 0x231A, Hi: 0x231B, Stride: 1}, + {Lo: 0x2328, Hi: 0x2328, Stride: 1}, + {Lo: 0x23CF, Hi: 0x23CF, Stride: 1}, + {Lo: 0x23E9, Hi: 0x23F3, Stride: 1}, + {Lo: 0x23F8, Hi: 0x23FA, Stride: 1}, + {Lo: 0x24C2, Hi: 0x24C2, Stride: 1}, + {Lo: 0x25AA, Hi: 0x25AB, Stride: 1}, + {Lo: 0x25B6, Hi: 0x25B6, Stride: 1}, + {Lo: 0x25C0, Hi: 0x25C0, Stride: 1}, + {Lo: 0x25FB, Hi: 0x25FE, Stride: 1}, + {Lo: 0x2600, Hi: 0x2604, Stride: 1}, + {Lo: 0x260E, Hi: 0x260E, Stride: 1}, + {Lo: 0x2611, Hi: 0x2611, Stride: 1}, + {Lo: 0x2614, Hi: 0x2615, Stride: 1}, + {Lo: 0x2618, Hi: 0x2618, Stride: 1}, + {Lo: 0x261D, Hi: 0x261D, Stride: 1}, + {Lo: 0x2620, Hi: 0x2620, Stride: 1}, + {Lo: 0x2622, Hi: 0x2623, Stride: 1}, + {Lo: 0x2626, Hi: 0x2626, Stride: 1}, + {Lo: 0x262A, Hi: 0x262A, Stride: 1}, + {Lo: 0x262E, Hi: 0x262F, Stride: 1}, + {Lo: 0x2638, Hi: 0x263A, Stride: 1}, + {Lo: 0x2640, Hi: 0x2640, Stride: 1}, + {Lo: 0x2642, Hi: 0x2642, Stride: 1}, + {Lo: 0x2648, Hi: 0x2653, Stride: 1}, + {Lo: 0x265F, Hi: 0x2660, Stride: 1}, + {Lo: 0x2663, Hi: 0x2663, Stride: 1}, + {Lo: 0x2665, Hi: 0x2666, Stride: 1}, + {Lo: 0x2668, Hi: 0x2668, Stride: 1}, + {Lo: 0x267B, Hi: 0x267B, Stride: 1}, + {Lo: 0x267E, Hi: 0x267F, Stride: 1}, + {Lo: 0x2692, Hi: 0x2697, Stride: 1}, + {Lo: 0x2699, Hi: 0x2699, Stride: 1}, + {Lo: 0x269B, Hi: 0x269C, Stride: 1}, + {Lo: 0x26A0, Hi: 0x26A1, Stride: 1}, + {Lo: 0x26A7, Hi: 0x26A7, Stride: 1}, + {Lo: 0x26AA, Hi: 0x26AB, Stride: 1}, + {Lo: 0x26B0, Hi: 0x26B1, Stride: 1}, + {Lo: 0x26BD, Hi: 0x26BE, Stride: 1}, + {Lo: 0x26C4, Hi: 0x26C5, Stride: 1}, + {Lo: 0x26C8, Hi: 0x26C8, Stride: 1}, + {Lo: 0x26CE, Hi: 0x26CF, Stride: 1}, + {Lo: 0x26D1, Hi: 0x26D1, Stride: 1}, + {Lo: 0x26D3, Hi: 0x26D4, Stride: 1}, + {Lo: 0x26E9, Hi: 0x26EA, Stride: 1}, + {Lo: 0x26F0, Hi: 0x26F5, Stride: 1}, + {Lo: 0x26F7, Hi: 0x26FA, Stride: 1}, + {Lo: 0x26FD, Hi: 0x26FD, Stride: 1}, + {Lo: 0x2702, Hi: 0x2702, Stride: 1}, + {Lo: 0x2705, Hi: 0x2705, Stride: 1}, + {Lo: 0x2708, Hi: 0x270D, Stride: 1}, + {Lo: 0x270F, Hi: 0x270F, Stride: 1}, + {Lo: 0x2712, Hi: 0x2712, Stride: 1}, + {Lo: 0x2714, Hi: 0x2714, Stride: 1}, + {Lo: 0x2716, Hi: 0x2716, Stride: 1}, + {Lo: 0x271D, Hi: 0x271D, Stride: 1}, + {Lo: 0x2721, Hi: 0x2721, Stride: 1}, + {Lo: 0x2728, Hi: 0x2728, Stride: 1}, + {Lo: 0x2733, Hi: 0x2734, Stride: 1}, + {Lo: 0x2744, Hi: 0x2744, Stride: 1}, + {Lo: 0x2747, Hi: 0x2747, Stride: 1}, + {Lo: 0x274C, Hi: 0x274C, Stride: 1}, + {Lo: 0x274E, Hi: 0x274E, Stride: 1}, + {Lo: 0x2753, Hi: 0x2755, Stride: 1}, + {Lo: 0x2757, Hi: 0x2757, Stride: 1}, + {Lo: 0x2763, Hi: 0x2764, Stride: 1}, + {Lo: 0x2795, Hi: 0x2797, Stride: 1}, + {Lo: 0x27A1, Hi: 0x27A1, Stride: 1}, + {Lo: 0x27B0, Hi: 0x27B0, Stride: 1}, + {Lo: 0x27BF, Hi: 0x27BF, Stride: 1}, + {Lo: 0x2934, Hi: 0x2935, Stride: 1}, + {Lo: 0x2B05, Hi: 0x2B07, Stride: 1}, + {Lo: 0x2B1B, Hi: 0x2B1C, Stride: 1}, + {Lo: 0x2B50, Hi: 0x2B50, Stride: 1}, + {Lo: 0x2B55, Hi: 0x2B55, Stride: 1}, + {Lo: 0x3030, Hi: 0x3030, Stride: 1}, + {Lo: 0x303D, Hi: 0x303D, Stride: 1}, + {Lo: 0x3297, Hi: 0x3297, Stride: 1}, + {Lo: 0x3299, Hi: 0x3299, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x1F004, Hi: 0x1F004, Stride: 1}, + {Lo: 0x1F02C, Hi: 0x1F02F, Stride: 1}, + {Lo: 0x1F094, Hi: 0x1F09F, Stride: 1}, + {Lo: 0x1F0AF, Hi: 0x1F0B0, Stride: 1}, + {Lo: 0x1F0C0, Hi: 0x1F0C0, Stride: 1}, + {Lo: 0x1F0CF, Hi: 0x1F0D0, Stride: 1}, + {Lo: 0x1F0F6, Hi: 0x1F0FF, Stride: 1}, + {Lo: 0x1F170, Hi: 0x1F171, Stride: 1}, + {Lo: 0x1F17E, Hi: 0x1F17F, Stride: 1}, + {Lo: 0x1F18E, Hi: 0x1F18E, Stride: 1}, + {Lo: 0x1F191, Hi: 0x1F19A, Stride: 1}, + {Lo: 0x1F1AE, Hi: 0x1F1E5, Stride: 1}, + {Lo: 0x1F201, Hi: 0x1F20F, Stride: 1}, + {Lo: 0x1F21A, Hi: 0x1F21A, Stride: 1}, + {Lo: 0x1F22F, Hi: 0x1F22F, Stride: 1}, + {Lo: 0x1F232, Hi: 0x1F23A, Stride: 1}, + {Lo: 0x1F23C, Hi: 0x1F23F, Stride: 1}, + {Lo: 0x1F249, Hi: 0x1F25F, Stride: 1}, + {Lo: 0x1F266, Hi: 0x1F321, Stride: 1}, + {Lo: 0x1F324, Hi: 0x1F393, Stride: 1}, + {Lo: 0x1F396, Hi: 0x1F397, Stride: 1}, + {Lo: 0x1F399, Hi: 0x1F39B, Stride: 1}, + {Lo: 0x1F39E, Hi: 0x1F3F0, Stride: 1}, + {Lo: 0x1F3F3, Hi: 0x1F3F5, Stride: 1}, + {Lo: 0x1F3F7, Hi: 0x1F3FA, Stride: 1}, + {Lo: 0x1F400, Hi: 0x1F4FD, Stride: 1}, + {Lo: 0x1F4FF, Hi: 0x1F53D, Stride: 1}, + {Lo: 0x1F549, Hi: 0x1F54E, Stride: 1}, + {Lo: 0x1F550, Hi: 0x1F567, Stride: 1}, + {Lo: 0x1F56F, Hi: 0x1F570, Stride: 1}, + {Lo: 0x1F573, Hi: 0x1F57A, Stride: 1}, + {Lo: 0x1F587, Hi: 0x1F587, Stride: 1}, + {Lo: 0x1F58A, Hi: 0x1F58D, Stride: 1}, + {Lo: 0x1F590, Hi: 0x1F590, Stride: 1}, + {Lo: 0x1F595, Hi: 0x1F596, Stride: 1}, + {Lo: 0x1F5A4, Hi: 0x1F5A5, Stride: 1}, + {Lo: 0x1F5A8, Hi: 0x1F5A8, Stride: 1}, + {Lo: 0x1F5B1, Hi: 0x1F5B2, Stride: 1}, + {Lo: 0x1F5BC, Hi: 0x1F5BC, Stride: 1}, + {Lo: 0x1F5C2, Hi: 0x1F5C4, Stride: 1}, + {Lo: 0x1F5D1, Hi: 0x1F5D3, Stride: 1}, + {Lo: 0x1F5DC, Hi: 0x1F5DE, Stride: 1}, + {Lo: 0x1F5E1, Hi: 0x1F5E1, Stride: 1}, + {Lo: 0x1F5E3, Hi: 0x1F5E3, Stride: 1}, + {Lo: 0x1F5E8, Hi: 0x1F5E8, Stride: 1}, + {Lo: 0x1F5EF, Hi: 0x1F5EF, Stride: 1}, + {Lo: 0x1F5F3, Hi: 0x1F5F3, Stride: 1}, + {Lo: 0x1F5FA, Hi: 0x1F64F, Stride: 1}, + {Lo: 0x1F680, Hi: 0x1F6C5, Stride: 1}, + {Lo: 0x1F6CB, Hi: 0x1F6D2, Stride: 1}, + {Lo: 0x1F6D5, Hi: 0x1F6E5, Stride: 1}, + {Lo: 0x1F6E9, Hi: 0x1F6E9, Stride: 1}, + {Lo: 0x1F6EB, Hi: 0x1F6F0, Stride: 1}, + {Lo: 0x1F6F3, Hi: 0x1F6FF, Stride: 1}, + {Lo: 0x1F7DA, Hi: 0x1F7FF, Stride: 1}, + {Lo: 0x1F80C, Hi: 0x1F80F, Stride: 1}, + {Lo: 0x1F848, Hi: 0x1F84F, Stride: 1}, + {Lo: 0x1F85A, Hi: 0x1F85F, Stride: 1}, + {Lo: 0x1F888, Hi: 0x1F88F, Stride: 1}, + {Lo: 0x1F8AE, Hi: 0x1F8AF, Stride: 1}, + {Lo: 0x1F8BC, Hi: 0x1F8BF, Stride: 1}, + {Lo: 0x1F8C2, Hi: 0x1F8CF, Stride: 1}, + {Lo: 0x1F8D9, Hi: 0x1F8FF, Stride: 1}, + {Lo: 0x1F90C, Hi: 0x1F93A, Stride: 1}, + {Lo: 0x1F93C, Hi: 0x1F945, Stride: 1}, + {Lo: 0x1F947, Hi: 0x1F9FF, Stride: 1}, + {Lo: 0x1FA58, Hi: 0x1FA5F, Stride: 1}, + {Lo: 0x1FA6E, Hi: 0x1FAFF, Stride: 1}, + {Lo: 0x1FC00, Hi: 0x1FFFD, Stride: 1}, + }, +} + +var unicodeAliasGrapheme_Cluster_Break_CR = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0xD, Hi: 0xD, Stride: 1}, + }, +} + +var unicodeAliasGrapheme_Cluster_Break_Control = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x0, Hi: 0x9, Stride: 1}, + {Lo: 0xB, Hi: 0xC, Stride: 1}, + {Lo: 0xE, Hi: 0x1F, Stride: 1}, + {Lo: 0x7F, Hi: 0x9F, Stride: 1}, + {Lo: 0xAD, Hi: 0xAD, Stride: 1}, + {Lo: 0x61C, Hi: 0x61C, Stride: 1}, + {Lo: 0x180E, Hi: 0x180E, Stride: 1}, + {Lo: 0x200B, Hi: 0x200B, Stride: 1}, + {Lo: 0x200E, Hi: 0x200F, Stride: 1}, + {Lo: 0x2028, Hi: 0x202E, Stride: 1}, + {Lo: 0x2060, Hi: 0x206F, Stride: 1}, + {Lo: 0xFEFF, Hi: 0xFEFF, Stride: 1}, + {Lo: 0xFFF0, Hi: 0xFFFB, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x13430, Hi: 0x1343F, Stride: 1}, + {Lo: 0x1BCA0, Hi: 0x1BCA3, Stride: 1}, + {Lo: 0x1D173, Hi: 0x1D17A, Stride: 1}, + {Lo: 0xE0000, Hi: 0xE001F, Stride: 1}, + {Lo: 0xE0080, Hi: 0xE00FF, Stride: 1}, + {Lo: 0xE01F0, Hi: 0xE0FFF, Stride: 1}, + }, +} + +var unicodeAliasGrapheme_Cluster_Break_Extend = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x300, Hi: 0x36F, Stride: 1}, + {Lo: 0x483, Hi: 0x489, Stride: 1}, + {Lo: 0x591, Hi: 0x5BD, Stride: 1}, + {Lo: 0x5BF, Hi: 0x5BF, Stride: 1}, + {Lo: 0x5C1, Hi: 0x5C2, Stride: 1}, + {Lo: 0x5C4, Hi: 0x5C5, Stride: 1}, + {Lo: 0x5C7, Hi: 0x5C7, Stride: 1}, + {Lo: 0x610, Hi: 0x61A, Stride: 1}, + {Lo: 0x64B, Hi: 0x65F, Stride: 1}, + {Lo: 0x670, Hi: 0x670, Stride: 1}, + {Lo: 0x6D6, Hi: 0x6DC, Stride: 1}, + {Lo: 0x6DF, Hi: 0x6E4, Stride: 1}, + {Lo: 0x6E7, Hi: 0x6E8, Stride: 1}, + {Lo: 0x6EA, Hi: 0x6ED, Stride: 1}, + {Lo: 0x711, Hi: 0x711, Stride: 1}, + {Lo: 0x730, Hi: 0x74A, Stride: 1}, + {Lo: 0x7A6, Hi: 0x7B0, Stride: 1}, + {Lo: 0x7EB, Hi: 0x7F3, Stride: 1}, + {Lo: 0x7FD, Hi: 0x7FD, Stride: 1}, + {Lo: 0x816, Hi: 0x819, Stride: 1}, + {Lo: 0x81B, Hi: 0x823, Stride: 1}, + {Lo: 0x825, Hi: 0x827, Stride: 1}, + {Lo: 0x829, Hi: 0x82D, Stride: 1}, + {Lo: 0x859, Hi: 0x85B, Stride: 1}, + {Lo: 0x897, Hi: 0x89F, Stride: 1}, + {Lo: 0x8CA, Hi: 0x8E1, Stride: 1}, + {Lo: 0x8E3, Hi: 0x902, Stride: 1}, + {Lo: 0x93A, Hi: 0x93A, Stride: 1}, + {Lo: 0x93C, Hi: 0x93C, Stride: 1}, + {Lo: 0x941, Hi: 0x948, Stride: 1}, + {Lo: 0x94D, Hi: 0x94D, Stride: 1}, + {Lo: 0x951, Hi: 0x957, Stride: 1}, + {Lo: 0x962, Hi: 0x963, Stride: 1}, + {Lo: 0x981, Hi: 0x981, Stride: 1}, + {Lo: 0x9BC, Hi: 0x9BC, Stride: 1}, + {Lo: 0x9BE, Hi: 0x9BE, Stride: 1}, + {Lo: 0x9C1, Hi: 0x9C4, Stride: 1}, + {Lo: 0x9CD, Hi: 0x9CD, Stride: 1}, + {Lo: 0x9D7, Hi: 0x9D7, Stride: 1}, + {Lo: 0x9E2, Hi: 0x9E3, Stride: 1}, + {Lo: 0x9FE, Hi: 0x9FE, Stride: 1}, + {Lo: 0xA01, Hi: 0xA02, Stride: 1}, + {Lo: 0xA3C, Hi: 0xA3C, Stride: 1}, + {Lo: 0xA41, Hi: 0xA42, Stride: 1}, + {Lo: 0xA47, Hi: 0xA48, Stride: 1}, + {Lo: 0xA4B, Hi: 0xA4D, Stride: 1}, + {Lo: 0xA51, Hi: 0xA51, Stride: 1}, + {Lo: 0xA70, Hi: 0xA71, Stride: 1}, + {Lo: 0xA75, Hi: 0xA75, Stride: 1}, + {Lo: 0xA81, Hi: 0xA82, Stride: 1}, + {Lo: 0xABC, Hi: 0xABC, Stride: 1}, + {Lo: 0xAC1, Hi: 0xAC5, Stride: 1}, + {Lo: 0xAC7, Hi: 0xAC8, Stride: 1}, + {Lo: 0xACD, Hi: 0xACD, Stride: 1}, + {Lo: 0xAE2, Hi: 0xAE3, Stride: 1}, + {Lo: 0xAFA, Hi: 0xAFF, Stride: 1}, + {Lo: 0xB01, Hi: 0xB01, Stride: 1}, + {Lo: 0xB3C, Hi: 0xB3C, Stride: 1}, + {Lo: 0xB3E, Hi: 0xB3F, Stride: 1}, + {Lo: 0xB41, Hi: 0xB44, Stride: 1}, + {Lo: 0xB4D, Hi: 0xB4D, Stride: 1}, + {Lo: 0xB55, Hi: 0xB57, Stride: 1}, + {Lo: 0xB62, Hi: 0xB63, Stride: 1}, + {Lo: 0xB82, Hi: 0xB82, Stride: 1}, + {Lo: 0xBBE, Hi: 0xBBE, Stride: 1}, + {Lo: 0xBC0, Hi: 0xBC0, Stride: 1}, + {Lo: 0xBCD, Hi: 0xBCD, Stride: 1}, + {Lo: 0xBD7, Hi: 0xBD7, Stride: 1}, + {Lo: 0xC00, Hi: 0xC00, Stride: 1}, + {Lo: 0xC04, Hi: 0xC04, Stride: 1}, + {Lo: 0xC3C, Hi: 0xC3C, Stride: 1}, + {Lo: 0xC3E, Hi: 0xC40, Stride: 1}, + {Lo: 0xC46, Hi: 0xC48, Stride: 1}, + {Lo: 0xC4A, Hi: 0xC4D, Stride: 1}, + {Lo: 0xC55, Hi: 0xC56, Stride: 1}, + {Lo: 0xC62, Hi: 0xC63, Stride: 1}, + {Lo: 0xC81, Hi: 0xC81, Stride: 1}, + {Lo: 0xCBC, Hi: 0xCBC, Stride: 1}, + {Lo: 0xCBF, Hi: 0xCC0, Stride: 1}, + {Lo: 0xCC2, Hi: 0xCC2, Stride: 1}, + {Lo: 0xCC6, Hi: 0xCC8, Stride: 1}, + {Lo: 0xCCA, Hi: 0xCCD, Stride: 1}, + {Lo: 0xCD5, Hi: 0xCD6, Stride: 1}, + {Lo: 0xCE2, Hi: 0xCE3, Stride: 1}, + {Lo: 0xD00, Hi: 0xD01, Stride: 1}, + {Lo: 0xD3B, Hi: 0xD3C, Stride: 1}, + {Lo: 0xD3E, Hi: 0xD3E, Stride: 1}, + {Lo: 0xD41, Hi: 0xD44, Stride: 1}, + {Lo: 0xD4D, Hi: 0xD4D, Stride: 1}, + {Lo: 0xD57, Hi: 0xD57, Stride: 1}, + {Lo: 0xD62, Hi: 0xD63, Stride: 1}, + {Lo: 0xD81, Hi: 0xD81, Stride: 1}, + {Lo: 0xDCA, Hi: 0xDCA, Stride: 1}, + {Lo: 0xDCF, Hi: 0xDCF, Stride: 1}, + {Lo: 0xDD2, Hi: 0xDD4, Stride: 1}, + {Lo: 0xDD6, Hi: 0xDD6, Stride: 1}, + {Lo: 0xDDF, Hi: 0xDDF, Stride: 1}, + {Lo: 0xE31, Hi: 0xE31, Stride: 1}, + {Lo: 0xE34, Hi: 0xE3A, Stride: 1}, + {Lo: 0xE47, Hi: 0xE4E, Stride: 1}, + {Lo: 0xEB1, Hi: 0xEB1, Stride: 1}, + {Lo: 0xEB4, Hi: 0xEBC, Stride: 1}, + {Lo: 0xEC8, Hi: 0xECE, Stride: 1}, + {Lo: 0xF18, Hi: 0xF19, Stride: 1}, + {Lo: 0xF35, Hi: 0xF35, Stride: 1}, + {Lo: 0xF37, Hi: 0xF37, Stride: 1}, + {Lo: 0xF39, Hi: 0xF39, Stride: 1}, + {Lo: 0xF71, Hi: 0xF7E, Stride: 1}, + {Lo: 0xF80, Hi: 0xF84, Stride: 1}, + {Lo: 0xF86, Hi: 0xF87, Stride: 1}, + {Lo: 0xF8D, Hi: 0xF97, Stride: 1}, + {Lo: 0xF99, Hi: 0xFBC, Stride: 1}, + {Lo: 0xFC6, Hi: 0xFC6, Stride: 1}, + {Lo: 0x102D, Hi: 0x1030, Stride: 1}, + {Lo: 0x1032, Hi: 0x1037, Stride: 1}, + {Lo: 0x1039, Hi: 0x103A, Stride: 1}, + {Lo: 0x103D, Hi: 0x103E, Stride: 1}, + {Lo: 0x1058, Hi: 0x1059, Stride: 1}, + {Lo: 0x105E, Hi: 0x1060, Stride: 1}, + {Lo: 0x1071, Hi: 0x1074, Stride: 1}, + {Lo: 0x1082, Hi: 0x1082, Stride: 1}, + {Lo: 0x1085, Hi: 0x1086, Stride: 1}, + {Lo: 0x108D, Hi: 0x108D, Stride: 1}, + {Lo: 0x109D, Hi: 0x109D, Stride: 1}, + {Lo: 0x135D, Hi: 0x135F, Stride: 1}, + {Lo: 0x1712, Hi: 0x1715, Stride: 1}, + {Lo: 0x1732, Hi: 0x1734, Stride: 1}, + {Lo: 0x1752, Hi: 0x1753, Stride: 1}, + {Lo: 0x1772, Hi: 0x1773, Stride: 1}, + {Lo: 0x17B4, Hi: 0x17B5, Stride: 1}, + {Lo: 0x17B7, Hi: 0x17BD, Stride: 1}, + {Lo: 0x17C6, Hi: 0x17C6, Stride: 1}, + {Lo: 0x17C9, Hi: 0x17D3, Stride: 1}, + {Lo: 0x17DD, Hi: 0x17DD, Stride: 1}, + {Lo: 0x180B, Hi: 0x180D, Stride: 1}, + {Lo: 0x180F, Hi: 0x180F, Stride: 1}, + {Lo: 0x1885, Hi: 0x1886, Stride: 1}, + {Lo: 0x18A9, Hi: 0x18A9, Stride: 1}, + {Lo: 0x1920, Hi: 0x1922, Stride: 1}, + {Lo: 0x1927, Hi: 0x1928, Stride: 1}, + {Lo: 0x1932, Hi: 0x1932, Stride: 1}, + {Lo: 0x1939, Hi: 0x193B, Stride: 1}, + {Lo: 0x1A17, Hi: 0x1A18, Stride: 1}, + {Lo: 0x1A1B, Hi: 0x1A1B, Stride: 1}, + {Lo: 0x1A56, Hi: 0x1A56, Stride: 1}, + {Lo: 0x1A58, Hi: 0x1A5E, Stride: 1}, + {Lo: 0x1A60, Hi: 0x1A60, Stride: 1}, + {Lo: 0x1A62, Hi: 0x1A62, Stride: 1}, + {Lo: 0x1A65, Hi: 0x1A6C, Stride: 1}, + {Lo: 0x1A73, Hi: 0x1A7C, Stride: 1}, + {Lo: 0x1A7F, Hi: 0x1A7F, Stride: 1}, + {Lo: 0x1AB0, Hi: 0x1ADD, Stride: 1}, + {Lo: 0x1AE0, Hi: 0x1AEB, Stride: 1}, + {Lo: 0x1B00, Hi: 0x1B03, Stride: 1}, + {Lo: 0x1B34, Hi: 0x1B3D, Stride: 1}, + {Lo: 0x1B42, Hi: 0x1B44, Stride: 1}, + {Lo: 0x1B6B, Hi: 0x1B73, Stride: 1}, + {Lo: 0x1B80, Hi: 0x1B81, Stride: 1}, + {Lo: 0x1BA2, Hi: 0x1BA5, Stride: 1}, + {Lo: 0x1BA8, Hi: 0x1BAD, Stride: 1}, + {Lo: 0x1BE6, Hi: 0x1BE6, Stride: 1}, + {Lo: 0x1BE8, Hi: 0x1BE9, Stride: 1}, + {Lo: 0x1BED, Hi: 0x1BED, Stride: 1}, + {Lo: 0x1BEF, Hi: 0x1BF3, Stride: 1}, + {Lo: 0x1C2C, Hi: 0x1C33, Stride: 1}, + {Lo: 0x1C36, Hi: 0x1C37, Stride: 1}, + {Lo: 0x1CD0, Hi: 0x1CD2, Stride: 1}, + {Lo: 0x1CD4, Hi: 0x1CE0, Stride: 1}, + {Lo: 0x1CE2, Hi: 0x1CE8, Stride: 1}, + {Lo: 0x1CED, Hi: 0x1CED, Stride: 1}, + {Lo: 0x1CF4, Hi: 0x1CF4, Stride: 1}, + {Lo: 0x1CF8, Hi: 0x1CF9, Stride: 1}, + {Lo: 0x1DC0, Hi: 0x1DFF, Stride: 1}, + {Lo: 0x200C, Hi: 0x200C, Stride: 1}, + {Lo: 0x20D0, Hi: 0x20F0, Stride: 1}, + {Lo: 0x2CEF, Hi: 0x2CF1, Stride: 1}, + {Lo: 0x2D7F, Hi: 0x2D7F, Stride: 1}, + {Lo: 0x2DE0, Hi: 0x2DFF, Stride: 1}, + {Lo: 0x302A, Hi: 0x302F, Stride: 1}, + {Lo: 0x3099, Hi: 0x309A, Stride: 1}, + {Lo: 0xA66F, Hi: 0xA672, Stride: 1}, + {Lo: 0xA674, Hi: 0xA67D, Stride: 1}, + {Lo: 0xA69E, Hi: 0xA69F, Stride: 1}, + {Lo: 0xA6F0, Hi: 0xA6F1, Stride: 1}, + {Lo: 0xA802, Hi: 0xA802, Stride: 1}, + {Lo: 0xA806, Hi: 0xA806, Stride: 1}, + {Lo: 0xA80B, Hi: 0xA80B, Stride: 1}, + {Lo: 0xA825, Hi: 0xA826, Stride: 1}, + {Lo: 0xA82C, Hi: 0xA82C, Stride: 1}, + {Lo: 0xA8C4, Hi: 0xA8C5, Stride: 1}, + {Lo: 0xA8E0, Hi: 0xA8F1, Stride: 1}, + {Lo: 0xA8FF, Hi: 0xA8FF, Stride: 1}, + {Lo: 0xA926, Hi: 0xA92D, Stride: 1}, + {Lo: 0xA947, Hi: 0xA951, Stride: 1}, + {Lo: 0xA953, Hi: 0xA953, Stride: 1}, + {Lo: 0xA980, Hi: 0xA982, Stride: 1}, + {Lo: 0xA9B3, Hi: 0xA9B3, Stride: 1}, + {Lo: 0xA9B6, Hi: 0xA9B9, Stride: 1}, + {Lo: 0xA9BC, Hi: 0xA9BD, Stride: 1}, + {Lo: 0xA9C0, Hi: 0xA9C0, Stride: 1}, + {Lo: 0xA9E5, Hi: 0xA9E5, Stride: 1}, + {Lo: 0xAA29, Hi: 0xAA2E, Stride: 1}, + {Lo: 0xAA31, Hi: 0xAA32, Stride: 1}, + {Lo: 0xAA35, Hi: 0xAA36, Stride: 1}, + {Lo: 0xAA43, Hi: 0xAA43, Stride: 1}, + {Lo: 0xAA4C, Hi: 0xAA4C, Stride: 1}, + {Lo: 0xAA7C, Hi: 0xAA7C, Stride: 1}, + {Lo: 0xAAB0, Hi: 0xAAB0, Stride: 1}, + {Lo: 0xAAB2, Hi: 0xAAB4, Stride: 1}, + {Lo: 0xAAB7, Hi: 0xAAB8, Stride: 1}, + {Lo: 0xAABE, Hi: 0xAABF, Stride: 1}, + {Lo: 0xAAC1, Hi: 0xAAC1, Stride: 1}, + {Lo: 0xAAEC, Hi: 0xAAED, Stride: 1}, + {Lo: 0xAAF6, Hi: 0xAAF6, Stride: 1}, + {Lo: 0xABE5, Hi: 0xABE5, Stride: 1}, + {Lo: 0xABE8, Hi: 0xABE8, Stride: 1}, + {Lo: 0xABED, Hi: 0xABED, Stride: 1}, + {Lo: 0xFB1E, Hi: 0xFB1E, Stride: 1}, + {Lo: 0xFE00, Hi: 0xFE0F, Stride: 1}, + {Lo: 0xFE20, Hi: 0xFE2F, Stride: 1}, + {Lo: 0xFF9E, Hi: 0xFF9F, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x101FD, Hi: 0x101FD, Stride: 1}, + {Lo: 0x102E0, Hi: 0x102E0, Stride: 1}, + {Lo: 0x10376, Hi: 0x1037A, Stride: 1}, + {Lo: 0x10A01, Hi: 0x10A03, Stride: 1}, + {Lo: 0x10A05, Hi: 0x10A06, Stride: 1}, + {Lo: 0x10A0C, Hi: 0x10A0F, Stride: 1}, + {Lo: 0x10A38, Hi: 0x10A3A, Stride: 1}, + {Lo: 0x10A3F, Hi: 0x10A3F, Stride: 1}, + {Lo: 0x10AE5, Hi: 0x10AE6, Stride: 1}, + {Lo: 0x10D24, Hi: 0x10D27, Stride: 1}, + {Lo: 0x10D69, Hi: 0x10D6D, Stride: 1}, + {Lo: 0x10EAB, Hi: 0x10EAC, Stride: 1}, + {Lo: 0x10EFA, Hi: 0x10EFF, Stride: 1}, + {Lo: 0x10F46, Hi: 0x10F50, Stride: 1}, + {Lo: 0x10F82, Hi: 0x10F85, Stride: 1}, + {Lo: 0x11001, Hi: 0x11001, Stride: 1}, + {Lo: 0x11038, Hi: 0x11046, Stride: 1}, + {Lo: 0x11070, Hi: 0x11070, Stride: 1}, + {Lo: 0x11073, Hi: 0x11074, Stride: 1}, + {Lo: 0x1107F, Hi: 0x11081, Stride: 1}, + {Lo: 0x110B3, Hi: 0x110B6, Stride: 1}, + {Lo: 0x110B9, Hi: 0x110BA, Stride: 1}, + {Lo: 0x110C2, Hi: 0x110C2, Stride: 1}, + {Lo: 0x11100, Hi: 0x11102, Stride: 1}, + {Lo: 0x11127, Hi: 0x1112B, Stride: 1}, + {Lo: 0x1112D, Hi: 0x11134, Stride: 1}, + {Lo: 0x11173, Hi: 0x11173, Stride: 1}, + {Lo: 0x11180, Hi: 0x11181, Stride: 1}, + {Lo: 0x111B6, Hi: 0x111BE, Stride: 1}, + {Lo: 0x111C0, Hi: 0x111C0, Stride: 1}, + {Lo: 0x111C9, Hi: 0x111CC, Stride: 1}, + {Lo: 0x111CF, Hi: 0x111CF, Stride: 1}, + {Lo: 0x1122F, Hi: 0x11231, Stride: 1}, + {Lo: 0x11234, Hi: 0x11237, Stride: 1}, + {Lo: 0x1123E, Hi: 0x1123E, Stride: 1}, + {Lo: 0x11241, Hi: 0x11241, Stride: 1}, + {Lo: 0x112DF, Hi: 0x112DF, Stride: 1}, + {Lo: 0x112E3, Hi: 0x112EA, Stride: 1}, + {Lo: 0x11300, Hi: 0x11301, Stride: 1}, + {Lo: 0x1133B, Hi: 0x1133C, Stride: 1}, + {Lo: 0x1133E, Hi: 0x1133E, Stride: 1}, + {Lo: 0x11340, Hi: 0x11340, Stride: 1}, + {Lo: 0x1134D, Hi: 0x1134D, Stride: 1}, + {Lo: 0x11357, Hi: 0x11357, Stride: 1}, + {Lo: 0x11366, Hi: 0x1136C, Stride: 1}, + {Lo: 0x11370, Hi: 0x11374, Stride: 1}, + {Lo: 0x113B8, Hi: 0x113B8, Stride: 1}, + {Lo: 0x113BB, Hi: 0x113C0, Stride: 1}, + {Lo: 0x113C2, Hi: 0x113C2, Stride: 1}, + {Lo: 0x113C5, Hi: 0x113C5, Stride: 1}, + {Lo: 0x113C7, Hi: 0x113C9, Stride: 1}, + {Lo: 0x113CE, Hi: 0x113D0, Stride: 1}, + {Lo: 0x113D2, Hi: 0x113D2, Stride: 1}, + {Lo: 0x113E1, Hi: 0x113E2, Stride: 1}, + {Lo: 0x11438, Hi: 0x1143F, Stride: 1}, + {Lo: 0x11442, Hi: 0x11444, Stride: 1}, + {Lo: 0x11446, Hi: 0x11446, Stride: 1}, + {Lo: 0x1145E, Hi: 0x1145E, Stride: 1}, + {Lo: 0x114B0, Hi: 0x114B0, Stride: 1}, + {Lo: 0x114B3, Hi: 0x114B8, Stride: 1}, + {Lo: 0x114BA, Hi: 0x114BA, Stride: 1}, + {Lo: 0x114BD, Hi: 0x114BD, Stride: 1}, + {Lo: 0x114BF, Hi: 0x114C0, Stride: 1}, + {Lo: 0x114C2, Hi: 0x114C3, Stride: 1}, + {Lo: 0x115AF, Hi: 0x115AF, Stride: 1}, + {Lo: 0x115B2, Hi: 0x115B5, Stride: 1}, + {Lo: 0x115BC, Hi: 0x115BD, Stride: 1}, + {Lo: 0x115BF, Hi: 0x115C0, Stride: 1}, + {Lo: 0x115DC, Hi: 0x115DD, Stride: 1}, + {Lo: 0x11633, Hi: 0x1163A, Stride: 1}, + {Lo: 0x1163D, Hi: 0x1163D, Stride: 1}, + {Lo: 0x1163F, Hi: 0x11640, Stride: 1}, + {Lo: 0x116AB, Hi: 0x116AB, Stride: 1}, + {Lo: 0x116AD, Hi: 0x116AD, Stride: 1}, + {Lo: 0x116B0, Hi: 0x116B7, Stride: 1}, + {Lo: 0x1171D, Hi: 0x1171D, Stride: 1}, + {Lo: 0x1171F, Hi: 0x1171F, Stride: 1}, + {Lo: 0x11722, Hi: 0x11725, Stride: 1}, + {Lo: 0x11727, Hi: 0x1172B, Stride: 1}, + {Lo: 0x1182F, Hi: 0x11837, Stride: 1}, + {Lo: 0x11839, Hi: 0x1183A, Stride: 1}, + {Lo: 0x11930, Hi: 0x11930, Stride: 1}, + {Lo: 0x1193B, Hi: 0x1193E, Stride: 1}, + {Lo: 0x11943, Hi: 0x11943, Stride: 1}, + {Lo: 0x119D4, Hi: 0x119D7, Stride: 1}, + {Lo: 0x119DA, Hi: 0x119DB, Stride: 1}, + {Lo: 0x119E0, Hi: 0x119E0, Stride: 1}, + {Lo: 0x11A01, Hi: 0x11A0A, Stride: 1}, + {Lo: 0x11A33, Hi: 0x11A38, Stride: 1}, + {Lo: 0x11A3B, Hi: 0x11A3E, Stride: 1}, + {Lo: 0x11A47, Hi: 0x11A47, Stride: 1}, + {Lo: 0x11A51, Hi: 0x11A56, Stride: 1}, + {Lo: 0x11A59, Hi: 0x11A5B, Stride: 1}, + {Lo: 0x11A8A, Hi: 0x11A96, Stride: 1}, + {Lo: 0x11A98, Hi: 0x11A99, Stride: 1}, + {Lo: 0x11B60, Hi: 0x11B60, Stride: 1}, + {Lo: 0x11B62, Hi: 0x11B64, Stride: 1}, + {Lo: 0x11B66, Hi: 0x11B66, Stride: 1}, + {Lo: 0x11C30, Hi: 0x11C36, Stride: 1}, + {Lo: 0x11C38, Hi: 0x11C3D, Stride: 1}, + {Lo: 0x11C3F, Hi: 0x11C3F, Stride: 1}, + {Lo: 0x11C92, Hi: 0x11CA7, Stride: 1}, + {Lo: 0x11CAA, Hi: 0x11CB0, Stride: 1}, + {Lo: 0x11CB2, Hi: 0x11CB3, Stride: 1}, + {Lo: 0x11CB5, Hi: 0x11CB6, Stride: 1}, + {Lo: 0x11D31, Hi: 0x11D36, Stride: 1}, + {Lo: 0x11D3A, Hi: 0x11D3A, Stride: 1}, + {Lo: 0x11D3C, Hi: 0x11D3D, Stride: 1}, + {Lo: 0x11D3F, Hi: 0x11D45, Stride: 1}, + {Lo: 0x11D47, Hi: 0x11D47, Stride: 1}, + {Lo: 0x11D90, Hi: 0x11D91, Stride: 1}, + {Lo: 0x11D95, Hi: 0x11D95, Stride: 1}, + {Lo: 0x11D97, Hi: 0x11D97, Stride: 1}, + {Lo: 0x11EF3, Hi: 0x11EF4, Stride: 1}, + {Lo: 0x11F00, Hi: 0x11F01, Stride: 1}, + {Lo: 0x11F36, Hi: 0x11F3A, Stride: 1}, + {Lo: 0x11F40, Hi: 0x11F42, Stride: 1}, + {Lo: 0x11F5A, Hi: 0x11F5A, Stride: 1}, + {Lo: 0x13440, Hi: 0x13440, Stride: 1}, + {Lo: 0x13447, Hi: 0x13455, Stride: 1}, + {Lo: 0x1611E, Hi: 0x16129, Stride: 1}, + {Lo: 0x1612D, Hi: 0x1612F, Stride: 1}, + {Lo: 0x16AF0, Hi: 0x16AF4, Stride: 1}, + {Lo: 0x16B30, Hi: 0x16B36, Stride: 1}, + {Lo: 0x16F4F, Hi: 0x16F4F, Stride: 1}, + {Lo: 0x16F8F, Hi: 0x16F92, Stride: 1}, + {Lo: 0x16FE4, Hi: 0x16FE4, Stride: 1}, + {Lo: 0x16FF0, Hi: 0x16FF1, Stride: 1}, + {Lo: 0x1BC9D, Hi: 0x1BC9E, Stride: 1}, + {Lo: 0x1CF00, Hi: 0x1CF2D, Stride: 1}, + {Lo: 0x1CF30, Hi: 0x1CF46, Stride: 1}, + {Lo: 0x1D165, Hi: 0x1D169, Stride: 1}, + {Lo: 0x1D16D, Hi: 0x1D172, Stride: 1}, + {Lo: 0x1D17B, Hi: 0x1D182, Stride: 1}, + {Lo: 0x1D185, Hi: 0x1D18B, Stride: 1}, + {Lo: 0x1D1AA, Hi: 0x1D1AD, Stride: 1}, + {Lo: 0x1D242, Hi: 0x1D244, Stride: 1}, + {Lo: 0x1DA00, Hi: 0x1DA36, Stride: 1}, + {Lo: 0x1DA3B, Hi: 0x1DA6C, Stride: 1}, + {Lo: 0x1DA75, Hi: 0x1DA75, Stride: 1}, + {Lo: 0x1DA84, Hi: 0x1DA84, Stride: 1}, + {Lo: 0x1DA9B, Hi: 0x1DA9F, Stride: 1}, + {Lo: 0x1DAA1, Hi: 0x1DAAF, Stride: 1}, + {Lo: 0x1E000, Hi: 0x1E006, Stride: 1}, + {Lo: 0x1E008, Hi: 0x1E018, Stride: 1}, + {Lo: 0x1E01B, Hi: 0x1E021, Stride: 1}, + {Lo: 0x1E023, Hi: 0x1E024, Stride: 1}, + {Lo: 0x1E026, Hi: 0x1E02A, Stride: 1}, + {Lo: 0x1E08F, Hi: 0x1E08F, Stride: 1}, + {Lo: 0x1E130, Hi: 0x1E136, Stride: 1}, + {Lo: 0x1E2AE, Hi: 0x1E2AE, Stride: 1}, + {Lo: 0x1E2EC, Hi: 0x1E2EF, Stride: 1}, + {Lo: 0x1E4EC, Hi: 0x1E4EF, Stride: 1}, + {Lo: 0x1E5EE, Hi: 0x1E5EF, Stride: 1}, + {Lo: 0x1E6E3, Hi: 0x1E6E3, Stride: 1}, + {Lo: 0x1E6E6, Hi: 0x1E6E6, Stride: 1}, + {Lo: 0x1E6EE, Hi: 0x1E6EF, Stride: 1}, + {Lo: 0x1E6F5, Hi: 0x1E6F5, Stride: 1}, + {Lo: 0x1E8D0, Hi: 0x1E8D6, Stride: 1}, + {Lo: 0x1E944, Hi: 0x1E94A, Stride: 1}, + {Lo: 0x1F3FB, Hi: 0x1F3FF, Stride: 1}, + {Lo: 0xE0020, Hi: 0xE007F, Stride: 1}, + {Lo: 0xE0100, Hi: 0xE01EF, Stride: 1}, + }, +} + +var unicodeAliasGrapheme_Cluster_Break_L = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x1100, Hi: 0x115F, Stride: 1}, + {Lo: 0xA960, Hi: 0xA97C, Stride: 1}, + }, +} + +var unicodeAliasGrapheme_Cluster_Break_LF = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0xA, Hi: 0xA, Stride: 1}, + }, +} + +var unicodeAliasGrapheme_Cluster_Break_LV = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0xAC00, Hi: 0xAC00, Stride: 1}, + {Lo: 0xAC1C, Hi: 0xAC1C, Stride: 1}, + {Lo: 0xAC38, Hi: 0xAC38, Stride: 1}, + {Lo: 0xAC54, Hi: 0xAC54, Stride: 1}, + {Lo: 0xAC70, Hi: 0xAC70, Stride: 1}, + {Lo: 0xAC8C, Hi: 0xAC8C, Stride: 1}, + {Lo: 0xACA8, Hi: 0xACA8, Stride: 1}, + {Lo: 0xACC4, Hi: 0xACC4, Stride: 1}, + {Lo: 0xACE0, Hi: 0xACE0, Stride: 1}, + {Lo: 0xACFC, Hi: 0xACFC, Stride: 1}, + {Lo: 0xAD18, Hi: 0xAD18, Stride: 1}, + {Lo: 0xAD34, Hi: 0xAD34, Stride: 1}, + {Lo: 0xAD50, Hi: 0xAD50, Stride: 1}, + {Lo: 0xAD6C, Hi: 0xAD6C, Stride: 1}, + {Lo: 0xAD88, Hi: 0xAD88, Stride: 1}, + {Lo: 0xADA4, Hi: 0xADA4, Stride: 1}, + {Lo: 0xADC0, Hi: 0xADC0, Stride: 1}, + {Lo: 0xADDC, Hi: 0xADDC, Stride: 1}, + {Lo: 0xADF8, Hi: 0xADF8, Stride: 1}, + {Lo: 0xAE14, Hi: 0xAE14, Stride: 1}, + {Lo: 0xAE30, Hi: 0xAE30, Stride: 1}, + {Lo: 0xAE4C, Hi: 0xAE4C, Stride: 1}, + {Lo: 0xAE68, Hi: 0xAE68, Stride: 1}, + {Lo: 0xAE84, Hi: 0xAE84, Stride: 1}, + {Lo: 0xAEA0, Hi: 0xAEA0, Stride: 1}, + {Lo: 0xAEBC, Hi: 0xAEBC, Stride: 1}, + {Lo: 0xAED8, Hi: 0xAED8, Stride: 1}, + {Lo: 0xAEF4, Hi: 0xAEF4, Stride: 1}, + {Lo: 0xAF10, Hi: 0xAF10, Stride: 1}, + {Lo: 0xAF2C, Hi: 0xAF2C, Stride: 1}, + {Lo: 0xAF48, Hi: 0xAF48, Stride: 1}, + {Lo: 0xAF64, Hi: 0xAF64, Stride: 1}, + {Lo: 0xAF80, Hi: 0xAF80, Stride: 1}, + {Lo: 0xAF9C, Hi: 0xAF9C, Stride: 1}, + {Lo: 0xAFB8, Hi: 0xAFB8, Stride: 1}, + {Lo: 0xAFD4, Hi: 0xAFD4, Stride: 1}, + {Lo: 0xAFF0, Hi: 0xAFF0, Stride: 1}, + {Lo: 0xB00C, Hi: 0xB00C, Stride: 1}, + {Lo: 0xB028, Hi: 0xB028, Stride: 1}, + {Lo: 0xB044, Hi: 0xB044, Stride: 1}, + {Lo: 0xB060, Hi: 0xB060, Stride: 1}, + {Lo: 0xB07C, Hi: 0xB07C, Stride: 1}, + {Lo: 0xB098, Hi: 0xB098, Stride: 1}, + {Lo: 0xB0B4, Hi: 0xB0B4, Stride: 1}, + {Lo: 0xB0D0, Hi: 0xB0D0, Stride: 1}, + {Lo: 0xB0EC, Hi: 0xB0EC, Stride: 1}, + {Lo: 0xB108, Hi: 0xB108, Stride: 1}, + {Lo: 0xB124, Hi: 0xB124, Stride: 1}, + {Lo: 0xB140, Hi: 0xB140, Stride: 1}, + {Lo: 0xB15C, Hi: 0xB15C, Stride: 1}, + {Lo: 0xB178, Hi: 0xB178, Stride: 1}, + {Lo: 0xB194, Hi: 0xB194, Stride: 1}, + {Lo: 0xB1B0, Hi: 0xB1B0, Stride: 1}, + {Lo: 0xB1CC, Hi: 0xB1CC, Stride: 1}, + {Lo: 0xB1E8, Hi: 0xB1E8, Stride: 1}, + {Lo: 0xB204, Hi: 0xB204, Stride: 1}, + {Lo: 0xB220, Hi: 0xB220, Stride: 1}, + {Lo: 0xB23C, Hi: 0xB23C, Stride: 1}, + {Lo: 0xB258, Hi: 0xB258, Stride: 1}, + {Lo: 0xB274, Hi: 0xB274, Stride: 1}, + {Lo: 0xB290, Hi: 0xB290, Stride: 1}, + {Lo: 0xB2AC, Hi: 0xB2AC, Stride: 1}, + {Lo: 0xB2C8, Hi: 0xB2C8, Stride: 1}, + {Lo: 0xB2E4, Hi: 0xB2E4, Stride: 1}, + {Lo: 0xB300, Hi: 0xB300, Stride: 1}, + {Lo: 0xB31C, Hi: 0xB31C, Stride: 1}, + {Lo: 0xB338, Hi: 0xB338, Stride: 1}, + {Lo: 0xB354, Hi: 0xB354, Stride: 1}, + {Lo: 0xB370, Hi: 0xB370, Stride: 1}, + {Lo: 0xB38C, Hi: 0xB38C, Stride: 1}, + {Lo: 0xB3A8, Hi: 0xB3A8, Stride: 1}, + {Lo: 0xB3C4, Hi: 0xB3C4, Stride: 1}, + {Lo: 0xB3E0, Hi: 0xB3E0, Stride: 1}, + {Lo: 0xB3FC, Hi: 0xB3FC, Stride: 1}, + {Lo: 0xB418, Hi: 0xB418, Stride: 1}, + {Lo: 0xB434, Hi: 0xB434, Stride: 1}, + {Lo: 0xB450, Hi: 0xB450, Stride: 1}, + {Lo: 0xB46C, Hi: 0xB46C, Stride: 1}, + {Lo: 0xB488, Hi: 0xB488, Stride: 1}, + {Lo: 0xB4A4, Hi: 0xB4A4, Stride: 1}, + {Lo: 0xB4C0, Hi: 0xB4C0, Stride: 1}, + {Lo: 0xB4DC, Hi: 0xB4DC, Stride: 1}, + {Lo: 0xB4F8, Hi: 0xB4F8, Stride: 1}, + {Lo: 0xB514, Hi: 0xB514, Stride: 1}, + {Lo: 0xB530, Hi: 0xB530, Stride: 1}, + {Lo: 0xB54C, Hi: 0xB54C, Stride: 1}, + {Lo: 0xB568, Hi: 0xB568, Stride: 1}, + {Lo: 0xB584, Hi: 0xB584, Stride: 1}, + {Lo: 0xB5A0, Hi: 0xB5A0, Stride: 1}, + {Lo: 0xB5BC, Hi: 0xB5BC, Stride: 1}, + {Lo: 0xB5D8, Hi: 0xB5D8, Stride: 1}, + {Lo: 0xB5F4, Hi: 0xB5F4, Stride: 1}, + {Lo: 0xB610, Hi: 0xB610, Stride: 1}, + {Lo: 0xB62C, Hi: 0xB62C, Stride: 1}, + {Lo: 0xB648, Hi: 0xB648, Stride: 1}, + {Lo: 0xB664, Hi: 0xB664, Stride: 1}, + {Lo: 0xB680, Hi: 0xB680, Stride: 1}, + {Lo: 0xB69C, Hi: 0xB69C, Stride: 1}, + {Lo: 0xB6B8, Hi: 0xB6B8, Stride: 1}, + {Lo: 0xB6D4, Hi: 0xB6D4, Stride: 1}, + {Lo: 0xB6F0, Hi: 0xB6F0, Stride: 1}, + {Lo: 0xB70C, Hi: 0xB70C, Stride: 1}, + {Lo: 0xB728, Hi: 0xB728, Stride: 1}, + {Lo: 0xB744, Hi: 0xB744, Stride: 1}, + {Lo: 0xB760, Hi: 0xB760, Stride: 1}, + {Lo: 0xB77C, Hi: 0xB77C, Stride: 1}, + {Lo: 0xB798, Hi: 0xB798, Stride: 1}, + {Lo: 0xB7B4, Hi: 0xB7B4, Stride: 1}, + {Lo: 0xB7D0, Hi: 0xB7D0, Stride: 1}, + {Lo: 0xB7EC, Hi: 0xB7EC, Stride: 1}, + {Lo: 0xB808, Hi: 0xB808, Stride: 1}, + {Lo: 0xB824, Hi: 0xB824, Stride: 1}, + {Lo: 0xB840, Hi: 0xB840, Stride: 1}, + {Lo: 0xB85C, Hi: 0xB85C, Stride: 1}, + {Lo: 0xB878, Hi: 0xB878, Stride: 1}, + {Lo: 0xB894, Hi: 0xB894, Stride: 1}, + {Lo: 0xB8B0, Hi: 0xB8B0, Stride: 1}, + {Lo: 0xB8CC, Hi: 0xB8CC, Stride: 1}, + {Lo: 0xB8E8, Hi: 0xB8E8, Stride: 1}, + {Lo: 0xB904, Hi: 0xB904, Stride: 1}, + {Lo: 0xB920, Hi: 0xB920, Stride: 1}, + {Lo: 0xB93C, Hi: 0xB93C, Stride: 1}, + {Lo: 0xB958, Hi: 0xB958, Stride: 1}, + {Lo: 0xB974, Hi: 0xB974, Stride: 1}, + {Lo: 0xB990, Hi: 0xB990, Stride: 1}, + {Lo: 0xB9AC, Hi: 0xB9AC, Stride: 1}, + {Lo: 0xB9C8, Hi: 0xB9C8, Stride: 1}, + {Lo: 0xB9E4, Hi: 0xB9E4, Stride: 1}, + {Lo: 0xBA00, Hi: 0xBA00, Stride: 1}, + {Lo: 0xBA1C, Hi: 0xBA1C, Stride: 1}, + {Lo: 0xBA38, Hi: 0xBA38, Stride: 1}, + {Lo: 0xBA54, Hi: 0xBA54, Stride: 1}, + {Lo: 0xBA70, Hi: 0xBA70, Stride: 1}, + {Lo: 0xBA8C, Hi: 0xBA8C, Stride: 1}, + {Lo: 0xBAA8, Hi: 0xBAA8, Stride: 1}, + {Lo: 0xBAC4, Hi: 0xBAC4, Stride: 1}, + {Lo: 0xBAE0, Hi: 0xBAE0, Stride: 1}, + {Lo: 0xBAFC, Hi: 0xBAFC, Stride: 1}, + {Lo: 0xBB18, Hi: 0xBB18, Stride: 1}, + {Lo: 0xBB34, Hi: 0xBB34, Stride: 1}, + {Lo: 0xBB50, Hi: 0xBB50, Stride: 1}, + {Lo: 0xBB6C, Hi: 0xBB6C, Stride: 1}, + {Lo: 0xBB88, Hi: 0xBB88, Stride: 1}, + {Lo: 0xBBA4, Hi: 0xBBA4, Stride: 1}, + {Lo: 0xBBC0, Hi: 0xBBC0, Stride: 1}, + {Lo: 0xBBDC, Hi: 0xBBDC, Stride: 1}, + {Lo: 0xBBF8, Hi: 0xBBF8, Stride: 1}, + {Lo: 0xBC14, Hi: 0xBC14, Stride: 1}, + {Lo: 0xBC30, Hi: 0xBC30, Stride: 1}, + {Lo: 0xBC4C, Hi: 0xBC4C, Stride: 1}, + {Lo: 0xBC68, Hi: 0xBC68, Stride: 1}, + {Lo: 0xBC84, Hi: 0xBC84, Stride: 1}, + {Lo: 0xBCA0, Hi: 0xBCA0, Stride: 1}, + {Lo: 0xBCBC, Hi: 0xBCBC, Stride: 1}, + {Lo: 0xBCD8, Hi: 0xBCD8, Stride: 1}, + {Lo: 0xBCF4, Hi: 0xBCF4, Stride: 1}, + {Lo: 0xBD10, Hi: 0xBD10, Stride: 1}, + {Lo: 0xBD2C, Hi: 0xBD2C, Stride: 1}, + {Lo: 0xBD48, Hi: 0xBD48, Stride: 1}, + {Lo: 0xBD64, Hi: 0xBD64, Stride: 1}, + {Lo: 0xBD80, Hi: 0xBD80, Stride: 1}, + {Lo: 0xBD9C, Hi: 0xBD9C, Stride: 1}, + {Lo: 0xBDB8, Hi: 0xBDB8, Stride: 1}, + {Lo: 0xBDD4, Hi: 0xBDD4, Stride: 1}, + {Lo: 0xBDF0, Hi: 0xBDF0, Stride: 1}, + {Lo: 0xBE0C, Hi: 0xBE0C, Stride: 1}, + {Lo: 0xBE28, Hi: 0xBE28, Stride: 1}, + {Lo: 0xBE44, Hi: 0xBE44, Stride: 1}, + {Lo: 0xBE60, Hi: 0xBE60, Stride: 1}, + {Lo: 0xBE7C, Hi: 0xBE7C, Stride: 1}, + {Lo: 0xBE98, Hi: 0xBE98, Stride: 1}, + {Lo: 0xBEB4, Hi: 0xBEB4, Stride: 1}, + {Lo: 0xBED0, Hi: 0xBED0, Stride: 1}, + {Lo: 0xBEEC, Hi: 0xBEEC, Stride: 1}, + {Lo: 0xBF08, Hi: 0xBF08, Stride: 1}, + {Lo: 0xBF24, Hi: 0xBF24, Stride: 1}, + {Lo: 0xBF40, Hi: 0xBF40, Stride: 1}, + {Lo: 0xBF5C, Hi: 0xBF5C, Stride: 1}, + {Lo: 0xBF78, Hi: 0xBF78, Stride: 1}, + {Lo: 0xBF94, Hi: 0xBF94, Stride: 1}, + {Lo: 0xBFB0, Hi: 0xBFB0, Stride: 1}, + {Lo: 0xBFCC, Hi: 0xBFCC, Stride: 1}, + {Lo: 0xBFE8, Hi: 0xBFE8, Stride: 1}, + {Lo: 0xC004, Hi: 0xC004, Stride: 1}, + {Lo: 0xC020, Hi: 0xC020, Stride: 1}, + {Lo: 0xC03C, Hi: 0xC03C, Stride: 1}, + {Lo: 0xC058, Hi: 0xC058, Stride: 1}, + {Lo: 0xC074, Hi: 0xC074, Stride: 1}, + {Lo: 0xC090, Hi: 0xC090, Stride: 1}, + {Lo: 0xC0AC, Hi: 0xC0AC, Stride: 1}, + {Lo: 0xC0C8, Hi: 0xC0C8, Stride: 1}, + {Lo: 0xC0E4, Hi: 0xC0E4, Stride: 1}, + {Lo: 0xC100, Hi: 0xC100, Stride: 1}, + {Lo: 0xC11C, Hi: 0xC11C, Stride: 1}, + {Lo: 0xC138, Hi: 0xC138, Stride: 1}, + {Lo: 0xC154, Hi: 0xC154, Stride: 1}, + {Lo: 0xC170, Hi: 0xC170, Stride: 1}, + {Lo: 0xC18C, Hi: 0xC18C, Stride: 1}, + {Lo: 0xC1A8, Hi: 0xC1A8, Stride: 1}, + {Lo: 0xC1C4, Hi: 0xC1C4, Stride: 1}, + {Lo: 0xC1E0, Hi: 0xC1E0, Stride: 1}, + {Lo: 0xC1FC, Hi: 0xC1FC, Stride: 1}, + {Lo: 0xC218, Hi: 0xC218, Stride: 1}, + {Lo: 0xC234, Hi: 0xC234, Stride: 1}, + {Lo: 0xC250, Hi: 0xC250, Stride: 1}, + {Lo: 0xC26C, Hi: 0xC26C, Stride: 1}, + {Lo: 0xC288, Hi: 0xC288, Stride: 1}, + {Lo: 0xC2A4, Hi: 0xC2A4, Stride: 1}, + {Lo: 0xC2C0, Hi: 0xC2C0, Stride: 1}, + {Lo: 0xC2DC, Hi: 0xC2DC, Stride: 1}, + {Lo: 0xC2F8, Hi: 0xC2F8, Stride: 1}, + {Lo: 0xC314, Hi: 0xC314, Stride: 1}, + {Lo: 0xC330, Hi: 0xC330, Stride: 1}, + {Lo: 0xC34C, Hi: 0xC34C, Stride: 1}, + {Lo: 0xC368, Hi: 0xC368, Stride: 1}, + {Lo: 0xC384, Hi: 0xC384, Stride: 1}, + {Lo: 0xC3A0, Hi: 0xC3A0, Stride: 1}, + {Lo: 0xC3BC, Hi: 0xC3BC, Stride: 1}, + {Lo: 0xC3D8, Hi: 0xC3D8, Stride: 1}, + {Lo: 0xC3F4, Hi: 0xC3F4, Stride: 1}, + {Lo: 0xC410, Hi: 0xC410, Stride: 1}, + {Lo: 0xC42C, Hi: 0xC42C, Stride: 1}, + {Lo: 0xC448, Hi: 0xC448, Stride: 1}, + {Lo: 0xC464, Hi: 0xC464, Stride: 1}, + {Lo: 0xC480, Hi: 0xC480, Stride: 1}, + {Lo: 0xC49C, Hi: 0xC49C, Stride: 1}, + {Lo: 0xC4B8, Hi: 0xC4B8, Stride: 1}, + {Lo: 0xC4D4, Hi: 0xC4D4, Stride: 1}, + {Lo: 0xC4F0, Hi: 0xC4F0, Stride: 1}, + {Lo: 0xC50C, Hi: 0xC50C, Stride: 1}, + {Lo: 0xC528, Hi: 0xC528, Stride: 1}, + {Lo: 0xC544, Hi: 0xC544, Stride: 1}, + {Lo: 0xC560, Hi: 0xC560, Stride: 1}, + {Lo: 0xC57C, Hi: 0xC57C, Stride: 1}, + {Lo: 0xC598, Hi: 0xC598, Stride: 1}, + {Lo: 0xC5B4, Hi: 0xC5B4, Stride: 1}, + {Lo: 0xC5D0, Hi: 0xC5D0, Stride: 1}, + {Lo: 0xC5EC, Hi: 0xC5EC, Stride: 1}, + {Lo: 0xC608, Hi: 0xC608, Stride: 1}, + {Lo: 0xC624, Hi: 0xC624, Stride: 1}, + {Lo: 0xC640, Hi: 0xC640, Stride: 1}, + {Lo: 0xC65C, Hi: 0xC65C, Stride: 1}, + {Lo: 0xC678, Hi: 0xC678, Stride: 1}, + {Lo: 0xC694, Hi: 0xC694, Stride: 1}, + {Lo: 0xC6B0, Hi: 0xC6B0, Stride: 1}, + {Lo: 0xC6CC, Hi: 0xC6CC, Stride: 1}, + {Lo: 0xC6E8, Hi: 0xC6E8, Stride: 1}, + {Lo: 0xC704, Hi: 0xC704, Stride: 1}, + {Lo: 0xC720, Hi: 0xC720, Stride: 1}, + {Lo: 0xC73C, Hi: 0xC73C, Stride: 1}, + {Lo: 0xC758, Hi: 0xC758, Stride: 1}, + {Lo: 0xC774, Hi: 0xC774, Stride: 1}, + {Lo: 0xC790, Hi: 0xC790, Stride: 1}, + {Lo: 0xC7AC, Hi: 0xC7AC, Stride: 1}, + {Lo: 0xC7C8, Hi: 0xC7C8, Stride: 1}, + {Lo: 0xC7E4, Hi: 0xC7E4, Stride: 1}, + {Lo: 0xC800, Hi: 0xC800, Stride: 1}, + {Lo: 0xC81C, Hi: 0xC81C, Stride: 1}, + {Lo: 0xC838, Hi: 0xC838, Stride: 1}, + {Lo: 0xC854, Hi: 0xC854, Stride: 1}, + {Lo: 0xC870, Hi: 0xC870, Stride: 1}, + {Lo: 0xC88C, Hi: 0xC88C, Stride: 1}, + {Lo: 0xC8A8, Hi: 0xC8A8, Stride: 1}, + {Lo: 0xC8C4, Hi: 0xC8C4, Stride: 1}, + {Lo: 0xC8E0, Hi: 0xC8E0, Stride: 1}, + {Lo: 0xC8FC, Hi: 0xC8FC, Stride: 1}, + {Lo: 0xC918, Hi: 0xC918, Stride: 1}, + {Lo: 0xC934, Hi: 0xC934, Stride: 1}, + {Lo: 0xC950, Hi: 0xC950, Stride: 1}, + {Lo: 0xC96C, Hi: 0xC96C, Stride: 1}, + {Lo: 0xC988, Hi: 0xC988, Stride: 1}, + {Lo: 0xC9A4, Hi: 0xC9A4, Stride: 1}, + {Lo: 0xC9C0, Hi: 0xC9C0, Stride: 1}, + {Lo: 0xC9DC, Hi: 0xC9DC, Stride: 1}, + {Lo: 0xC9F8, Hi: 0xC9F8, Stride: 1}, + {Lo: 0xCA14, Hi: 0xCA14, Stride: 1}, + {Lo: 0xCA30, Hi: 0xCA30, Stride: 1}, + {Lo: 0xCA4C, Hi: 0xCA4C, Stride: 1}, + {Lo: 0xCA68, Hi: 0xCA68, Stride: 1}, + {Lo: 0xCA84, Hi: 0xCA84, Stride: 1}, + {Lo: 0xCAA0, Hi: 0xCAA0, Stride: 1}, + {Lo: 0xCABC, Hi: 0xCABC, Stride: 1}, + {Lo: 0xCAD8, Hi: 0xCAD8, Stride: 1}, + {Lo: 0xCAF4, Hi: 0xCAF4, Stride: 1}, + {Lo: 0xCB10, Hi: 0xCB10, Stride: 1}, + {Lo: 0xCB2C, Hi: 0xCB2C, Stride: 1}, + {Lo: 0xCB48, Hi: 0xCB48, Stride: 1}, + {Lo: 0xCB64, Hi: 0xCB64, Stride: 1}, + {Lo: 0xCB80, Hi: 0xCB80, Stride: 1}, + {Lo: 0xCB9C, Hi: 0xCB9C, Stride: 1}, + {Lo: 0xCBB8, Hi: 0xCBB8, Stride: 1}, + {Lo: 0xCBD4, Hi: 0xCBD4, Stride: 1}, + {Lo: 0xCBF0, Hi: 0xCBF0, Stride: 1}, + {Lo: 0xCC0C, Hi: 0xCC0C, Stride: 1}, + {Lo: 0xCC28, Hi: 0xCC28, Stride: 1}, + {Lo: 0xCC44, Hi: 0xCC44, Stride: 1}, + {Lo: 0xCC60, Hi: 0xCC60, Stride: 1}, + {Lo: 0xCC7C, Hi: 0xCC7C, Stride: 1}, + {Lo: 0xCC98, Hi: 0xCC98, Stride: 1}, + {Lo: 0xCCB4, Hi: 0xCCB4, Stride: 1}, + {Lo: 0xCCD0, Hi: 0xCCD0, Stride: 1}, + {Lo: 0xCCEC, Hi: 0xCCEC, Stride: 1}, + {Lo: 0xCD08, Hi: 0xCD08, Stride: 1}, + {Lo: 0xCD24, Hi: 0xCD24, Stride: 1}, + {Lo: 0xCD40, Hi: 0xCD40, Stride: 1}, + {Lo: 0xCD5C, Hi: 0xCD5C, Stride: 1}, + {Lo: 0xCD78, Hi: 0xCD78, Stride: 1}, + {Lo: 0xCD94, Hi: 0xCD94, Stride: 1}, + {Lo: 0xCDB0, Hi: 0xCDB0, Stride: 1}, + {Lo: 0xCDCC, Hi: 0xCDCC, Stride: 1}, + {Lo: 0xCDE8, Hi: 0xCDE8, Stride: 1}, + {Lo: 0xCE04, Hi: 0xCE04, Stride: 1}, + {Lo: 0xCE20, Hi: 0xCE20, Stride: 1}, + {Lo: 0xCE3C, Hi: 0xCE3C, Stride: 1}, + {Lo: 0xCE58, Hi: 0xCE58, Stride: 1}, + {Lo: 0xCE74, Hi: 0xCE74, Stride: 1}, + {Lo: 0xCE90, Hi: 0xCE90, Stride: 1}, + {Lo: 0xCEAC, Hi: 0xCEAC, Stride: 1}, + {Lo: 0xCEC8, Hi: 0xCEC8, Stride: 1}, + {Lo: 0xCEE4, Hi: 0xCEE4, Stride: 1}, + {Lo: 0xCF00, Hi: 0xCF00, Stride: 1}, + {Lo: 0xCF1C, Hi: 0xCF1C, Stride: 1}, + {Lo: 0xCF38, Hi: 0xCF38, Stride: 1}, + {Lo: 0xCF54, Hi: 0xCF54, Stride: 1}, + {Lo: 0xCF70, Hi: 0xCF70, Stride: 1}, + {Lo: 0xCF8C, Hi: 0xCF8C, Stride: 1}, + {Lo: 0xCFA8, Hi: 0xCFA8, Stride: 1}, + {Lo: 0xCFC4, Hi: 0xCFC4, Stride: 1}, + {Lo: 0xCFE0, Hi: 0xCFE0, Stride: 1}, + {Lo: 0xCFFC, Hi: 0xCFFC, Stride: 1}, + {Lo: 0xD018, Hi: 0xD018, Stride: 1}, + {Lo: 0xD034, Hi: 0xD034, Stride: 1}, + {Lo: 0xD050, Hi: 0xD050, Stride: 1}, + {Lo: 0xD06C, Hi: 0xD06C, Stride: 1}, + {Lo: 0xD088, Hi: 0xD088, Stride: 1}, + {Lo: 0xD0A4, Hi: 0xD0A4, Stride: 1}, + {Lo: 0xD0C0, Hi: 0xD0C0, Stride: 1}, + {Lo: 0xD0DC, Hi: 0xD0DC, Stride: 1}, + {Lo: 0xD0F8, Hi: 0xD0F8, Stride: 1}, + {Lo: 0xD114, Hi: 0xD114, Stride: 1}, + {Lo: 0xD130, Hi: 0xD130, Stride: 1}, + {Lo: 0xD14C, Hi: 0xD14C, Stride: 1}, + {Lo: 0xD168, Hi: 0xD168, Stride: 1}, + {Lo: 0xD184, Hi: 0xD184, Stride: 1}, + {Lo: 0xD1A0, Hi: 0xD1A0, Stride: 1}, + {Lo: 0xD1BC, Hi: 0xD1BC, Stride: 1}, + {Lo: 0xD1D8, Hi: 0xD1D8, Stride: 1}, + {Lo: 0xD1F4, Hi: 0xD1F4, Stride: 1}, + {Lo: 0xD210, Hi: 0xD210, Stride: 1}, + {Lo: 0xD22C, Hi: 0xD22C, Stride: 1}, + {Lo: 0xD248, Hi: 0xD248, Stride: 1}, + {Lo: 0xD264, Hi: 0xD264, Stride: 1}, + {Lo: 0xD280, Hi: 0xD280, Stride: 1}, + {Lo: 0xD29C, Hi: 0xD29C, Stride: 1}, + {Lo: 0xD2B8, Hi: 0xD2B8, Stride: 1}, + {Lo: 0xD2D4, Hi: 0xD2D4, Stride: 1}, + {Lo: 0xD2F0, Hi: 0xD2F0, Stride: 1}, + {Lo: 0xD30C, Hi: 0xD30C, Stride: 1}, + {Lo: 0xD328, Hi: 0xD328, Stride: 1}, + {Lo: 0xD344, Hi: 0xD344, Stride: 1}, + {Lo: 0xD360, Hi: 0xD360, Stride: 1}, + {Lo: 0xD37C, Hi: 0xD37C, Stride: 1}, + {Lo: 0xD398, Hi: 0xD398, Stride: 1}, + {Lo: 0xD3B4, Hi: 0xD3B4, Stride: 1}, + {Lo: 0xD3D0, Hi: 0xD3D0, Stride: 1}, + {Lo: 0xD3EC, Hi: 0xD3EC, Stride: 1}, + {Lo: 0xD408, Hi: 0xD408, Stride: 1}, + {Lo: 0xD424, Hi: 0xD424, Stride: 1}, + {Lo: 0xD440, Hi: 0xD440, Stride: 1}, + {Lo: 0xD45C, Hi: 0xD45C, Stride: 1}, + {Lo: 0xD478, Hi: 0xD478, Stride: 1}, + {Lo: 0xD494, Hi: 0xD494, Stride: 1}, + {Lo: 0xD4B0, Hi: 0xD4B0, Stride: 1}, + {Lo: 0xD4CC, Hi: 0xD4CC, Stride: 1}, + {Lo: 0xD4E8, Hi: 0xD4E8, Stride: 1}, + {Lo: 0xD504, Hi: 0xD504, Stride: 1}, + {Lo: 0xD520, Hi: 0xD520, Stride: 1}, + {Lo: 0xD53C, Hi: 0xD53C, Stride: 1}, + {Lo: 0xD558, Hi: 0xD558, Stride: 1}, + {Lo: 0xD574, Hi: 0xD574, Stride: 1}, + {Lo: 0xD590, Hi: 0xD590, Stride: 1}, + {Lo: 0xD5AC, Hi: 0xD5AC, Stride: 1}, + {Lo: 0xD5C8, Hi: 0xD5C8, Stride: 1}, + {Lo: 0xD5E4, Hi: 0xD5E4, Stride: 1}, + {Lo: 0xD600, Hi: 0xD600, Stride: 1}, + {Lo: 0xD61C, Hi: 0xD61C, Stride: 1}, + {Lo: 0xD638, Hi: 0xD638, Stride: 1}, + {Lo: 0xD654, Hi: 0xD654, Stride: 1}, + {Lo: 0xD670, Hi: 0xD670, Stride: 1}, + {Lo: 0xD68C, Hi: 0xD68C, Stride: 1}, + {Lo: 0xD6A8, Hi: 0xD6A8, Stride: 1}, + {Lo: 0xD6C4, Hi: 0xD6C4, Stride: 1}, + {Lo: 0xD6E0, Hi: 0xD6E0, Stride: 1}, + {Lo: 0xD6FC, Hi: 0xD6FC, Stride: 1}, + {Lo: 0xD718, Hi: 0xD718, Stride: 1}, + {Lo: 0xD734, Hi: 0xD734, Stride: 1}, + {Lo: 0xD750, Hi: 0xD750, Stride: 1}, + {Lo: 0xD76C, Hi: 0xD76C, Stride: 1}, + {Lo: 0xD788, Hi: 0xD788, Stride: 1}, + }, +} + +var unicodeAliasGrapheme_Cluster_Break_LVT = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0xAC01, Hi: 0xAC1B, Stride: 1}, + {Lo: 0xAC1D, Hi: 0xAC37, Stride: 1}, + {Lo: 0xAC39, Hi: 0xAC53, Stride: 1}, + {Lo: 0xAC55, Hi: 0xAC6F, Stride: 1}, + {Lo: 0xAC71, Hi: 0xAC8B, Stride: 1}, + {Lo: 0xAC8D, Hi: 0xACA7, Stride: 1}, + {Lo: 0xACA9, Hi: 0xACC3, Stride: 1}, + {Lo: 0xACC5, Hi: 0xACDF, Stride: 1}, + {Lo: 0xACE1, Hi: 0xACFB, Stride: 1}, + {Lo: 0xACFD, Hi: 0xAD17, Stride: 1}, + {Lo: 0xAD19, Hi: 0xAD33, Stride: 1}, + {Lo: 0xAD35, Hi: 0xAD4F, Stride: 1}, + {Lo: 0xAD51, Hi: 0xAD6B, Stride: 1}, + {Lo: 0xAD6D, Hi: 0xAD87, Stride: 1}, + {Lo: 0xAD89, Hi: 0xADA3, Stride: 1}, + {Lo: 0xADA5, Hi: 0xADBF, Stride: 1}, + {Lo: 0xADC1, Hi: 0xADDB, Stride: 1}, + {Lo: 0xADDD, Hi: 0xADF7, Stride: 1}, + {Lo: 0xADF9, Hi: 0xAE13, Stride: 1}, + {Lo: 0xAE15, Hi: 0xAE2F, Stride: 1}, + {Lo: 0xAE31, Hi: 0xAE4B, Stride: 1}, + {Lo: 0xAE4D, Hi: 0xAE67, Stride: 1}, + {Lo: 0xAE69, Hi: 0xAE83, Stride: 1}, + {Lo: 0xAE85, Hi: 0xAE9F, Stride: 1}, + {Lo: 0xAEA1, Hi: 0xAEBB, Stride: 1}, + {Lo: 0xAEBD, Hi: 0xAED7, Stride: 1}, + {Lo: 0xAED9, Hi: 0xAEF3, Stride: 1}, + {Lo: 0xAEF5, Hi: 0xAF0F, Stride: 1}, + {Lo: 0xAF11, Hi: 0xAF2B, Stride: 1}, + {Lo: 0xAF2D, Hi: 0xAF47, Stride: 1}, + {Lo: 0xAF49, Hi: 0xAF63, Stride: 1}, + {Lo: 0xAF65, Hi: 0xAF7F, Stride: 1}, + {Lo: 0xAF81, Hi: 0xAF9B, Stride: 1}, + {Lo: 0xAF9D, Hi: 0xAFB7, Stride: 1}, + {Lo: 0xAFB9, Hi: 0xAFD3, Stride: 1}, + {Lo: 0xAFD5, Hi: 0xAFEF, Stride: 1}, + {Lo: 0xAFF1, Hi: 0xB00B, Stride: 1}, + {Lo: 0xB00D, Hi: 0xB027, Stride: 1}, + {Lo: 0xB029, Hi: 0xB043, Stride: 1}, + {Lo: 0xB045, Hi: 0xB05F, Stride: 1}, + {Lo: 0xB061, Hi: 0xB07B, Stride: 1}, + {Lo: 0xB07D, Hi: 0xB097, Stride: 1}, + {Lo: 0xB099, Hi: 0xB0B3, Stride: 1}, + {Lo: 0xB0B5, Hi: 0xB0CF, Stride: 1}, + {Lo: 0xB0D1, Hi: 0xB0EB, Stride: 1}, + {Lo: 0xB0ED, Hi: 0xB107, Stride: 1}, + {Lo: 0xB109, Hi: 0xB123, Stride: 1}, + {Lo: 0xB125, Hi: 0xB13F, Stride: 1}, + {Lo: 0xB141, Hi: 0xB15B, Stride: 1}, + {Lo: 0xB15D, Hi: 0xB177, Stride: 1}, + {Lo: 0xB179, Hi: 0xB193, Stride: 1}, + {Lo: 0xB195, Hi: 0xB1AF, Stride: 1}, + {Lo: 0xB1B1, Hi: 0xB1CB, Stride: 1}, + {Lo: 0xB1CD, Hi: 0xB1E7, Stride: 1}, + {Lo: 0xB1E9, Hi: 0xB203, Stride: 1}, + {Lo: 0xB205, Hi: 0xB21F, Stride: 1}, + {Lo: 0xB221, Hi: 0xB23B, Stride: 1}, + {Lo: 0xB23D, Hi: 0xB257, Stride: 1}, + {Lo: 0xB259, Hi: 0xB273, Stride: 1}, + {Lo: 0xB275, Hi: 0xB28F, Stride: 1}, + {Lo: 0xB291, Hi: 0xB2AB, Stride: 1}, + {Lo: 0xB2AD, Hi: 0xB2C7, Stride: 1}, + {Lo: 0xB2C9, Hi: 0xB2E3, Stride: 1}, + {Lo: 0xB2E5, Hi: 0xB2FF, Stride: 1}, + {Lo: 0xB301, Hi: 0xB31B, Stride: 1}, + {Lo: 0xB31D, Hi: 0xB337, Stride: 1}, + {Lo: 0xB339, Hi: 0xB353, Stride: 1}, + {Lo: 0xB355, Hi: 0xB36F, Stride: 1}, + {Lo: 0xB371, Hi: 0xB38B, Stride: 1}, + {Lo: 0xB38D, Hi: 0xB3A7, Stride: 1}, + {Lo: 0xB3A9, Hi: 0xB3C3, Stride: 1}, + {Lo: 0xB3C5, Hi: 0xB3DF, Stride: 1}, + {Lo: 0xB3E1, Hi: 0xB3FB, Stride: 1}, + {Lo: 0xB3FD, Hi: 0xB417, Stride: 1}, + {Lo: 0xB419, Hi: 0xB433, Stride: 1}, + {Lo: 0xB435, Hi: 0xB44F, Stride: 1}, + {Lo: 0xB451, Hi: 0xB46B, Stride: 1}, + {Lo: 0xB46D, Hi: 0xB487, Stride: 1}, + {Lo: 0xB489, Hi: 0xB4A3, Stride: 1}, + {Lo: 0xB4A5, Hi: 0xB4BF, Stride: 1}, + {Lo: 0xB4C1, Hi: 0xB4DB, Stride: 1}, + {Lo: 0xB4DD, Hi: 0xB4F7, Stride: 1}, + {Lo: 0xB4F9, Hi: 0xB513, Stride: 1}, + {Lo: 0xB515, Hi: 0xB52F, Stride: 1}, + {Lo: 0xB531, Hi: 0xB54B, Stride: 1}, + {Lo: 0xB54D, Hi: 0xB567, Stride: 1}, + {Lo: 0xB569, Hi: 0xB583, Stride: 1}, + {Lo: 0xB585, Hi: 0xB59F, Stride: 1}, + {Lo: 0xB5A1, Hi: 0xB5BB, Stride: 1}, + {Lo: 0xB5BD, Hi: 0xB5D7, Stride: 1}, + {Lo: 0xB5D9, Hi: 0xB5F3, Stride: 1}, + {Lo: 0xB5F5, Hi: 0xB60F, Stride: 1}, + {Lo: 0xB611, Hi: 0xB62B, Stride: 1}, + {Lo: 0xB62D, Hi: 0xB647, Stride: 1}, + {Lo: 0xB649, Hi: 0xB663, Stride: 1}, + {Lo: 0xB665, Hi: 0xB67F, Stride: 1}, + {Lo: 0xB681, Hi: 0xB69B, Stride: 1}, + {Lo: 0xB69D, Hi: 0xB6B7, Stride: 1}, + {Lo: 0xB6B9, Hi: 0xB6D3, Stride: 1}, + {Lo: 0xB6D5, Hi: 0xB6EF, Stride: 1}, + {Lo: 0xB6F1, Hi: 0xB70B, Stride: 1}, + {Lo: 0xB70D, Hi: 0xB727, Stride: 1}, + {Lo: 0xB729, Hi: 0xB743, Stride: 1}, + {Lo: 0xB745, Hi: 0xB75F, Stride: 1}, + {Lo: 0xB761, Hi: 0xB77B, Stride: 1}, + {Lo: 0xB77D, Hi: 0xB797, Stride: 1}, + {Lo: 0xB799, Hi: 0xB7B3, Stride: 1}, + {Lo: 0xB7B5, Hi: 0xB7CF, Stride: 1}, + {Lo: 0xB7D1, Hi: 0xB7EB, Stride: 1}, + {Lo: 0xB7ED, Hi: 0xB807, Stride: 1}, + {Lo: 0xB809, Hi: 0xB823, Stride: 1}, + {Lo: 0xB825, Hi: 0xB83F, Stride: 1}, + {Lo: 0xB841, Hi: 0xB85B, Stride: 1}, + {Lo: 0xB85D, Hi: 0xB877, Stride: 1}, + {Lo: 0xB879, Hi: 0xB893, Stride: 1}, + {Lo: 0xB895, Hi: 0xB8AF, Stride: 1}, + {Lo: 0xB8B1, Hi: 0xB8CB, Stride: 1}, + {Lo: 0xB8CD, Hi: 0xB8E7, Stride: 1}, + {Lo: 0xB8E9, Hi: 0xB903, Stride: 1}, + {Lo: 0xB905, Hi: 0xB91F, Stride: 1}, + {Lo: 0xB921, Hi: 0xB93B, Stride: 1}, + {Lo: 0xB93D, Hi: 0xB957, Stride: 1}, + {Lo: 0xB959, Hi: 0xB973, Stride: 1}, + {Lo: 0xB975, Hi: 0xB98F, Stride: 1}, + {Lo: 0xB991, Hi: 0xB9AB, Stride: 1}, + {Lo: 0xB9AD, Hi: 0xB9C7, Stride: 1}, + {Lo: 0xB9C9, Hi: 0xB9E3, Stride: 1}, + {Lo: 0xB9E5, Hi: 0xB9FF, Stride: 1}, + {Lo: 0xBA01, Hi: 0xBA1B, Stride: 1}, + {Lo: 0xBA1D, Hi: 0xBA37, Stride: 1}, + {Lo: 0xBA39, Hi: 0xBA53, Stride: 1}, + {Lo: 0xBA55, Hi: 0xBA6F, Stride: 1}, + {Lo: 0xBA71, Hi: 0xBA8B, Stride: 1}, + {Lo: 0xBA8D, Hi: 0xBAA7, Stride: 1}, + {Lo: 0xBAA9, Hi: 0xBAC3, Stride: 1}, + {Lo: 0xBAC5, Hi: 0xBADF, Stride: 1}, + {Lo: 0xBAE1, Hi: 0xBAFB, Stride: 1}, + {Lo: 0xBAFD, Hi: 0xBB17, Stride: 1}, + {Lo: 0xBB19, Hi: 0xBB33, Stride: 1}, + {Lo: 0xBB35, Hi: 0xBB4F, Stride: 1}, + {Lo: 0xBB51, Hi: 0xBB6B, Stride: 1}, + {Lo: 0xBB6D, Hi: 0xBB87, Stride: 1}, + {Lo: 0xBB89, Hi: 0xBBA3, Stride: 1}, + {Lo: 0xBBA5, Hi: 0xBBBF, Stride: 1}, + {Lo: 0xBBC1, Hi: 0xBBDB, Stride: 1}, + {Lo: 0xBBDD, Hi: 0xBBF7, Stride: 1}, + {Lo: 0xBBF9, Hi: 0xBC13, Stride: 1}, + {Lo: 0xBC15, Hi: 0xBC2F, Stride: 1}, + {Lo: 0xBC31, Hi: 0xBC4B, Stride: 1}, + {Lo: 0xBC4D, Hi: 0xBC67, Stride: 1}, + {Lo: 0xBC69, Hi: 0xBC83, Stride: 1}, + {Lo: 0xBC85, Hi: 0xBC9F, Stride: 1}, + {Lo: 0xBCA1, Hi: 0xBCBB, Stride: 1}, + {Lo: 0xBCBD, Hi: 0xBCD7, Stride: 1}, + {Lo: 0xBCD9, Hi: 0xBCF3, Stride: 1}, + {Lo: 0xBCF5, Hi: 0xBD0F, Stride: 1}, + {Lo: 0xBD11, Hi: 0xBD2B, Stride: 1}, + {Lo: 0xBD2D, Hi: 0xBD47, Stride: 1}, + {Lo: 0xBD49, Hi: 0xBD63, Stride: 1}, + {Lo: 0xBD65, Hi: 0xBD7F, Stride: 1}, + {Lo: 0xBD81, Hi: 0xBD9B, Stride: 1}, + {Lo: 0xBD9D, Hi: 0xBDB7, Stride: 1}, + {Lo: 0xBDB9, Hi: 0xBDD3, Stride: 1}, + {Lo: 0xBDD5, Hi: 0xBDEF, Stride: 1}, + {Lo: 0xBDF1, Hi: 0xBE0B, Stride: 1}, + {Lo: 0xBE0D, Hi: 0xBE27, Stride: 1}, + {Lo: 0xBE29, Hi: 0xBE43, Stride: 1}, + {Lo: 0xBE45, Hi: 0xBE5F, Stride: 1}, + {Lo: 0xBE61, Hi: 0xBE7B, Stride: 1}, + {Lo: 0xBE7D, Hi: 0xBE97, Stride: 1}, + {Lo: 0xBE99, Hi: 0xBEB3, Stride: 1}, + {Lo: 0xBEB5, Hi: 0xBECF, Stride: 1}, + {Lo: 0xBED1, Hi: 0xBEEB, Stride: 1}, + {Lo: 0xBEED, Hi: 0xBF07, Stride: 1}, + {Lo: 0xBF09, Hi: 0xBF23, Stride: 1}, + {Lo: 0xBF25, Hi: 0xBF3F, Stride: 1}, + {Lo: 0xBF41, Hi: 0xBF5B, Stride: 1}, + {Lo: 0xBF5D, Hi: 0xBF77, Stride: 1}, + {Lo: 0xBF79, Hi: 0xBF93, Stride: 1}, + {Lo: 0xBF95, Hi: 0xBFAF, Stride: 1}, + {Lo: 0xBFB1, Hi: 0xBFCB, Stride: 1}, + {Lo: 0xBFCD, Hi: 0xBFE7, Stride: 1}, + {Lo: 0xBFE9, Hi: 0xC003, Stride: 1}, + {Lo: 0xC005, Hi: 0xC01F, Stride: 1}, + {Lo: 0xC021, Hi: 0xC03B, Stride: 1}, + {Lo: 0xC03D, Hi: 0xC057, Stride: 1}, + {Lo: 0xC059, Hi: 0xC073, Stride: 1}, + {Lo: 0xC075, Hi: 0xC08F, Stride: 1}, + {Lo: 0xC091, Hi: 0xC0AB, Stride: 1}, + {Lo: 0xC0AD, Hi: 0xC0C7, Stride: 1}, + {Lo: 0xC0C9, Hi: 0xC0E3, Stride: 1}, + {Lo: 0xC0E5, Hi: 0xC0FF, Stride: 1}, + {Lo: 0xC101, Hi: 0xC11B, Stride: 1}, + {Lo: 0xC11D, Hi: 0xC137, Stride: 1}, + {Lo: 0xC139, Hi: 0xC153, Stride: 1}, + {Lo: 0xC155, Hi: 0xC16F, Stride: 1}, + {Lo: 0xC171, Hi: 0xC18B, Stride: 1}, + {Lo: 0xC18D, Hi: 0xC1A7, Stride: 1}, + {Lo: 0xC1A9, Hi: 0xC1C3, Stride: 1}, + {Lo: 0xC1C5, Hi: 0xC1DF, Stride: 1}, + {Lo: 0xC1E1, Hi: 0xC1FB, Stride: 1}, + {Lo: 0xC1FD, Hi: 0xC217, Stride: 1}, + {Lo: 0xC219, Hi: 0xC233, Stride: 1}, + {Lo: 0xC235, Hi: 0xC24F, Stride: 1}, + {Lo: 0xC251, Hi: 0xC26B, Stride: 1}, + {Lo: 0xC26D, Hi: 0xC287, Stride: 1}, + {Lo: 0xC289, Hi: 0xC2A3, Stride: 1}, + {Lo: 0xC2A5, Hi: 0xC2BF, Stride: 1}, + {Lo: 0xC2C1, Hi: 0xC2DB, Stride: 1}, + {Lo: 0xC2DD, Hi: 0xC2F7, Stride: 1}, + {Lo: 0xC2F9, Hi: 0xC313, Stride: 1}, + {Lo: 0xC315, Hi: 0xC32F, Stride: 1}, + {Lo: 0xC331, Hi: 0xC34B, Stride: 1}, + {Lo: 0xC34D, Hi: 0xC367, Stride: 1}, + {Lo: 0xC369, Hi: 0xC383, Stride: 1}, + {Lo: 0xC385, Hi: 0xC39F, Stride: 1}, + {Lo: 0xC3A1, Hi: 0xC3BB, Stride: 1}, + {Lo: 0xC3BD, Hi: 0xC3D7, Stride: 1}, + {Lo: 0xC3D9, Hi: 0xC3F3, Stride: 1}, + {Lo: 0xC3F5, Hi: 0xC40F, Stride: 1}, + {Lo: 0xC411, Hi: 0xC42B, Stride: 1}, + {Lo: 0xC42D, Hi: 0xC447, Stride: 1}, + {Lo: 0xC449, Hi: 0xC463, Stride: 1}, + {Lo: 0xC465, Hi: 0xC47F, Stride: 1}, + {Lo: 0xC481, Hi: 0xC49B, Stride: 1}, + {Lo: 0xC49D, Hi: 0xC4B7, Stride: 1}, + {Lo: 0xC4B9, Hi: 0xC4D3, Stride: 1}, + {Lo: 0xC4D5, Hi: 0xC4EF, Stride: 1}, + {Lo: 0xC4F1, Hi: 0xC50B, Stride: 1}, + {Lo: 0xC50D, Hi: 0xC527, Stride: 1}, + {Lo: 0xC529, Hi: 0xC543, Stride: 1}, + {Lo: 0xC545, Hi: 0xC55F, Stride: 1}, + {Lo: 0xC561, Hi: 0xC57B, Stride: 1}, + {Lo: 0xC57D, Hi: 0xC597, Stride: 1}, + {Lo: 0xC599, Hi: 0xC5B3, Stride: 1}, + {Lo: 0xC5B5, Hi: 0xC5CF, Stride: 1}, + {Lo: 0xC5D1, Hi: 0xC5EB, Stride: 1}, + {Lo: 0xC5ED, Hi: 0xC607, Stride: 1}, + {Lo: 0xC609, Hi: 0xC623, Stride: 1}, + {Lo: 0xC625, Hi: 0xC63F, Stride: 1}, + {Lo: 0xC641, Hi: 0xC65B, Stride: 1}, + {Lo: 0xC65D, Hi: 0xC677, Stride: 1}, + {Lo: 0xC679, Hi: 0xC693, Stride: 1}, + {Lo: 0xC695, Hi: 0xC6AF, Stride: 1}, + {Lo: 0xC6B1, Hi: 0xC6CB, Stride: 1}, + {Lo: 0xC6CD, Hi: 0xC6E7, Stride: 1}, + {Lo: 0xC6E9, Hi: 0xC703, Stride: 1}, + {Lo: 0xC705, Hi: 0xC71F, Stride: 1}, + {Lo: 0xC721, Hi: 0xC73B, Stride: 1}, + {Lo: 0xC73D, Hi: 0xC757, Stride: 1}, + {Lo: 0xC759, Hi: 0xC773, Stride: 1}, + {Lo: 0xC775, Hi: 0xC78F, Stride: 1}, + {Lo: 0xC791, Hi: 0xC7AB, Stride: 1}, + {Lo: 0xC7AD, Hi: 0xC7C7, Stride: 1}, + {Lo: 0xC7C9, Hi: 0xC7E3, Stride: 1}, + {Lo: 0xC7E5, Hi: 0xC7FF, Stride: 1}, + {Lo: 0xC801, Hi: 0xC81B, Stride: 1}, + {Lo: 0xC81D, Hi: 0xC837, Stride: 1}, + {Lo: 0xC839, Hi: 0xC853, Stride: 1}, + {Lo: 0xC855, Hi: 0xC86F, Stride: 1}, + {Lo: 0xC871, Hi: 0xC88B, Stride: 1}, + {Lo: 0xC88D, Hi: 0xC8A7, Stride: 1}, + {Lo: 0xC8A9, Hi: 0xC8C3, Stride: 1}, + {Lo: 0xC8C5, Hi: 0xC8DF, Stride: 1}, + {Lo: 0xC8E1, Hi: 0xC8FB, Stride: 1}, + {Lo: 0xC8FD, Hi: 0xC917, Stride: 1}, + {Lo: 0xC919, Hi: 0xC933, Stride: 1}, + {Lo: 0xC935, Hi: 0xC94F, Stride: 1}, + {Lo: 0xC951, Hi: 0xC96B, Stride: 1}, + {Lo: 0xC96D, Hi: 0xC987, Stride: 1}, + {Lo: 0xC989, Hi: 0xC9A3, Stride: 1}, + {Lo: 0xC9A5, Hi: 0xC9BF, Stride: 1}, + {Lo: 0xC9C1, Hi: 0xC9DB, Stride: 1}, + {Lo: 0xC9DD, Hi: 0xC9F7, Stride: 1}, + {Lo: 0xC9F9, Hi: 0xCA13, Stride: 1}, + {Lo: 0xCA15, Hi: 0xCA2F, Stride: 1}, + {Lo: 0xCA31, Hi: 0xCA4B, Stride: 1}, + {Lo: 0xCA4D, Hi: 0xCA67, Stride: 1}, + {Lo: 0xCA69, Hi: 0xCA83, Stride: 1}, + {Lo: 0xCA85, Hi: 0xCA9F, Stride: 1}, + {Lo: 0xCAA1, Hi: 0xCABB, Stride: 1}, + {Lo: 0xCABD, Hi: 0xCAD7, Stride: 1}, + {Lo: 0xCAD9, Hi: 0xCAF3, Stride: 1}, + {Lo: 0xCAF5, Hi: 0xCB0F, Stride: 1}, + {Lo: 0xCB11, Hi: 0xCB2B, Stride: 1}, + {Lo: 0xCB2D, Hi: 0xCB47, Stride: 1}, + {Lo: 0xCB49, Hi: 0xCB63, Stride: 1}, + {Lo: 0xCB65, Hi: 0xCB7F, Stride: 1}, + {Lo: 0xCB81, Hi: 0xCB9B, Stride: 1}, + {Lo: 0xCB9D, Hi: 0xCBB7, Stride: 1}, + {Lo: 0xCBB9, Hi: 0xCBD3, Stride: 1}, + {Lo: 0xCBD5, Hi: 0xCBEF, Stride: 1}, + {Lo: 0xCBF1, Hi: 0xCC0B, Stride: 1}, + {Lo: 0xCC0D, Hi: 0xCC27, Stride: 1}, + {Lo: 0xCC29, Hi: 0xCC43, Stride: 1}, + {Lo: 0xCC45, Hi: 0xCC5F, Stride: 1}, + {Lo: 0xCC61, Hi: 0xCC7B, Stride: 1}, + {Lo: 0xCC7D, Hi: 0xCC97, Stride: 1}, + {Lo: 0xCC99, Hi: 0xCCB3, Stride: 1}, + {Lo: 0xCCB5, Hi: 0xCCCF, Stride: 1}, + {Lo: 0xCCD1, Hi: 0xCCEB, Stride: 1}, + {Lo: 0xCCED, Hi: 0xCD07, Stride: 1}, + {Lo: 0xCD09, Hi: 0xCD23, Stride: 1}, + {Lo: 0xCD25, Hi: 0xCD3F, Stride: 1}, + {Lo: 0xCD41, Hi: 0xCD5B, Stride: 1}, + {Lo: 0xCD5D, Hi: 0xCD77, Stride: 1}, + {Lo: 0xCD79, Hi: 0xCD93, Stride: 1}, + {Lo: 0xCD95, Hi: 0xCDAF, Stride: 1}, + {Lo: 0xCDB1, Hi: 0xCDCB, Stride: 1}, + {Lo: 0xCDCD, Hi: 0xCDE7, Stride: 1}, + {Lo: 0xCDE9, Hi: 0xCE03, Stride: 1}, + {Lo: 0xCE05, Hi: 0xCE1F, Stride: 1}, + {Lo: 0xCE21, Hi: 0xCE3B, Stride: 1}, + {Lo: 0xCE3D, Hi: 0xCE57, Stride: 1}, + {Lo: 0xCE59, Hi: 0xCE73, Stride: 1}, + {Lo: 0xCE75, Hi: 0xCE8F, Stride: 1}, + {Lo: 0xCE91, Hi: 0xCEAB, Stride: 1}, + {Lo: 0xCEAD, Hi: 0xCEC7, Stride: 1}, + {Lo: 0xCEC9, Hi: 0xCEE3, Stride: 1}, + {Lo: 0xCEE5, Hi: 0xCEFF, Stride: 1}, + {Lo: 0xCF01, Hi: 0xCF1B, Stride: 1}, + {Lo: 0xCF1D, Hi: 0xCF37, Stride: 1}, + {Lo: 0xCF39, Hi: 0xCF53, Stride: 1}, + {Lo: 0xCF55, Hi: 0xCF6F, Stride: 1}, + {Lo: 0xCF71, Hi: 0xCF8B, Stride: 1}, + {Lo: 0xCF8D, Hi: 0xCFA7, Stride: 1}, + {Lo: 0xCFA9, Hi: 0xCFC3, Stride: 1}, + {Lo: 0xCFC5, Hi: 0xCFDF, Stride: 1}, + {Lo: 0xCFE1, Hi: 0xCFFB, Stride: 1}, + {Lo: 0xCFFD, Hi: 0xD017, Stride: 1}, + {Lo: 0xD019, Hi: 0xD033, Stride: 1}, + {Lo: 0xD035, Hi: 0xD04F, Stride: 1}, + {Lo: 0xD051, Hi: 0xD06B, Stride: 1}, + {Lo: 0xD06D, Hi: 0xD087, Stride: 1}, + {Lo: 0xD089, Hi: 0xD0A3, Stride: 1}, + {Lo: 0xD0A5, Hi: 0xD0BF, Stride: 1}, + {Lo: 0xD0C1, Hi: 0xD0DB, Stride: 1}, + {Lo: 0xD0DD, Hi: 0xD0F7, Stride: 1}, + {Lo: 0xD0F9, Hi: 0xD113, Stride: 1}, + {Lo: 0xD115, Hi: 0xD12F, Stride: 1}, + {Lo: 0xD131, Hi: 0xD14B, Stride: 1}, + {Lo: 0xD14D, Hi: 0xD167, Stride: 1}, + {Lo: 0xD169, Hi: 0xD183, Stride: 1}, + {Lo: 0xD185, Hi: 0xD19F, Stride: 1}, + {Lo: 0xD1A1, Hi: 0xD1BB, Stride: 1}, + {Lo: 0xD1BD, Hi: 0xD1D7, Stride: 1}, + {Lo: 0xD1D9, Hi: 0xD1F3, Stride: 1}, + {Lo: 0xD1F5, Hi: 0xD20F, Stride: 1}, + {Lo: 0xD211, Hi: 0xD22B, Stride: 1}, + {Lo: 0xD22D, Hi: 0xD247, Stride: 1}, + {Lo: 0xD249, Hi: 0xD263, Stride: 1}, + {Lo: 0xD265, Hi: 0xD27F, Stride: 1}, + {Lo: 0xD281, Hi: 0xD29B, Stride: 1}, + {Lo: 0xD29D, Hi: 0xD2B7, Stride: 1}, + {Lo: 0xD2B9, Hi: 0xD2D3, Stride: 1}, + {Lo: 0xD2D5, Hi: 0xD2EF, Stride: 1}, + {Lo: 0xD2F1, Hi: 0xD30B, Stride: 1}, + {Lo: 0xD30D, Hi: 0xD327, Stride: 1}, + {Lo: 0xD329, Hi: 0xD343, Stride: 1}, + {Lo: 0xD345, Hi: 0xD35F, Stride: 1}, + {Lo: 0xD361, Hi: 0xD37B, Stride: 1}, + {Lo: 0xD37D, Hi: 0xD397, Stride: 1}, + {Lo: 0xD399, Hi: 0xD3B3, Stride: 1}, + {Lo: 0xD3B5, Hi: 0xD3CF, Stride: 1}, + {Lo: 0xD3D1, Hi: 0xD3EB, Stride: 1}, + {Lo: 0xD3ED, Hi: 0xD407, Stride: 1}, + {Lo: 0xD409, Hi: 0xD423, Stride: 1}, + {Lo: 0xD425, Hi: 0xD43F, Stride: 1}, + {Lo: 0xD441, Hi: 0xD45B, Stride: 1}, + {Lo: 0xD45D, Hi: 0xD477, Stride: 1}, + {Lo: 0xD479, Hi: 0xD493, Stride: 1}, + {Lo: 0xD495, Hi: 0xD4AF, Stride: 1}, + {Lo: 0xD4B1, Hi: 0xD4CB, Stride: 1}, + {Lo: 0xD4CD, Hi: 0xD4E7, Stride: 1}, + {Lo: 0xD4E9, Hi: 0xD503, Stride: 1}, + {Lo: 0xD505, Hi: 0xD51F, Stride: 1}, + {Lo: 0xD521, Hi: 0xD53B, Stride: 1}, + {Lo: 0xD53D, Hi: 0xD557, Stride: 1}, + {Lo: 0xD559, Hi: 0xD573, Stride: 1}, + {Lo: 0xD575, Hi: 0xD58F, Stride: 1}, + {Lo: 0xD591, Hi: 0xD5AB, Stride: 1}, + {Lo: 0xD5AD, Hi: 0xD5C7, Stride: 1}, + {Lo: 0xD5C9, Hi: 0xD5E3, Stride: 1}, + {Lo: 0xD5E5, Hi: 0xD5FF, Stride: 1}, + {Lo: 0xD601, Hi: 0xD61B, Stride: 1}, + {Lo: 0xD61D, Hi: 0xD637, Stride: 1}, + {Lo: 0xD639, Hi: 0xD653, Stride: 1}, + {Lo: 0xD655, Hi: 0xD66F, Stride: 1}, + {Lo: 0xD671, Hi: 0xD68B, Stride: 1}, + {Lo: 0xD68D, Hi: 0xD6A7, Stride: 1}, + {Lo: 0xD6A9, Hi: 0xD6C3, Stride: 1}, + {Lo: 0xD6C5, Hi: 0xD6DF, Stride: 1}, + {Lo: 0xD6E1, Hi: 0xD6FB, Stride: 1}, + {Lo: 0xD6FD, Hi: 0xD717, Stride: 1}, + {Lo: 0xD719, Hi: 0xD733, Stride: 1}, + {Lo: 0xD735, Hi: 0xD74F, Stride: 1}, + {Lo: 0xD751, Hi: 0xD76B, Stride: 1}, + {Lo: 0xD76D, Hi: 0xD787, Stride: 1}, + {Lo: 0xD789, Hi: 0xD7A3, Stride: 1}, + }, +} + +var unicodeAliasGrapheme_Cluster_Break_Prepend = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x600, Hi: 0x605, Stride: 1}, + {Lo: 0x6DD, Hi: 0x6DD, Stride: 1}, + {Lo: 0x70F, Hi: 0x70F, Stride: 1}, + {Lo: 0x890, Hi: 0x891, Stride: 1}, + {Lo: 0x8E2, Hi: 0x8E2, Stride: 1}, + {Lo: 0xD4E, Hi: 0xD4E, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x110BD, Hi: 0x110BD, Stride: 1}, + {Lo: 0x110CD, Hi: 0x110CD, Stride: 1}, + {Lo: 0x111C2, Hi: 0x111C3, Stride: 1}, + {Lo: 0x113D1, Hi: 0x113D1, Stride: 1}, + {Lo: 0x1193F, Hi: 0x1193F, Stride: 1}, + {Lo: 0x11941, Hi: 0x11941, Stride: 1}, + {Lo: 0x11A84, Hi: 0x11A89, Stride: 1}, + {Lo: 0x11D46, Hi: 0x11D46, Stride: 1}, + {Lo: 0x11F02, Hi: 0x11F02, Stride: 1}, + }, +} + +var unicodeAliasGrapheme_Cluster_Break_Regional_Indicator = &unicode.RangeTable{ + R32: []unicode.Range32{ + {Lo: 0x1F1E6, Hi: 0x1F1FF, Stride: 1}, + }, +} + +var unicodeAliasGrapheme_Cluster_Break_SpacingMark = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x903, Hi: 0x903, Stride: 1}, + {Lo: 0x93B, Hi: 0x93B, Stride: 1}, + {Lo: 0x93E, Hi: 0x940, Stride: 1}, + {Lo: 0x949, Hi: 0x94C, Stride: 1}, + {Lo: 0x94E, Hi: 0x94F, Stride: 1}, + {Lo: 0x982, Hi: 0x983, Stride: 1}, + {Lo: 0x9BF, Hi: 0x9C0, Stride: 1}, + {Lo: 0x9C7, Hi: 0x9C8, Stride: 1}, + {Lo: 0x9CB, Hi: 0x9CC, Stride: 1}, + {Lo: 0xA03, Hi: 0xA03, Stride: 1}, + {Lo: 0xA3E, Hi: 0xA40, Stride: 1}, + {Lo: 0xA83, Hi: 0xA83, Stride: 1}, + {Lo: 0xABE, Hi: 0xAC0, Stride: 1}, + {Lo: 0xAC9, Hi: 0xAC9, Stride: 1}, + {Lo: 0xACB, Hi: 0xACC, Stride: 1}, + {Lo: 0xB02, Hi: 0xB03, Stride: 1}, + {Lo: 0xB40, Hi: 0xB40, Stride: 1}, + {Lo: 0xB47, Hi: 0xB48, Stride: 1}, + {Lo: 0xB4B, Hi: 0xB4C, Stride: 1}, + {Lo: 0xBBF, Hi: 0xBBF, Stride: 1}, + {Lo: 0xBC1, Hi: 0xBC2, Stride: 1}, + {Lo: 0xBC6, Hi: 0xBC8, Stride: 1}, + {Lo: 0xBCA, Hi: 0xBCC, Stride: 1}, + {Lo: 0xC01, Hi: 0xC03, Stride: 1}, + {Lo: 0xC41, Hi: 0xC44, Stride: 1}, + {Lo: 0xC82, Hi: 0xC83, Stride: 1}, + {Lo: 0xCBE, Hi: 0xCBE, Stride: 1}, + {Lo: 0xCC1, Hi: 0xCC1, Stride: 1}, + {Lo: 0xCC3, Hi: 0xCC4, Stride: 1}, + {Lo: 0xCF3, Hi: 0xCF3, Stride: 1}, + {Lo: 0xD02, Hi: 0xD03, Stride: 1}, + {Lo: 0xD3F, Hi: 0xD40, Stride: 1}, + {Lo: 0xD46, Hi: 0xD48, Stride: 1}, + {Lo: 0xD4A, Hi: 0xD4C, Stride: 1}, + {Lo: 0xD82, Hi: 0xD83, Stride: 1}, + {Lo: 0xDD0, Hi: 0xDD1, Stride: 1}, + {Lo: 0xDD8, Hi: 0xDDE, Stride: 1}, + {Lo: 0xDF2, Hi: 0xDF3, Stride: 1}, + {Lo: 0xE33, Hi: 0xE33, Stride: 1}, + {Lo: 0xEB3, Hi: 0xEB3, Stride: 1}, + {Lo: 0xF3E, Hi: 0xF3F, Stride: 1}, + {Lo: 0xF7F, Hi: 0xF7F, Stride: 1}, + {Lo: 0x1031, Hi: 0x1031, Stride: 1}, + {Lo: 0x103B, Hi: 0x103C, Stride: 1}, + {Lo: 0x1056, Hi: 0x1057, Stride: 1}, + {Lo: 0x1084, Hi: 0x1084, Stride: 1}, + {Lo: 0x17B6, Hi: 0x17B6, Stride: 1}, + {Lo: 0x17BE, Hi: 0x17C5, Stride: 1}, + {Lo: 0x17C7, Hi: 0x17C8, Stride: 1}, + {Lo: 0x1923, Hi: 0x1926, Stride: 1}, + {Lo: 0x1929, Hi: 0x192B, Stride: 1}, + {Lo: 0x1930, Hi: 0x1931, Stride: 1}, + {Lo: 0x1933, Hi: 0x1938, Stride: 1}, + {Lo: 0x1A19, Hi: 0x1A1A, Stride: 1}, + {Lo: 0x1A55, Hi: 0x1A55, Stride: 1}, + {Lo: 0x1A57, Hi: 0x1A57, Stride: 1}, + {Lo: 0x1A6D, Hi: 0x1A72, Stride: 1}, + {Lo: 0x1B04, Hi: 0x1B04, Stride: 1}, + {Lo: 0x1B3E, Hi: 0x1B41, Stride: 1}, + {Lo: 0x1B82, Hi: 0x1B82, Stride: 1}, + {Lo: 0x1BA1, Hi: 0x1BA1, Stride: 1}, + {Lo: 0x1BA6, Hi: 0x1BA7, Stride: 1}, + {Lo: 0x1BE7, Hi: 0x1BE7, Stride: 1}, + {Lo: 0x1BEA, Hi: 0x1BEC, Stride: 1}, + {Lo: 0x1BEE, Hi: 0x1BEE, Stride: 1}, + {Lo: 0x1C24, Hi: 0x1C2B, Stride: 1}, + {Lo: 0x1C34, Hi: 0x1C35, Stride: 1}, + {Lo: 0x1CE1, Hi: 0x1CE1, Stride: 1}, + {Lo: 0x1CF7, Hi: 0x1CF7, Stride: 1}, + {Lo: 0xA823, Hi: 0xA824, Stride: 1}, + {Lo: 0xA827, Hi: 0xA827, Stride: 1}, + {Lo: 0xA880, Hi: 0xA881, Stride: 1}, + {Lo: 0xA8B4, Hi: 0xA8C3, Stride: 1}, + {Lo: 0xA952, Hi: 0xA952, Stride: 1}, + {Lo: 0xA983, Hi: 0xA983, Stride: 1}, + {Lo: 0xA9B4, Hi: 0xA9B5, Stride: 1}, + {Lo: 0xA9BA, Hi: 0xA9BB, Stride: 1}, + {Lo: 0xA9BE, Hi: 0xA9BF, Stride: 1}, + {Lo: 0xAA2F, Hi: 0xAA30, Stride: 1}, + {Lo: 0xAA33, Hi: 0xAA34, Stride: 1}, + {Lo: 0xAA4D, Hi: 0xAA4D, Stride: 1}, + {Lo: 0xAAEB, Hi: 0xAAEB, Stride: 1}, + {Lo: 0xAAEE, Hi: 0xAAEF, Stride: 1}, + {Lo: 0xAAF5, Hi: 0xAAF5, Stride: 1}, + {Lo: 0xABE3, Hi: 0xABE4, Stride: 1}, + {Lo: 0xABE6, Hi: 0xABE7, Stride: 1}, + {Lo: 0xABE9, Hi: 0xABEA, Stride: 1}, + {Lo: 0xABEC, Hi: 0xABEC, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x11000, Hi: 0x11000, Stride: 1}, + {Lo: 0x11002, Hi: 0x11002, Stride: 1}, + {Lo: 0x11082, Hi: 0x11082, Stride: 1}, + {Lo: 0x110B0, Hi: 0x110B2, Stride: 1}, + {Lo: 0x110B7, Hi: 0x110B8, Stride: 1}, + {Lo: 0x1112C, Hi: 0x1112C, Stride: 1}, + {Lo: 0x11145, Hi: 0x11146, Stride: 1}, + {Lo: 0x11182, Hi: 0x11182, Stride: 1}, + {Lo: 0x111B3, Hi: 0x111B5, Stride: 1}, + {Lo: 0x111BF, Hi: 0x111BF, Stride: 1}, + {Lo: 0x111CE, Hi: 0x111CE, Stride: 1}, + {Lo: 0x1122C, Hi: 0x1122E, Stride: 1}, + {Lo: 0x11232, Hi: 0x11233, Stride: 1}, + {Lo: 0x112E0, Hi: 0x112E2, Stride: 1}, + {Lo: 0x11302, Hi: 0x11303, Stride: 1}, + {Lo: 0x1133F, Hi: 0x1133F, Stride: 1}, + {Lo: 0x11341, Hi: 0x11344, Stride: 1}, + {Lo: 0x11347, Hi: 0x11348, Stride: 1}, + {Lo: 0x1134B, Hi: 0x1134C, Stride: 1}, + {Lo: 0x11362, Hi: 0x11363, Stride: 1}, + {Lo: 0x113B9, Hi: 0x113BA, Stride: 1}, + {Lo: 0x113CA, Hi: 0x113CA, Stride: 1}, + {Lo: 0x113CC, Hi: 0x113CD, Stride: 1}, + {Lo: 0x11435, Hi: 0x11437, Stride: 1}, + {Lo: 0x11440, Hi: 0x11441, Stride: 1}, + {Lo: 0x11445, Hi: 0x11445, Stride: 1}, + {Lo: 0x114B1, Hi: 0x114B2, Stride: 1}, + {Lo: 0x114B9, Hi: 0x114B9, Stride: 1}, + {Lo: 0x114BB, Hi: 0x114BC, Stride: 1}, + {Lo: 0x114BE, Hi: 0x114BE, Stride: 1}, + {Lo: 0x114C1, Hi: 0x114C1, Stride: 1}, + {Lo: 0x115B0, Hi: 0x115B1, Stride: 1}, + {Lo: 0x115B8, Hi: 0x115BB, Stride: 1}, + {Lo: 0x115BE, Hi: 0x115BE, Stride: 1}, + {Lo: 0x11630, Hi: 0x11632, Stride: 1}, + {Lo: 0x1163B, Hi: 0x1163C, Stride: 1}, + {Lo: 0x1163E, Hi: 0x1163E, Stride: 1}, + {Lo: 0x116AC, Hi: 0x116AC, Stride: 1}, + {Lo: 0x116AE, Hi: 0x116AF, Stride: 1}, + {Lo: 0x1171E, Hi: 0x1171E, Stride: 1}, + {Lo: 0x11726, Hi: 0x11726, Stride: 1}, + {Lo: 0x1182C, Hi: 0x1182E, Stride: 1}, + {Lo: 0x11838, Hi: 0x11838, Stride: 1}, + {Lo: 0x11931, Hi: 0x11935, Stride: 1}, + {Lo: 0x11937, Hi: 0x11938, Stride: 1}, + {Lo: 0x11940, Hi: 0x11940, Stride: 1}, + {Lo: 0x11942, Hi: 0x11942, Stride: 1}, + {Lo: 0x119D1, Hi: 0x119D3, Stride: 1}, + {Lo: 0x119DC, Hi: 0x119DF, Stride: 1}, + {Lo: 0x119E4, Hi: 0x119E4, Stride: 1}, + {Lo: 0x11A39, Hi: 0x11A39, Stride: 1}, + {Lo: 0x11A57, Hi: 0x11A58, Stride: 1}, + {Lo: 0x11A97, Hi: 0x11A97, Stride: 1}, + {Lo: 0x11B61, Hi: 0x11B61, Stride: 1}, + {Lo: 0x11B65, Hi: 0x11B65, Stride: 1}, + {Lo: 0x11B67, Hi: 0x11B67, Stride: 1}, + {Lo: 0x11C2F, Hi: 0x11C2F, Stride: 1}, + {Lo: 0x11C3E, Hi: 0x11C3E, Stride: 1}, + {Lo: 0x11CA9, Hi: 0x11CA9, Stride: 1}, + {Lo: 0x11CB1, Hi: 0x11CB1, Stride: 1}, + {Lo: 0x11CB4, Hi: 0x11CB4, Stride: 1}, + {Lo: 0x11D8A, Hi: 0x11D8E, Stride: 1}, + {Lo: 0x11D93, Hi: 0x11D94, Stride: 1}, + {Lo: 0x11D96, Hi: 0x11D96, Stride: 1}, + {Lo: 0x11EF5, Hi: 0x11EF6, Stride: 1}, + {Lo: 0x11F03, Hi: 0x11F03, Stride: 1}, + {Lo: 0x11F34, Hi: 0x11F35, Stride: 1}, + {Lo: 0x11F3E, Hi: 0x11F3F, Stride: 1}, + {Lo: 0x1612A, Hi: 0x1612C, Stride: 1}, + {Lo: 0x16F51, Hi: 0x16F87, Stride: 1}, + }, +} + +var unicodeAliasGrapheme_Cluster_Break_T = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x11A8, Hi: 0x11FF, Stride: 1}, + {Lo: 0xD7CB, Hi: 0xD7FB, Stride: 1}, + }, +} + +var unicodeAliasGrapheme_Cluster_Break_V = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x1160, Hi: 0x11A7, Stride: 1}, + {Lo: 0xD7B0, Hi: 0xD7C6, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x16D63, Hi: 0x16D63, Stride: 1}, + {Lo: 0x16D67, Hi: 0x16D6A, Stride: 1}, + }, +} + +var unicodeAliasGrapheme_Cluster_Break_ZWJ = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x200D, Hi: 0x200D, Stride: 1}, + }, +} + +var unicodeAliasMath = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x2B, Hi: 0x2B, Stride: 1}, + {Lo: 0x3C, Hi: 0x3E, Stride: 1}, + {Lo: 0x5E, Hi: 0x5E, Stride: 1}, + {Lo: 0x7C, Hi: 0x7C, Stride: 1}, + {Lo: 0x7E, Hi: 0x7E, Stride: 1}, + {Lo: 0xAC, Hi: 0xAC, Stride: 1}, + {Lo: 0xB1, Hi: 0xB1, Stride: 1}, + {Lo: 0xD7, Hi: 0xD7, Stride: 1}, + {Lo: 0xF7, Hi: 0xF7, Stride: 1}, + {Lo: 0x3D0, Hi: 0x3D2, Stride: 1}, + {Lo: 0x3D5, Hi: 0x3D5, Stride: 1}, + {Lo: 0x3F0, Hi: 0x3F1, Stride: 1}, + {Lo: 0x3F4, Hi: 0x3F6, Stride: 1}, + {Lo: 0x606, Hi: 0x608, Stride: 1}, + {Lo: 0x2016, Hi: 0x2016, Stride: 1}, + {Lo: 0x2032, Hi: 0x2034, Stride: 1}, + {Lo: 0x2040, Hi: 0x2040, Stride: 1}, + {Lo: 0x2044, Hi: 0x2044, Stride: 1}, + {Lo: 0x2052, Hi: 0x2052, Stride: 1}, + {Lo: 0x2061, Hi: 0x2064, Stride: 1}, + {Lo: 0x207A, Hi: 0x207E, Stride: 1}, + {Lo: 0x208A, Hi: 0x208E, Stride: 1}, + {Lo: 0x20D0, Hi: 0x20DC, Stride: 1}, + {Lo: 0x20E1, Hi: 0x20E1, Stride: 1}, + {Lo: 0x20E5, Hi: 0x20E6, Stride: 1}, + {Lo: 0x20EB, Hi: 0x20EF, Stride: 1}, + {Lo: 0x2102, Hi: 0x2102, Stride: 1}, + {Lo: 0x2107, Hi: 0x2107, Stride: 1}, + {Lo: 0x210A, Hi: 0x2113, Stride: 1}, + {Lo: 0x2115, Hi: 0x2115, Stride: 1}, + {Lo: 0x2118, Hi: 0x211D, Stride: 1}, + {Lo: 0x2124, Hi: 0x2124, Stride: 1}, + {Lo: 0x2128, Hi: 0x2129, Stride: 1}, + {Lo: 0x212C, Hi: 0x212D, Stride: 1}, + {Lo: 0x212F, Hi: 0x2131, Stride: 1}, + {Lo: 0x2133, Hi: 0x2138, Stride: 1}, + {Lo: 0x213C, Hi: 0x2149, Stride: 1}, + {Lo: 0x214B, Hi: 0x214B, Stride: 1}, + {Lo: 0x2190, Hi: 0x21A7, Stride: 1}, + {Lo: 0x21A9, Hi: 0x21AE, Stride: 1}, + {Lo: 0x21B0, Hi: 0x21B1, Stride: 1}, + {Lo: 0x21B6, Hi: 0x21B7, Stride: 1}, + {Lo: 0x21BC, Hi: 0x21DB, Stride: 1}, + {Lo: 0x21DD, Hi: 0x21DD, Stride: 1}, + {Lo: 0x21E4, Hi: 0x21E5, Stride: 1}, + {Lo: 0x21F4, Hi: 0x22FF, Stride: 1}, + {Lo: 0x2308, Hi: 0x230B, Stride: 1}, + {Lo: 0x2320, Hi: 0x2321, Stride: 1}, + {Lo: 0x237C, Hi: 0x237C, Stride: 1}, + {Lo: 0x239B, Hi: 0x23B5, Stride: 1}, + {Lo: 0x23B7, Hi: 0x23B7, Stride: 1}, + {Lo: 0x23D0, Hi: 0x23D0, Stride: 1}, + {Lo: 0x23DC, Hi: 0x23E2, Stride: 1}, + {Lo: 0x25A0, Hi: 0x25A1, Stride: 1}, + {Lo: 0x25AE, Hi: 0x25B7, Stride: 1}, + {Lo: 0x25BC, Hi: 0x25C1, Stride: 1}, + {Lo: 0x25C6, Hi: 0x25C7, Stride: 1}, + {Lo: 0x25CA, Hi: 0x25CB, Stride: 1}, + {Lo: 0x25CF, Hi: 0x25D3, Stride: 1}, + {Lo: 0x25E2, Hi: 0x25E2, Stride: 1}, + {Lo: 0x25E4, Hi: 0x25E4, Stride: 1}, + {Lo: 0x25E7, Hi: 0x25EC, Stride: 1}, + {Lo: 0x25F8, Hi: 0x25FF, Stride: 1}, + {Lo: 0x2605, Hi: 0x2606, Stride: 1}, + {Lo: 0x2640, Hi: 0x2640, Stride: 1}, + {Lo: 0x2642, Hi: 0x2642, Stride: 1}, + {Lo: 0x2660, Hi: 0x2663, Stride: 1}, + {Lo: 0x266D, Hi: 0x266F, Stride: 1}, + {Lo: 0x27C0, Hi: 0x27FF, Stride: 1}, + {Lo: 0x2900, Hi: 0x2AFF, Stride: 1}, + {Lo: 0x2B30, Hi: 0x2B44, Stride: 1}, + {Lo: 0x2B47, Hi: 0x2B4C, Stride: 1}, + {Lo: 0xFB29, Hi: 0xFB29, Stride: 1}, + {Lo: 0xFE61, Hi: 0xFE66, Stride: 1}, + {Lo: 0xFE68, Hi: 0xFE68, Stride: 1}, + {Lo: 0xFF0B, Hi: 0xFF0B, Stride: 1}, + {Lo: 0xFF1C, Hi: 0xFF1E, Stride: 1}, + {Lo: 0xFF3C, Hi: 0xFF3C, Stride: 1}, + {Lo: 0xFF3E, Hi: 0xFF3E, Stride: 1}, + {Lo: 0xFF5C, Hi: 0xFF5C, Stride: 1}, + {Lo: 0xFF5E, Hi: 0xFF5E, Stride: 1}, + {Lo: 0xFFE2, Hi: 0xFFE2, Stride: 1}, + {Lo: 0xFFE9, Hi: 0xFFEC, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x10D8E, Hi: 0x10D8F, Stride: 1}, + {Lo: 0x1CEF0, Hi: 0x1CEF0, Stride: 1}, + {Lo: 0x1D400, Hi: 0x1D454, Stride: 1}, + {Lo: 0x1D456, Hi: 0x1D49C, Stride: 1}, + {Lo: 0x1D49E, Hi: 0x1D49F, Stride: 1}, + {Lo: 0x1D4A2, Hi: 0x1D4A2, Stride: 1}, + {Lo: 0x1D4A5, Hi: 0x1D4A6, Stride: 1}, + {Lo: 0x1D4A9, Hi: 0x1D4AC, Stride: 1}, + {Lo: 0x1D4AE, Hi: 0x1D4B9, Stride: 1}, + {Lo: 0x1D4BB, Hi: 0x1D4BB, Stride: 1}, + {Lo: 0x1D4BD, Hi: 0x1D4C3, Stride: 1}, + {Lo: 0x1D4C5, Hi: 0x1D505, Stride: 1}, + {Lo: 0x1D507, Hi: 0x1D50A, Stride: 1}, + {Lo: 0x1D50D, Hi: 0x1D514, Stride: 1}, + {Lo: 0x1D516, Hi: 0x1D51C, Stride: 1}, + {Lo: 0x1D51E, Hi: 0x1D539, Stride: 1}, + {Lo: 0x1D53B, Hi: 0x1D53E, Stride: 1}, + {Lo: 0x1D540, Hi: 0x1D544, Stride: 1}, + {Lo: 0x1D546, Hi: 0x1D546, Stride: 1}, + {Lo: 0x1D54A, Hi: 0x1D550, Stride: 1}, + {Lo: 0x1D552, Hi: 0x1D6A5, Stride: 1}, + {Lo: 0x1D6A8, Hi: 0x1D7CB, Stride: 1}, + {Lo: 0x1D7CE, Hi: 0x1D7FF, Stride: 1}, + {Lo: 0x1EE00, Hi: 0x1EE03, Stride: 1}, + {Lo: 0x1EE05, Hi: 0x1EE1F, Stride: 1}, + {Lo: 0x1EE21, Hi: 0x1EE22, Stride: 1}, + {Lo: 0x1EE24, Hi: 0x1EE24, Stride: 1}, + {Lo: 0x1EE27, Hi: 0x1EE27, Stride: 1}, + {Lo: 0x1EE29, Hi: 0x1EE32, Stride: 1}, + {Lo: 0x1EE34, Hi: 0x1EE37, Stride: 1}, + {Lo: 0x1EE39, Hi: 0x1EE39, Stride: 1}, + {Lo: 0x1EE3B, Hi: 0x1EE3B, Stride: 1}, + {Lo: 0x1EE42, Hi: 0x1EE42, Stride: 1}, + {Lo: 0x1EE47, Hi: 0x1EE47, Stride: 1}, + {Lo: 0x1EE49, Hi: 0x1EE49, Stride: 1}, + {Lo: 0x1EE4B, Hi: 0x1EE4B, Stride: 1}, + {Lo: 0x1EE4D, Hi: 0x1EE4F, Stride: 1}, + {Lo: 0x1EE51, Hi: 0x1EE52, Stride: 1}, + {Lo: 0x1EE54, Hi: 0x1EE54, Stride: 1}, + {Lo: 0x1EE57, Hi: 0x1EE57, Stride: 1}, + {Lo: 0x1EE59, Hi: 0x1EE59, Stride: 1}, + {Lo: 0x1EE5B, Hi: 0x1EE5B, Stride: 1}, + {Lo: 0x1EE5D, Hi: 0x1EE5D, Stride: 1}, + {Lo: 0x1EE5F, Hi: 0x1EE5F, Stride: 1}, + {Lo: 0x1EE61, Hi: 0x1EE62, Stride: 1}, + {Lo: 0x1EE64, Hi: 0x1EE64, Stride: 1}, + {Lo: 0x1EE67, Hi: 0x1EE6A, Stride: 1}, + {Lo: 0x1EE6C, Hi: 0x1EE72, Stride: 1}, + {Lo: 0x1EE74, Hi: 0x1EE77, Stride: 1}, + {Lo: 0x1EE79, Hi: 0x1EE7C, Stride: 1}, + {Lo: 0x1EE7E, Hi: 0x1EE7E, Stride: 1}, + {Lo: 0x1EE80, Hi: 0x1EE89, Stride: 1}, + {Lo: 0x1EE8B, Hi: 0x1EE9B, Stride: 1}, + {Lo: 0x1EEA1, Hi: 0x1EEA3, Stride: 1}, + {Lo: 0x1EEA5, Hi: 0x1EEA9, Stride: 1}, + {Lo: 0x1EEAB, Hi: 0x1EEBB, Stride: 1}, + {Lo: 0x1EEF0, Hi: 0x1EEF1, Stride: 1}, + {Lo: 0x1F8D0, Hi: 0x1F8D8, Stride: 1}, + }, +} + +var unicodeAliasSentence_Break_ATerm = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x2E, Hi: 0x2E, Stride: 1}, + {Lo: 0x2024, Hi: 0x2024, Stride: 1}, + {Lo: 0xFE52, Hi: 0xFE52, Stride: 1}, + {Lo: 0xFF0E, Hi: 0xFF0E, Stride: 1}, + }, +} + +var unicodeAliasSentence_Break_CR = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0xD, Hi: 0xD, Stride: 1}, + }, +} + +var unicodeAliasSentence_Break_Close = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x22, Hi: 0x22, Stride: 1}, + {Lo: 0x27, Hi: 0x29, Stride: 1}, + {Lo: 0x5B, Hi: 0x5B, Stride: 1}, + {Lo: 0x5D, Hi: 0x5D, Stride: 1}, + {Lo: 0x7B, Hi: 0x7B, Stride: 1}, + {Lo: 0x7D, Hi: 0x7D, Stride: 1}, + {Lo: 0xAB, Hi: 0xAB, Stride: 1}, + {Lo: 0xBB, Hi: 0xBB, Stride: 1}, + {Lo: 0xF3A, Hi: 0xF3D, Stride: 1}, + {Lo: 0x169B, Hi: 0x169C, Stride: 1}, + {Lo: 0x2018, Hi: 0x201F, Stride: 1}, + {Lo: 0x2039, Hi: 0x203A, Stride: 1}, + {Lo: 0x2045, Hi: 0x2046, Stride: 1}, + {Lo: 0x207D, Hi: 0x207E, Stride: 1}, + {Lo: 0x208D, Hi: 0x208E, Stride: 1}, + {Lo: 0x2308, Hi: 0x230B, Stride: 1}, + {Lo: 0x2329, Hi: 0x232A, Stride: 1}, + {Lo: 0x275B, Hi: 0x2760, Stride: 1}, + {Lo: 0x2768, Hi: 0x2775, Stride: 1}, + {Lo: 0x27C5, Hi: 0x27C6, Stride: 1}, + {Lo: 0x27E6, Hi: 0x27EF, Stride: 1}, + {Lo: 0x2983, Hi: 0x2998, Stride: 1}, + {Lo: 0x29D8, Hi: 0x29DB, Stride: 1}, + {Lo: 0x29FC, Hi: 0x29FD, Stride: 1}, + {Lo: 0x2E00, Hi: 0x2E0D, Stride: 1}, + {Lo: 0x2E1C, Hi: 0x2E1D, Stride: 1}, + {Lo: 0x2E20, Hi: 0x2E29, Stride: 1}, + {Lo: 0x2E42, Hi: 0x2E42, Stride: 1}, + {Lo: 0x2E55, Hi: 0x2E5C, Stride: 1}, + {Lo: 0x3008, Hi: 0x3011, Stride: 1}, + {Lo: 0x3014, Hi: 0x301B, Stride: 1}, + {Lo: 0x301D, Hi: 0x301F, Stride: 1}, + {Lo: 0xFD3E, Hi: 0xFD3F, Stride: 1}, + {Lo: 0xFE17, Hi: 0xFE18, Stride: 1}, + {Lo: 0xFE35, Hi: 0xFE44, Stride: 1}, + {Lo: 0xFE47, Hi: 0xFE48, Stride: 1}, + {Lo: 0xFE59, Hi: 0xFE5E, Stride: 1}, + {Lo: 0xFF08, Hi: 0xFF09, Stride: 1}, + {Lo: 0xFF3B, Hi: 0xFF3B, Stride: 1}, + {Lo: 0xFF3D, Hi: 0xFF3D, Stride: 1}, + {Lo: 0xFF5B, Hi: 0xFF5B, Stride: 1}, + {Lo: 0xFF5D, Hi: 0xFF5D, Stride: 1}, + {Lo: 0xFF5F, Hi: 0xFF60, Stride: 1}, + {Lo: 0xFF62, Hi: 0xFF63, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x1F676, Hi: 0x1F678, Stride: 1}, + }, +} + +var unicodeAliasSentence_Break_Extend = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x300, Hi: 0x36F, Stride: 1}, + {Lo: 0x483, Hi: 0x489, Stride: 1}, + {Lo: 0x591, Hi: 0x5BD, Stride: 1}, + {Lo: 0x5BF, Hi: 0x5BF, Stride: 1}, + {Lo: 0x5C1, Hi: 0x5C2, Stride: 1}, + {Lo: 0x5C4, Hi: 0x5C5, Stride: 1}, + {Lo: 0x5C7, Hi: 0x5C7, Stride: 1}, + {Lo: 0x610, Hi: 0x61A, Stride: 1}, + {Lo: 0x64B, Hi: 0x65F, Stride: 1}, + {Lo: 0x670, Hi: 0x670, Stride: 1}, + {Lo: 0x6D6, Hi: 0x6DC, Stride: 1}, + {Lo: 0x6DF, Hi: 0x6E4, Stride: 1}, + {Lo: 0x6E7, Hi: 0x6E8, Stride: 1}, + {Lo: 0x6EA, Hi: 0x6ED, Stride: 1}, + {Lo: 0x711, Hi: 0x711, Stride: 1}, + {Lo: 0x730, Hi: 0x74A, Stride: 1}, + {Lo: 0x7A6, Hi: 0x7B0, Stride: 1}, + {Lo: 0x7EB, Hi: 0x7F3, Stride: 1}, + {Lo: 0x7FD, Hi: 0x7FD, Stride: 1}, + {Lo: 0x816, Hi: 0x819, Stride: 1}, + {Lo: 0x81B, Hi: 0x823, Stride: 1}, + {Lo: 0x825, Hi: 0x827, Stride: 1}, + {Lo: 0x829, Hi: 0x82D, Stride: 1}, + {Lo: 0x859, Hi: 0x85B, Stride: 1}, + {Lo: 0x897, Hi: 0x89F, Stride: 1}, + {Lo: 0x8CA, Hi: 0x8E1, Stride: 1}, + {Lo: 0x8E3, Hi: 0x903, Stride: 1}, + {Lo: 0x93A, Hi: 0x93C, Stride: 1}, + {Lo: 0x93E, Hi: 0x94F, Stride: 1}, + {Lo: 0x951, Hi: 0x957, Stride: 1}, + {Lo: 0x962, Hi: 0x963, Stride: 1}, + {Lo: 0x981, Hi: 0x983, Stride: 1}, + {Lo: 0x9BC, Hi: 0x9BC, Stride: 1}, + {Lo: 0x9BE, Hi: 0x9C4, Stride: 1}, + {Lo: 0x9C7, Hi: 0x9C8, Stride: 1}, + {Lo: 0x9CB, Hi: 0x9CD, Stride: 1}, + {Lo: 0x9D7, Hi: 0x9D7, Stride: 1}, + {Lo: 0x9E2, Hi: 0x9E3, Stride: 1}, + {Lo: 0x9FE, Hi: 0x9FE, Stride: 1}, + {Lo: 0xA01, Hi: 0xA03, Stride: 1}, + {Lo: 0xA3C, Hi: 0xA3C, Stride: 1}, + {Lo: 0xA3E, Hi: 0xA42, Stride: 1}, + {Lo: 0xA47, Hi: 0xA48, Stride: 1}, + {Lo: 0xA4B, Hi: 0xA4D, Stride: 1}, + {Lo: 0xA51, Hi: 0xA51, Stride: 1}, + {Lo: 0xA70, Hi: 0xA71, Stride: 1}, + {Lo: 0xA75, Hi: 0xA75, Stride: 1}, + {Lo: 0xA81, Hi: 0xA83, Stride: 1}, + {Lo: 0xABC, Hi: 0xABC, Stride: 1}, + {Lo: 0xABE, Hi: 0xAC5, Stride: 1}, + {Lo: 0xAC7, Hi: 0xAC9, Stride: 1}, + {Lo: 0xACB, Hi: 0xACD, Stride: 1}, + {Lo: 0xAE2, Hi: 0xAE3, Stride: 1}, + {Lo: 0xAFA, Hi: 0xAFF, Stride: 1}, + {Lo: 0xB01, Hi: 0xB03, Stride: 1}, + {Lo: 0xB3C, Hi: 0xB3C, Stride: 1}, + {Lo: 0xB3E, Hi: 0xB44, Stride: 1}, + {Lo: 0xB47, Hi: 0xB48, Stride: 1}, + {Lo: 0xB4B, Hi: 0xB4D, Stride: 1}, + {Lo: 0xB55, Hi: 0xB57, Stride: 1}, + {Lo: 0xB62, Hi: 0xB63, Stride: 1}, + {Lo: 0xB82, Hi: 0xB82, Stride: 1}, + {Lo: 0xBBE, Hi: 0xBC2, Stride: 1}, + {Lo: 0xBC6, Hi: 0xBC8, Stride: 1}, + {Lo: 0xBCA, Hi: 0xBCD, Stride: 1}, + {Lo: 0xBD7, Hi: 0xBD7, Stride: 1}, + {Lo: 0xC00, Hi: 0xC04, Stride: 1}, + {Lo: 0xC3C, Hi: 0xC3C, Stride: 1}, + {Lo: 0xC3E, Hi: 0xC44, Stride: 1}, + {Lo: 0xC46, Hi: 0xC48, Stride: 1}, + {Lo: 0xC4A, Hi: 0xC4D, Stride: 1}, + {Lo: 0xC55, Hi: 0xC56, Stride: 1}, + {Lo: 0xC62, Hi: 0xC63, Stride: 1}, + {Lo: 0xC81, Hi: 0xC83, Stride: 1}, + {Lo: 0xCBC, Hi: 0xCBC, Stride: 1}, + {Lo: 0xCBE, Hi: 0xCC4, Stride: 1}, + {Lo: 0xCC6, Hi: 0xCC8, Stride: 1}, + {Lo: 0xCCA, Hi: 0xCCD, Stride: 1}, + {Lo: 0xCD5, Hi: 0xCD6, Stride: 1}, + {Lo: 0xCE2, Hi: 0xCE3, Stride: 1}, + {Lo: 0xCF3, Hi: 0xCF3, Stride: 1}, + {Lo: 0xD00, Hi: 0xD03, Stride: 1}, + {Lo: 0xD3B, Hi: 0xD3C, Stride: 1}, + {Lo: 0xD3E, Hi: 0xD44, Stride: 1}, + {Lo: 0xD46, Hi: 0xD48, Stride: 1}, + {Lo: 0xD4A, Hi: 0xD4D, Stride: 1}, + {Lo: 0xD57, Hi: 0xD57, Stride: 1}, + {Lo: 0xD62, Hi: 0xD63, Stride: 1}, + {Lo: 0xD81, Hi: 0xD83, Stride: 1}, + {Lo: 0xDCA, Hi: 0xDCA, Stride: 1}, + {Lo: 0xDCF, Hi: 0xDD4, Stride: 1}, + {Lo: 0xDD6, Hi: 0xDD6, Stride: 1}, + {Lo: 0xDD8, Hi: 0xDDF, Stride: 1}, + {Lo: 0xDF2, Hi: 0xDF3, Stride: 1}, + {Lo: 0xE31, Hi: 0xE31, Stride: 1}, + {Lo: 0xE34, Hi: 0xE3A, Stride: 1}, + {Lo: 0xE47, Hi: 0xE4E, Stride: 1}, + {Lo: 0xEB1, Hi: 0xEB1, Stride: 1}, + {Lo: 0xEB4, Hi: 0xEBC, Stride: 1}, + {Lo: 0xEC8, Hi: 0xECE, Stride: 1}, + {Lo: 0xF18, Hi: 0xF19, Stride: 1}, + {Lo: 0xF35, Hi: 0xF35, Stride: 1}, + {Lo: 0xF37, Hi: 0xF37, Stride: 1}, + {Lo: 0xF39, Hi: 0xF39, Stride: 1}, + {Lo: 0xF3E, Hi: 0xF3F, Stride: 1}, + {Lo: 0xF71, Hi: 0xF84, Stride: 1}, + {Lo: 0xF86, Hi: 0xF87, Stride: 1}, + {Lo: 0xF8D, Hi: 0xF97, Stride: 1}, + {Lo: 0xF99, Hi: 0xFBC, Stride: 1}, + {Lo: 0xFC6, Hi: 0xFC6, Stride: 1}, + {Lo: 0x102B, Hi: 0x103E, Stride: 1}, + {Lo: 0x1056, Hi: 0x1059, Stride: 1}, + {Lo: 0x105E, Hi: 0x1060, Stride: 1}, + {Lo: 0x1062, Hi: 0x1064, Stride: 1}, + {Lo: 0x1067, Hi: 0x106D, Stride: 1}, + {Lo: 0x1071, Hi: 0x1074, Stride: 1}, + {Lo: 0x1082, Hi: 0x108D, Stride: 1}, + {Lo: 0x108F, Hi: 0x108F, Stride: 1}, + {Lo: 0x109A, Hi: 0x109D, Stride: 1}, + {Lo: 0x135D, Hi: 0x135F, Stride: 1}, + {Lo: 0x1712, Hi: 0x1715, Stride: 1}, + {Lo: 0x1732, Hi: 0x1734, Stride: 1}, + {Lo: 0x1752, Hi: 0x1753, Stride: 1}, + {Lo: 0x1772, Hi: 0x1773, Stride: 1}, + {Lo: 0x17B4, Hi: 0x17D3, Stride: 1}, + {Lo: 0x17DD, Hi: 0x17DD, Stride: 1}, + {Lo: 0x180B, Hi: 0x180D, Stride: 1}, + {Lo: 0x180F, Hi: 0x180F, Stride: 1}, + {Lo: 0x1885, Hi: 0x1886, Stride: 1}, + {Lo: 0x18A9, Hi: 0x18A9, Stride: 1}, + {Lo: 0x1920, Hi: 0x192B, Stride: 1}, + {Lo: 0x1930, Hi: 0x193B, Stride: 1}, + {Lo: 0x1A17, Hi: 0x1A1B, Stride: 1}, + {Lo: 0x1A55, Hi: 0x1A5E, Stride: 1}, + {Lo: 0x1A60, Hi: 0x1A7C, Stride: 1}, + {Lo: 0x1A7F, Hi: 0x1A7F, Stride: 1}, + {Lo: 0x1AB0, Hi: 0x1ADD, Stride: 1}, + {Lo: 0x1AE0, Hi: 0x1AEB, Stride: 1}, + {Lo: 0x1B00, Hi: 0x1B04, Stride: 1}, + {Lo: 0x1B34, Hi: 0x1B44, Stride: 1}, + {Lo: 0x1B6B, Hi: 0x1B73, Stride: 1}, + {Lo: 0x1B80, Hi: 0x1B82, Stride: 1}, + {Lo: 0x1BA1, Hi: 0x1BAD, Stride: 1}, + {Lo: 0x1BE6, Hi: 0x1BF3, Stride: 1}, + {Lo: 0x1C24, Hi: 0x1C37, Stride: 1}, + {Lo: 0x1CD0, Hi: 0x1CD2, Stride: 1}, + {Lo: 0x1CD4, Hi: 0x1CE8, Stride: 1}, + {Lo: 0x1CED, Hi: 0x1CED, Stride: 1}, + {Lo: 0x1CF4, Hi: 0x1CF4, Stride: 1}, + {Lo: 0x1CF7, Hi: 0x1CF9, Stride: 1}, + {Lo: 0x1DC0, Hi: 0x1DFF, Stride: 1}, + {Lo: 0x200C, Hi: 0x200D, Stride: 1}, + {Lo: 0x20D0, Hi: 0x20F0, Stride: 1}, + {Lo: 0x2CEF, Hi: 0x2CF1, Stride: 1}, + {Lo: 0x2D7F, Hi: 0x2D7F, Stride: 1}, + {Lo: 0x2DE0, Hi: 0x2DFF, Stride: 1}, + {Lo: 0x302A, Hi: 0x302F, Stride: 1}, + {Lo: 0x3099, Hi: 0x309A, Stride: 1}, + {Lo: 0xA66F, Hi: 0xA672, Stride: 1}, + {Lo: 0xA674, Hi: 0xA67D, Stride: 1}, + {Lo: 0xA69E, Hi: 0xA69F, Stride: 1}, + {Lo: 0xA6F0, Hi: 0xA6F1, Stride: 1}, + {Lo: 0xA802, Hi: 0xA802, Stride: 1}, + {Lo: 0xA806, Hi: 0xA806, Stride: 1}, + {Lo: 0xA80B, Hi: 0xA80B, Stride: 1}, + {Lo: 0xA823, Hi: 0xA827, Stride: 1}, + {Lo: 0xA82C, Hi: 0xA82C, Stride: 1}, + {Lo: 0xA880, Hi: 0xA881, Stride: 1}, + {Lo: 0xA8B4, Hi: 0xA8C5, Stride: 1}, + {Lo: 0xA8E0, Hi: 0xA8F1, Stride: 1}, + {Lo: 0xA8FF, Hi: 0xA8FF, Stride: 1}, + {Lo: 0xA926, Hi: 0xA92D, Stride: 1}, + {Lo: 0xA947, Hi: 0xA953, Stride: 1}, + {Lo: 0xA980, Hi: 0xA983, Stride: 1}, + {Lo: 0xA9B3, Hi: 0xA9C0, Stride: 1}, + {Lo: 0xA9E5, Hi: 0xA9E5, Stride: 1}, + {Lo: 0xAA29, Hi: 0xAA36, Stride: 1}, + {Lo: 0xAA43, Hi: 0xAA43, Stride: 1}, + {Lo: 0xAA4C, Hi: 0xAA4D, Stride: 1}, + {Lo: 0xAA7B, Hi: 0xAA7D, Stride: 1}, + {Lo: 0xAAB0, Hi: 0xAAB0, Stride: 1}, + {Lo: 0xAAB2, Hi: 0xAAB4, Stride: 1}, + {Lo: 0xAAB7, Hi: 0xAAB8, Stride: 1}, + {Lo: 0xAABE, Hi: 0xAABF, Stride: 1}, + {Lo: 0xAAC1, Hi: 0xAAC1, Stride: 1}, + {Lo: 0xAAEB, Hi: 0xAAEF, Stride: 1}, + {Lo: 0xAAF5, Hi: 0xAAF6, Stride: 1}, + {Lo: 0xABE3, Hi: 0xABEA, Stride: 1}, + {Lo: 0xABEC, Hi: 0xABED, Stride: 1}, + {Lo: 0xFB1E, Hi: 0xFB1E, Stride: 1}, + {Lo: 0xFE00, Hi: 0xFE0F, Stride: 1}, + {Lo: 0xFE20, Hi: 0xFE2F, Stride: 1}, + {Lo: 0xFF9E, Hi: 0xFF9F, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x101FD, Hi: 0x101FD, Stride: 1}, + {Lo: 0x102E0, Hi: 0x102E0, Stride: 1}, + {Lo: 0x10376, Hi: 0x1037A, Stride: 1}, + {Lo: 0x10A01, Hi: 0x10A03, Stride: 1}, + {Lo: 0x10A05, Hi: 0x10A06, Stride: 1}, + {Lo: 0x10A0C, Hi: 0x10A0F, Stride: 1}, + {Lo: 0x10A38, Hi: 0x10A3A, Stride: 1}, + {Lo: 0x10A3F, Hi: 0x10A3F, Stride: 1}, + {Lo: 0x10AE5, Hi: 0x10AE6, Stride: 1}, + {Lo: 0x10D24, Hi: 0x10D27, Stride: 1}, + {Lo: 0x10D69, Hi: 0x10D6D, Stride: 1}, + {Lo: 0x10EAB, Hi: 0x10EAC, Stride: 1}, + {Lo: 0x10EFA, Hi: 0x10EFF, Stride: 1}, + {Lo: 0x10F46, Hi: 0x10F50, Stride: 1}, + {Lo: 0x10F82, Hi: 0x10F85, Stride: 1}, + {Lo: 0x11000, Hi: 0x11002, Stride: 1}, + {Lo: 0x11038, Hi: 0x11046, Stride: 1}, + {Lo: 0x11070, Hi: 0x11070, Stride: 1}, + {Lo: 0x11073, Hi: 0x11074, Stride: 1}, + {Lo: 0x1107F, Hi: 0x11082, Stride: 1}, + {Lo: 0x110B0, Hi: 0x110BA, Stride: 1}, + {Lo: 0x110C2, Hi: 0x110C2, Stride: 1}, + {Lo: 0x11100, Hi: 0x11102, Stride: 1}, + {Lo: 0x11127, Hi: 0x11134, Stride: 1}, + {Lo: 0x11145, Hi: 0x11146, Stride: 1}, + {Lo: 0x11173, Hi: 0x11173, Stride: 1}, + {Lo: 0x11180, Hi: 0x11182, Stride: 1}, + {Lo: 0x111B3, Hi: 0x111C0, Stride: 1}, + {Lo: 0x111C9, Hi: 0x111CC, Stride: 1}, + {Lo: 0x111CE, Hi: 0x111CF, Stride: 1}, + {Lo: 0x1122C, Hi: 0x11237, Stride: 1}, + {Lo: 0x1123E, Hi: 0x1123E, Stride: 1}, + {Lo: 0x11241, Hi: 0x11241, Stride: 1}, + {Lo: 0x112DF, Hi: 0x112EA, Stride: 1}, + {Lo: 0x11300, Hi: 0x11303, Stride: 1}, + {Lo: 0x1133B, Hi: 0x1133C, Stride: 1}, + {Lo: 0x1133E, Hi: 0x11344, Stride: 1}, + {Lo: 0x11347, Hi: 0x11348, Stride: 1}, + {Lo: 0x1134B, Hi: 0x1134D, Stride: 1}, + {Lo: 0x11357, Hi: 0x11357, Stride: 1}, + {Lo: 0x11362, Hi: 0x11363, Stride: 1}, + {Lo: 0x11366, Hi: 0x1136C, Stride: 1}, + {Lo: 0x11370, Hi: 0x11374, Stride: 1}, + {Lo: 0x113B8, Hi: 0x113C0, Stride: 1}, + {Lo: 0x113C2, Hi: 0x113C2, Stride: 1}, + {Lo: 0x113C5, Hi: 0x113C5, Stride: 1}, + {Lo: 0x113C7, Hi: 0x113CA, Stride: 1}, + {Lo: 0x113CC, Hi: 0x113D0, Stride: 1}, + {Lo: 0x113D2, Hi: 0x113D2, Stride: 1}, + {Lo: 0x113E1, Hi: 0x113E2, Stride: 1}, + {Lo: 0x11435, Hi: 0x11446, Stride: 1}, + {Lo: 0x1145E, Hi: 0x1145E, Stride: 1}, + {Lo: 0x114B0, Hi: 0x114C3, Stride: 1}, + {Lo: 0x115AF, Hi: 0x115B5, Stride: 1}, + {Lo: 0x115B8, Hi: 0x115C0, Stride: 1}, + {Lo: 0x115DC, Hi: 0x115DD, Stride: 1}, + {Lo: 0x11630, Hi: 0x11640, Stride: 1}, + {Lo: 0x116AB, Hi: 0x116B7, Stride: 1}, + {Lo: 0x1171D, Hi: 0x1172B, Stride: 1}, + {Lo: 0x1182C, Hi: 0x1183A, Stride: 1}, + {Lo: 0x11930, Hi: 0x11935, Stride: 1}, + {Lo: 0x11937, Hi: 0x11938, Stride: 1}, + {Lo: 0x1193B, Hi: 0x1193E, Stride: 1}, + {Lo: 0x11940, Hi: 0x11940, Stride: 1}, + {Lo: 0x11942, Hi: 0x11943, Stride: 1}, + {Lo: 0x119D1, Hi: 0x119D7, Stride: 1}, + {Lo: 0x119DA, Hi: 0x119E0, Stride: 1}, + {Lo: 0x119E4, Hi: 0x119E4, Stride: 1}, + {Lo: 0x11A01, Hi: 0x11A0A, Stride: 1}, + {Lo: 0x11A33, Hi: 0x11A39, Stride: 1}, + {Lo: 0x11A3B, Hi: 0x11A3E, Stride: 1}, + {Lo: 0x11A47, Hi: 0x11A47, Stride: 1}, + {Lo: 0x11A51, Hi: 0x11A5B, Stride: 1}, + {Lo: 0x11A8A, Hi: 0x11A99, Stride: 1}, + {Lo: 0x11B60, Hi: 0x11B67, Stride: 1}, + {Lo: 0x11C2F, Hi: 0x11C36, Stride: 1}, + {Lo: 0x11C38, Hi: 0x11C3F, Stride: 1}, + {Lo: 0x11C92, Hi: 0x11CA7, Stride: 1}, + {Lo: 0x11CA9, Hi: 0x11CB6, Stride: 1}, + {Lo: 0x11D31, Hi: 0x11D36, Stride: 1}, + {Lo: 0x11D3A, Hi: 0x11D3A, Stride: 1}, + {Lo: 0x11D3C, Hi: 0x11D3D, Stride: 1}, + {Lo: 0x11D3F, Hi: 0x11D45, Stride: 1}, + {Lo: 0x11D47, Hi: 0x11D47, Stride: 1}, + {Lo: 0x11D8A, Hi: 0x11D8E, Stride: 1}, + {Lo: 0x11D90, Hi: 0x11D91, Stride: 1}, + {Lo: 0x11D93, Hi: 0x11D97, Stride: 1}, + {Lo: 0x11EF3, Hi: 0x11EF6, Stride: 1}, + {Lo: 0x11F00, Hi: 0x11F01, Stride: 1}, + {Lo: 0x11F03, Hi: 0x11F03, Stride: 1}, + {Lo: 0x11F34, Hi: 0x11F3A, Stride: 1}, + {Lo: 0x11F3E, Hi: 0x11F42, Stride: 1}, + {Lo: 0x11F5A, Hi: 0x11F5A, Stride: 1}, + {Lo: 0x13440, Hi: 0x13440, Stride: 1}, + {Lo: 0x13447, Hi: 0x13455, Stride: 1}, + {Lo: 0x1611E, Hi: 0x1612F, Stride: 1}, + {Lo: 0x16AF0, Hi: 0x16AF4, Stride: 1}, + {Lo: 0x16B30, Hi: 0x16B36, Stride: 1}, + {Lo: 0x16F4F, Hi: 0x16F4F, Stride: 1}, + {Lo: 0x16F51, Hi: 0x16F87, Stride: 1}, + {Lo: 0x16F8F, Hi: 0x16F92, Stride: 1}, + {Lo: 0x16FE4, Hi: 0x16FE4, Stride: 1}, + {Lo: 0x16FF0, Hi: 0x16FF1, Stride: 1}, + {Lo: 0x1BC9D, Hi: 0x1BC9E, Stride: 1}, + {Lo: 0x1CF00, Hi: 0x1CF2D, Stride: 1}, + {Lo: 0x1CF30, Hi: 0x1CF46, Stride: 1}, + {Lo: 0x1D165, Hi: 0x1D169, Stride: 1}, + {Lo: 0x1D16D, Hi: 0x1D172, Stride: 1}, + {Lo: 0x1D17B, Hi: 0x1D182, Stride: 1}, + {Lo: 0x1D185, Hi: 0x1D18B, Stride: 1}, + {Lo: 0x1D1AA, Hi: 0x1D1AD, Stride: 1}, + {Lo: 0x1D242, Hi: 0x1D244, Stride: 1}, + {Lo: 0x1DA00, Hi: 0x1DA36, Stride: 1}, + {Lo: 0x1DA3B, Hi: 0x1DA6C, Stride: 1}, + {Lo: 0x1DA75, Hi: 0x1DA75, Stride: 1}, + {Lo: 0x1DA84, Hi: 0x1DA84, Stride: 1}, + {Lo: 0x1DA9B, Hi: 0x1DA9F, Stride: 1}, + {Lo: 0x1DAA1, Hi: 0x1DAAF, Stride: 1}, + {Lo: 0x1E000, Hi: 0x1E006, Stride: 1}, + {Lo: 0x1E008, Hi: 0x1E018, Stride: 1}, + {Lo: 0x1E01B, Hi: 0x1E021, Stride: 1}, + {Lo: 0x1E023, Hi: 0x1E024, Stride: 1}, + {Lo: 0x1E026, Hi: 0x1E02A, Stride: 1}, + {Lo: 0x1E08F, Hi: 0x1E08F, Stride: 1}, + {Lo: 0x1E130, Hi: 0x1E136, Stride: 1}, + {Lo: 0x1E2AE, Hi: 0x1E2AE, Stride: 1}, + {Lo: 0x1E2EC, Hi: 0x1E2EF, Stride: 1}, + {Lo: 0x1E4EC, Hi: 0x1E4EF, Stride: 1}, + {Lo: 0x1E5EE, Hi: 0x1E5EF, Stride: 1}, + {Lo: 0x1E6E3, Hi: 0x1E6E3, Stride: 1}, + {Lo: 0x1E6E6, Hi: 0x1E6E6, Stride: 1}, + {Lo: 0x1E6EE, Hi: 0x1E6EF, Stride: 1}, + {Lo: 0x1E6F5, Hi: 0x1E6F5, Stride: 1}, + {Lo: 0x1E8D0, Hi: 0x1E8D6, Stride: 1}, + {Lo: 0x1E944, Hi: 0x1E94A, Stride: 1}, + {Lo: 0xE0020, Hi: 0xE007F, Stride: 1}, + {Lo: 0xE0100, Hi: 0xE01EF, Stride: 1}, + }, +} + +var unicodeAliasSentence_Break_Format = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0xAD, Hi: 0xAD, Stride: 1}, + {Lo: 0x61C, Hi: 0x61C, Stride: 1}, + {Lo: 0x70F, Hi: 0x70F, Stride: 1}, + {Lo: 0x180E, Hi: 0x180E, Stride: 1}, + {Lo: 0x200B, Hi: 0x200B, Stride: 1}, + {Lo: 0x200E, Hi: 0x200F, Stride: 1}, + {Lo: 0x202A, Hi: 0x202E, Stride: 1}, + {Lo: 0x2060, Hi: 0x2064, Stride: 1}, + {Lo: 0x2066, Hi: 0x206F, Stride: 1}, + {Lo: 0xFEFF, Hi: 0xFEFF, Stride: 1}, + {Lo: 0xFFF9, Hi: 0xFFFB, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x13430, Hi: 0x1343F, Stride: 1}, + {Lo: 0x1BCA0, Hi: 0x1BCA3, Stride: 1}, + {Lo: 0x1D173, Hi: 0x1D17A, Stride: 1}, + {Lo: 0xE0001, Hi: 0xE0001, Stride: 1}, + }, +} + +var unicodeAliasSentence_Break_LF = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0xA, Hi: 0xA, Stride: 1}, + }, +} + +var unicodeAliasSentence_Break_Lower = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x61, Hi: 0x7A, Stride: 1}, + {Lo: 0xAA, Hi: 0xAA, Stride: 1}, + {Lo: 0xB5, Hi: 0xB5, Stride: 1}, + {Lo: 0xBA, Hi: 0xBA, Stride: 1}, + {Lo: 0xDF, Hi: 0xF6, Stride: 1}, + {Lo: 0xF8, Hi: 0xFF, Stride: 1}, + {Lo: 0x101, Hi: 0x101, Stride: 1}, + {Lo: 0x103, Hi: 0x103, Stride: 1}, + {Lo: 0x105, Hi: 0x105, Stride: 1}, + {Lo: 0x107, Hi: 0x107, Stride: 1}, + {Lo: 0x109, Hi: 0x109, Stride: 1}, + {Lo: 0x10B, Hi: 0x10B, Stride: 1}, + {Lo: 0x10D, Hi: 0x10D, Stride: 1}, + {Lo: 0x10F, Hi: 0x10F, Stride: 1}, + {Lo: 0x111, Hi: 0x111, Stride: 1}, + {Lo: 0x113, Hi: 0x113, Stride: 1}, + {Lo: 0x115, Hi: 0x115, Stride: 1}, + {Lo: 0x117, Hi: 0x117, Stride: 1}, + {Lo: 0x119, Hi: 0x119, Stride: 1}, + {Lo: 0x11B, Hi: 0x11B, Stride: 1}, + {Lo: 0x11D, Hi: 0x11D, Stride: 1}, + {Lo: 0x11F, Hi: 0x11F, Stride: 1}, + {Lo: 0x121, Hi: 0x121, Stride: 1}, + {Lo: 0x123, Hi: 0x123, Stride: 1}, + {Lo: 0x125, Hi: 0x125, Stride: 1}, + {Lo: 0x127, Hi: 0x127, Stride: 1}, + {Lo: 0x129, Hi: 0x129, Stride: 1}, + {Lo: 0x12B, Hi: 0x12B, Stride: 1}, + {Lo: 0x12D, Hi: 0x12D, Stride: 1}, + {Lo: 0x12F, Hi: 0x12F, Stride: 1}, + {Lo: 0x131, Hi: 0x131, Stride: 1}, + {Lo: 0x133, Hi: 0x133, Stride: 1}, + {Lo: 0x135, Hi: 0x135, Stride: 1}, + {Lo: 0x137, Hi: 0x138, Stride: 1}, + {Lo: 0x13A, Hi: 0x13A, Stride: 1}, + {Lo: 0x13C, Hi: 0x13C, Stride: 1}, + {Lo: 0x13E, Hi: 0x13E, Stride: 1}, + {Lo: 0x140, Hi: 0x140, Stride: 1}, + {Lo: 0x142, Hi: 0x142, Stride: 1}, + {Lo: 0x144, Hi: 0x144, Stride: 1}, + {Lo: 0x146, Hi: 0x146, Stride: 1}, + {Lo: 0x148, Hi: 0x149, Stride: 1}, + {Lo: 0x14B, Hi: 0x14B, Stride: 1}, + {Lo: 0x14D, Hi: 0x14D, Stride: 1}, + {Lo: 0x14F, Hi: 0x14F, Stride: 1}, + {Lo: 0x151, Hi: 0x151, Stride: 1}, + {Lo: 0x153, Hi: 0x153, Stride: 1}, + {Lo: 0x155, Hi: 0x155, Stride: 1}, + {Lo: 0x157, Hi: 0x157, Stride: 1}, + {Lo: 0x159, Hi: 0x159, Stride: 1}, + {Lo: 0x15B, Hi: 0x15B, Stride: 1}, + {Lo: 0x15D, Hi: 0x15D, Stride: 1}, + {Lo: 0x15F, Hi: 0x15F, Stride: 1}, + {Lo: 0x161, Hi: 0x161, Stride: 1}, + {Lo: 0x163, Hi: 0x163, Stride: 1}, + {Lo: 0x165, Hi: 0x165, Stride: 1}, + {Lo: 0x167, Hi: 0x167, Stride: 1}, + {Lo: 0x169, Hi: 0x169, Stride: 1}, + {Lo: 0x16B, Hi: 0x16B, Stride: 1}, + {Lo: 0x16D, Hi: 0x16D, Stride: 1}, + {Lo: 0x16F, Hi: 0x16F, Stride: 1}, + {Lo: 0x171, Hi: 0x171, Stride: 1}, + {Lo: 0x173, Hi: 0x173, Stride: 1}, + {Lo: 0x175, Hi: 0x175, Stride: 1}, + {Lo: 0x177, Hi: 0x177, Stride: 1}, + {Lo: 0x17A, Hi: 0x17A, Stride: 1}, + {Lo: 0x17C, Hi: 0x17C, Stride: 1}, + {Lo: 0x17E, Hi: 0x180, Stride: 1}, + {Lo: 0x183, Hi: 0x183, Stride: 1}, + {Lo: 0x185, Hi: 0x185, Stride: 1}, + {Lo: 0x188, Hi: 0x188, Stride: 1}, + {Lo: 0x18C, Hi: 0x18D, Stride: 1}, + {Lo: 0x192, Hi: 0x192, Stride: 1}, + {Lo: 0x195, Hi: 0x195, Stride: 1}, + {Lo: 0x199, Hi: 0x19B, Stride: 1}, + {Lo: 0x19E, Hi: 0x19E, Stride: 1}, + {Lo: 0x1A1, Hi: 0x1A1, Stride: 1}, + {Lo: 0x1A3, Hi: 0x1A3, Stride: 1}, + {Lo: 0x1A5, Hi: 0x1A5, Stride: 1}, + {Lo: 0x1A8, Hi: 0x1A8, Stride: 1}, + {Lo: 0x1AA, Hi: 0x1AB, Stride: 1}, + {Lo: 0x1AD, Hi: 0x1AD, Stride: 1}, + {Lo: 0x1B0, Hi: 0x1B0, Stride: 1}, + {Lo: 0x1B4, Hi: 0x1B4, Stride: 1}, + {Lo: 0x1B6, Hi: 0x1B6, Stride: 1}, + {Lo: 0x1B9, Hi: 0x1BA, Stride: 1}, + {Lo: 0x1BD, Hi: 0x1BF, Stride: 1}, + {Lo: 0x1C6, Hi: 0x1C6, Stride: 1}, + {Lo: 0x1C9, Hi: 0x1C9, Stride: 1}, + {Lo: 0x1CC, Hi: 0x1CC, Stride: 1}, + {Lo: 0x1CE, Hi: 0x1CE, Stride: 1}, + {Lo: 0x1D0, Hi: 0x1D0, Stride: 1}, + {Lo: 0x1D2, Hi: 0x1D2, Stride: 1}, + {Lo: 0x1D4, Hi: 0x1D4, Stride: 1}, + {Lo: 0x1D6, Hi: 0x1D6, Stride: 1}, + {Lo: 0x1D8, Hi: 0x1D8, Stride: 1}, + {Lo: 0x1DA, Hi: 0x1DA, Stride: 1}, + {Lo: 0x1DC, Hi: 0x1DD, Stride: 1}, + {Lo: 0x1DF, Hi: 0x1DF, Stride: 1}, + {Lo: 0x1E1, Hi: 0x1E1, Stride: 1}, + {Lo: 0x1E3, Hi: 0x1E3, Stride: 1}, + {Lo: 0x1E5, Hi: 0x1E5, Stride: 1}, + {Lo: 0x1E7, Hi: 0x1E7, Stride: 1}, + {Lo: 0x1E9, Hi: 0x1E9, Stride: 1}, + {Lo: 0x1EB, Hi: 0x1EB, Stride: 1}, + {Lo: 0x1ED, Hi: 0x1ED, Stride: 1}, + {Lo: 0x1EF, Hi: 0x1F0, Stride: 1}, + {Lo: 0x1F3, Hi: 0x1F3, Stride: 1}, + {Lo: 0x1F5, Hi: 0x1F5, Stride: 1}, + {Lo: 0x1F9, Hi: 0x1F9, Stride: 1}, + {Lo: 0x1FB, Hi: 0x1FB, Stride: 1}, + {Lo: 0x1FD, Hi: 0x1FD, Stride: 1}, + {Lo: 0x1FF, Hi: 0x1FF, Stride: 1}, + {Lo: 0x201, Hi: 0x201, Stride: 1}, + {Lo: 0x203, Hi: 0x203, Stride: 1}, + {Lo: 0x205, Hi: 0x205, Stride: 1}, + {Lo: 0x207, Hi: 0x207, Stride: 1}, + {Lo: 0x209, Hi: 0x209, Stride: 1}, + {Lo: 0x20B, Hi: 0x20B, Stride: 1}, + {Lo: 0x20D, Hi: 0x20D, Stride: 1}, + {Lo: 0x20F, Hi: 0x20F, Stride: 1}, + {Lo: 0x211, Hi: 0x211, Stride: 1}, + {Lo: 0x213, Hi: 0x213, Stride: 1}, + {Lo: 0x215, Hi: 0x215, Stride: 1}, + {Lo: 0x217, Hi: 0x217, Stride: 1}, + {Lo: 0x219, Hi: 0x219, Stride: 1}, + {Lo: 0x21B, Hi: 0x21B, Stride: 1}, + {Lo: 0x21D, Hi: 0x21D, Stride: 1}, + {Lo: 0x21F, Hi: 0x21F, Stride: 1}, + {Lo: 0x221, Hi: 0x221, Stride: 1}, + {Lo: 0x223, Hi: 0x223, Stride: 1}, + {Lo: 0x225, Hi: 0x225, Stride: 1}, + {Lo: 0x227, Hi: 0x227, Stride: 1}, + {Lo: 0x229, Hi: 0x229, Stride: 1}, + {Lo: 0x22B, Hi: 0x22B, Stride: 1}, + {Lo: 0x22D, Hi: 0x22D, Stride: 1}, + {Lo: 0x22F, Hi: 0x22F, Stride: 1}, + {Lo: 0x231, Hi: 0x231, Stride: 1}, + {Lo: 0x233, Hi: 0x239, Stride: 1}, + {Lo: 0x23C, Hi: 0x23C, Stride: 1}, + {Lo: 0x23F, Hi: 0x240, Stride: 1}, + {Lo: 0x242, Hi: 0x242, Stride: 1}, + {Lo: 0x247, Hi: 0x247, Stride: 1}, + {Lo: 0x249, Hi: 0x249, Stride: 1}, + {Lo: 0x24B, Hi: 0x24B, Stride: 1}, + {Lo: 0x24D, Hi: 0x24D, Stride: 1}, + {Lo: 0x24F, Hi: 0x293, Stride: 1}, + {Lo: 0x296, Hi: 0x2B8, Stride: 1}, + {Lo: 0x2C0, Hi: 0x2C1, Stride: 1}, + {Lo: 0x2E0, Hi: 0x2E4, Stride: 1}, + {Lo: 0x371, Hi: 0x371, Stride: 1}, + {Lo: 0x373, Hi: 0x373, Stride: 1}, + {Lo: 0x377, Hi: 0x377, Stride: 1}, + {Lo: 0x37A, Hi: 0x37D, Stride: 1}, + {Lo: 0x390, Hi: 0x390, Stride: 1}, + {Lo: 0x3AC, Hi: 0x3CE, Stride: 1}, + {Lo: 0x3D0, Hi: 0x3D1, Stride: 1}, + {Lo: 0x3D5, Hi: 0x3D7, Stride: 1}, + {Lo: 0x3D9, Hi: 0x3D9, Stride: 1}, + {Lo: 0x3DB, Hi: 0x3DB, Stride: 1}, + {Lo: 0x3DD, Hi: 0x3DD, Stride: 1}, + {Lo: 0x3DF, Hi: 0x3DF, Stride: 1}, + {Lo: 0x3E1, Hi: 0x3E1, Stride: 1}, + {Lo: 0x3E3, Hi: 0x3E3, Stride: 1}, + {Lo: 0x3E5, Hi: 0x3E5, Stride: 1}, + {Lo: 0x3E7, Hi: 0x3E7, Stride: 1}, + {Lo: 0x3E9, Hi: 0x3E9, Stride: 1}, + {Lo: 0x3EB, Hi: 0x3EB, Stride: 1}, + {Lo: 0x3ED, Hi: 0x3ED, Stride: 1}, + {Lo: 0x3EF, Hi: 0x3F3, Stride: 1}, + {Lo: 0x3F5, Hi: 0x3F5, Stride: 1}, + {Lo: 0x3F8, Hi: 0x3F8, Stride: 1}, + {Lo: 0x3FB, Hi: 0x3FC, Stride: 1}, + {Lo: 0x430, Hi: 0x45F, Stride: 1}, + {Lo: 0x461, Hi: 0x461, Stride: 1}, + {Lo: 0x463, Hi: 0x463, Stride: 1}, + {Lo: 0x465, Hi: 0x465, Stride: 1}, + {Lo: 0x467, Hi: 0x467, Stride: 1}, + {Lo: 0x469, Hi: 0x469, Stride: 1}, + {Lo: 0x46B, Hi: 0x46B, Stride: 1}, + {Lo: 0x46D, Hi: 0x46D, Stride: 1}, + {Lo: 0x46F, Hi: 0x46F, Stride: 1}, + {Lo: 0x471, Hi: 0x471, Stride: 1}, + {Lo: 0x473, Hi: 0x473, Stride: 1}, + {Lo: 0x475, Hi: 0x475, Stride: 1}, + {Lo: 0x477, Hi: 0x477, Stride: 1}, + {Lo: 0x479, Hi: 0x479, Stride: 1}, + {Lo: 0x47B, Hi: 0x47B, Stride: 1}, + {Lo: 0x47D, Hi: 0x47D, Stride: 1}, + {Lo: 0x47F, Hi: 0x47F, Stride: 1}, + {Lo: 0x481, Hi: 0x481, Stride: 1}, + {Lo: 0x48B, Hi: 0x48B, Stride: 1}, + {Lo: 0x48D, Hi: 0x48D, Stride: 1}, + {Lo: 0x48F, Hi: 0x48F, Stride: 1}, + {Lo: 0x491, Hi: 0x491, Stride: 1}, + {Lo: 0x493, Hi: 0x493, Stride: 1}, + {Lo: 0x495, Hi: 0x495, Stride: 1}, + {Lo: 0x497, Hi: 0x497, Stride: 1}, + {Lo: 0x499, Hi: 0x499, Stride: 1}, + {Lo: 0x49B, Hi: 0x49B, Stride: 1}, + {Lo: 0x49D, Hi: 0x49D, Stride: 1}, + {Lo: 0x49F, Hi: 0x49F, Stride: 1}, + {Lo: 0x4A1, Hi: 0x4A1, Stride: 1}, + {Lo: 0x4A3, Hi: 0x4A3, Stride: 1}, + {Lo: 0x4A5, Hi: 0x4A5, Stride: 1}, + {Lo: 0x4A7, Hi: 0x4A7, Stride: 1}, + {Lo: 0x4A9, Hi: 0x4A9, Stride: 1}, + {Lo: 0x4AB, Hi: 0x4AB, Stride: 1}, + {Lo: 0x4AD, Hi: 0x4AD, Stride: 1}, + {Lo: 0x4AF, Hi: 0x4AF, Stride: 1}, + {Lo: 0x4B1, Hi: 0x4B1, Stride: 1}, + {Lo: 0x4B3, Hi: 0x4B3, Stride: 1}, + {Lo: 0x4B5, Hi: 0x4B5, Stride: 1}, + {Lo: 0x4B7, Hi: 0x4B7, Stride: 1}, + {Lo: 0x4B9, Hi: 0x4B9, Stride: 1}, + {Lo: 0x4BB, Hi: 0x4BB, Stride: 1}, + {Lo: 0x4BD, Hi: 0x4BD, Stride: 1}, + {Lo: 0x4BF, Hi: 0x4BF, Stride: 1}, + {Lo: 0x4C2, Hi: 0x4C2, Stride: 1}, + {Lo: 0x4C4, Hi: 0x4C4, Stride: 1}, + {Lo: 0x4C6, Hi: 0x4C6, Stride: 1}, + {Lo: 0x4C8, Hi: 0x4C8, Stride: 1}, + {Lo: 0x4CA, Hi: 0x4CA, Stride: 1}, + {Lo: 0x4CC, Hi: 0x4CC, Stride: 1}, + {Lo: 0x4CE, Hi: 0x4CF, Stride: 1}, + {Lo: 0x4D1, Hi: 0x4D1, Stride: 1}, + {Lo: 0x4D3, Hi: 0x4D3, Stride: 1}, + {Lo: 0x4D5, Hi: 0x4D5, Stride: 1}, + {Lo: 0x4D7, Hi: 0x4D7, Stride: 1}, + {Lo: 0x4D9, Hi: 0x4D9, Stride: 1}, + {Lo: 0x4DB, Hi: 0x4DB, Stride: 1}, + {Lo: 0x4DD, Hi: 0x4DD, Stride: 1}, + {Lo: 0x4DF, Hi: 0x4DF, Stride: 1}, + {Lo: 0x4E1, Hi: 0x4E1, Stride: 1}, + {Lo: 0x4E3, Hi: 0x4E3, Stride: 1}, + {Lo: 0x4E5, Hi: 0x4E5, Stride: 1}, + {Lo: 0x4E7, Hi: 0x4E7, Stride: 1}, + {Lo: 0x4E9, Hi: 0x4E9, Stride: 1}, + {Lo: 0x4EB, Hi: 0x4EB, Stride: 1}, + {Lo: 0x4ED, Hi: 0x4ED, Stride: 1}, + {Lo: 0x4EF, Hi: 0x4EF, Stride: 1}, + {Lo: 0x4F1, Hi: 0x4F1, Stride: 1}, + {Lo: 0x4F3, Hi: 0x4F3, Stride: 1}, + {Lo: 0x4F5, Hi: 0x4F5, Stride: 1}, + {Lo: 0x4F7, Hi: 0x4F7, Stride: 1}, + {Lo: 0x4F9, Hi: 0x4F9, Stride: 1}, + {Lo: 0x4FB, Hi: 0x4FB, Stride: 1}, + {Lo: 0x4FD, Hi: 0x4FD, Stride: 1}, + {Lo: 0x4FF, Hi: 0x4FF, Stride: 1}, + {Lo: 0x501, Hi: 0x501, Stride: 1}, + {Lo: 0x503, Hi: 0x503, Stride: 1}, + {Lo: 0x505, Hi: 0x505, Stride: 1}, + {Lo: 0x507, Hi: 0x507, Stride: 1}, + {Lo: 0x509, Hi: 0x509, Stride: 1}, + {Lo: 0x50B, Hi: 0x50B, Stride: 1}, + {Lo: 0x50D, Hi: 0x50D, Stride: 1}, + {Lo: 0x50F, Hi: 0x50F, Stride: 1}, + {Lo: 0x511, Hi: 0x511, Stride: 1}, + {Lo: 0x513, Hi: 0x513, Stride: 1}, + {Lo: 0x515, Hi: 0x515, Stride: 1}, + {Lo: 0x517, Hi: 0x517, Stride: 1}, + {Lo: 0x519, Hi: 0x519, Stride: 1}, + {Lo: 0x51B, Hi: 0x51B, Stride: 1}, + {Lo: 0x51D, Hi: 0x51D, Stride: 1}, + {Lo: 0x51F, Hi: 0x51F, Stride: 1}, + {Lo: 0x521, Hi: 0x521, Stride: 1}, + {Lo: 0x523, Hi: 0x523, Stride: 1}, + {Lo: 0x525, Hi: 0x525, Stride: 1}, + {Lo: 0x527, Hi: 0x527, Stride: 1}, + {Lo: 0x529, Hi: 0x529, Stride: 1}, + {Lo: 0x52B, Hi: 0x52B, Stride: 1}, + {Lo: 0x52D, Hi: 0x52D, Stride: 1}, + {Lo: 0x52F, Hi: 0x52F, Stride: 1}, + {Lo: 0x560, Hi: 0x588, Stride: 1}, + {Lo: 0x10FC, Hi: 0x10FC, Stride: 1}, + {Lo: 0x13F8, Hi: 0x13FD, Stride: 1}, + {Lo: 0x1C80, Hi: 0x1C88, Stride: 1}, + {Lo: 0x1C8A, Hi: 0x1C8A, Stride: 1}, + {Lo: 0x1D00, Hi: 0x1DBF, Stride: 1}, + {Lo: 0x1E01, Hi: 0x1E01, Stride: 1}, + {Lo: 0x1E03, Hi: 0x1E03, Stride: 1}, + {Lo: 0x1E05, Hi: 0x1E05, Stride: 1}, + {Lo: 0x1E07, Hi: 0x1E07, Stride: 1}, + {Lo: 0x1E09, Hi: 0x1E09, Stride: 1}, + {Lo: 0x1E0B, Hi: 0x1E0B, Stride: 1}, + {Lo: 0x1E0D, Hi: 0x1E0D, Stride: 1}, + {Lo: 0x1E0F, Hi: 0x1E0F, Stride: 1}, + {Lo: 0x1E11, Hi: 0x1E11, Stride: 1}, + {Lo: 0x1E13, Hi: 0x1E13, Stride: 1}, + {Lo: 0x1E15, Hi: 0x1E15, Stride: 1}, + {Lo: 0x1E17, Hi: 0x1E17, Stride: 1}, + {Lo: 0x1E19, Hi: 0x1E19, Stride: 1}, + {Lo: 0x1E1B, Hi: 0x1E1B, Stride: 1}, + {Lo: 0x1E1D, Hi: 0x1E1D, Stride: 1}, + {Lo: 0x1E1F, Hi: 0x1E1F, Stride: 1}, + {Lo: 0x1E21, Hi: 0x1E21, Stride: 1}, + {Lo: 0x1E23, Hi: 0x1E23, Stride: 1}, + {Lo: 0x1E25, Hi: 0x1E25, Stride: 1}, + {Lo: 0x1E27, Hi: 0x1E27, Stride: 1}, + {Lo: 0x1E29, Hi: 0x1E29, Stride: 1}, + {Lo: 0x1E2B, Hi: 0x1E2B, Stride: 1}, + {Lo: 0x1E2D, Hi: 0x1E2D, Stride: 1}, + {Lo: 0x1E2F, Hi: 0x1E2F, Stride: 1}, + {Lo: 0x1E31, Hi: 0x1E31, Stride: 1}, + {Lo: 0x1E33, Hi: 0x1E33, Stride: 1}, + {Lo: 0x1E35, Hi: 0x1E35, Stride: 1}, + {Lo: 0x1E37, Hi: 0x1E37, Stride: 1}, + {Lo: 0x1E39, Hi: 0x1E39, Stride: 1}, + {Lo: 0x1E3B, Hi: 0x1E3B, Stride: 1}, + {Lo: 0x1E3D, Hi: 0x1E3D, Stride: 1}, + {Lo: 0x1E3F, Hi: 0x1E3F, Stride: 1}, + {Lo: 0x1E41, Hi: 0x1E41, Stride: 1}, + {Lo: 0x1E43, Hi: 0x1E43, Stride: 1}, + {Lo: 0x1E45, Hi: 0x1E45, Stride: 1}, + {Lo: 0x1E47, Hi: 0x1E47, Stride: 1}, + {Lo: 0x1E49, Hi: 0x1E49, Stride: 1}, + {Lo: 0x1E4B, Hi: 0x1E4B, Stride: 1}, + {Lo: 0x1E4D, Hi: 0x1E4D, Stride: 1}, + {Lo: 0x1E4F, Hi: 0x1E4F, Stride: 1}, + {Lo: 0x1E51, Hi: 0x1E51, Stride: 1}, + {Lo: 0x1E53, Hi: 0x1E53, Stride: 1}, + {Lo: 0x1E55, Hi: 0x1E55, Stride: 1}, + {Lo: 0x1E57, Hi: 0x1E57, Stride: 1}, + {Lo: 0x1E59, Hi: 0x1E59, Stride: 1}, + {Lo: 0x1E5B, Hi: 0x1E5B, Stride: 1}, + {Lo: 0x1E5D, Hi: 0x1E5D, Stride: 1}, + {Lo: 0x1E5F, Hi: 0x1E5F, Stride: 1}, + {Lo: 0x1E61, Hi: 0x1E61, Stride: 1}, + {Lo: 0x1E63, Hi: 0x1E63, Stride: 1}, + {Lo: 0x1E65, Hi: 0x1E65, Stride: 1}, + {Lo: 0x1E67, Hi: 0x1E67, Stride: 1}, + {Lo: 0x1E69, Hi: 0x1E69, Stride: 1}, + {Lo: 0x1E6B, Hi: 0x1E6B, Stride: 1}, + {Lo: 0x1E6D, Hi: 0x1E6D, Stride: 1}, + {Lo: 0x1E6F, Hi: 0x1E6F, Stride: 1}, + {Lo: 0x1E71, Hi: 0x1E71, Stride: 1}, + {Lo: 0x1E73, Hi: 0x1E73, Stride: 1}, + {Lo: 0x1E75, Hi: 0x1E75, Stride: 1}, + {Lo: 0x1E77, Hi: 0x1E77, Stride: 1}, + {Lo: 0x1E79, Hi: 0x1E79, Stride: 1}, + {Lo: 0x1E7B, Hi: 0x1E7B, Stride: 1}, + {Lo: 0x1E7D, Hi: 0x1E7D, Stride: 1}, + {Lo: 0x1E7F, Hi: 0x1E7F, Stride: 1}, + {Lo: 0x1E81, Hi: 0x1E81, Stride: 1}, + {Lo: 0x1E83, Hi: 0x1E83, Stride: 1}, + {Lo: 0x1E85, Hi: 0x1E85, Stride: 1}, + {Lo: 0x1E87, Hi: 0x1E87, Stride: 1}, + {Lo: 0x1E89, Hi: 0x1E89, Stride: 1}, + {Lo: 0x1E8B, Hi: 0x1E8B, Stride: 1}, + {Lo: 0x1E8D, Hi: 0x1E8D, Stride: 1}, + {Lo: 0x1E8F, Hi: 0x1E8F, Stride: 1}, + {Lo: 0x1E91, Hi: 0x1E91, Stride: 1}, + {Lo: 0x1E93, Hi: 0x1E93, Stride: 1}, + {Lo: 0x1E95, Hi: 0x1E9D, Stride: 1}, + {Lo: 0x1E9F, Hi: 0x1E9F, Stride: 1}, + {Lo: 0x1EA1, Hi: 0x1EA1, Stride: 1}, + {Lo: 0x1EA3, Hi: 0x1EA3, Stride: 1}, + {Lo: 0x1EA5, Hi: 0x1EA5, Stride: 1}, + {Lo: 0x1EA7, Hi: 0x1EA7, Stride: 1}, + {Lo: 0x1EA9, Hi: 0x1EA9, Stride: 1}, + {Lo: 0x1EAB, Hi: 0x1EAB, Stride: 1}, + {Lo: 0x1EAD, Hi: 0x1EAD, Stride: 1}, + {Lo: 0x1EAF, Hi: 0x1EAF, Stride: 1}, + {Lo: 0x1EB1, Hi: 0x1EB1, Stride: 1}, + {Lo: 0x1EB3, Hi: 0x1EB3, Stride: 1}, + {Lo: 0x1EB5, Hi: 0x1EB5, Stride: 1}, + {Lo: 0x1EB7, Hi: 0x1EB7, Stride: 1}, + {Lo: 0x1EB9, Hi: 0x1EB9, Stride: 1}, + {Lo: 0x1EBB, Hi: 0x1EBB, Stride: 1}, + {Lo: 0x1EBD, Hi: 0x1EBD, Stride: 1}, + {Lo: 0x1EBF, Hi: 0x1EBF, Stride: 1}, + {Lo: 0x1EC1, Hi: 0x1EC1, Stride: 1}, + {Lo: 0x1EC3, Hi: 0x1EC3, Stride: 1}, + {Lo: 0x1EC5, Hi: 0x1EC5, Stride: 1}, + {Lo: 0x1EC7, Hi: 0x1EC7, Stride: 1}, + {Lo: 0x1EC9, Hi: 0x1EC9, Stride: 1}, + {Lo: 0x1ECB, Hi: 0x1ECB, Stride: 1}, + {Lo: 0x1ECD, Hi: 0x1ECD, Stride: 1}, + {Lo: 0x1ECF, Hi: 0x1ECF, Stride: 1}, + {Lo: 0x1ED1, Hi: 0x1ED1, Stride: 1}, + {Lo: 0x1ED3, Hi: 0x1ED3, Stride: 1}, + {Lo: 0x1ED5, Hi: 0x1ED5, Stride: 1}, + {Lo: 0x1ED7, Hi: 0x1ED7, Stride: 1}, + {Lo: 0x1ED9, Hi: 0x1ED9, Stride: 1}, + {Lo: 0x1EDB, Hi: 0x1EDB, Stride: 1}, + {Lo: 0x1EDD, Hi: 0x1EDD, Stride: 1}, + {Lo: 0x1EDF, Hi: 0x1EDF, Stride: 1}, + {Lo: 0x1EE1, Hi: 0x1EE1, Stride: 1}, + {Lo: 0x1EE3, Hi: 0x1EE3, Stride: 1}, + {Lo: 0x1EE5, Hi: 0x1EE5, Stride: 1}, + {Lo: 0x1EE7, Hi: 0x1EE7, Stride: 1}, + {Lo: 0x1EE9, Hi: 0x1EE9, Stride: 1}, + {Lo: 0x1EEB, Hi: 0x1EEB, Stride: 1}, + {Lo: 0x1EED, Hi: 0x1EED, Stride: 1}, + {Lo: 0x1EEF, Hi: 0x1EEF, Stride: 1}, + {Lo: 0x1EF1, Hi: 0x1EF1, Stride: 1}, + {Lo: 0x1EF3, Hi: 0x1EF3, Stride: 1}, + {Lo: 0x1EF5, Hi: 0x1EF5, Stride: 1}, + {Lo: 0x1EF7, Hi: 0x1EF7, Stride: 1}, + {Lo: 0x1EF9, Hi: 0x1EF9, Stride: 1}, + {Lo: 0x1EFB, Hi: 0x1EFB, Stride: 1}, + {Lo: 0x1EFD, Hi: 0x1EFD, Stride: 1}, + {Lo: 0x1EFF, Hi: 0x1F07, Stride: 1}, + {Lo: 0x1F10, Hi: 0x1F15, Stride: 1}, + {Lo: 0x1F20, Hi: 0x1F27, Stride: 1}, + {Lo: 0x1F30, Hi: 0x1F37, Stride: 1}, + {Lo: 0x1F40, Hi: 0x1F45, Stride: 1}, + {Lo: 0x1F50, Hi: 0x1F57, Stride: 1}, + {Lo: 0x1F60, Hi: 0x1F67, Stride: 1}, + {Lo: 0x1F70, Hi: 0x1F7D, Stride: 1}, + {Lo: 0x1F80, Hi: 0x1F87, Stride: 1}, + {Lo: 0x1F90, Hi: 0x1F97, Stride: 1}, + {Lo: 0x1FA0, Hi: 0x1FA7, Stride: 1}, + {Lo: 0x1FB0, Hi: 0x1FB4, Stride: 1}, + {Lo: 0x1FB6, Hi: 0x1FB7, Stride: 1}, + {Lo: 0x1FBE, Hi: 0x1FBE, Stride: 1}, + {Lo: 0x1FC2, Hi: 0x1FC4, Stride: 1}, + {Lo: 0x1FC6, Hi: 0x1FC7, Stride: 1}, + {Lo: 0x1FD0, Hi: 0x1FD3, Stride: 1}, + {Lo: 0x1FD6, Hi: 0x1FD7, Stride: 1}, + {Lo: 0x1FE0, Hi: 0x1FE7, Stride: 1}, + {Lo: 0x1FF2, Hi: 0x1FF4, Stride: 1}, + {Lo: 0x1FF6, Hi: 0x1FF7, Stride: 1}, + {Lo: 0x2071, Hi: 0x2071, Stride: 1}, + {Lo: 0x207F, Hi: 0x207F, Stride: 1}, + {Lo: 0x2090, Hi: 0x209C, Stride: 1}, + {Lo: 0x210A, Hi: 0x210A, Stride: 1}, + {Lo: 0x210E, Hi: 0x210F, Stride: 1}, + {Lo: 0x2113, Hi: 0x2113, Stride: 1}, + {Lo: 0x212F, Hi: 0x212F, Stride: 1}, + {Lo: 0x2134, Hi: 0x2134, Stride: 1}, + {Lo: 0x2139, Hi: 0x2139, Stride: 1}, + {Lo: 0x213C, Hi: 0x213D, Stride: 1}, + {Lo: 0x2146, Hi: 0x2149, Stride: 1}, + {Lo: 0x214E, Hi: 0x214E, Stride: 1}, + {Lo: 0x2170, Hi: 0x217F, Stride: 1}, + {Lo: 0x2184, Hi: 0x2184, Stride: 1}, + {Lo: 0x24D0, Hi: 0x24E9, Stride: 1}, + {Lo: 0x2C30, Hi: 0x2C5F, Stride: 1}, + {Lo: 0x2C61, Hi: 0x2C61, Stride: 1}, + {Lo: 0x2C65, Hi: 0x2C66, Stride: 1}, + {Lo: 0x2C68, Hi: 0x2C68, Stride: 1}, + {Lo: 0x2C6A, Hi: 0x2C6A, Stride: 1}, + {Lo: 0x2C6C, Hi: 0x2C6C, Stride: 1}, + {Lo: 0x2C71, Hi: 0x2C71, Stride: 1}, + {Lo: 0x2C73, Hi: 0x2C74, Stride: 1}, + {Lo: 0x2C76, Hi: 0x2C7D, Stride: 1}, + {Lo: 0x2C81, Hi: 0x2C81, Stride: 1}, + {Lo: 0x2C83, Hi: 0x2C83, Stride: 1}, + {Lo: 0x2C85, Hi: 0x2C85, Stride: 1}, + {Lo: 0x2C87, Hi: 0x2C87, Stride: 1}, + {Lo: 0x2C89, Hi: 0x2C89, Stride: 1}, + {Lo: 0x2C8B, Hi: 0x2C8B, Stride: 1}, + {Lo: 0x2C8D, Hi: 0x2C8D, Stride: 1}, + {Lo: 0x2C8F, Hi: 0x2C8F, Stride: 1}, + {Lo: 0x2C91, Hi: 0x2C91, Stride: 1}, + {Lo: 0x2C93, Hi: 0x2C93, Stride: 1}, + {Lo: 0x2C95, Hi: 0x2C95, Stride: 1}, + {Lo: 0x2C97, Hi: 0x2C97, Stride: 1}, + {Lo: 0x2C99, Hi: 0x2C99, Stride: 1}, + {Lo: 0x2C9B, Hi: 0x2C9B, Stride: 1}, + {Lo: 0x2C9D, Hi: 0x2C9D, Stride: 1}, + {Lo: 0x2C9F, Hi: 0x2C9F, Stride: 1}, + {Lo: 0x2CA1, Hi: 0x2CA1, Stride: 1}, + {Lo: 0x2CA3, Hi: 0x2CA3, Stride: 1}, + {Lo: 0x2CA5, Hi: 0x2CA5, Stride: 1}, + {Lo: 0x2CA7, Hi: 0x2CA7, Stride: 1}, + {Lo: 0x2CA9, Hi: 0x2CA9, Stride: 1}, + {Lo: 0x2CAB, Hi: 0x2CAB, Stride: 1}, + {Lo: 0x2CAD, Hi: 0x2CAD, Stride: 1}, + {Lo: 0x2CAF, Hi: 0x2CAF, Stride: 1}, + {Lo: 0x2CB1, Hi: 0x2CB1, Stride: 1}, + {Lo: 0x2CB3, Hi: 0x2CB3, Stride: 1}, + {Lo: 0x2CB5, Hi: 0x2CB5, Stride: 1}, + {Lo: 0x2CB7, Hi: 0x2CB7, Stride: 1}, + {Lo: 0x2CB9, Hi: 0x2CB9, Stride: 1}, + {Lo: 0x2CBB, Hi: 0x2CBB, Stride: 1}, + {Lo: 0x2CBD, Hi: 0x2CBD, Stride: 1}, + {Lo: 0x2CBF, Hi: 0x2CBF, Stride: 1}, + {Lo: 0x2CC1, Hi: 0x2CC1, Stride: 1}, + {Lo: 0x2CC3, Hi: 0x2CC3, Stride: 1}, + {Lo: 0x2CC5, Hi: 0x2CC5, Stride: 1}, + {Lo: 0x2CC7, Hi: 0x2CC7, Stride: 1}, + {Lo: 0x2CC9, Hi: 0x2CC9, Stride: 1}, + {Lo: 0x2CCB, Hi: 0x2CCB, Stride: 1}, + {Lo: 0x2CCD, Hi: 0x2CCD, Stride: 1}, + {Lo: 0x2CCF, Hi: 0x2CCF, Stride: 1}, + {Lo: 0x2CD1, Hi: 0x2CD1, Stride: 1}, + {Lo: 0x2CD3, Hi: 0x2CD3, Stride: 1}, + {Lo: 0x2CD5, Hi: 0x2CD5, Stride: 1}, + {Lo: 0x2CD7, Hi: 0x2CD7, Stride: 1}, + {Lo: 0x2CD9, Hi: 0x2CD9, Stride: 1}, + {Lo: 0x2CDB, Hi: 0x2CDB, Stride: 1}, + {Lo: 0x2CDD, Hi: 0x2CDD, Stride: 1}, + {Lo: 0x2CDF, Hi: 0x2CDF, Stride: 1}, + {Lo: 0x2CE1, Hi: 0x2CE1, Stride: 1}, + {Lo: 0x2CE3, Hi: 0x2CE4, Stride: 1}, + {Lo: 0x2CEC, Hi: 0x2CEC, Stride: 1}, + {Lo: 0x2CEE, Hi: 0x2CEE, Stride: 1}, + {Lo: 0x2CF3, Hi: 0x2CF3, Stride: 1}, + {Lo: 0x2D00, Hi: 0x2D25, Stride: 1}, + {Lo: 0x2D27, Hi: 0x2D27, Stride: 1}, + {Lo: 0x2D2D, Hi: 0x2D2D, Stride: 1}, + {Lo: 0xA641, Hi: 0xA641, Stride: 1}, + {Lo: 0xA643, Hi: 0xA643, Stride: 1}, + {Lo: 0xA645, Hi: 0xA645, Stride: 1}, + {Lo: 0xA647, Hi: 0xA647, Stride: 1}, + {Lo: 0xA649, Hi: 0xA649, Stride: 1}, + {Lo: 0xA64B, Hi: 0xA64B, Stride: 1}, + {Lo: 0xA64D, Hi: 0xA64D, Stride: 1}, + {Lo: 0xA64F, Hi: 0xA64F, Stride: 1}, + {Lo: 0xA651, Hi: 0xA651, Stride: 1}, + {Lo: 0xA653, Hi: 0xA653, Stride: 1}, + {Lo: 0xA655, Hi: 0xA655, Stride: 1}, + {Lo: 0xA657, Hi: 0xA657, Stride: 1}, + {Lo: 0xA659, Hi: 0xA659, Stride: 1}, + {Lo: 0xA65B, Hi: 0xA65B, Stride: 1}, + {Lo: 0xA65D, Hi: 0xA65D, Stride: 1}, + {Lo: 0xA65F, Hi: 0xA65F, Stride: 1}, + {Lo: 0xA661, Hi: 0xA661, Stride: 1}, + {Lo: 0xA663, Hi: 0xA663, Stride: 1}, + {Lo: 0xA665, Hi: 0xA665, Stride: 1}, + {Lo: 0xA667, Hi: 0xA667, Stride: 1}, + {Lo: 0xA669, Hi: 0xA669, Stride: 1}, + {Lo: 0xA66B, Hi: 0xA66B, Stride: 1}, + {Lo: 0xA66D, Hi: 0xA66D, Stride: 1}, + {Lo: 0xA681, Hi: 0xA681, Stride: 1}, + {Lo: 0xA683, Hi: 0xA683, Stride: 1}, + {Lo: 0xA685, Hi: 0xA685, Stride: 1}, + {Lo: 0xA687, Hi: 0xA687, Stride: 1}, + {Lo: 0xA689, Hi: 0xA689, Stride: 1}, + {Lo: 0xA68B, Hi: 0xA68B, Stride: 1}, + {Lo: 0xA68D, Hi: 0xA68D, Stride: 1}, + {Lo: 0xA68F, Hi: 0xA68F, Stride: 1}, + {Lo: 0xA691, Hi: 0xA691, Stride: 1}, + {Lo: 0xA693, Hi: 0xA693, Stride: 1}, + {Lo: 0xA695, Hi: 0xA695, Stride: 1}, + {Lo: 0xA697, Hi: 0xA697, Stride: 1}, + {Lo: 0xA699, Hi: 0xA699, Stride: 1}, + {Lo: 0xA69B, Hi: 0xA69D, Stride: 1}, + {Lo: 0xA723, Hi: 0xA723, Stride: 1}, + {Lo: 0xA725, Hi: 0xA725, Stride: 1}, + {Lo: 0xA727, Hi: 0xA727, Stride: 1}, + {Lo: 0xA729, Hi: 0xA729, Stride: 1}, + {Lo: 0xA72B, Hi: 0xA72B, Stride: 1}, + {Lo: 0xA72D, Hi: 0xA72D, Stride: 1}, + {Lo: 0xA72F, Hi: 0xA731, Stride: 1}, + {Lo: 0xA733, Hi: 0xA733, Stride: 1}, + {Lo: 0xA735, Hi: 0xA735, Stride: 1}, + {Lo: 0xA737, Hi: 0xA737, Stride: 1}, + {Lo: 0xA739, Hi: 0xA739, Stride: 1}, + {Lo: 0xA73B, Hi: 0xA73B, Stride: 1}, + {Lo: 0xA73D, Hi: 0xA73D, Stride: 1}, + {Lo: 0xA73F, Hi: 0xA73F, Stride: 1}, + {Lo: 0xA741, Hi: 0xA741, Stride: 1}, + {Lo: 0xA743, Hi: 0xA743, Stride: 1}, + {Lo: 0xA745, Hi: 0xA745, Stride: 1}, + {Lo: 0xA747, Hi: 0xA747, Stride: 1}, + {Lo: 0xA749, Hi: 0xA749, Stride: 1}, + {Lo: 0xA74B, Hi: 0xA74B, Stride: 1}, + {Lo: 0xA74D, Hi: 0xA74D, Stride: 1}, + {Lo: 0xA74F, Hi: 0xA74F, Stride: 1}, + {Lo: 0xA751, Hi: 0xA751, Stride: 1}, + {Lo: 0xA753, Hi: 0xA753, Stride: 1}, + {Lo: 0xA755, Hi: 0xA755, Stride: 1}, + {Lo: 0xA757, Hi: 0xA757, Stride: 1}, + {Lo: 0xA759, Hi: 0xA759, Stride: 1}, + {Lo: 0xA75B, Hi: 0xA75B, Stride: 1}, + {Lo: 0xA75D, Hi: 0xA75D, Stride: 1}, + {Lo: 0xA75F, Hi: 0xA75F, Stride: 1}, + {Lo: 0xA761, Hi: 0xA761, Stride: 1}, + {Lo: 0xA763, Hi: 0xA763, Stride: 1}, + {Lo: 0xA765, Hi: 0xA765, Stride: 1}, + {Lo: 0xA767, Hi: 0xA767, Stride: 1}, + {Lo: 0xA769, Hi: 0xA769, Stride: 1}, + {Lo: 0xA76B, Hi: 0xA76B, Stride: 1}, + {Lo: 0xA76D, Hi: 0xA76D, Stride: 1}, + {Lo: 0xA76F, Hi: 0xA778, Stride: 1}, + {Lo: 0xA77A, Hi: 0xA77A, Stride: 1}, + {Lo: 0xA77C, Hi: 0xA77C, Stride: 1}, + {Lo: 0xA77F, Hi: 0xA77F, Stride: 1}, + {Lo: 0xA781, Hi: 0xA781, Stride: 1}, + {Lo: 0xA783, Hi: 0xA783, Stride: 1}, + {Lo: 0xA785, Hi: 0xA785, Stride: 1}, + {Lo: 0xA787, Hi: 0xA787, Stride: 1}, + {Lo: 0xA78C, Hi: 0xA78C, Stride: 1}, + {Lo: 0xA78E, Hi: 0xA78E, Stride: 1}, + {Lo: 0xA791, Hi: 0xA791, Stride: 1}, + {Lo: 0xA793, Hi: 0xA795, Stride: 1}, + {Lo: 0xA797, Hi: 0xA797, Stride: 1}, + {Lo: 0xA799, Hi: 0xA799, Stride: 1}, + {Lo: 0xA79B, Hi: 0xA79B, Stride: 1}, + {Lo: 0xA79D, Hi: 0xA79D, Stride: 1}, + {Lo: 0xA79F, Hi: 0xA79F, Stride: 1}, + {Lo: 0xA7A1, Hi: 0xA7A1, Stride: 1}, + {Lo: 0xA7A3, Hi: 0xA7A3, Stride: 1}, + {Lo: 0xA7A5, Hi: 0xA7A5, Stride: 1}, + {Lo: 0xA7A7, Hi: 0xA7A7, Stride: 1}, + {Lo: 0xA7A9, Hi: 0xA7A9, Stride: 1}, + {Lo: 0xA7AF, Hi: 0xA7AF, Stride: 1}, + {Lo: 0xA7B5, Hi: 0xA7B5, Stride: 1}, + {Lo: 0xA7B7, Hi: 0xA7B7, Stride: 1}, + {Lo: 0xA7B9, Hi: 0xA7B9, Stride: 1}, + {Lo: 0xA7BB, Hi: 0xA7BB, Stride: 1}, + {Lo: 0xA7BD, Hi: 0xA7BD, Stride: 1}, + {Lo: 0xA7BF, Hi: 0xA7BF, Stride: 1}, + {Lo: 0xA7C1, Hi: 0xA7C1, Stride: 1}, + {Lo: 0xA7C3, Hi: 0xA7C3, Stride: 1}, + {Lo: 0xA7C8, Hi: 0xA7C8, Stride: 1}, + {Lo: 0xA7CA, Hi: 0xA7CA, Stride: 1}, + {Lo: 0xA7CD, Hi: 0xA7CD, Stride: 1}, + {Lo: 0xA7CF, Hi: 0xA7CF, Stride: 1}, + {Lo: 0xA7D1, Hi: 0xA7D1, Stride: 1}, + {Lo: 0xA7D3, Hi: 0xA7D3, Stride: 1}, + {Lo: 0xA7D5, Hi: 0xA7D5, Stride: 1}, + {Lo: 0xA7D7, Hi: 0xA7D7, Stride: 1}, + {Lo: 0xA7D9, Hi: 0xA7D9, Stride: 1}, + {Lo: 0xA7DB, Hi: 0xA7DB, Stride: 1}, + {Lo: 0xA7F1, Hi: 0xA7F4, Stride: 1}, + {Lo: 0xA7F6, Hi: 0xA7F6, Stride: 1}, + {Lo: 0xA7F8, Hi: 0xA7FA, Stride: 1}, + {Lo: 0xAB30, Hi: 0xAB5A, Stride: 1}, + {Lo: 0xAB5C, Hi: 0xAB69, Stride: 1}, + {Lo: 0xAB70, Hi: 0xABBF, Stride: 1}, + {Lo: 0xFB00, Hi: 0xFB06, Stride: 1}, + {Lo: 0xFB13, Hi: 0xFB17, Stride: 1}, + {Lo: 0xFF41, Hi: 0xFF5A, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x10428, Hi: 0x1044F, Stride: 1}, + {Lo: 0x104D8, Hi: 0x104FB, Stride: 1}, + {Lo: 0x10597, Hi: 0x105A1, Stride: 1}, + {Lo: 0x105A3, Hi: 0x105B1, Stride: 1}, + {Lo: 0x105B3, Hi: 0x105B9, Stride: 1}, + {Lo: 0x105BB, Hi: 0x105BC, Stride: 1}, + {Lo: 0x10780, Hi: 0x10780, Stride: 1}, + {Lo: 0x10783, Hi: 0x10785, Stride: 1}, + {Lo: 0x10787, Hi: 0x107B0, Stride: 1}, + {Lo: 0x107B2, Hi: 0x107BA, Stride: 1}, + {Lo: 0x10CC0, Hi: 0x10CF2, Stride: 1}, + {Lo: 0x10D70, Hi: 0x10D85, Stride: 1}, + {Lo: 0x118C0, Hi: 0x118DF, Stride: 1}, + {Lo: 0x16E60, Hi: 0x16E7F, Stride: 1}, + {Lo: 0x16EBB, Hi: 0x16ED3, Stride: 1}, + {Lo: 0x1D41A, Hi: 0x1D433, Stride: 1}, + {Lo: 0x1D44E, Hi: 0x1D454, Stride: 1}, + {Lo: 0x1D456, Hi: 0x1D467, Stride: 1}, + {Lo: 0x1D482, Hi: 0x1D49B, Stride: 1}, + {Lo: 0x1D4B6, Hi: 0x1D4B9, Stride: 1}, + {Lo: 0x1D4BB, Hi: 0x1D4BB, Stride: 1}, + {Lo: 0x1D4BD, Hi: 0x1D4C3, Stride: 1}, + {Lo: 0x1D4C5, Hi: 0x1D4CF, Stride: 1}, + {Lo: 0x1D4EA, Hi: 0x1D503, Stride: 1}, + {Lo: 0x1D51E, Hi: 0x1D537, Stride: 1}, + {Lo: 0x1D552, Hi: 0x1D56B, Stride: 1}, + {Lo: 0x1D586, Hi: 0x1D59F, Stride: 1}, + {Lo: 0x1D5BA, Hi: 0x1D5D3, Stride: 1}, + {Lo: 0x1D5EE, Hi: 0x1D607, Stride: 1}, + {Lo: 0x1D622, Hi: 0x1D63B, Stride: 1}, + {Lo: 0x1D656, Hi: 0x1D66F, Stride: 1}, + {Lo: 0x1D68A, Hi: 0x1D6A5, Stride: 1}, + {Lo: 0x1D6C2, Hi: 0x1D6DA, Stride: 1}, + {Lo: 0x1D6DC, Hi: 0x1D6E1, Stride: 1}, + {Lo: 0x1D6FC, Hi: 0x1D714, Stride: 1}, + {Lo: 0x1D716, Hi: 0x1D71B, Stride: 1}, + {Lo: 0x1D736, Hi: 0x1D74E, Stride: 1}, + {Lo: 0x1D750, Hi: 0x1D755, Stride: 1}, + {Lo: 0x1D770, Hi: 0x1D788, Stride: 1}, + {Lo: 0x1D78A, Hi: 0x1D78F, Stride: 1}, + {Lo: 0x1D7AA, Hi: 0x1D7C2, Stride: 1}, + {Lo: 0x1D7C4, Hi: 0x1D7C9, Stride: 1}, + {Lo: 0x1D7CB, Hi: 0x1D7CB, Stride: 1}, + {Lo: 0x1DF00, Hi: 0x1DF09, Stride: 1}, + {Lo: 0x1DF0B, Hi: 0x1DF1E, Stride: 1}, + {Lo: 0x1DF25, Hi: 0x1DF2A, Stride: 1}, + {Lo: 0x1E030, Hi: 0x1E06D, Stride: 1}, + {Lo: 0x1E922, Hi: 0x1E943, Stride: 1}, + }, +} + +var unicodeAliasSentence_Break_Numeric = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x30, Hi: 0x39, Stride: 1}, + {Lo: 0x600, Hi: 0x605, Stride: 1}, + {Lo: 0x660, Hi: 0x669, Stride: 1}, + {Lo: 0x66B, Hi: 0x66C, Stride: 1}, + {Lo: 0x6DD, Hi: 0x6DD, Stride: 1}, + {Lo: 0x6F0, Hi: 0x6F9, Stride: 1}, + {Lo: 0x7C0, Hi: 0x7C9, Stride: 1}, + {Lo: 0x890, Hi: 0x891, Stride: 1}, + {Lo: 0x8E2, Hi: 0x8E2, Stride: 1}, + {Lo: 0x966, Hi: 0x96F, Stride: 1}, + {Lo: 0x9E6, Hi: 0x9EF, Stride: 1}, + {Lo: 0xA66, Hi: 0xA6F, Stride: 1}, + {Lo: 0xAE6, Hi: 0xAEF, Stride: 1}, + {Lo: 0xB66, Hi: 0xB6F, Stride: 1}, + {Lo: 0xBE6, Hi: 0xBEF, Stride: 1}, + {Lo: 0xC66, Hi: 0xC6F, Stride: 1}, + {Lo: 0xCE6, Hi: 0xCEF, Stride: 1}, + {Lo: 0xD66, Hi: 0xD6F, Stride: 1}, + {Lo: 0xDE6, Hi: 0xDEF, Stride: 1}, + {Lo: 0xE50, Hi: 0xE59, Stride: 1}, + {Lo: 0xED0, Hi: 0xED9, Stride: 1}, + {Lo: 0xF20, Hi: 0xF29, Stride: 1}, + {Lo: 0x1040, Hi: 0x1049, Stride: 1}, + {Lo: 0x1090, Hi: 0x1099, Stride: 1}, + {Lo: 0x17E0, Hi: 0x17E9, Stride: 1}, + {Lo: 0x1810, Hi: 0x1819, Stride: 1}, + {Lo: 0x1946, Hi: 0x194F, Stride: 1}, + {Lo: 0x19D0, Hi: 0x19DA, Stride: 1}, + {Lo: 0x1A80, Hi: 0x1A89, Stride: 1}, + {Lo: 0x1A90, Hi: 0x1A99, Stride: 1}, + {Lo: 0x1B50, Hi: 0x1B59, Stride: 1}, + {Lo: 0x1BB0, Hi: 0x1BB9, Stride: 1}, + {Lo: 0x1C40, Hi: 0x1C49, Stride: 1}, + {Lo: 0x1C50, Hi: 0x1C59, Stride: 1}, + {Lo: 0xA620, Hi: 0xA629, Stride: 1}, + {Lo: 0xA8D0, Hi: 0xA8D9, Stride: 1}, + {Lo: 0xA900, Hi: 0xA909, Stride: 1}, + {Lo: 0xA9D0, Hi: 0xA9D9, Stride: 1}, + {Lo: 0xA9F0, Hi: 0xA9F9, Stride: 1}, + {Lo: 0xAA50, Hi: 0xAA59, Stride: 1}, + {Lo: 0xABF0, Hi: 0xABF9, Stride: 1}, + {Lo: 0xFF10, Hi: 0xFF19, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x104A0, Hi: 0x104A9, Stride: 1}, + {Lo: 0x10D30, Hi: 0x10D39, Stride: 1}, + {Lo: 0x10D40, Hi: 0x10D49, Stride: 1}, + {Lo: 0x11066, Hi: 0x1106F, Stride: 1}, + {Lo: 0x110BD, Hi: 0x110BD, Stride: 1}, + {Lo: 0x110CD, Hi: 0x110CD, Stride: 1}, + {Lo: 0x110F0, Hi: 0x110F9, Stride: 1}, + {Lo: 0x11136, Hi: 0x1113F, Stride: 1}, + {Lo: 0x111D0, Hi: 0x111D9, Stride: 1}, + {Lo: 0x112F0, Hi: 0x112F9, Stride: 1}, + {Lo: 0x11450, Hi: 0x11459, Stride: 1}, + {Lo: 0x114D0, Hi: 0x114D9, Stride: 1}, + {Lo: 0x11650, Hi: 0x11659, Stride: 1}, + {Lo: 0x116C0, Hi: 0x116C9, Stride: 1}, + {Lo: 0x116D0, Hi: 0x116E3, Stride: 1}, + {Lo: 0x11730, Hi: 0x11739, Stride: 1}, + {Lo: 0x118E0, Hi: 0x118E9, Stride: 1}, + {Lo: 0x11950, Hi: 0x11959, Stride: 1}, + {Lo: 0x11BF0, Hi: 0x11BF9, Stride: 1}, + {Lo: 0x11C50, Hi: 0x11C59, Stride: 1}, + {Lo: 0x11D50, Hi: 0x11D59, Stride: 1}, + {Lo: 0x11DA0, Hi: 0x11DA9, Stride: 1}, + {Lo: 0x11DE0, Hi: 0x11DE9, Stride: 1}, + {Lo: 0x11F50, Hi: 0x11F59, Stride: 1}, + {Lo: 0x16130, Hi: 0x16139, Stride: 1}, + {Lo: 0x16A60, Hi: 0x16A69, Stride: 1}, + {Lo: 0x16AC0, Hi: 0x16AC9, Stride: 1}, + {Lo: 0x16B50, Hi: 0x16B59, Stride: 1}, + {Lo: 0x16D70, Hi: 0x16D79, Stride: 1}, + {Lo: 0x1CCF0, Hi: 0x1CCF9, Stride: 1}, + {Lo: 0x1D7CE, Hi: 0x1D7FF, Stride: 1}, + {Lo: 0x1E140, Hi: 0x1E149, Stride: 1}, + {Lo: 0x1E2F0, Hi: 0x1E2F9, Stride: 1}, + {Lo: 0x1E4F0, Hi: 0x1E4F9, Stride: 1}, + {Lo: 0x1E5F1, Hi: 0x1E5FA, Stride: 1}, + {Lo: 0x1E950, Hi: 0x1E959, Stride: 1}, + {Lo: 0x1FBF0, Hi: 0x1FBF9, Stride: 1}, + }, +} + +var unicodeAliasSentence_Break_OLetter = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x1BB, Hi: 0x1BB, Stride: 1}, + {Lo: 0x1C0, Hi: 0x1C3, Stride: 1}, + {Lo: 0x294, Hi: 0x295, Stride: 1}, + {Lo: 0x2B9, Hi: 0x2BF, Stride: 1}, + {Lo: 0x2C6, Hi: 0x2D1, Stride: 1}, + {Lo: 0x2EC, Hi: 0x2EC, Stride: 1}, + {Lo: 0x2EE, Hi: 0x2EE, Stride: 1}, + {Lo: 0x374, Hi: 0x374, Stride: 1}, + {Lo: 0x559, Hi: 0x559, Stride: 1}, + {Lo: 0x5D0, Hi: 0x5EA, Stride: 1}, + {Lo: 0x5EF, Hi: 0x5F3, Stride: 1}, + {Lo: 0x620, Hi: 0x64A, Stride: 1}, + {Lo: 0x66E, Hi: 0x66F, Stride: 1}, + {Lo: 0x671, Hi: 0x6D3, Stride: 1}, + {Lo: 0x6D5, Hi: 0x6D5, Stride: 1}, + {Lo: 0x6E5, Hi: 0x6E6, Stride: 1}, + {Lo: 0x6EE, Hi: 0x6EF, Stride: 1}, + {Lo: 0x6FA, Hi: 0x6FC, Stride: 1}, + {Lo: 0x6FF, Hi: 0x6FF, Stride: 1}, + {Lo: 0x710, Hi: 0x710, Stride: 1}, + {Lo: 0x712, Hi: 0x72F, Stride: 1}, + {Lo: 0x74D, Hi: 0x7A5, Stride: 1}, + {Lo: 0x7B1, Hi: 0x7B1, Stride: 1}, + {Lo: 0x7CA, Hi: 0x7EA, Stride: 1}, + {Lo: 0x7F4, Hi: 0x7F5, Stride: 1}, + {Lo: 0x7FA, Hi: 0x7FA, Stride: 1}, + {Lo: 0x800, Hi: 0x815, Stride: 1}, + {Lo: 0x81A, Hi: 0x81A, Stride: 1}, + {Lo: 0x824, Hi: 0x824, Stride: 1}, + {Lo: 0x828, Hi: 0x828, Stride: 1}, + {Lo: 0x840, Hi: 0x858, Stride: 1}, + {Lo: 0x860, Hi: 0x86A, Stride: 1}, + {Lo: 0x870, Hi: 0x887, Stride: 1}, + {Lo: 0x889, Hi: 0x88F, Stride: 1}, + {Lo: 0x8A0, Hi: 0x8C9, Stride: 1}, + {Lo: 0x904, Hi: 0x939, Stride: 1}, + {Lo: 0x93D, Hi: 0x93D, Stride: 1}, + {Lo: 0x950, Hi: 0x950, Stride: 1}, + {Lo: 0x958, Hi: 0x961, Stride: 1}, + {Lo: 0x971, Hi: 0x980, Stride: 1}, + {Lo: 0x985, Hi: 0x98C, Stride: 1}, + {Lo: 0x98F, Hi: 0x990, Stride: 1}, + {Lo: 0x993, Hi: 0x9A8, Stride: 1}, + {Lo: 0x9AA, Hi: 0x9B0, Stride: 1}, + {Lo: 0x9B2, Hi: 0x9B2, Stride: 1}, + {Lo: 0x9B6, Hi: 0x9B9, Stride: 1}, + {Lo: 0x9BD, Hi: 0x9BD, Stride: 1}, + {Lo: 0x9CE, Hi: 0x9CE, Stride: 1}, + {Lo: 0x9DC, Hi: 0x9DD, Stride: 1}, + {Lo: 0x9DF, Hi: 0x9E1, Stride: 1}, + {Lo: 0x9F0, Hi: 0x9F1, Stride: 1}, + {Lo: 0x9FC, Hi: 0x9FC, Stride: 1}, + {Lo: 0xA05, Hi: 0xA0A, Stride: 1}, + {Lo: 0xA0F, Hi: 0xA10, Stride: 1}, + {Lo: 0xA13, Hi: 0xA28, Stride: 1}, + {Lo: 0xA2A, Hi: 0xA30, Stride: 1}, + {Lo: 0xA32, Hi: 0xA33, Stride: 1}, + {Lo: 0xA35, Hi: 0xA36, Stride: 1}, + {Lo: 0xA38, Hi: 0xA39, Stride: 1}, + {Lo: 0xA59, Hi: 0xA5C, Stride: 1}, + {Lo: 0xA5E, Hi: 0xA5E, Stride: 1}, + {Lo: 0xA72, Hi: 0xA74, Stride: 1}, + {Lo: 0xA85, Hi: 0xA8D, Stride: 1}, + {Lo: 0xA8F, Hi: 0xA91, Stride: 1}, + {Lo: 0xA93, Hi: 0xAA8, Stride: 1}, + {Lo: 0xAAA, Hi: 0xAB0, Stride: 1}, + {Lo: 0xAB2, Hi: 0xAB3, Stride: 1}, + {Lo: 0xAB5, Hi: 0xAB9, Stride: 1}, + {Lo: 0xABD, Hi: 0xABD, Stride: 1}, + {Lo: 0xAD0, Hi: 0xAD0, Stride: 1}, + {Lo: 0xAE0, Hi: 0xAE1, Stride: 1}, + {Lo: 0xAF9, Hi: 0xAF9, Stride: 1}, + {Lo: 0xB05, Hi: 0xB0C, Stride: 1}, + {Lo: 0xB0F, Hi: 0xB10, Stride: 1}, + {Lo: 0xB13, Hi: 0xB28, Stride: 1}, + {Lo: 0xB2A, Hi: 0xB30, Stride: 1}, + {Lo: 0xB32, Hi: 0xB33, Stride: 1}, + {Lo: 0xB35, Hi: 0xB39, Stride: 1}, + {Lo: 0xB3D, Hi: 0xB3D, Stride: 1}, + {Lo: 0xB5C, Hi: 0xB5D, Stride: 1}, + {Lo: 0xB5F, Hi: 0xB61, Stride: 1}, + {Lo: 0xB71, Hi: 0xB71, Stride: 1}, + {Lo: 0xB83, Hi: 0xB83, Stride: 1}, + {Lo: 0xB85, Hi: 0xB8A, Stride: 1}, + {Lo: 0xB8E, Hi: 0xB90, Stride: 1}, + {Lo: 0xB92, Hi: 0xB95, Stride: 1}, + {Lo: 0xB99, Hi: 0xB9A, Stride: 1}, + {Lo: 0xB9C, Hi: 0xB9C, Stride: 1}, + {Lo: 0xB9E, Hi: 0xB9F, Stride: 1}, + {Lo: 0xBA3, Hi: 0xBA4, Stride: 1}, + {Lo: 0xBA8, Hi: 0xBAA, Stride: 1}, + {Lo: 0xBAE, Hi: 0xBB9, Stride: 1}, + {Lo: 0xBD0, Hi: 0xBD0, Stride: 1}, + {Lo: 0xC05, Hi: 0xC0C, Stride: 1}, + {Lo: 0xC0E, Hi: 0xC10, Stride: 1}, + {Lo: 0xC12, Hi: 0xC28, Stride: 1}, + {Lo: 0xC2A, Hi: 0xC39, Stride: 1}, + {Lo: 0xC3D, Hi: 0xC3D, Stride: 1}, + {Lo: 0xC58, Hi: 0xC5A, Stride: 1}, + {Lo: 0xC5C, Hi: 0xC5D, Stride: 1}, + {Lo: 0xC60, Hi: 0xC61, Stride: 1}, + {Lo: 0xC80, Hi: 0xC80, Stride: 1}, + {Lo: 0xC85, Hi: 0xC8C, Stride: 1}, + {Lo: 0xC8E, Hi: 0xC90, Stride: 1}, + {Lo: 0xC92, Hi: 0xCA8, Stride: 1}, + {Lo: 0xCAA, Hi: 0xCB3, Stride: 1}, + {Lo: 0xCB5, Hi: 0xCB9, Stride: 1}, + {Lo: 0xCBD, Hi: 0xCBD, Stride: 1}, + {Lo: 0xCDC, Hi: 0xCDE, Stride: 1}, + {Lo: 0xCE0, Hi: 0xCE1, Stride: 1}, + {Lo: 0xCF1, Hi: 0xCF2, Stride: 1}, + {Lo: 0xD04, Hi: 0xD0C, Stride: 1}, + {Lo: 0xD0E, Hi: 0xD10, Stride: 1}, + {Lo: 0xD12, Hi: 0xD3A, Stride: 1}, + {Lo: 0xD3D, Hi: 0xD3D, Stride: 1}, + {Lo: 0xD4E, Hi: 0xD4E, Stride: 1}, + {Lo: 0xD54, Hi: 0xD56, Stride: 1}, + {Lo: 0xD5F, Hi: 0xD61, Stride: 1}, + {Lo: 0xD7A, Hi: 0xD7F, Stride: 1}, + {Lo: 0xD85, Hi: 0xD96, Stride: 1}, + {Lo: 0xD9A, Hi: 0xDB1, Stride: 1}, + {Lo: 0xDB3, Hi: 0xDBB, Stride: 1}, + {Lo: 0xDBD, Hi: 0xDBD, Stride: 1}, + {Lo: 0xDC0, Hi: 0xDC6, Stride: 1}, + {Lo: 0xE01, Hi: 0xE30, Stride: 1}, + {Lo: 0xE32, Hi: 0xE33, Stride: 1}, + {Lo: 0xE40, Hi: 0xE46, Stride: 1}, + {Lo: 0xE81, Hi: 0xE82, Stride: 1}, + {Lo: 0xE84, Hi: 0xE84, Stride: 1}, + {Lo: 0xE86, Hi: 0xE8A, Stride: 1}, + {Lo: 0xE8C, Hi: 0xEA3, Stride: 1}, + {Lo: 0xEA5, Hi: 0xEA5, Stride: 1}, + {Lo: 0xEA7, Hi: 0xEB0, Stride: 1}, + {Lo: 0xEB2, Hi: 0xEB3, Stride: 1}, + {Lo: 0xEBD, Hi: 0xEBD, Stride: 1}, + {Lo: 0xEC0, Hi: 0xEC4, Stride: 1}, + {Lo: 0xEC6, Hi: 0xEC6, Stride: 1}, + {Lo: 0xEDC, Hi: 0xEDF, Stride: 1}, + {Lo: 0xF00, Hi: 0xF00, Stride: 1}, + {Lo: 0xF40, Hi: 0xF47, Stride: 1}, + {Lo: 0xF49, Hi: 0xF6C, Stride: 1}, + {Lo: 0xF88, Hi: 0xF8C, Stride: 1}, + {Lo: 0x1000, Hi: 0x102A, Stride: 1}, + {Lo: 0x103F, Hi: 0x103F, Stride: 1}, + {Lo: 0x1050, Hi: 0x1055, Stride: 1}, + {Lo: 0x105A, Hi: 0x105D, Stride: 1}, + {Lo: 0x1061, Hi: 0x1061, Stride: 1}, + {Lo: 0x1065, Hi: 0x1066, Stride: 1}, + {Lo: 0x106E, Hi: 0x1070, Stride: 1}, + {Lo: 0x1075, Hi: 0x1081, Stride: 1}, + {Lo: 0x108E, Hi: 0x108E, Stride: 1}, + {Lo: 0x10D0, Hi: 0x10FA, Stride: 1}, + {Lo: 0x10FD, Hi: 0x1248, Stride: 1}, + {Lo: 0x124A, Hi: 0x124D, Stride: 1}, + {Lo: 0x1250, Hi: 0x1256, Stride: 1}, + {Lo: 0x1258, Hi: 0x1258, Stride: 1}, + {Lo: 0x125A, Hi: 0x125D, Stride: 1}, + {Lo: 0x1260, Hi: 0x1288, Stride: 1}, + {Lo: 0x128A, Hi: 0x128D, Stride: 1}, + {Lo: 0x1290, Hi: 0x12B0, Stride: 1}, + {Lo: 0x12B2, Hi: 0x12B5, Stride: 1}, + {Lo: 0x12B8, Hi: 0x12BE, Stride: 1}, + {Lo: 0x12C0, Hi: 0x12C0, Stride: 1}, + {Lo: 0x12C2, Hi: 0x12C5, Stride: 1}, + {Lo: 0x12C8, Hi: 0x12D6, Stride: 1}, + {Lo: 0x12D8, Hi: 0x1310, Stride: 1}, + {Lo: 0x1312, Hi: 0x1315, Stride: 1}, + {Lo: 0x1318, Hi: 0x135A, Stride: 1}, + {Lo: 0x1380, Hi: 0x138F, Stride: 1}, + {Lo: 0x1401, Hi: 0x166C, Stride: 1}, + {Lo: 0x166F, Hi: 0x167F, Stride: 1}, + {Lo: 0x1681, Hi: 0x169A, Stride: 1}, + {Lo: 0x16A0, Hi: 0x16EA, Stride: 1}, + {Lo: 0x16EE, Hi: 0x16F8, Stride: 1}, + {Lo: 0x1700, Hi: 0x1711, Stride: 1}, + {Lo: 0x171F, Hi: 0x1731, Stride: 1}, + {Lo: 0x1740, Hi: 0x1751, Stride: 1}, + {Lo: 0x1760, Hi: 0x176C, Stride: 1}, + {Lo: 0x176E, Hi: 0x1770, Stride: 1}, + {Lo: 0x1780, Hi: 0x17B3, Stride: 1}, + {Lo: 0x17D7, Hi: 0x17D7, Stride: 1}, + {Lo: 0x17DC, Hi: 0x17DC, Stride: 1}, + {Lo: 0x1820, Hi: 0x1878, Stride: 1}, + {Lo: 0x1880, Hi: 0x1884, Stride: 1}, + {Lo: 0x1887, Hi: 0x18A8, Stride: 1}, + {Lo: 0x18AA, Hi: 0x18AA, Stride: 1}, + {Lo: 0x18B0, Hi: 0x18F5, Stride: 1}, + {Lo: 0x1900, Hi: 0x191E, Stride: 1}, + {Lo: 0x1950, Hi: 0x196D, Stride: 1}, + {Lo: 0x1970, Hi: 0x1974, Stride: 1}, + {Lo: 0x1980, Hi: 0x19AB, Stride: 1}, + {Lo: 0x19B0, Hi: 0x19C9, Stride: 1}, + {Lo: 0x1A00, Hi: 0x1A16, Stride: 1}, + {Lo: 0x1A20, Hi: 0x1A54, Stride: 1}, + {Lo: 0x1AA7, Hi: 0x1AA7, Stride: 1}, + {Lo: 0x1B05, Hi: 0x1B33, Stride: 1}, + {Lo: 0x1B45, Hi: 0x1B4C, Stride: 1}, + {Lo: 0x1B83, Hi: 0x1BA0, Stride: 1}, + {Lo: 0x1BAE, Hi: 0x1BAF, Stride: 1}, + {Lo: 0x1BBA, Hi: 0x1BE5, Stride: 1}, + {Lo: 0x1C00, Hi: 0x1C23, Stride: 1}, + {Lo: 0x1C4D, Hi: 0x1C4F, Stride: 1}, + {Lo: 0x1C5A, Hi: 0x1C7D, Stride: 1}, + {Lo: 0x1C90, Hi: 0x1CBA, Stride: 1}, + {Lo: 0x1CBD, Hi: 0x1CBF, Stride: 1}, + {Lo: 0x1CE9, Hi: 0x1CEC, Stride: 1}, + {Lo: 0x1CEE, Hi: 0x1CF3, Stride: 1}, + {Lo: 0x1CF5, Hi: 0x1CF6, Stride: 1}, + {Lo: 0x1CFA, Hi: 0x1CFA, Stride: 1}, + {Lo: 0x2135, Hi: 0x2138, Stride: 1}, + {Lo: 0x2180, Hi: 0x2182, Stride: 1}, + {Lo: 0x2185, Hi: 0x2188, Stride: 1}, + {Lo: 0x2D30, Hi: 0x2D67, Stride: 1}, + {Lo: 0x2D6F, Hi: 0x2D6F, Stride: 1}, + {Lo: 0x2D80, Hi: 0x2D96, Stride: 1}, + {Lo: 0x2DA0, Hi: 0x2DA6, Stride: 1}, + {Lo: 0x2DA8, Hi: 0x2DAE, Stride: 1}, + {Lo: 0x2DB0, Hi: 0x2DB6, Stride: 1}, + {Lo: 0x2DB8, Hi: 0x2DBE, Stride: 1}, + {Lo: 0x2DC0, Hi: 0x2DC6, Stride: 1}, + {Lo: 0x2DC8, Hi: 0x2DCE, Stride: 1}, + {Lo: 0x2DD0, Hi: 0x2DD6, Stride: 1}, + {Lo: 0x2DD8, Hi: 0x2DDE, Stride: 1}, + {Lo: 0x2E2F, Hi: 0x2E2F, Stride: 1}, + {Lo: 0x3005, Hi: 0x3007, Stride: 1}, + {Lo: 0x3021, Hi: 0x3029, Stride: 1}, + {Lo: 0x3031, Hi: 0x3035, Stride: 1}, + {Lo: 0x3038, Hi: 0x303C, Stride: 1}, + {Lo: 0x3041, Hi: 0x3096, Stride: 1}, + {Lo: 0x309D, Hi: 0x309F, Stride: 1}, + {Lo: 0x30A1, Hi: 0x30FA, Stride: 1}, + {Lo: 0x30FC, Hi: 0x30FF, Stride: 1}, + {Lo: 0x3105, Hi: 0x312F, Stride: 1}, + {Lo: 0x3131, Hi: 0x318E, Stride: 1}, + {Lo: 0x31A0, Hi: 0x31BF, Stride: 1}, + {Lo: 0x31F0, Hi: 0x31FF, Stride: 1}, + {Lo: 0x3400, Hi: 0x4DBF, Stride: 1}, + {Lo: 0x4E00, Hi: 0xA48C, Stride: 1}, + {Lo: 0xA4D0, Hi: 0xA4FD, Stride: 1}, + {Lo: 0xA500, Hi: 0xA60C, Stride: 1}, + {Lo: 0xA610, Hi: 0xA61F, Stride: 1}, + {Lo: 0xA62A, Hi: 0xA62B, Stride: 1}, + {Lo: 0xA66E, Hi: 0xA66E, Stride: 1}, + {Lo: 0xA67F, Hi: 0xA67F, Stride: 1}, + {Lo: 0xA6A0, Hi: 0xA6EF, Stride: 1}, + {Lo: 0xA717, Hi: 0xA71F, Stride: 1}, + {Lo: 0xA788, Hi: 0xA788, Stride: 1}, + {Lo: 0xA78F, Hi: 0xA78F, Stride: 1}, + {Lo: 0xA7F7, Hi: 0xA7F7, Stride: 1}, + {Lo: 0xA7FB, Hi: 0xA801, Stride: 1}, + {Lo: 0xA803, Hi: 0xA805, Stride: 1}, + {Lo: 0xA807, Hi: 0xA80A, Stride: 1}, + {Lo: 0xA80C, Hi: 0xA822, Stride: 1}, + {Lo: 0xA840, Hi: 0xA873, Stride: 1}, + {Lo: 0xA882, Hi: 0xA8B3, Stride: 1}, + {Lo: 0xA8F2, Hi: 0xA8F7, Stride: 1}, + {Lo: 0xA8FB, Hi: 0xA8FB, Stride: 1}, + {Lo: 0xA8FD, Hi: 0xA8FE, Stride: 1}, + {Lo: 0xA90A, Hi: 0xA925, Stride: 1}, + {Lo: 0xA930, Hi: 0xA946, Stride: 1}, + {Lo: 0xA960, Hi: 0xA97C, Stride: 1}, + {Lo: 0xA984, Hi: 0xA9B2, Stride: 1}, + {Lo: 0xA9CF, Hi: 0xA9CF, Stride: 1}, + {Lo: 0xA9E0, Hi: 0xA9E4, Stride: 1}, + {Lo: 0xA9E6, Hi: 0xA9EF, Stride: 1}, + {Lo: 0xA9FA, Hi: 0xA9FE, Stride: 1}, + {Lo: 0xAA00, Hi: 0xAA28, Stride: 1}, + {Lo: 0xAA40, Hi: 0xAA42, Stride: 1}, + {Lo: 0xAA44, Hi: 0xAA4B, Stride: 1}, + {Lo: 0xAA60, Hi: 0xAA76, Stride: 1}, + {Lo: 0xAA7A, Hi: 0xAA7A, Stride: 1}, + {Lo: 0xAA7E, Hi: 0xAAAF, Stride: 1}, + {Lo: 0xAAB1, Hi: 0xAAB1, Stride: 1}, + {Lo: 0xAAB5, Hi: 0xAAB6, Stride: 1}, + {Lo: 0xAAB9, Hi: 0xAABD, Stride: 1}, + {Lo: 0xAAC0, Hi: 0xAAC0, Stride: 1}, + {Lo: 0xAAC2, Hi: 0xAAC2, Stride: 1}, + {Lo: 0xAADB, Hi: 0xAADD, Stride: 1}, + {Lo: 0xAAE0, Hi: 0xAAEA, Stride: 1}, + {Lo: 0xAAF2, Hi: 0xAAF4, Stride: 1}, + {Lo: 0xAB01, Hi: 0xAB06, Stride: 1}, + {Lo: 0xAB09, Hi: 0xAB0E, Stride: 1}, + {Lo: 0xAB11, Hi: 0xAB16, Stride: 1}, + {Lo: 0xAB20, Hi: 0xAB26, Stride: 1}, + {Lo: 0xAB28, Hi: 0xAB2E, Stride: 1}, + {Lo: 0xABC0, Hi: 0xABE2, Stride: 1}, + {Lo: 0xAC00, Hi: 0xD7A3, Stride: 1}, + {Lo: 0xD7B0, Hi: 0xD7C6, Stride: 1}, + {Lo: 0xD7CB, Hi: 0xD7FB, Stride: 1}, + {Lo: 0xF900, Hi: 0xFA6D, Stride: 1}, + {Lo: 0xFA70, Hi: 0xFAD9, Stride: 1}, + {Lo: 0xFB1D, Hi: 0xFB1D, Stride: 1}, + {Lo: 0xFB1F, Hi: 0xFB28, Stride: 1}, + {Lo: 0xFB2A, Hi: 0xFB36, Stride: 1}, + {Lo: 0xFB38, Hi: 0xFB3C, Stride: 1}, + {Lo: 0xFB3E, Hi: 0xFB3E, Stride: 1}, + {Lo: 0xFB40, Hi: 0xFB41, Stride: 1}, + {Lo: 0xFB43, Hi: 0xFB44, Stride: 1}, + {Lo: 0xFB46, Hi: 0xFBB1, Stride: 1}, + {Lo: 0xFBD3, Hi: 0xFD3D, Stride: 1}, + {Lo: 0xFD50, Hi: 0xFD8F, Stride: 1}, + {Lo: 0xFD92, Hi: 0xFDC7, Stride: 1}, + {Lo: 0xFDF0, Hi: 0xFDFB, Stride: 1}, + {Lo: 0xFE70, Hi: 0xFE74, Stride: 1}, + {Lo: 0xFE76, Hi: 0xFEFC, Stride: 1}, + {Lo: 0xFF66, Hi: 0xFF9D, Stride: 1}, + {Lo: 0xFFA0, Hi: 0xFFBE, Stride: 1}, + {Lo: 0xFFC2, Hi: 0xFFC7, Stride: 1}, + {Lo: 0xFFCA, Hi: 0xFFCF, Stride: 1}, + {Lo: 0xFFD2, Hi: 0xFFD7, Stride: 1}, + {Lo: 0xFFDA, Hi: 0xFFDC, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x10000, Hi: 0x1000B, Stride: 1}, + {Lo: 0x1000D, Hi: 0x10026, Stride: 1}, + {Lo: 0x10028, Hi: 0x1003A, Stride: 1}, + {Lo: 0x1003C, Hi: 0x1003D, Stride: 1}, + {Lo: 0x1003F, Hi: 0x1004D, Stride: 1}, + {Lo: 0x10050, Hi: 0x1005D, Stride: 1}, + {Lo: 0x10080, Hi: 0x100FA, Stride: 1}, + {Lo: 0x10140, Hi: 0x10174, Stride: 1}, + {Lo: 0x10280, Hi: 0x1029C, Stride: 1}, + {Lo: 0x102A0, Hi: 0x102D0, Stride: 1}, + {Lo: 0x10300, Hi: 0x1031F, Stride: 1}, + {Lo: 0x1032D, Hi: 0x1034A, Stride: 1}, + {Lo: 0x10350, Hi: 0x10375, Stride: 1}, + {Lo: 0x10380, Hi: 0x1039D, Stride: 1}, + {Lo: 0x103A0, Hi: 0x103C3, Stride: 1}, + {Lo: 0x103C8, Hi: 0x103CF, Stride: 1}, + {Lo: 0x103D1, Hi: 0x103D5, Stride: 1}, + {Lo: 0x10450, Hi: 0x1049D, Stride: 1}, + {Lo: 0x10500, Hi: 0x10527, Stride: 1}, + {Lo: 0x10530, Hi: 0x10563, Stride: 1}, + {Lo: 0x105C0, Hi: 0x105F3, Stride: 1}, + {Lo: 0x10600, Hi: 0x10736, Stride: 1}, + {Lo: 0x10740, Hi: 0x10755, Stride: 1}, + {Lo: 0x10760, Hi: 0x10767, Stride: 1}, + {Lo: 0x10781, Hi: 0x10782, Stride: 1}, + {Lo: 0x10800, Hi: 0x10805, Stride: 1}, + {Lo: 0x10808, Hi: 0x10808, Stride: 1}, + {Lo: 0x1080A, Hi: 0x10835, Stride: 1}, + {Lo: 0x10837, Hi: 0x10838, Stride: 1}, + {Lo: 0x1083C, Hi: 0x1083C, Stride: 1}, + {Lo: 0x1083F, Hi: 0x10855, Stride: 1}, + {Lo: 0x10860, Hi: 0x10876, Stride: 1}, + {Lo: 0x10880, Hi: 0x1089E, Stride: 1}, + {Lo: 0x108E0, Hi: 0x108F2, Stride: 1}, + {Lo: 0x108F4, Hi: 0x108F5, Stride: 1}, + {Lo: 0x10900, Hi: 0x10915, Stride: 1}, + {Lo: 0x10920, Hi: 0x10939, Stride: 1}, + {Lo: 0x10940, Hi: 0x10959, Stride: 1}, + {Lo: 0x10980, Hi: 0x109B7, Stride: 1}, + {Lo: 0x109BE, Hi: 0x109BF, Stride: 1}, + {Lo: 0x10A00, Hi: 0x10A00, Stride: 1}, + {Lo: 0x10A10, Hi: 0x10A13, Stride: 1}, + {Lo: 0x10A15, Hi: 0x10A17, Stride: 1}, + {Lo: 0x10A19, Hi: 0x10A35, Stride: 1}, + {Lo: 0x10A60, Hi: 0x10A7C, Stride: 1}, + {Lo: 0x10A80, Hi: 0x10A9C, Stride: 1}, + {Lo: 0x10AC0, Hi: 0x10AC7, Stride: 1}, + {Lo: 0x10AC9, Hi: 0x10AE4, Stride: 1}, + {Lo: 0x10B00, Hi: 0x10B35, Stride: 1}, + {Lo: 0x10B40, Hi: 0x10B55, Stride: 1}, + {Lo: 0x10B60, Hi: 0x10B72, Stride: 1}, + {Lo: 0x10B80, Hi: 0x10B91, Stride: 1}, + {Lo: 0x10C00, Hi: 0x10C48, Stride: 1}, + {Lo: 0x10D00, Hi: 0x10D23, Stride: 1}, + {Lo: 0x10D4A, Hi: 0x10D4F, Stride: 1}, + {Lo: 0x10D6F, Hi: 0x10D6F, Stride: 1}, + {Lo: 0x10E80, Hi: 0x10EA9, Stride: 1}, + {Lo: 0x10EB0, Hi: 0x10EB1, Stride: 1}, + {Lo: 0x10EC2, Hi: 0x10EC7, Stride: 1}, + {Lo: 0x10F00, Hi: 0x10F1C, Stride: 1}, + {Lo: 0x10F27, Hi: 0x10F27, Stride: 1}, + {Lo: 0x10F30, Hi: 0x10F45, Stride: 1}, + {Lo: 0x10F70, Hi: 0x10F81, Stride: 1}, + {Lo: 0x10FB0, Hi: 0x10FC4, Stride: 1}, + {Lo: 0x10FE0, Hi: 0x10FF6, Stride: 1}, + {Lo: 0x11003, Hi: 0x11037, Stride: 1}, + {Lo: 0x11071, Hi: 0x11072, Stride: 1}, + {Lo: 0x11075, Hi: 0x11075, Stride: 1}, + {Lo: 0x11083, Hi: 0x110AF, Stride: 1}, + {Lo: 0x110D0, Hi: 0x110E8, Stride: 1}, + {Lo: 0x11103, Hi: 0x11126, Stride: 1}, + {Lo: 0x11144, Hi: 0x11144, Stride: 1}, + {Lo: 0x11147, Hi: 0x11147, Stride: 1}, + {Lo: 0x11150, Hi: 0x11172, Stride: 1}, + {Lo: 0x11176, Hi: 0x11176, Stride: 1}, + {Lo: 0x11183, Hi: 0x111B2, Stride: 1}, + {Lo: 0x111C1, Hi: 0x111C4, Stride: 1}, + {Lo: 0x111DA, Hi: 0x111DA, Stride: 1}, + {Lo: 0x111DC, Hi: 0x111DC, Stride: 1}, + {Lo: 0x11200, Hi: 0x11211, Stride: 1}, + {Lo: 0x11213, Hi: 0x1122B, Stride: 1}, + {Lo: 0x1123F, Hi: 0x11240, Stride: 1}, + {Lo: 0x11280, Hi: 0x11286, Stride: 1}, + {Lo: 0x11288, Hi: 0x11288, Stride: 1}, + {Lo: 0x1128A, Hi: 0x1128D, Stride: 1}, + {Lo: 0x1128F, Hi: 0x1129D, Stride: 1}, + {Lo: 0x1129F, Hi: 0x112A8, Stride: 1}, + {Lo: 0x112B0, Hi: 0x112DE, Stride: 1}, + {Lo: 0x11305, Hi: 0x1130C, Stride: 1}, + {Lo: 0x1130F, Hi: 0x11310, Stride: 1}, + {Lo: 0x11313, Hi: 0x11328, Stride: 1}, + {Lo: 0x1132A, Hi: 0x11330, Stride: 1}, + {Lo: 0x11332, Hi: 0x11333, Stride: 1}, + {Lo: 0x11335, Hi: 0x11339, Stride: 1}, + {Lo: 0x1133D, Hi: 0x1133D, Stride: 1}, + {Lo: 0x11350, Hi: 0x11350, Stride: 1}, + {Lo: 0x1135D, Hi: 0x11361, Stride: 1}, + {Lo: 0x11380, Hi: 0x11389, Stride: 1}, + {Lo: 0x1138B, Hi: 0x1138B, Stride: 1}, + {Lo: 0x1138E, Hi: 0x1138E, Stride: 1}, + {Lo: 0x11390, Hi: 0x113B5, Stride: 1}, + {Lo: 0x113B7, Hi: 0x113B7, Stride: 1}, + {Lo: 0x113D1, Hi: 0x113D1, Stride: 1}, + {Lo: 0x113D3, Hi: 0x113D3, Stride: 1}, + {Lo: 0x11400, Hi: 0x11434, Stride: 1}, + {Lo: 0x11447, Hi: 0x1144A, Stride: 1}, + {Lo: 0x1145F, Hi: 0x11461, Stride: 1}, + {Lo: 0x11480, Hi: 0x114AF, Stride: 1}, + {Lo: 0x114C4, Hi: 0x114C5, Stride: 1}, + {Lo: 0x114C7, Hi: 0x114C7, Stride: 1}, + {Lo: 0x11580, Hi: 0x115AE, Stride: 1}, + {Lo: 0x115D8, Hi: 0x115DB, Stride: 1}, + {Lo: 0x11600, Hi: 0x1162F, Stride: 1}, + {Lo: 0x11644, Hi: 0x11644, Stride: 1}, + {Lo: 0x11680, Hi: 0x116AA, Stride: 1}, + {Lo: 0x116B8, Hi: 0x116B8, Stride: 1}, + {Lo: 0x11700, Hi: 0x1171A, Stride: 1}, + {Lo: 0x11740, Hi: 0x11746, Stride: 1}, + {Lo: 0x11800, Hi: 0x1182B, Stride: 1}, + {Lo: 0x118FF, Hi: 0x11906, Stride: 1}, + {Lo: 0x11909, Hi: 0x11909, Stride: 1}, + {Lo: 0x1190C, Hi: 0x11913, Stride: 1}, + {Lo: 0x11915, Hi: 0x11916, Stride: 1}, + {Lo: 0x11918, Hi: 0x1192F, Stride: 1}, + {Lo: 0x1193F, Hi: 0x1193F, Stride: 1}, + {Lo: 0x11941, Hi: 0x11941, Stride: 1}, + {Lo: 0x119A0, Hi: 0x119A7, Stride: 1}, + {Lo: 0x119AA, Hi: 0x119D0, Stride: 1}, + {Lo: 0x119E1, Hi: 0x119E1, Stride: 1}, + {Lo: 0x119E3, Hi: 0x119E3, Stride: 1}, + {Lo: 0x11A00, Hi: 0x11A00, Stride: 1}, + {Lo: 0x11A0B, Hi: 0x11A32, Stride: 1}, + {Lo: 0x11A3A, Hi: 0x11A3A, Stride: 1}, + {Lo: 0x11A50, Hi: 0x11A50, Stride: 1}, + {Lo: 0x11A5C, Hi: 0x11A89, Stride: 1}, + {Lo: 0x11A9D, Hi: 0x11A9D, Stride: 1}, + {Lo: 0x11AB0, Hi: 0x11AF8, Stride: 1}, + {Lo: 0x11BC0, Hi: 0x11BE0, Stride: 1}, + {Lo: 0x11C00, Hi: 0x11C08, Stride: 1}, + {Lo: 0x11C0A, Hi: 0x11C2E, Stride: 1}, + {Lo: 0x11C40, Hi: 0x11C40, Stride: 1}, + {Lo: 0x11C72, Hi: 0x11C8F, Stride: 1}, + {Lo: 0x11D00, Hi: 0x11D06, Stride: 1}, + {Lo: 0x11D08, Hi: 0x11D09, Stride: 1}, + {Lo: 0x11D0B, Hi: 0x11D30, Stride: 1}, + {Lo: 0x11D46, Hi: 0x11D46, Stride: 1}, + {Lo: 0x11D60, Hi: 0x11D65, Stride: 1}, + {Lo: 0x11D67, Hi: 0x11D68, Stride: 1}, + {Lo: 0x11D6A, Hi: 0x11D89, Stride: 1}, + {Lo: 0x11D98, Hi: 0x11D98, Stride: 1}, + {Lo: 0x11DB0, Hi: 0x11DDB, Stride: 1}, + {Lo: 0x11EE0, Hi: 0x11EF2, Stride: 1}, + {Lo: 0x11F02, Hi: 0x11F02, Stride: 1}, + {Lo: 0x11F04, Hi: 0x11F10, Stride: 1}, + {Lo: 0x11F12, Hi: 0x11F33, Stride: 1}, + {Lo: 0x11FB0, Hi: 0x11FB0, Stride: 1}, + {Lo: 0x12000, Hi: 0x12399, Stride: 1}, + {Lo: 0x12400, Hi: 0x1246E, Stride: 1}, + {Lo: 0x12480, Hi: 0x12543, Stride: 1}, + {Lo: 0x12F90, Hi: 0x12FF0, Stride: 1}, + {Lo: 0x13000, Hi: 0x1342F, Stride: 1}, + {Lo: 0x13441, Hi: 0x13446, Stride: 1}, + {Lo: 0x13460, Hi: 0x143FA, Stride: 1}, + {Lo: 0x14400, Hi: 0x14646, Stride: 1}, + {Lo: 0x16100, Hi: 0x1611D, Stride: 1}, + {Lo: 0x16800, Hi: 0x16A38, Stride: 1}, + {Lo: 0x16A40, Hi: 0x16A5E, Stride: 1}, + {Lo: 0x16A70, Hi: 0x16ABE, Stride: 1}, + {Lo: 0x16AD0, Hi: 0x16AED, Stride: 1}, + {Lo: 0x16B00, Hi: 0x16B2F, Stride: 1}, + {Lo: 0x16B40, Hi: 0x16B43, Stride: 1}, + {Lo: 0x16B63, Hi: 0x16B77, Stride: 1}, + {Lo: 0x16B7D, Hi: 0x16B8F, Stride: 1}, + {Lo: 0x16D40, Hi: 0x16D6C, Stride: 1}, + {Lo: 0x16F00, Hi: 0x16F4A, Stride: 1}, + {Lo: 0x16F50, Hi: 0x16F50, Stride: 1}, + {Lo: 0x16F93, Hi: 0x16F9F, Stride: 1}, + {Lo: 0x16FE0, Hi: 0x16FE1, Stride: 1}, + {Lo: 0x16FE3, Hi: 0x16FE3, Stride: 1}, + {Lo: 0x16FF2, Hi: 0x16FF6, Stride: 1}, + {Lo: 0x17000, Hi: 0x18CD5, Stride: 1}, + {Lo: 0x18CFF, Hi: 0x18D1E, Stride: 1}, + {Lo: 0x18D80, Hi: 0x18DF2, Stride: 1}, + {Lo: 0x1AFF0, Hi: 0x1AFF3, Stride: 1}, + {Lo: 0x1AFF5, Hi: 0x1AFFB, Stride: 1}, + {Lo: 0x1AFFD, Hi: 0x1AFFE, Stride: 1}, + {Lo: 0x1B000, Hi: 0x1B122, Stride: 1}, + {Lo: 0x1B132, Hi: 0x1B132, Stride: 1}, + {Lo: 0x1B150, Hi: 0x1B152, Stride: 1}, + {Lo: 0x1B155, Hi: 0x1B155, Stride: 1}, + {Lo: 0x1B164, Hi: 0x1B167, Stride: 1}, + {Lo: 0x1B170, Hi: 0x1B2FB, Stride: 1}, + {Lo: 0x1BC00, Hi: 0x1BC6A, Stride: 1}, + {Lo: 0x1BC70, Hi: 0x1BC7C, Stride: 1}, + {Lo: 0x1BC80, Hi: 0x1BC88, Stride: 1}, + {Lo: 0x1BC90, Hi: 0x1BC99, Stride: 1}, + {Lo: 0x1DF0A, Hi: 0x1DF0A, Stride: 1}, + {Lo: 0x1E100, Hi: 0x1E12C, Stride: 1}, + {Lo: 0x1E137, Hi: 0x1E13D, Stride: 1}, + {Lo: 0x1E14E, Hi: 0x1E14E, Stride: 1}, + {Lo: 0x1E290, Hi: 0x1E2AD, Stride: 1}, + {Lo: 0x1E2C0, Hi: 0x1E2EB, Stride: 1}, + {Lo: 0x1E4D0, Hi: 0x1E4EB, Stride: 1}, + {Lo: 0x1E5D0, Hi: 0x1E5ED, Stride: 1}, + {Lo: 0x1E5F0, Hi: 0x1E5F0, Stride: 1}, + {Lo: 0x1E6C0, Hi: 0x1E6DE, Stride: 1}, + {Lo: 0x1E6E0, Hi: 0x1E6E2, Stride: 1}, + {Lo: 0x1E6E4, Hi: 0x1E6E5, Stride: 1}, + {Lo: 0x1E6E7, Hi: 0x1E6ED, Stride: 1}, + {Lo: 0x1E6F0, Hi: 0x1E6F4, Stride: 1}, + {Lo: 0x1E6FE, Hi: 0x1E6FF, Stride: 1}, + {Lo: 0x1E7E0, Hi: 0x1E7E6, Stride: 1}, + {Lo: 0x1E7E8, Hi: 0x1E7EB, Stride: 1}, + {Lo: 0x1E7ED, Hi: 0x1E7EE, Stride: 1}, + {Lo: 0x1E7F0, Hi: 0x1E7FE, Stride: 1}, + {Lo: 0x1E800, Hi: 0x1E8C4, Stride: 1}, + {Lo: 0x1E94B, Hi: 0x1E94B, Stride: 1}, + {Lo: 0x1EE00, Hi: 0x1EE03, Stride: 1}, + {Lo: 0x1EE05, Hi: 0x1EE1F, Stride: 1}, + {Lo: 0x1EE21, Hi: 0x1EE22, Stride: 1}, + {Lo: 0x1EE24, Hi: 0x1EE24, Stride: 1}, + {Lo: 0x1EE27, Hi: 0x1EE27, Stride: 1}, + {Lo: 0x1EE29, Hi: 0x1EE32, Stride: 1}, + {Lo: 0x1EE34, Hi: 0x1EE37, Stride: 1}, + {Lo: 0x1EE39, Hi: 0x1EE39, Stride: 1}, + {Lo: 0x1EE3B, Hi: 0x1EE3B, Stride: 1}, + {Lo: 0x1EE42, Hi: 0x1EE42, Stride: 1}, + {Lo: 0x1EE47, Hi: 0x1EE47, Stride: 1}, + {Lo: 0x1EE49, Hi: 0x1EE49, Stride: 1}, + {Lo: 0x1EE4B, Hi: 0x1EE4B, Stride: 1}, + {Lo: 0x1EE4D, Hi: 0x1EE4F, Stride: 1}, + {Lo: 0x1EE51, Hi: 0x1EE52, Stride: 1}, + {Lo: 0x1EE54, Hi: 0x1EE54, Stride: 1}, + {Lo: 0x1EE57, Hi: 0x1EE57, Stride: 1}, + {Lo: 0x1EE59, Hi: 0x1EE59, Stride: 1}, + {Lo: 0x1EE5B, Hi: 0x1EE5B, Stride: 1}, + {Lo: 0x1EE5D, Hi: 0x1EE5D, Stride: 1}, + {Lo: 0x1EE5F, Hi: 0x1EE5F, Stride: 1}, + {Lo: 0x1EE61, Hi: 0x1EE62, Stride: 1}, + {Lo: 0x1EE64, Hi: 0x1EE64, Stride: 1}, + {Lo: 0x1EE67, Hi: 0x1EE6A, Stride: 1}, + {Lo: 0x1EE6C, Hi: 0x1EE72, Stride: 1}, + {Lo: 0x1EE74, Hi: 0x1EE77, Stride: 1}, + {Lo: 0x1EE79, Hi: 0x1EE7C, Stride: 1}, + {Lo: 0x1EE7E, Hi: 0x1EE7E, Stride: 1}, + {Lo: 0x1EE80, Hi: 0x1EE89, Stride: 1}, + {Lo: 0x1EE8B, Hi: 0x1EE9B, Stride: 1}, + {Lo: 0x1EEA1, Hi: 0x1EEA3, Stride: 1}, + {Lo: 0x1EEA5, Hi: 0x1EEA9, Stride: 1}, + {Lo: 0x1EEAB, Hi: 0x1EEBB, Stride: 1}, + {Lo: 0x20000, Hi: 0x2A6DF, Stride: 1}, + {Lo: 0x2A700, Hi: 0x2B81D, Stride: 1}, + {Lo: 0x2B820, Hi: 0x2CEAD, Stride: 1}, + {Lo: 0x2CEB0, Hi: 0x2EBE0, Stride: 1}, + {Lo: 0x2EBF0, Hi: 0x2EE5D, Stride: 1}, + {Lo: 0x2F800, Hi: 0x2FA1D, Stride: 1}, + {Lo: 0x30000, Hi: 0x3134A, Stride: 1}, + {Lo: 0x31350, Hi: 0x33479, Stride: 1}, + }, +} + +var unicodeAliasSentence_Break_SContinue = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x2C, Hi: 0x2D, Stride: 1}, + {Lo: 0x3A, Hi: 0x3B, Stride: 1}, + {Lo: 0x37E, Hi: 0x37E, Stride: 1}, + {Lo: 0x55D, Hi: 0x55D, Stride: 1}, + {Lo: 0x60C, Hi: 0x60D, Stride: 1}, + {Lo: 0x7F8, Hi: 0x7F8, Stride: 1}, + {Lo: 0x1802, Hi: 0x1802, Stride: 1}, + {Lo: 0x1808, Hi: 0x1808, Stride: 1}, + {Lo: 0x2013, Hi: 0x2014, Stride: 1}, + {Lo: 0x3001, Hi: 0x3001, Stride: 1}, + {Lo: 0xFE10, Hi: 0xFE11, Stride: 1}, + {Lo: 0xFE13, Hi: 0xFE14, Stride: 1}, + {Lo: 0xFE31, Hi: 0xFE32, Stride: 1}, + {Lo: 0xFE50, Hi: 0xFE51, Stride: 1}, + {Lo: 0xFE54, Hi: 0xFE55, Stride: 1}, + {Lo: 0xFE58, Hi: 0xFE58, Stride: 1}, + {Lo: 0xFE63, Hi: 0xFE63, Stride: 1}, + {Lo: 0xFF0C, Hi: 0xFF0D, Stride: 1}, + {Lo: 0xFF1A, Hi: 0xFF1B, Stride: 1}, + {Lo: 0xFF64, Hi: 0xFF64, Stride: 1}, + }, +} + +var unicodeAliasSentence_Break_STerm = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x21, Hi: 0x21, Stride: 1}, + {Lo: 0x3F, Hi: 0x3F, Stride: 1}, + {Lo: 0x589, Hi: 0x589, Stride: 1}, + {Lo: 0x61D, Hi: 0x61F, Stride: 1}, + {Lo: 0x6D4, Hi: 0x6D4, Stride: 1}, + {Lo: 0x700, Hi: 0x702, Stride: 1}, + {Lo: 0x7F9, Hi: 0x7F9, Stride: 1}, + {Lo: 0x837, Hi: 0x837, Stride: 1}, + {Lo: 0x839, Hi: 0x839, Stride: 1}, + {Lo: 0x83D, Hi: 0x83E, Stride: 1}, + {Lo: 0x964, Hi: 0x965, Stride: 1}, + {Lo: 0x104A, Hi: 0x104B, Stride: 1}, + {Lo: 0x1362, Hi: 0x1362, Stride: 1}, + {Lo: 0x1367, Hi: 0x1368, Stride: 1}, + {Lo: 0x166E, Hi: 0x166E, Stride: 1}, + {Lo: 0x1735, Hi: 0x1736, Stride: 1}, + {Lo: 0x17D4, Hi: 0x17D5, Stride: 1}, + {Lo: 0x1803, Hi: 0x1803, Stride: 1}, + {Lo: 0x1809, Hi: 0x1809, Stride: 1}, + {Lo: 0x1944, Hi: 0x1945, Stride: 1}, + {Lo: 0x1AA8, Hi: 0x1AAB, Stride: 1}, + {Lo: 0x1B4E, Hi: 0x1B4F, Stride: 1}, + {Lo: 0x1B5A, Hi: 0x1B5B, Stride: 1}, + {Lo: 0x1B5E, Hi: 0x1B5F, Stride: 1}, + {Lo: 0x1B7D, Hi: 0x1B7F, Stride: 1}, + {Lo: 0x1C3B, Hi: 0x1C3C, Stride: 1}, + {Lo: 0x1C7E, Hi: 0x1C7F, Stride: 1}, + {Lo: 0x203C, Hi: 0x203D, Stride: 1}, + {Lo: 0x2047, Hi: 0x2049, Stride: 1}, + {Lo: 0x2CF9, Hi: 0x2CFB, Stride: 1}, + {Lo: 0x2E2E, Hi: 0x2E2E, Stride: 1}, + {Lo: 0x2E3C, Hi: 0x2E3C, Stride: 1}, + {Lo: 0x2E53, Hi: 0x2E54, Stride: 1}, + {Lo: 0x3002, Hi: 0x3002, Stride: 1}, + {Lo: 0xA4FF, Hi: 0xA4FF, Stride: 1}, + {Lo: 0xA60E, Hi: 0xA60F, Stride: 1}, + {Lo: 0xA6F3, Hi: 0xA6F3, Stride: 1}, + {Lo: 0xA6F7, Hi: 0xA6F7, Stride: 1}, + {Lo: 0xA876, Hi: 0xA877, Stride: 1}, + {Lo: 0xA8CE, Hi: 0xA8CF, Stride: 1}, + {Lo: 0xA92F, Hi: 0xA92F, Stride: 1}, + {Lo: 0xA9C8, Hi: 0xA9C9, Stride: 1}, + {Lo: 0xAA5D, Hi: 0xAA5F, Stride: 1}, + {Lo: 0xAAF0, Hi: 0xAAF1, Stride: 1}, + {Lo: 0xABEB, Hi: 0xABEB, Stride: 1}, + {Lo: 0xFE12, Hi: 0xFE12, Stride: 1}, + {Lo: 0xFE15, Hi: 0xFE16, Stride: 1}, + {Lo: 0xFE56, Hi: 0xFE57, Stride: 1}, + {Lo: 0xFF01, Hi: 0xFF01, Stride: 1}, + {Lo: 0xFF1F, Hi: 0xFF1F, Stride: 1}, + {Lo: 0xFF61, Hi: 0xFF61, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x10A56, Hi: 0x10A57, Stride: 1}, + {Lo: 0x10F55, Hi: 0x10F59, Stride: 1}, + {Lo: 0x10F86, Hi: 0x10F89, Stride: 1}, + {Lo: 0x11047, Hi: 0x11048, Stride: 1}, + {Lo: 0x110BE, Hi: 0x110C1, Stride: 1}, + {Lo: 0x11141, Hi: 0x11143, Stride: 1}, + {Lo: 0x111C5, Hi: 0x111C6, Stride: 1}, + {Lo: 0x111CD, Hi: 0x111CD, Stride: 1}, + {Lo: 0x111DE, Hi: 0x111DF, Stride: 1}, + {Lo: 0x11238, Hi: 0x11239, Stride: 1}, + {Lo: 0x1123B, Hi: 0x1123C, Stride: 1}, + {Lo: 0x112A9, Hi: 0x112A9, Stride: 1}, + {Lo: 0x113D4, Hi: 0x113D5, Stride: 1}, + {Lo: 0x1144B, Hi: 0x1144C, Stride: 1}, + {Lo: 0x115C2, Hi: 0x115C3, Stride: 1}, + {Lo: 0x115C9, Hi: 0x115D7, Stride: 1}, + {Lo: 0x11641, Hi: 0x11642, Stride: 1}, + {Lo: 0x1173C, Hi: 0x1173E, Stride: 1}, + {Lo: 0x11944, Hi: 0x11944, Stride: 1}, + {Lo: 0x11946, Hi: 0x11946, Stride: 1}, + {Lo: 0x11A42, Hi: 0x11A43, Stride: 1}, + {Lo: 0x11A9B, Hi: 0x11A9C, Stride: 1}, + {Lo: 0x11C41, Hi: 0x11C42, Stride: 1}, + {Lo: 0x11EF7, Hi: 0x11EF8, Stride: 1}, + {Lo: 0x11F43, Hi: 0x11F44, Stride: 1}, + {Lo: 0x16A6E, Hi: 0x16A6F, Stride: 1}, + {Lo: 0x16AF5, Hi: 0x16AF5, Stride: 1}, + {Lo: 0x16B37, Hi: 0x16B38, Stride: 1}, + {Lo: 0x16B44, Hi: 0x16B44, Stride: 1}, + {Lo: 0x16D6E, Hi: 0x16D6F, Stride: 1}, + {Lo: 0x16E98, Hi: 0x16E98, Stride: 1}, + {Lo: 0x1BC9F, Hi: 0x1BC9F, Stride: 1}, + {Lo: 0x1DA88, Hi: 0x1DA88, Stride: 1}, + }, +} + +var unicodeAliasSentence_Break_Sep = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x85, Hi: 0x85, Stride: 1}, + {Lo: 0x2028, Hi: 0x2029, Stride: 1}, + }, +} + +var unicodeAliasSentence_Break_Sp = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x9, Hi: 0x9, Stride: 1}, + {Lo: 0xB, Hi: 0xC, Stride: 1}, + {Lo: 0x20, Hi: 0x20, Stride: 1}, + {Lo: 0xA0, Hi: 0xA0, Stride: 1}, + {Lo: 0x1680, Hi: 0x1680, Stride: 1}, + {Lo: 0x2000, Hi: 0x200A, Stride: 1}, + {Lo: 0x202F, Hi: 0x202F, Stride: 1}, + {Lo: 0x205F, Hi: 0x205F, Stride: 1}, + {Lo: 0x3000, Hi: 0x3000, Stride: 1}, + }, +} + +var unicodeAliasSentence_Break_Upper = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x41, Hi: 0x5A, Stride: 1}, + {Lo: 0xC0, Hi: 0xD6, Stride: 1}, + {Lo: 0xD8, Hi: 0xDE, Stride: 1}, + {Lo: 0x100, Hi: 0x100, Stride: 1}, + {Lo: 0x102, Hi: 0x102, Stride: 1}, + {Lo: 0x104, Hi: 0x104, Stride: 1}, + {Lo: 0x106, Hi: 0x106, Stride: 1}, + {Lo: 0x108, Hi: 0x108, Stride: 1}, + {Lo: 0x10A, Hi: 0x10A, Stride: 1}, + {Lo: 0x10C, Hi: 0x10C, Stride: 1}, + {Lo: 0x10E, Hi: 0x10E, Stride: 1}, + {Lo: 0x110, Hi: 0x110, Stride: 1}, + {Lo: 0x112, Hi: 0x112, Stride: 1}, + {Lo: 0x114, Hi: 0x114, Stride: 1}, + {Lo: 0x116, Hi: 0x116, Stride: 1}, + {Lo: 0x118, Hi: 0x118, Stride: 1}, + {Lo: 0x11A, Hi: 0x11A, Stride: 1}, + {Lo: 0x11C, Hi: 0x11C, Stride: 1}, + {Lo: 0x11E, Hi: 0x11E, Stride: 1}, + {Lo: 0x120, Hi: 0x120, Stride: 1}, + {Lo: 0x122, Hi: 0x122, Stride: 1}, + {Lo: 0x124, Hi: 0x124, Stride: 1}, + {Lo: 0x126, Hi: 0x126, Stride: 1}, + {Lo: 0x128, Hi: 0x128, Stride: 1}, + {Lo: 0x12A, Hi: 0x12A, Stride: 1}, + {Lo: 0x12C, Hi: 0x12C, Stride: 1}, + {Lo: 0x12E, Hi: 0x12E, Stride: 1}, + {Lo: 0x130, Hi: 0x130, Stride: 1}, + {Lo: 0x132, Hi: 0x132, Stride: 1}, + {Lo: 0x134, Hi: 0x134, Stride: 1}, + {Lo: 0x136, Hi: 0x136, Stride: 1}, + {Lo: 0x139, Hi: 0x139, Stride: 1}, + {Lo: 0x13B, Hi: 0x13B, Stride: 1}, + {Lo: 0x13D, Hi: 0x13D, Stride: 1}, + {Lo: 0x13F, Hi: 0x13F, Stride: 1}, + {Lo: 0x141, Hi: 0x141, Stride: 1}, + {Lo: 0x143, Hi: 0x143, Stride: 1}, + {Lo: 0x145, Hi: 0x145, Stride: 1}, + {Lo: 0x147, Hi: 0x147, Stride: 1}, + {Lo: 0x14A, Hi: 0x14A, Stride: 1}, + {Lo: 0x14C, Hi: 0x14C, Stride: 1}, + {Lo: 0x14E, Hi: 0x14E, Stride: 1}, + {Lo: 0x150, Hi: 0x150, Stride: 1}, + {Lo: 0x152, Hi: 0x152, Stride: 1}, + {Lo: 0x154, Hi: 0x154, Stride: 1}, + {Lo: 0x156, Hi: 0x156, Stride: 1}, + {Lo: 0x158, Hi: 0x158, Stride: 1}, + {Lo: 0x15A, Hi: 0x15A, Stride: 1}, + {Lo: 0x15C, Hi: 0x15C, Stride: 1}, + {Lo: 0x15E, Hi: 0x15E, Stride: 1}, + {Lo: 0x160, Hi: 0x160, Stride: 1}, + {Lo: 0x162, Hi: 0x162, Stride: 1}, + {Lo: 0x164, Hi: 0x164, Stride: 1}, + {Lo: 0x166, Hi: 0x166, Stride: 1}, + {Lo: 0x168, Hi: 0x168, Stride: 1}, + {Lo: 0x16A, Hi: 0x16A, Stride: 1}, + {Lo: 0x16C, Hi: 0x16C, Stride: 1}, + {Lo: 0x16E, Hi: 0x16E, Stride: 1}, + {Lo: 0x170, Hi: 0x170, Stride: 1}, + {Lo: 0x172, Hi: 0x172, Stride: 1}, + {Lo: 0x174, Hi: 0x174, Stride: 1}, + {Lo: 0x176, Hi: 0x176, Stride: 1}, + {Lo: 0x178, Hi: 0x179, Stride: 1}, + {Lo: 0x17B, Hi: 0x17B, Stride: 1}, + {Lo: 0x17D, Hi: 0x17D, Stride: 1}, + {Lo: 0x181, Hi: 0x182, Stride: 1}, + {Lo: 0x184, Hi: 0x184, Stride: 1}, + {Lo: 0x186, Hi: 0x187, Stride: 1}, + {Lo: 0x189, Hi: 0x18B, Stride: 1}, + {Lo: 0x18E, Hi: 0x191, Stride: 1}, + {Lo: 0x193, Hi: 0x194, Stride: 1}, + {Lo: 0x196, Hi: 0x198, Stride: 1}, + {Lo: 0x19C, Hi: 0x19D, Stride: 1}, + {Lo: 0x19F, Hi: 0x1A0, Stride: 1}, + {Lo: 0x1A2, Hi: 0x1A2, Stride: 1}, + {Lo: 0x1A4, Hi: 0x1A4, Stride: 1}, + {Lo: 0x1A6, Hi: 0x1A7, Stride: 1}, + {Lo: 0x1A9, Hi: 0x1A9, Stride: 1}, + {Lo: 0x1AC, Hi: 0x1AC, Stride: 1}, + {Lo: 0x1AE, Hi: 0x1AF, Stride: 1}, + {Lo: 0x1B1, Hi: 0x1B3, Stride: 1}, + {Lo: 0x1B5, Hi: 0x1B5, Stride: 1}, + {Lo: 0x1B7, Hi: 0x1B8, Stride: 1}, + {Lo: 0x1BC, Hi: 0x1BC, Stride: 1}, + {Lo: 0x1C4, Hi: 0x1C5, Stride: 1}, + {Lo: 0x1C7, Hi: 0x1C8, Stride: 1}, + {Lo: 0x1CA, Hi: 0x1CB, Stride: 1}, + {Lo: 0x1CD, Hi: 0x1CD, Stride: 1}, + {Lo: 0x1CF, Hi: 0x1CF, Stride: 1}, + {Lo: 0x1D1, Hi: 0x1D1, Stride: 1}, + {Lo: 0x1D3, Hi: 0x1D3, Stride: 1}, + {Lo: 0x1D5, Hi: 0x1D5, Stride: 1}, + {Lo: 0x1D7, Hi: 0x1D7, Stride: 1}, + {Lo: 0x1D9, Hi: 0x1D9, Stride: 1}, + {Lo: 0x1DB, Hi: 0x1DB, Stride: 1}, + {Lo: 0x1DE, Hi: 0x1DE, Stride: 1}, + {Lo: 0x1E0, Hi: 0x1E0, Stride: 1}, + {Lo: 0x1E2, Hi: 0x1E2, Stride: 1}, + {Lo: 0x1E4, Hi: 0x1E4, Stride: 1}, + {Lo: 0x1E6, Hi: 0x1E6, Stride: 1}, + {Lo: 0x1E8, Hi: 0x1E8, Stride: 1}, + {Lo: 0x1EA, Hi: 0x1EA, Stride: 1}, + {Lo: 0x1EC, Hi: 0x1EC, Stride: 1}, + {Lo: 0x1EE, Hi: 0x1EE, Stride: 1}, + {Lo: 0x1F1, Hi: 0x1F2, Stride: 1}, + {Lo: 0x1F4, Hi: 0x1F4, Stride: 1}, + {Lo: 0x1F6, Hi: 0x1F8, Stride: 1}, + {Lo: 0x1FA, Hi: 0x1FA, Stride: 1}, + {Lo: 0x1FC, Hi: 0x1FC, Stride: 1}, + {Lo: 0x1FE, Hi: 0x1FE, Stride: 1}, + {Lo: 0x200, Hi: 0x200, Stride: 1}, + {Lo: 0x202, Hi: 0x202, Stride: 1}, + {Lo: 0x204, Hi: 0x204, Stride: 1}, + {Lo: 0x206, Hi: 0x206, Stride: 1}, + {Lo: 0x208, Hi: 0x208, Stride: 1}, + {Lo: 0x20A, Hi: 0x20A, Stride: 1}, + {Lo: 0x20C, Hi: 0x20C, Stride: 1}, + {Lo: 0x20E, Hi: 0x20E, Stride: 1}, + {Lo: 0x210, Hi: 0x210, Stride: 1}, + {Lo: 0x212, Hi: 0x212, Stride: 1}, + {Lo: 0x214, Hi: 0x214, Stride: 1}, + {Lo: 0x216, Hi: 0x216, Stride: 1}, + {Lo: 0x218, Hi: 0x218, Stride: 1}, + {Lo: 0x21A, Hi: 0x21A, Stride: 1}, + {Lo: 0x21C, Hi: 0x21C, Stride: 1}, + {Lo: 0x21E, Hi: 0x21E, Stride: 1}, + {Lo: 0x220, Hi: 0x220, Stride: 1}, + {Lo: 0x222, Hi: 0x222, Stride: 1}, + {Lo: 0x224, Hi: 0x224, Stride: 1}, + {Lo: 0x226, Hi: 0x226, Stride: 1}, + {Lo: 0x228, Hi: 0x228, Stride: 1}, + {Lo: 0x22A, Hi: 0x22A, Stride: 1}, + {Lo: 0x22C, Hi: 0x22C, Stride: 1}, + {Lo: 0x22E, Hi: 0x22E, Stride: 1}, + {Lo: 0x230, Hi: 0x230, Stride: 1}, + {Lo: 0x232, Hi: 0x232, Stride: 1}, + {Lo: 0x23A, Hi: 0x23B, Stride: 1}, + {Lo: 0x23D, Hi: 0x23E, Stride: 1}, + {Lo: 0x241, Hi: 0x241, Stride: 1}, + {Lo: 0x243, Hi: 0x246, Stride: 1}, + {Lo: 0x248, Hi: 0x248, Stride: 1}, + {Lo: 0x24A, Hi: 0x24A, Stride: 1}, + {Lo: 0x24C, Hi: 0x24C, Stride: 1}, + {Lo: 0x24E, Hi: 0x24E, Stride: 1}, + {Lo: 0x370, Hi: 0x370, Stride: 1}, + {Lo: 0x372, Hi: 0x372, Stride: 1}, + {Lo: 0x376, Hi: 0x376, Stride: 1}, + {Lo: 0x37F, Hi: 0x37F, Stride: 1}, + {Lo: 0x386, Hi: 0x386, Stride: 1}, + {Lo: 0x388, Hi: 0x38A, Stride: 1}, + {Lo: 0x38C, Hi: 0x38C, Stride: 1}, + {Lo: 0x38E, Hi: 0x38F, Stride: 1}, + {Lo: 0x391, Hi: 0x3A1, Stride: 1}, + {Lo: 0x3A3, Hi: 0x3AB, Stride: 1}, + {Lo: 0x3CF, Hi: 0x3CF, Stride: 1}, + {Lo: 0x3D2, Hi: 0x3D4, Stride: 1}, + {Lo: 0x3D8, Hi: 0x3D8, Stride: 1}, + {Lo: 0x3DA, Hi: 0x3DA, Stride: 1}, + {Lo: 0x3DC, Hi: 0x3DC, Stride: 1}, + {Lo: 0x3DE, Hi: 0x3DE, Stride: 1}, + {Lo: 0x3E0, Hi: 0x3E0, Stride: 1}, + {Lo: 0x3E2, Hi: 0x3E2, Stride: 1}, + {Lo: 0x3E4, Hi: 0x3E4, Stride: 1}, + {Lo: 0x3E6, Hi: 0x3E6, Stride: 1}, + {Lo: 0x3E8, Hi: 0x3E8, Stride: 1}, + {Lo: 0x3EA, Hi: 0x3EA, Stride: 1}, + {Lo: 0x3EC, Hi: 0x3EC, Stride: 1}, + {Lo: 0x3EE, Hi: 0x3EE, Stride: 1}, + {Lo: 0x3F4, Hi: 0x3F4, Stride: 1}, + {Lo: 0x3F7, Hi: 0x3F7, Stride: 1}, + {Lo: 0x3F9, Hi: 0x3FA, Stride: 1}, + {Lo: 0x3FD, Hi: 0x42F, Stride: 1}, + {Lo: 0x460, Hi: 0x460, Stride: 1}, + {Lo: 0x462, Hi: 0x462, Stride: 1}, + {Lo: 0x464, Hi: 0x464, Stride: 1}, + {Lo: 0x466, Hi: 0x466, Stride: 1}, + {Lo: 0x468, Hi: 0x468, Stride: 1}, + {Lo: 0x46A, Hi: 0x46A, Stride: 1}, + {Lo: 0x46C, Hi: 0x46C, Stride: 1}, + {Lo: 0x46E, Hi: 0x46E, Stride: 1}, + {Lo: 0x470, Hi: 0x470, Stride: 1}, + {Lo: 0x472, Hi: 0x472, Stride: 1}, + {Lo: 0x474, Hi: 0x474, Stride: 1}, + {Lo: 0x476, Hi: 0x476, Stride: 1}, + {Lo: 0x478, Hi: 0x478, Stride: 1}, + {Lo: 0x47A, Hi: 0x47A, Stride: 1}, + {Lo: 0x47C, Hi: 0x47C, Stride: 1}, + {Lo: 0x47E, Hi: 0x47E, Stride: 1}, + {Lo: 0x480, Hi: 0x480, Stride: 1}, + {Lo: 0x48A, Hi: 0x48A, Stride: 1}, + {Lo: 0x48C, Hi: 0x48C, Stride: 1}, + {Lo: 0x48E, Hi: 0x48E, Stride: 1}, + {Lo: 0x490, Hi: 0x490, Stride: 1}, + {Lo: 0x492, Hi: 0x492, Stride: 1}, + {Lo: 0x494, Hi: 0x494, Stride: 1}, + {Lo: 0x496, Hi: 0x496, Stride: 1}, + {Lo: 0x498, Hi: 0x498, Stride: 1}, + {Lo: 0x49A, Hi: 0x49A, Stride: 1}, + {Lo: 0x49C, Hi: 0x49C, Stride: 1}, + {Lo: 0x49E, Hi: 0x49E, Stride: 1}, + {Lo: 0x4A0, Hi: 0x4A0, Stride: 1}, + {Lo: 0x4A2, Hi: 0x4A2, Stride: 1}, + {Lo: 0x4A4, Hi: 0x4A4, Stride: 1}, + {Lo: 0x4A6, Hi: 0x4A6, Stride: 1}, + {Lo: 0x4A8, Hi: 0x4A8, Stride: 1}, + {Lo: 0x4AA, Hi: 0x4AA, Stride: 1}, + {Lo: 0x4AC, Hi: 0x4AC, Stride: 1}, + {Lo: 0x4AE, Hi: 0x4AE, Stride: 1}, + {Lo: 0x4B0, Hi: 0x4B0, Stride: 1}, + {Lo: 0x4B2, Hi: 0x4B2, Stride: 1}, + {Lo: 0x4B4, Hi: 0x4B4, Stride: 1}, + {Lo: 0x4B6, Hi: 0x4B6, Stride: 1}, + {Lo: 0x4B8, Hi: 0x4B8, Stride: 1}, + {Lo: 0x4BA, Hi: 0x4BA, Stride: 1}, + {Lo: 0x4BC, Hi: 0x4BC, Stride: 1}, + {Lo: 0x4BE, Hi: 0x4BE, Stride: 1}, + {Lo: 0x4C0, Hi: 0x4C1, Stride: 1}, + {Lo: 0x4C3, Hi: 0x4C3, Stride: 1}, + {Lo: 0x4C5, Hi: 0x4C5, Stride: 1}, + {Lo: 0x4C7, Hi: 0x4C7, Stride: 1}, + {Lo: 0x4C9, Hi: 0x4C9, Stride: 1}, + {Lo: 0x4CB, Hi: 0x4CB, Stride: 1}, + {Lo: 0x4CD, Hi: 0x4CD, Stride: 1}, + {Lo: 0x4D0, Hi: 0x4D0, Stride: 1}, + {Lo: 0x4D2, Hi: 0x4D2, Stride: 1}, + {Lo: 0x4D4, Hi: 0x4D4, Stride: 1}, + {Lo: 0x4D6, Hi: 0x4D6, Stride: 1}, + {Lo: 0x4D8, Hi: 0x4D8, Stride: 1}, + {Lo: 0x4DA, Hi: 0x4DA, Stride: 1}, + {Lo: 0x4DC, Hi: 0x4DC, Stride: 1}, + {Lo: 0x4DE, Hi: 0x4DE, Stride: 1}, + {Lo: 0x4E0, Hi: 0x4E0, Stride: 1}, + {Lo: 0x4E2, Hi: 0x4E2, Stride: 1}, + {Lo: 0x4E4, Hi: 0x4E4, Stride: 1}, + {Lo: 0x4E6, Hi: 0x4E6, Stride: 1}, + {Lo: 0x4E8, Hi: 0x4E8, Stride: 1}, + {Lo: 0x4EA, Hi: 0x4EA, Stride: 1}, + {Lo: 0x4EC, Hi: 0x4EC, Stride: 1}, + {Lo: 0x4EE, Hi: 0x4EE, Stride: 1}, + {Lo: 0x4F0, Hi: 0x4F0, Stride: 1}, + {Lo: 0x4F2, Hi: 0x4F2, Stride: 1}, + {Lo: 0x4F4, Hi: 0x4F4, Stride: 1}, + {Lo: 0x4F6, Hi: 0x4F6, Stride: 1}, + {Lo: 0x4F8, Hi: 0x4F8, Stride: 1}, + {Lo: 0x4FA, Hi: 0x4FA, Stride: 1}, + {Lo: 0x4FC, Hi: 0x4FC, Stride: 1}, + {Lo: 0x4FE, Hi: 0x4FE, Stride: 1}, + {Lo: 0x500, Hi: 0x500, Stride: 1}, + {Lo: 0x502, Hi: 0x502, Stride: 1}, + {Lo: 0x504, Hi: 0x504, Stride: 1}, + {Lo: 0x506, Hi: 0x506, Stride: 1}, + {Lo: 0x508, Hi: 0x508, Stride: 1}, + {Lo: 0x50A, Hi: 0x50A, Stride: 1}, + {Lo: 0x50C, Hi: 0x50C, Stride: 1}, + {Lo: 0x50E, Hi: 0x50E, Stride: 1}, + {Lo: 0x510, Hi: 0x510, Stride: 1}, + {Lo: 0x512, Hi: 0x512, Stride: 1}, + {Lo: 0x514, Hi: 0x514, Stride: 1}, + {Lo: 0x516, Hi: 0x516, Stride: 1}, + {Lo: 0x518, Hi: 0x518, Stride: 1}, + {Lo: 0x51A, Hi: 0x51A, Stride: 1}, + {Lo: 0x51C, Hi: 0x51C, Stride: 1}, + {Lo: 0x51E, Hi: 0x51E, Stride: 1}, + {Lo: 0x520, Hi: 0x520, Stride: 1}, + {Lo: 0x522, Hi: 0x522, Stride: 1}, + {Lo: 0x524, Hi: 0x524, Stride: 1}, + {Lo: 0x526, Hi: 0x526, Stride: 1}, + {Lo: 0x528, Hi: 0x528, Stride: 1}, + {Lo: 0x52A, Hi: 0x52A, Stride: 1}, + {Lo: 0x52C, Hi: 0x52C, Stride: 1}, + {Lo: 0x52E, Hi: 0x52E, Stride: 1}, + {Lo: 0x531, Hi: 0x556, Stride: 1}, + {Lo: 0x10A0, Hi: 0x10C5, Stride: 1}, + {Lo: 0x10C7, Hi: 0x10C7, Stride: 1}, + {Lo: 0x10CD, Hi: 0x10CD, Stride: 1}, + {Lo: 0x13A0, Hi: 0x13F5, Stride: 1}, + {Lo: 0x1C89, Hi: 0x1C89, Stride: 1}, + {Lo: 0x1E00, Hi: 0x1E00, Stride: 1}, + {Lo: 0x1E02, Hi: 0x1E02, Stride: 1}, + {Lo: 0x1E04, Hi: 0x1E04, Stride: 1}, + {Lo: 0x1E06, Hi: 0x1E06, Stride: 1}, + {Lo: 0x1E08, Hi: 0x1E08, Stride: 1}, + {Lo: 0x1E0A, Hi: 0x1E0A, Stride: 1}, + {Lo: 0x1E0C, Hi: 0x1E0C, Stride: 1}, + {Lo: 0x1E0E, Hi: 0x1E0E, Stride: 1}, + {Lo: 0x1E10, Hi: 0x1E10, Stride: 1}, + {Lo: 0x1E12, Hi: 0x1E12, Stride: 1}, + {Lo: 0x1E14, Hi: 0x1E14, Stride: 1}, + {Lo: 0x1E16, Hi: 0x1E16, Stride: 1}, + {Lo: 0x1E18, Hi: 0x1E18, Stride: 1}, + {Lo: 0x1E1A, Hi: 0x1E1A, Stride: 1}, + {Lo: 0x1E1C, Hi: 0x1E1C, Stride: 1}, + {Lo: 0x1E1E, Hi: 0x1E1E, Stride: 1}, + {Lo: 0x1E20, Hi: 0x1E20, Stride: 1}, + {Lo: 0x1E22, Hi: 0x1E22, Stride: 1}, + {Lo: 0x1E24, Hi: 0x1E24, Stride: 1}, + {Lo: 0x1E26, Hi: 0x1E26, Stride: 1}, + {Lo: 0x1E28, Hi: 0x1E28, Stride: 1}, + {Lo: 0x1E2A, Hi: 0x1E2A, Stride: 1}, + {Lo: 0x1E2C, Hi: 0x1E2C, Stride: 1}, + {Lo: 0x1E2E, Hi: 0x1E2E, Stride: 1}, + {Lo: 0x1E30, Hi: 0x1E30, Stride: 1}, + {Lo: 0x1E32, Hi: 0x1E32, Stride: 1}, + {Lo: 0x1E34, Hi: 0x1E34, Stride: 1}, + {Lo: 0x1E36, Hi: 0x1E36, Stride: 1}, + {Lo: 0x1E38, Hi: 0x1E38, Stride: 1}, + {Lo: 0x1E3A, Hi: 0x1E3A, Stride: 1}, + {Lo: 0x1E3C, Hi: 0x1E3C, Stride: 1}, + {Lo: 0x1E3E, Hi: 0x1E3E, Stride: 1}, + {Lo: 0x1E40, Hi: 0x1E40, Stride: 1}, + {Lo: 0x1E42, Hi: 0x1E42, Stride: 1}, + {Lo: 0x1E44, Hi: 0x1E44, Stride: 1}, + {Lo: 0x1E46, Hi: 0x1E46, Stride: 1}, + {Lo: 0x1E48, Hi: 0x1E48, Stride: 1}, + {Lo: 0x1E4A, Hi: 0x1E4A, Stride: 1}, + {Lo: 0x1E4C, Hi: 0x1E4C, Stride: 1}, + {Lo: 0x1E4E, Hi: 0x1E4E, Stride: 1}, + {Lo: 0x1E50, Hi: 0x1E50, Stride: 1}, + {Lo: 0x1E52, Hi: 0x1E52, Stride: 1}, + {Lo: 0x1E54, Hi: 0x1E54, Stride: 1}, + {Lo: 0x1E56, Hi: 0x1E56, Stride: 1}, + {Lo: 0x1E58, Hi: 0x1E58, Stride: 1}, + {Lo: 0x1E5A, Hi: 0x1E5A, Stride: 1}, + {Lo: 0x1E5C, Hi: 0x1E5C, Stride: 1}, + {Lo: 0x1E5E, Hi: 0x1E5E, Stride: 1}, + {Lo: 0x1E60, Hi: 0x1E60, Stride: 1}, + {Lo: 0x1E62, Hi: 0x1E62, Stride: 1}, + {Lo: 0x1E64, Hi: 0x1E64, Stride: 1}, + {Lo: 0x1E66, Hi: 0x1E66, Stride: 1}, + {Lo: 0x1E68, Hi: 0x1E68, Stride: 1}, + {Lo: 0x1E6A, Hi: 0x1E6A, Stride: 1}, + {Lo: 0x1E6C, Hi: 0x1E6C, Stride: 1}, + {Lo: 0x1E6E, Hi: 0x1E6E, Stride: 1}, + {Lo: 0x1E70, Hi: 0x1E70, Stride: 1}, + {Lo: 0x1E72, Hi: 0x1E72, Stride: 1}, + {Lo: 0x1E74, Hi: 0x1E74, Stride: 1}, + {Lo: 0x1E76, Hi: 0x1E76, Stride: 1}, + {Lo: 0x1E78, Hi: 0x1E78, Stride: 1}, + {Lo: 0x1E7A, Hi: 0x1E7A, Stride: 1}, + {Lo: 0x1E7C, Hi: 0x1E7C, Stride: 1}, + {Lo: 0x1E7E, Hi: 0x1E7E, Stride: 1}, + {Lo: 0x1E80, Hi: 0x1E80, Stride: 1}, + {Lo: 0x1E82, Hi: 0x1E82, Stride: 1}, + {Lo: 0x1E84, Hi: 0x1E84, Stride: 1}, + {Lo: 0x1E86, Hi: 0x1E86, Stride: 1}, + {Lo: 0x1E88, Hi: 0x1E88, Stride: 1}, + {Lo: 0x1E8A, Hi: 0x1E8A, Stride: 1}, + {Lo: 0x1E8C, Hi: 0x1E8C, Stride: 1}, + {Lo: 0x1E8E, Hi: 0x1E8E, Stride: 1}, + {Lo: 0x1E90, Hi: 0x1E90, Stride: 1}, + {Lo: 0x1E92, Hi: 0x1E92, Stride: 1}, + {Lo: 0x1E94, Hi: 0x1E94, Stride: 1}, + {Lo: 0x1E9E, Hi: 0x1E9E, Stride: 1}, + {Lo: 0x1EA0, Hi: 0x1EA0, Stride: 1}, + {Lo: 0x1EA2, Hi: 0x1EA2, Stride: 1}, + {Lo: 0x1EA4, Hi: 0x1EA4, Stride: 1}, + {Lo: 0x1EA6, Hi: 0x1EA6, Stride: 1}, + {Lo: 0x1EA8, Hi: 0x1EA8, Stride: 1}, + {Lo: 0x1EAA, Hi: 0x1EAA, Stride: 1}, + {Lo: 0x1EAC, Hi: 0x1EAC, Stride: 1}, + {Lo: 0x1EAE, Hi: 0x1EAE, Stride: 1}, + {Lo: 0x1EB0, Hi: 0x1EB0, Stride: 1}, + {Lo: 0x1EB2, Hi: 0x1EB2, Stride: 1}, + {Lo: 0x1EB4, Hi: 0x1EB4, Stride: 1}, + {Lo: 0x1EB6, Hi: 0x1EB6, Stride: 1}, + {Lo: 0x1EB8, Hi: 0x1EB8, Stride: 1}, + {Lo: 0x1EBA, Hi: 0x1EBA, Stride: 1}, + {Lo: 0x1EBC, Hi: 0x1EBC, Stride: 1}, + {Lo: 0x1EBE, Hi: 0x1EBE, Stride: 1}, + {Lo: 0x1EC0, Hi: 0x1EC0, Stride: 1}, + {Lo: 0x1EC2, Hi: 0x1EC2, Stride: 1}, + {Lo: 0x1EC4, Hi: 0x1EC4, Stride: 1}, + {Lo: 0x1EC6, Hi: 0x1EC6, Stride: 1}, + {Lo: 0x1EC8, Hi: 0x1EC8, Stride: 1}, + {Lo: 0x1ECA, Hi: 0x1ECA, Stride: 1}, + {Lo: 0x1ECC, Hi: 0x1ECC, Stride: 1}, + {Lo: 0x1ECE, Hi: 0x1ECE, Stride: 1}, + {Lo: 0x1ED0, Hi: 0x1ED0, Stride: 1}, + {Lo: 0x1ED2, Hi: 0x1ED2, Stride: 1}, + {Lo: 0x1ED4, Hi: 0x1ED4, Stride: 1}, + {Lo: 0x1ED6, Hi: 0x1ED6, Stride: 1}, + {Lo: 0x1ED8, Hi: 0x1ED8, Stride: 1}, + {Lo: 0x1EDA, Hi: 0x1EDA, Stride: 1}, + {Lo: 0x1EDC, Hi: 0x1EDC, Stride: 1}, + {Lo: 0x1EDE, Hi: 0x1EDE, Stride: 1}, + {Lo: 0x1EE0, Hi: 0x1EE0, Stride: 1}, + {Lo: 0x1EE2, Hi: 0x1EE2, Stride: 1}, + {Lo: 0x1EE4, Hi: 0x1EE4, Stride: 1}, + {Lo: 0x1EE6, Hi: 0x1EE6, Stride: 1}, + {Lo: 0x1EE8, Hi: 0x1EE8, Stride: 1}, + {Lo: 0x1EEA, Hi: 0x1EEA, Stride: 1}, + {Lo: 0x1EEC, Hi: 0x1EEC, Stride: 1}, + {Lo: 0x1EEE, Hi: 0x1EEE, Stride: 1}, + {Lo: 0x1EF0, Hi: 0x1EF0, Stride: 1}, + {Lo: 0x1EF2, Hi: 0x1EF2, Stride: 1}, + {Lo: 0x1EF4, Hi: 0x1EF4, Stride: 1}, + {Lo: 0x1EF6, Hi: 0x1EF6, Stride: 1}, + {Lo: 0x1EF8, Hi: 0x1EF8, Stride: 1}, + {Lo: 0x1EFA, Hi: 0x1EFA, Stride: 1}, + {Lo: 0x1EFC, Hi: 0x1EFC, Stride: 1}, + {Lo: 0x1EFE, Hi: 0x1EFE, Stride: 1}, + {Lo: 0x1F08, Hi: 0x1F0F, Stride: 1}, + {Lo: 0x1F18, Hi: 0x1F1D, Stride: 1}, + {Lo: 0x1F28, Hi: 0x1F2F, Stride: 1}, + {Lo: 0x1F38, Hi: 0x1F3F, Stride: 1}, + {Lo: 0x1F48, Hi: 0x1F4D, Stride: 1}, + {Lo: 0x1F59, Hi: 0x1F59, Stride: 1}, + {Lo: 0x1F5B, Hi: 0x1F5B, Stride: 1}, + {Lo: 0x1F5D, Hi: 0x1F5D, Stride: 1}, + {Lo: 0x1F5F, Hi: 0x1F5F, Stride: 1}, + {Lo: 0x1F68, Hi: 0x1F6F, Stride: 1}, + {Lo: 0x1F88, Hi: 0x1F8F, Stride: 1}, + {Lo: 0x1F98, Hi: 0x1F9F, Stride: 1}, + {Lo: 0x1FA8, Hi: 0x1FAF, Stride: 1}, + {Lo: 0x1FB8, Hi: 0x1FBC, Stride: 1}, + {Lo: 0x1FC8, Hi: 0x1FCC, Stride: 1}, + {Lo: 0x1FD8, Hi: 0x1FDB, Stride: 1}, + {Lo: 0x1FE8, Hi: 0x1FEC, Stride: 1}, + {Lo: 0x1FF8, Hi: 0x1FFC, Stride: 1}, + {Lo: 0x2102, Hi: 0x2102, Stride: 1}, + {Lo: 0x2107, Hi: 0x2107, Stride: 1}, + {Lo: 0x210B, Hi: 0x210D, Stride: 1}, + {Lo: 0x2110, Hi: 0x2112, Stride: 1}, + {Lo: 0x2115, Hi: 0x2115, Stride: 1}, + {Lo: 0x2119, Hi: 0x211D, Stride: 1}, + {Lo: 0x2124, Hi: 0x2124, Stride: 1}, + {Lo: 0x2126, Hi: 0x2126, Stride: 1}, + {Lo: 0x2128, Hi: 0x2128, Stride: 1}, + {Lo: 0x212A, Hi: 0x212D, Stride: 1}, + {Lo: 0x2130, Hi: 0x2133, Stride: 1}, + {Lo: 0x213E, Hi: 0x213F, Stride: 1}, + {Lo: 0x2145, Hi: 0x2145, Stride: 1}, + {Lo: 0x2160, Hi: 0x216F, Stride: 1}, + {Lo: 0x2183, Hi: 0x2183, Stride: 1}, + {Lo: 0x24B6, Hi: 0x24CF, Stride: 1}, + {Lo: 0x2C00, Hi: 0x2C2F, Stride: 1}, + {Lo: 0x2C60, Hi: 0x2C60, Stride: 1}, + {Lo: 0x2C62, Hi: 0x2C64, Stride: 1}, + {Lo: 0x2C67, Hi: 0x2C67, Stride: 1}, + {Lo: 0x2C69, Hi: 0x2C69, Stride: 1}, + {Lo: 0x2C6B, Hi: 0x2C6B, Stride: 1}, + {Lo: 0x2C6D, Hi: 0x2C70, Stride: 1}, + {Lo: 0x2C72, Hi: 0x2C72, Stride: 1}, + {Lo: 0x2C75, Hi: 0x2C75, Stride: 1}, + {Lo: 0x2C7E, Hi: 0x2C80, Stride: 1}, + {Lo: 0x2C82, Hi: 0x2C82, Stride: 1}, + {Lo: 0x2C84, Hi: 0x2C84, Stride: 1}, + {Lo: 0x2C86, Hi: 0x2C86, Stride: 1}, + {Lo: 0x2C88, Hi: 0x2C88, Stride: 1}, + {Lo: 0x2C8A, Hi: 0x2C8A, Stride: 1}, + {Lo: 0x2C8C, Hi: 0x2C8C, Stride: 1}, + {Lo: 0x2C8E, Hi: 0x2C8E, Stride: 1}, + {Lo: 0x2C90, Hi: 0x2C90, Stride: 1}, + {Lo: 0x2C92, Hi: 0x2C92, Stride: 1}, + {Lo: 0x2C94, Hi: 0x2C94, Stride: 1}, + {Lo: 0x2C96, Hi: 0x2C96, Stride: 1}, + {Lo: 0x2C98, Hi: 0x2C98, Stride: 1}, + {Lo: 0x2C9A, Hi: 0x2C9A, Stride: 1}, + {Lo: 0x2C9C, Hi: 0x2C9C, Stride: 1}, + {Lo: 0x2C9E, Hi: 0x2C9E, Stride: 1}, + {Lo: 0x2CA0, Hi: 0x2CA0, Stride: 1}, + {Lo: 0x2CA2, Hi: 0x2CA2, Stride: 1}, + {Lo: 0x2CA4, Hi: 0x2CA4, Stride: 1}, + {Lo: 0x2CA6, Hi: 0x2CA6, Stride: 1}, + {Lo: 0x2CA8, Hi: 0x2CA8, Stride: 1}, + {Lo: 0x2CAA, Hi: 0x2CAA, Stride: 1}, + {Lo: 0x2CAC, Hi: 0x2CAC, Stride: 1}, + {Lo: 0x2CAE, Hi: 0x2CAE, Stride: 1}, + {Lo: 0x2CB0, Hi: 0x2CB0, Stride: 1}, + {Lo: 0x2CB2, Hi: 0x2CB2, Stride: 1}, + {Lo: 0x2CB4, Hi: 0x2CB4, Stride: 1}, + {Lo: 0x2CB6, Hi: 0x2CB6, Stride: 1}, + {Lo: 0x2CB8, Hi: 0x2CB8, Stride: 1}, + {Lo: 0x2CBA, Hi: 0x2CBA, Stride: 1}, + {Lo: 0x2CBC, Hi: 0x2CBC, Stride: 1}, + {Lo: 0x2CBE, Hi: 0x2CBE, Stride: 1}, + {Lo: 0x2CC0, Hi: 0x2CC0, Stride: 1}, + {Lo: 0x2CC2, Hi: 0x2CC2, Stride: 1}, + {Lo: 0x2CC4, Hi: 0x2CC4, Stride: 1}, + {Lo: 0x2CC6, Hi: 0x2CC6, Stride: 1}, + {Lo: 0x2CC8, Hi: 0x2CC8, Stride: 1}, + {Lo: 0x2CCA, Hi: 0x2CCA, Stride: 1}, + {Lo: 0x2CCC, Hi: 0x2CCC, Stride: 1}, + {Lo: 0x2CCE, Hi: 0x2CCE, Stride: 1}, + {Lo: 0x2CD0, Hi: 0x2CD0, Stride: 1}, + {Lo: 0x2CD2, Hi: 0x2CD2, Stride: 1}, + {Lo: 0x2CD4, Hi: 0x2CD4, Stride: 1}, + {Lo: 0x2CD6, Hi: 0x2CD6, Stride: 1}, + {Lo: 0x2CD8, Hi: 0x2CD8, Stride: 1}, + {Lo: 0x2CDA, Hi: 0x2CDA, Stride: 1}, + {Lo: 0x2CDC, Hi: 0x2CDC, Stride: 1}, + {Lo: 0x2CDE, Hi: 0x2CDE, Stride: 1}, + {Lo: 0x2CE0, Hi: 0x2CE0, Stride: 1}, + {Lo: 0x2CE2, Hi: 0x2CE2, Stride: 1}, + {Lo: 0x2CEB, Hi: 0x2CEB, Stride: 1}, + {Lo: 0x2CED, Hi: 0x2CED, Stride: 1}, + {Lo: 0x2CF2, Hi: 0x2CF2, Stride: 1}, + {Lo: 0xA640, Hi: 0xA640, Stride: 1}, + {Lo: 0xA642, Hi: 0xA642, Stride: 1}, + {Lo: 0xA644, Hi: 0xA644, Stride: 1}, + {Lo: 0xA646, Hi: 0xA646, Stride: 1}, + {Lo: 0xA648, Hi: 0xA648, Stride: 1}, + {Lo: 0xA64A, Hi: 0xA64A, Stride: 1}, + {Lo: 0xA64C, Hi: 0xA64C, Stride: 1}, + {Lo: 0xA64E, Hi: 0xA64E, Stride: 1}, + {Lo: 0xA650, Hi: 0xA650, Stride: 1}, + {Lo: 0xA652, Hi: 0xA652, Stride: 1}, + {Lo: 0xA654, Hi: 0xA654, Stride: 1}, + {Lo: 0xA656, Hi: 0xA656, Stride: 1}, + {Lo: 0xA658, Hi: 0xA658, Stride: 1}, + {Lo: 0xA65A, Hi: 0xA65A, Stride: 1}, + {Lo: 0xA65C, Hi: 0xA65C, Stride: 1}, + {Lo: 0xA65E, Hi: 0xA65E, Stride: 1}, + {Lo: 0xA660, Hi: 0xA660, Stride: 1}, + {Lo: 0xA662, Hi: 0xA662, Stride: 1}, + {Lo: 0xA664, Hi: 0xA664, Stride: 1}, + {Lo: 0xA666, Hi: 0xA666, Stride: 1}, + {Lo: 0xA668, Hi: 0xA668, Stride: 1}, + {Lo: 0xA66A, Hi: 0xA66A, Stride: 1}, + {Lo: 0xA66C, Hi: 0xA66C, Stride: 1}, + {Lo: 0xA680, Hi: 0xA680, Stride: 1}, + {Lo: 0xA682, Hi: 0xA682, Stride: 1}, + {Lo: 0xA684, Hi: 0xA684, Stride: 1}, + {Lo: 0xA686, Hi: 0xA686, Stride: 1}, + {Lo: 0xA688, Hi: 0xA688, Stride: 1}, + {Lo: 0xA68A, Hi: 0xA68A, Stride: 1}, + {Lo: 0xA68C, Hi: 0xA68C, Stride: 1}, + {Lo: 0xA68E, Hi: 0xA68E, Stride: 1}, + {Lo: 0xA690, Hi: 0xA690, Stride: 1}, + {Lo: 0xA692, Hi: 0xA692, Stride: 1}, + {Lo: 0xA694, Hi: 0xA694, Stride: 1}, + {Lo: 0xA696, Hi: 0xA696, Stride: 1}, + {Lo: 0xA698, Hi: 0xA698, Stride: 1}, + {Lo: 0xA69A, Hi: 0xA69A, Stride: 1}, + {Lo: 0xA722, Hi: 0xA722, Stride: 1}, + {Lo: 0xA724, Hi: 0xA724, Stride: 1}, + {Lo: 0xA726, Hi: 0xA726, Stride: 1}, + {Lo: 0xA728, Hi: 0xA728, Stride: 1}, + {Lo: 0xA72A, Hi: 0xA72A, Stride: 1}, + {Lo: 0xA72C, Hi: 0xA72C, Stride: 1}, + {Lo: 0xA72E, Hi: 0xA72E, Stride: 1}, + {Lo: 0xA732, Hi: 0xA732, Stride: 1}, + {Lo: 0xA734, Hi: 0xA734, Stride: 1}, + {Lo: 0xA736, Hi: 0xA736, Stride: 1}, + {Lo: 0xA738, Hi: 0xA738, Stride: 1}, + {Lo: 0xA73A, Hi: 0xA73A, Stride: 1}, + {Lo: 0xA73C, Hi: 0xA73C, Stride: 1}, + {Lo: 0xA73E, Hi: 0xA73E, Stride: 1}, + {Lo: 0xA740, Hi: 0xA740, Stride: 1}, + {Lo: 0xA742, Hi: 0xA742, Stride: 1}, + {Lo: 0xA744, Hi: 0xA744, Stride: 1}, + {Lo: 0xA746, Hi: 0xA746, Stride: 1}, + {Lo: 0xA748, Hi: 0xA748, Stride: 1}, + {Lo: 0xA74A, Hi: 0xA74A, Stride: 1}, + {Lo: 0xA74C, Hi: 0xA74C, Stride: 1}, + {Lo: 0xA74E, Hi: 0xA74E, Stride: 1}, + {Lo: 0xA750, Hi: 0xA750, Stride: 1}, + {Lo: 0xA752, Hi: 0xA752, Stride: 1}, + {Lo: 0xA754, Hi: 0xA754, Stride: 1}, + {Lo: 0xA756, Hi: 0xA756, Stride: 1}, + {Lo: 0xA758, Hi: 0xA758, Stride: 1}, + {Lo: 0xA75A, Hi: 0xA75A, Stride: 1}, + {Lo: 0xA75C, Hi: 0xA75C, Stride: 1}, + {Lo: 0xA75E, Hi: 0xA75E, Stride: 1}, + {Lo: 0xA760, Hi: 0xA760, Stride: 1}, + {Lo: 0xA762, Hi: 0xA762, Stride: 1}, + {Lo: 0xA764, Hi: 0xA764, Stride: 1}, + {Lo: 0xA766, Hi: 0xA766, Stride: 1}, + {Lo: 0xA768, Hi: 0xA768, Stride: 1}, + {Lo: 0xA76A, Hi: 0xA76A, Stride: 1}, + {Lo: 0xA76C, Hi: 0xA76C, Stride: 1}, + {Lo: 0xA76E, Hi: 0xA76E, Stride: 1}, + {Lo: 0xA779, Hi: 0xA779, Stride: 1}, + {Lo: 0xA77B, Hi: 0xA77B, Stride: 1}, + {Lo: 0xA77D, Hi: 0xA77E, Stride: 1}, + {Lo: 0xA780, Hi: 0xA780, Stride: 1}, + {Lo: 0xA782, Hi: 0xA782, Stride: 1}, + {Lo: 0xA784, Hi: 0xA784, Stride: 1}, + {Lo: 0xA786, Hi: 0xA786, Stride: 1}, + {Lo: 0xA78B, Hi: 0xA78B, Stride: 1}, + {Lo: 0xA78D, Hi: 0xA78D, Stride: 1}, + {Lo: 0xA790, Hi: 0xA790, Stride: 1}, + {Lo: 0xA792, Hi: 0xA792, Stride: 1}, + {Lo: 0xA796, Hi: 0xA796, Stride: 1}, + {Lo: 0xA798, Hi: 0xA798, Stride: 1}, + {Lo: 0xA79A, Hi: 0xA79A, Stride: 1}, + {Lo: 0xA79C, Hi: 0xA79C, Stride: 1}, + {Lo: 0xA79E, Hi: 0xA79E, Stride: 1}, + {Lo: 0xA7A0, Hi: 0xA7A0, Stride: 1}, + {Lo: 0xA7A2, Hi: 0xA7A2, Stride: 1}, + {Lo: 0xA7A4, Hi: 0xA7A4, Stride: 1}, + {Lo: 0xA7A6, Hi: 0xA7A6, Stride: 1}, + {Lo: 0xA7A8, Hi: 0xA7A8, Stride: 1}, + {Lo: 0xA7AA, Hi: 0xA7AE, Stride: 1}, + {Lo: 0xA7B0, Hi: 0xA7B4, Stride: 1}, + {Lo: 0xA7B6, Hi: 0xA7B6, Stride: 1}, + {Lo: 0xA7B8, Hi: 0xA7B8, Stride: 1}, + {Lo: 0xA7BA, Hi: 0xA7BA, Stride: 1}, + {Lo: 0xA7BC, Hi: 0xA7BC, Stride: 1}, + {Lo: 0xA7BE, Hi: 0xA7BE, Stride: 1}, + {Lo: 0xA7C0, Hi: 0xA7C0, Stride: 1}, + {Lo: 0xA7C2, Hi: 0xA7C2, Stride: 1}, + {Lo: 0xA7C4, Hi: 0xA7C7, Stride: 1}, + {Lo: 0xA7C9, Hi: 0xA7C9, Stride: 1}, + {Lo: 0xA7CB, Hi: 0xA7CC, Stride: 1}, + {Lo: 0xA7CE, Hi: 0xA7CE, Stride: 1}, + {Lo: 0xA7D0, Hi: 0xA7D0, Stride: 1}, + {Lo: 0xA7D2, Hi: 0xA7D2, Stride: 1}, + {Lo: 0xA7D4, Hi: 0xA7D4, Stride: 1}, + {Lo: 0xA7D6, Hi: 0xA7D6, Stride: 1}, + {Lo: 0xA7D8, Hi: 0xA7D8, Stride: 1}, + {Lo: 0xA7DA, Hi: 0xA7DA, Stride: 1}, + {Lo: 0xA7DC, Hi: 0xA7DC, Stride: 1}, + {Lo: 0xA7F5, Hi: 0xA7F5, Stride: 1}, + {Lo: 0xFF21, Hi: 0xFF3A, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x10400, Hi: 0x10427, Stride: 1}, + {Lo: 0x104B0, Hi: 0x104D3, Stride: 1}, + {Lo: 0x10570, Hi: 0x1057A, Stride: 1}, + {Lo: 0x1057C, Hi: 0x1058A, Stride: 1}, + {Lo: 0x1058C, Hi: 0x10592, Stride: 1}, + {Lo: 0x10594, Hi: 0x10595, Stride: 1}, + {Lo: 0x10C80, Hi: 0x10CB2, Stride: 1}, + {Lo: 0x10D50, Hi: 0x10D65, Stride: 1}, + {Lo: 0x118A0, Hi: 0x118BF, Stride: 1}, + {Lo: 0x16E40, Hi: 0x16E5F, Stride: 1}, + {Lo: 0x16EA0, Hi: 0x16EB8, Stride: 1}, + {Lo: 0x1D400, Hi: 0x1D419, Stride: 1}, + {Lo: 0x1D434, Hi: 0x1D44D, Stride: 1}, + {Lo: 0x1D468, Hi: 0x1D481, Stride: 1}, + {Lo: 0x1D49C, Hi: 0x1D49C, Stride: 1}, + {Lo: 0x1D49E, Hi: 0x1D49F, Stride: 1}, + {Lo: 0x1D4A2, Hi: 0x1D4A2, Stride: 1}, + {Lo: 0x1D4A5, Hi: 0x1D4A6, Stride: 1}, + {Lo: 0x1D4A9, Hi: 0x1D4AC, Stride: 1}, + {Lo: 0x1D4AE, Hi: 0x1D4B5, Stride: 1}, + {Lo: 0x1D4D0, Hi: 0x1D4E9, Stride: 1}, + {Lo: 0x1D504, Hi: 0x1D505, Stride: 1}, + {Lo: 0x1D507, Hi: 0x1D50A, Stride: 1}, + {Lo: 0x1D50D, Hi: 0x1D514, Stride: 1}, + {Lo: 0x1D516, Hi: 0x1D51C, Stride: 1}, + {Lo: 0x1D538, Hi: 0x1D539, Stride: 1}, + {Lo: 0x1D53B, Hi: 0x1D53E, Stride: 1}, + {Lo: 0x1D540, Hi: 0x1D544, Stride: 1}, + {Lo: 0x1D546, Hi: 0x1D546, Stride: 1}, + {Lo: 0x1D54A, Hi: 0x1D550, Stride: 1}, + {Lo: 0x1D56C, Hi: 0x1D585, Stride: 1}, + {Lo: 0x1D5A0, Hi: 0x1D5B9, Stride: 1}, + {Lo: 0x1D5D4, Hi: 0x1D5ED, Stride: 1}, + {Lo: 0x1D608, Hi: 0x1D621, Stride: 1}, + {Lo: 0x1D63C, Hi: 0x1D655, Stride: 1}, + {Lo: 0x1D670, Hi: 0x1D689, Stride: 1}, + {Lo: 0x1D6A8, Hi: 0x1D6C0, Stride: 1}, + {Lo: 0x1D6E2, Hi: 0x1D6FA, Stride: 1}, + {Lo: 0x1D71C, Hi: 0x1D734, Stride: 1}, + {Lo: 0x1D756, Hi: 0x1D76E, Stride: 1}, + {Lo: 0x1D790, Hi: 0x1D7A8, Stride: 1}, + {Lo: 0x1D7CA, Hi: 0x1D7CA, Stride: 1}, + {Lo: 0x1E900, Hi: 0x1E921, Stride: 1}, + {Lo: 0x1F130, Hi: 0x1F149, Stride: 1}, + {Lo: 0x1F150, Hi: 0x1F169, Stride: 1}, + {Lo: 0x1F170, Hi: 0x1F189, Stride: 1}, + }, +} + +var unicodeAliasWord_Break_ALetter = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x41, Hi: 0x5A, Stride: 1}, + {Lo: 0x61, Hi: 0x7A, Stride: 1}, + {Lo: 0xAA, Hi: 0xAA, Stride: 1}, + {Lo: 0xB5, Hi: 0xB5, Stride: 1}, + {Lo: 0xB8, Hi: 0xB8, Stride: 1}, + {Lo: 0xBA, Hi: 0xBA, Stride: 1}, + {Lo: 0xC0, Hi: 0xD6, Stride: 1}, + {Lo: 0xD8, Hi: 0xF6, Stride: 1}, + {Lo: 0xF8, Hi: 0x2D7, Stride: 1}, + {Lo: 0x2DE, Hi: 0x2FF, Stride: 1}, + {Lo: 0x370, Hi: 0x374, Stride: 1}, + {Lo: 0x376, Hi: 0x377, Stride: 1}, + {Lo: 0x37A, Hi: 0x37D, Stride: 1}, + {Lo: 0x37F, Hi: 0x37F, Stride: 1}, + {Lo: 0x386, Hi: 0x386, Stride: 1}, + {Lo: 0x388, Hi: 0x38A, Stride: 1}, + {Lo: 0x38C, Hi: 0x38C, Stride: 1}, + {Lo: 0x38E, Hi: 0x3A1, Stride: 1}, + {Lo: 0x3A3, Hi: 0x3F5, Stride: 1}, + {Lo: 0x3F7, Hi: 0x481, Stride: 1}, + {Lo: 0x48A, Hi: 0x52F, Stride: 1}, + {Lo: 0x531, Hi: 0x556, Stride: 1}, + {Lo: 0x559, Hi: 0x55C, Stride: 1}, + {Lo: 0x55E, Hi: 0x55E, Stride: 1}, + {Lo: 0x560, Hi: 0x588, Stride: 1}, + {Lo: 0x58A, Hi: 0x58A, Stride: 1}, + {Lo: 0x5F3, Hi: 0x5F3, Stride: 1}, + {Lo: 0x620, Hi: 0x64A, Stride: 1}, + {Lo: 0x66E, Hi: 0x66F, Stride: 1}, + {Lo: 0x671, Hi: 0x6D3, Stride: 1}, + {Lo: 0x6D5, Hi: 0x6D5, Stride: 1}, + {Lo: 0x6E5, Hi: 0x6E6, Stride: 1}, + {Lo: 0x6EE, Hi: 0x6EF, Stride: 1}, + {Lo: 0x6FA, Hi: 0x6FC, Stride: 1}, + {Lo: 0x6FF, Hi: 0x6FF, Stride: 1}, + {Lo: 0x70F, Hi: 0x710, Stride: 1}, + {Lo: 0x712, Hi: 0x72F, Stride: 1}, + {Lo: 0x74D, Hi: 0x7A5, Stride: 1}, + {Lo: 0x7B1, Hi: 0x7B1, Stride: 1}, + {Lo: 0x7CA, Hi: 0x7EA, Stride: 1}, + {Lo: 0x7F4, Hi: 0x7F5, Stride: 1}, + {Lo: 0x7FA, Hi: 0x7FA, Stride: 1}, + {Lo: 0x800, Hi: 0x815, Stride: 1}, + {Lo: 0x81A, Hi: 0x81A, Stride: 1}, + {Lo: 0x824, Hi: 0x824, Stride: 1}, + {Lo: 0x828, Hi: 0x828, Stride: 1}, + {Lo: 0x840, Hi: 0x858, Stride: 1}, + {Lo: 0x860, Hi: 0x86A, Stride: 1}, + {Lo: 0x870, Hi: 0x887, Stride: 1}, + {Lo: 0x889, Hi: 0x88F, Stride: 1}, + {Lo: 0x8A0, Hi: 0x8C9, Stride: 1}, + {Lo: 0x904, Hi: 0x939, Stride: 1}, + {Lo: 0x93D, Hi: 0x93D, Stride: 1}, + {Lo: 0x950, Hi: 0x950, Stride: 1}, + {Lo: 0x958, Hi: 0x961, Stride: 1}, + {Lo: 0x971, Hi: 0x980, Stride: 1}, + {Lo: 0x985, Hi: 0x98C, Stride: 1}, + {Lo: 0x98F, Hi: 0x990, Stride: 1}, + {Lo: 0x993, Hi: 0x9A8, Stride: 1}, + {Lo: 0x9AA, Hi: 0x9B0, Stride: 1}, + {Lo: 0x9B2, Hi: 0x9B2, Stride: 1}, + {Lo: 0x9B6, Hi: 0x9B9, Stride: 1}, + {Lo: 0x9BD, Hi: 0x9BD, Stride: 1}, + {Lo: 0x9CE, Hi: 0x9CE, Stride: 1}, + {Lo: 0x9DC, Hi: 0x9DD, Stride: 1}, + {Lo: 0x9DF, Hi: 0x9E1, Stride: 1}, + {Lo: 0x9F0, Hi: 0x9F1, Stride: 1}, + {Lo: 0x9FC, Hi: 0x9FC, Stride: 1}, + {Lo: 0xA05, Hi: 0xA0A, Stride: 1}, + {Lo: 0xA0F, Hi: 0xA10, Stride: 1}, + {Lo: 0xA13, Hi: 0xA28, Stride: 1}, + {Lo: 0xA2A, Hi: 0xA30, Stride: 1}, + {Lo: 0xA32, Hi: 0xA33, Stride: 1}, + {Lo: 0xA35, Hi: 0xA36, Stride: 1}, + {Lo: 0xA38, Hi: 0xA39, Stride: 1}, + {Lo: 0xA59, Hi: 0xA5C, Stride: 1}, + {Lo: 0xA5E, Hi: 0xA5E, Stride: 1}, + {Lo: 0xA72, Hi: 0xA74, Stride: 1}, + {Lo: 0xA85, Hi: 0xA8D, Stride: 1}, + {Lo: 0xA8F, Hi: 0xA91, Stride: 1}, + {Lo: 0xA93, Hi: 0xAA8, Stride: 1}, + {Lo: 0xAAA, Hi: 0xAB0, Stride: 1}, + {Lo: 0xAB2, Hi: 0xAB3, Stride: 1}, + {Lo: 0xAB5, Hi: 0xAB9, Stride: 1}, + {Lo: 0xABD, Hi: 0xABD, Stride: 1}, + {Lo: 0xAD0, Hi: 0xAD0, Stride: 1}, + {Lo: 0xAE0, Hi: 0xAE1, Stride: 1}, + {Lo: 0xAF9, Hi: 0xAF9, Stride: 1}, + {Lo: 0xB05, Hi: 0xB0C, Stride: 1}, + {Lo: 0xB0F, Hi: 0xB10, Stride: 1}, + {Lo: 0xB13, Hi: 0xB28, Stride: 1}, + {Lo: 0xB2A, Hi: 0xB30, Stride: 1}, + {Lo: 0xB32, Hi: 0xB33, Stride: 1}, + {Lo: 0xB35, Hi: 0xB39, Stride: 1}, + {Lo: 0xB3D, Hi: 0xB3D, Stride: 1}, + {Lo: 0xB5C, Hi: 0xB5D, Stride: 1}, + {Lo: 0xB5F, Hi: 0xB61, Stride: 1}, + {Lo: 0xB71, Hi: 0xB71, Stride: 1}, + {Lo: 0xB83, Hi: 0xB83, Stride: 1}, + {Lo: 0xB85, Hi: 0xB8A, Stride: 1}, + {Lo: 0xB8E, Hi: 0xB90, Stride: 1}, + {Lo: 0xB92, Hi: 0xB95, Stride: 1}, + {Lo: 0xB99, Hi: 0xB9A, Stride: 1}, + {Lo: 0xB9C, Hi: 0xB9C, Stride: 1}, + {Lo: 0xB9E, Hi: 0xB9F, Stride: 1}, + {Lo: 0xBA3, Hi: 0xBA4, Stride: 1}, + {Lo: 0xBA8, Hi: 0xBAA, Stride: 1}, + {Lo: 0xBAE, Hi: 0xBB9, Stride: 1}, + {Lo: 0xBD0, Hi: 0xBD0, Stride: 1}, + {Lo: 0xC05, Hi: 0xC0C, Stride: 1}, + {Lo: 0xC0E, Hi: 0xC10, Stride: 1}, + {Lo: 0xC12, Hi: 0xC28, Stride: 1}, + {Lo: 0xC2A, Hi: 0xC39, Stride: 1}, + {Lo: 0xC3D, Hi: 0xC3D, Stride: 1}, + {Lo: 0xC58, Hi: 0xC5A, Stride: 1}, + {Lo: 0xC5C, Hi: 0xC5D, Stride: 1}, + {Lo: 0xC60, Hi: 0xC61, Stride: 1}, + {Lo: 0xC80, Hi: 0xC80, Stride: 1}, + {Lo: 0xC85, Hi: 0xC8C, Stride: 1}, + {Lo: 0xC8E, Hi: 0xC90, Stride: 1}, + {Lo: 0xC92, Hi: 0xCA8, Stride: 1}, + {Lo: 0xCAA, Hi: 0xCB3, Stride: 1}, + {Lo: 0xCB5, Hi: 0xCB9, Stride: 1}, + {Lo: 0xCBD, Hi: 0xCBD, Stride: 1}, + {Lo: 0xCDC, Hi: 0xCDE, Stride: 1}, + {Lo: 0xCE0, Hi: 0xCE1, Stride: 1}, + {Lo: 0xCF1, Hi: 0xCF2, Stride: 1}, + {Lo: 0xD04, Hi: 0xD0C, Stride: 1}, + {Lo: 0xD0E, Hi: 0xD10, Stride: 1}, + {Lo: 0xD12, Hi: 0xD3A, Stride: 1}, + {Lo: 0xD3D, Hi: 0xD3D, Stride: 1}, + {Lo: 0xD4E, Hi: 0xD4E, Stride: 1}, + {Lo: 0xD54, Hi: 0xD56, Stride: 1}, + {Lo: 0xD5F, Hi: 0xD61, Stride: 1}, + {Lo: 0xD7A, Hi: 0xD7F, Stride: 1}, + {Lo: 0xD85, Hi: 0xD96, Stride: 1}, + {Lo: 0xD9A, Hi: 0xDB1, Stride: 1}, + {Lo: 0xDB3, Hi: 0xDBB, Stride: 1}, + {Lo: 0xDBD, Hi: 0xDBD, Stride: 1}, + {Lo: 0xDC0, Hi: 0xDC6, Stride: 1}, + {Lo: 0xF00, Hi: 0xF00, Stride: 1}, + {Lo: 0xF40, Hi: 0xF47, Stride: 1}, + {Lo: 0xF49, Hi: 0xF6C, Stride: 1}, + {Lo: 0xF88, Hi: 0xF8C, Stride: 1}, + {Lo: 0x10A0, Hi: 0x10C5, Stride: 1}, + {Lo: 0x10C7, Hi: 0x10C7, Stride: 1}, + {Lo: 0x10CD, Hi: 0x10CD, Stride: 1}, + {Lo: 0x10D0, Hi: 0x10FA, Stride: 1}, + {Lo: 0x10FC, Hi: 0x1248, Stride: 1}, + {Lo: 0x124A, Hi: 0x124D, Stride: 1}, + {Lo: 0x1250, Hi: 0x1256, Stride: 1}, + {Lo: 0x1258, Hi: 0x1258, Stride: 1}, + {Lo: 0x125A, Hi: 0x125D, Stride: 1}, + {Lo: 0x1260, Hi: 0x1288, Stride: 1}, + {Lo: 0x128A, Hi: 0x128D, Stride: 1}, + {Lo: 0x1290, Hi: 0x12B0, Stride: 1}, + {Lo: 0x12B2, Hi: 0x12B5, Stride: 1}, + {Lo: 0x12B8, Hi: 0x12BE, Stride: 1}, + {Lo: 0x12C0, Hi: 0x12C0, Stride: 1}, + {Lo: 0x12C2, Hi: 0x12C5, Stride: 1}, + {Lo: 0x12C8, Hi: 0x12D6, Stride: 1}, + {Lo: 0x12D8, Hi: 0x1310, Stride: 1}, + {Lo: 0x1312, Hi: 0x1315, Stride: 1}, + {Lo: 0x1318, Hi: 0x135A, Stride: 1}, + {Lo: 0x1380, Hi: 0x138F, Stride: 1}, + {Lo: 0x13A0, Hi: 0x13F5, Stride: 1}, + {Lo: 0x13F8, Hi: 0x13FD, Stride: 1}, + {Lo: 0x1401, Hi: 0x166C, Stride: 1}, + {Lo: 0x166F, Hi: 0x167F, Stride: 1}, + {Lo: 0x1681, Hi: 0x169A, Stride: 1}, + {Lo: 0x16A0, Hi: 0x16EA, Stride: 1}, + {Lo: 0x16EE, Hi: 0x16F8, Stride: 1}, + {Lo: 0x1700, Hi: 0x1711, Stride: 1}, + {Lo: 0x171F, Hi: 0x1731, Stride: 1}, + {Lo: 0x1740, Hi: 0x1751, Stride: 1}, + {Lo: 0x1760, Hi: 0x176C, Stride: 1}, + {Lo: 0x176E, Hi: 0x1770, Stride: 1}, + {Lo: 0x1820, Hi: 0x1878, Stride: 1}, + {Lo: 0x1880, Hi: 0x1884, Stride: 1}, + {Lo: 0x1887, Hi: 0x18A8, Stride: 1}, + {Lo: 0x18AA, Hi: 0x18AA, Stride: 1}, + {Lo: 0x18B0, Hi: 0x18F5, Stride: 1}, + {Lo: 0x1900, Hi: 0x191E, Stride: 1}, + {Lo: 0x1A00, Hi: 0x1A16, Stride: 1}, + {Lo: 0x1B05, Hi: 0x1B33, Stride: 1}, + {Lo: 0x1B45, Hi: 0x1B4C, Stride: 1}, + {Lo: 0x1B83, Hi: 0x1BA0, Stride: 1}, + {Lo: 0x1BAE, Hi: 0x1BAF, Stride: 1}, + {Lo: 0x1BBA, Hi: 0x1BE5, Stride: 1}, + {Lo: 0x1C00, Hi: 0x1C23, Stride: 1}, + {Lo: 0x1C4D, Hi: 0x1C4F, Stride: 1}, + {Lo: 0x1C5A, Hi: 0x1C7D, Stride: 1}, + {Lo: 0x1C80, Hi: 0x1C8A, Stride: 1}, + {Lo: 0x1C90, Hi: 0x1CBA, Stride: 1}, + {Lo: 0x1CBD, Hi: 0x1CBF, Stride: 1}, + {Lo: 0x1CE9, Hi: 0x1CEC, Stride: 1}, + {Lo: 0x1CEE, Hi: 0x1CF3, Stride: 1}, + {Lo: 0x1CF5, Hi: 0x1CF6, Stride: 1}, + {Lo: 0x1CFA, Hi: 0x1CFA, Stride: 1}, + {Lo: 0x1D00, Hi: 0x1DBF, Stride: 1}, + {Lo: 0x1E00, Hi: 0x1F15, Stride: 1}, + {Lo: 0x1F18, Hi: 0x1F1D, Stride: 1}, + {Lo: 0x1F20, Hi: 0x1F45, Stride: 1}, + {Lo: 0x1F48, Hi: 0x1F4D, Stride: 1}, + {Lo: 0x1F50, Hi: 0x1F57, Stride: 1}, + {Lo: 0x1F59, Hi: 0x1F59, Stride: 1}, + {Lo: 0x1F5B, Hi: 0x1F5B, Stride: 1}, + {Lo: 0x1F5D, Hi: 0x1F5D, Stride: 1}, + {Lo: 0x1F5F, Hi: 0x1F7D, Stride: 1}, + {Lo: 0x1F80, Hi: 0x1FB4, Stride: 1}, + {Lo: 0x1FB6, Hi: 0x1FBC, Stride: 1}, + {Lo: 0x1FBE, Hi: 0x1FBE, Stride: 1}, + {Lo: 0x1FC2, Hi: 0x1FC4, Stride: 1}, + {Lo: 0x1FC6, Hi: 0x1FCC, Stride: 1}, + {Lo: 0x1FD0, Hi: 0x1FD3, Stride: 1}, + {Lo: 0x1FD6, Hi: 0x1FDB, Stride: 1}, + {Lo: 0x1FE0, Hi: 0x1FEC, Stride: 1}, + {Lo: 0x1FF2, Hi: 0x1FF4, Stride: 1}, + {Lo: 0x1FF6, Hi: 0x1FFC, Stride: 1}, + {Lo: 0x2071, Hi: 0x2071, Stride: 1}, + {Lo: 0x207F, Hi: 0x207F, Stride: 1}, + {Lo: 0x2090, Hi: 0x209C, Stride: 1}, + {Lo: 0x2102, Hi: 0x2102, Stride: 1}, + {Lo: 0x2107, Hi: 0x2107, Stride: 1}, + {Lo: 0x210A, Hi: 0x2113, Stride: 1}, + {Lo: 0x2115, Hi: 0x2115, Stride: 1}, + {Lo: 0x2119, Hi: 0x211D, Stride: 1}, + {Lo: 0x2124, Hi: 0x2124, Stride: 1}, + {Lo: 0x2126, Hi: 0x2126, Stride: 1}, + {Lo: 0x2128, Hi: 0x2128, Stride: 1}, + {Lo: 0x212A, Hi: 0x212D, Stride: 1}, + {Lo: 0x212F, Hi: 0x2139, Stride: 1}, + {Lo: 0x213C, Hi: 0x213F, Stride: 1}, + {Lo: 0x2145, Hi: 0x2149, Stride: 1}, + {Lo: 0x214E, Hi: 0x214E, Stride: 1}, + {Lo: 0x2160, Hi: 0x2188, Stride: 1}, + {Lo: 0x24B6, Hi: 0x24E9, Stride: 1}, + {Lo: 0x2C00, Hi: 0x2CE4, Stride: 1}, + {Lo: 0x2CEB, Hi: 0x2CEE, Stride: 1}, + {Lo: 0x2CF2, Hi: 0x2CF3, Stride: 1}, + {Lo: 0x2D00, Hi: 0x2D25, Stride: 1}, + {Lo: 0x2D27, Hi: 0x2D27, Stride: 1}, + {Lo: 0x2D2D, Hi: 0x2D2D, Stride: 1}, + {Lo: 0x2D30, Hi: 0x2D67, Stride: 1}, + {Lo: 0x2D6F, Hi: 0x2D6F, Stride: 1}, + {Lo: 0x2D80, Hi: 0x2D96, Stride: 1}, + {Lo: 0x2DA0, Hi: 0x2DA6, Stride: 1}, + {Lo: 0x2DA8, Hi: 0x2DAE, Stride: 1}, + {Lo: 0x2DB0, Hi: 0x2DB6, Stride: 1}, + {Lo: 0x2DB8, Hi: 0x2DBE, Stride: 1}, + {Lo: 0x2DC0, Hi: 0x2DC6, Stride: 1}, + {Lo: 0x2DC8, Hi: 0x2DCE, Stride: 1}, + {Lo: 0x2DD0, Hi: 0x2DD6, Stride: 1}, + {Lo: 0x2DD8, Hi: 0x2DDE, Stride: 1}, + {Lo: 0x2E2F, Hi: 0x2E2F, Stride: 1}, + {Lo: 0x3005, Hi: 0x3005, Stride: 1}, + {Lo: 0x303B, Hi: 0x303C, Stride: 1}, + {Lo: 0x3105, Hi: 0x312F, Stride: 1}, + {Lo: 0x3131, Hi: 0x318E, Stride: 1}, + {Lo: 0x31A0, Hi: 0x31BF, Stride: 1}, + {Lo: 0xA000, Hi: 0xA48C, Stride: 1}, + {Lo: 0xA4D0, Hi: 0xA4FD, Stride: 1}, + {Lo: 0xA500, Hi: 0xA60C, Stride: 1}, + {Lo: 0xA610, Hi: 0xA61F, Stride: 1}, + {Lo: 0xA62A, Hi: 0xA62B, Stride: 1}, + {Lo: 0xA640, Hi: 0xA66E, Stride: 1}, + {Lo: 0xA67F, Hi: 0xA69D, Stride: 1}, + {Lo: 0xA6A0, Hi: 0xA6EF, Stride: 1}, + {Lo: 0xA708, Hi: 0xA7DC, Stride: 1}, + {Lo: 0xA7F1, Hi: 0xA801, Stride: 1}, + {Lo: 0xA803, Hi: 0xA805, Stride: 1}, + {Lo: 0xA807, Hi: 0xA80A, Stride: 1}, + {Lo: 0xA80C, Hi: 0xA822, Stride: 1}, + {Lo: 0xA840, Hi: 0xA873, Stride: 1}, + {Lo: 0xA882, Hi: 0xA8B3, Stride: 1}, + {Lo: 0xA8F2, Hi: 0xA8F7, Stride: 1}, + {Lo: 0xA8FB, Hi: 0xA8FB, Stride: 1}, + {Lo: 0xA8FD, Hi: 0xA8FE, Stride: 1}, + {Lo: 0xA90A, Hi: 0xA925, Stride: 1}, + {Lo: 0xA930, Hi: 0xA946, Stride: 1}, + {Lo: 0xA960, Hi: 0xA97C, Stride: 1}, + {Lo: 0xA984, Hi: 0xA9B2, Stride: 1}, + {Lo: 0xA9CF, Hi: 0xA9CF, Stride: 1}, + {Lo: 0xAA00, Hi: 0xAA28, Stride: 1}, + {Lo: 0xAA40, Hi: 0xAA42, Stride: 1}, + {Lo: 0xAA44, Hi: 0xAA4B, Stride: 1}, + {Lo: 0xAAE0, Hi: 0xAAEA, Stride: 1}, + {Lo: 0xAAF2, Hi: 0xAAF4, Stride: 1}, + {Lo: 0xAB01, Hi: 0xAB06, Stride: 1}, + {Lo: 0xAB09, Hi: 0xAB0E, Stride: 1}, + {Lo: 0xAB11, Hi: 0xAB16, Stride: 1}, + {Lo: 0xAB20, Hi: 0xAB26, Stride: 1}, + {Lo: 0xAB28, Hi: 0xAB2E, Stride: 1}, + {Lo: 0xAB30, Hi: 0xAB69, Stride: 1}, + {Lo: 0xAB70, Hi: 0xABE2, Stride: 1}, + {Lo: 0xAC00, Hi: 0xD7A3, Stride: 1}, + {Lo: 0xD7B0, Hi: 0xD7C6, Stride: 1}, + {Lo: 0xD7CB, Hi: 0xD7FB, Stride: 1}, + {Lo: 0xFB00, Hi: 0xFB06, Stride: 1}, + {Lo: 0xFB13, Hi: 0xFB17, Stride: 1}, + {Lo: 0xFB50, Hi: 0xFBB1, Stride: 1}, + {Lo: 0xFBD3, Hi: 0xFD3D, Stride: 1}, + {Lo: 0xFD50, Hi: 0xFD8F, Stride: 1}, + {Lo: 0xFD92, Hi: 0xFDC7, Stride: 1}, + {Lo: 0xFDF0, Hi: 0xFDFB, Stride: 1}, + {Lo: 0xFE70, Hi: 0xFE74, Stride: 1}, + {Lo: 0xFE76, Hi: 0xFEFC, Stride: 1}, + {Lo: 0xFF21, Hi: 0xFF3A, Stride: 1}, + {Lo: 0xFF41, Hi: 0xFF5A, Stride: 1}, + {Lo: 0xFFA0, Hi: 0xFFBE, Stride: 1}, + {Lo: 0xFFC2, Hi: 0xFFC7, Stride: 1}, + {Lo: 0xFFCA, Hi: 0xFFCF, Stride: 1}, + {Lo: 0xFFD2, Hi: 0xFFD7, Stride: 1}, + {Lo: 0xFFDA, Hi: 0xFFDC, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x10000, Hi: 0x1000B, Stride: 1}, + {Lo: 0x1000D, Hi: 0x10026, Stride: 1}, + {Lo: 0x10028, Hi: 0x1003A, Stride: 1}, + {Lo: 0x1003C, Hi: 0x1003D, Stride: 1}, + {Lo: 0x1003F, Hi: 0x1004D, Stride: 1}, + {Lo: 0x10050, Hi: 0x1005D, Stride: 1}, + {Lo: 0x10080, Hi: 0x100FA, Stride: 1}, + {Lo: 0x10140, Hi: 0x10174, Stride: 1}, + {Lo: 0x10280, Hi: 0x1029C, Stride: 1}, + {Lo: 0x102A0, Hi: 0x102D0, Stride: 1}, + {Lo: 0x10300, Hi: 0x1031F, Stride: 1}, + {Lo: 0x1032D, Hi: 0x1034A, Stride: 1}, + {Lo: 0x10350, Hi: 0x10375, Stride: 1}, + {Lo: 0x10380, Hi: 0x1039D, Stride: 1}, + {Lo: 0x103A0, Hi: 0x103C3, Stride: 1}, + {Lo: 0x103C8, Hi: 0x103CF, Stride: 1}, + {Lo: 0x103D1, Hi: 0x103D5, Stride: 1}, + {Lo: 0x10400, Hi: 0x1049D, Stride: 1}, + {Lo: 0x104B0, Hi: 0x104D3, Stride: 1}, + {Lo: 0x104D8, Hi: 0x104FB, Stride: 1}, + {Lo: 0x10500, Hi: 0x10527, Stride: 1}, + {Lo: 0x10530, Hi: 0x10563, Stride: 1}, + {Lo: 0x10570, Hi: 0x1057A, Stride: 1}, + {Lo: 0x1057C, Hi: 0x1058A, Stride: 1}, + {Lo: 0x1058C, Hi: 0x10592, Stride: 1}, + {Lo: 0x10594, Hi: 0x10595, Stride: 1}, + {Lo: 0x10597, Hi: 0x105A1, Stride: 1}, + {Lo: 0x105A3, Hi: 0x105B1, Stride: 1}, + {Lo: 0x105B3, Hi: 0x105B9, Stride: 1}, + {Lo: 0x105BB, Hi: 0x105BC, Stride: 1}, + {Lo: 0x105C0, Hi: 0x105F3, Stride: 1}, + {Lo: 0x10600, Hi: 0x10736, Stride: 1}, + {Lo: 0x10740, Hi: 0x10755, Stride: 1}, + {Lo: 0x10760, Hi: 0x10767, Stride: 1}, + {Lo: 0x10780, Hi: 0x10785, Stride: 1}, + {Lo: 0x10787, Hi: 0x107B0, Stride: 1}, + {Lo: 0x107B2, Hi: 0x107BA, Stride: 1}, + {Lo: 0x10800, Hi: 0x10805, Stride: 1}, + {Lo: 0x10808, Hi: 0x10808, Stride: 1}, + {Lo: 0x1080A, Hi: 0x10835, Stride: 1}, + {Lo: 0x10837, Hi: 0x10838, Stride: 1}, + {Lo: 0x1083C, Hi: 0x1083C, Stride: 1}, + {Lo: 0x1083F, Hi: 0x10855, Stride: 1}, + {Lo: 0x10860, Hi: 0x10876, Stride: 1}, + {Lo: 0x10880, Hi: 0x1089E, Stride: 1}, + {Lo: 0x108E0, Hi: 0x108F2, Stride: 1}, + {Lo: 0x108F4, Hi: 0x108F5, Stride: 1}, + {Lo: 0x10900, Hi: 0x10915, Stride: 1}, + {Lo: 0x10920, Hi: 0x10939, Stride: 1}, + {Lo: 0x10940, Hi: 0x10959, Stride: 1}, + {Lo: 0x10980, Hi: 0x109B7, Stride: 1}, + {Lo: 0x109BE, Hi: 0x109BF, Stride: 1}, + {Lo: 0x10A00, Hi: 0x10A00, Stride: 1}, + {Lo: 0x10A10, Hi: 0x10A13, Stride: 1}, + {Lo: 0x10A15, Hi: 0x10A17, Stride: 1}, + {Lo: 0x10A19, Hi: 0x10A35, Stride: 1}, + {Lo: 0x10A60, Hi: 0x10A7C, Stride: 1}, + {Lo: 0x10A80, Hi: 0x10A9C, Stride: 1}, + {Lo: 0x10AC0, Hi: 0x10AC7, Stride: 1}, + {Lo: 0x10AC9, Hi: 0x10AE4, Stride: 1}, + {Lo: 0x10B00, Hi: 0x10B35, Stride: 1}, + {Lo: 0x10B40, Hi: 0x10B55, Stride: 1}, + {Lo: 0x10B60, Hi: 0x10B72, Stride: 1}, + {Lo: 0x10B80, Hi: 0x10B91, Stride: 1}, + {Lo: 0x10C00, Hi: 0x10C48, Stride: 1}, + {Lo: 0x10C80, Hi: 0x10CB2, Stride: 1}, + {Lo: 0x10CC0, Hi: 0x10CF2, Stride: 1}, + {Lo: 0x10D00, Hi: 0x10D23, Stride: 1}, + {Lo: 0x10D4A, Hi: 0x10D65, Stride: 1}, + {Lo: 0x10D6F, Hi: 0x10D85, Stride: 1}, + {Lo: 0x10E80, Hi: 0x10EA9, Stride: 1}, + {Lo: 0x10EB0, Hi: 0x10EB1, Stride: 1}, + {Lo: 0x10EC2, Hi: 0x10EC7, Stride: 1}, + {Lo: 0x10F00, Hi: 0x10F1C, Stride: 1}, + {Lo: 0x10F27, Hi: 0x10F27, Stride: 1}, + {Lo: 0x10F30, Hi: 0x10F45, Stride: 1}, + {Lo: 0x10F70, Hi: 0x10F81, Stride: 1}, + {Lo: 0x10FB0, Hi: 0x10FC4, Stride: 1}, + {Lo: 0x10FE0, Hi: 0x10FF6, Stride: 1}, + {Lo: 0x11003, Hi: 0x11037, Stride: 1}, + {Lo: 0x11071, Hi: 0x11072, Stride: 1}, + {Lo: 0x11075, Hi: 0x11075, Stride: 1}, + {Lo: 0x11083, Hi: 0x110AF, Stride: 1}, + {Lo: 0x110D0, Hi: 0x110E8, Stride: 1}, + {Lo: 0x11103, Hi: 0x11126, Stride: 1}, + {Lo: 0x11144, Hi: 0x11144, Stride: 1}, + {Lo: 0x11147, Hi: 0x11147, Stride: 1}, + {Lo: 0x11150, Hi: 0x11172, Stride: 1}, + {Lo: 0x11176, Hi: 0x11176, Stride: 1}, + {Lo: 0x11183, Hi: 0x111B2, Stride: 1}, + {Lo: 0x111C1, Hi: 0x111C4, Stride: 1}, + {Lo: 0x111DA, Hi: 0x111DA, Stride: 1}, + {Lo: 0x111DC, Hi: 0x111DC, Stride: 1}, + {Lo: 0x11200, Hi: 0x11211, Stride: 1}, + {Lo: 0x11213, Hi: 0x1122B, Stride: 1}, + {Lo: 0x1123F, Hi: 0x11240, Stride: 1}, + {Lo: 0x11280, Hi: 0x11286, Stride: 1}, + {Lo: 0x11288, Hi: 0x11288, Stride: 1}, + {Lo: 0x1128A, Hi: 0x1128D, Stride: 1}, + {Lo: 0x1128F, Hi: 0x1129D, Stride: 1}, + {Lo: 0x1129F, Hi: 0x112A8, Stride: 1}, + {Lo: 0x112B0, Hi: 0x112DE, Stride: 1}, + {Lo: 0x11305, Hi: 0x1130C, Stride: 1}, + {Lo: 0x1130F, Hi: 0x11310, Stride: 1}, + {Lo: 0x11313, Hi: 0x11328, Stride: 1}, + {Lo: 0x1132A, Hi: 0x11330, Stride: 1}, + {Lo: 0x11332, Hi: 0x11333, Stride: 1}, + {Lo: 0x11335, Hi: 0x11339, Stride: 1}, + {Lo: 0x1133D, Hi: 0x1133D, Stride: 1}, + {Lo: 0x11350, Hi: 0x11350, Stride: 1}, + {Lo: 0x1135D, Hi: 0x11361, Stride: 1}, + {Lo: 0x11380, Hi: 0x11389, Stride: 1}, + {Lo: 0x1138B, Hi: 0x1138B, Stride: 1}, + {Lo: 0x1138E, Hi: 0x1138E, Stride: 1}, + {Lo: 0x11390, Hi: 0x113B5, Stride: 1}, + {Lo: 0x113B7, Hi: 0x113B7, Stride: 1}, + {Lo: 0x113D1, Hi: 0x113D1, Stride: 1}, + {Lo: 0x113D3, Hi: 0x113D3, Stride: 1}, + {Lo: 0x11400, Hi: 0x11434, Stride: 1}, + {Lo: 0x11447, Hi: 0x1144A, Stride: 1}, + {Lo: 0x1145F, Hi: 0x11461, Stride: 1}, + {Lo: 0x11480, Hi: 0x114AF, Stride: 1}, + {Lo: 0x114C4, Hi: 0x114C5, Stride: 1}, + {Lo: 0x114C7, Hi: 0x114C7, Stride: 1}, + {Lo: 0x11580, Hi: 0x115AE, Stride: 1}, + {Lo: 0x115D8, Hi: 0x115DB, Stride: 1}, + {Lo: 0x11600, Hi: 0x1162F, Stride: 1}, + {Lo: 0x11644, Hi: 0x11644, Stride: 1}, + {Lo: 0x11680, Hi: 0x116AA, Stride: 1}, + {Lo: 0x116B8, Hi: 0x116B8, Stride: 1}, + {Lo: 0x11800, Hi: 0x1182B, Stride: 1}, + {Lo: 0x118A0, Hi: 0x118DF, Stride: 1}, + {Lo: 0x118FF, Hi: 0x11906, Stride: 1}, + {Lo: 0x11909, Hi: 0x11909, Stride: 1}, + {Lo: 0x1190C, Hi: 0x11913, Stride: 1}, + {Lo: 0x11915, Hi: 0x11916, Stride: 1}, + {Lo: 0x11918, Hi: 0x1192F, Stride: 1}, + {Lo: 0x1193F, Hi: 0x1193F, Stride: 1}, + {Lo: 0x11941, Hi: 0x11941, Stride: 1}, + {Lo: 0x119A0, Hi: 0x119A7, Stride: 1}, + {Lo: 0x119AA, Hi: 0x119D0, Stride: 1}, + {Lo: 0x119E1, Hi: 0x119E1, Stride: 1}, + {Lo: 0x119E3, Hi: 0x119E3, Stride: 1}, + {Lo: 0x11A00, Hi: 0x11A00, Stride: 1}, + {Lo: 0x11A0B, Hi: 0x11A32, Stride: 1}, + {Lo: 0x11A3A, Hi: 0x11A3A, Stride: 1}, + {Lo: 0x11A50, Hi: 0x11A50, Stride: 1}, + {Lo: 0x11A5C, Hi: 0x11A89, Stride: 1}, + {Lo: 0x11A9D, Hi: 0x11A9D, Stride: 1}, + {Lo: 0x11AB0, Hi: 0x11AF8, Stride: 1}, + {Lo: 0x11BC0, Hi: 0x11BE0, Stride: 1}, + {Lo: 0x11C00, Hi: 0x11C08, Stride: 1}, + {Lo: 0x11C0A, Hi: 0x11C2E, Stride: 1}, + {Lo: 0x11C40, Hi: 0x11C40, Stride: 1}, + {Lo: 0x11C72, Hi: 0x11C8F, Stride: 1}, + {Lo: 0x11D00, Hi: 0x11D06, Stride: 1}, + {Lo: 0x11D08, Hi: 0x11D09, Stride: 1}, + {Lo: 0x11D0B, Hi: 0x11D30, Stride: 1}, + {Lo: 0x11D46, Hi: 0x11D46, Stride: 1}, + {Lo: 0x11D60, Hi: 0x11D65, Stride: 1}, + {Lo: 0x11D67, Hi: 0x11D68, Stride: 1}, + {Lo: 0x11D6A, Hi: 0x11D89, Stride: 1}, + {Lo: 0x11D98, Hi: 0x11D98, Stride: 1}, + {Lo: 0x11DB0, Hi: 0x11DDB, Stride: 1}, + {Lo: 0x11EE0, Hi: 0x11EF2, Stride: 1}, + {Lo: 0x11F02, Hi: 0x11F02, Stride: 1}, + {Lo: 0x11F04, Hi: 0x11F10, Stride: 1}, + {Lo: 0x11F12, Hi: 0x11F33, Stride: 1}, + {Lo: 0x11FB0, Hi: 0x11FB0, Stride: 1}, + {Lo: 0x12000, Hi: 0x12399, Stride: 1}, + {Lo: 0x12400, Hi: 0x1246E, Stride: 1}, + {Lo: 0x12480, Hi: 0x12543, Stride: 1}, + {Lo: 0x12F90, Hi: 0x12FF0, Stride: 1}, + {Lo: 0x13000, Hi: 0x1342F, Stride: 1}, + {Lo: 0x13441, Hi: 0x13446, Stride: 1}, + {Lo: 0x13460, Hi: 0x143FA, Stride: 1}, + {Lo: 0x14400, Hi: 0x14646, Stride: 1}, + {Lo: 0x16100, Hi: 0x1611D, Stride: 1}, + {Lo: 0x16800, Hi: 0x16A38, Stride: 1}, + {Lo: 0x16A40, Hi: 0x16A5E, Stride: 1}, + {Lo: 0x16A70, Hi: 0x16ABE, Stride: 1}, + {Lo: 0x16AD0, Hi: 0x16AED, Stride: 1}, + {Lo: 0x16B00, Hi: 0x16B2F, Stride: 1}, + {Lo: 0x16B40, Hi: 0x16B43, Stride: 1}, + {Lo: 0x16B63, Hi: 0x16B77, Stride: 1}, + {Lo: 0x16B7D, Hi: 0x16B8F, Stride: 1}, + {Lo: 0x16D40, Hi: 0x16D6C, Stride: 1}, + {Lo: 0x16E40, Hi: 0x16E7F, Stride: 1}, + {Lo: 0x16EA0, Hi: 0x16EB8, Stride: 1}, + {Lo: 0x16EBB, Hi: 0x16ED3, Stride: 1}, + {Lo: 0x16F00, Hi: 0x16F4A, Stride: 1}, + {Lo: 0x16F50, Hi: 0x16F50, Stride: 1}, + {Lo: 0x16F93, Hi: 0x16F9F, Stride: 1}, + {Lo: 0x16FE0, Hi: 0x16FE1, Stride: 1}, + {Lo: 0x16FE3, Hi: 0x16FE3, Stride: 1}, + {Lo: 0x1BC00, Hi: 0x1BC6A, Stride: 1}, + {Lo: 0x1BC70, Hi: 0x1BC7C, Stride: 1}, + {Lo: 0x1BC80, Hi: 0x1BC88, Stride: 1}, + {Lo: 0x1BC90, Hi: 0x1BC99, Stride: 1}, + {Lo: 0x1D400, Hi: 0x1D454, Stride: 1}, + {Lo: 0x1D456, Hi: 0x1D49C, Stride: 1}, + {Lo: 0x1D49E, Hi: 0x1D49F, Stride: 1}, + {Lo: 0x1D4A2, Hi: 0x1D4A2, Stride: 1}, + {Lo: 0x1D4A5, Hi: 0x1D4A6, Stride: 1}, + {Lo: 0x1D4A9, Hi: 0x1D4AC, Stride: 1}, + {Lo: 0x1D4AE, Hi: 0x1D4B9, Stride: 1}, + {Lo: 0x1D4BB, Hi: 0x1D4BB, Stride: 1}, + {Lo: 0x1D4BD, Hi: 0x1D4C3, Stride: 1}, + {Lo: 0x1D4C5, Hi: 0x1D505, Stride: 1}, + {Lo: 0x1D507, Hi: 0x1D50A, Stride: 1}, + {Lo: 0x1D50D, Hi: 0x1D514, Stride: 1}, + {Lo: 0x1D516, Hi: 0x1D51C, Stride: 1}, + {Lo: 0x1D51E, Hi: 0x1D539, Stride: 1}, + {Lo: 0x1D53B, Hi: 0x1D53E, Stride: 1}, + {Lo: 0x1D540, Hi: 0x1D544, Stride: 1}, + {Lo: 0x1D546, Hi: 0x1D546, Stride: 1}, + {Lo: 0x1D54A, Hi: 0x1D550, Stride: 1}, + {Lo: 0x1D552, Hi: 0x1D6A5, Stride: 1}, + {Lo: 0x1D6A8, Hi: 0x1D6C0, Stride: 1}, + {Lo: 0x1D6C2, Hi: 0x1D6DA, Stride: 1}, + {Lo: 0x1D6DC, Hi: 0x1D6FA, Stride: 1}, + {Lo: 0x1D6FC, Hi: 0x1D714, Stride: 1}, + {Lo: 0x1D716, Hi: 0x1D734, Stride: 1}, + {Lo: 0x1D736, Hi: 0x1D74E, Stride: 1}, + {Lo: 0x1D750, Hi: 0x1D76E, Stride: 1}, + {Lo: 0x1D770, Hi: 0x1D788, Stride: 1}, + {Lo: 0x1D78A, Hi: 0x1D7A8, Stride: 1}, + {Lo: 0x1D7AA, Hi: 0x1D7C2, Stride: 1}, + {Lo: 0x1D7C4, Hi: 0x1D7CB, Stride: 1}, + {Lo: 0x1DF00, Hi: 0x1DF1E, Stride: 1}, + {Lo: 0x1DF25, Hi: 0x1DF2A, Stride: 1}, + {Lo: 0x1E030, Hi: 0x1E06D, Stride: 1}, + {Lo: 0x1E100, Hi: 0x1E12C, Stride: 1}, + {Lo: 0x1E137, Hi: 0x1E13D, Stride: 1}, + {Lo: 0x1E14E, Hi: 0x1E14E, Stride: 1}, + {Lo: 0x1E290, Hi: 0x1E2AD, Stride: 1}, + {Lo: 0x1E2C0, Hi: 0x1E2EB, Stride: 1}, + {Lo: 0x1E4D0, Hi: 0x1E4EB, Stride: 1}, + {Lo: 0x1E5D0, Hi: 0x1E5ED, Stride: 1}, + {Lo: 0x1E5F0, Hi: 0x1E5F0, Stride: 1}, + {Lo: 0x1E6C0, Hi: 0x1E6DE, Stride: 1}, + {Lo: 0x1E6E0, Hi: 0x1E6E2, Stride: 1}, + {Lo: 0x1E6E4, Hi: 0x1E6E5, Stride: 1}, + {Lo: 0x1E6E7, Hi: 0x1E6ED, Stride: 1}, + {Lo: 0x1E6F0, Hi: 0x1E6F4, Stride: 1}, + {Lo: 0x1E6FE, Hi: 0x1E6FF, Stride: 1}, + {Lo: 0x1E7E0, Hi: 0x1E7E6, Stride: 1}, + {Lo: 0x1E7E8, Hi: 0x1E7EB, Stride: 1}, + {Lo: 0x1E7ED, Hi: 0x1E7EE, Stride: 1}, + {Lo: 0x1E7F0, Hi: 0x1E7FE, Stride: 1}, + {Lo: 0x1E800, Hi: 0x1E8C4, Stride: 1}, + {Lo: 0x1E900, Hi: 0x1E943, Stride: 1}, + {Lo: 0x1E94B, Hi: 0x1E94B, Stride: 1}, + {Lo: 0x1EE00, Hi: 0x1EE03, Stride: 1}, + {Lo: 0x1EE05, Hi: 0x1EE1F, Stride: 1}, + {Lo: 0x1EE21, Hi: 0x1EE22, Stride: 1}, + {Lo: 0x1EE24, Hi: 0x1EE24, Stride: 1}, + {Lo: 0x1EE27, Hi: 0x1EE27, Stride: 1}, + {Lo: 0x1EE29, Hi: 0x1EE32, Stride: 1}, + {Lo: 0x1EE34, Hi: 0x1EE37, Stride: 1}, + {Lo: 0x1EE39, Hi: 0x1EE39, Stride: 1}, + {Lo: 0x1EE3B, Hi: 0x1EE3B, Stride: 1}, + {Lo: 0x1EE42, Hi: 0x1EE42, Stride: 1}, + {Lo: 0x1EE47, Hi: 0x1EE47, Stride: 1}, + {Lo: 0x1EE49, Hi: 0x1EE49, Stride: 1}, + {Lo: 0x1EE4B, Hi: 0x1EE4B, Stride: 1}, + {Lo: 0x1EE4D, Hi: 0x1EE4F, Stride: 1}, + {Lo: 0x1EE51, Hi: 0x1EE52, Stride: 1}, + {Lo: 0x1EE54, Hi: 0x1EE54, Stride: 1}, + {Lo: 0x1EE57, Hi: 0x1EE57, Stride: 1}, + {Lo: 0x1EE59, Hi: 0x1EE59, Stride: 1}, + {Lo: 0x1EE5B, Hi: 0x1EE5B, Stride: 1}, + {Lo: 0x1EE5D, Hi: 0x1EE5D, Stride: 1}, + {Lo: 0x1EE5F, Hi: 0x1EE5F, Stride: 1}, + {Lo: 0x1EE61, Hi: 0x1EE62, Stride: 1}, + {Lo: 0x1EE64, Hi: 0x1EE64, Stride: 1}, + {Lo: 0x1EE67, Hi: 0x1EE6A, Stride: 1}, + {Lo: 0x1EE6C, Hi: 0x1EE72, Stride: 1}, + {Lo: 0x1EE74, Hi: 0x1EE77, Stride: 1}, + {Lo: 0x1EE79, Hi: 0x1EE7C, Stride: 1}, + {Lo: 0x1EE7E, Hi: 0x1EE7E, Stride: 1}, + {Lo: 0x1EE80, Hi: 0x1EE89, Stride: 1}, + {Lo: 0x1EE8B, Hi: 0x1EE9B, Stride: 1}, + {Lo: 0x1EEA1, Hi: 0x1EEA3, Stride: 1}, + {Lo: 0x1EEA5, Hi: 0x1EEA9, Stride: 1}, + {Lo: 0x1EEAB, Hi: 0x1EEBB, Stride: 1}, + {Lo: 0x1F130, Hi: 0x1F149, Stride: 1}, + {Lo: 0x1F150, Hi: 0x1F169, Stride: 1}, + {Lo: 0x1F170, Hi: 0x1F189, Stride: 1}, + }, +} + +var unicodeAliasWord_Break_CR = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0xD, Hi: 0xD, Stride: 1}, + }, +} + +var unicodeAliasWord_Break_Double_Quote = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x22, Hi: 0x22, Stride: 1}, + }, +} + +var unicodeAliasWord_Break_Extend = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x300, Hi: 0x36F, Stride: 1}, + {Lo: 0x483, Hi: 0x489, Stride: 1}, + {Lo: 0x591, Hi: 0x5BD, Stride: 1}, + {Lo: 0x5BF, Hi: 0x5BF, Stride: 1}, + {Lo: 0x5C1, Hi: 0x5C2, Stride: 1}, + {Lo: 0x5C4, Hi: 0x5C5, Stride: 1}, + {Lo: 0x5C7, Hi: 0x5C7, Stride: 1}, + {Lo: 0x610, Hi: 0x61A, Stride: 1}, + {Lo: 0x64B, Hi: 0x65F, Stride: 1}, + {Lo: 0x670, Hi: 0x670, Stride: 1}, + {Lo: 0x6D6, Hi: 0x6DC, Stride: 1}, + {Lo: 0x6DF, Hi: 0x6E4, Stride: 1}, + {Lo: 0x6E7, Hi: 0x6E8, Stride: 1}, + {Lo: 0x6EA, Hi: 0x6ED, Stride: 1}, + {Lo: 0x711, Hi: 0x711, Stride: 1}, + {Lo: 0x730, Hi: 0x74A, Stride: 1}, + {Lo: 0x7A6, Hi: 0x7B0, Stride: 1}, + {Lo: 0x7EB, Hi: 0x7F3, Stride: 1}, + {Lo: 0x7FD, Hi: 0x7FD, Stride: 1}, + {Lo: 0x816, Hi: 0x819, Stride: 1}, + {Lo: 0x81B, Hi: 0x823, Stride: 1}, + {Lo: 0x825, Hi: 0x827, Stride: 1}, + {Lo: 0x829, Hi: 0x82D, Stride: 1}, + {Lo: 0x859, Hi: 0x85B, Stride: 1}, + {Lo: 0x897, Hi: 0x89F, Stride: 1}, + {Lo: 0x8CA, Hi: 0x8E1, Stride: 1}, + {Lo: 0x8E3, Hi: 0x903, Stride: 1}, + {Lo: 0x93A, Hi: 0x93C, Stride: 1}, + {Lo: 0x93E, Hi: 0x94F, Stride: 1}, + {Lo: 0x951, Hi: 0x957, Stride: 1}, + {Lo: 0x962, Hi: 0x963, Stride: 1}, + {Lo: 0x981, Hi: 0x983, Stride: 1}, + {Lo: 0x9BC, Hi: 0x9BC, Stride: 1}, + {Lo: 0x9BE, Hi: 0x9C4, Stride: 1}, + {Lo: 0x9C7, Hi: 0x9C8, Stride: 1}, + {Lo: 0x9CB, Hi: 0x9CD, Stride: 1}, + {Lo: 0x9D7, Hi: 0x9D7, Stride: 1}, + {Lo: 0x9E2, Hi: 0x9E3, Stride: 1}, + {Lo: 0x9FE, Hi: 0x9FE, Stride: 1}, + {Lo: 0xA01, Hi: 0xA03, Stride: 1}, + {Lo: 0xA3C, Hi: 0xA3C, Stride: 1}, + {Lo: 0xA3E, Hi: 0xA42, Stride: 1}, + {Lo: 0xA47, Hi: 0xA48, Stride: 1}, + {Lo: 0xA4B, Hi: 0xA4D, Stride: 1}, + {Lo: 0xA51, Hi: 0xA51, Stride: 1}, + {Lo: 0xA70, Hi: 0xA71, Stride: 1}, + {Lo: 0xA75, Hi: 0xA75, Stride: 1}, + {Lo: 0xA81, Hi: 0xA83, Stride: 1}, + {Lo: 0xABC, Hi: 0xABC, Stride: 1}, + {Lo: 0xABE, Hi: 0xAC5, Stride: 1}, + {Lo: 0xAC7, Hi: 0xAC9, Stride: 1}, + {Lo: 0xACB, Hi: 0xACD, Stride: 1}, + {Lo: 0xAE2, Hi: 0xAE3, Stride: 1}, + {Lo: 0xAFA, Hi: 0xAFF, Stride: 1}, + {Lo: 0xB01, Hi: 0xB03, Stride: 1}, + {Lo: 0xB3C, Hi: 0xB3C, Stride: 1}, + {Lo: 0xB3E, Hi: 0xB44, Stride: 1}, + {Lo: 0xB47, Hi: 0xB48, Stride: 1}, + {Lo: 0xB4B, Hi: 0xB4D, Stride: 1}, + {Lo: 0xB55, Hi: 0xB57, Stride: 1}, + {Lo: 0xB62, Hi: 0xB63, Stride: 1}, + {Lo: 0xB82, Hi: 0xB82, Stride: 1}, + {Lo: 0xBBE, Hi: 0xBC2, Stride: 1}, + {Lo: 0xBC6, Hi: 0xBC8, Stride: 1}, + {Lo: 0xBCA, Hi: 0xBCD, Stride: 1}, + {Lo: 0xBD7, Hi: 0xBD7, Stride: 1}, + {Lo: 0xC00, Hi: 0xC04, Stride: 1}, + {Lo: 0xC3C, Hi: 0xC3C, Stride: 1}, + {Lo: 0xC3E, Hi: 0xC44, Stride: 1}, + {Lo: 0xC46, Hi: 0xC48, Stride: 1}, + {Lo: 0xC4A, Hi: 0xC4D, Stride: 1}, + {Lo: 0xC55, Hi: 0xC56, Stride: 1}, + {Lo: 0xC62, Hi: 0xC63, Stride: 1}, + {Lo: 0xC81, Hi: 0xC83, Stride: 1}, + {Lo: 0xCBC, Hi: 0xCBC, Stride: 1}, + {Lo: 0xCBE, Hi: 0xCC4, Stride: 1}, + {Lo: 0xCC6, Hi: 0xCC8, Stride: 1}, + {Lo: 0xCCA, Hi: 0xCCD, Stride: 1}, + {Lo: 0xCD5, Hi: 0xCD6, Stride: 1}, + {Lo: 0xCE2, Hi: 0xCE3, Stride: 1}, + {Lo: 0xCF3, Hi: 0xCF3, Stride: 1}, + {Lo: 0xD00, Hi: 0xD03, Stride: 1}, + {Lo: 0xD3B, Hi: 0xD3C, Stride: 1}, + {Lo: 0xD3E, Hi: 0xD44, Stride: 1}, + {Lo: 0xD46, Hi: 0xD48, Stride: 1}, + {Lo: 0xD4A, Hi: 0xD4D, Stride: 1}, + {Lo: 0xD57, Hi: 0xD57, Stride: 1}, + {Lo: 0xD62, Hi: 0xD63, Stride: 1}, + {Lo: 0xD81, Hi: 0xD83, Stride: 1}, + {Lo: 0xDCA, Hi: 0xDCA, Stride: 1}, + {Lo: 0xDCF, Hi: 0xDD4, Stride: 1}, + {Lo: 0xDD6, Hi: 0xDD6, Stride: 1}, + {Lo: 0xDD8, Hi: 0xDDF, Stride: 1}, + {Lo: 0xDF2, Hi: 0xDF3, Stride: 1}, + {Lo: 0xE31, Hi: 0xE31, Stride: 1}, + {Lo: 0xE34, Hi: 0xE3A, Stride: 1}, + {Lo: 0xE47, Hi: 0xE4E, Stride: 1}, + {Lo: 0xEB1, Hi: 0xEB1, Stride: 1}, + {Lo: 0xEB4, Hi: 0xEBC, Stride: 1}, + {Lo: 0xEC8, Hi: 0xECE, Stride: 1}, + {Lo: 0xF18, Hi: 0xF19, Stride: 1}, + {Lo: 0xF35, Hi: 0xF35, Stride: 1}, + {Lo: 0xF37, Hi: 0xF37, Stride: 1}, + {Lo: 0xF39, Hi: 0xF39, Stride: 1}, + {Lo: 0xF3E, Hi: 0xF3F, Stride: 1}, + {Lo: 0xF71, Hi: 0xF84, Stride: 1}, + {Lo: 0xF86, Hi: 0xF87, Stride: 1}, + {Lo: 0xF8D, Hi: 0xF97, Stride: 1}, + {Lo: 0xF99, Hi: 0xFBC, Stride: 1}, + {Lo: 0xFC6, Hi: 0xFC6, Stride: 1}, + {Lo: 0x102B, Hi: 0x103E, Stride: 1}, + {Lo: 0x1056, Hi: 0x1059, Stride: 1}, + {Lo: 0x105E, Hi: 0x1060, Stride: 1}, + {Lo: 0x1062, Hi: 0x1064, Stride: 1}, + {Lo: 0x1067, Hi: 0x106D, Stride: 1}, + {Lo: 0x1071, Hi: 0x1074, Stride: 1}, + {Lo: 0x1082, Hi: 0x108D, Stride: 1}, + {Lo: 0x108F, Hi: 0x108F, Stride: 1}, + {Lo: 0x109A, Hi: 0x109D, Stride: 1}, + {Lo: 0x135D, Hi: 0x135F, Stride: 1}, + {Lo: 0x1712, Hi: 0x1715, Stride: 1}, + {Lo: 0x1732, Hi: 0x1734, Stride: 1}, + {Lo: 0x1752, Hi: 0x1753, Stride: 1}, + {Lo: 0x1772, Hi: 0x1773, Stride: 1}, + {Lo: 0x17B4, Hi: 0x17D3, Stride: 1}, + {Lo: 0x17DD, Hi: 0x17DD, Stride: 1}, + {Lo: 0x180B, Hi: 0x180D, Stride: 1}, + {Lo: 0x180F, Hi: 0x180F, Stride: 1}, + {Lo: 0x1885, Hi: 0x1886, Stride: 1}, + {Lo: 0x18A9, Hi: 0x18A9, Stride: 1}, + {Lo: 0x1920, Hi: 0x192B, Stride: 1}, + {Lo: 0x1930, Hi: 0x193B, Stride: 1}, + {Lo: 0x1A17, Hi: 0x1A1B, Stride: 1}, + {Lo: 0x1A55, Hi: 0x1A5E, Stride: 1}, + {Lo: 0x1A60, Hi: 0x1A7C, Stride: 1}, + {Lo: 0x1A7F, Hi: 0x1A7F, Stride: 1}, + {Lo: 0x1AB0, Hi: 0x1ADD, Stride: 1}, + {Lo: 0x1AE0, Hi: 0x1AEB, Stride: 1}, + {Lo: 0x1B00, Hi: 0x1B04, Stride: 1}, + {Lo: 0x1B34, Hi: 0x1B44, Stride: 1}, + {Lo: 0x1B6B, Hi: 0x1B73, Stride: 1}, + {Lo: 0x1B80, Hi: 0x1B82, Stride: 1}, + {Lo: 0x1BA1, Hi: 0x1BAD, Stride: 1}, + {Lo: 0x1BE6, Hi: 0x1BF3, Stride: 1}, + {Lo: 0x1C24, Hi: 0x1C37, Stride: 1}, + {Lo: 0x1CD0, Hi: 0x1CD2, Stride: 1}, + {Lo: 0x1CD4, Hi: 0x1CE8, Stride: 1}, + {Lo: 0x1CED, Hi: 0x1CED, Stride: 1}, + {Lo: 0x1CF4, Hi: 0x1CF4, Stride: 1}, + {Lo: 0x1CF7, Hi: 0x1CF9, Stride: 1}, + {Lo: 0x1DC0, Hi: 0x1DFF, Stride: 1}, + {Lo: 0x200C, Hi: 0x200C, Stride: 1}, + {Lo: 0x20D0, Hi: 0x20F0, Stride: 1}, + {Lo: 0x2CEF, Hi: 0x2CF1, Stride: 1}, + {Lo: 0x2D7F, Hi: 0x2D7F, Stride: 1}, + {Lo: 0x2DE0, Hi: 0x2DFF, Stride: 1}, + {Lo: 0x302A, Hi: 0x302F, Stride: 1}, + {Lo: 0x3099, Hi: 0x309A, Stride: 1}, + {Lo: 0xA66F, Hi: 0xA672, Stride: 1}, + {Lo: 0xA674, Hi: 0xA67D, Stride: 1}, + {Lo: 0xA69E, Hi: 0xA69F, Stride: 1}, + {Lo: 0xA6F0, Hi: 0xA6F1, Stride: 1}, + {Lo: 0xA802, Hi: 0xA802, Stride: 1}, + {Lo: 0xA806, Hi: 0xA806, Stride: 1}, + {Lo: 0xA80B, Hi: 0xA80B, Stride: 1}, + {Lo: 0xA823, Hi: 0xA827, Stride: 1}, + {Lo: 0xA82C, Hi: 0xA82C, Stride: 1}, + {Lo: 0xA880, Hi: 0xA881, Stride: 1}, + {Lo: 0xA8B4, Hi: 0xA8C5, Stride: 1}, + {Lo: 0xA8E0, Hi: 0xA8F1, Stride: 1}, + {Lo: 0xA8FF, Hi: 0xA8FF, Stride: 1}, + {Lo: 0xA926, Hi: 0xA92D, Stride: 1}, + {Lo: 0xA947, Hi: 0xA953, Stride: 1}, + {Lo: 0xA980, Hi: 0xA983, Stride: 1}, + {Lo: 0xA9B3, Hi: 0xA9C0, Stride: 1}, + {Lo: 0xA9E5, Hi: 0xA9E5, Stride: 1}, + {Lo: 0xAA29, Hi: 0xAA36, Stride: 1}, + {Lo: 0xAA43, Hi: 0xAA43, Stride: 1}, + {Lo: 0xAA4C, Hi: 0xAA4D, Stride: 1}, + {Lo: 0xAA7B, Hi: 0xAA7D, Stride: 1}, + {Lo: 0xAAB0, Hi: 0xAAB0, Stride: 1}, + {Lo: 0xAAB2, Hi: 0xAAB4, Stride: 1}, + {Lo: 0xAAB7, Hi: 0xAAB8, Stride: 1}, + {Lo: 0xAABE, Hi: 0xAABF, Stride: 1}, + {Lo: 0xAAC1, Hi: 0xAAC1, Stride: 1}, + {Lo: 0xAAEB, Hi: 0xAAEF, Stride: 1}, + {Lo: 0xAAF5, Hi: 0xAAF6, Stride: 1}, + {Lo: 0xABE3, Hi: 0xABEA, Stride: 1}, + {Lo: 0xABEC, Hi: 0xABED, Stride: 1}, + {Lo: 0xFB1E, Hi: 0xFB1E, Stride: 1}, + {Lo: 0xFE00, Hi: 0xFE0F, Stride: 1}, + {Lo: 0xFE20, Hi: 0xFE2F, Stride: 1}, + {Lo: 0xFF9E, Hi: 0xFF9F, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x101FD, Hi: 0x101FD, Stride: 1}, + {Lo: 0x102E0, Hi: 0x102E0, Stride: 1}, + {Lo: 0x10376, Hi: 0x1037A, Stride: 1}, + {Lo: 0x10A01, Hi: 0x10A03, Stride: 1}, + {Lo: 0x10A05, Hi: 0x10A06, Stride: 1}, + {Lo: 0x10A0C, Hi: 0x10A0F, Stride: 1}, + {Lo: 0x10A38, Hi: 0x10A3A, Stride: 1}, + {Lo: 0x10A3F, Hi: 0x10A3F, Stride: 1}, + {Lo: 0x10AE5, Hi: 0x10AE6, Stride: 1}, + {Lo: 0x10D24, Hi: 0x10D27, Stride: 1}, + {Lo: 0x10D69, Hi: 0x10D6D, Stride: 1}, + {Lo: 0x10EAB, Hi: 0x10EAC, Stride: 1}, + {Lo: 0x10EFA, Hi: 0x10EFF, Stride: 1}, + {Lo: 0x10F46, Hi: 0x10F50, Stride: 1}, + {Lo: 0x10F82, Hi: 0x10F85, Stride: 1}, + {Lo: 0x11000, Hi: 0x11002, Stride: 1}, + {Lo: 0x11038, Hi: 0x11046, Stride: 1}, + {Lo: 0x11070, Hi: 0x11070, Stride: 1}, + {Lo: 0x11073, Hi: 0x11074, Stride: 1}, + {Lo: 0x1107F, Hi: 0x11082, Stride: 1}, + {Lo: 0x110B0, Hi: 0x110BA, Stride: 1}, + {Lo: 0x110C2, Hi: 0x110C2, Stride: 1}, + {Lo: 0x11100, Hi: 0x11102, Stride: 1}, + {Lo: 0x11127, Hi: 0x11134, Stride: 1}, + {Lo: 0x11145, Hi: 0x11146, Stride: 1}, + {Lo: 0x11173, Hi: 0x11173, Stride: 1}, + {Lo: 0x11180, Hi: 0x11182, Stride: 1}, + {Lo: 0x111B3, Hi: 0x111C0, Stride: 1}, + {Lo: 0x111C9, Hi: 0x111CC, Stride: 1}, + {Lo: 0x111CE, Hi: 0x111CF, Stride: 1}, + {Lo: 0x1122C, Hi: 0x11237, Stride: 1}, + {Lo: 0x1123E, Hi: 0x1123E, Stride: 1}, + {Lo: 0x11241, Hi: 0x11241, Stride: 1}, + {Lo: 0x112DF, Hi: 0x112EA, Stride: 1}, + {Lo: 0x11300, Hi: 0x11303, Stride: 1}, + {Lo: 0x1133B, Hi: 0x1133C, Stride: 1}, + {Lo: 0x1133E, Hi: 0x11344, Stride: 1}, + {Lo: 0x11347, Hi: 0x11348, Stride: 1}, + {Lo: 0x1134B, Hi: 0x1134D, Stride: 1}, + {Lo: 0x11357, Hi: 0x11357, Stride: 1}, + {Lo: 0x11362, Hi: 0x11363, Stride: 1}, + {Lo: 0x11366, Hi: 0x1136C, Stride: 1}, + {Lo: 0x11370, Hi: 0x11374, Stride: 1}, + {Lo: 0x113B8, Hi: 0x113C0, Stride: 1}, + {Lo: 0x113C2, Hi: 0x113C2, Stride: 1}, + {Lo: 0x113C5, Hi: 0x113C5, Stride: 1}, + {Lo: 0x113C7, Hi: 0x113CA, Stride: 1}, + {Lo: 0x113CC, Hi: 0x113D0, Stride: 1}, + {Lo: 0x113D2, Hi: 0x113D2, Stride: 1}, + {Lo: 0x113E1, Hi: 0x113E2, Stride: 1}, + {Lo: 0x11435, Hi: 0x11446, Stride: 1}, + {Lo: 0x1145E, Hi: 0x1145E, Stride: 1}, + {Lo: 0x114B0, Hi: 0x114C3, Stride: 1}, + {Lo: 0x115AF, Hi: 0x115B5, Stride: 1}, + {Lo: 0x115B8, Hi: 0x115C0, Stride: 1}, + {Lo: 0x115DC, Hi: 0x115DD, Stride: 1}, + {Lo: 0x11630, Hi: 0x11640, Stride: 1}, + {Lo: 0x116AB, Hi: 0x116B7, Stride: 1}, + {Lo: 0x1171D, Hi: 0x1172B, Stride: 1}, + {Lo: 0x1182C, Hi: 0x1183A, Stride: 1}, + {Lo: 0x11930, Hi: 0x11935, Stride: 1}, + {Lo: 0x11937, Hi: 0x11938, Stride: 1}, + {Lo: 0x1193B, Hi: 0x1193E, Stride: 1}, + {Lo: 0x11940, Hi: 0x11940, Stride: 1}, + {Lo: 0x11942, Hi: 0x11943, Stride: 1}, + {Lo: 0x119D1, Hi: 0x119D7, Stride: 1}, + {Lo: 0x119DA, Hi: 0x119E0, Stride: 1}, + {Lo: 0x119E4, Hi: 0x119E4, Stride: 1}, + {Lo: 0x11A01, Hi: 0x11A0A, Stride: 1}, + {Lo: 0x11A33, Hi: 0x11A39, Stride: 1}, + {Lo: 0x11A3B, Hi: 0x11A3E, Stride: 1}, + {Lo: 0x11A47, Hi: 0x11A47, Stride: 1}, + {Lo: 0x11A51, Hi: 0x11A5B, Stride: 1}, + {Lo: 0x11A8A, Hi: 0x11A99, Stride: 1}, + {Lo: 0x11B60, Hi: 0x11B67, Stride: 1}, + {Lo: 0x11C2F, Hi: 0x11C36, Stride: 1}, + {Lo: 0x11C38, Hi: 0x11C3F, Stride: 1}, + {Lo: 0x11C92, Hi: 0x11CA7, Stride: 1}, + {Lo: 0x11CA9, Hi: 0x11CB6, Stride: 1}, + {Lo: 0x11D31, Hi: 0x11D36, Stride: 1}, + {Lo: 0x11D3A, Hi: 0x11D3A, Stride: 1}, + {Lo: 0x11D3C, Hi: 0x11D3D, Stride: 1}, + {Lo: 0x11D3F, Hi: 0x11D45, Stride: 1}, + {Lo: 0x11D47, Hi: 0x11D47, Stride: 1}, + {Lo: 0x11D8A, Hi: 0x11D8E, Stride: 1}, + {Lo: 0x11D90, Hi: 0x11D91, Stride: 1}, + {Lo: 0x11D93, Hi: 0x11D97, Stride: 1}, + {Lo: 0x11EF3, Hi: 0x11EF6, Stride: 1}, + {Lo: 0x11F00, Hi: 0x11F01, Stride: 1}, + {Lo: 0x11F03, Hi: 0x11F03, Stride: 1}, + {Lo: 0x11F34, Hi: 0x11F3A, Stride: 1}, + {Lo: 0x11F3E, Hi: 0x11F42, Stride: 1}, + {Lo: 0x11F5A, Hi: 0x11F5A, Stride: 1}, + {Lo: 0x13440, Hi: 0x13440, Stride: 1}, + {Lo: 0x13447, Hi: 0x13455, Stride: 1}, + {Lo: 0x1611E, Hi: 0x1612F, Stride: 1}, + {Lo: 0x16AF0, Hi: 0x16AF4, Stride: 1}, + {Lo: 0x16B30, Hi: 0x16B36, Stride: 1}, + {Lo: 0x16F4F, Hi: 0x16F4F, Stride: 1}, + {Lo: 0x16F51, Hi: 0x16F87, Stride: 1}, + {Lo: 0x16F8F, Hi: 0x16F92, Stride: 1}, + {Lo: 0x16FE4, Hi: 0x16FE4, Stride: 1}, + {Lo: 0x16FF0, Hi: 0x16FF1, Stride: 1}, + {Lo: 0x1BC9D, Hi: 0x1BC9E, Stride: 1}, + {Lo: 0x1CF00, Hi: 0x1CF2D, Stride: 1}, + {Lo: 0x1CF30, Hi: 0x1CF46, Stride: 1}, + {Lo: 0x1D165, Hi: 0x1D169, Stride: 1}, + {Lo: 0x1D16D, Hi: 0x1D172, Stride: 1}, + {Lo: 0x1D17B, Hi: 0x1D182, Stride: 1}, + {Lo: 0x1D185, Hi: 0x1D18B, Stride: 1}, + {Lo: 0x1D1AA, Hi: 0x1D1AD, Stride: 1}, + {Lo: 0x1D242, Hi: 0x1D244, Stride: 1}, + {Lo: 0x1DA00, Hi: 0x1DA36, Stride: 1}, + {Lo: 0x1DA3B, Hi: 0x1DA6C, Stride: 1}, + {Lo: 0x1DA75, Hi: 0x1DA75, Stride: 1}, + {Lo: 0x1DA84, Hi: 0x1DA84, Stride: 1}, + {Lo: 0x1DA9B, Hi: 0x1DA9F, Stride: 1}, + {Lo: 0x1DAA1, Hi: 0x1DAAF, Stride: 1}, + {Lo: 0x1E000, Hi: 0x1E006, Stride: 1}, + {Lo: 0x1E008, Hi: 0x1E018, Stride: 1}, + {Lo: 0x1E01B, Hi: 0x1E021, Stride: 1}, + {Lo: 0x1E023, Hi: 0x1E024, Stride: 1}, + {Lo: 0x1E026, Hi: 0x1E02A, Stride: 1}, + {Lo: 0x1E08F, Hi: 0x1E08F, Stride: 1}, + {Lo: 0x1E130, Hi: 0x1E136, Stride: 1}, + {Lo: 0x1E2AE, Hi: 0x1E2AE, Stride: 1}, + {Lo: 0x1E2EC, Hi: 0x1E2EF, Stride: 1}, + {Lo: 0x1E4EC, Hi: 0x1E4EF, Stride: 1}, + {Lo: 0x1E5EE, Hi: 0x1E5EF, Stride: 1}, + {Lo: 0x1E6E3, Hi: 0x1E6E3, Stride: 1}, + {Lo: 0x1E6E6, Hi: 0x1E6E6, Stride: 1}, + {Lo: 0x1E6EE, Hi: 0x1E6EF, Stride: 1}, + {Lo: 0x1E6F5, Hi: 0x1E6F5, Stride: 1}, + {Lo: 0x1E8D0, Hi: 0x1E8D6, Stride: 1}, + {Lo: 0x1E944, Hi: 0x1E94A, Stride: 1}, + {Lo: 0x1F3FB, Hi: 0x1F3FF, Stride: 1}, + {Lo: 0xE0020, Hi: 0xE007F, Stride: 1}, + {Lo: 0xE0100, Hi: 0xE01EF, Stride: 1}, + }, +} + +var unicodeAliasWord_Break_ExtendNumLet = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x5F, Hi: 0x5F, Stride: 1}, + {Lo: 0x202F, Hi: 0x202F, Stride: 1}, + {Lo: 0x203F, Hi: 0x2040, Stride: 1}, + {Lo: 0x2054, Hi: 0x2054, Stride: 1}, + {Lo: 0xFE33, Hi: 0xFE34, Stride: 1}, + {Lo: 0xFE4D, Hi: 0xFE4F, Stride: 1}, + {Lo: 0xFF3F, Hi: 0xFF3F, Stride: 1}, + }, +} + +var unicodeAliasWord_Break_Format = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0xAD, Hi: 0xAD, Stride: 1}, + {Lo: 0x61C, Hi: 0x61C, Stride: 1}, + {Lo: 0x180E, Hi: 0x180E, Stride: 1}, + {Lo: 0x200E, Hi: 0x200F, Stride: 1}, + {Lo: 0x202A, Hi: 0x202E, Stride: 1}, + {Lo: 0x2060, Hi: 0x2064, Stride: 1}, + {Lo: 0x2066, Hi: 0x206F, Stride: 1}, + {Lo: 0xFEFF, Hi: 0xFEFF, Stride: 1}, + {Lo: 0xFFF9, Hi: 0xFFFB, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x13430, Hi: 0x1343F, Stride: 1}, + {Lo: 0x1BCA0, Hi: 0x1BCA3, Stride: 1}, + {Lo: 0x1D173, Hi: 0x1D17A, Stride: 1}, + {Lo: 0xE0001, Hi: 0xE0001, Stride: 1}, + }, +} + +var unicodeAliasWord_Break_Hebrew_Letter = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x5D0, Hi: 0x5EA, Stride: 1}, + {Lo: 0x5EF, Hi: 0x5F2, Stride: 1}, + {Lo: 0xFB1D, Hi: 0xFB1D, Stride: 1}, + {Lo: 0xFB1F, Hi: 0xFB28, Stride: 1}, + {Lo: 0xFB2A, Hi: 0xFB36, Stride: 1}, + {Lo: 0xFB38, Hi: 0xFB3C, Stride: 1}, + {Lo: 0xFB3E, Hi: 0xFB3E, Stride: 1}, + {Lo: 0xFB40, Hi: 0xFB41, Stride: 1}, + {Lo: 0xFB43, Hi: 0xFB44, Stride: 1}, + {Lo: 0xFB46, Hi: 0xFB4F, Stride: 1}, + }, +} + +var unicodeAliasWord_Break_Katakana = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x3031, Hi: 0x3035, Stride: 1}, + {Lo: 0x309B, Hi: 0x309C, Stride: 1}, + {Lo: 0x30A0, Hi: 0x30FA, Stride: 1}, + {Lo: 0x30FC, Hi: 0x30FF, Stride: 1}, + {Lo: 0x31F0, Hi: 0x31FF, Stride: 1}, + {Lo: 0x32D0, Hi: 0x32FE, Stride: 1}, + {Lo: 0x3300, Hi: 0x3357, Stride: 1}, + {Lo: 0xFF66, Hi: 0xFF9D, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x1AFF0, Hi: 0x1AFF3, Stride: 1}, + {Lo: 0x1AFF5, Hi: 0x1AFFB, Stride: 1}, + {Lo: 0x1AFFD, Hi: 0x1AFFE, Stride: 1}, + {Lo: 0x1B000, Hi: 0x1B000, Stride: 1}, + {Lo: 0x1B120, Hi: 0x1B122, Stride: 1}, + {Lo: 0x1B155, Hi: 0x1B155, Stride: 1}, + {Lo: 0x1B164, Hi: 0x1B167, Stride: 1}, + }, +} + +var unicodeAliasWord_Break_LF = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0xA, Hi: 0xA, Stride: 1}, + }, +} + +var unicodeAliasWord_Break_MidLetter = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x3A, Hi: 0x3A, Stride: 1}, + {Lo: 0xB7, Hi: 0xB7, Stride: 1}, + {Lo: 0x387, Hi: 0x387, Stride: 1}, + {Lo: 0x55F, Hi: 0x55F, Stride: 1}, + {Lo: 0x5F4, Hi: 0x5F4, Stride: 1}, + {Lo: 0x2027, Hi: 0x2027, Stride: 1}, + {Lo: 0xFE13, Hi: 0xFE13, Stride: 1}, + {Lo: 0xFE55, Hi: 0xFE55, Stride: 1}, + {Lo: 0xFF1A, Hi: 0xFF1A, Stride: 1}, + }, +} + +var unicodeAliasWord_Break_MidNum = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x2C, Hi: 0x2C, Stride: 1}, + {Lo: 0x3B, Hi: 0x3B, Stride: 1}, + {Lo: 0x37E, Hi: 0x37E, Stride: 1}, + {Lo: 0x589, Hi: 0x589, Stride: 1}, + {Lo: 0x60C, Hi: 0x60D, Stride: 1}, + {Lo: 0x66C, Hi: 0x66C, Stride: 1}, + {Lo: 0x7F8, Hi: 0x7F8, Stride: 1}, + {Lo: 0x2044, Hi: 0x2044, Stride: 1}, + {Lo: 0xFE50, Hi: 0xFE50, Stride: 1}, + {Lo: 0xFE54, Hi: 0xFE54, Stride: 1}, + {Lo: 0xFF0C, Hi: 0xFF0C, Stride: 1}, + {Lo: 0xFF1B, Hi: 0xFF1B, Stride: 1}, + }, +} + +var unicodeAliasWord_Break_MidNumLet = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x2E, Hi: 0x2E, Stride: 1}, + {Lo: 0x2018, Hi: 0x2019, Stride: 1}, + {Lo: 0x2024, Hi: 0x2024, Stride: 1}, + {Lo: 0xFE52, Hi: 0xFE52, Stride: 1}, + {Lo: 0xFF07, Hi: 0xFF07, Stride: 1}, + {Lo: 0xFF0E, Hi: 0xFF0E, Stride: 1}, + }, +} + +var unicodeAliasWord_Break_Newline = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0xB, Hi: 0xC, Stride: 1}, + {Lo: 0x85, Hi: 0x85, Stride: 1}, + {Lo: 0x2028, Hi: 0x2029, Stride: 1}, + }, +} + +var unicodeAliasWord_Break_Numeric = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x30, Hi: 0x39, Stride: 1}, + {Lo: 0x600, Hi: 0x605, Stride: 1}, + {Lo: 0x660, Hi: 0x669, Stride: 1}, + {Lo: 0x66B, Hi: 0x66B, Stride: 1}, + {Lo: 0x6DD, Hi: 0x6DD, Stride: 1}, + {Lo: 0x6F0, Hi: 0x6F9, Stride: 1}, + {Lo: 0x7C0, Hi: 0x7C9, Stride: 1}, + {Lo: 0x890, Hi: 0x891, Stride: 1}, + {Lo: 0x8E2, Hi: 0x8E2, Stride: 1}, + {Lo: 0x966, Hi: 0x96F, Stride: 1}, + {Lo: 0x9E6, Hi: 0x9EF, Stride: 1}, + {Lo: 0xA66, Hi: 0xA6F, Stride: 1}, + {Lo: 0xAE6, Hi: 0xAEF, Stride: 1}, + {Lo: 0xB66, Hi: 0xB6F, Stride: 1}, + {Lo: 0xBE6, Hi: 0xBEF, Stride: 1}, + {Lo: 0xC66, Hi: 0xC6F, Stride: 1}, + {Lo: 0xCE6, Hi: 0xCEF, Stride: 1}, + {Lo: 0xD66, Hi: 0xD6F, Stride: 1}, + {Lo: 0xDE6, Hi: 0xDEF, Stride: 1}, + {Lo: 0xE50, Hi: 0xE59, Stride: 1}, + {Lo: 0xED0, Hi: 0xED9, Stride: 1}, + {Lo: 0xF20, Hi: 0xF29, Stride: 1}, + {Lo: 0x1040, Hi: 0x1049, Stride: 1}, + {Lo: 0x1090, Hi: 0x1099, Stride: 1}, + {Lo: 0x17E0, Hi: 0x17E9, Stride: 1}, + {Lo: 0x1810, Hi: 0x1819, Stride: 1}, + {Lo: 0x1946, Hi: 0x194F, Stride: 1}, + {Lo: 0x19D0, Hi: 0x19DA, Stride: 1}, + {Lo: 0x1A80, Hi: 0x1A89, Stride: 1}, + {Lo: 0x1A90, Hi: 0x1A99, Stride: 1}, + {Lo: 0x1B50, Hi: 0x1B59, Stride: 1}, + {Lo: 0x1BB0, Hi: 0x1BB9, Stride: 1}, + {Lo: 0x1C40, Hi: 0x1C49, Stride: 1}, + {Lo: 0x1C50, Hi: 0x1C59, Stride: 1}, + {Lo: 0xA620, Hi: 0xA629, Stride: 1}, + {Lo: 0xA8D0, Hi: 0xA8D9, Stride: 1}, + {Lo: 0xA900, Hi: 0xA909, Stride: 1}, + {Lo: 0xA9D0, Hi: 0xA9D9, Stride: 1}, + {Lo: 0xA9F0, Hi: 0xA9F9, Stride: 1}, + {Lo: 0xAA50, Hi: 0xAA59, Stride: 1}, + {Lo: 0xABF0, Hi: 0xABF9, Stride: 1}, + {Lo: 0xFF10, Hi: 0xFF19, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x104A0, Hi: 0x104A9, Stride: 1}, + {Lo: 0x10D30, Hi: 0x10D39, Stride: 1}, + {Lo: 0x10D40, Hi: 0x10D49, Stride: 1}, + {Lo: 0x11066, Hi: 0x1106F, Stride: 1}, + {Lo: 0x110BD, Hi: 0x110BD, Stride: 1}, + {Lo: 0x110CD, Hi: 0x110CD, Stride: 1}, + {Lo: 0x110F0, Hi: 0x110F9, Stride: 1}, + {Lo: 0x11136, Hi: 0x1113F, Stride: 1}, + {Lo: 0x111D0, Hi: 0x111D9, Stride: 1}, + {Lo: 0x112F0, Hi: 0x112F9, Stride: 1}, + {Lo: 0x11450, Hi: 0x11459, Stride: 1}, + {Lo: 0x114D0, Hi: 0x114D9, Stride: 1}, + {Lo: 0x11650, Hi: 0x11659, Stride: 1}, + {Lo: 0x116C0, Hi: 0x116C9, Stride: 1}, + {Lo: 0x116D0, Hi: 0x116E3, Stride: 1}, + {Lo: 0x11730, Hi: 0x11739, Stride: 1}, + {Lo: 0x118E0, Hi: 0x118E9, Stride: 1}, + {Lo: 0x11950, Hi: 0x11959, Stride: 1}, + {Lo: 0x11BF0, Hi: 0x11BF9, Stride: 1}, + {Lo: 0x11C50, Hi: 0x11C59, Stride: 1}, + {Lo: 0x11D50, Hi: 0x11D59, Stride: 1}, + {Lo: 0x11DA0, Hi: 0x11DA9, Stride: 1}, + {Lo: 0x11DE0, Hi: 0x11DE9, Stride: 1}, + {Lo: 0x11F50, Hi: 0x11F59, Stride: 1}, + {Lo: 0x16130, Hi: 0x16139, Stride: 1}, + {Lo: 0x16A60, Hi: 0x16A69, Stride: 1}, + {Lo: 0x16AC0, Hi: 0x16AC9, Stride: 1}, + {Lo: 0x16B50, Hi: 0x16B59, Stride: 1}, + {Lo: 0x16D70, Hi: 0x16D79, Stride: 1}, + {Lo: 0x1CCF0, Hi: 0x1CCF9, Stride: 1}, + {Lo: 0x1D7CE, Hi: 0x1D7FF, Stride: 1}, + {Lo: 0x1E140, Hi: 0x1E149, Stride: 1}, + {Lo: 0x1E2F0, Hi: 0x1E2F9, Stride: 1}, + {Lo: 0x1E4F0, Hi: 0x1E4F9, Stride: 1}, + {Lo: 0x1E5F1, Hi: 0x1E5FA, Stride: 1}, + {Lo: 0x1E950, Hi: 0x1E959, Stride: 1}, + {Lo: 0x1FBF0, Hi: 0x1FBF9, Stride: 1}, + }, +} + +var unicodeAliasWord_Break_Regional_Indicator = &unicode.RangeTable{ + R32: []unicode.Range32{ + {Lo: 0x1F1E6, Hi: 0x1F1FF, Stride: 1}, + }, +} + +var unicodeAliasWord_Break_Single_Quote = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x27, Hi: 0x27, Stride: 1}, + }, +} + +var unicodeAliasWord_Break_WSegSpace = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x20, Hi: 0x20, Stride: 1}, + {Lo: 0x1680, Hi: 0x1680, Stride: 1}, + {Lo: 0x2000, Hi: 0x2006, Stride: 1}, + {Lo: 0x2008, Hi: 0x200A, Stride: 1}, + {Lo: 0x205F, Hi: 0x205F, Stride: 1}, + {Lo: 0x3000, Hi: 0x3000, Stride: 1}, + }, +} + +var unicodeAliasWord_Break_ZWJ = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x200D, Hi: 0x200D, Stride: 1}, + }, +} + +var unicodeAliasIndic_Conjunct_Break_Consonant = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x915, Hi: 0x939, Stride: 1}, + {Lo: 0x958, Hi: 0x95F, Stride: 1}, + {Lo: 0x978, Hi: 0x97F, Stride: 1}, + {Lo: 0x995, Hi: 0x9A8, Stride: 1}, + {Lo: 0x9AA, Hi: 0x9B0, Stride: 1}, + {Lo: 0x9B2, Hi: 0x9B2, Stride: 1}, + {Lo: 0x9B6, Hi: 0x9B9, Stride: 1}, + {Lo: 0x9DC, Hi: 0x9DD, Stride: 1}, + {Lo: 0x9DF, Hi: 0x9DF, Stride: 1}, + {Lo: 0x9F0, Hi: 0x9F1, Stride: 1}, + {Lo: 0xA95, Hi: 0xAA8, Stride: 1}, + {Lo: 0xAAA, Hi: 0xAB0, Stride: 1}, + {Lo: 0xAB2, Hi: 0xAB3, Stride: 1}, + {Lo: 0xAB5, Hi: 0xAB9, Stride: 1}, + {Lo: 0xAF9, Hi: 0xAF9, Stride: 1}, + {Lo: 0xB15, Hi: 0xB28, Stride: 1}, + {Lo: 0xB2A, Hi: 0xB30, Stride: 1}, + {Lo: 0xB32, Hi: 0xB33, Stride: 1}, + {Lo: 0xB35, Hi: 0xB39, Stride: 1}, + {Lo: 0xB5C, Hi: 0xB5D, Stride: 1}, + {Lo: 0xB5F, Hi: 0xB5F, Stride: 1}, + {Lo: 0xB71, Hi: 0xB71, Stride: 1}, + {Lo: 0xC15, Hi: 0xC28, Stride: 1}, + {Lo: 0xC2A, Hi: 0xC39, Stride: 1}, + {Lo: 0xC58, Hi: 0xC5A, Stride: 1}, + {Lo: 0xD15, Hi: 0xD3A, Stride: 1}, + {Lo: 0x1000, Hi: 0x102A, Stride: 1}, + {Lo: 0x103F, Hi: 0x103F, Stride: 1}, + {Lo: 0x1050, Hi: 0x1055, Stride: 1}, + {Lo: 0x105A, Hi: 0x105D, Stride: 1}, + {Lo: 0x1061, Hi: 0x1061, Stride: 1}, + {Lo: 0x1065, Hi: 0x1066, Stride: 1}, + {Lo: 0x106E, Hi: 0x1070, Stride: 1}, + {Lo: 0x1075, Hi: 0x1081, Stride: 1}, + {Lo: 0x108E, Hi: 0x108E, Stride: 1}, + {Lo: 0x1780, Hi: 0x17B3, Stride: 1}, + {Lo: 0x1A20, Hi: 0x1A54, Stride: 1}, + {Lo: 0x1B0B, Hi: 0x1B0C, Stride: 1}, + {Lo: 0x1B13, Hi: 0x1B33, Stride: 1}, + {Lo: 0x1B45, Hi: 0x1B4C, Stride: 1}, + {Lo: 0x1B83, Hi: 0x1BA0, Stride: 1}, + {Lo: 0x1BAE, Hi: 0x1BAF, Stride: 1}, + {Lo: 0x1BBB, Hi: 0x1BBD, Stride: 1}, + {Lo: 0xA989, Hi: 0xA98B, Stride: 1}, + {Lo: 0xA98F, Hi: 0xA9B2, Stride: 1}, + {Lo: 0xA9E0, Hi: 0xA9E4, Stride: 1}, + {Lo: 0xA9E7, Hi: 0xA9EF, Stride: 1}, + {Lo: 0xA9FA, Hi: 0xA9FE, Stride: 1}, + {Lo: 0xAA60, Hi: 0xAA6F, Stride: 1}, + {Lo: 0xAA71, Hi: 0xAA73, Stride: 1}, + {Lo: 0xAA7A, Hi: 0xAA7A, Stride: 1}, + {Lo: 0xAA7E, Hi: 0xAA7F, Stride: 1}, + {Lo: 0xAAE0, Hi: 0xAAEA, Stride: 1}, + {Lo: 0xABC0, Hi: 0xABDA, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x10A00, Hi: 0x10A00, Stride: 1}, + {Lo: 0x10A10, Hi: 0x10A13, Stride: 1}, + {Lo: 0x10A15, Hi: 0x10A17, Stride: 1}, + {Lo: 0x10A19, Hi: 0x10A35, Stride: 1}, + {Lo: 0x11103, Hi: 0x11126, Stride: 1}, + {Lo: 0x11144, Hi: 0x11144, Stride: 1}, + {Lo: 0x11147, Hi: 0x11147, Stride: 1}, + {Lo: 0x11380, Hi: 0x11389, Stride: 1}, + {Lo: 0x1138B, Hi: 0x1138B, Stride: 1}, + {Lo: 0x1138E, Hi: 0x1138E, Stride: 1}, + {Lo: 0x11390, Hi: 0x113B5, Stride: 1}, + {Lo: 0x11900, Hi: 0x11906, Stride: 1}, + {Lo: 0x11909, Hi: 0x11909, Stride: 1}, + {Lo: 0x1190C, Hi: 0x11913, Stride: 1}, + {Lo: 0x11915, Hi: 0x11916, Stride: 1}, + {Lo: 0x11918, Hi: 0x1192F, Stride: 1}, + {Lo: 0x11A00, Hi: 0x11A00, Stride: 1}, + {Lo: 0x11A0B, Hi: 0x11A32, Stride: 1}, + {Lo: 0x11A50, Hi: 0x11A50, Stride: 1}, + {Lo: 0x11A5C, Hi: 0x11A83, Stride: 1}, + {Lo: 0x11F04, Hi: 0x11F10, Stride: 1}, + {Lo: 0x11F12, Hi: 0x11F33, Stride: 1}, + }, +} + +var unicodeAliasIndic_Conjunct_Break_Extend = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x300, Hi: 0x36F, Stride: 1}, + {Lo: 0x483, Hi: 0x487, Stride: 1}, + {Lo: 0x488, Hi: 0x489, Stride: 1}, + {Lo: 0x591, Hi: 0x5BD, Stride: 1}, + {Lo: 0x5BF, Hi: 0x5BF, Stride: 1}, + {Lo: 0x5C1, Hi: 0x5C2, Stride: 1}, + {Lo: 0x5C4, Hi: 0x5C5, Stride: 1}, + {Lo: 0x5C7, Hi: 0x5C7, Stride: 1}, + {Lo: 0x610, Hi: 0x61A, Stride: 1}, + {Lo: 0x64B, Hi: 0x65F, Stride: 1}, + {Lo: 0x670, Hi: 0x670, Stride: 1}, + {Lo: 0x6D6, Hi: 0x6DC, Stride: 1}, + {Lo: 0x6DF, Hi: 0x6E4, Stride: 1}, + {Lo: 0x6E7, Hi: 0x6E8, Stride: 1}, + {Lo: 0x6EA, Hi: 0x6ED, Stride: 1}, + {Lo: 0x711, Hi: 0x711, Stride: 1}, + {Lo: 0x730, Hi: 0x74A, Stride: 1}, + {Lo: 0x7A6, Hi: 0x7B0, Stride: 1}, + {Lo: 0x7EB, Hi: 0x7F3, Stride: 1}, + {Lo: 0x7FD, Hi: 0x7FD, Stride: 1}, + {Lo: 0x816, Hi: 0x819, Stride: 1}, + {Lo: 0x81B, Hi: 0x823, Stride: 1}, + {Lo: 0x825, Hi: 0x827, Stride: 1}, + {Lo: 0x829, Hi: 0x82D, Stride: 1}, + {Lo: 0x859, Hi: 0x85B, Stride: 1}, + {Lo: 0x897, Hi: 0x89F, Stride: 1}, + {Lo: 0x8CA, Hi: 0x8E1, Stride: 1}, + {Lo: 0x8E3, Hi: 0x902, Stride: 1}, + {Lo: 0x93A, Hi: 0x93A, Stride: 1}, + {Lo: 0x93C, Hi: 0x93C, Stride: 1}, + {Lo: 0x941, Hi: 0x948, Stride: 1}, + {Lo: 0x951, Hi: 0x957, Stride: 1}, + {Lo: 0x962, Hi: 0x963, Stride: 1}, + {Lo: 0x981, Hi: 0x981, Stride: 1}, + {Lo: 0x9BC, Hi: 0x9BC, Stride: 1}, + {Lo: 0x9BE, Hi: 0x9BE, Stride: 1}, + {Lo: 0x9C1, Hi: 0x9C4, Stride: 1}, + {Lo: 0x9D7, Hi: 0x9D7, Stride: 1}, + {Lo: 0x9E2, Hi: 0x9E3, Stride: 1}, + {Lo: 0x9FE, Hi: 0x9FE, Stride: 1}, + {Lo: 0xA01, Hi: 0xA02, Stride: 1}, + {Lo: 0xA3C, Hi: 0xA3C, Stride: 1}, + {Lo: 0xA41, Hi: 0xA42, Stride: 1}, + {Lo: 0xA47, Hi: 0xA48, Stride: 1}, + {Lo: 0xA4B, Hi: 0xA4D, Stride: 1}, + {Lo: 0xA51, Hi: 0xA51, Stride: 1}, + {Lo: 0xA70, Hi: 0xA71, Stride: 1}, + {Lo: 0xA75, Hi: 0xA75, Stride: 1}, + {Lo: 0xA81, Hi: 0xA82, Stride: 1}, + {Lo: 0xABC, Hi: 0xABC, Stride: 1}, + {Lo: 0xAC1, Hi: 0xAC5, Stride: 1}, + {Lo: 0xAC7, Hi: 0xAC8, Stride: 1}, + {Lo: 0xAE2, Hi: 0xAE3, Stride: 1}, + {Lo: 0xAFA, Hi: 0xAFF, Stride: 1}, + {Lo: 0xB01, Hi: 0xB01, Stride: 1}, + {Lo: 0xB3C, Hi: 0xB3C, Stride: 1}, + {Lo: 0xB3E, Hi: 0xB3E, Stride: 1}, + {Lo: 0xB3F, Hi: 0xB3F, Stride: 1}, + {Lo: 0xB41, Hi: 0xB44, Stride: 1}, + {Lo: 0xB55, Hi: 0xB56, Stride: 1}, + {Lo: 0xB57, Hi: 0xB57, Stride: 1}, + {Lo: 0xB62, Hi: 0xB63, Stride: 1}, + {Lo: 0xB82, Hi: 0xB82, Stride: 1}, + {Lo: 0xBBE, Hi: 0xBBE, Stride: 1}, + {Lo: 0xBC0, Hi: 0xBC0, Stride: 1}, + {Lo: 0xBCD, Hi: 0xBCD, Stride: 1}, + {Lo: 0xBD7, Hi: 0xBD7, Stride: 1}, + {Lo: 0xC00, Hi: 0xC00, Stride: 1}, + {Lo: 0xC04, Hi: 0xC04, Stride: 1}, + {Lo: 0xC3C, Hi: 0xC3C, Stride: 1}, + {Lo: 0xC3E, Hi: 0xC40, Stride: 1}, + {Lo: 0xC46, Hi: 0xC48, Stride: 1}, + {Lo: 0xC4A, Hi: 0xC4C, Stride: 1}, + {Lo: 0xC55, Hi: 0xC56, Stride: 1}, + {Lo: 0xC62, Hi: 0xC63, Stride: 1}, + {Lo: 0xC81, Hi: 0xC81, Stride: 1}, + {Lo: 0xCBC, Hi: 0xCBC, Stride: 1}, + {Lo: 0xCBF, Hi: 0xCBF, Stride: 1}, + {Lo: 0xCC0, Hi: 0xCC0, Stride: 1}, + {Lo: 0xCC2, Hi: 0xCC2, Stride: 1}, + {Lo: 0xCC6, Hi: 0xCC6, Stride: 1}, + {Lo: 0xCC7, Hi: 0xCC8, Stride: 1}, + {Lo: 0xCCA, Hi: 0xCCB, Stride: 1}, + {Lo: 0xCCC, Hi: 0xCCD, Stride: 1}, + {Lo: 0xCD5, Hi: 0xCD6, Stride: 1}, + {Lo: 0xCE2, Hi: 0xCE3, Stride: 1}, + {Lo: 0xD00, Hi: 0xD01, Stride: 1}, + {Lo: 0xD3B, Hi: 0xD3C, Stride: 1}, + {Lo: 0xD3E, Hi: 0xD3E, Stride: 1}, + {Lo: 0xD41, Hi: 0xD44, Stride: 1}, + {Lo: 0xD57, Hi: 0xD57, Stride: 1}, + {Lo: 0xD62, Hi: 0xD63, Stride: 1}, + {Lo: 0xD81, Hi: 0xD81, Stride: 1}, + {Lo: 0xDCA, Hi: 0xDCA, Stride: 1}, + {Lo: 0xDCF, Hi: 0xDCF, Stride: 1}, + {Lo: 0xDD2, Hi: 0xDD4, Stride: 1}, + {Lo: 0xDD6, Hi: 0xDD6, Stride: 1}, + {Lo: 0xDDF, Hi: 0xDDF, Stride: 1}, + {Lo: 0xE31, Hi: 0xE31, Stride: 1}, + {Lo: 0xE34, Hi: 0xE3A, Stride: 1}, + {Lo: 0xE47, Hi: 0xE4E, Stride: 1}, + {Lo: 0xEB1, Hi: 0xEB1, Stride: 1}, + {Lo: 0xEB4, Hi: 0xEBC, Stride: 1}, + {Lo: 0xEC8, Hi: 0xECE, Stride: 1}, + {Lo: 0xF18, Hi: 0xF19, Stride: 1}, + {Lo: 0xF35, Hi: 0xF35, Stride: 1}, + {Lo: 0xF37, Hi: 0xF37, Stride: 1}, + {Lo: 0xF39, Hi: 0xF39, Stride: 1}, + {Lo: 0xF71, Hi: 0xF7E, Stride: 1}, + {Lo: 0xF80, Hi: 0xF84, Stride: 1}, + {Lo: 0xF86, Hi: 0xF87, Stride: 1}, + {Lo: 0xF8D, Hi: 0xF97, Stride: 1}, + {Lo: 0xF99, Hi: 0xFBC, Stride: 1}, + {Lo: 0xFC6, Hi: 0xFC6, Stride: 1}, + {Lo: 0x102D, Hi: 0x1030, Stride: 1}, + {Lo: 0x1032, Hi: 0x1037, Stride: 1}, + {Lo: 0x103A, Hi: 0x103A, Stride: 1}, + {Lo: 0x103D, Hi: 0x103E, Stride: 1}, + {Lo: 0x1058, Hi: 0x1059, Stride: 1}, + {Lo: 0x105E, Hi: 0x1060, Stride: 1}, + {Lo: 0x1071, Hi: 0x1074, Stride: 1}, + {Lo: 0x1082, Hi: 0x1082, Stride: 1}, + {Lo: 0x1085, Hi: 0x1086, Stride: 1}, + {Lo: 0x108D, Hi: 0x108D, Stride: 1}, + {Lo: 0x109D, Hi: 0x109D, Stride: 1}, + {Lo: 0x135D, Hi: 0x135F, Stride: 1}, + {Lo: 0x1712, Hi: 0x1714, Stride: 1}, + {Lo: 0x1715, Hi: 0x1715, Stride: 1}, + {Lo: 0x1732, Hi: 0x1733, Stride: 1}, + {Lo: 0x1734, Hi: 0x1734, Stride: 1}, + {Lo: 0x1752, Hi: 0x1753, Stride: 1}, + {Lo: 0x1772, Hi: 0x1773, Stride: 1}, + {Lo: 0x17B4, Hi: 0x17B5, Stride: 1}, + {Lo: 0x17B7, Hi: 0x17BD, Stride: 1}, + {Lo: 0x17C6, Hi: 0x17C6, Stride: 1}, + {Lo: 0x17C9, Hi: 0x17D1, Stride: 1}, + {Lo: 0x17D3, Hi: 0x17D3, Stride: 1}, + {Lo: 0x17DD, Hi: 0x17DD, Stride: 1}, + {Lo: 0x180B, Hi: 0x180D, Stride: 1}, + {Lo: 0x180F, Hi: 0x180F, Stride: 1}, + {Lo: 0x1885, Hi: 0x1886, Stride: 1}, + {Lo: 0x18A9, Hi: 0x18A9, Stride: 1}, + {Lo: 0x1920, Hi: 0x1922, Stride: 1}, + {Lo: 0x1927, Hi: 0x1928, Stride: 1}, + {Lo: 0x1932, Hi: 0x1932, Stride: 1}, + {Lo: 0x1939, Hi: 0x193B, Stride: 1}, + {Lo: 0x1A17, Hi: 0x1A18, Stride: 1}, + {Lo: 0x1A1B, Hi: 0x1A1B, Stride: 1}, + {Lo: 0x1A56, Hi: 0x1A56, Stride: 1}, + {Lo: 0x1A58, Hi: 0x1A5E, Stride: 1}, + {Lo: 0x1A62, Hi: 0x1A62, Stride: 1}, + {Lo: 0x1A65, Hi: 0x1A6C, Stride: 1}, + {Lo: 0x1A73, Hi: 0x1A7C, Stride: 1}, + {Lo: 0x1A7F, Hi: 0x1A7F, Stride: 1}, + {Lo: 0x1AB0, Hi: 0x1ABD, Stride: 1}, + {Lo: 0x1ABE, Hi: 0x1ABE, Stride: 1}, + {Lo: 0x1ABF, Hi: 0x1ADD, Stride: 1}, + {Lo: 0x1AE0, Hi: 0x1AEB, Stride: 1}, + {Lo: 0x1B00, Hi: 0x1B03, Stride: 1}, + {Lo: 0x1B34, Hi: 0x1B34, Stride: 1}, + {Lo: 0x1B35, Hi: 0x1B35, Stride: 1}, + {Lo: 0x1B36, Hi: 0x1B3A, Stride: 1}, + {Lo: 0x1B3B, Hi: 0x1B3B, Stride: 1}, + {Lo: 0x1B3C, Hi: 0x1B3C, Stride: 1}, + {Lo: 0x1B3D, Hi: 0x1B3D, Stride: 1}, + {Lo: 0x1B42, Hi: 0x1B42, Stride: 1}, + {Lo: 0x1B43, Hi: 0x1B43, Stride: 1}, + {Lo: 0x1B6B, Hi: 0x1B73, Stride: 1}, + {Lo: 0x1B80, Hi: 0x1B81, Stride: 1}, + {Lo: 0x1BA2, Hi: 0x1BA5, Stride: 1}, + {Lo: 0x1BA8, Hi: 0x1BA9, Stride: 1}, + {Lo: 0x1BAA, Hi: 0x1BAA, Stride: 1}, + {Lo: 0x1BAC, Hi: 0x1BAD, Stride: 1}, + {Lo: 0x1BE6, Hi: 0x1BE6, Stride: 1}, + {Lo: 0x1BE8, Hi: 0x1BE9, Stride: 1}, + {Lo: 0x1BED, Hi: 0x1BED, Stride: 1}, + {Lo: 0x1BEF, Hi: 0x1BF1, Stride: 1}, + {Lo: 0x1BF2, Hi: 0x1BF3, Stride: 1}, + {Lo: 0x1C2C, Hi: 0x1C33, Stride: 1}, + {Lo: 0x1C36, Hi: 0x1C37, Stride: 1}, + {Lo: 0x1CD0, Hi: 0x1CD2, Stride: 1}, + {Lo: 0x1CD4, Hi: 0x1CE0, Stride: 1}, + {Lo: 0x1CE2, Hi: 0x1CE8, Stride: 1}, + {Lo: 0x1CED, Hi: 0x1CED, Stride: 1}, + {Lo: 0x1CF4, Hi: 0x1CF4, Stride: 1}, + {Lo: 0x1CF8, Hi: 0x1CF9, Stride: 1}, + {Lo: 0x1DC0, Hi: 0x1DFF, Stride: 1}, + {Lo: 0x200D, Hi: 0x200D, Stride: 1}, + {Lo: 0x20D0, Hi: 0x20DC, Stride: 1}, + {Lo: 0x20DD, Hi: 0x20E0, Stride: 1}, + {Lo: 0x20E1, Hi: 0x20E1, Stride: 1}, + {Lo: 0x20E2, Hi: 0x20E4, Stride: 1}, + {Lo: 0x20E5, Hi: 0x20F0, Stride: 1}, + {Lo: 0x2CEF, Hi: 0x2CF1, Stride: 1}, + {Lo: 0x2D7F, Hi: 0x2D7F, Stride: 1}, + {Lo: 0x2DE0, Hi: 0x2DFF, Stride: 1}, + {Lo: 0x302A, Hi: 0x302D, Stride: 1}, + {Lo: 0x302E, Hi: 0x302F, Stride: 1}, + {Lo: 0x3099, Hi: 0x309A, Stride: 1}, + {Lo: 0xA66F, Hi: 0xA66F, Stride: 1}, + {Lo: 0xA670, Hi: 0xA672, Stride: 1}, + {Lo: 0xA674, Hi: 0xA67D, Stride: 1}, + {Lo: 0xA69E, Hi: 0xA69F, Stride: 1}, + {Lo: 0xA6F0, Hi: 0xA6F1, Stride: 1}, + {Lo: 0xA802, Hi: 0xA802, Stride: 1}, + {Lo: 0xA806, Hi: 0xA806, Stride: 1}, + {Lo: 0xA80B, Hi: 0xA80B, Stride: 1}, + {Lo: 0xA825, Hi: 0xA826, Stride: 1}, + {Lo: 0xA82C, Hi: 0xA82C, Stride: 1}, + {Lo: 0xA8C4, Hi: 0xA8C5, Stride: 1}, + {Lo: 0xA8E0, Hi: 0xA8F1, Stride: 1}, + {Lo: 0xA8FF, Hi: 0xA8FF, Stride: 1}, + {Lo: 0xA926, Hi: 0xA92D, Stride: 1}, + {Lo: 0xA947, Hi: 0xA951, Stride: 1}, + {Lo: 0xA953, Hi: 0xA953, Stride: 1}, + {Lo: 0xA980, Hi: 0xA982, Stride: 1}, + {Lo: 0xA9B3, Hi: 0xA9B3, Stride: 1}, + {Lo: 0xA9B6, Hi: 0xA9B9, Stride: 1}, + {Lo: 0xA9BC, Hi: 0xA9BD, Stride: 1}, + {Lo: 0xA9E5, Hi: 0xA9E5, Stride: 1}, + {Lo: 0xAA29, Hi: 0xAA2E, Stride: 1}, + {Lo: 0xAA31, Hi: 0xAA32, Stride: 1}, + {Lo: 0xAA35, Hi: 0xAA36, Stride: 1}, + {Lo: 0xAA43, Hi: 0xAA43, Stride: 1}, + {Lo: 0xAA4C, Hi: 0xAA4C, Stride: 1}, + {Lo: 0xAA7C, Hi: 0xAA7C, Stride: 1}, + {Lo: 0xAAB0, Hi: 0xAAB0, Stride: 1}, + {Lo: 0xAAB2, Hi: 0xAAB4, Stride: 1}, + {Lo: 0xAAB7, Hi: 0xAAB8, Stride: 1}, + {Lo: 0xAABE, Hi: 0xAABF, Stride: 1}, + {Lo: 0xAAC1, Hi: 0xAAC1, Stride: 1}, + {Lo: 0xAAEC, Hi: 0xAAED, Stride: 1}, + {Lo: 0xABE5, Hi: 0xABE5, Stride: 1}, + {Lo: 0xABE8, Hi: 0xABE8, Stride: 1}, + {Lo: 0xABED, Hi: 0xABED, Stride: 1}, + {Lo: 0xFB1E, Hi: 0xFB1E, Stride: 1}, + {Lo: 0xFE00, Hi: 0xFE0F, Stride: 1}, + {Lo: 0xFE20, Hi: 0xFE2F, Stride: 1}, + {Lo: 0xFF9E, Hi: 0xFF9F, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x101FD, Hi: 0x101FD, Stride: 1}, + {Lo: 0x102E0, Hi: 0x102E0, Stride: 1}, + {Lo: 0x10376, Hi: 0x1037A, Stride: 1}, + {Lo: 0x10A01, Hi: 0x10A03, Stride: 1}, + {Lo: 0x10A05, Hi: 0x10A06, Stride: 1}, + {Lo: 0x10A0C, Hi: 0x10A0F, Stride: 1}, + {Lo: 0x10A38, Hi: 0x10A3A, Stride: 1}, + {Lo: 0x10AE5, Hi: 0x10AE6, Stride: 1}, + {Lo: 0x10D24, Hi: 0x10D27, Stride: 1}, + {Lo: 0x10D69, Hi: 0x10D6D, Stride: 1}, + {Lo: 0x10EAB, Hi: 0x10EAC, Stride: 1}, + {Lo: 0x10EFA, Hi: 0x10EFF, Stride: 1}, + {Lo: 0x10F46, Hi: 0x10F50, Stride: 1}, + {Lo: 0x10F82, Hi: 0x10F85, Stride: 1}, + {Lo: 0x11001, Hi: 0x11001, Stride: 1}, + {Lo: 0x11038, Hi: 0x11046, Stride: 1}, + {Lo: 0x11070, Hi: 0x11070, Stride: 1}, + {Lo: 0x11073, Hi: 0x11074, Stride: 1}, + {Lo: 0x1107F, Hi: 0x11081, Stride: 1}, + {Lo: 0x110B3, Hi: 0x110B6, Stride: 1}, + {Lo: 0x110B9, Hi: 0x110BA, Stride: 1}, + {Lo: 0x110C2, Hi: 0x110C2, Stride: 1}, + {Lo: 0x11100, Hi: 0x11102, Stride: 1}, + {Lo: 0x11127, Hi: 0x1112B, Stride: 1}, + {Lo: 0x1112D, Hi: 0x11132, Stride: 1}, + {Lo: 0x11134, Hi: 0x11134, Stride: 1}, + {Lo: 0x11173, Hi: 0x11173, Stride: 1}, + {Lo: 0x11180, Hi: 0x11181, Stride: 1}, + {Lo: 0x111B6, Hi: 0x111BE, Stride: 1}, + {Lo: 0x111C0, Hi: 0x111C0, Stride: 1}, + {Lo: 0x111C9, Hi: 0x111CC, Stride: 1}, + {Lo: 0x111CF, Hi: 0x111CF, Stride: 1}, + {Lo: 0x1122F, Hi: 0x11231, Stride: 1}, + {Lo: 0x11234, Hi: 0x11234, Stride: 1}, + {Lo: 0x11235, Hi: 0x11235, Stride: 1}, + {Lo: 0x11236, Hi: 0x11237, Stride: 1}, + {Lo: 0x1123E, Hi: 0x1123E, Stride: 1}, + {Lo: 0x11241, Hi: 0x11241, Stride: 1}, + {Lo: 0x112DF, Hi: 0x112DF, Stride: 1}, + {Lo: 0x112E3, Hi: 0x112EA, Stride: 1}, + {Lo: 0x11300, Hi: 0x11301, Stride: 1}, + {Lo: 0x1133B, Hi: 0x1133C, Stride: 1}, + {Lo: 0x1133E, Hi: 0x1133E, Stride: 1}, + {Lo: 0x11340, Hi: 0x11340, Stride: 1}, + {Lo: 0x1134D, Hi: 0x1134D, Stride: 1}, + {Lo: 0x11357, Hi: 0x11357, Stride: 1}, + {Lo: 0x11366, Hi: 0x1136C, Stride: 1}, + {Lo: 0x11370, Hi: 0x11374, Stride: 1}, + {Lo: 0x113B8, Hi: 0x113B8, Stride: 1}, + {Lo: 0x113BB, Hi: 0x113C0, Stride: 1}, + {Lo: 0x113C2, Hi: 0x113C2, Stride: 1}, + {Lo: 0x113C5, Hi: 0x113C5, Stride: 1}, + {Lo: 0x113C7, Hi: 0x113C9, Stride: 1}, + {Lo: 0x113CE, Hi: 0x113CE, Stride: 1}, + {Lo: 0x113CF, Hi: 0x113CF, Stride: 1}, + {Lo: 0x113D2, Hi: 0x113D2, Stride: 1}, + {Lo: 0x113E1, Hi: 0x113E2, Stride: 1}, + {Lo: 0x11438, Hi: 0x1143F, Stride: 1}, + {Lo: 0x11442, Hi: 0x11444, Stride: 1}, + {Lo: 0x11446, Hi: 0x11446, Stride: 1}, + {Lo: 0x1145E, Hi: 0x1145E, Stride: 1}, + {Lo: 0x114B0, Hi: 0x114B0, Stride: 1}, + {Lo: 0x114B3, Hi: 0x114B8, Stride: 1}, + {Lo: 0x114BA, Hi: 0x114BA, Stride: 1}, + {Lo: 0x114BD, Hi: 0x114BD, Stride: 1}, + {Lo: 0x114BF, Hi: 0x114C0, Stride: 1}, + {Lo: 0x114C2, Hi: 0x114C3, Stride: 1}, + {Lo: 0x115AF, Hi: 0x115AF, Stride: 1}, + {Lo: 0x115B2, Hi: 0x115B5, Stride: 1}, + {Lo: 0x115BC, Hi: 0x115BD, Stride: 1}, + {Lo: 0x115BF, Hi: 0x115C0, Stride: 1}, + {Lo: 0x115DC, Hi: 0x115DD, Stride: 1}, + {Lo: 0x11633, Hi: 0x1163A, Stride: 1}, + {Lo: 0x1163D, Hi: 0x1163D, Stride: 1}, + {Lo: 0x1163F, Hi: 0x11640, Stride: 1}, + {Lo: 0x116AB, Hi: 0x116AB, Stride: 1}, + {Lo: 0x116AD, Hi: 0x116AD, Stride: 1}, + {Lo: 0x116B0, Hi: 0x116B5, Stride: 1}, + {Lo: 0x116B6, Hi: 0x116B6, Stride: 1}, + {Lo: 0x116B7, Hi: 0x116B7, Stride: 1}, + {Lo: 0x1171D, Hi: 0x1171D, Stride: 1}, + {Lo: 0x1171F, Hi: 0x1171F, Stride: 1}, + {Lo: 0x11722, Hi: 0x11725, Stride: 1}, + {Lo: 0x11727, Hi: 0x1172B, Stride: 1}, + {Lo: 0x1182F, Hi: 0x11837, Stride: 1}, + {Lo: 0x11839, Hi: 0x1183A, Stride: 1}, + {Lo: 0x11930, Hi: 0x11930, Stride: 1}, + {Lo: 0x1193B, Hi: 0x1193C, Stride: 1}, + {Lo: 0x1193D, Hi: 0x1193D, Stride: 1}, + {Lo: 0x11943, Hi: 0x11943, Stride: 1}, + {Lo: 0x119D4, Hi: 0x119D7, Stride: 1}, + {Lo: 0x119DA, Hi: 0x119DB, Stride: 1}, + {Lo: 0x119E0, Hi: 0x119E0, Stride: 1}, + {Lo: 0x11A01, Hi: 0x11A0A, Stride: 1}, + {Lo: 0x11A33, Hi: 0x11A38, Stride: 1}, + {Lo: 0x11A3B, Hi: 0x11A3E, Stride: 1}, + {Lo: 0x11A51, Hi: 0x11A56, Stride: 1}, + {Lo: 0x11A59, Hi: 0x11A5B, Stride: 1}, + {Lo: 0x11A8A, Hi: 0x11A96, Stride: 1}, + {Lo: 0x11A98, Hi: 0x11A98, Stride: 1}, + {Lo: 0x11B60, Hi: 0x11B60, Stride: 1}, + {Lo: 0x11B62, Hi: 0x11B64, Stride: 1}, + {Lo: 0x11B66, Hi: 0x11B66, Stride: 1}, + {Lo: 0x11C30, Hi: 0x11C36, Stride: 1}, + {Lo: 0x11C38, Hi: 0x11C3D, Stride: 1}, + {Lo: 0x11C3F, Hi: 0x11C3F, Stride: 1}, + {Lo: 0x11C92, Hi: 0x11CA7, Stride: 1}, + {Lo: 0x11CAA, Hi: 0x11CB0, Stride: 1}, + {Lo: 0x11CB2, Hi: 0x11CB3, Stride: 1}, + {Lo: 0x11CB5, Hi: 0x11CB6, Stride: 1}, + {Lo: 0x11D31, Hi: 0x11D36, Stride: 1}, + {Lo: 0x11D3A, Hi: 0x11D3A, Stride: 1}, + {Lo: 0x11D3C, Hi: 0x11D3D, Stride: 1}, + {Lo: 0x11D3F, Hi: 0x11D45, Stride: 1}, + {Lo: 0x11D47, Hi: 0x11D47, Stride: 1}, + {Lo: 0x11D90, Hi: 0x11D91, Stride: 1}, + {Lo: 0x11D95, Hi: 0x11D95, Stride: 1}, + {Lo: 0x11D97, Hi: 0x11D97, Stride: 1}, + {Lo: 0x11EF3, Hi: 0x11EF4, Stride: 1}, + {Lo: 0x11F00, Hi: 0x11F01, Stride: 1}, + {Lo: 0x11F36, Hi: 0x11F3A, Stride: 1}, + {Lo: 0x11F40, Hi: 0x11F40, Stride: 1}, + {Lo: 0x11F41, Hi: 0x11F41, Stride: 1}, + {Lo: 0x11F5A, Hi: 0x11F5A, Stride: 1}, + {Lo: 0x13440, Hi: 0x13440, Stride: 1}, + {Lo: 0x13447, Hi: 0x13455, Stride: 1}, + {Lo: 0x1611E, Hi: 0x16129, Stride: 1}, + {Lo: 0x1612D, Hi: 0x1612F, Stride: 1}, + {Lo: 0x16AF0, Hi: 0x16AF4, Stride: 1}, + {Lo: 0x16B30, Hi: 0x16B36, Stride: 1}, + {Lo: 0x16F4F, Hi: 0x16F4F, Stride: 1}, + {Lo: 0x16F8F, Hi: 0x16F92, Stride: 1}, + {Lo: 0x16FE4, Hi: 0x16FE4, Stride: 1}, + {Lo: 0x16FF0, Hi: 0x16FF1, Stride: 1}, + {Lo: 0x1BC9D, Hi: 0x1BC9E, Stride: 1}, + {Lo: 0x1CF00, Hi: 0x1CF2D, Stride: 1}, + {Lo: 0x1CF30, Hi: 0x1CF46, Stride: 1}, + {Lo: 0x1D165, Hi: 0x1D166, Stride: 1}, + {Lo: 0x1D167, Hi: 0x1D169, Stride: 1}, + {Lo: 0x1D16D, Hi: 0x1D172, Stride: 1}, + {Lo: 0x1D17B, Hi: 0x1D182, Stride: 1}, + {Lo: 0x1D185, Hi: 0x1D18B, Stride: 1}, + {Lo: 0x1D1AA, Hi: 0x1D1AD, Stride: 1}, + {Lo: 0x1D242, Hi: 0x1D244, Stride: 1}, + {Lo: 0x1DA00, Hi: 0x1DA36, Stride: 1}, + {Lo: 0x1DA3B, Hi: 0x1DA6C, Stride: 1}, + {Lo: 0x1DA75, Hi: 0x1DA75, Stride: 1}, + {Lo: 0x1DA84, Hi: 0x1DA84, Stride: 1}, + {Lo: 0x1DA9B, Hi: 0x1DA9F, Stride: 1}, + {Lo: 0x1DAA1, Hi: 0x1DAAF, Stride: 1}, + {Lo: 0x1E000, Hi: 0x1E006, Stride: 1}, + {Lo: 0x1E008, Hi: 0x1E018, Stride: 1}, + {Lo: 0x1E01B, Hi: 0x1E021, Stride: 1}, + {Lo: 0x1E023, Hi: 0x1E024, Stride: 1}, + {Lo: 0x1E026, Hi: 0x1E02A, Stride: 1}, + {Lo: 0x1E08F, Hi: 0x1E08F, Stride: 1}, + {Lo: 0x1E130, Hi: 0x1E136, Stride: 1}, + {Lo: 0x1E2AE, Hi: 0x1E2AE, Stride: 1}, + {Lo: 0x1E2EC, Hi: 0x1E2EF, Stride: 1}, + {Lo: 0x1E4EC, Hi: 0x1E4EF, Stride: 1}, + {Lo: 0x1E5EE, Hi: 0x1E5EF, Stride: 1}, + {Lo: 0x1E6E3, Hi: 0x1E6E3, Stride: 1}, + {Lo: 0x1E6E6, Hi: 0x1E6E6, Stride: 1}, + {Lo: 0x1E6EE, Hi: 0x1E6EF, Stride: 1}, + {Lo: 0x1E6F5, Hi: 0x1E6F5, Stride: 1}, + {Lo: 0x1E8D0, Hi: 0x1E8D6, Stride: 1}, + {Lo: 0x1E944, Hi: 0x1E94A, Stride: 1}, + {Lo: 0x1F3FB, Hi: 0x1F3FF, Stride: 1}, + {Lo: 0xE0020, Hi: 0xE007F, Stride: 1}, + {Lo: 0xE0100, Hi: 0xE01EF, Stride: 1}, + }, +} + +var unicodeAliasIndic_Conjunct_Break_Linker = &unicode.RangeTable{ + R16: []unicode.Range16{ + {Lo: 0x94D, Hi: 0x94D, Stride: 1}, + {Lo: 0x9CD, Hi: 0x9CD, Stride: 1}, + {Lo: 0xACD, Hi: 0xACD, Stride: 1}, + {Lo: 0xB4D, Hi: 0xB4D, Stride: 1}, + {Lo: 0xC4D, Hi: 0xC4D, Stride: 1}, + {Lo: 0xD4D, Hi: 0xD4D, Stride: 1}, + {Lo: 0x1039, Hi: 0x1039, Stride: 1}, + {Lo: 0x17D2, Hi: 0x17D2, Stride: 1}, + {Lo: 0x1A60, Hi: 0x1A60, Stride: 1}, + {Lo: 0x1B44, Hi: 0x1B44, Stride: 1}, + {Lo: 0x1BAB, Hi: 0x1BAB, Stride: 1}, + {Lo: 0xA9C0, Hi: 0xA9C0, Stride: 1}, + {Lo: 0xAAF6, Hi: 0xAAF6, Stride: 1}, + }, + R32: []unicode.Range32{ + {Lo: 0x10A3F, Hi: 0x10A3F, Stride: 1}, + {Lo: 0x11133, Hi: 0x11133, Stride: 1}, + {Lo: 0x113D0, Hi: 0x113D0, Stride: 1}, + {Lo: 0x1193E, Hi: 0x1193E, Stride: 1}, + {Lo: 0x11A47, Hi: 0x11A47, Stride: 1}, + {Lo: 0x11A99, Hi: 0x11A99, Stride: 1}, + {Lo: 0x11F42, Hi: 0x11F42, Stride: 1}, + }, +} diff --git a/vendor/github.com/dlclark/regexp2/v2/syntax/writer.go b/vendor/github.com/dlclark/regexp2/v2/syntax/writer.go new file mode 100644 index 000000000..9ceee2b91 --- /dev/null +++ b/vendor/github.com/dlclark/regexp2/v2/syntax/writer.go @@ -0,0 +1,728 @@ +package syntax + +import ( + "bytes" + "fmt" + "math" + "slices" +) + +func Write(tree *RegexTree) (*Code, error) { + w := newWriter(nil) + code, err := w.codeFromTree(tree) + if err != nil { + return nil, err + } + + if slices.Contains(code.CaptureSlotInUse, false) { + quickWriter := newWriter(code.CaptureSlotInUse) + quickCode, err := quickWriter.codeFromTree(tree) + if err != nil { + return nil, err + } + if !dispatchTablesEqual(code.Dispatches, quickCode.Dispatches) { + return nil, fmt.Errorf("full and quick dispatch tables differ") + } + for i := range quickCode.Dispatches { + quickCode.Dispatches[i].Sets = code.Dispatches[i].Sets + quickCode.Dispatches[i].ASCII = code.Dispatches[i].ASCII + quickCode.Dispatches[i].ASCIIMasks = code.Dispatches[i].ASCIIMasks + } + code.QuickCodes = quickCode.Codes + code.QuickDispatches = quickCode.Dispatches + } + return code, nil +} + +func newWriter(quickCaptureSlots []bool) writer { + return writer{ + intStack: make([]int, 0, 32), + emitted: make([]int, 2), + stringhash: make(map[string]int), + sethash: make(map[string]int), + preconsumed: make(map[*RegexNode]bool), + dispatchInfo: make(map[*RegexNode]dispatchInfo), + dispatchCodes: make(map[*RegexNode]int), + dispatchGotos: make(map[*RegexNode][]int), + quickCaptureSlots: quickCaptureSlots, + } +} + +type writer struct { + emitted []int + + intStack []int + curpos int + stringhash map[string]int + stringtable [][]rune + sethash map[string]int + settable []*CharSet + dispatchtable []DispatchTable + preconsumed map[*RegexNode]bool + dispatchInfo map[*RegexNode]dispatchInfo + dispatchCodes map[*RegexNode]int + dispatchGotos map[*RegexNode][]int + counting bool + count int + trackcount int + caps map[int]int + quickCaptureSlots []bool + ecma bool +} + +type dispatchInfo struct { + sets []*CharSet + leaders []*RegexNode + complete []bool + ok bool +} + +func dispatchTablesEqual(left, right []DispatchTable) bool { + if len(left) != len(right) { + return false + } + for i := range left { + if !slices.Equal(left[i].Sets, right[i].Sets) || + !slices.Equal(left[i].ASCIIMasks, right[i].ASCIIMasks) || + (left[i].ASCII == nil) != (right[i].ASCII == nil) { + return false + } + if left[i].ASCII != nil && *left[i].ASCII != *right[i].ASCII { + return false + } + } + return true +} + +const ( + BeforeChild NodeType = 64 + AfterChild NodeType = 128 + //MaxPrefixSize is the largest number of runes we'll use for a BoyerMoyer prefix + MaxPrefixSize = 50 +) + +// The top level RegexCode generator. It does a depth-first walk +// through the tree and calls EmitFragment to emits code before +// and after each child of an interior node, and at each leaf. +// +// It runs two passes, first to count the size of the generated +// code, and second to generate the code. +// +// We should time it against the alternative, which is +// to just generate the code and grow the array as we go. +func (w *writer) codeFromTree(tree *RegexTree) (*Code, error) { + var ( + curNode *RegexNode + curChild int + capsize int + ) + w.ecma = tree.Options&ECMAScript != 0 + // construct sparse capnum mapping if some numbers are unused + + if tree.Capnumlist == nil || tree.Captop == len(tree.Capnumlist) { + capsize = tree.Captop + w.caps = nil + } else { + capsize = len(tree.Capnumlist) + w.caps = tree.Caps + for i := 0; i < len(tree.Capnumlist); i++ { + w.caps[tree.Capnumlist[i]] = i + } + } + + w.counting = true + + for { + if !w.counting { + w.emitted = make([]int, w.count) + w.dispatchCodes = make(map[*RegexNode]int) + w.dispatchGotos = make(map[*RegexNode][]int) + } + + curNode = tree.Root + curChild = 0 + + w.emit1(Lazybranch, 0) + + for { + if len(curNode.Children) == 0 { + if err := w.emitFragment(curNode.T, curNode, 0); err != nil { + return nil, err + } + } else if curChild < len(curNode.Children) { + if err := w.emitFragment(curNode.T|BeforeChild, curNode, curChild); err != nil { + return nil, err + } + + curNode = curNode.Children[curChild] + + w.pushInt(curChild) + curChild = 0 + continue + } + + if w.emptyStack() { + break + } + + curChild = w.popInt() + curNode = curNode.Parent + + if err := w.emitFragment(curNode.T|AfterChild, curNode, curChild); err != nil { + return nil, err + } + curChild++ + } + + w.patchJump(0, w.curPos()) + w.emit(Stop) + + if !w.counting { + break + } + + w.counting = false + } + if w.quickCaptureSlots != nil { + return &Code{Codes: w.emitted, Dispatches: w.dispatchtable, TrackCount: w.trackcount}, nil + } + + fcPrefix := getFirstCharsPrefix(tree) + prefix := getPrefix(tree) + rtl := (tree.Options & RightToLeft) != 0 + + var bmPrefix *BmPrefix + //TODO: benchmark string prefixes + if prefix != nil && len(prefix.PrefixStr) > 0 && MaxPrefixSize > 0 { + if len(prefix.PrefixStr) > MaxPrefixSize { + // Keep the portion encountered first in the search direction. + if rtl { + prefix.PrefixStr = prefix.PrefixStr[len(prefix.PrefixStr)-MaxPrefixSize:] + } else { + prefix.PrefixStr = prefix.PrefixStr[:MaxPrefixSize] + } + } + bmPrefix = newBmPrefix(prefix.PrefixStr, prefix.CaseInsensitive, rtl) + } else { + bmPrefix = nil + } + + return &Code{ + Codes: w.emitted, + Strings: w.stringtable, + Sets: w.settable, + Dispatches: w.dispatchtable, + TrackCount: w.trackcount, + Caps: w.caps, + Capsize: capsize, + CaptureSlotInUse: captureSlotsInUse(tree.Root, capsize, w.caps), + FcPrefix: fcPrefix, + BmPrefix: bmPrefix, + Anchors: getAnchors(tree), + RightToLeft: rtl, + FindOptimizations: tree.FindOptimizations, + LeftContextRunes: AnalyzeLeftContext(tree.Root), + }, nil +} + +// AnalyzeLeftContext returns how many runes before a candidate start the matcher +// may inspect. Slicing the input down to that candidate is legal only when no +// opcode depends on the original search origin or unbounded left text. +// +// 0 never looks left of the start position +// 1 one previous rune is enough for \b, or to keep ^/\A from seeing +// the candidate as the original start (they test leftchars()==0) +// -1 do not slice: lookbehind, or \G (NtStart), which keys off textstart +func AnalyzeLeftContext(n *RegexNode) int { + if n == nil { + return 0 + } + + need := 0 + switch n.T { + case NtPosLook, NtNegLook: + if n.Options&RightToLeft != 0 { + return -1 + } + case NtStart: + return -1 + case NtBol, NtBeginning, NtBoundary, NtNonboundary, NtECMABoundary, NtNonECMABoundary: + need = 1 + } + + for _, child := range n.Children { + childNeed := AnalyzeLeftContext(child) + if childNeed < 0 { + return -1 + } + if childNeed > need { + need = childNeed + } + } + return need +} + +// The main RegexCode generator. It does a depth-first walk +// through the tree and calls EmitFragment to emits code before +// and after each child of an interior node, and at each leaf. +func (w *writer) emitFragment(nodetype NodeType, node *RegexNode, curIndex int) error { + bits := InstOp(0) + + if (node.Options & RightToLeft) != 0 { + bits |= Rtl + } + if (node.Options & IgnoreCase) != 0 { + bits |= Ci + } + + ntBits := NodeType(bits) + + switch nodetype { + case NtConcatenate | BeforeChild, NtConcatenate | AfterChild, NtEmpty: + + case NtResetCapture: + slot := w.mapCapnum(node.M) + if w.quickCaptureSlots != nil && !w.quickCaptureSlots[slot] { + break + } + w.emit1(ResetCapture, slot) + + case NtAlternate | BeforeChild: + if sets, leaders, _, ok := w.getDispatchCandidates(node); ok { + if curIndex == 0 { + w.dispatchCodes[node] = w.dispatchCode(sets) + w.emit1(Dispatch|bits, w.dispatchCodes[node]) + } + w.preconsumed[leaders[curIndex]] = true + w.patchDispatchBranch(node, curIndex, w.curPos()) + } else if curIndex < len(node.Children)-1 { + w.pushInt(w.curPos()) + w.emit1(Lazybranch, 0) + } + + case NtAlternate | AfterChild: + if _, _, complete, ok := w.getDispatchCandidates(node); ok { + if curIndex < len(node.Children)-1 && !complete[curIndex] { + gotoPos := w.curPos() + w.emit1(Goto, 0) + w.dispatchGotos[node] = append(w.dispatchGotos[node], gotoPos) + } + if curIndex == len(node.Children)-1 { + end := w.curPos() + for _, gotoPos := range w.dispatchGotos[node] { + w.patchJump(gotoPos, end) + } + for branch, isComplete := range complete { + if isComplete { + w.patchDispatchBranch(node, branch, end) + } + } + } + } else if curIndex < len(node.Children)-1 { + lbPos := w.popInt() + w.pushInt(w.curPos()) + w.emit1(Goto, 0) + w.patchJump(lbPos, w.curPos()) + } else { + for i := 0; i < curIndex; i++ { + w.patchJump(w.popInt(), w.curPos()) + } + } + + case NtBackRefCond | BeforeChild: + if curIndex == 0 { + w.emit(Setjump) + w.pushInt(w.curPos()) + w.emit1(Lazybranch, 0) + w.emit1(Testref, w.mapCapnum(node.M)) + w.emit(Forejump) + } + + case NtBackRefCond | AfterChild: + switch curIndex { + case 0: + branchpos := w.popInt() + w.pushInt(w.curPos()) + w.emit1(Goto, 0) + w.patchJump(branchpos, w.curPos()) + w.emit(Forejump) + if len(node.Children) <= 1 { + w.patchJump(w.popInt(), w.curPos()) + } + case 1: + w.patchJump(w.popInt(), w.curPos()) + } + + case NtExprCond | BeforeChild: + if curIndex == 0 { + w.emit(Setjump) + w.emit(Setmark) + w.pushInt(w.curPos()) + w.emit1(Lazybranch, 0) + } + + case NtExprCond | AfterChild: + switch curIndex { + case 0: + w.emit(Getmark) + w.emit(Forejump) + case 1: + branchpos := w.popInt() + w.pushInt(w.curPos()) + w.emit1(Goto, 0) + w.patchJump(branchpos, w.curPos()) + w.emit(Getmark) + w.emit(Forejump) + if len(node.Children) <= 2 { + w.patchJump(w.popInt(), w.curPos()) + } + case 2: + w.patchJump(w.popInt(), w.curPos()) + } + + case NtLoop | BeforeChild, NtLazyloop | BeforeChild: + + // Counted loops distinguish required iterations from optional ones + // for RepeatMatcher's empty-iteration rejection (ECMAScript 2025 + // §22.2.2.3.1, step 2.2), even when the upper bound is unbounded. + if node.N < math.MaxInt32 || node.M > 1 || w.ecma { + if node.M == 0 { + w.emit1(Nullcount, 0) + } else { + w.emit1(Setcount, 1-node.M) + } + } else if node.M == 0 { + w.emit(Nullmark) + } else { + w.emit(Setmark) + } + + if node.M == 0 { + w.pushInt(w.curPos()) + w.emit1(Goto, 0) + } + w.pushInt(w.curPos()) + + case NtLoop | AfterChild, NtLazyloop | AfterChild: + + startJumpPos := w.curPos() + lazy := InstOp(nodetype - (NtLoop | AfterChild)) + + if node.N < math.MaxInt32 || node.M > 1 || w.ecma { + if node.N == math.MaxInt32 { + w.emit2(Branchcount+lazy, w.popInt(), math.MaxInt32) + } else { + w.emit2(Branchcount+lazy, w.popInt(), node.N-node.M) + } + } else { + w.emit1(Branchmark+lazy, w.popInt()) + } + + if node.M == 0 { + w.patchJump(w.popInt(), startJumpPos) + } + + case NtGroup | BeforeChild, NtGroup | AfterChild: + + case NtCapture | BeforeChild: + if w.emitCapture(node) { + w.emit(Setmark) + } + + case NtCapture | AfterChild: + if w.emitCapture(node) { + w.emit2(Capturemark, w.mapCapnum(node.M), w.mapCapnum(node.N)) + } + + case NtPosLook | BeforeChild: + // NOTE: the following line causes lookahead/lookbehind to be + // NON-BACKTRACKING. It can be commented out with (*) + w.emit(Setjump) + + w.emit(Setmark) + + case NtPosLook | AfterChild: + w.emit(Getmark) + + // NOTE: the following line causes lookahead/lookbehind to be + // NON-BACKTRACKING. It can be commented out with (*) + w.emit(Forejump) + + case NtNegLook | BeforeChild: + w.emit(Setjump) + w.pushInt(w.curPos()) + w.emit1(Lazybranch, 0) + + case NtNegLook | AfterChild: + w.emit(Backjump) + w.patchJump(w.popInt(), w.curPos()) + w.emit(Forejump) + + case NtAtomic | BeforeChild: + w.emit(Setjump) + + case NtAtomic | AfterChild: + w.emit(Forejump) + + case NtOne, NtNotone: + if !w.preconsumed[node] { + w.emit1(InstOp(node.T|ntBits), int(node.Ch)) + } + + case NtNotoneloop, NtNotoneloopatomic, NtNotonelazy, NtOneloop, NtOneloopatomic, NtOnelazy: + if node.M > 0 { + if node.T == NtOneloop || node.T == NtOnelazy || node.T == NtOneloopatomic { + w.emit2(Onerep|bits, int(node.Ch), node.M) + } else { + w.emit2(Notonerep|bits, int(node.Ch), node.M) + } + } + if node.N > node.M { + if node.N == math.MaxInt32 { + w.emit2(InstOp(node.T|ntBits), int(node.Ch), math.MaxInt32) + } else { + w.emit2(InstOp(node.T|ntBits), int(node.Ch), node.N-node.M) + } + } + + case NtSetloop, NtSetlazy, NtSetloopatomic: + if node.M > 0 { + w.emit2(Setrep|bits, w.setCode(node.Set), node.M) + } + if node.N > node.M { + if node.N == math.MaxInt32 { + w.emit2(InstOp(node.T|ntBits), w.setCode(node.Set), math.MaxInt32) + } else { + w.emit2(InstOp(node.T|ntBits), w.setCode(node.Set), node.N-node.M) + } + } + + case NtMulti: + str := node.Str + if w.preconsumed[node] { + if bits&Rtl != 0 { + str = str[:len(str)-1] + } else { + str = str[1:] + } + } + if len(str) > 0 { + w.emit1(InstOp(node.T|ntBits), w.stringCode(str)) + } + + case NtSet: + if !w.preconsumed[node] { + w.emit1(InstOp(node.T|ntBits), w.setCode(node.Set)) + } + + case NtRef: + w.emit1(InstOp(node.T|ntBits), w.mapCapnum(node.M)) + + case NtNothing, NtBol, NtEol, NtBoundary, NtNonboundary, NtBeginning, NtStart, NtEndZ, NtEnd, NtUpdateBumpalong: + w.emit(InstOp(node.T)) + + case NtECMABoundary, NtNonECMABoundary: + // Ci tells the runner that IgnoreCase applies, which (with Unicode) + // adds to the word characters. + w.emit(InstOp(node.T) | bits&Ci) + + case NtGrapheme: + w.emit(InstOp(node.T | ntBits)) + + default: + return fmt.Errorf("unexpected opcode in regular expression generation: %v", nodetype) + } + + return nil +} + +func (w *writer) emitCapture(node *RegexNode) bool { + if w.quickCaptureSlots == nil { + return true + } + capnum, uncapnum := w.mapCapnum(node.M), w.mapCapnum(node.N) + if uncapnum != -1 { + return true + } + return capnum >= 0 && (capnum >= len(w.quickCaptureSlots) || w.quickCaptureSlots[capnum]) +} + +// To avoid recursion, we use a simple integer stack. +// This is the push. +func (w *writer) pushInt(i int) { + w.intStack = append(w.intStack, i) +} + +// Returns true if the stack is empty. +func (w *writer) emptyStack() bool { + return len(w.intStack) == 0 +} + +// This is the pop. +func (w *writer) popInt() int { + //get our item + idx := len(w.intStack) - 1 + i := w.intStack[idx] + //trim our slice + w.intStack = w.intStack[:idx] + return i +} + +// Returns the current position in the emitted code. +func (w *writer) curPos() int { + return w.curpos +} + +// Fixes up a jump instruction at the specified offset +// so that it jumps to the specified jumpDest. +func (w *writer) patchJump(offset, jumpDest int) { + w.emitted[offset+1] = jumpDest +} + +func (w *writer) getDispatchCandidates(node *RegexNode) ([]*CharSet, []*RegexNode, []bool, bool) { + if info, found := w.dispatchInfo[node]; found { + return info.sets, info.leaders, info.complete, info.ok + } + sets, leaders, complete, ok := node.dispatchCandidates() + w.dispatchInfo[node] = dispatchInfo{sets: sets, leaders: leaders, complete: complete, ok: ok} + return sets, leaders, complete, ok +} + +func (w *writer) dispatchCode(sets []*CharSet) int { + if w.counting { + return 0 + } + table := DispatchTable{ + Sets: make([]int, len(sets)), + Branches: make([]int, len(sets)), + } + if len(sets) >= 4 { + table.ASCII = &[128]uint16{} + } else { + table.ASCIIMasks = make([]uint64, len(sets)*2) + } + for i, set := range sets { + table.Sets[i] = w.setCode(set) + for ch := rune(0); ch < 128; ch++ { + if set.CharIn(ch) { + if table.ASCII != nil { + table.ASCII[ch] = uint16(i + 1) + } else { + table.ASCIIMasks[i*2+int(ch>>6)] |= uint64(1) << (ch & 63) + } + } + } + } + index := len(w.dispatchtable) + w.dispatchtable = append(w.dispatchtable, table) + return index +} + +func (w *writer) patchDispatchBranch(node *RegexNode, branch, target int) { + if w.counting { + return + } + table := w.dispatchCodes[node] + w.dispatchtable[table].Branches[branch] = target +} + +// Returns an index in the set table for a charset +// uses a map to eliminate duplicates. +func (w *writer) setCode(set *CharSet) int { + if w.counting { + return 0 + } + + buf := &bytes.Buffer{} + + set.mapHashFill(buf) + hash := buf.String() + i, ok := w.sethash[hash] + if !ok { + i = len(w.sethash) + w.sethash[hash] = i + w.settable = append(w.settable, set) + } + return i +} + +// Returns an index in the string table for a string. +// uses a map to eliminate duplicates. +func (w *writer) stringCode(str []rune) int { + if w.counting { + return 0 + } + + hash := string(str) + i, ok := w.stringhash[hash] + if !ok { + i = len(w.stringhash) + w.stringhash[hash] = i + w.stringtable = append(w.stringtable, str) + } + + return i +} + +// When generating code on a regex that uses a sparse set +// of capture slots, we hash them to a dense set of indices +// for an array of capture slots. Instead of doing the hash +// at match time, it's done at compile time, here. +func (w *writer) mapCapnum(capnum int) int { + if capnum == -1 { + return -1 + } + + if w.caps != nil { + return w.caps[capnum] + } + + return capnum +} + +// Emits a zero-argument operation. Note that the emit +// functions all run in two modes: they can emit code, or +// they can just count the size of the code. +func (w *writer) emit(op InstOp) { + if w.counting { + w.count++ + if opcodeBacktracks(op) { + w.trackcount++ + } + return + } + w.emitted[w.curpos] = int(op) + w.curpos++ +} + +// Emits a one-argument operation. +func (w *writer) emit1(op InstOp, opd1 int) { + if w.counting { + w.count += 2 + if opcodeBacktracks(op) { + w.trackcount++ + } + return + } + w.emitted[w.curpos] = int(op) + w.curpos++ + w.emitted[w.curpos] = opd1 + w.curpos++ +} + +// Emits a two-argument operation. +func (w *writer) emit2(op InstOp, opd1, opd2 int) { + if w.counting { + w.count += 3 + if opcodeBacktracks(op) { + w.trackcount++ + } + return + } + w.emitted[w.curpos] = int(op) + w.curpos++ + w.emitted[w.curpos] = opd1 + w.curpos++ + w.emitted[w.curpos] = opd2 + w.curpos++ +} diff --git a/vendor/github.com/go-openapi/jsonpointer/CONTRIBUTORS.md b/vendor/github.com/go-openapi/jsonpointer/CONTRIBUTORS.md index de0bf5c04..6941823e6 100644 --- a/vendor/github.com/go-openapi/jsonpointer/CONTRIBUTORS.md +++ b/vendor/github.com/go-openapi/jsonpointer/CONTRIBUTORS.md @@ -4,11 +4,11 @@ | Total Contributors | Total Contributions | | --- | --- | -| 13 | 132 | +| 13 | 136 | | Username | All Time Contribution Count | All Commits | | --- | --- | --- | -| @fredbi | 83 | | +| @fredbi | 87 | | | @casualjim | 33 | | | @magodo | 3 | | | @youyuanwu | 3 | | diff --git a/vendor/github.com/go-openapi/jsonpointer/README.md b/vendor/github.com/go-openapi/jsonpointer/README.md index 6e7929c64..e563fac77 100644 --- a/vendor/github.com/go-openapi/jsonpointer/README.md +++ b/vendor/github.com/go-openapi/jsonpointer/README.md @@ -5,7 +5,7 @@ -[![Release][release-badge]][release-url] [![Go Report Card][gocard-badge]][gocard-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url] +[![Release][release-badge]][release-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url] [![GoDoc][godoc-badge]][godoc-url] [![Discord Channel][discord-badge]][discord-url] [![go version][goversion-badge]][goversion-url] ![Top language][top-badge] ![Commits since latest release][commits-badge] @@ -152,8 +152,6 @@ Maintainers can cut a new release by either: [release-badge]: https://badge.fury.io/gh/go-openapi%2Fjsonpointer.svg [release-url]: https://badge.fury.io/gh/go-openapi%2Fjsonpointer -[gocard-badge]: https://goreportcard.com/badge/github.com/go-openapi/jsonpointer -[gocard-url]: https://goreportcard.com/report/github.com/go-openapi/jsonpointer [codefactor-badge]: https://img.shields.io/codefactor/grade/github/go-openapi/jsonpointer [codefactor-url]: https://www.codefactor.io/repository/github/go-openapi/jsonpointer diff --git a/vendor/github.com/go-openapi/jsonpointer/pointer.go b/vendor/github.com/go-openapi/jsonpointer/pointer.go index 05fc863ee..d6ee165f6 100644 --- a/vendor/github.com/go-openapi/jsonpointer/pointer.go +++ b/vendor/github.com/go-openapi/jsonpointer/pointer.go @@ -284,7 +284,7 @@ func (p *Pointer) set(node, data any, nameProvider NameProvider) (any, error) { // new child reference (e.g. a slice header returned by an "-" append) into its parent on the way // back up. // -// Returning the (possibly new) node at each level is what makes append work at any depth without +// Returning the (possibly new) node at each level makes append work at any depth without // requiring the caller to pass a pointer to the containing slice: the new slice header propagates // up and each parent rebinds it via the appropriate kind-specific setter. func (p *Pointer) setAt(node any, tokens []string, data any, nameProvider NameProvider) (any, error) { diff --git a/vendor/github.com/go-openapi/jsonreference/.golangci.yml b/vendor/github.com/go-openapi/jsonreference/.golangci.yml index dc7c96053..3f3b5af8d 100644 --- a/vendor/github.com/go-openapi/jsonreference/.golangci.yml +++ b/vendor/github.com/go-openapi/jsonreference/.golangci.yml @@ -4,8 +4,12 @@ linters: disable: - depguard - funlen + - goconst - godox + - gomodguard + - gomodguard_v2 - exhaustruct + - exhaustruct_v5 - nlreturn - nonamedreturns - noinlineerr diff --git a/vendor/github.com/go-openapi/jsonreference/CONTRIBUTORS.md b/vendor/github.com/go-openapi/jsonreference/CONTRIBUTORS.md index d20737c94..ce4326eef 100644 --- a/vendor/github.com/go-openapi/jsonreference/CONTRIBUTORS.md +++ b/vendor/github.com/go-openapi/jsonreference/CONTRIBUTORS.md @@ -4,11 +4,11 @@ | Total Contributors | Total Contributions | | --- | --- | -| 9 | 83 | +| 9 | 90 | | Username | All Time Contribution Count | All Commits | | --- | --- | --- | -| @fredbi | 46 | | +| @fredbi | 53 | | | @casualjim | 25 | | | @youyuanwu | 5 | | | @olivierlemasle | 2 | | diff --git a/vendor/github.com/go-openapi/jsonreference/README.md b/vendor/github.com/go-openapi/jsonreference/README.md index fbd16cf89..000a1feb5 100644 --- a/vendor/github.com/go-openapi/jsonreference/README.md +++ b/vendor/github.com/go-openapi/jsonreference/README.md @@ -5,7 +5,7 @@ -[![Release][release-badge]][release-url] [![Go Report Card][gocard-badge]][gocard-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url] +[![Release][release-badge]][release-url] [![CodeFactor Grade][codefactor-badge]][codefactor-url] [![License][license-badge]][license-url] [![GoDoc][godoc-badge]][godoc-url] [![Discord Channel][discord-badge]][discord-url] [![go version][goversion-badge]][goversion-url] ![Top language][top-badge] ![Commits since latest release][commits-badge] @@ -97,8 +97,6 @@ Maintainers can cut a new release by either: [gomod-badge]: https://badge.fury.io/go/github.com%2Fgo-openapi%2Fjsonreference.svg [gomod-url]: https://badge.fury.io/go/github.com%2Fgo-openapi%2Fjsonreference -[gocard-badge]: https://goreportcard.com/badge/github.com/go-openapi/jsonreference -[gocard-url]: https://goreportcard.com/report/github.com/go-openapi/jsonreference [codefactor-badge]: https://img.shields.io/codefactor/grade/github/go-openapi/jsonreference [codefactor-url]: https://www.codefactor.io/repository/github/go-openapi/jsonreference diff --git a/vendor/github.com/go-openapi/jsonreference/internal/normalize_url.go b/vendor/github.com/go-openapi/jsonreference/internal/normalize_url.go index a08b47320..6ef640e3b 100644 --- a/vendor/github.com/go-openapi/jsonreference/internal/normalize_url.go +++ b/vendor/github.com/go-openapi/jsonreference/internal/normalize_url.go @@ -5,19 +5,12 @@ package internal import ( "net/url" - "regexp" "strings" ) const ( - defaultHTTPPort = ":80" - defaultHTTPSPort = ":443" -) - -// Regular expressions used by the normalizations. -var ( - rxPort = regexp.MustCompile(`(:\d+)/?$`) - rxDupSlashes = regexp.MustCompile(`/{2,}`) + defaultHTTPPort = "80" + defaultHTTPSPort = "443" ) // NormalizeURL will normalize the specified URL @@ -55,20 +48,66 @@ func lowercaseHost(u *url.URL) { } } +// removeDefaultPort drops :80 from an http URL and :443 from an https one. +// +// The port stays when dropping it would leave an authority url.Parse no longer accepts, so the +// shortened host is parsed before being kept. url.Parse reads "https://:a:443" as the host ":a" +// on port 443, and ":a" on its own is an invalid port, so "https://:a" no longer parses. +// +// A degenerate authority can spell a default port twice - url.Parse reads "http://:80:80" as the +// host ":80" on port 80 - so removal repeats until nothing more comes off. Each pass shortens the +// host, so the loop ends, and normalizing the result again changes nothing. func removeDefaultPort(u *url.URL) { - if len(u.Host) > 0 { - scheme := strings.ToLower(u.Scheme) - u.Host = rxPort.ReplaceAllStringFunc(u.Host, func(val string) string { - if (scheme == "http" && val == defaultHTTPPort) || (scheme == "https" && val == defaultHTTPSPort) { - return "" - } - return val - }) + for { + port := u.Port() + if port == "" || port != defaultPortForScheme(strings.ToLower(u.Scheme)) { + return + } + + host := strings.TrimSuffix(u.Host, ":"+port) + if _, err := url.Parse("//" + host); err != nil { + return + } + + u.Host = host + } +} + +func defaultPortForScheme(scheme string) string { + switch scheme { + case "http": + return defaultHTTPPort + case "https": + return defaultHTTPSPort + default: + return "" } } +// removeDuplicateSlashes collapses every run of slashes in the path to a single one, however +// long the run is: "/a//b///c" becomes "/a/b/c". +// +// A path holding no "//" is left as it is, which is the common case and costs one scan and no +// allocation. func removeDuplicateSlashes(u *url.URL) { - if len(u.Path) > 0 { - u.Path = rxDupSlashes.ReplaceAllString(u.Path, "/") + const doubleSlash = "//" + + start := strings.Index(u.Path, doubleSlash) + if start < 0 { + return } + + var collapsed strings.Builder + collapsed.Grow(len(u.Path)) + collapsed.WriteString(u.Path[:start+1]) // everything up to and including the first slash of the run + + for i := start + 1; i < len(u.Path); i++ { + c := u.Path[i] + if c == '/' && u.Path[i-1] == '/' { + continue + } + collapsed.WriteByte(c) + } + + u.Path = collapsed.String() } diff --git a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/options.go b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/options.go index f114f1f1a..cfcd42685 100644 --- a/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/options.go +++ b/vendor/github.com/go-openapi/swag/jsonutils/adapters/stdlib/json/options.go @@ -10,6 +10,11 @@ package json // It mirrors the limit enforced by the standard library's [encoding/json] decoder // (see encoding/json's internal maxNestingDepth), which this adapter would otherwise // not benefit from since it drives [encoding/json.Decoder.Token] directly. +// +// With encoding/json v2 (GOEXPERIMENT=jsonv2, the default from go1.27), Token applies +// that same limit itself and reports "exceeded max depth" before this counter fires. +// Set a lower limit with [WithMaxNestingDepth] to be rejected earlier than the stdlib; +// a higher one does not lift the stdlib's own 10,000-level ceiling on the decode path. const defaultMaxNestingDepth = 10000 // Option selects options for the stdlib adapter. diff --git a/vendor/github.com/gobwas/glob/.gitignore b/vendor/github.com/gobwas/glob/.gitignore index b4ae623be..534b466c5 100644 --- a/vendor/github.com/gobwas/glob/.gitignore +++ b/vendor/github.com/gobwas/glob/.gitignore @@ -6,3 +6,5 @@ glob.iml *.dot *.png *.svg +patterns.txt +*.bench diff --git a/vendor/github.com/gobwas/glob/.travis.yml b/vendor/github.com/gobwas/glob/.travis.yml deleted file mode 100644 index e8a276826..000000000 --- a/vendor/github.com/gobwas/glob/.travis.yml +++ /dev/null @@ -1,9 +0,0 @@ -sudo: false - -language: go - -go: - - 1.5.3 - -script: - - go test -v ./... diff --git a/vendor/github.com/gobwas/glob/bench.sh b/vendor/github.com/gobwas/glob/bench.sh index 804cf22e6..8570697b8 100644 --- a/vendor/github.com/gobwas/glob/bench.sh +++ b/vendor/github.com/gobwas/glob/bench.sh @@ -1,26 +1,41 @@ -#! /bin/bash +#!/bin/bash +# +# Compares the benchmarks of the current branch against a git revision: +# +# ./bench.sh v0.2.3 # all the benchmarks +# ./bench.sh master 'Match' # the ones matching a -bench regexp +# +# The results are written to *.bench files in the current directory and +# compared with benchstat (go install golang.org/x/perf/cmd/benchstat@latest). -bench() { - filename="/tmp/$1-$2.bench" - if test -e "${filename}"; - then - echo "Already exists ${filename}" - else - backup=`git rev-parse --abbrev-ref HEAD` - git checkout $1 - echo -n "Creating ${filename}... " - go test ./... -run=NONE -bench=$2 > "${filename}" -benchmem - echo "OK" - git checkout ${backup} - sleep 5 - fi -} +set -eu + +prev=$1 +what=${2:-.} +curr=$(git rev-parse --abbrev-ref HEAD) +rnd=$(head -c4 "$out" + echo "OK" + git checkout -q "$curr" + sleep 5 +} -bench ${to} $2 -bench ${current} $2 +bench "$prev" +bench "$curr" -benchcmp $3 "/tmp/${to}-$2.bench" "/tmp/${current}-$2.bench" +benchstat "$(file "$prev")" "$(file "$curr")" diff --git a/vendor/github.com/gobwas/glob/compiler/compiler.go b/vendor/github.com/gobwas/glob/compiler/compiler.go deleted file mode 100644 index 02e7de80a..000000000 --- a/vendor/github.com/gobwas/glob/compiler/compiler.go +++ /dev/null @@ -1,525 +0,0 @@ -package compiler - -// TODO use constructor with all matchers, and to their structs private -// TODO glue multiple Text nodes (like after QuoteMeta) - -import ( - "fmt" - "reflect" - - "github.com/gobwas/glob/match" - "github.com/gobwas/glob/syntax/ast" - "github.com/gobwas/glob/util/runes" -) - -func optimizeMatcher(matcher match.Matcher) match.Matcher { - switch m := matcher.(type) { - - case match.Any: - if len(m.Separators) == 0 { - return match.NewSuper() - } - - case match.AnyOf: - if len(m.Matchers) == 1 { - return m.Matchers[0] - } - - return m - - case match.List: - if m.Not == false && len(m.List) == 1 { - return match.NewText(string(m.List)) - } - - return m - - case match.BTree: - m.Left = optimizeMatcher(m.Left) - m.Right = optimizeMatcher(m.Right) - - r, ok := m.Value.(match.Text) - if !ok { - return m - } - - var ( - leftNil = m.Left == nil - rightNil = m.Right == nil - ) - if leftNil && rightNil { - return match.NewText(r.Str) - } - - _, leftSuper := m.Left.(match.Super) - lp, leftPrefix := m.Left.(match.Prefix) - la, leftAny := m.Left.(match.Any) - - _, rightSuper := m.Right.(match.Super) - rs, rightSuffix := m.Right.(match.Suffix) - ra, rightAny := m.Right.(match.Any) - - switch { - case leftSuper && rightSuper: - return match.NewContains(r.Str, false) - - case leftSuper && rightNil: - return match.NewSuffix(r.Str) - - case rightSuper && leftNil: - return match.NewPrefix(r.Str) - - case leftNil && rightSuffix: - return match.NewPrefixSuffix(r.Str, rs.Suffix) - - case rightNil && leftPrefix: - return match.NewPrefixSuffix(lp.Prefix, r.Str) - - case rightNil && leftAny: - return match.NewSuffixAny(r.Str, la.Separators) - - case leftNil && rightAny: - return match.NewPrefixAny(r.Str, ra.Separators) - } - - return m - } - - return matcher -} - -func compileMatchers(matchers []match.Matcher) (match.Matcher, error) { - if len(matchers) == 0 { - return nil, fmt.Errorf("compile error: need at least one matcher") - } - if len(matchers) == 1 { - return matchers[0], nil - } - if m := glueMatchers(matchers); m != nil { - return m, nil - } - - idx := -1 - maxLen := -1 - var val match.Matcher - for i, matcher := range matchers { - if l := matcher.Len(); l != -1 && l >= maxLen { - maxLen = l - idx = i - val = matcher - } - } - - if val == nil { // not found matcher with static length - r, err := compileMatchers(matchers[1:]) - if err != nil { - return nil, err - } - return match.NewBTree(matchers[0], nil, r), nil - } - - left := matchers[:idx] - var right []match.Matcher - if len(matchers) > idx+1 { - right = matchers[idx+1:] - } - - var l, r match.Matcher - var err error - if len(left) > 0 { - l, err = compileMatchers(left) - if err != nil { - return nil, err - } - } - - if len(right) > 0 { - r, err = compileMatchers(right) - if err != nil { - return nil, err - } - } - - return match.NewBTree(val, l, r), nil -} - -func glueMatchers(matchers []match.Matcher) match.Matcher { - if m := glueMatchersAsEvery(matchers); m != nil { - return m - } - if m := glueMatchersAsRow(matchers); m != nil { - return m - } - return nil -} - -func glueMatchersAsRow(matchers []match.Matcher) match.Matcher { - if len(matchers) <= 1 { - return nil - } - - var ( - c []match.Matcher - l int - ) - for _, matcher := range matchers { - if ml := matcher.Len(); ml == -1 { - return nil - } else { - c = append(c, matcher) - l += ml - } - } - return match.NewRow(l, c...) -} - -func glueMatchersAsEvery(matchers []match.Matcher) match.Matcher { - if len(matchers) <= 1 { - return nil - } - - var ( - hasAny bool - hasSuper bool - hasSingle bool - min int - separator []rune - ) - - for i, matcher := range matchers { - var sep []rune - - switch m := matcher.(type) { - case match.Super: - sep = []rune{} - hasSuper = true - - case match.Any: - sep = m.Separators - hasAny = true - - case match.Single: - sep = m.Separators - hasSingle = true - min++ - - case match.List: - if !m.Not { - return nil - } - sep = m.List - hasSingle = true - min++ - - default: - return nil - } - - // initialize - if i == 0 { - separator = sep - } - - if runes.Equal(sep, separator) { - continue - } - - return nil - } - - if hasSuper && !hasAny && !hasSingle { - return match.NewSuper() - } - - if hasAny && !hasSuper && !hasSingle { - return match.NewAny(separator) - } - - if (hasAny || hasSuper) && min > 0 && len(separator) == 0 { - return match.NewMin(min) - } - - every := match.NewEveryOf() - - if min > 0 { - every.Add(match.NewMin(min)) - - if !hasAny && !hasSuper { - every.Add(match.NewMax(min)) - } - } - - if len(separator) > 0 { - every.Add(match.NewContains(string(separator), true)) - } - - return every -} - -func minimizeMatchers(matchers []match.Matcher) []match.Matcher { - var done match.Matcher - var left, right, count int - - for l := 0; l < len(matchers); l++ { - for r := len(matchers); r > l; r-- { - if glued := glueMatchers(matchers[l:r]); glued != nil { - var swap bool - - if done == nil { - swap = true - } else { - cl, gl := done.Len(), glued.Len() - swap = cl > -1 && gl > -1 && gl > cl - swap = swap || count < r-l - } - - if swap { - done = glued - left = l - right = r - count = r - l - } - } - } - } - - if done == nil { - return matchers - } - - next := append(append([]match.Matcher{}, matchers[:left]...), done) - if right < len(matchers) { - next = append(next, matchers[right:]...) - } - - if len(next) == len(matchers) { - return next - } - - return minimizeMatchers(next) -} - -// minimizeAnyOf tries to apply some heuristics to minimize number of nodes in given tree -func minimizeTree(tree *ast.Node) *ast.Node { - switch tree.Kind { - case ast.KindAnyOf: - return minimizeTreeAnyOf(tree) - default: - return nil - } -} - -// minimizeAnyOf tries to find common children of given node of AnyOf pattern -// it searches for common children from left and from right -// if any common children are found – then it returns new optimized ast tree -// else it returns nil -func minimizeTreeAnyOf(tree *ast.Node) *ast.Node { - if !areOfSameKind(tree.Children, ast.KindPattern) { - return nil - } - - commonLeft, commonRight := commonChildren(tree.Children) - commonLeftCount, commonRightCount := len(commonLeft), len(commonRight) - if commonLeftCount == 0 && commonRightCount == 0 { // there are no common parts - return nil - } - - var result []*ast.Node - if commonLeftCount > 0 { - result = append(result, ast.NewNode(ast.KindPattern, nil, commonLeft...)) - } - - var anyOf []*ast.Node - for _, child := range tree.Children { - reuse := child.Children[commonLeftCount : len(child.Children)-commonRightCount] - var node *ast.Node - if len(reuse) == 0 { - // this pattern is completely reduced by commonLeft and commonRight patterns - // so it become nothing - node = ast.NewNode(ast.KindNothing, nil) - } else { - node = ast.NewNode(ast.KindPattern, nil, reuse...) - } - anyOf = appendIfUnique(anyOf, node) - } - switch { - case len(anyOf) == 1 && anyOf[0].Kind != ast.KindNothing: - result = append(result, anyOf[0]) - case len(anyOf) > 1: - result = append(result, ast.NewNode(ast.KindAnyOf, nil, anyOf...)) - } - - if commonRightCount > 0 { - result = append(result, ast.NewNode(ast.KindPattern, nil, commonRight...)) - } - - return ast.NewNode(ast.KindPattern, nil, result...) -} - -func commonChildren(nodes []*ast.Node) (commonLeft, commonRight []*ast.Node) { - if len(nodes) <= 1 { - return - } - - // find node that has least number of children - idx := leastChildren(nodes) - if idx == -1 { - return - } - tree := nodes[idx] - treeLength := len(tree.Children) - - // allocate max able size for rightCommon slice - // to get ability insert elements in reverse order (from end to start) - // without sorting - commonRight = make([]*ast.Node, treeLength) - lastRight := treeLength // will use this to get results as commonRight[lastRight:] - - var ( - breakLeft bool - breakRight bool - commonTotal int - ) - for i, j := 0, treeLength-1; commonTotal < treeLength && j >= 0 && !(breakLeft && breakRight); i, j = i+1, j-1 { - treeLeft := tree.Children[i] - treeRight := tree.Children[j] - - for k := 0; k < len(nodes) && !(breakLeft && breakRight); k++ { - // skip least children node - if k == idx { - continue - } - - restLeft := nodes[k].Children[i] - restRight := nodes[k].Children[j+len(nodes[k].Children)-treeLength] - - breakLeft = breakLeft || !treeLeft.Equal(restLeft) - - // disable searching for right common parts, if left part is already overlapping - breakRight = breakRight || (!breakLeft && j <= i) - breakRight = breakRight || !treeRight.Equal(restRight) - } - - if !breakLeft { - commonTotal++ - commonLeft = append(commonLeft, treeLeft) - } - if !breakRight { - commonTotal++ - lastRight = j - commonRight[j] = treeRight - } - } - - commonRight = commonRight[lastRight:] - - return -} - -func appendIfUnique(target []*ast.Node, val *ast.Node) []*ast.Node { - for _, n := range target { - if reflect.DeepEqual(n, val) { - return target - } - } - return append(target, val) -} - -func areOfSameKind(nodes []*ast.Node, kind ast.Kind) bool { - for _, n := range nodes { - if n.Kind != kind { - return false - } - } - return true -} - -func leastChildren(nodes []*ast.Node) int { - min := -1 - idx := -1 - for i, n := range nodes { - if idx == -1 || (len(n.Children) < min) { - min = len(n.Children) - idx = i - } - } - return idx -} - -func compileTreeChildren(tree *ast.Node, sep []rune) ([]match.Matcher, error) { - var matchers []match.Matcher - for _, desc := range tree.Children { - m, err := compile(desc, sep) - if err != nil { - return nil, err - } - matchers = append(matchers, optimizeMatcher(m)) - } - return matchers, nil -} - -func compile(tree *ast.Node, sep []rune) (m match.Matcher, err error) { - switch tree.Kind { - case ast.KindAnyOf: - // todo this could be faster on pattern_alternatives_combine_lite (see glob_test.go) - if n := minimizeTree(tree); n != nil { - return compile(n, sep) - } - matchers, err := compileTreeChildren(tree, sep) - if err != nil { - return nil, err - } - return match.NewAnyOf(matchers...), nil - - case ast.KindPattern: - if len(tree.Children) == 0 { - return match.NewNothing(), nil - } - matchers, err := compileTreeChildren(tree, sep) - if err != nil { - return nil, err - } - m, err = compileMatchers(minimizeMatchers(matchers)) - if err != nil { - return nil, err - } - - case ast.KindAny: - m = match.NewAny(sep) - - case ast.KindSuper: - m = match.NewSuper() - - case ast.KindSingle: - m = match.NewSingle(sep) - - case ast.KindNothing: - m = match.NewNothing() - - case ast.KindList: - l := tree.Value.(ast.List) - m = match.NewList([]rune(l.Chars), l.Not) - - case ast.KindRange: - r := tree.Value.(ast.Range) - m = match.NewRange(r.Lo, r.Hi, r.Not) - - case ast.KindText: - t := tree.Value.(ast.Text) - m = match.NewText(t.Text) - - default: - return nil, fmt.Errorf("could not compile tree: unknown node type") - } - - return optimizeMatcher(m), nil -} - -func Compile(tree *ast.Node, sep []rune) (match.Matcher, error) { - m, err := compile(tree, sep) - if err != nil { - return nil, err - } - - return m, nil -} diff --git a/vendor/github.com/gobwas/glob/glob.go b/vendor/github.com/gobwas/glob/glob.go index 2afde343a..fb3e47554 100644 --- a/vendor/github.com/gobwas/glob/glob.go +++ b/vendor/github.com/gobwas/glob/glob.go @@ -1,80 +1,158 @@ package glob import ( - "github.com/gobwas/glob/compiler" + "fmt" + + "github.com/gobwas/glob/internal/debug" "github.com/gobwas/glob/syntax" ) -// Glob represents compiled glob pattern. -type Glob interface { - Match(string) bool +// SyntaxError is returned by [Compile] when the given pattern can not be +// parsed. Offset points at the place in the pattern the error was detected +// at, so the tooling can do things like: +// +// {a,b +// ----^ unclosed `{` +type SyntaxError struct { + // Offset is a byte offset in the pattern. + Offset int + // Reason describes the error. + Reason string } -// Compile creates Glob for given pattern and strings (if any present after pattern) as separators. -// The pattern syntax is: +func (s *SyntaxError) Error() string { + return fmt.Sprintf("glob: syntax error at %d: %s", s.Offset, s.Reason) +} + +// Pattern represents a compiled glob pattern. // -// pattern: -// { term } +// A pattern is compiled into a tree of matchers: // -// term: -// `*` matches any sequence of non-separator characters -// `**` matches any sequence of characters -// `?` matches any single non-separator character -// `[` [ `!` ] { character-range } `]` -// character class (must be non-empty) -// `{` pattern-list `}` -// pattern alternatives -// c matches character c (c != `*`, `**`, `?`, `\`, `[`, `{`, `}`) -// `\` c matches character c +// `a` => "a" +// `a*` => ["a"·*] +// `{a*,b}` => {["a"·*]|"b"} // -// character-range: -// c matches character c (c != `\\`, `-`, `]`) -// `\` c matches character c -// lo `-` hi matches character c for lo <= c <= hi +// Matching is a backtracking walk over that tree; see [Pattern.Match]. +type Pattern struct { + // str is the pattern text the Pattern was compiled from; see + // [Pattern.String]. + str string + + // sep are the separators the Pattern was compiled with; see + // [Pattern.Separators]. + sep []rune + + // m is the root of the matcher tree; see [matcher]. + m matcher + + // state tells whether matching m needs the backtracking state, that + // is, whether it may save checkpoints; see [needsState]. A pattern + // without them is matched with a plain call chain. + state bool + + // The match preconditions: every matching string is at least minLen + // bytes and ends with suffix. They fail the obvious mismatches in O(1) + // instead of a backtracking walk -- e.g. `a*a*a*b` requires the + // trailing `b`, no matter how the stars go. + // + // A precondition pays off only when it catches a mismatch earlier than + // the walk would, which is why: + // + // - there is no required prefix: the walk is left-to-right, so a + // leading literal is the first thing checked anyway, while a bad + // suffix or length is discovered last, after the whole + // backtracking exploration; + // + // - they are computed for the stateful patterns only: a stateless + // pattern is a plain call chain whose matchers perform these very + // checks themselves (e.g. suffixMatcher is a HasSuffix), so the + // precondition would only duplicate them. + minLen int + suffix string +} + +// String returns the source text used to compile the pattern, the same way +// [regexp.Regexp.String] does. // -// pattern-list: -// pattern { `,` pattern } -// comma-separated (without spaces) patterns +// Note that separators are not part of String: they are given to Compile +// alongside the pattern text. +func (p *Pattern) String() string { + return p.str +} + +// Separators returns the separators the pattern was compiled with, in the +// order they were given to Compile; nil when there are none. // -func Compile(pattern string, separators ...rune) (Glob, error) { - ast, err := syntax.Parse(pattern) - if err != nil { - return nil, err - } +// The returned slice is the very one given to Compile, sharing its backing +// array: it is not copied on the way in or out. Matching does not use it. +func (p *Pattern) Separators() []rune { + return p.sep +} - matcher, err := compiler.Compile(ast, separators) - if err != nil { - return nil, err +func init() { + // The matcher tree is unexported; hand its rendering to the in-module + // tooling (cmd/globtest -v) without widening the public API. + debug.Tree = func(p any) string { + return p.(*Pattern).m.String() } +} - return matcher, nil +// Compile compiles the glob pattern. The separators, if given, are the +// characters `*` and `?` do not match (`**` does); they can not be changed +// after the compilation, see [Pattern.Separators]. A malformed pattern is +// reported with a [*SyntaxError]. +// +// The pattern syntax is: +// +// pattern: +// { term } +// +// term: +// `*` matches any sequence of non-separator characters +// `**` matches any sequence of characters +// `?` matches any single non-separator character +// `[` [ `!` ] class `]` +// character class; `!` negates it +// `{` pattern-list `}` +// pattern alternatives +// c matches character c (c != `*`, `**`, `?`, `\`, `[`, `{`, `}`) +// `\` c matches character c +// +// class: +// lo `-` hi matches character c for lo <= c <= hi +// { c } matches any of the listed characters (c != `\`, `]`; +// `\` c matches c, `-` is literal here); must be non-empty +// +// pattern-list: +// pattern { `,` pattern } +// comma-separated (without spaces) patterns +func Compile(pattern string, separators ...rune) (*Pattern, error) { + return compile(pattern, separators) } -// MustCompile is the same as Compile, except that if Compile returns error, this will panic -func MustCompile(pattern string, separators ...rune) Glob { +// MustCompile is the same as Compile, except that if Compile returns error, +// this will panic. +func MustCompile(pattern string, separators ...rune) *Pattern { g, err := Compile(pattern, separators...) if err != nil { panic(err) } - return g } -// QuoteMeta returns a string that quotes all glob pattern meta characters -// inside the argument text; For example, QuoteMeta(`{foo*}`) returns `\[foo\*\]`. +// QuoteMeta returns a copy of the s having all glob meta characters escaped. func QuoteMeta(s string) string { + // 2 is a pessimistic way of allocating an extra byte per each byte in s. b := make([]byte, 2*len(s)) - - // a byte loop is correct because all meta characters are ASCII j := 0 + // A byte loop is correct here because all meta characters are ASCII. for i := 0; i < len(s); i++ { - if syntax.Special(s[i]) { + if syntax.IsSpecial(s[i]) { b[j] = '\\' j++ } b[j] = s[i] j++ } - return string(b[0:j]) } diff --git a/vendor/github.com/gobwas/glob/internal/debug/debug_disabled.go b/vendor/github.com/gobwas/glob/internal/debug/debug_disabled.go new file mode 100644 index 000000000..1dcc50d44 --- /dev/null +++ b/vendor/github.com/gobwas/glob/internal/debug/debug_disabled.go @@ -0,0 +1,8 @@ +//go:build !globdebug +// +build !globdebug + +package debug + +const Enabled = false + +func Printf(f string, args ...any) {} diff --git a/vendor/github.com/gobwas/glob/internal/debug/debug_enabled.go b/vendor/github.com/gobwas/glob/internal/debug/debug_enabled.go new file mode 100644 index 000000000..26aeebd61 --- /dev/null +++ b/vendor/github.com/gobwas/glob/internal/debug/debug_enabled.go @@ -0,0 +1,14 @@ +//go:build globdebug +// +build globdebug + +package debug + +import ( + "fmt" +) + +const Enabled = true + +func Printf(f string, args ...any) { + fmt.Printf(f, args...) +} diff --git a/vendor/github.com/gobwas/glob/internal/debug/tree.go b/vendor/github.com/gobwas/glob/internal/debug/tree.go new file mode 100644 index 000000000..c716a141e --- /dev/null +++ b/vendor/github.com/gobwas/glob/internal/debug/tree.go @@ -0,0 +1,8 @@ +package debug + +// Tree renders the matcher tree of a compiled *glob.Pattern. +// +// It is set by package glob at init time: the pattern internals are +// unexported, and this keeps them so while letting the in-module tooling +// (cmd/globtest -v) print them. The format is not stable. +var Tree func(pattern any) string diff --git a/vendor/github.com/gobwas/glob/match.go b/vendor/github.com/gobwas/glob/match.go new file mode 100644 index 000000000..2b8425706 --- /dev/null +++ b/vendor/github.com/gobwas/glob/match.go @@ -0,0 +1,788 @@ +package glob + +import ( + "fmt" + "slices" + "strconv" + "strings" + "sync" + "unicode/utf8" + "unsafe" + + "github.com/gobwas/glob/internal/debug" +) + +// Match reports whether s matches the pattern. +func (p *Pattern) Match(s string) bool { + var x matchContext + if p.state { + if len(s) < p.minLen || !strings.HasSuffix(s, p.suffix) { + return false + } + state := acquireState() + defer releaseState(state) + x.state = state + } + for { + n, match := p.m.Match(x, s[x.offset:]) + // Note: debug.Enabled is a build-tag constant; when it is false the + // whole block (including the argument evaluation) is compiled away. + if debug.Enabled && x.state != nil { + debug.Printf("stack: %s\n", formatStack(x.state.stack)) + debug.Printf("stars: %s\n", formatStack(x.state.stars)) + } + if match && n == len(s[x.offset:]) { + if debug.Enabled { + debug.Printf("match!\n") + } + return true + } + if x.state == nil { + // The pattern never saves checkpoints (see [needsState]): + // nothing to backtrack to. + return false + } + var ( + c checkpoint + k checkpointKind + ) + switch { + case len(x.state.stars) > 0: + if debug.Enabled { + debug.Printf("has star\n") + } + c = popLast(&x.state.stars) + k = checkpointStars + + case len(x.state.stack) > 0: + if debug.Enabled { + debug.Printf("has stack\n") + } + c = popLast(&x.state.stack) + k = checkpointStack + + default: + if debug.Enabled { + debug.Printf("no match\n") + } + return false + } + x.offset = c.offset + x.kind = k + x.frame = frame{ + path: c.path, + depth: 0, + } + } +} + +// matcher is a node of the tree a pattern compiles into. +// +// Match matches the beginning of s and reports how many bytes it consumed; +// the caller goes on with the rest. A matcher may consume nothing and still +// match: a void does, and so does a non-terminal star -- it stores its +// restart points instead and lets the walk continue, to be resumed from one +// of them on a mismatch later; see [Pattern.Match]. The context tells where +// in the input and in the tree the matcher is; see [matchContext]. +// +// String renders the node for the debug output and cmd/globtest -v; the +// notation is described at [Pattern]. +type matcher interface { + Match(matchContext, string) (n int, matched bool) + String() string +} + +// frame tells where in the matcher tree the walk currently is: the path from +// the root down to the current node, and the depth of the node. +// +// A checkpoint stores the frame's path; resuming it re-enters the tree from +// the root and follows the path back to the very node that saved it (an +// alternative to try, or a star to restart) -- see [Pattern.Match], +// [multiMatcher.Match] and [altMatcher.Match]. +// +// For `{a*b,c}y`, compiled into [{["a"·*·"b"]|"c"}·"y"], the frame at each +// node the walk visits is: +// +// node path depth +// [{["a"·*·"b"]|"c"}·"y"] [] 0 the root +// {["a"·*·"b"]|"c"} [0]* 1 +// ["a"·*·"b"] [0 0]* 2 +// "a" [0 0 0]* 3 +// * [0 0 1] 3 +// "b" [0 0 2] 3 +// "c" [0 1] 2 reached only by resuming the +// checkpoint the alt saved +// "y" [1] 1 +// +// * the zeros are virtual: turning to child #0 records nothing, so the +// path actually stored is [] -- see path below. +type frame struct { + // path addresses the current node: path[d] is the index of the child taken + // at depth d, that is, in the multiMatcher or altMatcher d levels below + // the root. + // + // For `{a*b,c}y`, compiled into [{["a"·*·"b"]|"c"}·"y"]: + // + // [0 1] the "c" alternative -- what the alt checkpoints when it + // enters ["a"·*·"b"], to be tried on a mismatch + // + // [0 0 1] the star: child #1 of ["a"·*·"b"], which is alternative #0 + // of the alt, which is child #0 of the root sequence -- what + // the star's restart points carry + // + // It is recorded lazily: an index is stored only when the walk turns to a + // child other than #0 (see [matchContext.branch]), so the path may be + // shorter than the current depth -- the missing trailing entries are + // implicitly zero, and [frame.index] reads them as such. In the example + // above, at "a" the path is still empty, not [0 0 0]: the alt, alternative + // #0 and "a" were all entered as child #0. + path []int + + // depth is the depth of the current node (the one [frame.path] leads to): + // 0 at the root, 1 at its children, and so on; [matchContext.next] + // increments it on every descent. It is also where the node's own entry in + // path lives: path[depth] is the child to take next -- [frame.index] reads + // it, [matchContext.branch] writes it. + // + // It is not len(path): the path is recorded lazily, so it may fall short + // of the depth, and, when resuming a checkpoint, it is the whole path of + // the checkpoint, reaching beyond the depth all the way down to the node + // to resume at. + // + // To say it the other way, depth is what len(path) would be were the path + // always recorded in full -- the virtual zeros included -- and cut at the + // current node: the length of the node's full address in the tree. + // + // For `{a*b,c}y`, compiled into [{["a"·*·"b"]|"c"}·"y"], the nodes at + // each depth are: + // + // 0 [{["a"·*·"b"]|"c"}·"y"] the root sequence + // 1 {["a"·*·"b"]|"c"}, "y" its children + // 2 ["a"·*·"b"], "c" the alternatives + // 3 "a", *, "b" the children of ["a"·*·"b"] + depth int +} + +// index returns the index of the child to take at the current node: the one +// the path leads to when resuming a checkpoint, #0 otherwise. +func (v frame) index() int { + if v.depth >= len(v.path) { + return 0 + } + return v.path[v.depth] +} + +// checkpoint is a place to resume the walk from on a mismatch. +type checkpoint struct { + // offset is the position in the input to resume at. + offset int + + // path leads to the node that saved the checkpoint; see [frame]. + // + // Unlike a live frame's, it is always at full length -- the virtual zeros + // written out -- so len(path) is the depth of that node, and a checkpoint + // needs no depth of its own: resuming starts at the root and tells it has + // arrived by comparing the walk's depth against len(path); see + // [matchContext.branch], [matchContext.storeStar] and [altMatcher.Match]. + path []int +} + +// checkpointKind tells which pile a checkpoint was taken from during the +// backtracking in [Pattern.Match]. +type checkpointKind int + +const ( + // checkpointStack is an alternative checkpoint saved by altMatcher. + checkpointStack checkpointKind = iota + // checkpointStars is a star restart point saved by starMatcher. + checkpointStars +) + +// matchContext is what a matcher is called with: where in the input and in +// the tree it is, plus the backtracking state shared by the whole walk. It +// is passed by value, so a matcher's changes to it are seen by its +// descendants only. +type matchContext struct { + // offset is the position in the whole input the current node matches from. + // The matchers see only the remainder of the input, so it is what a + // checkpoint records to resume at the same place; see [checkpoint]. + offset int + + // frame is where in the matcher tree the current node is; see [frame]. + frame frame + + // state holds the checkpoint piles and the path arena shared by the + // whole walk. + state *matchState + + // kind tells which pile the checkpoint being resumed was taken from. + // See [altMatcher.Match] for its use. + kind checkpointKind + + // starsFloor is the number of star restart points that existed when + // the walk entered the current alternative. The entries below it were + // born outside of the alternative and must not be discarded by the + // stars inside it; see [matchContext.storeStar]. + starsFloor int +} + +// push saves an alternative checkpoint at the current offset for the node f +// leads to; see [altMatcher.Match]. +func (x matchContext) push(f frame) { + x.state.stack = append(x.state.stack, checkpoint{ + offset: x.offset, + path: f.path, + }) + if debug.Enabled { + debug.Printf( + "checkpoint offset=%d path=%v\n", + x.offset, f.path, + ) + } +} + +// storeStar saves a restart point for the current star at offset bytes +// further in the input; reset tells whether the star may discard the pending +// restart points first, see below. +func (x matchContext) storeStar(offset int, reset bool) { + path := x.frame.path + if d := x.frame.depth; len(path) < d { + // The walk records an index in path only when it turns to a child + // other than the first one; levels entered at child #0 are implicit. + // Store the path at its full length (the missing entries are always + // zeros) so that the alts above can tell this checkpoint from their + // own. See [altMatcher.Match]. + p := x.state.allocPath(d) + copy(p, path) + path = p + } + if reset { + // This star can extend over anything the pending restart points could + // reach -- they are redundant, discard them. See + // research.swtch.com/glob. + // + // However, only the restart points born inside the current alternative + // may be discarded. An outer star, when resumed, re-enters the + // enclosing alt and may pick another alternative -- something this + // star, locked inside its own alternative, can not absorb. See the + // `*{*0,}` test: the outer star must survive the inner one to reach + // the empty alternative. + x.state.stars = x.state.stars[:x.starsFloor] + } + x.state.stars = append(x.state.stars, checkpoint{ + offset: x.offset + offset, + path: path, + }) + if debug.Enabled { + debug.Printf( + "star offset=%d path=%v reset=%t\n", + x.offset+offset, path, reset, + ) + } +} + +// next returns the context for a child of the current node, matching offset +// bytes further in the input: one level deeper in the tree. +func (x matchContext) next(offset int) matchContext { + x.offset = x.offset + offset + x.frame.depth += 1 + return x +} + +// branch returns a copy of the current frame with its path turned to child i +// at the current level, discarding the deeper levels. The new path is +// allocated from the state's arena. +func (x matchContext) branch(i int) frame { + f := x.frame + path := x.state.allocPath(f.depth + 1) + copy(path, f.path) + path[f.depth] = i + f.path = path + return f +} + +// matchState holds the backtracking state of a single [Pattern.Match] call. +// The states are pooled globally: the buffers keep their grown capacity +// between the matches, so a steady-state Match does not allocate them. +type matchState struct { + // stars are the star restart points and stack the alternative + // checkpoints, both LIFO. On a mismatch the walk resumes from the most + // recent restart point, if any, before the most recent alternative; see + // [Pattern.Match]. + stars []checkpoint + stack []checkpoint + + // arena is the buffer the checkpoint paths are allocated from; see + // [matchState.allocPath]. It is bulk-freed when the match ends, which + // spares the per-path lifetime reasoning: a path may be shared between + // the current frame and several checkpoints. + arena []int +} + +// allocPath returns a zeroed []int of length n allocated from the state's +// arena. When the arena runs out of capacity, a fresh chunk is started; the +// paths allocated from the previous chunks stay valid, since the chunks are +// kept alive by the paths referencing them. +func (st *matchState) allocPath(n int) []int { + if cap(st.arena)-len(st.arena) < n { + st.arena = make([]int, 0, max(2*cap(st.arena), n, 32)) + } + p := st.arena[len(st.arena) : len(st.arena)+n : len(st.arena)+n] + st.arena = st.arena[:len(st.arena)+n] + clear(p) + return p +} + +var statePool sync.Pool // Pool[*matchState] + +// acquireState takes a state from the pool, or makes a new one. +func acquireState() *matchState { + if st, _ := statePool.Get().(*matchState); st != nil { + return st + } + return &matchState{} +} + +// releaseState empties the state and puts it back to the pool. +func releaseState(st *matchState) { + resetCheckpoints(&st.stars) + resetCheckpoints(&st.stack) + // The arena holds no references; keep the (largest) chunk as is. + st.arena = st.arena[:0] + statePool.Put(st) +} + +// resetCheckpoints empties s keeping its capacity. The whole backing array +// is zeroed (not only the live part) to drop the references to the +// checkpoint paths popped during the match. +func resetCheckpoints(s *[]checkpoint) { + full := (*s)[:cap(*s)] + clear(full) + *s = full[:0] +} + +// multiMatcher is a sequence, ["a"·*·"b"]: it matches its children one +// after another, each on the input the previous ones left. +type multiMatcher []matcher + +func (ms multiMatcher) String() string { + var sb strings.Builder + sb.WriteByte('[') + for i, m := range ms { + if i > 0 { + sb.WriteString("·") + } + sb.WriteString(m.String()) + } + sb.WriteByte(']') + return sb.String() +} + +func (ms multiMatcher) Match(x matchContext, s string) (n int, ok bool) { + for i := x.frame.index(); i < len(ms); i++ { + if i != x.frame.index() && x.state != nil { + // The path is recorded for the checkpoints the descendants may + // save; in a stateless walk (see [needsState]) there are none + // and nobody would ever read it. + x.frame = x.branch(i) + } + child := x.next(n) + k, ok := ms[i].Match(child, s[n:]) + if debug.Enabled { + debug.Printf( + "[%T@%p] #%d match %#q against %[5]T(%[5]s) at path=%v depth=%d => %d %t\n", + ms, unsafe.SliceData(ms), i, s[n:], ms[i], + child.frame.path, child.frame.depth, k, ok, + ) + } + if !ok { + return 0, false + } + n += k + } + return n, true +} + +// altMatcher is a group of alternatives, {"a"|"b"}: it matches the one the +// walk is at (the first one when entered anew), having saved a checkpoint +// for the next one to be tried on a mismatch later. +type altMatcher []matcher + +func (ms altMatcher) String() string { + var sb strings.Builder + sb.WriteByte('{') + for i, m := range ms { + if i > 0 { + sb.WriteString("|") + } + sb.WriteString(m.String()) + } + sb.WriteByte('}') + return sb.String() +} + +func (ms altMatcher) Match(x matchContext, s string) (int, bool) { + i := x.frame.index() + // Save a checkpoint for the next alternative to consider it in case of + // a mismatch later (if any). This must be done only when: + // + // - the alt is entered for the first time (the resume path ends above + // this level, or there is none); + // + // - the resume path ends exactly at this level with an alternative + // checkpoint -- its job is "try alternative #i", so the one for the + // next alternative must be saved now. Note that a star restart point + // may end at this level too (a star being a direct child of the alt, + // as in `{*,b}`) -- it must not trigger a save. + // + // Otherwise the walk is merely passing through this alt on its way to + // resume a deeper checkpoint -- the one for the next alternative was + // already saved when the alt was entered for the first time, and saving + // it again on every star restart would blow the stack up exponentially. + // See the "alternatives" tests. + if next := i + 1; next < len(ms) { + d := len(x.frame.path) + if x.frame.depth >= d || (x.frame.depth == d-1 && x.kind == checkpointStack) { + x.push(x.branch(next)) + } + } + // The stars below this level may only discard the restart points born + // inside the same alternative; see [matchContext.storeStar]. + x.starsFloor = len(x.state.stars) + child := x.next(0) + n, match := ms[i].Match(child, s) + if debug.Enabled { + debug.Printf( + "[%T@%p] #%d match %#q against %[5]T(%[5]s) at path=%v depth=%d => %d %t\n", + ms, unsafe.SliceData(ms), i, s, ms[i], + child.frame.path, child.frame.depth, n, match, + ) + } + return n, match +} + +// textMatcher is a literal, "abc". +type textMatcher struct { + Text string +} + +func (m *textMatcher) String() string { + return strconv.Quote(m.Text) +} + +func (m *textMatcher) Match(_ matchContext, s string) (int, bool) { + if strings.HasPrefix(s, m.Text) { + return len(m.Text), true + } + return 0, false +} + +// charMatcher is a `?`: any single character but a separator. +type charMatcher struct { + Sep []rune +} + +func (m *charMatcher) String() string { + var sb strings.Builder + sb.WriteByte('?') + if len(m.Sep) > 0 { + sb.WriteByte('(') + formatRunes(&sb, m.Sep) + sb.WriteByte(')') + } + return sb.String() +} + +func (m *charMatcher) Match(_ matchContext, s string) (int, bool) { + if len(s) == 0 { + return 0, false + } + r, n := utf8.DecodeRuneInString(s) + if slices.Contains(m.Sep, r) { + return 0, false + } + return n, true +} + +// starMatcher is a `*` or a `**`: any sequence of characters, but for the +// separators in the former case. +type starMatcher struct { + // Sep are the separators the star may not extend over; empty for `**`. + Sep []rune + // SepStr is Sep as a string, for the byte-wise scans below. + SepStr string + + // Next is the literal the matcher right after this star begins with + // (when it is a textMatcher), set by [annotateStars]. A restart point + // at a position where the literal does not occur is a guaranteed + // mismatch, so the star jumps between its occurrences instead of + // retrying at every rune. + Next string + // Terminal is set by [annotateStars] when nothing follows this star + // anywhere in the pattern: the star then consumes everything in its + // reach at once, and no restart point can change the outcome. + Terminal bool +} + +// reach returns the length of the prefix of s the star may extend over: +// everything up to the nearest separator. +func (m *starMatcher) reach(s string) int { + if m.SepStr == "" { + return len(s) + } + if e := strings.IndexAny(s, m.SepStr); e >= 0 { + return e + } + return len(s) +} + +// storeSkip stores the restart point at the next occurrence of the m.Next +// literal instead of the next rune. +func (m *starMatcher) storeSkip(x matchContext, s string) { + reach := m.reach(s) + // Look for the occurrences starting within the star's reach; the + // literal itself may extend past it (it may contain the separators). + // Note that a valid UTF-8 literal can not match at a mid-rune + // position, so the one-byte skip below is rune-safe. + end := min(reach+len(m.Next), len(s)) + j := strings.Index(s[1:end], m.Next) + if j < 0 || 1+j > reach { + return + } + x.storeStar(1+j, len(m.Sep) == 0) +} + +func (m *starMatcher) String() string { + var sb strings.Builder + sb.WriteByte('*') + if len(m.Sep) > 0 { + sb.WriteByte('(') + formatRunes(&sb, m.Sep) + sb.WriteByte(')') + } + return sb.String() +} + +func (m *starMatcher) Match(x matchContext, s string) (int, bool) { + if m.Terminal { + // Nothing follows this star in the pattern: either it consumes + // the whole remainder within its reach, or the match fails. + return m.reach(s), true + } + if len(s) == 0 { + return 0, true + } + if m.Next != "" { + m.storeSkip(x, s) + return 0, true + } + r, n := utf8.DecodeRuneInString(s) + if !slices.Contains(m.Sep, r) { + // The star may extend over the rune: save the restart point past + // it. A separator-free star (`**`) can extend over anything the + // pending restart points could reach, so it may discard them; see + // [matchContext.storeStar]. + x.storeStar(n, len(m.Sep) == 0) + } + return 0, true +} + +// runeRangeMatcher is a character range class, `[a-z]` or `[!a-z]`. +type runeRangeMatcher struct { + Lo rune + Hi rune + Not bool +} + +func (m *runeRangeMatcher) String() string { + var sb strings.Builder + if m.Not { + sb.WriteByte('!') + } + sb.WriteByte('[') + sb.WriteRune(m.Lo) + sb.WriteByte('-') + sb.WriteRune(m.Hi) + sb.WriteByte(']') + return sb.String() +} + +func (m *runeRangeMatcher) Match(_ matchContext, s string) (int, bool) { + // Note that an invalid byte decodes as U+FFFD, and is matched as such, + // the same way regexp does; only the empty input is a mismatch. + r, n := utf8.DecodeRuneInString(s) + if n == 0 { + return 0, false + } + ok := m.Lo <= r && r <= m.Hi + if ok != m.Not { + return n, true + } + return 0, false +} + +// runeSetMatcher is a character set class, `[abc]` or `[!abc]`. +type runeSetMatcher struct { + Set map[rune]struct{} + Not bool +} + +// formatRunes writes rs, sorted and comma-separated, to sb. +func formatRunes(sb *strings.Builder, rs []rune) { + rs = slices.Clone(rs) // Not to reorder the caller's, e.g. a matcher's Sep. + slices.Sort(rs) + for i, r := range rs { + if i > 0 { + sb.WriteByte(',') + } + sb.WriteRune(r) + } +} + +func (m *runeSetMatcher) String() string { + rs := make([]rune, 0, len(m.Set)) + for r := range m.Set { + rs = append(rs, r) + } + var sb strings.Builder + if m.Not { + sb.WriteByte('!') + } + sb.WriteByte('[') + formatRunes(&sb, rs) + sb.WriteByte(']') + return sb.String() +} + +func (m *runeSetMatcher) Match(_ matchContext, s string) (int, bool) { + // See the note in runeRangeMatcher.Match. + r, n := utf8.DecodeRuneInString(s) + if n == 0 { + return 0, false + } + if _, has := m.Set[r]; has != m.Not { + return n, true + } + return 0, false +} + +// voidMatcher matches the empty string: an empty alternative, `{a,}`. In a +// sequence it is dropped by [normalizeSequence]. +type voidMatcher struct{} + +func (*voidMatcher) String() string { + return "void" +} + +func (*voidMatcher) Match(matchContext, string) (int, bool) { + return 0, true +} + +// The shaped matchers below are the compile-time rewrites of the common +// terminal sub-sequences; see [specialize]. Nothing may follow them in the +// pattern, so each one either consumes the whole remainder of the input or +// fails -- deterministically, storing no checkpoints. + +// prefixMatcher is a terminal `abc*`. +type prefixMatcher struct { + Text string + Sep string +} + +func (m *prefixMatcher) String() string { + return "prefix(" + strconv.Quote(m.Text) + ")" +} + +func (m *prefixMatcher) Match(_ matchContext, s string) (int, bool) { + if strings.HasPrefix(s, m.Text) && noSep(s[len(m.Text):], m.Sep) { + return len(s), true + } + return 0, false +} + +// suffixMatcher is a terminal `*abc`. +type suffixMatcher struct { + Text string + Sep string +} + +func (m *suffixMatcher) String() string { + return "suffix(" + strconv.Quote(m.Text) + ")" +} + +func (m *suffixMatcher) Match(_ matchContext, s string) (int, bool) { + if strings.HasSuffix(s, m.Text) && noSep(s[:len(s)-len(m.Text)], m.Sep) { + return len(s), true + } + return 0, false +} + +// prefixSuffixMatcher is a terminal `abc*def`. +type prefixSuffixMatcher struct { + Prefix string + Suffix string + Sep string +} + +func (m *prefixSuffixMatcher) String() string { + return "prefix_suffix(" + strconv.Quote(m.Prefix) + "," + strconv.Quote(m.Suffix) + ")" +} + +func (m *prefixSuffixMatcher) Match(_ matchContext, s string) (int, bool) { + // The length check keeps the prefix and the suffix from overlapping: + // `a*ant` must not match `ant`. + if len(s) >= len(m.Prefix)+len(m.Suffix) && + strings.HasPrefix(s, m.Prefix) && + strings.HasSuffix(s, m.Suffix) && + noSep(s[len(m.Prefix):len(s)-len(m.Suffix)], m.Sep) { + return len(s), true + } + return 0, false +} + +// containsMatcher is a terminal `*abc*` with the separator-free stars. +type containsMatcher struct { + Text string +} + +func (m *containsMatcher) String() string { + return "contains(" + strconv.Quote(m.Text) + ")" +} + +func (m *containsMatcher) Match(_ matchContext, s string) (int, bool) { + if strings.Contains(s, m.Text) { + return len(s), true + } + return 0, false +} + +// noSep reports whether s contains none of the separators. +func noSep(s, sep string) bool { + return sep == "" || !strings.ContainsAny(s, sep) +} + +// formatCheckpoint renders c as path@offset for the debug output. +func formatCheckpoint(c checkpoint) string { + return fmt.Sprintf("%v@%d", c.path, c.offset) +} + +// formatStack renders the checkpoint pile s for the debug output, the most +// recent one last. +func formatStack(s []checkpoint) string { + var sb strings.Builder + for i, c := range s { + if i > 0 { + sb.WriteString(" -> ") + } + sb.WriteString(formatCheckpoint(c)) + } + return sb.String() +} + +// popLast panics if s is empty. +func popLast[T any, E ~[]T](s *E) T { + n := len(*s) + r := (*s)[n-1] + *s = (*s)[:n-1] + return r +} diff --git a/vendor/github.com/gobwas/glob/match/any.go b/vendor/github.com/gobwas/glob/match/any.go deleted file mode 100644 index 514a9a5c4..000000000 --- a/vendor/github.com/gobwas/glob/match/any.go +++ /dev/null @@ -1,45 +0,0 @@ -package match - -import ( - "fmt" - "github.com/gobwas/glob/util/strings" -) - -type Any struct { - Separators []rune -} - -func NewAny(s []rune) Any { - return Any{s} -} - -func (self Any) Match(s string) bool { - return strings.IndexAnyRunes(s, self.Separators) == -1 -} - -func (self Any) Index(s string) (int, []int) { - found := strings.IndexAnyRunes(s, self.Separators) - switch found { - case -1: - case 0: - return 0, segments0 - default: - s = s[:found] - } - - segments := acquireSegments(len(s)) - for i := range s { - segments = append(segments, i) - } - segments = append(segments, len(s)) - - return 0, segments -} - -func (self Any) Len() int { - return lenNo -} - -func (self Any) String() string { - return fmt.Sprintf("", string(self.Separators)) -} diff --git a/vendor/github.com/gobwas/glob/match/any_of.go b/vendor/github.com/gobwas/glob/match/any_of.go deleted file mode 100644 index 8e65356cd..000000000 --- a/vendor/github.com/gobwas/glob/match/any_of.go +++ /dev/null @@ -1,82 +0,0 @@ -package match - -import "fmt" - -type AnyOf struct { - Matchers Matchers -} - -func NewAnyOf(m ...Matcher) AnyOf { - return AnyOf{Matchers(m)} -} - -func (self *AnyOf) Add(m Matcher) error { - self.Matchers = append(self.Matchers, m) - return nil -} - -func (self AnyOf) Match(s string) bool { - for _, m := range self.Matchers { - if m.Match(s) { - return true - } - } - - return false -} - -func (self AnyOf) Index(s string) (int, []int) { - index := -1 - - segments := acquireSegments(len(s)) - for _, m := range self.Matchers { - idx, seg := m.Index(s) - if idx == -1 { - continue - } - - if index == -1 || idx < index { - index = idx - segments = append(segments[:0], seg...) - continue - } - - if idx > index { - continue - } - - // here idx == index - segments = appendMerge(segments, seg) - } - - if index == -1 { - releaseSegments(segments) - return -1, nil - } - - return index, segments -} - -func (self AnyOf) Len() (l int) { - l = -1 - for _, m := range self.Matchers { - ml := m.Len() - switch { - case l == -1: - l = ml - continue - - case ml == -1: - return -1 - - case l != ml: - return -1 - } - } - - return -} - -func (self AnyOf) String() string { - return fmt.Sprintf("", self.Matchers) -} diff --git a/vendor/github.com/gobwas/glob/match/btree.go b/vendor/github.com/gobwas/glob/match/btree.go deleted file mode 100644 index a8130e93e..000000000 --- a/vendor/github.com/gobwas/glob/match/btree.go +++ /dev/null @@ -1,146 +0,0 @@ -package match - -import ( - "fmt" - "unicode/utf8" -) - -type BTree struct { - Value Matcher - Left Matcher - Right Matcher - ValueLengthRunes int - LeftLengthRunes int - RightLengthRunes int - LengthRunes int -} - -func NewBTree(Value, Left, Right Matcher) (tree BTree) { - tree.Value = Value - tree.Left = Left - tree.Right = Right - - lenOk := true - if tree.ValueLengthRunes = Value.Len(); tree.ValueLengthRunes == -1 { - lenOk = false - } - - if Left != nil { - if tree.LeftLengthRunes = Left.Len(); tree.LeftLengthRunes == -1 { - lenOk = false - } - } - - if Right != nil { - if tree.RightLengthRunes = Right.Len(); tree.RightLengthRunes == -1 { - lenOk = false - } - } - - if lenOk { - tree.LengthRunes = tree.LeftLengthRunes + tree.ValueLengthRunes + tree.RightLengthRunes - } else { - tree.LengthRunes = -1 - } - - return tree -} - -func (self BTree) Len() int { - return self.LengthRunes -} - -// todo? -func (self BTree) Index(s string) (int, []int) { - return -1, nil -} - -func (self BTree) Match(s string) bool { - inputLen := len(s) - - // self.Length, self.RLen and self.LLen are values meaning the length of runes for each part - // here we manipulating byte length for better optimizations - // but these checks still works, cause minLen of 1-rune string is 1 byte. - if self.LengthRunes != -1 && self.LengthRunes > inputLen { - return false - } - - // try to cut unnecessary parts - // by knowledge of length of right and left part - var offset, limit int - if self.LeftLengthRunes >= 0 { - offset = self.LeftLengthRunes - } - if self.RightLengthRunes >= 0 { - limit = inputLen - self.RightLengthRunes - } else { - limit = inputLen - } - - for offset < limit { - // search for matching part in substring - index, segments := self.Value.Index(s[offset:limit]) - if index == -1 { - releaseSegments(segments) - return false - } - - l := s[:offset+index] - var left bool - if self.Left != nil { - left = self.Left.Match(l) - } else { - left = l == "" - } - - if left { - for i := len(segments) - 1; i >= 0; i-- { - length := segments[i] - - var right bool - var r string - // if there is no string for the right branch - if inputLen <= offset+index+length { - r = "" - } else { - r = s[offset+index+length:] - } - - if self.Right != nil { - right = self.Right.Match(r) - } else { - right = r == "" - } - - if right { - releaseSegments(segments) - return true - } - } - } - - _, step := utf8.DecodeRuneInString(s[offset+index:]) - offset += index + step - - releaseSegments(segments) - } - - return false -} - -func (self BTree) String() string { - const n string = "" - var l, r string - if self.Left == nil { - l = n - } else { - l = self.Left.String() - } - if self.Right == nil { - r = n - } else { - r = self.Right.String() - } - - return fmt.Sprintf("%s]>", l, self.Value, r) -} diff --git a/vendor/github.com/gobwas/glob/match/contains.go b/vendor/github.com/gobwas/glob/match/contains.go deleted file mode 100644 index 0998e95b0..000000000 --- a/vendor/github.com/gobwas/glob/match/contains.go +++ /dev/null @@ -1,58 +0,0 @@ -package match - -import ( - "fmt" - "strings" -) - -type Contains struct { - Needle string - Not bool -} - -func NewContains(needle string, not bool) Contains { - return Contains{needle, not} -} - -func (self Contains) Match(s string) bool { - return strings.Contains(s, self.Needle) != self.Not -} - -func (self Contains) Index(s string) (int, []int) { - var offset int - - idx := strings.Index(s, self.Needle) - - if !self.Not { - if idx == -1 { - return -1, nil - } - - offset = idx + len(self.Needle) - if len(s) <= offset { - return 0, []int{offset} - } - s = s[offset:] - } else if idx != -1 { - s = s[:idx] - } - - segments := acquireSegments(len(s) + 1) - for i := range s { - segments = append(segments, offset+i) - } - - return 0, append(segments, offset+len(s)) -} - -func (self Contains) Len() int { - return lenNo -} - -func (self Contains) String() string { - var not string - if self.Not { - not = "!" - } - return fmt.Sprintf("", not, self.Needle) -} diff --git a/vendor/github.com/gobwas/glob/match/every_of.go b/vendor/github.com/gobwas/glob/match/every_of.go deleted file mode 100644 index 7c968ee36..000000000 --- a/vendor/github.com/gobwas/glob/match/every_of.go +++ /dev/null @@ -1,99 +0,0 @@ -package match - -import ( - "fmt" -) - -type EveryOf struct { - Matchers Matchers -} - -func NewEveryOf(m ...Matcher) EveryOf { - return EveryOf{Matchers(m)} -} - -func (self *EveryOf) Add(m Matcher) error { - self.Matchers = append(self.Matchers, m) - return nil -} - -func (self EveryOf) Len() (l int) { - for _, m := range self.Matchers { - if ml := m.Len(); l > 0 { - l += ml - } else { - return -1 - } - } - - return -} - -func (self EveryOf) Index(s string) (int, []int) { - var index int - var offset int - - // make `in` with cap as len(s), - // cause it is the maximum size of output segments values - next := acquireSegments(len(s)) - current := acquireSegments(len(s)) - - sub := s - for i, m := range self.Matchers { - idx, seg := m.Index(sub) - if idx == -1 { - releaseSegments(next) - releaseSegments(current) - return -1, nil - } - - if i == 0 { - // we use copy here instead of `current = seg` - // cause seg is a slice from reusable buffer `in` - // and it could be overwritten in next iteration - current = append(current, seg...) - } else { - // clear the next - next = next[:0] - - delta := index - (idx + offset) - for _, ex := range current { - for _, n := range seg { - if ex+delta == n { - next = append(next, n) - } - } - } - - if len(next) == 0 { - releaseSegments(next) - releaseSegments(current) - return -1, nil - } - - current = append(current[:0], next...) - } - - index = idx + offset - sub = s[index:] - offset += idx - } - - releaseSegments(next) - - return index, current -} - -func (self EveryOf) Match(s string) bool { - for _, m := range self.Matchers { - if !m.Match(s) { - return false - } - } - - return true -} - -func (self EveryOf) String() string { - return fmt.Sprintf("", self.Matchers) -} diff --git a/vendor/github.com/gobwas/glob/match/list.go b/vendor/github.com/gobwas/glob/match/list.go deleted file mode 100644 index 7fd763ecd..000000000 --- a/vendor/github.com/gobwas/glob/match/list.go +++ /dev/null @@ -1,49 +0,0 @@ -package match - -import ( - "fmt" - "github.com/gobwas/glob/util/runes" - "unicode/utf8" -) - -type List struct { - List []rune - Not bool -} - -func NewList(list []rune, not bool) List { - return List{list, not} -} - -func (self List) Match(s string) bool { - r, w := utf8.DecodeRuneInString(s) - if len(s) > w { - return false - } - - inList := runes.IndexRune(self.List, r) != -1 - return inList == !self.Not -} - -func (self List) Len() int { - return lenOne -} - -func (self List) Index(s string) (int, []int) { - for i, r := range s { - if self.Not == (runes.IndexRune(self.List, r) == -1) { - return i, segmentsByRuneLength[utf8.RuneLen(r)] - } - } - - return -1, nil -} - -func (self List) String() string { - var not string - if self.Not { - not = "!" - } - - return fmt.Sprintf("", not, string(self.List)) -} diff --git a/vendor/github.com/gobwas/glob/match/match.go b/vendor/github.com/gobwas/glob/match/match.go deleted file mode 100644 index f80e007fb..000000000 --- a/vendor/github.com/gobwas/glob/match/match.go +++ /dev/null @@ -1,81 +0,0 @@ -package match - -// todo common table of rune's length - -import ( - "fmt" - "strings" -) - -const lenOne = 1 -const lenZero = 0 -const lenNo = -1 - -type Matcher interface { - Match(string) bool - Index(string) (int, []int) - Len() int - String() string -} - -type Matchers []Matcher - -func (m Matchers) String() string { - var s []string - for _, matcher := range m { - s = append(s, fmt.Sprint(matcher)) - } - - return fmt.Sprintf("%s", strings.Join(s, ",")) -} - -// appendMerge merges and sorts given already SORTED and UNIQUE segments. -func appendMerge(target, sub []int) []int { - lt, ls := len(target), len(sub) - out := make([]int, 0, lt+ls) - - for x, y := 0, 0; x < lt || y < ls; { - if x >= lt { - out = append(out, sub[y:]...) - break - } - - if y >= ls { - out = append(out, target[x:]...) - break - } - - xValue := target[x] - yValue := sub[y] - - switch { - - case xValue == yValue: - out = append(out, xValue) - x++ - y++ - - case xValue < yValue: - out = append(out, xValue) - x++ - - case yValue < xValue: - out = append(out, yValue) - y++ - - } - } - - target = append(target[:0], out...) - - return target -} - -func reverseSegments(input []int) { - l := len(input) - m := l / 2 - - for i := 0; i < m; i++ { - input[i], input[l-i-1] = input[l-i-1], input[i] - } -} diff --git a/vendor/github.com/gobwas/glob/match/max.go b/vendor/github.com/gobwas/glob/match/max.go deleted file mode 100644 index d72f69eff..000000000 --- a/vendor/github.com/gobwas/glob/match/max.go +++ /dev/null @@ -1,49 +0,0 @@ -package match - -import ( - "fmt" - "unicode/utf8" -) - -type Max struct { - Limit int -} - -func NewMax(l int) Max { - return Max{l} -} - -func (self Max) Match(s string) bool { - var l int - for range s { - l += 1 - if l > self.Limit { - return false - } - } - - return true -} - -func (self Max) Index(s string) (int, []int) { - segments := acquireSegments(self.Limit + 1) - segments = append(segments, 0) - var count int - for i, r := range s { - count++ - if count > self.Limit { - break - } - segments = append(segments, i+utf8.RuneLen(r)) - } - - return 0, segments -} - -func (self Max) Len() int { - return lenNo -} - -func (self Max) String() string { - return fmt.Sprintf("", self.Limit) -} diff --git a/vendor/github.com/gobwas/glob/match/min.go b/vendor/github.com/gobwas/glob/match/min.go deleted file mode 100644 index db57ac8eb..000000000 --- a/vendor/github.com/gobwas/glob/match/min.go +++ /dev/null @@ -1,57 +0,0 @@ -package match - -import ( - "fmt" - "unicode/utf8" -) - -type Min struct { - Limit int -} - -func NewMin(l int) Min { - return Min{l} -} - -func (self Min) Match(s string) bool { - var l int - for range s { - l += 1 - if l >= self.Limit { - return true - } - } - - return false -} - -func (self Min) Index(s string) (int, []int) { - var count int - - c := len(s) - self.Limit + 1 - if c <= 0 { - return -1, nil - } - - segments := acquireSegments(c) - for i, r := range s { - count++ - if count >= self.Limit { - segments = append(segments, i+utf8.RuneLen(r)) - } - } - - if len(segments) == 0 { - return -1, nil - } - - return 0, segments -} - -func (self Min) Len() int { - return lenNo -} - -func (self Min) String() string { - return fmt.Sprintf("", self.Limit) -} diff --git a/vendor/github.com/gobwas/glob/match/nothing.go b/vendor/github.com/gobwas/glob/match/nothing.go deleted file mode 100644 index 0d4ecd36b..000000000 --- a/vendor/github.com/gobwas/glob/match/nothing.go +++ /dev/null @@ -1,27 +0,0 @@ -package match - -import ( - "fmt" -) - -type Nothing struct{} - -func NewNothing() Nothing { - return Nothing{} -} - -func (self Nothing) Match(s string) bool { - return len(s) == 0 -} - -func (self Nothing) Index(s string) (int, []int) { - return 0, segments0 -} - -func (self Nothing) Len() int { - return lenZero -} - -func (self Nothing) String() string { - return fmt.Sprintf("") -} diff --git a/vendor/github.com/gobwas/glob/match/prefix.go b/vendor/github.com/gobwas/glob/match/prefix.go deleted file mode 100644 index a7347250e..000000000 --- a/vendor/github.com/gobwas/glob/match/prefix.go +++ /dev/null @@ -1,50 +0,0 @@ -package match - -import ( - "fmt" - "strings" - "unicode/utf8" -) - -type Prefix struct { - Prefix string -} - -func NewPrefix(p string) Prefix { - return Prefix{p} -} - -func (self Prefix) Index(s string) (int, []int) { - idx := strings.Index(s, self.Prefix) - if idx == -1 { - return -1, nil - } - - length := len(self.Prefix) - var sub string - if len(s) > idx+length { - sub = s[idx+length:] - } else { - sub = "" - } - - segments := acquireSegments(len(sub) + 1) - segments = append(segments, length) - for i, r := range sub { - segments = append(segments, length+i+utf8.RuneLen(r)) - } - - return idx, segments -} - -func (self Prefix) Len() int { - return lenNo -} - -func (self Prefix) Match(s string) bool { - return strings.HasPrefix(s, self.Prefix) -} - -func (self Prefix) String() string { - return fmt.Sprintf("", self.Prefix) -} diff --git a/vendor/github.com/gobwas/glob/match/prefix_any.go b/vendor/github.com/gobwas/glob/match/prefix_any.go deleted file mode 100644 index 8ee58fe1b..000000000 --- a/vendor/github.com/gobwas/glob/match/prefix_any.go +++ /dev/null @@ -1,55 +0,0 @@ -package match - -import ( - "fmt" - "strings" - "unicode/utf8" - - sutil "github.com/gobwas/glob/util/strings" -) - -type PrefixAny struct { - Prefix string - Separators []rune -} - -func NewPrefixAny(s string, sep []rune) PrefixAny { - return PrefixAny{s, sep} -} - -func (self PrefixAny) Index(s string) (int, []int) { - idx := strings.Index(s, self.Prefix) - if idx == -1 { - return -1, nil - } - - n := len(self.Prefix) - sub := s[idx+n:] - i := sutil.IndexAnyRunes(sub, self.Separators) - if i > -1 { - sub = sub[:i] - } - - seg := acquireSegments(len(sub) + 1) - seg = append(seg, n) - for i, r := range sub { - seg = append(seg, n+i+utf8.RuneLen(r)) - } - - return idx, seg -} - -func (self PrefixAny) Len() int { - return lenNo -} - -func (self PrefixAny) Match(s string) bool { - if !strings.HasPrefix(s, self.Prefix) { - return false - } - return sutil.IndexAnyRunes(s[len(self.Prefix):], self.Separators) == -1 -} - -func (self PrefixAny) String() string { - return fmt.Sprintf("", self.Prefix, string(self.Separators)) -} diff --git a/vendor/github.com/gobwas/glob/match/prefix_suffix.go b/vendor/github.com/gobwas/glob/match/prefix_suffix.go deleted file mode 100644 index 8208085a1..000000000 --- a/vendor/github.com/gobwas/glob/match/prefix_suffix.go +++ /dev/null @@ -1,62 +0,0 @@ -package match - -import ( - "fmt" - "strings" -) - -type PrefixSuffix struct { - Prefix, Suffix string -} - -func NewPrefixSuffix(p, s string) PrefixSuffix { - return PrefixSuffix{p, s} -} - -func (self PrefixSuffix) Index(s string) (int, []int) { - prefixIdx := strings.Index(s, self.Prefix) - if prefixIdx == -1 { - return -1, nil - } - - suffixLen := len(self.Suffix) - if suffixLen <= 0 { - return prefixIdx, []int{len(s) - prefixIdx} - } - - if (len(s) - prefixIdx) <= 0 { - return -1, nil - } - - segments := acquireSegments(len(s) - prefixIdx) - for sub := s[prefixIdx:]; ; { - suffixIdx := strings.LastIndex(sub, self.Suffix) - if suffixIdx == -1 { - break - } - - segments = append(segments, suffixIdx+suffixLen) - sub = sub[:suffixIdx] - } - - if len(segments) == 0 { - releaseSegments(segments) - return -1, nil - } - - reverseSegments(segments) - - return prefixIdx, segments -} - -func (self PrefixSuffix) Len() int { - return lenNo -} - -func (self PrefixSuffix) Match(s string) bool { - return strings.HasPrefix(s, self.Prefix) && strings.HasSuffix(s, self.Suffix) -} - -func (self PrefixSuffix) String() string { - return fmt.Sprintf("", self.Prefix, self.Suffix) -} diff --git a/vendor/github.com/gobwas/glob/match/range.go b/vendor/github.com/gobwas/glob/match/range.go deleted file mode 100644 index ce30245a4..000000000 --- a/vendor/github.com/gobwas/glob/match/range.go +++ /dev/null @@ -1,48 +0,0 @@ -package match - -import ( - "fmt" - "unicode/utf8" -) - -type Range struct { - Lo, Hi rune - Not bool -} - -func NewRange(lo, hi rune, not bool) Range { - return Range{lo, hi, not} -} - -func (self Range) Len() int { - return lenOne -} - -func (self Range) Match(s string) bool { - r, w := utf8.DecodeRuneInString(s) - if len(s) > w { - return false - } - - inRange := r >= self.Lo && r <= self.Hi - - return inRange == !self.Not -} - -func (self Range) Index(s string) (int, []int) { - for i, r := range s { - if self.Not != (r >= self.Lo && r <= self.Hi) { - return i, segmentsByRuneLength[utf8.RuneLen(r)] - } - } - - return -1, nil -} - -func (self Range) String() string { - var not string - if self.Not { - not = "!" - } - return fmt.Sprintf("", not, string(self.Lo), string(self.Hi)) -} diff --git a/vendor/github.com/gobwas/glob/match/row.go b/vendor/github.com/gobwas/glob/match/row.go deleted file mode 100644 index 4379042e4..000000000 --- a/vendor/github.com/gobwas/glob/match/row.go +++ /dev/null @@ -1,77 +0,0 @@ -package match - -import ( - "fmt" -) - -type Row struct { - Matchers Matchers - RunesLength int - Segments []int -} - -func NewRow(len int, m ...Matcher) Row { - return Row{ - Matchers: Matchers(m), - RunesLength: len, - Segments: []int{len}, - } -} - -func (self Row) matchAll(s string) bool { - var idx int - for _, m := range self.Matchers { - length := m.Len() - - var next, i int - for next = range s[idx:] { - i++ - if i == length { - break - } - } - - if i < length || !m.Match(s[idx:idx+next+1]) { - return false - } - - idx += next + 1 - } - - return true -} - -func (self Row) lenOk(s string) bool { - var i int - for range s { - i++ - if i > self.RunesLength { - return false - } - } - return self.RunesLength == i -} - -func (self Row) Match(s string) bool { - return self.lenOk(s) && self.matchAll(s) -} - -func (self Row) Len() (l int) { - return self.RunesLength -} - -func (self Row) Index(s string) (int, []int) { - for i := range s { - if len(s[i:]) < self.RunesLength { - break - } - if self.matchAll(s[i:]) { - return i, self.Segments - } - } - return -1, nil -} - -func (self Row) String() string { - return fmt.Sprintf("", self.RunesLength, self.Matchers) -} diff --git a/vendor/github.com/gobwas/glob/match/segments.go b/vendor/github.com/gobwas/glob/match/segments.go deleted file mode 100644 index 9ea6f3094..000000000 --- a/vendor/github.com/gobwas/glob/match/segments.go +++ /dev/null @@ -1,91 +0,0 @@ -package match - -import ( - "sync" -) - -type SomePool interface { - Get() []int - Put([]int) -} - -var segmentsPools [1024]sync.Pool - -func toPowerOfTwo(v int) int { - v-- - v |= v >> 1 - v |= v >> 2 - v |= v >> 4 - v |= v >> 8 - v |= v >> 16 - v++ - - return v -} - -const ( - cacheFrom = 16 - cacheToAndHigher = 1024 - cacheFromIndex = 15 - cacheToAndHigherIndex = 1023 -) - -var ( - segments0 = []int{0} - segments1 = []int{1} - segments2 = []int{2} - segments3 = []int{3} - segments4 = []int{4} -) - -var segmentsByRuneLength [5][]int = [5][]int{ - 0: segments0, - 1: segments1, - 2: segments2, - 3: segments3, - 4: segments4, -} - -func init() { - for i := cacheToAndHigher; i >= cacheFrom; i >>= 1 { - func(i int) { - segmentsPools[i-1] = sync.Pool{New: func() interface{} { - return make([]int, 0, i) - }} - }(i) - } -} - -func getTableIndex(c int) int { - p := toPowerOfTwo(c) - switch { - case p >= cacheToAndHigher: - return cacheToAndHigherIndex - case p <= cacheFrom: - return cacheFromIndex - default: - return p - 1 - } -} - -func acquireSegments(c int) []int { - // make []int with less capacity than cacheFrom - // is faster than acquiring it from pool - if c < cacheFrom { - return make([]int, 0, c) - } - - return segmentsPools[getTableIndex(c)].Get().([]int)[:0] -} - -func releaseSegments(s []int) { - c := cap(s) - - // make []int with less capacity than cacheFrom - // is faster than acquiring it from pool - if c < cacheFrom { - return - } - - segmentsPools[getTableIndex(c)].Put(s) -} diff --git a/vendor/github.com/gobwas/glob/match/single.go b/vendor/github.com/gobwas/glob/match/single.go deleted file mode 100644 index ee6e3954c..000000000 --- a/vendor/github.com/gobwas/glob/match/single.go +++ /dev/null @@ -1,43 +0,0 @@ -package match - -import ( - "fmt" - "github.com/gobwas/glob/util/runes" - "unicode/utf8" -) - -// single represents ? -type Single struct { - Separators []rune -} - -func NewSingle(s []rune) Single { - return Single{s} -} - -func (self Single) Match(s string) bool { - r, w := utf8.DecodeRuneInString(s) - if len(s) > w { - return false - } - - return runes.IndexRune(self.Separators, r) == -1 -} - -func (self Single) Len() int { - return lenOne -} - -func (self Single) Index(s string) (int, []int) { - for i, r := range s { - if runes.IndexRune(self.Separators, r) == -1 { - return i, segmentsByRuneLength[utf8.RuneLen(r)] - } - } - - return -1, nil -} - -func (self Single) String() string { - return fmt.Sprintf("", string(self.Separators)) -} diff --git a/vendor/github.com/gobwas/glob/match/suffix.go b/vendor/github.com/gobwas/glob/match/suffix.go deleted file mode 100644 index 85bea8c68..000000000 --- a/vendor/github.com/gobwas/glob/match/suffix.go +++ /dev/null @@ -1,35 +0,0 @@ -package match - -import ( - "fmt" - "strings" -) - -type Suffix struct { - Suffix string -} - -func NewSuffix(s string) Suffix { - return Suffix{s} -} - -func (self Suffix) Len() int { - return lenNo -} - -func (self Suffix) Match(s string) bool { - return strings.HasSuffix(s, self.Suffix) -} - -func (self Suffix) Index(s string) (int, []int) { - idx := strings.Index(s, self.Suffix) - if idx == -1 { - return -1, nil - } - - return 0, []int{idx + len(self.Suffix)} -} - -func (self Suffix) String() string { - return fmt.Sprintf("", self.Suffix) -} diff --git a/vendor/github.com/gobwas/glob/match/suffix_any.go b/vendor/github.com/gobwas/glob/match/suffix_any.go deleted file mode 100644 index c5106f819..000000000 --- a/vendor/github.com/gobwas/glob/match/suffix_any.go +++ /dev/null @@ -1,43 +0,0 @@ -package match - -import ( - "fmt" - "strings" - - sutil "github.com/gobwas/glob/util/strings" -) - -type SuffixAny struct { - Suffix string - Separators []rune -} - -func NewSuffixAny(s string, sep []rune) SuffixAny { - return SuffixAny{s, sep} -} - -func (self SuffixAny) Index(s string) (int, []int) { - idx := strings.Index(s, self.Suffix) - if idx == -1 { - return -1, nil - } - - i := sutil.LastIndexAnyRunes(s[:idx], self.Separators) + 1 - - return i, []int{idx + len(self.Suffix) - i} -} - -func (self SuffixAny) Len() int { - return lenNo -} - -func (self SuffixAny) Match(s string) bool { - if !strings.HasSuffix(s, self.Suffix) { - return false - } - return sutil.IndexAnyRunes(s[:len(s)-len(self.Suffix)], self.Separators) == -1 -} - -func (self SuffixAny) String() string { - return fmt.Sprintf("", string(self.Separators), self.Suffix) -} diff --git a/vendor/github.com/gobwas/glob/match/super.go b/vendor/github.com/gobwas/glob/match/super.go deleted file mode 100644 index 3875950bb..000000000 --- a/vendor/github.com/gobwas/glob/match/super.go +++ /dev/null @@ -1,33 +0,0 @@ -package match - -import ( - "fmt" -) - -type Super struct{} - -func NewSuper() Super { - return Super{} -} - -func (self Super) Match(s string) bool { - return true -} - -func (self Super) Len() int { - return lenNo -} - -func (self Super) Index(s string) (int, []int) { - segments := acquireSegments(len(s) + 1) - for i := range s { - segments = append(segments, i) - } - segments = append(segments, len(s)) - - return 0, segments -} - -func (self Super) String() string { - return fmt.Sprintf("") -} diff --git a/vendor/github.com/gobwas/glob/match/text.go b/vendor/github.com/gobwas/glob/match/text.go deleted file mode 100644 index 0a17616d3..000000000 --- a/vendor/github.com/gobwas/glob/match/text.go +++ /dev/null @@ -1,45 +0,0 @@ -package match - -import ( - "fmt" - "strings" - "unicode/utf8" -) - -// raw represents raw string to match -type Text struct { - Str string - RunesLength int - BytesLength int - Segments []int -} - -func NewText(s string) Text { - return Text{ - Str: s, - RunesLength: utf8.RuneCountInString(s), - BytesLength: len(s), - Segments: []int{len(s)}, - } -} - -func (self Text) Match(s string) bool { - return self.Str == s -} - -func (self Text) Len() int { - return self.RunesLength -} - -func (self Text) Index(s string) (int, []int) { - index := strings.Index(s, self.Str) - if index == -1 { - return -1, nil - } - - return index, self.Segments -} - -func (self Text) String() string { - return fmt.Sprintf("", self.Str) -} diff --git a/vendor/github.com/gobwas/glob/parse.go b/vendor/github.com/gobwas/glob/parse.go new file mode 100644 index 000000000..30114dfcf --- /dev/null +++ b/vendor/github.com/gobwas/glob/parse.go @@ -0,0 +1,679 @@ +package glob + +import ( + "slices" + "unicode/utf8" + + "github.com/gobwas/glob/internal/debug" + "github.com/gobwas/glob/syntax" +) + +// compile parses the pattern into a matcher tree (see below), simplifies and +// specializes it, and computes the match-time hints and preconditions; see +// [simplify], [specialize], [annotateStars], [needsState], [minLength] and +// [requiredSuffix]. It is what [Compile] wraps. +func compile(str string, sep []rune) (*Pattern, error) { + if debug.Enabled { + debug.Printf("compiling %#q\n", str) + } + // The matchers keep sep and read it while matching, and the variadic slice + // may alias an array owned by the caller: give them a copy of their own. + // + // The pattern itself keeps the slice as given, to return it from + // Separators() without cloning. + var ( + sepCopy = slices.Clone(sep) + sepStr = string(sep) + ) + + type operator struct { + kind int + index int + } + const ( + opTerms = iota + opList + ) + /* + Stack-based parsing is a technique used to evaluate mathematical + expressions by leveraging the properties of the LIFO (Last-In, + First-Out) data structure, the stack. It involves using two stacks: one + for operands (numbers) and one for operators. By processing the + expression from left to right and strategically pushing and popping + elements from the stacks, the expression can be effectively evaluated. + + https://cp-algorithms.com/string/expression_parsing.html + + Here the operands are matchers and the only operators are the braces + and the commas inside them, so it goes as follows: + + - a leaf token (text, `?`, `*`, `**`, `[...]`) pushes its matcher + onto the stack; + + - `{` pushes two operators, both remembering the current stack + length: opTerms marks where the alternatives of the group will + be collected, opList marks where the terms of the current + alternative begin; + + - `,` pops the opList, collapses the terms above its index into a + single multiMatcher (or a voidMatcher when there are none, as in + `{,a}`), and pushes a fresh opList for the next alternative; + + - `}` pops the opList and collapses the last alternative the same + way, then pops the opTerms and collapses everything above its + index -- one matcher per alternative by now -- into an + altMatcher; + + - at the EOF whatever is left on the stack is the top-level + sequence; a leftover operator means an unclosed `{`. + + For example, `a{b*,c}d` goes like this (list@i is an opList with + index i, likewise terms@i): + + token stack operators + a "a" + { "a" terms@1 list@1 + b "a" "b" terms@1 list@1 + * "a" "b" * terms@1 list@1 + , "a" ["b"·*] terms@1 list@2 + c "a" ["b"·*] "c" terms@1 list@2 + } "a" ["b"·*] ["c"] terms@1 + "a" {["b"·*]|["c"]} + d "a" {["b"·*]|["c"]} "d" + EOF ["a"·{["b"·*]|["c"]}·"d"] + + The result is then simplified (["c"] becomes "c") and specialized; + see [simplify] and [specialize]. + */ + var ( + stack []matcher + operators []operator + ) + lex := syntax.NewLexer(str) +parsing: + for { + token := lex.Next() + if debug.Enabled { + debug.Printf("token: %s\n", token) + } + switch token.Type { + case syntax.EOF: + break parsing + + case syntax.Error: + return nil, &SyntaxError{ + Offset: lex.Offset(), + Reason: token.Data, + } + + case syntax.Single: + stack = append(stack, &charMatcher{ + Sep: sepCopy, + }) + + case syntax.Text: + stack = append(stack, &textMatcher{ + Text: token.Data, + }) + + case syntax.RangeOpen: + m, err := parseRange(lex) + if err != nil { + return nil, err + } + stack = append(stack, m) + + case syntax.Any: + stack = append(stack, &starMatcher{ + Sep: sepCopy, + SepStr: sepStr, + }) + + case syntax.Super: + stack = append(stack, &starMatcher{ + Sep: nil, + }) + + case syntax.TermsOpen: + // Note that the `{` opens both the group and its first + // alternative: every alternative is delimited by an opList + // operator. This way TermsClose always collapses the trailing + // alternative into a single matcher first, even when the group + // has no commas at all, e.g. `{ab*}`. + operators = append(operators, + operator{kind: opTerms, index: len(stack)}, + operator{kind: opList, index: len(stack)}, + ) + if debug.Enabled { + debug.Printf("terms enter: %d\n", len(stack)) + } + + case syntax.TermSeparator: + k := len(operators) - 1 + if k < 0 { + return nil, &SyntaxError{ + Offset: lex.Offset(), + Reason: "unexpected `,`", + } + } + x := operators[k] + if x.kind == opList { + // Remove the most recent "comma" operator. + // Note that the previous one is the terms operator. + operators = operators[:k] + } + i := x.index + // Handle the `{,a}` case. + if i == len(stack) { + // Empty matchers. + stack = append(stack, &voidMatcher{}) + } else { + stack[i] = multiMatcher(slices.Clone(stack[i:])) + stack = stack[:i+1] + if debug.Enabled { + debug.Printf("terms next: %d: %s\n", i, stack[i]) + } + } + operators = append(operators, operator{ + kind: opList, + index: len(stack), + }) + if debug.Enabled { + debug.Printf("terms separator: %d\n", len(stack)) + } + + case syntax.TermsClose: + for { + k := len(operators) - 1 + if k < 0 { + return nil, &SyntaxError{ + Offset: lex.Offset(), + Reason: "unexpected `}`", + } + } + x := operators[k] + operators = operators[:k] + + i := x.index + c := slices.Clone(stack[i:]) + var m matcher + switch x.kind { + case opTerms: + m = altMatcher(c) + case opList: + m = multiMatcher(c) + } + // Handle the `{a,}` case. + if i == len(stack) { + stack = append(stack, m) + } else { + stack = stack[:i+1] + stack[i] = m + } + + if debug.Enabled { + debug.Printf( + "terms leave(%d): %d: %s\n", + x.kind, i, stack[i], + ) + } + if x.kind == opTerms { + break + } + } + + default: + return nil, &SyntaxError{ + Offset: lex.Offset(), + Reason: "unexpected token " + token.String(), + } + } + } + if len(operators) != 0 { + return nil, &SyntaxError{ + Offset: lex.Offset(), + Reason: "unclosed `{`", + } + } + m := simplify(multiMatcher(stack)) + m = specialize(m, true) + annotateStars(m, true) + if debug.Enabled { + debug.Printf("compiled %#q: %s\n", str, m) + } + p := &Pattern{ + str: str, + sep: sep, + m: m, + state: needsState(m), + } + if p.state { + p.minLen = minLength(m) + p.suffix = requiredSuffix(m) + } + return p, nil +} + +// parseRange parses a character class, called right after its opening `[` +// was read; it consumes the tokens up to and including the closing `]`. The +// class is either a range, `[a-c]`, or a set, `[abc]`, either possibly +// negated with a leading `!`; see [runeRangeMatcher] and [runeSetMatcher]. +func parseRange(lex *syntax.Lexer) (matcher, error) { + // -1 marks a range boundary as unset: any decoded rune, including + // U+0000, is non-negative. + var ( + not bool + lo, hi rune = -1, -1 + chars map[rune]struct{} + ) + for { + token := lex.Next() + switch token.Type { + case syntax.EOF: + return nil, &SyntaxError{ + Offset: lex.Offset(), + Reason: "unclosed `[`", + } + + case syntax.Error: + return nil, &SyntaxError{ + Offset: lex.Offset(), + Reason: token.Data, + } + + case syntax.Not: + not = true + + case syntax.RangeLo: + r, w := utf8.DecodeRuneInString(token.Data) + if len(token.Data) > w { + return nil, &SyntaxError{ + Offset: lex.Offset(), + Reason: "unexpected length of range lo character", + } + } + lo = r + + case syntax.RangeBetween: + // The `-` between lo and hi: nothing to do. + + case syntax.RangeHi: + r, w := utf8.DecodeRuneInString(token.Data) + if len(token.Data) > w { + return nil, &SyntaxError{ + Offset: lex.Offset(), + Reason: "unexpected length of range hi character", + } + } + hi = r + + if hi < lo { + return nil, &SyntaxError{ + Offset: lex.Offset(), + Reason: "range hi character is less than lo", + } + } + + case syntax.Text: + chars = make(map[rune]struct{}) + for _, r := range token.Data { + chars[r] = struct{}{} + } + + case syntax.RangeClose: + isRange := lo >= 0 && hi >= 0 + isChars := chars != nil + + if isChars == isRange { + return nil, &SyntaxError{ + Offset: lex.Offset(), + Reason: "could not parse range", + } + } + if isRange { + return &runeRangeMatcher{ + Lo: lo, + Hi: hi, + Not: not, + }, nil + } + return &runeSetMatcher{ + Set: chars, + Not: not, + }, nil + } + } +} + +// simplify rewrites the freshly parsed tree into its canonical shape, bottom +// up: the sequences are normalized (see [normalizeSequence]), and a sequence +// or a group of alternatives with a single child is replaced by the child, +// with none -- by a void. +func simplify(m matcher) matcher { + var ( + ms []matcher + isMulti bool + ) + switch v := m.(type) { + case multiMatcher: + ms, isMulti = v, true + case altMatcher: + ms = v + default: + return m + } + for i, m := range ms { + ms[i] = simplify(m) + } + if isMulti { + ms = normalizeSequence(ms) + } + switch len(ms) { + case 0: + return &voidMatcher{} + case 1: + return ms[0] + } + if isMulti { + return multiMatcher(ms) + } + return altMatcher(ms) +} + +// normalizeSequence rewrites a sequence of (already simplified) matchers +// into a simpler equivalent one: +// +// ["a"·["b"·"c"]·"d"] => ["a"·"b"·"c"·"d"] inline the nested sequences +// ["a"·void] => ["a"] drop the void matchers +// ["a"·"b"] => ["ab"] merge the adjacent literals +// [*·**] => [**] coalesce the adjacent stars +// +// Longer literals also make better star jumps; see [annotateStars]. +func normalizeSequence(ms []matcher) []matcher { + if !needsNormalize(ms) { + // The common case: nothing to rewrite, no copy needed. + return ms + } + out := make([]matcher, 0, len(ms)) + var push func(m matcher) + push = func(m matcher) { + switch v := m.(type) { + case multiMatcher: + for _, c := range v { + push(c) + } + return + case *voidMatcher: + return + case *textMatcher: + if len(out) > 0 { + if prev, ok := out[len(out)-1].(*textMatcher); ok { + out[len(out)-1] = &textMatcher{Text: prev.Text + v.Text} + return + } + } + case *starMatcher: + if len(out) > 0 { + if prev, ok := out[len(out)-1].(*starMatcher); ok { + // Adjacent stars are equivalent to the most general + // of them: the one not limited by separators, if any. + if len(prev.Sep) > 0 && len(v.Sep) == 0 { + out[len(out)-1] = v + } + return + } + } + } + out = append(out, m) + } + for _, m := range ms { + push(m) + } + return out +} + +// needsNormalize reports whether [normalizeSequence] would change ms, so +// that the common case skips the copy. +func needsNormalize(ms []matcher) bool { + for i, m := range ms { + switch m.(type) { + case multiMatcher, *voidMatcher: + return true + case *textMatcher: + if i > 0 { + if _, ok := ms[i-1].(*textMatcher); ok { + return true + } + } + case *starMatcher: + if i > 0 { + if _, ok := ms[i-1].(*starMatcher); ok { + return true + } + } + } + } + return false +} + +// specialize rewrites the terminal sub-sequences of the simplified matcher +// tree into the shaped matchers -- [prefixMatcher], [suffixMatcher], +// [prefixSuffixMatcher] and [containsMatcher]; see [foldTail] for the +// rewrites. The tail flag tells whether nothing follows m in the pattern; +// only there the rewrites apply, since a shaped matcher consumes the whole +// remainder of the input. +func specialize(m matcher, tail bool) matcher { + switch v := m.(type) { + case altMatcher: + // Every alternative ends where the alt ends. + for i, c := range v { + v[i] = specialize(c, tail) + } + return v + + case multiMatcher: + for i, c := range v { + v[i] = specialize(c, tail && i == len(v)-1) + } + if !tail { + return v + } + ms := foldTail([]matcher(v)) + if len(ms) == 1 { + return ms[0] + } + return multiMatcher(ms) + } + return m +} + +// foldTail repeatedly folds the two trailing matchers of the terminal +// sequence ms into a shaped one, while possible: +// +// [..·"abc"·*] => [..·prefix("abc")] +// [..·*·"abc"] => [..·suffix("abc")] +// [..·"abc"·prefix("def")] => [..·prefix("abcdef")] +// [..·*·prefix("abc")] => [..·contains("abc")] (separator-free) +// [..·"abc"·suffix("def")] => [..·prefix_suffix("abc","def")] +// [..·*·contains("abc")] => [..·contains("abc")] (separator-free) +func foldTail(ms []matcher) []matcher { + for len(ms) >= 2 { + var ( + prev = ms[len(ms)-2] + folded matcher + ) + switch last := ms[len(ms)-1].(type) { + case *starMatcher: + if t, ok := prev.(*textMatcher); ok { + folded = &prefixMatcher{Text: t.Text, Sep: last.SepStr} + } + + case *textMatcher: + if star, ok := prev.(*starMatcher); ok { + folded = &suffixMatcher{Text: last.Text, Sep: star.SepStr} + } + + case *prefixMatcher: + switch p := prev.(type) { + case *textMatcher: + folded = &prefixMatcher{Text: p.Text + last.Text, Sep: last.Sep} + case *starMatcher: + if p.SepStr == "" && last.Sep == "" { + folded = &containsMatcher{Text: last.Text} + } + } + + case *suffixMatcher: + if t, ok := prev.(*textMatcher); ok { + folded = &prefixSuffixMatcher{ + Prefix: t.Text, + Suffix: last.Text, + Sep: last.Sep, + } + } + + case *containsMatcher: + if star, ok := prev.(*starMatcher); ok && star.SepStr == "" { + folded = last + } + } + if folded == nil { + break + } + ms = ms[:len(ms)-1] + ms[len(ms)-1] = folded + } + return ms +} + +// annotateStars computes the compile-time hints for the star matchers, in +// order to keep the number of restart points they store at match time low: +// +// - a star directly followed by a literal jumps between the literal +// occurrences instead of retrying at every rune (see +// [starMatcher.storeSkip]); +// +// - a star with nothing after it anywhere in the pattern (tail is true +// for m and the star closes it) consumes its whole reach at once and +// stores no restart points at all. +func annotateStars(m matcher, tail bool) { + switch v := m.(type) { + case multiMatcher: + for i, c := range v { + last := i == len(v)-1 + star, ok := c.(*starMatcher) + if !ok { + annotateStars(c, tail && last) + continue + } + star.Terminal = tail && last + if !last { + star.Next = leadingLiteral(v[i+1]) + } + } + case altMatcher: + for _, c := range v { + annotateStars(c, tail) + } + case *starMatcher: + v.Terminal = tail + } +} + +// leadingLiteral returns the literal the given matcher is guaranteed to +// begin its match with, if any. +func leadingLiteral(m matcher) string { + switch v := m.(type) { + case *textMatcher: + return v.Text + case *prefixMatcher: + return v.Text + case *prefixSuffixMatcher: + return v.Prefix + } + return "" +} + +// minLength returns the minimum length in bytes of a string m can match. +func minLength(m matcher) (n int) { + switch v := m.(type) { + case *textMatcher: + return len(v.Text) + case *charMatcher, *runeRangeMatcher, *runeSetMatcher: + return 1 + case *prefixMatcher: + return len(v.Text) + case *suffixMatcher: + return len(v.Text) + case *prefixSuffixMatcher: + return len(v.Prefix) + len(v.Suffix) + case *containsMatcher: + return len(v.Text) + case multiMatcher: + for _, c := range v { + n += minLength(c) + } + return n + case altMatcher: + n = minLength(v[0]) + for _, c := range v[1:] { + n = min(n, minLength(c)) + } + return n + } + return 0 // A star or a void. +} + +// requiredSuffix returns the literal every string m matches must end with. +func requiredSuffix(m matcher) string { + switch v := m.(type) { + case *textMatcher: + return v.Text + case *suffixMatcher: + return v.Text + case *prefixSuffixMatcher: + return v.Suffix + case multiMatcher: + return requiredSuffix(v[len(v)-1]) + case altMatcher: + s := requiredSuffix(v[0]) + for _, c := range v[1:] { + s = commonSuffix(s, requiredSuffix(c)) + if s == "" { + break + } + } + return s + } + return "" // A star, a single-character matcher or a void. +} + +// commonSuffix returns the longest common suffix of a and b, never splitting +// a multi-byte rune. +func commonSuffix(a, b string) string { + i := 0 + for i < len(a) && i < len(b) { + ra, wa := utf8.DecodeLastRuneInString(a[:len(a)-i]) + rb, wb := utf8.DecodeLastRuneInString(b[:len(b)-i]) + if ra != rb || wa != wb { + break + } + i += wa + } + return a[len(a)-i:] +} + +// needsState reports whether matching m may save a checkpoint. Only the +// alts and the non-terminal stars do; a pattern without them is matched +// with a plain call chain -- see [Pattern.Match]. +func needsState(m matcher) bool { + switch v := m.(type) { + case altMatcher: + return true + case multiMatcher: + return slices.ContainsFunc(v, needsState) + case *starMatcher: + return !v.Terminal + } + return false +} diff --git a/vendor/github.com/gobwas/glob/readme.md b/vendor/github.com/gobwas/glob/readme.md index f58144e73..9f692571f 100644 --- a/vendor/github.com/gobwas/glob/readme.md +++ b/vendor/github.com/gobwas/glob/readme.md @@ -1,6 +1,6 @@ # glob.[go](https://golang.org) -[![GoDoc][godoc-image]][godoc-url] [![Build Status][travis-image]][travis-url] +[![GoDoc][godoc-image]][godoc-url] [![CI][ci-image]][ci-url] > Go Globbing Library. @@ -19,130 +19,225 @@ package main import "github.com/gobwas/glob" func main() { - var g glob.Glob - + var g *glob.Pattern + // create simple glob g = glob.MustCompile("*.github.com") g.Match("api.github.com") // true - - // quote meta characters and then create simple glob + + // quote meta characters and then create simple glob g = glob.MustCompile(glob.QuoteMeta("*.github.com")) g.Match("*.github.com") // true - + // create new glob with set of delimiters as ["."] g = glob.MustCompile("api.*.com", '.') g.Match("api.github.com") // true g.Match("api.gi.hub.com") // false - + // create new glob with set of delimiters as ["."] // but now with super wildcard g = glob.MustCompile("api.**.com", '.') g.Match("api.github.com") // true g.Match("api.gi.hub.com") // true - + // create glob with single symbol wildcard g = glob.MustCompile("?at") g.Match("cat") // true g.Match("fat") // true g.Match("at") // false - + // create glob with single symbol wildcard and delimiters ['f'] g = glob.MustCompile("?at", 'f') g.Match("cat") // true g.Match("fat") // false - g.Match("at") // false - - // create glob with character-list matchers + g.Match("at") // false + + // create glob with character-list matchers g = glob.MustCompile("[abc]at") g.Match("cat") // true g.Match("bat") // true g.Match("fat") // false g.Match("at") // false - - // create glob with character-list matchers + + // create glob with character-list matchers g = glob.MustCompile("[!abc]at") g.Match("cat") // false g.Match("bat") // false g.Match("fat") // true - g.Match("at") // false - - // create glob with character-range matchers + g.Match("at") // false + + // create glob with character-range matchers g = glob.MustCompile("[a-c]at") g.Match("cat") // true g.Match("bat") // true g.Match("fat") // false g.Match("at") // false - - // create glob with character-range matchers + + // create glob with character-range matchers g = glob.MustCompile("[!a-c]at") g.Match("cat") // false g.Match("bat") // false g.Match("fat") // true - g.Match("at") // false - - // create glob with pattern-alternatives list + g.Match("at") // false + + // create glob with pattern-alternatives list g = glob.MustCompile("{cat,bat,[fr]at}") g.Match("cat") // true g.Match("bat") // true g.Match("fat") // true g.Match("rat") // true - g.Match("at") // false - g.Match("zat") // false + g.Match("at") // false + g.Match("zat") // false } ``` +`Compile` reports malformed patterns with a `*glob.SyntaxError` carrying the +byte offset and the reason: + +```go +_, err := glob.Compile("{a,b") +// err: glob: syntax error at 4: unclosed `{` +``` + +A compiled `Pattern` captures what it was compiled from, so it can be passed +around instead of the raw arguments and inspected when needed (`String()` makes +it a `fmt.Stringer`, like `regexp.Regexp`): + +```go +g := glob.MustCompile("*.github.com", '.') +g.String() // "*.github.com" +g.Separators() // []rune{'.'} +``` + +## Syntax + +Syntax is inspired by [standard wildcards](http://tldp.org/LDP/GNU-Linux-Tools-Summary/html/x11655.htm), +with one addition: `**` (the "super-asterisk"), which matches any sequence +of characters *including* the separators, where `*` stops at them. Note that +it is just that -- a `*` that crosses separators -- and not the `**/` +"globstar" of shells and file globbers: `**/x` requires the literal `/`, so +it does not match `x`; use `{**/,}x` for that. The same applies to a +`**` between separators, e.g. `a/**/b` does not match `a/b`. + +``` +pattern: + { term } + +term: + `*` matches any sequence of non-separator characters + `**` matches any sequence of characters + `?` matches any single non-separator character + `[` [ `!` ] class `]` + character class; `!` negates it + `{` pattern-list `}` + pattern alternatives + c matches character c (c != `*`, `**`, `?`, `\`, `[`, `{`, `}`) + `\` c matches character c + +class: + lo `-` hi matches character c for lo <= c <= hi + { c } matches any of the listed characters (c != `\`, `]`; + `\` c matches c, `-` is literal here); must be non-empty + +pattern-list: + pattern { `,` pattern } + comma-separated (without spaces) patterns +``` + +### Escaping + +The backslash is the escape character: `\*` is a literal asterisk, and a +backslash itself is `\\`. Mind the Go string literals: `"foo\\bar"` is the +pattern `foo\bar`, which is the literal `foobar`, not `foo\bar`. To match a +backslash (e.g. in the Windows paths) write `"foo\\\\bar"` or `` `foo\\bar` ``, +or use `QuoteMeta` on the literal part. + +### Separators + +The separators are not part of the pattern syntax -- they are configured +once, at compilation time, as the extra arguments of `Compile`: + +```go +g := glob.MustCompile("api.*.com", '.', '/') +``` + +They only limit the wildcards: `*` and `?` never match a separator, while +`**` matches across them; the literals and the character classes are not +affected. With no separators given, `*` and `**` are equivalent. A compiled +`*glob.Pattern` keeps its separators for all matches -- to match the same +pattern with different separators, compile it again. + ## Performance -This library is created for compile-once patterns. This means, that compilation could take time, but -strings matching is done faster, than in case when always parsing template. +This library is created for compile-once patterns. This means, that +compilation could take time, but strings matching is done faster, than in +case when always parsing template. -If you will not use compiled `glob.Glob` object, and do `g := glob.MustCompile(pattern); g.Match(...)` every time, then your code will be much more slower. +If you will not use compiled `*glob.Pattern` object, and do +`g := glob.MustCompile(pattern); g.Match(...)` every time, then your code +will be much more slower. -Run `go test -bench=.` from source root to see the benchmarks: +`Match` performs zero allocations and is safe for concurrent use. Common +pattern shapes (literals, prefixes, suffixes, substrings) are recognized at +compile time and matched with plain string comparisons; the backtracking +engine behind the rest is differentially fuzzed against the `regexp` package +(see `FuzzMatchRegexp`). -Pattern | Fixture | Match | Speed (ns/op) ---------|---------|-------|-------------- -`[a-z][!a-x]*cat*[h][!b]*eyes*` | `my cat has very bright eyes` | `true` | 432 -`[a-z][!a-x]*cat*[h][!b]*eyes*` | `my dog has very bright eyes` | `false` | 199 -`https://*.google.*` | `https://account.google.com` | `true` | 96 -`https://*.google.*` | `https://google.com` | `false` | 66 -`{https://*.google.*,*yandex.*,*yahoo.*,*mail.ru}` | `http://yahoo.com` | `true` | 163 -`{https://*.google.*,*yandex.*,*yahoo.*,*mail.ru}` | `http://google.com` | `false` | 197 -`{https://*gobwas.com,http://exclude.gobwas.com}` | `https://safe.gobwas.com` | `true` | 22 -`{https://*gobwas.com,http://exclude.gobwas.com}` | `http://safe.gobwas.com` | `false` | 24 -`abc*` | `abcdef` | `true` | 8.15 -`abc*` | `af` | `false` | 5.68 -`*def` | `abcdef` | `true` | 8.84 -`*def` | `af` | `false` | 5.74 -`ab*ef` | `abcdef` | `true` | 15.2 -`ab*ef` | `af` | `false` | 10.4 - -The same things with `regexp` package: +Run `go test -bench=.` from source root to see the benchmarks (the numbers +below are from an Apple M4): Pattern | Fixture | Match | Speed (ns/op) --------|---------|-------|-------------- -`^[a-z][^a-x].*cat.*[h][^b].*eyes.*$` | `my cat has very bright eyes` | `true` | 2553 -`^[a-z][^a-x].*cat.*[h][^b].*eyes.*$` | `my dog has very bright eyes` | `false` | 1383 -`^https:\/\/.*\.google\..*$` | `https://account.google.com` | `true` | 1205 -`^https:\/\/.*\.google\..*$` | `https://google.com` | `false` | 767 -`^(https:\/\/.*\.google\..*|.*yandex\..*|.*yahoo\..*|.*mail\.ru)$` | `http://yahoo.com` | `true` | 1435 -`^(https:\/\/.*\.google\..*|.*yandex\..*|.*yahoo\..*|.*mail\.ru)$` | `http://google.com` | `false` | 1674 -`^(https:\/\/.*gobwas\.com|http://exclude.gobwas.com)$` | `https://safe.gobwas.com` | `true` | 1039 -`^(https:\/\/.*gobwas\.com|http://exclude.gobwas.com)$` | `http://safe.gobwas.com` | `false` | 272 -`^abc.*$` | `abcdef` | `true` | 237 -`^abc.*$` | `af` | `false` | 100 -`^.*def$` | `abcdef` | `true` | 464 -`^.*def$` | `af` | `false` | 265 -`^ab.*ef$` | `abcdef` | `true` | 375 -`^ab.*ef$` | `af` | `false` | 145 - -[godoc-image]: https://godoc.org/github.com/gobwas/glob?status.svg -[godoc-url]: https://godoc.org/github.com/gobwas/glob -[travis-image]: https://travis-ci.org/gobwas/glob.svg?branch=master -[travis-url]: https://travis-ci.org/gobwas/glob - -## Syntax - -Syntax is inspired by [standard wildcards](http://tldp.org/LDP/GNU-Linux-Tools-Summary/html/x11655.htm), -except that `**` is aka super-asterisk, that do not sensitive for separators. \ No newline at end of file +`[a-z][!a-x]*cat*[h][!b]*eyes*` | `my cat has very bright eyes` | `true` | 141 +`[a-z][!a-x]*cat*[h][!b]*eyes*` | `my dog has very bright eyes` | `false` | 46 +`https://*.google.*` | `https://account.google.com` | `true` | 16 +`https://*.google.*` | `https://google.com` | `false` | 13 +`{https://*.google.*,*yandex.*,*yahoo.*,*mail.ru}` | `http://yahoo.com` | `true` | 61 +`{https://*.google.*,*yandex.*,*yahoo.*,*mail.ru}` | `http://google.com` | `false` | 70 +`{https://*gobwas.com,http://exclude.gobwas.com}` | `https://safe.gobwas.com` | `true` | 24 +`{https://*gobwas.com,http://exclude.gobwas.com}` | `http://safe.gobwas.com` | `false` | 32 +`google.com` | `google.com` | `true` | 5.0 +`google.com` | `gobwas.com` | `false` | 3.9 +`abc*` | `abcdef` | `true` | 4.1 +`abc*` | `af` | `false` | 3.0 +`*def` | `abcdef` | `true` | 4.1 +`*def` | `af` | `false` | 2.9 +`ab*ef` | `abcdef` | `true` | 6.0 +`ab*ef` | `af` | `false` | 3.0 + +The same things with the `regexp` package -- not to pick on it (it is a +general-purpose engine with much stronger guarantees), but as a reference +for how the glob-shaped specialization pays off per pattern. The regular +expressions are the exact equivalents: anchored, and with the `s` flag +where there is a `*`, since a `*` matches a newline like any other +character (see `BenchmarkCompareGlobAndRegexp`): + +Pattern | Fixture | Match | Speed (ns/op) | glob is +--------|---------|-------|---------------|-------- +`(?s)^[a-z][^a-x].*cat.*[h][^b].*eyes.*$` | `my cat has very bright eyes` | `true` | 505 | 3.6x faster +`(?s)^[a-z][^a-x].*cat.*[h][^b].*eyes.*$` | `my dog has very bright eyes` | `false` | 221 | 4.9x faster +`(?s)^https://.*\.google\..*$` | `https://account.google.com` | `true` | 251 | 16x faster +`(?s)^https://.*\.google\..*$` | `https://google.com` | `false` | 128 | 9.6x faster +`(?s)^(https://.*\.google\..*\|.*yandex\..*\|.*yahoo\..*\|.*mail\.ru)$` | `http://yahoo.com` | `true` | 396 | 6.5x faster +`(?s)^(https://.*\.google\..*\|.*yandex\..*\|.*yahoo\..*\|.*mail\.ru)$` | `http://google.com` | `false` | 558 | 8.0x faster +`(?s)^(https://.*gobwas\.com\|http://exclude\.gobwas\.com)$` | `https://safe.gobwas.com` | `true` | 210 | 8.8x faster +`(?s)^(https://.*gobwas\.com\|http://exclude\.gobwas\.com)$` | `http://safe.gobwas.com` | `false` | 46 | 1.4x faster +`^google\.com$` | `google.com` | `true` | 25 | 5.0x faster +`^google\.com$` | `gobwas.com` | `false` | 17 | 4.3x faster +`(?s)^abc.*$` | `abcdef` | `true` | 43 | 10x faster +`(?s)^abc.*$` | `af` | `false` | 1.5 | 2.0x slower +`(?s)^.*def$` | `abcdef` | `true` | 73 | 18x faster +`(?s)^.*def$` | `af` | `false` | 1.5 | 1.9x slower +`(?s)^ab.*ef$` | `abcdef` | `true` | 77 | 13x faster +`(?s)^ab.*ef$` | `af` | `false` | 1.5 | 2.0x slower + +(The three `slower` rows are the tiny-mismatch cases. Both engines reject +them with the same literal check; `regexp` just reaches it through less +call overhead. In absolute terms it is 1.5ns vs 3ns -- negligible either +way.) + +[godoc-image]: https://pkg.go.dev/badge/github.com/gobwas/glob.svg +[godoc-url]: https://pkg.go.dev/github.com/gobwas/glob +[ci-image]: https://github.com/gobwas/glob/actions/workflows/ci.yml/badge.svg?branch=master +[ci-url]: https://github.com/gobwas/glob/actions/workflows/ci.yml diff --git a/vendor/github.com/gobwas/glob/syntax/ast/ast.go b/vendor/github.com/gobwas/glob/syntax/ast/ast.go deleted file mode 100644 index 3220a694a..000000000 --- a/vendor/github.com/gobwas/glob/syntax/ast/ast.go +++ /dev/null @@ -1,122 +0,0 @@ -package ast - -import ( - "bytes" - "fmt" -) - -type Node struct { - Parent *Node - Children []*Node - Value interface{} - Kind Kind -} - -func NewNode(k Kind, v interface{}, ch ...*Node) *Node { - n := &Node{ - Kind: k, - Value: v, - } - for _, c := range ch { - Insert(n, c) - } - return n -} - -func (a *Node) Equal(b *Node) bool { - if a.Kind != b.Kind { - return false - } - if a.Value != b.Value { - return false - } - if len(a.Children) != len(b.Children) { - return false - } - for i, c := range a.Children { - if !c.Equal(b.Children[i]) { - return false - } - } - return true -} - -func (a *Node) String() string { - var buf bytes.Buffer - buf.WriteString(a.Kind.String()) - if a.Value != nil { - buf.WriteString(" =") - buf.WriteString(fmt.Sprintf("%v", a.Value)) - } - if len(a.Children) > 0 { - buf.WriteString(" [") - for i, c := range a.Children { - if i > 0 { - buf.WriteString(", ") - } - buf.WriteString(c.String()) - } - buf.WriteString("]") - } - return buf.String() -} - -func Insert(parent *Node, children ...*Node) { - parent.Children = append(parent.Children, children...) - for _, ch := range children { - ch.Parent = parent - } -} - -type List struct { - Not bool - Chars string -} - -type Range struct { - Not bool - Lo, Hi rune -} - -type Text struct { - Text string -} - -type Kind int - -const ( - KindNothing Kind = iota - KindPattern - KindList - KindRange - KindText - KindAny - KindSuper - KindSingle - KindAnyOf -) - -func (k Kind) String() string { - switch k { - case KindNothing: - return "Nothing" - case KindPattern: - return "Pattern" - case KindList: - return "List" - case KindRange: - return "Range" - case KindText: - return "Text" - case KindAny: - return "Any" - case KindSuper: - return "Super" - case KindSingle: - return "Single" - case KindAnyOf: - return "AnyOf" - default: - return "" - } -} diff --git a/vendor/github.com/gobwas/glob/syntax/ast/parser.go b/vendor/github.com/gobwas/glob/syntax/ast/parser.go deleted file mode 100644 index 429b40943..000000000 --- a/vendor/github.com/gobwas/glob/syntax/ast/parser.go +++ /dev/null @@ -1,157 +0,0 @@ -package ast - -import ( - "errors" - "fmt" - "github.com/gobwas/glob/syntax/lexer" - "unicode/utf8" -) - -type Lexer interface { - Next() lexer.Token -} - -type parseFn func(*Node, Lexer) (parseFn, *Node, error) - -func Parse(lexer Lexer) (*Node, error) { - var parser parseFn - - root := NewNode(KindPattern, nil) - - var ( - tree *Node - err error - ) - for parser, tree = parserMain, root; parser != nil; { - parser, tree, err = parser(tree, lexer) - if err != nil { - return nil, err - } - } - - return root, nil -} - -func parserMain(tree *Node, lex Lexer) (parseFn, *Node, error) { - for { - token := lex.Next() - switch token.Type { - case lexer.EOF: - return nil, tree, nil - - case lexer.Error: - return nil, tree, errors.New(token.Raw) - - case lexer.Text: - Insert(tree, NewNode(KindText, Text{token.Raw})) - return parserMain, tree, nil - - case lexer.Any: - Insert(tree, NewNode(KindAny, nil)) - return parserMain, tree, nil - - case lexer.Super: - Insert(tree, NewNode(KindSuper, nil)) - return parserMain, tree, nil - - case lexer.Single: - Insert(tree, NewNode(KindSingle, nil)) - return parserMain, tree, nil - - case lexer.RangeOpen: - return parserRange, tree, nil - - case lexer.TermsOpen: - a := NewNode(KindAnyOf, nil) - Insert(tree, a) - - p := NewNode(KindPattern, nil) - Insert(a, p) - - return parserMain, p, nil - - case lexer.Separator: - p := NewNode(KindPattern, nil) - Insert(tree.Parent, p) - - return parserMain, p, nil - - case lexer.TermsClose: - return parserMain, tree.Parent.Parent, nil - - default: - return nil, tree, fmt.Errorf("unexpected token: %s", token) - } - } - return nil, tree, fmt.Errorf("unknown error") -} - -func parserRange(tree *Node, lex Lexer) (parseFn, *Node, error) { - var ( - not bool - lo rune - hi rune - chars string - ) - for { - token := lex.Next() - switch token.Type { - case lexer.EOF: - return nil, tree, errors.New("unexpected end") - - case lexer.Error: - return nil, tree, errors.New(token.Raw) - - case lexer.Not: - not = true - - case lexer.RangeLo: - r, w := utf8.DecodeRuneInString(token.Raw) - if len(token.Raw) > w { - return nil, tree, fmt.Errorf("unexpected length of lo character") - } - lo = r - - case lexer.RangeBetween: - // - - case lexer.RangeHi: - r, w := utf8.DecodeRuneInString(token.Raw) - if len(token.Raw) > w { - return nil, tree, fmt.Errorf("unexpected length of lo character") - } - - hi = r - - if hi < lo { - return nil, tree, fmt.Errorf("hi character '%s' should be greater than lo '%s'", string(hi), string(lo)) - } - - case lexer.Text: - chars = token.Raw - - case lexer.RangeClose: - isRange := lo != 0 && hi != 0 - isChars := chars != "" - - if isChars == isRange { - return nil, tree, fmt.Errorf("could not parse range") - } - - if isRange { - Insert(tree, NewNode(KindRange, Range{ - Lo: lo, - Hi: hi, - Not: not, - })) - } else { - Insert(tree, NewNode(KindList, List{ - Chars: chars, - Not: not, - })) - } - - return parserMain, tree, nil - } - } -} diff --git a/vendor/github.com/gobwas/glob/syntax/lexer.go b/vendor/github.com/gobwas/glob/syntax/lexer.go new file mode 100644 index 000000000..428608023 --- /dev/null +++ b/vendor/github.com/gobwas/glob/syntax/lexer.go @@ -0,0 +1,381 @@ +// Package syntax implements the lexer of the glob pattern syntax. The parser +// lives in package glob; the syntax itself is described at [glob.Compile]. +package syntax + +import ( + "bytes" + "fmt" + "slices" + "unicode/utf8" +) + +// TokenType tells the kind of a [Token]. +type TokenType int + +const ( + // EOF marks the end of the input; the lexer returns it repeatedly. + EOF TokenType = iota + // Error carries an error message in Token.Data; the lexer keeps + // returning it once it happened. Note that the lexer catches only the + // errors local to a token (an invalid UTF-8 sequence, a malformed + // character class): the structural ones, like an unclosed `{`, are for + // the parser to detect. + Error + // Text is a run of literal characters, with the escapes resolved. + Text + // Any is the `*` wildcard. + Any + // Super is the `**` wildcard. + Super + // Single is the `?` wildcard. + Single + // Not is the `!` right after the `[` of a character class. + Not + // TermSeparator is the `,` between the alternatives of a `{...}` group. + // Outside of a group a comma is a plain Text character. + TermSeparator + // RangeOpen and RangeClose are the `[` and `]` of a character class. + // Between them the lexer produces either a Text token (a set of + // characters, `[abc]`) or a RangeLo, RangeBetween, RangeHi triple (a + // range, `[a-c]`), possibly preceded by Not. + RangeOpen + RangeClose + RangeLo + RangeHi + RangeBetween + // TermsOpen and TermsClose are the `{` and `}` of an alternatives group. + TermsOpen + TermsClose +) + +func (tt TokenType) String() string { + switch tt { + case EOF: + return "eof" + case Error: + return "error" + case Text: + return "text" + case Any: + return "any" + case Super: + return "super" + case Single: + return "single" + case Not: + return "not" + case TermSeparator: + return "separator" + case RangeOpen: + return "range_open" + case RangeClose: + return "range_close" + case RangeLo: + return "range_lo" + case RangeHi: + return "range_hi" + case RangeBetween: + return "range_between" + case TermsOpen: + return "terms_open" + case TermsClose: + return "terms_close" + default: + return "" + } +} + +// Token is a lexeme of the pattern: its kind and the source text it was +// read from (or the error message for Error, the literal characters with +// the escapes resolved for Text). +type Token struct { + Type TokenType + Data string +} + +func (t Token) String() string { + return fmt.Sprintf("%v<%q>", t.Type, t.Data) +} + +const ( + char_any = '*' + char_comma = ',' + char_single = '?' + char_escape = '\\' + char_range_open = '[' + char_range_close = ']' + char_terms_open = '{' + char_terms_close = '}' + char_range_not = '!' + char_range_between = '-' +) + +var specials = []byte{ + char_any, + char_single, + char_escape, + char_range_open, + char_range_close, + char_terms_open, + char_terms_close, +} + +// IsSpecial reports whether c is a glob meta character, that is, one that +// [glob.QuoteMeta] escapes. Note that `,`, `!` and `-` are not among them: +// they are special only inside `{...}` and `[...]` respectively, which are. +func IsSpecial(c byte) bool { + return bytes.IndexByte(specials, c) != -1 +} + +type tokens []Token + +func (i *tokens) shift() (ret Token) { + ret = (*i)[0] + copy(*i, (*i)[1:]) + *i = (*i)[:len(*i)-1] + return +} + +func (i *tokens) push(v Token) { + *i = append(*i, v) +} + +func (i *tokens) empty() bool { + return len(*i) == 0 +} + +// eof is the end-of-input sentinel. It must not collide with any rune that +// can appear in a valid pattern -- note that U+0000 can. +const eof rune = -1 + +// Lexer splits a pattern into tokens; see [Lexer.Next]. +type Lexer struct { + data string + pos int + err error + + tokens tokens + termsLevel int + + lastRune rune + lastRuneSize int + hasRune bool +} + +// NewLexer returns a lexer over the source pattern. +func NewLexer(source string) *Lexer { + l := &Lexer{ + data: source, + tokens: tokens(make([]Token, 0, 4)), + } + return l +} + +// Offset returns the byte offset in the source the lexer stopped at, that +// is, the position right after the most recently returned token. +func (l *Lexer) Offset() int { + return l.pos +} + +// Next returns the next token. Once the input is over it returns EOF, and +// once an error happened it returns that Error, repeatedly. +func (l *Lexer) Next() Token { + if l.err != nil { + return Token{Error, l.err.Error()} + } + if !l.tokens.empty() { + return l.tokens.shift() + } + + l.fetchItem() + return l.Next() +} + +func (l *Lexer) peek() (r rune, w int) { + if l.pos == len(l.data) { + return eof, 0 + } + + r, w = utf8.DecodeRuneInString(l.data[l.pos:]) + if r == utf8.RuneError && w == 1 { + // An invalid encoding: a valid U+FFFD decodes at its width of 3. + l.errorf("invalid UTF-8 sequence") + r = eof + w = 0 + } + + return +} + +func (l *Lexer) read() rune { + if l.hasRune { + l.hasRune = false + l.seek(l.lastRuneSize) + return l.lastRune + } + + r, s := l.peek() + l.seek(s) + + l.lastRune = r + l.lastRuneSize = s + + return r +} + +func (l *Lexer) seek(w int) { + l.pos += w +} + +func (l *Lexer) unread() { + if l.hasRune { + l.errorf("could not unread rune") + return + } + l.seek(-l.lastRuneSize) + l.hasRune = true +} + +func (l *Lexer) errorf(f string, v ...any) { + l.err = fmt.Errorf(f, v...) +} + +func (l *Lexer) inTerms() bool { + return l.termsLevel > 0 +} + +func (l *Lexer) termsEnter() { + l.termsLevel++ +} + +func (l *Lexer) termsLeave() { + l.termsLevel-- +} + +var inTextBreakers = []rune{char_single, char_any, char_range_open, char_terms_open} +var inTermsBreakers = append(inTextBreakers, char_terms_close, char_comma) + +func (l *Lexer) fetchItem() { + r := l.read() + switch { + case r == eof: + l.tokens.push(Token{EOF, ""}) + + case r == char_terms_open: + l.termsEnter() + l.tokens.push(Token{TermsOpen, string(r)}) + + case r == char_comma && l.inTerms(): + l.tokens.push(Token{TermSeparator, string(r)}) + + case r == char_terms_close && l.inTerms(): + l.tokens.push(Token{TermsClose, string(r)}) + l.termsLeave() + + case r == char_range_open: + l.tokens.push(Token{RangeOpen, string(r)}) + l.fetchRange() + + case r == char_single: + l.tokens.push(Token{Single, string(r)}) + + case r == char_any: + if l.read() == char_any { + l.tokens.push(Token{Super, string(r) + string(r)}) + } else { + l.unread() + l.tokens.push(Token{Any, string(r)}) + } + + default: + l.unread() + + var breakers []rune + if l.inTerms() { + breakers = inTermsBreakers + } else { + breakers = inTextBreakers + } + l.fetchText(breakers) + } +} + +func (l *Lexer) fetchRange() { + var wantHi bool + var wantClose bool + var seenNot bool + for { + r := l.read() + if r == eof { + l.errorf("unexpected end of input") + return + } + + if wantClose { + if r != char_range_close { + l.errorf("expected close range character") + } else { + l.tokens.push(Token{RangeClose, string(r)}) + } + return + } + + if wantHi { + l.tokens.push(Token{RangeHi, string(r)}) + wantClose = true + continue + } + + if !seenNot && r == char_range_not { + l.tokens.push(Token{Not, string(r)}) + seenNot = true + continue + } + + if n, w := l.peek(); n == char_range_between { + l.seek(w) + l.tokens.push(Token{RangeLo, string(r)}) + l.tokens.push(Token{RangeBetween, string(n)}) + wantHi = true + continue + } + + l.unread() // unread first peek and fetch as text + l.fetchText([]rune{char_range_close}) + wantClose = true + } +} + +func (l *Lexer) fetchText(breakers []rune) { + var data []rune + var escaped bool + +reading: + for { + r := l.read() + if r == eof { + if escaped { + l.errorf("trailing backslash") + } + break + } + + if !escaped { + if r == char_escape { + escaped = true + continue + } + if slices.Index(breakers, r) != -1 { + l.unread() + break reading + } + } + + escaped = false + data = append(data, r) + } + + if len(data) > 0 { + l.tokens.push(Token{Text, string(data)}) + } +} diff --git a/vendor/github.com/gobwas/glob/syntax/lexer/lexer.go b/vendor/github.com/gobwas/glob/syntax/lexer/lexer.go deleted file mode 100644 index a1c8d1962..000000000 --- a/vendor/github.com/gobwas/glob/syntax/lexer/lexer.go +++ /dev/null @@ -1,273 +0,0 @@ -package lexer - -import ( - "bytes" - "fmt" - "github.com/gobwas/glob/util/runes" - "unicode/utf8" -) - -const ( - char_any = '*' - char_comma = ',' - char_single = '?' - char_escape = '\\' - char_range_open = '[' - char_range_close = ']' - char_terms_open = '{' - char_terms_close = '}' - char_range_not = '!' - char_range_between = '-' -) - -var specials = []byte{ - char_any, - char_single, - char_escape, - char_range_open, - char_range_close, - char_terms_open, - char_terms_close, -} - -func Special(c byte) bool { - return bytes.IndexByte(specials, c) != -1 -} - -type tokens []Token - -func (i *tokens) shift() (ret Token) { - ret = (*i)[0] - copy(*i, (*i)[1:]) - *i = (*i)[:len(*i)-1] - return -} - -func (i *tokens) push(v Token) { - *i = append(*i, v) -} - -func (i *tokens) empty() bool { - return len(*i) == 0 -} - -var eof rune = 0 - -type lexer struct { - data string - pos int - err error - - tokens tokens - termsLevel int - - lastRune rune - lastRuneSize int - hasRune bool -} - -func NewLexer(source string) *lexer { - l := &lexer{ - data: source, - tokens: tokens(make([]Token, 0, 4)), - } - return l -} - -func (l *lexer) Next() Token { - if l.err != nil { - return Token{Error, l.err.Error()} - } - if !l.tokens.empty() { - return l.tokens.shift() - } - - l.fetchItem() - return l.Next() -} - -func (l *lexer) peek() (r rune, w int) { - if l.pos == len(l.data) { - return eof, 0 - } - - r, w = utf8.DecodeRuneInString(l.data[l.pos:]) - if r == utf8.RuneError { - l.errorf("could not read rune") - r = eof - w = 0 - } - - return -} - -func (l *lexer) read() rune { - if l.hasRune { - l.hasRune = false - l.seek(l.lastRuneSize) - return l.lastRune - } - - r, s := l.peek() - l.seek(s) - - l.lastRune = r - l.lastRuneSize = s - - return r -} - -func (l *lexer) seek(w int) { - l.pos += w -} - -func (l *lexer) unread() { - if l.hasRune { - l.errorf("could not unread rune") - return - } - l.seek(-l.lastRuneSize) - l.hasRune = true -} - -func (l *lexer) errorf(f string, v ...interface{}) { - l.err = fmt.Errorf(f, v...) -} - -func (l *lexer) inTerms() bool { - return l.termsLevel > 0 -} - -func (l *lexer) termsEnter() { - l.termsLevel++ -} - -func (l *lexer) termsLeave() { - l.termsLevel-- -} - -var inTextBreakers = []rune{char_single, char_any, char_range_open, char_terms_open} -var inTermsBreakers = append(inTextBreakers, char_terms_close, char_comma) - -func (l *lexer) fetchItem() { - r := l.read() - switch { - case r == eof: - l.tokens.push(Token{EOF, ""}) - - case r == char_terms_open: - l.termsEnter() - l.tokens.push(Token{TermsOpen, string(r)}) - - case r == char_comma && l.inTerms(): - l.tokens.push(Token{Separator, string(r)}) - - case r == char_terms_close && l.inTerms(): - l.tokens.push(Token{TermsClose, string(r)}) - l.termsLeave() - - case r == char_range_open: - l.tokens.push(Token{RangeOpen, string(r)}) - l.fetchRange() - - case r == char_single: - l.tokens.push(Token{Single, string(r)}) - - case r == char_any: - if l.read() == char_any { - l.tokens.push(Token{Super, string(r) + string(r)}) - } else { - l.unread() - l.tokens.push(Token{Any, string(r)}) - } - - default: - l.unread() - - var breakers []rune - if l.inTerms() { - breakers = inTermsBreakers - } else { - breakers = inTextBreakers - } - l.fetchText(breakers) - } -} - -func (l *lexer) fetchRange() { - var wantHi bool - var wantClose bool - var seenNot bool - for { - r := l.read() - if r == eof { - l.errorf("unexpected end of input") - return - } - - if wantClose { - if r != char_range_close { - l.errorf("expected close range character") - } else { - l.tokens.push(Token{RangeClose, string(r)}) - } - return - } - - if wantHi { - l.tokens.push(Token{RangeHi, string(r)}) - wantClose = true - continue - } - - if !seenNot && r == char_range_not { - l.tokens.push(Token{Not, string(r)}) - seenNot = true - continue - } - - if n, w := l.peek(); n == char_range_between { - l.seek(w) - l.tokens.push(Token{RangeLo, string(r)}) - l.tokens.push(Token{RangeBetween, string(n)}) - wantHi = true - continue - } - - l.unread() // unread first peek and fetch as text - l.fetchText([]rune{char_range_close}) - wantClose = true - } -} - -func (l *lexer) fetchText(breakers []rune) { - var data []rune - var escaped bool - -reading: - for { - r := l.read() - if r == eof { - break - } - - if !escaped { - if r == char_escape { - escaped = true - continue - } - - if runes.IndexRune(breakers, r) != -1 { - l.unread() - break reading - } - } - - escaped = false - data = append(data, r) - } - - if len(data) > 0 { - l.tokens.push(Token{Text, string(data)}) - } -} diff --git a/vendor/github.com/gobwas/glob/syntax/lexer/token.go b/vendor/github.com/gobwas/glob/syntax/lexer/token.go deleted file mode 100644 index 2797c4e83..000000000 --- a/vendor/github.com/gobwas/glob/syntax/lexer/token.go +++ /dev/null @@ -1,88 +0,0 @@ -package lexer - -import "fmt" - -type TokenType int - -const ( - EOF TokenType = iota - Error - Text - Char - Any - Super - Single - Not - Separator - RangeOpen - RangeClose - RangeLo - RangeHi - RangeBetween - TermsOpen - TermsClose -) - -func (tt TokenType) String() string { - switch tt { - case EOF: - return "eof" - - case Error: - return "error" - - case Text: - return "text" - - case Char: - return "char" - - case Any: - return "any" - - case Super: - return "super" - - case Single: - return "single" - - case Not: - return "not" - - case Separator: - return "separator" - - case RangeOpen: - return "range_open" - - case RangeClose: - return "range_close" - - case RangeLo: - return "range_lo" - - case RangeHi: - return "range_hi" - - case RangeBetween: - return "range_between" - - case TermsOpen: - return "terms_open" - - case TermsClose: - return "terms_close" - - default: - return "undef" - } -} - -type Token struct { - Type TokenType - Raw string -} - -func (t Token) String() string { - return fmt.Sprintf("%v<%q>", t.Type, t.Raw) -} diff --git a/vendor/github.com/gobwas/glob/syntax/syntax.go b/vendor/github.com/gobwas/glob/syntax/syntax.go deleted file mode 100644 index 1d168b148..000000000 --- a/vendor/github.com/gobwas/glob/syntax/syntax.go +++ /dev/null @@ -1,14 +0,0 @@ -package syntax - -import ( - "github.com/gobwas/glob/syntax/ast" - "github.com/gobwas/glob/syntax/lexer" -) - -func Parse(s string) (*ast.Node, error) { - return ast.Parse(lexer.NewLexer(s)) -} - -func Special(b byte) bool { - return lexer.Special(b) -} diff --git a/vendor/github.com/gobwas/glob/util/runes/runes.go b/vendor/github.com/gobwas/glob/util/runes/runes.go deleted file mode 100644 index a72355641..000000000 --- a/vendor/github.com/gobwas/glob/util/runes/runes.go +++ /dev/null @@ -1,154 +0,0 @@ -package runes - -func Index(s, needle []rune) int { - ls, ln := len(s), len(needle) - - switch { - case ln == 0: - return 0 - case ln == 1: - return IndexRune(s, needle[0]) - case ln == ls: - if Equal(s, needle) { - return 0 - } - return -1 - case ln > ls: - return -1 - } - -head: - for i := 0; i < ls && ls-i >= ln; i++ { - for y := 0; y < ln; y++ { - if s[i+y] != needle[y] { - continue head - } - } - - return i - } - - return -1 -} - -func LastIndex(s, needle []rune) int { - ls, ln := len(s), len(needle) - - switch { - case ln == 0: - if ls == 0 { - return 0 - } - return ls - case ln == 1: - return IndexLastRune(s, needle[0]) - case ln == ls: - if Equal(s, needle) { - return 0 - } - return -1 - case ln > ls: - return -1 - } - -head: - for i := ls - 1; i >= 0 && i >= ln; i-- { - for y := ln - 1; y >= 0; y-- { - if s[i-(ln-y-1)] != needle[y] { - continue head - } - } - - return i - ln + 1 - } - - return -1 -} - -// IndexAny returns the index of the first instance of any Unicode code point -// from chars in s, or -1 if no Unicode code point from chars is present in s. -func IndexAny(s, chars []rune) int { - if len(chars) > 0 { - for i, c := range s { - for _, m := range chars { - if c == m { - return i - } - } - } - } - return -1 -} - -func Contains(s, needle []rune) bool { - return Index(s, needle) >= 0 -} - -func Max(s []rune) (max rune) { - for _, r := range s { - if r > max { - max = r - } - } - - return -} - -func Min(s []rune) rune { - min := rune(-1) - for _, r := range s { - if min == -1 { - min = r - continue - } - - if r < min { - min = r - } - } - - return min -} - -func IndexRune(s []rune, r rune) int { - for i, c := range s { - if c == r { - return i - } - } - return -1 -} - -func IndexLastRune(s []rune, r rune) int { - for i := len(s) - 1; i >= 0; i-- { - if s[i] == r { - return i - } - } - - return -1 -} - -func Equal(a, b []rune) bool { - if len(a) == len(b) { - for i := 0; i < len(a); i++ { - if a[i] != b[i] { - return false - } - } - - return true - } - - return false -} - -// HasPrefix tests whether the string s begins with prefix. -func HasPrefix(s, prefix []rune) bool { - return len(s) >= len(prefix) && Equal(s[0:len(prefix)], prefix) -} - -// HasSuffix tests whether the string s ends with suffix. -func HasSuffix(s, suffix []rune) bool { - return len(s) >= len(suffix) && Equal(s[len(s)-len(suffix):], suffix) -} diff --git a/vendor/github.com/gobwas/glob/util/strings/strings.go b/vendor/github.com/gobwas/glob/util/strings/strings.go deleted file mode 100644 index e8ee1920b..000000000 --- a/vendor/github.com/gobwas/glob/util/strings/strings.go +++ /dev/null @@ -1,39 +0,0 @@ -package strings - -import ( - "strings" - "unicode/utf8" -) - -func IndexAnyRunes(s string, rs []rune) int { - for _, r := range rs { - if i := strings.IndexRune(s, r); i != -1 { - return i - } - } - - return -1 -} - -func LastIndexAnyRunes(s string, rs []rune) int { - for _, r := range rs { - i := -1 - if 0 <= r && r < utf8.RuneSelf { - i = strings.LastIndexByte(s, byte(r)) - } else { - sub := s - for len(sub) > 0 { - j := strings.IndexRune(s, r) - if j == -1 { - break - } - i = j - sub = sub[i+1:] - } - } - if i != -1 { - return i - } - } - return -1 -} diff --git a/vendor/github.com/redis/go-redis/v9/.gitignore b/vendor/github.com/redis/go-redis/v9/.gitignore index 93affec7f..4134a1f45 100644 --- a/vendor/github.com/redis/go-redis/v9/.gitignore +++ b/vendor/github.com/redis/go-redis/v9/.gitignore @@ -17,3 +17,12 @@ maintenanceNotifications/docs/ # Docker-generated files (TLS certificates, cluster data, etc.) dockers/*/tls/ dockers/osscluster-tls/ + +# Per-user Claude Code settings (machine/personal overrides, not shared policy) +.claude/settings.local.json + +# example build artifacts +example/autopipeline/autopipeline + +# Claude Code worktrees (ephemeral, local) +.claude/worktrees/ diff --git a/vendor/github.com/redis/go-redis/v9/AGENTS.md b/vendor/github.com/redis/go-redis/v9/AGENTS.md new file mode 100644 index 000000000..ca0a31168 --- /dev/null +++ b/vendor/github.com/redis/go-redis/v9/AGENTS.md @@ -0,0 +1,228 @@ +# AGENTS.md + +Guidance for AI coding agents (and humans) working in this repository. This is +the shared, tool-agnostic source of truth: Claude Code loads it through +`CLAUDE.md` (which imports this file), and other agents (Codex, Cursor, Aider, +Zed, …) read `AGENTS.md` directly. Edit repository guidance here, not in +`CLAUDE.md`. + +## Repository + +go-redis is the official Redis client for Go. Module path: +`github.com/redis/go-redis/v9` (Go 1.24+). The repo is a multi-module workspace +— every directory containing a `go.mod` is built and tested independently: + +- root (`github.com/redis/go-redis/v9`) — the client library. +- `extra/redisotel`, `extra/redisotel-native`, `extra/redisprometheus`, + `extra/rediscensus`, `extra/rediscmd` — instrumentation adapters with their + own module paths (so they can pin large telemetry deps without forcing them on + root consumers). +- `internal/customvet` — custom `go vet` analyzers (also its own module). +- `maintnotifications/e2e`, `doctests`, `fuzz`, examples under `example/` — + separate modules. + +The Makefile iterates over every `go.mod` (`GO_MOD_DIRS`) when running +`test.ci`, `go_mod_tidy`, etc. When you add a dependency in one module, you +almost never need to update the others. + +## Common commands + +Tests run against a Redis stack started via Docker Compose. Profiles in +`docker-compose.yml` control which services come up (`standalone`, `cluster`, +`sentinel`, `all`, `e2e`). + +```sh +make docker.start # bring up the full test stack (profile: all) +make docker.stop +make test # docker.start -> test.ci -> docker.stop +make test.ci # run tests assuming containers are already up +make test.ci.skip-vectorsets # when REDIS_VERSION < 8 +make bench # go test -bench=. (root module only) +make fmt # gofumpt + goimports -local github.com/redis/go-redis +make build +make go_mod_tidy # go mod tidy across every module +``` + +E2E (maintenance notifications) needs the extra `cae-resp-proxy` service: + +```sh +make test.e2e # starts e2e profile, runs ./maintnotifications/e2e/, tears down +make test.e2e.docker # subset that runs inside docker +make test.e2e.logic # logic-only tests, no proxy required +``` + +Run a single test. The root suite is Ginkgo-based (`bsm/ginkgo` + `bsm/gomega` +forks), so `go test -run` matches the Go-level wrapper and you focus a spec with +the Ginkgo flag: + +```sh +go test -run TestGinkgoSuite . -ginkgo.focus="ZAdd" +go test -run TestGinkgoSuite . -ginkgo.focus="cluster" +``` + +Plain `go test` tests (most files outside the Ginkgo suite, e.g. `internal/...`, +`maintnotifications/...`) work the usual way: + +```sh +go test -run TestConnStateMachine ./internal/pool/... +go test -race -run TestCircuitBreaker ./maintnotifications/... +``` + +Env knobs (passed through the Makefile): + +- `REDIS_VERSION` — e.g. `8.8`. Drives both the test image tag and + `main_test.go` version-gating (`SkipBeforeRedisVersion` / + `SkipAfterRedisVersion`). +- `CLIENT_LIBS_TEST_IMAGE` — full image ref, e.g. + `redislabs/client-libs-test:8.8-m03`. +- `RE_CLUSTER=true` — run against a Redis Enterprise cluster instead of the + docker-compose stack (the suite then skips ring/sentinel/TLS-cluster setup). +- `RCE_DOCKER=true` — Redis CE in docker (default for `make test`). +- `REDIS_PORT` — override the default standalone port (`6380`). + +CI also runs the custom vet tool: +`go vet -vettool ./internal/customvet/customvet ./...`. The `setval` analyzer +requires every `Cmder` with a `Result()` to also have a `SetVal()`. + +## Architecture + +### Client types (root package) + +All clients are in the root package and share most plumbing: + +- `Client` (`redis.go`) — single-node client. +- `ClusterClient` (`osscluster.go`) — Redis Cluster aware. `osscluster_router.go` + routes commands to the right shard; `internal/routing/` handles cluster-wide + aggregation policies (e.g. fan-out for `KEYS`, `DBSIZE`). +- `Ring` (`ring.go`) — client-side sharding across independent Redis nodes + (consistent hashing, no cluster protocol). +- Failover client (`sentinel.go`) — Sentinel-managed failover. +- `UniversalClient` (`universal.go`) — wrapper that picks one of the above based + on options. + +Command surface lives in topical files: `string_commands.go`, `hash_commands.go`, +`stream_commands.go`, `search_commands.go`, `vectorset_commands.go`, etc. Each +file defines methods on the shared `Cmdable` interface so every client type gets +the same API. + +### Hooks (`redis.go` `hooksMixin`) + +Three hook chains run around every operation: `DialHook`, `ProcessHook`, +`ProcessPipelineHook`. Hooks are registered via `client.AddHook(...)` and chain +in FIFO order; each hook must call `next` to continue. When a hook wraps an +error, it must call `cmd.SetErr(wrappedErr)` so the typed-error helpers +(`redis.IsLoadingError`, `IsMovedError`, etc. in `error.go`) keep working through +`errors.As`. The README has a longer pipeline-hook example. + +### Connection pool (`internal/pool`) + +Owns dialing, idle/active connection bookkeeping, conn state (`conn_state.go`), +pubsub-conn lifecycle (`pubsub.go`), and the dial-retry/backoff logic that powers +`DialerRetries` / `DialerRetryBackoff` (also exposed at `dial_retry_backoff.go` +in the root). `OnConnect`, `MinIdleConns`, and the buffer-size options +(`ReadBufferSize`/`WriteBufferSize`, default 32 KiB since v9.12) flow through +here. + +### Protocol (`internal/proto`) + +RESP2/RESP3 reader and writer. Push notifications (RESP3 `>`-prefixed frames) are +peeked here and dispatched via the `push/` package. The `push.Registry` lets +callers register handlers for specific notification names; +`maintnotifications/push_notification_handler.go` is how `maintnotifications` +plugs in. + +### Maintenance notifications (`maintnotifications/`) + +This is a non-trivial subsystem worth understanding before touching +cluster/handoff code. It listens for RESP3 push notifications about cluster +maintenance (`MOVING`, `MIGRATING`, `MIGRATED`, `FAILING_OVER`, `FAILED_OVER` +for standalone; `SMIGRATING`, `SMIGRATED` for cluster) and performs seamless +connection handoff to new endpoints. Key pieces: + +- `manager.go` — coordinates state transitions. +- `handoff_worker.go` — moves in-flight ops to new connections. +- `pool_hook.go` — integrates with `internal/pool` to mark/replace connections. +- `circuit_breaker.go` — backs off when the upstream is unhealthy. +- `state.go` — per-connection state machine. +- E2E coverage lives in `maintnotifications/e2e/` and drives a fault-injector / + RESP proxy (`cae-resp-proxy`). + +Configuration is via `redis.Options.MaintNotificationsConfig`; modes are +`ModeAuto` (default), `ModeEnabled` (require server support), `ModeDisabled`. +RESP3 (`Protocol: 3`) is required. + +### Authentication (`auth/`, `internal/auth/streaming`) + +Four credential sources, in priority order: streaming provider (e.g. Entra ID +via `go-redis-entraid`), context-based provider, function provider, static +`Username`/`Password`. The streaming provider is what enables token rotation +without reconnecting — the listener in `auth/reauth_credentials_listener.go` +issues `AUTH` on each refresh. + +### Internal helpers + +- `internal/hscan` — struct scanning for `HGETALL` results (`Scan` interface + re-exported as `redis.Scanner`). +- `internal/hashtag` — extracts `{tag}` segments for cluster slot routing. +- `internal/routing` — aggregator policies and shard pickers used by + `ClusterClient` for multi-shard commands. +- `internal/otel` — small OpenTelemetry shim used to keep root free of telemetry + deps; full instrumentation lives in `extra/redisotel-native`. + +## Architectural specs + +Read the relevant design doc **before** changing code in that subsystem. They +cover invariants and decisions that aren't obvious from the code, and are plain +markdown any tool or editor can open: + +- `.claude/specs/pool.md` — connection pool: `wantConn` queue and FIFO + discipline, `ConnState` machine, dial retry/backoff, hook integration, the + re-auth/handoff coexistence contract. +- `.claude/specs/cluster-routing.md` — slot computation, MOVED/ASK redirection, + request/response policies, aggregators, replica routing, topology reload, + cross-slot rules. +- `.claude/specs/maintnotifications.md` — RESP3 push notification protocol, mode + handshake, per-conn state, handoff worker pool, circuit breaker, endpoint-type + resolution, cluster vs. standalone differences. + +## Conventions + +- New `Cmder` type → also implement `SetVal` (the custom vet `setval` check + enforces this; `SetErr` is on the embedded `baseCmd`). +- Wrap errors with custom error types that implement `Unwrap`, or use + `fmt.Errorf("...: %w", err)`. Always call `cmd.SetErr(...)` after wrapping so + typed-error checks still pass. +- `gofumpt` + `goimports -local github.com/redis/go-redis` is the formatter + (`make fmt`); CI runs both. +- Don't log directly — use `internal.Logger` (set via `redis.SetLogger`); + `logging.Disable()` is called in tests. +- Version-gate Redis-version-specific tests with `SkipBeforeRedisVersion` / + `SkipAfterRedisVersion` rather than skipping at the suite level. + +### Commits and PRs + +Conventional Commits, short and exact — `(): `. +Subject ≤50 chars (hard cap 72), imperative ("add", not "added"), no trailing +period. Body only when the *why* isn't obvious from the diff; wrap at 72. + +- Types: `feat`, `fix`, `refactor`, `perf`, `docs`, `test`, `chore` (also + `build`, `ci`, `style`, `revert`). +- Scope = the subsystem touched, lowercase: `pool`, `conn`, `pubsub`, + `sentinel`, `retry`, `command`/`cmd`, `vectorset`, `otel`, `streams`, `push`, + `deps`, `ci`, `tests`, `docs`. Omit only for genuinely cross-cutting changes. +- Breaking change: `feat(scope)!: ...` plus a `BREAKING CHANGE:` body line. + Reference issues/PRs at the end — `Closes #42`, `Refs #17`. +- **No AI-attribution trailer.** Do not add `Co-Authored-By: …`, "Generated with + …", or any AI-attribution line to commits or PR bodies in this repo. + +## Repo-specific tooling + +`.claude/` holds shared AI config: + +- `commands/` — slash commands (e.g. `check-ci`, which summarizes a PR's CI). +- `skills/` — task playbooks: `testing`, `add-command`, `commit-style`, + `update-ci-image`, `prepare-release`. +- `specs/` — the architecture docs listed above. + +For Claude Code, the skills auto-trigger from their descriptions. For other +tools, each `SKILL.md` is plain markdown you can open and follow directly. diff --git a/vendor/github.com/redis/go-redis/v9/CLAUDE.md b/vendor/github.com/redis/go-redis/v9/CLAUDE.md new file mode 100644 index 000000000..7e9eb08c5 --- /dev/null +++ b/vendor/github.com/redis/go-redis/v9/CLAUDE.md @@ -0,0 +1,19 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +Repository guidance — layout, commands, architecture, and conventions — is +maintained in [`AGENTS.md`](AGENTS.md) so it stays shared across AI tools. It is +imported below; edit `AGENTS.md`, not this file, for that content. + +@AGENTS.md + +## Claude-specific + +- Repo-local **skills** under `.claude/skills/` auto-trigger from their + descriptions — no need to invoke them manually (the set is listed in + `AGENTS.md`). +- **Slash commands** under `.claude/commands/` (e.g. `/check-ci`) are available + in-session. +- Architectural **specs** under `.claude/specs/` are read on demand; open the + relevant one before changing that subsystem. diff --git a/vendor/github.com/redis/go-redis/v9/CONTRIBUTING.md b/vendor/github.com/redis/go-redis/v9/CONTRIBUTING.md index 8c68c522e..9f175644a 100644 --- a/vendor/github.com/redis/go-redis/v9/CONTRIBUTING.md +++ b/vendor/github.com/redis/go-redis/v9/CONTRIBUTING.md @@ -37,7 +37,7 @@ Here's how to get started with your code contribution: > Note: this clones and builds the docker containers specified in `docker-compose.yml`, to understand more about > the infrastructure that will be started you can check the `docker-compose.yml`. You also have the possiblity > to specify the redis image that will be pulled with the env variable `CLIENT_LIBS_TEST_IMAGE`. -> By default the docker image that will be pulled and started is `redislabs/client-libs-test:8.2.1-pre`. +> By default the docker image that will be pulled and started is `redislabs/client-libs-test:8.10.0`. > If you want to test with newer Redis version, using a newer version of `redislabs/client-libs-test` should work out of the box. 4. While developing, make sure the tests pass by running `make test` (if you have the docker containers running, `make test.ci` may be sufficient). diff --git a/vendor/github.com/redis/go-redis/v9/Makefile b/vendor/github.com/redis/go-redis/v9/Makefile index 1322bd4f3..8881f2d31 100644 --- a/vendor/github.com/redis/go-redis/v9/Makefile +++ b/vendor/github.com/redis/go-redis/v9/Makefile @@ -1,8 +1,8 @@ GO_MOD_DIRS := $(shell find . -type f -name 'go.mod' -exec dirname {} \; | sort) -REDIS_VERSION ?= 8.8 +REDIS_VERSION ?= 8.10 RE_CLUSTER ?= false RCE_DOCKER ?= true -CLIENT_LIBS_TEST_IMAGE ?= redislabs/client-libs-test:8.8.0 +CLIENT_LIBS_TEST_IMAGE ?= redislabs/client-libs-test:8.10.0 docker.start: export RE_CLUSTER=$(RE_CLUSTER) && \ @@ -71,6 +71,35 @@ test.ci.skip-vectorsets: cd internal/customvet && go build . go vet -vettool ./internal/customvet/customvet +# Replay the parametrized command integration suites through the AutoPipeliner +# Cmdable faces (blocking + async) to prove the commands behave the same +# batched as on a plain client. Selected via GOREDIS_TEST_SUBJECT (see +# newUniversalSubject in main_test.go). Requires the docker env +# (make docker.start). +# +# The focus covers every parametrized suite (some via the Commands/BitCount +# substrings — Describe names differ in case). Skipped on purpose: DDL Commands (needs the cluster topology the +# lightweight BeforeSuite doesn't build), HotKeys Commands (same), and +# AutoPipeline Blocking Commands (the AP suite itself — running it through an +# AP subject would nest engines). +test.autopipeline-subjects: + # RE_CLUSTER=true forces the lightweight BeforeSuite (no sentinel/ring/cluster + # setup): the command suite only needs the standalone Redis, and running the + # full stateful BeforeSuite twice (once per subject) against the same server + # corrupts replication state and fails the second run. Both faces then run + # cleanly against the same env. The explicit -timeout keeps a hang from + # eating go test's 10m default per subject. + set -e; for subj in ap-blocking ap-async; do \ + echo "=== command suite via GOREDIS_TEST_SUBJECT=$$subj ==="; \ + (export RE_CLUSTER=true && \ + export RCE_DOCKER=$(RCE_DOCKER) && \ + export REDIS_VERSION=$(REDIS_VERSION) && \ + export GOREDIS_TEST_SUBJECT=$$subj && \ + go test -v . -race -skip Example -run TestGinkgoSuite -timeout 8m \ + -ginkgo.focus='Commands|RediSearch commands|Probabilistic commands|RedisTimeseries commands|Redis VectorSet commands|BitCount|ScanIterator|Advanced JSON' \ + -ginkgo.skip='AutoPipeline Blocking Commands|DDL Commands|HotKeys Commands'); \ + done + bench: export RE_CLUSTER=$(RE_CLUSTER) && \ export RCE_DOCKER=$(RCE_DOCKER) && \ @@ -101,7 +130,7 @@ test.e2e.logic: go test -v -run "TestCreateTestFaultInjectorLogic|TestFaultInjectorClientCreation" ./maintnotifications/e2e/ @echo "Logic tests completed!" -.PHONY: all test test.ci test.ci.skip-vectorsets bench fmt test.e2e test.e2e.logic docker.e2e.start docker.e2e.stop +.PHONY: all test test.ci test.ci.skip-vectorsets test.autopipeline-subjects bench fmt test.e2e test.e2e.logic docker.e2e.start docker.e2e.stop build: export RE_CLUSTER=$(RE_CLUSTER) && \ diff --git a/vendor/github.com/redis/go-redis/v9/README.md b/vendor/github.com/redis/go-redis/v9/README.md index ae90d2b7d..59a2eee8f 100644 --- a/vendor/github.com/redis/go-redis/v9/README.md +++ b/vendor/github.com/redis/go-redis/v9/README.md @@ -21,6 +21,7 @@ In `go-redis` we are aiming to support the last three releases of Redis. Current - [Redis 8.2](https://raw.githubusercontent.com/redis/redis/8.2/00-RELEASENOTES) - using Redis CE 8.2 - [Redis 8.4](https://raw.githubusercontent.com/redis/redis/8.4/00-RELEASENOTES) - using Redis CE 8.4 - [Redis 8.8](https://raw.githubusercontent.com/redis/redis/8.8/00-RELEASENOTES) - using Redis CE 8.8 +- [Redis 8.10](https://raw.githubusercontent.com/redis/redis/8.10/00-RELEASENOTES) - using Redis CE 8.10 Although the `go.mod` states it requires at minimum `go 1.24`, our CI is configured to run the tests against all supported versions of Redis and multiple versions of Go ([1.24](https://go.dev/doc/devel/release#go1.24.0), oldstable, and stable). We observe that some modules related test may not pass with @@ -78,9 +79,13 @@ surface. The API is experimental and may change in a future release. - [StreamingCredentialsProvider (e.g. entra id, oauth)](#1-streaming-credentials-provider-highest-priority) (experimental) - [Pub/Sub](https://redis.uptrace.dev/guide/go-redis-pubsub.html). - [Pipelines and transactions](https://redis.uptrace.dev/guide/go-redis-pipelines.html). +- [Automatic pipelining](#automatic-pipelining) (experimental) — batches concurrent + commands into pipelines for you; meant for high-throughput / high-load / scale + use cases. - [Scripting](https://redis.uptrace.dev/guide/lua-scripting.html). - [Redis Sentinel](https://redis.uptrace.dev/guide/go-redis-sentinel.html). - [Redis Cluster](https://redis.uptrace.dev/guide/go-redis-cluster.html). +- [Client-side caching](#client-side-caching). - [Redis Performance Monitoring](https://redis.uptrace.dev/guide/redis-performance-monitoring.html). - [Redis Probabilistic [RedisStack]](https://redis.io/docs/data-types/probabilistic/) - [Customizable read and write buffers size.](#custom-buffer-sizes) @@ -285,6 +290,50 @@ rdb := redis.NewClient(&redis.Options{ }) ``` +### Client-side caching + +go-redis supports server-assisted client-side caching for standalone clients. +Eligible read replies are stored in the application's memory, so repeated reads +can avoid a Redis round trip. Redis tracks which keys each connection has read +and sends RESP3 invalidation notifications when those keys change. go-redis +uses those notifications to evict affected entries automatically. + +> **Experimental:** The client-side caching API may change in a minor release. + +Enable the built-in bounded cache with `ClientSideCacheConfig`: + +```go +rdb := redis.NewClient(&redis.Options{ + Addr: "localhost:6379", + Protocol: 3, + DB: 0, + ClientSideCacheConfig: &redis.ClientSideCacheConfig{ + MaxEntries: 10_000, + }, +}) +defer rdb.Close() +``` + +Client-side caching currently requires RESP3, a standalone client, and database +0. Fixed `Username` and `Password` values are supported. It is disabled when a +dynamic credential provider is configured, because cached data must never be +reused after the client's ACL identity changes. Only deterministic read +commands supported by the cache are stored; writes and streaming responses +bypass it. + +While client-side caching is enabled, go-redis rejects `SELECT`, `AUTH`, +`HELLO` with arguments, `RESET`, `CLIENT TRACKING`, and raw `SUBSCRIBE`, +`PSUBSCRIBE`, or `SSUBSCRIBE` commands because they would change connection +state that the cache relies on. A guarded command also fails its whole +pipeline. The typed `Subscribe`, `PSubscribe`, and `SSubscribe` APIs remain +supported because they use dedicated connections. + +Invalidations are processed asynchronously. `DrainInterval` controls how often +idle connections are checked for them, while `MaxStaleness` can provide an +optional upper bound on an entry's lifetime. See the +[client-side caching example](./example/client-side-caching) for a working +demonstration. + ### Connecting via a redis url go-redis also supports connecting via the @@ -340,6 +389,118 @@ rdb := redis.NewClient(&redis.Options{ }) ``` +### Automatic pipelining + +**Experimental** — the API may still change. Reach for autopipelining in +high-throughput / high-load / scale scenarios; at low concurrency a plain +client is simpler and just as fast. A runnable usage tour and throughput +comparison live in [`example/autopipeline`](example/autopipeline). + +> **EXPERIMENTAL:** the autopipelining API is subject to change in a future +> release as we gather feedback — pin your go-redis version if you adopt it. + +When many goroutines issue commands concurrently, autopipelining batches them +into Redis pipelines automatically — without you writing any pipeline code. It +comes in two faces: + +- **`AutoPipeline()` — blocking, drop-in.** Each command call blocks until it + executes and returns its own value/error, exactly like a normal client, so + existing code keeps working unchanged. Under concurrency the engine coalesces + commands from all goroutines into deep, back-to-back pipelines (a single + ordered batch stream by default), reaching several times a plain client's + executed commands per second in the same environment — roughly an order of + magnitude with a parallel-batch config (`MaxConcurrentBatches` > 1 with + `Unordered`). Per-goroutine ordering is preserved. +- **`AsyncAutoPipeline()` — deferred, highest throughput.** Command calls return + immediately; you submit a window of commands and read their results afterward, + which keeps each pipeline deep — tens of times a plain client's throughput. + Ordered by default. Absolute numbers depend heavily on the machine, network + path and server; see `autopipeline_bench_README.md` for the benchmark + methodology and multipliers. + +```go +rdb := redis.NewClient(&redis.Options{Addr: "localhost:6379"}) +defer rdb.Close() +ctx := context.Background() + +// Blocking face: drop-in for a normal client, batched under the hood. +ap, err := rdb.AutoPipeline() +if err != nil { // invalid AutoPipelineOptions, or the client is closed + log.Fatal(err) +} +defer ap.Close() + +var wg sync.WaitGroup +for i := 0; i < 1000; i++ { + wg.Add(1) + go func(i int) { + defer wg.Done() + key := fmt.Sprintf("key:%d", i) + if err := ap.Set(ctx, key, i, 0).Err(); err != nil { // blocks until executed + log.Printf("set %s: %v", key, err) + } + }(i) +} +wg.Wait() +``` + +For maximum throughput, submit a window on the async face and read later: + +```go +ctx := context.Background() +ap, err := rdb.AsyncAutoPipeline() // ordered by default +if err != nil { + log.Fatal(err) +} +defer ap.Close() + +cmds := make([]*redis.StatusCmd, 0, 200) +for i := 0; i < 200; i++ { + cmds = append(cmds, ap.Set(ctx, fmt.Sprintf("key:%d", i), i, 0)) // returns immediately +} +for _, cmd := range cmds { + if err := cmd.Err(); err != nil { // blocks until executed + log.Printf("set: %v", err) + } +} +``` + +Each face has a no-argument form that uses `Options.AutoPipelineOptions` (or the +built-in default) and a `WithOptions` form that takes an explicit +`*AutoPipelineOptions`; both return `(*AutoPipeliner, error)` — the error is +non-nil for an invalid config or a closed client (e.g. +`ap, err := rdb.AsyncAutoPipelineWithOptions(&redis.AutoPipelineOptions{MaxConcurrentBatches: 8, Unordered: true})`); +a handful of parallel batches saturates the link — more permits only add +overlapping batches without deepening them. +They work on `ClusterClient` too: commands are routed to the correct shard per +key, so a single batch may span many slots; ordering across nodes is per key +(same-key commands stay in order, different nodes' sub-pipelines run +concurrently). Because batches share a few pipeline connections, autopipelining +also needs far fewer connections than a plain client at the same concurrency +(see `PipelinePoolSize`). Autopipelining is only a win under concurrency (or +windowed submission) — a single goroutine issuing one blocking command at a +time sees little benefit, and a hand-written `Pipeline()` is still fastest when +you can batch by hand. + +Caveats: a command's context is not honored once it is queued (batches execute +on the autopipeliner's own context) — use a plain client for per-command +deadlines. Blocking commands (`BLPOP`, `WAIT`, ...) are never batched and run +directly on your context — as are `SHUTDOWN` and `MONITOR`, which would +poison a shared pipeline connection — and `Do` also bypasses batching with plain +`Client.Do` semantics — prefer the typed methods (`ap.Set`, `ap.Get`, ...). On +a dropped connection a batch is retried whole (up to `MaxRetries`), so +non-idempotent commands may execute twice. Both faces return a cached, +client-shared instance: the first call's config wins and `Close` stops it for +all callers. Hooks may read command results (the engine hands a hook running +on the dispatch goroutine the same view a plain pipeline hook gets), but a +hook must never issue a command on the same autopipeliner and wait for it — +the nested command needs the very dispatch slot the hook is holding, and the +engine only recovers by failing that flush after its 30s permit backstops. +`Options.Limiter` is consulted once per batch dispatch (as with a manual +pipeline), not once per command. An autopipeliner created on a +`WithTimeout`/`WithReadTimeout` clone is not stopped by the parent's `Close` — +close it explicitly. + ### Advanced Configuration go-redis supports extending the client identification phase to allow projects to send their own custom client identification. @@ -457,6 +618,24 @@ vals, err := rdb.Eval(ctx, "return {KEYS[1],ARGV[1]}", []string{"key"}, "hello") res, err := rdb.Do(ctx, "set", "key", "value").Result() ``` +### Raw commands and connection state + +`Do` sends the command verbatim on whichever pooled connection happens to be +free. For keyspace commands that is all you need. It is the wrong tool for +any command that alters **connection session state** — `SELECT`, +`CLIENT SETNAME`, `CLIENT TRACKING`, `RESET`, `HIMPORT PREPARE`/`DISCARD`, +and similar: the state lands on (or is wiped from) a single arbitrary +connection, later commands are served by other connections that don't share +it, and the affected connection eventually returns to the pool and serves +unrelated callers. The result is nondeterministic behavior that typed APIs +manage for you — for example, the typed `HImport*` methods keep a +client-side registry and replay fieldsets onto every connection that needs +them, while a raw `Do(ctx, "himport", "prepare", ...)` bypasses that +entirely, with no replay, recovery, or discard propagation. + +For session-scoped work without a typed API, hold a dedicated connection +(`client.Conn()`) for its whole lifetime and close it afterwards. + ## Typed Errors go-redis provides typed error checking functions for common Redis errors: diff --git a/vendor/github.com/redis/go-redis/v9/RELEASE-NOTES.md b/vendor/github.com/redis/go-redis/v9/RELEASE-NOTES.md index a125344da..0ebed0927 100644 --- a/vendor/github.com/redis/go-redis/v9/RELEASE-NOTES.md +++ b/vendor/github.com/redis/go-redis/v9/RELEASE-NOTES.md @@ -1,5 +1,244 @@ # Release Notes +# 9.22.0 (2026-08-03) + +This is a minor release introducing two flagship (experimental) features — **client-side caching** and **automatic pipelining** — alongside support for Redis 8.10, new commands, and a large batch of stability and parser-robustness fixes. It consolidates everything shipped in 9.22.0-beta.1, so the notes below cover the full 9.21.0 → 9.22.0 upgrade. + +⚠️ Two changes to be aware of when upgrading from 9.21.0: + +- **Default configuration values changed** ([#3918](https://github.com/redis/go-redis/pull/3918)): read/write timeouts, retry backoff, cluster state reload interval, and TCP keep-alive defaults are now aligned with the cross-SDK configuration proposal (see the highlight below). Explicitly configured values are unaffected. +- **`WaitAOF` return type corrected** ([#3888](https://github.com/redis/go-redis/pull/3888)): `WaitAOF` now returns `*IntSliceCmd`, matching the two-integer reply of `WAITAOF` (previously `*IntCmd`, which failed to parse the reply at runtime). Code referencing the old return type needs a one-line update. + +## 🚀 Highlights + +### Client-Side Caching (Experimental) + +The standalone `Client` gains server-assisted client-side caching built on RESP3 `CLIENT TRACKING`. Enable it by setting `ClientSideCacheConfig` in `Options` (or supply your own cache via `ClientSideCache` — e.g. to share one cache across clients). Cacheable read results are served from a local in-process cache and invalidated automatically when the server reports a change, cutting round trips for read-heavy workloads. + +The invalidation architecture is selected by `ClientSideCacheStrategy`; the default (and currently only) strategy is `CSCStrategySharedTracking`: one shared cache, every pool connection runs plain `CLIENT TRACKING ON`, and a background drainer applies buffered invalidations — portable (no BCAST) and consistent with the other Redis client libraries. Requirements and guardrails: RESP3 (`Protocol: 3`), standalone client, DB 0 only; commands that would change the connection identity (`SELECT`, `AUTH`, ...) are rejected while caching is enabled, and CSC is disabled when a credentials provider is set (fixed `Username`/`Password` work and are namespaced). See the README's [client-side caching section](README.md#client-side-caching) and the runnable [example](example/client-side-caching). + +**Experimental:** the API may change in a minor release. + +([#3941](https://github.com/redis/go-redis/pull/3941)) by [@ofekshenawa](https://github.com/ofekshenawa) + +### Automatic Pipelining (Experimental) + +`AutoPipeliner` is a background batcher that coalesces commands from many concurrent goroutines into Redis pipelines, multiplying throughput without any manual pipeline management. It comes in two faces, available on `Client` and `ClusterClient` (and configurable via `Options.AutoPipelineOptions` / `UniversalOptions.AutoPipelineOptions`): + +- **`AutoPipeline()`** — the blocking face: a drop-in `Cmdable` where each call blocks until executed, exactly like a plain client, while concurrent callers' commands batch together under the hood (measured locally over loopback: ~1M+ SET/sec vs ~100k unpipelined; indicative, not a guarantee). Per-goroutine command order is preserved. +- **`AsyncAutoPipeline()`** — the deferred face: command calls return immediately and every typed result accessor (`Val`/`Result`/`Err`/...) blocks until the command has executed. Submit a window of commands, then read the results, to keep pipelines deep (~2–3M SET/sec locally; indicative). + +`AutoPipelineOptions` controls batching: `MaxBatchSize` (soft target, default 200; the blocking face's preset uses 300), `MaxBatchBytes` (approximate payload cap so huge values flush as several bounded writes), `MaxFlushDelay` with optional `AdaptiveDelay` (delay scales down as the queue fills), and `MaxConcurrentBatches` (default 1 = a single ordered batch stream; raising it requires `Unordered: true`, so ordering is never lost by accident — `Validate()` rejects the combination otherwise). A usage tour and throughput comparison live in [`example/autopipeline`](example/autopipeline). + +**Experimental:** the API may change in a future release — pin your go-redis version if you adopt it. + +([#3942](https://github.com/redis/go-redis/pull/3942)) by [@ndyakov](https://github.com/ndyakov), with help from [@cxljs](https://github.com/cxljs) + +### Redis 8.10 Support + +This release adds support for **Redis 8.10**. The README's supported-versions list now includes Redis 8.10, and CI runs the full suite against the `redislabs/client-libs-test:8.10.0` image by default ([#3920](https://github.com/redis/go-redis/pull/3920), [#3940](https://github.com/redis/go-redis/pull/3940)). + +Coverage for the new commands and options that ship with Redis 8.10: + +- **`HIMPORT`** ([#3919](https://github.com/redis/go-redis/pull/3919)) — bulk hash import via server-side fieldsets, exposed as `HImportPrepare`, `HImportSet`, `HImportDiscard`, and `HImportDiscardAll`. Fieldsets are session state scoped to a single physical connection, which does not mix well with connection pooling — so the client keeps a versioned fieldset registry and lazily replays the `PREPARE` on whichever pooled connection executes a `SET` that needs it, at most once per connection, with no extra round trip (the `PREPARE` is injected into the same write as the `SET`). +- **`LMOVEM` / `BLMOVEM`** ([#3913](https://github.com/redis/go-redis/pull/3913)) — move multiple elements between lists in one call. +- **`SUNIONCARD` / `SDIFFCARD`** ([#3897](https://github.com/redis/go-redis/pull/3897)) — cardinality of set union/difference without materializing the result. +- **`XREAD` / `XREADGROUP` `MAXCOUNT` and `MAXSIZE`** ([#3898](https://github.com/redis/go-redis/pull/3898)) — bound how much data a stream read returns. +- **`TS.READ`** ([#3896](https://github.com/redis/go-redis/pull/3896)), **`TS.QUERYLABELS`** ([#3926](https://github.com/redis/go-redis/pull/3926)), **`TS.NRANGE` / `TS.NREVRANGE`** ([#3870](https://github.com/redis/go-redis/pull/3870)) with multiple aggregators per key ([#3937](https://github.com/redis/go-redis/pull/3937)), and **`EXCLUDEEMPTY`** on `TS.MRANGE` / `TS.MREVRANGE` ([#3912](https://github.com/redis/go-redis/pull/3912)) — new time-series query surface. +- **`FT.ALIASLIST`** ([#3925](https://github.com/redis/go-redis/pull/3925)), **`COLLECT` reducer for `FT.AGGREGATE`** ([#3886](https://github.com/redis/go-redis/pull/3886)), **`RERANK` on HNSW vector fields in `FT.CREATE`** ([#3927](https://github.com/redis/go-redis/pull/3927)), and **`FT.HYBRID` timeout warnings** ([#3911](https://github.com/redis/go-redis/pull/3911)) — search coverage. + +### Cross-SDK Aligned Defaults + +Default configuration values now follow the cross-SDK configuration proposal shared by all Redis client libraries ([#3918](https://github.com/redis/go-redis/pull/3918)): + +| Setting | Old default | New default | +|---|---|---| +| `ReadTimeout` / `WriteTimeout` | 3s | 5s | +| Retry backoff (min/max) | 8ms / 512ms | 10ms / 1s | +| Cluster state reload interval | 10s | 60s | +| TCP keep-alive | 5min period | 30s idle / 5s interval / 3 probes (`net.KeepAliveConfig`) | + +Applications that set these values explicitly are unaffected; applications relying on the old defaults inherit the new ones. + +### Data-Race and Parser Hardening Sweep + +A systematic audit fixed data races across the client — hooks (`AddHook`, [#3868](https://github.com/redis/go-redis/pull/3868)), `Ring.SetAddrs` ([#3862](https://github.com/redis/go-redis/pull/3862)), cluster node slices ([#3861](https://github.com/redis/go-redis/pull/3861)), pub/sub reconnect ([#3906](https://github.com/redis/go-redis/pull/3906)), maintenance notifications ([#3894](https://github.com/redis/go-redis/pull/3894), [#3872](https://github.com/redis/go-redis/pull/3872)), pool handoff ([#3876](https://github.com/redis/go-redis/pull/3876)), and `redisotel` ([#3881](https://github.com/redis/go-redis/pull/3881)) — and hardened the RESP parsers against malformed or unexpected replies: over-reads on nil replies ([#3874](https://github.com/redis/go-redis/pull/3874)), integer overflow when skipping map/attribute bodies ([#3877](https://github.com/redis/go-redis/pull/3877)), unhashable RESP3 map keys ([#3873](https://github.com/redis/go-redis/pull/3873)), odd-length flat replies ([#3900](https://github.com/redis/go-redis/pull/3900)), mismatched declared array lengths ([#3907](https://github.com/redis/go-redis/pull/3907)), unexpected extra reply frames ([#3884](https://github.com/redis/go-redis/pull/3884)), and nil elements in numeric/bool slice replies ([#3922](https://github.com/redis/go-redis/pull/3922)). + +### PubSub `Receive` Hang Fix + +`PeekPushNotificationName` blocked until 36 bytes were buffered, so a short subscribe confirmation (channel name of six or fewer characters) on an otherwise idle connection hung `PubSub.Receive` forever — a regression introduced in 9.20.1 by [#3842](https://github.com/redis/go-redis/pull/3842). The peek now parses whatever is already buffered and only waits for one more byte when the frame prefix is valid but incomplete. Fixes [#3935](https://github.com/redis/go-redis/issues/3935). + +([#3936](https://github.com/redis/go-redis/pull/3936)) by [@ndyakov](https://github.com/ndyakov) + +### Correct Cluster Transaction Retries + +The cluster transaction pipeline treated a `MULTI`...`EXEC` block as independently retryable commands, which could scatter a transaction across nodes or send malformed transactions on retry. Redirects (`MOVED`/`ASK`/`TRYAGAIN`) and aborts are now handled at the whole-transaction level, matching Redis transaction semantics: the transaction is re-routed and retried as a unit, never partially ([#3909](https://github.com/redis/go-redis/pull/3909)) by [@cxljs](https://github.com/cxljs). + +### Credential Redaction in Command Tracing + +`rediscmd.AppendCmd` — used by `redisotel` and `rediscensus` to render commands into span attributes — now redacts credential arguments as ``: `AUTH`, `HELLO ... AUTH`, `CONFIG SET` of `requirepass` / `masterauth` / TLS key passphrases, `ACL SETUSER` password rules, and `MIGRATE ... AUTH`/`AUTH2`. The client sends `HELLO ... AUTH` on every handshake and `AUTH` on every streaming-credentials rotation through the regular hook chain, so tracing hooks previously captured credentials even when the application never issued an auth command itself ([#3939](https://github.com/redis/go-redis/pull/3939)) by [@saddamr3e](https://github.com/saddamr3e). + +## ✨ New Features + +- **Client-side caching**: server-assisted caching for the standalone client via `ClientSideCacheConfig` / `ClientSideCache`, with the `CSCStrategySharedTracking` invalidation strategy ([#3941](https://github.com/redis/go-redis/pull/3941)) by [@ofekshenawa](https://github.com/ofekshenawa) +- **Automatic pipelining**: `AutoPipeline()` (blocking) and `AsyncAutoPipeline()` (deferred results) on `Client` and `ClusterClient`, configured via `AutoPipelineOptions` ([#3942](https://github.com/redis/go-redis/pull/3942)) by [@ndyakov](https://github.com/ndyakov), with help from [@cxljs](https://github.com/cxljs) +- **`HIMPORT` command family**: `HImportPrepare` / `HImportSet` / `HImportDiscard` / `HImportDiscardAll` with lazy per-connection fieldset prepare replay ([#3919](https://github.com/redis/go-redis/pull/3919)) by [@ndyakov](https://github.com/ndyakov) +- **`LMOVEM` / `BLMOVEM`**: move multiple list elements in one call, with `COUNT` (up to N) or `EXACTLY` (all-or-nothing) semantics via `LMoveMArgs` ([#3913](https://github.com/redis/go-redis/pull/3913)) by [@ofekshenawa](https://github.com/ofekshenawa) +- **`SUnionCard` / `SDiffCard`**: cardinality of set union/difference ([#3897](https://github.com/redis/go-redis/pull/3897)) by [@ofekshenawa](https://github.com/ofekshenawa) +- **`XRead` / `XReadGroup` `MAXCOUNT` / `MAXSIZE`**: bound stream read responses by entry count or payload size ([#3898](https://github.com/redis/go-redis/pull/3898)) by [@ofekshenawa](https://github.com/ofekshenawa) +- **`TS.READ`**: read samples from a series starting at a given timestamp, with `TSReadEarliest` (`-`), `TSReadLatest` (`+`), and `TSReadNew` (`$`) sentinels ([#3896](https://github.com/redis/go-redis/pull/3896)) by [@ofekshenawa](https://github.com/ofekshenawa) +- **`TS.QUERYLABELS`**: query label names/values across time series ([#3926](https://github.com/redis/go-redis/pull/3926)) by [@ndyakov](https://github.com/ndyakov) +- **`TS.NRANGE` / `TS.NREVRANGE`**: range queries across multiple series ([#3870](https://github.com/redis/go-redis/pull/3870)) by [@ofekshenawa](https://github.com/ofekshenawa), with multiple aggregators per key ([#3937](https://github.com/redis/go-redis/pull/3937)) by [@ndyakov](https://github.com/ndyakov) +- **`TS.MRANGE` / `TS.MREVRANGE` `EXCLUDEEMPTY`**: skip series with no samples in the result ([#3912](https://github.com/redis/go-redis/pull/3912)) by [@ofekshenawa](https://github.com/ofekshenawa) +- **`FT.ALIASLIST`**: list all index aliases ([#3925](https://github.com/redis/go-redis/pull/3925)) by [@ndyakov](https://github.com/ndyakov) +- **`FT.AGGREGATE` `COLLECT` reducer**: collect grouped values into an array ([#3886](https://github.com/redis/go-redis/pull/3886)) by [@ndyakov](https://github.com/ndyakov) +- **`FT.CREATE` `RERANK`**: `RERANK` parameter on HNSW vector field definitions ([#3927](https://github.com/redis/go-redis/pull/3927)) by [@ofekshenawa](https://github.com/ofekshenawa) +- **`FT.HYBRID` timeout warnings**: timeout warnings are now populated in hybrid search results ([#3911](https://github.com/redis/go-redis/pull/3911)) by [@ofekshenawa](https://github.com/ofekshenawa) +- **`FT.HYBRID` KNN `SHARD_K_RATIO`** (Redis 8.8+): per-shard K ratio for KNN clauses ([#3841](https://github.com/redis/go-redis/pull/3841)) by [@ndyakov](https://github.com/ndyakov) + +## 🐛 Bug Fixes + +- **PubSub `Receive` hang**: peek push-notification names without demanding 36 buffered bytes, fixing a hang on short subscribe confirmations (fixes [#3935](https://github.com/redis/go-redis/issues/3935), regression from 9.20.1) ([#3936](https://github.com/redis/go-redis/pull/3936)) by [@ndyakov](https://github.com/ndyakov) +- **Cluster transactions**: re-route the whole tx pipeline on redirect/abort instead of per-command ([#3909](https://github.com/redis/go-redis/pull/3909)) by [@cxljs](https://github.com/cxljs) +- **Credential leak in traces**: `rediscmd.AppendCmd` redacts credential arguments (`AUTH`, `HELLO ... AUTH`, `CONFIG SET` secret params, `ACL SETUSER` password rules, `MIGRATE AUTH`/`AUTH2`), so `redisotel` / `rediscensus` span attributes no longer contain passwords ([#3939](https://github.com/redis/go-redis/pull/3939)) by [@saddamr3e](https://github.com/saddamr3e) +- **`WaitAOF` return type**: returns `*IntSliceCmd` matching the two-integer `WAITAOF` reply ([#3888](https://github.com/redis/go-redis/pull/3888)) by [@CipherN9](https://github.com/CipherN9) +- **`Ring.Publish` routing**: publish to the shard that owns the topic instead of a round-robined one ([#3893](https://github.com/redis/go-redis/pull/3893)) by [@dkindel](https://github.com/dkindel) +- **Pool `OnRemove` hooks**: fire `OnRemove` on `putConn` eviction paths so removal hooks see every evicted connection ([#3932](https://github.com/redis/go-redis/pull/3932)) by [@cxljs](https://github.com/cxljs) +- **`UniversalClient` `InfoMap`**: added `InfoMap` to the `Cmdable` interface ([#3904](https://github.com/redis/go-redis/pull/3904)) by [@nazarli-shabnam](https://github.com/nazarli-shabnam) +- **`SlowLogGet` context**: pass the caller's context instead of a background one ([#3915](https://github.com/redis/go-redis/pull/3915)) by [@sonnemusk](https://github.com/sonnemusk) +- **`ModuleLoadex` nil config**: return an error instead of panicking on nil config ([#3916](https://github.com/redis/go-redis/pull/3916)) by [@sonnemusk](https://github.com/sonnemusk) +- **`ParseURL` IPv6 hosts**: keep single brackets for IPv6 hosts without a port ([#3882](https://github.com/redis/go-redis/pull/3882)) by [@sueun-dev](https://github.com/sueun-dev) +- **`ParseURL` durations**: treat unit durations `<= 0` as disabled ([#3866](https://github.com/redis/go-redis/pull/3866)) by [@sueun-dev](https://github.com/sueun-dev) +- **Nil `*uint8` encoding**: encode nil `*uint8` as `"0"` like other numeric pointers ([#3869](https://github.com/redis/go-redis/pull/3869)) by [@sueun-dev](https://github.com/sueun-dev) +- **`JSONSliceCmd` read errors**: return the read error from `readReply` instead of swallowing it ([#3903](https://github.com/redis/go-redis/pull/3903)) by [@saddamr3e](https://github.com/saddamr3e) +- **RESP parser hardening**: reconcile declared entry-array lengths ([#3907](https://github.com/redis/go-redis/pull/3907)), handle nil elements in int/uint/bool slice parsers ([#3922](https://github.com/redis/go-redis/pull/3922)), drain unexpected reply frames ([#3884](https://github.com/redis/go-redis/pull/3884)), reject odd-length flat replies in Z/KeyValue parsers ([#3900](https://github.com/redis/go-redis/pull/3900)), avoid int overflow when skipping map/attr bodies ([#3877](https://github.com/redis/go-redis/pull/3877)), don't over-read nil replies in `Reader.Discard` ([#3874](https://github.com/redis/go-redis/pull/3874)) by [@saddamr3e](https://github.com/saddamr3e); reject unhashable keys in RESP3 map parsing ([#3873](https://github.com/redis/go-redis/pull/3873)) by [@iabdullah215](https://github.com/iabdullah215) +- **Data races**: hook state during `AddHook` ([#3868](https://github.com/redis/go-redis/pull/3868)), `onNewNode` during `Ring.SetAddrs` ([#3862](https://github.com/redis/go-redis/pull/3862)), shared masters/slaves slices in cluster ([#3861](https://github.com/redis/go-redis/pull/3861)), shared `opt.Addr` during pub/sub reconnect ([#3906](https://github.com/redis/go-redis/pull/3906)), `clusterStateReloadCallback` in maintnotifications ([#3894](https://github.com/redis/go-redis/pull/3894)), conn reader in `isHealthyConn` during handoff ([#3876](https://github.com/redis/go-redis/pull/3876)) by [@saddamr3e](https://github.com/saddamr3e); handoff race window in maintnotifications ([#3872](https://github.com/redis/go-redis/pull/3872)) by [@ndyakov](https://github.com/ndyakov) +- **`redisotel`**: use `ObservableCounter` for cumulative pool stats ([#3914](https://github.com/redis/go-redis/pull/3914)) by [@Solaris-star](https://github.com/Solaris-star); avoid a data race on shared attributes during `MinIdleConns` warmup ([#3881](https://github.com/redis/go-redis/pull/3881)) by [@ndyakov](https://github.com/ndyakov) + +## 🧰 Maintenance + +- **Cross-SDK default alignment**: new defaults for timeouts, retry backoff, cluster state reload, and TCP keep-alive ([#3918](https://github.com/redis/go-redis/pull/3918)) by [@ndyakov](https://github.com/ndyakov) +- **CI on Redis 8.10**: 8.10 made the default test version ([#3920](https://github.com/redis/go-redis/pull/3920)) with version gating by major.minor ([#3908](https://github.com/redis/go-redis/pull/3908)) by [@ofekshenawa](https://github.com/ofekshenawa); the test stack now runs the GA `redislabs/client-libs-test:8.10.0` image and 8.8 was dropped from the CI matrix ([#3940](https://github.com/redis/go-redis/pull/3940)) +- **Type-safe atomics**: use typed `sync/atomic` value types ([#3860](https://github.com/redis/go-redis/pull/3860)) and remove the dead `assertUnstableCommand` RESP3 path ([#3928](https://github.com/redis/go-redis/pull/3928)) by [@cxljs](https://github.com/cxljs) +- **Docs**: clarify that `ExpireTime` / `PExpireTime` return Unix timestamps ([#3917](https://github.com/redis/go-redis/pull/3917)) by [@sonnemusk](https://github.com/sonnemusk); remove a duplicate example step ([#3875](https://github.com/redis/go-redis/pull/3875)) by [@andy-stark-redis](https://github.com/andy-stark-redis) + +## 👥 Contributors + +We'd like to thank all the contributors who worked on this release! + +[@andy-stark-redis](https://github.com/andy-stark-redis), [@CipherN9](https://github.com/CipherN9), [@cxljs](https://github.com/cxljs), [@dkindel](https://github.com/dkindel), [@iabdullah215](https://github.com/iabdullah215), [@nazarli-shabnam](https://github.com/nazarli-shabnam), [@ndyakov](https://github.com/ndyakov), [@ofekshenawa](https://github.com/ofekshenawa), [@saddamr3e](https://github.com/saddamr3e), [@Solaris-star](https://github.com/Solaris-star), [@sonnemusk](https://github.com/sonnemusk), [@sueun-dev](https://github.com/sueun-dev) + +--- + +**Full Changelog**: https://github.com/redis/go-redis/compare/v9.21.0...v9.22.0 + +# 9.22.0-beta.1 (2026-07-29) + +This is a **beta** release adding support for Redis 8.10, new commands, and a large batch of stability and parser-robustness fixes. The 9.22.0 GA release will follow once client-side caching and auto-pipelining are merged. + +⚠️ Two changes to be aware of when upgrading from 9.21.0: + +- **Default configuration values changed** ([#3918](https://github.com/redis/go-redis/pull/3918)): read/write timeouts, retry backoff, cluster state reload interval, and TCP keep-alive defaults are now aligned with the cross-SDK configuration proposal (see the highlight below). Explicitly configured values are unaffected. +- **`WaitAOF` return type corrected** ([#3888](https://github.com/redis/go-redis/pull/3888)): `WaitAOF` now returns `*IntSliceCmd`, matching the two-integer reply of `WAITAOF` (previously `*IntCmd`, which failed to parse the reply at runtime). Code referencing the old return type needs a one-line update. + +## 🚀 Highlights + +### Redis 8.10 Support + +This release adds support for **Redis 8.10**. The README's supported-versions list now includes Redis 8.10, and CI runs the full suite against the `redislabs/client-libs-test:8.10.0` image by default ([#3920](https://github.com/redis/go-redis/pull/3920), [#3940](https://github.com/redis/go-redis/pull/3940)). + +Coverage for the new commands and options that ship with Redis 8.10: + +- **`HIMPORT`** ([#3919](https://github.com/redis/go-redis/pull/3919)) — bulk hash import via server-side fieldsets, exposed as `HImportPrepare`, `HImportSet`, `HImportDiscard`, and `HImportDiscardAll`. Fieldsets are session state scoped to a single physical connection, which does not mix well with connection pooling — so the client keeps a versioned fieldset registry and lazily replays the `PREPARE` on whichever pooled connection executes a `SET` that needs it, at most once per connection, with no extra round trip (the `PREPARE` is injected into the same write as the `SET`). +- **`LMOVEM` / `BLMOVEM`** ([#3913](https://github.com/redis/go-redis/pull/3913)) — move multiple elements between lists in one call. +- **`SUNIONCARD` / `SDIFFCARD`** ([#3897](https://github.com/redis/go-redis/pull/3897)) — cardinality of set union/difference without materializing the result. +- **`XREAD` / `XREADGROUP` `MAXCOUNT` and `MAXSIZE`** ([#3898](https://github.com/redis/go-redis/pull/3898)) — bound how much data a stream read returns. +- **`TS.READ`** ([#3896](https://github.com/redis/go-redis/pull/3896)), **`TS.QUERYLABELS`** ([#3926](https://github.com/redis/go-redis/pull/3926)), **`TS.NRANGE` / `TS.NREVRANGE`** ([#3870](https://github.com/redis/go-redis/pull/3870)) with multiple aggregators per key ([#3937](https://github.com/redis/go-redis/pull/3937)), and **`EXCLUDEEMPTY`** on `TS.MRANGE` / `TS.MREVRANGE` ([#3912](https://github.com/redis/go-redis/pull/3912)) — new time-series query surface. +- **`FT.ALIASLIST`** ([#3925](https://github.com/redis/go-redis/pull/3925)), **`COLLECT` reducer for `FT.AGGREGATE`** ([#3886](https://github.com/redis/go-redis/pull/3886)), **`RERANK` on HNSW vector fields in `FT.CREATE`** ([#3927](https://github.com/redis/go-redis/pull/3927)), and **`FT.HYBRID` timeout warnings** ([#3911](https://github.com/redis/go-redis/pull/3911)) — search coverage. + +### Cross-SDK Aligned Defaults + +Default configuration values now follow the cross-SDK configuration proposal shared by all Redis client libraries ([#3918](https://github.com/redis/go-redis/pull/3918)): + +| Setting | Old default | New default | +|---|---|---| +| `ReadTimeout` / `WriteTimeout` | 3s | 5s | +| Retry backoff (min/max) | 8ms / 512ms | 10ms / 1s | +| Cluster state reload interval | 10s | 60s | +| TCP keep-alive | 5min period | 30s idle / 5s interval / 3 probes (`net.KeepAliveConfig`) | + +Applications that set these values explicitly are unaffected; applications relying on the old defaults inherit the new ones. + +### Data-Race and Parser Hardening Sweep + +A systematic audit fixed data races across the client — hooks (`AddHook`, [#3868](https://github.com/redis/go-redis/pull/3868)), `Ring.SetAddrs` ([#3862](https://github.com/redis/go-redis/pull/3862)), cluster node slices ([#3861](https://github.com/redis/go-redis/pull/3861)), pub/sub reconnect ([#3906](https://github.com/redis/go-redis/pull/3906)), maintenance notifications ([#3894](https://github.com/redis/go-redis/pull/3894), [#3872](https://github.com/redis/go-redis/pull/3872)), pool handoff ([#3876](https://github.com/redis/go-redis/pull/3876)), and `redisotel` ([#3881](https://github.com/redis/go-redis/pull/3881)) — and hardened the RESP parsers against malformed or unexpected replies: over-reads on nil replies ([#3874](https://github.com/redis/go-redis/pull/3874)), integer overflow when skipping map/attribute bodies ([#3877](https://github.com/redis/go-redis/pull/3877)), unhashable RESP3 map keys ([#3873](https://github.com/redis/go-redis/pull/3873)), odd-length flat replies ([#3900](https://github.com/redis/go-redis/pull/3900)), mismatched declared array lengths ([#3907](https://github.com/redis/go-redis/pull/3907)), unexpected extra reply frames ([#3884](https://github.com/redis/go-redis/pull/3884)), and nil elements in numeric/bool slice replies ([#3922](https://github.com/redis/go-redis/pull/3922)). + +### PubSub `Receive` Hang Fix + +`PeekPushNotificationName` blocked until 36 bytes were buffered, so a short subscribe confirmation (channel name of six or fewer characters) on an otherwise idle connection hung `PubSub.Receive` forever — a regression introduced in 9.20.1 by [#3842](https://github.com/redis/go-redis/pull/3842). The peek now parses whatever is already buffered and only waits for one more byte when the frame prefix is valid but incomplete. Fixes [#3935](https://github.com/redis/go-redis/issues/3935). + +([#3936](https://github.com/redis/go-redis/pull/3936)) by [@ndyakov](https://github.com/ndyakov) + +### Correct Cluster Transaction Retries + +The cluster transaction pipeline treated a `MULTI`...`EXEC` block as independently retryable commands, which could scatter a transaction across nodes or send malformed transactions on retry. Redirects (`MOVED`/`ASK`/`TRYAGAIN`) and aborts are now handled at the whole-transaction level, matching Redis transaction semantics: the transaction is re-routed and retried as a unit, never partially ([#3909](https://github.com/redis/go-redis/pull/3909)) by [@cxljs](https://github.com/cxljs). + +### Credential Redaction in Command Tracing + +`rediscmd.AppendCmd` — used by `redisotel` and `rediscensus` to render commands into span attributes — now redacts credential arguments as ``: `AUTH`, `HELLO ... AUTH`, `CONFIG SET` of `requirepass` / `masterauth` / TLS key passphrases, `ACL SETUSER` password rules, and `MIGRATE ... AUTH`/`AUTH2`. The client sends `HELLO ... AUTH` on every handshake and `AUTH` on every streaming-credentials rotation through the regular hook chain, so tracing hooks previously captured credentials even when the application never issued an auth command itself ([#3939](https://github.com/redis/go-redis/pull/3939)) by [@saddamr3e](https://github.com/saddamr3e). + +## ✨ New Features + +- **`HIMPORT` command family**: `HImportPrepare` / `HImportSet` / `HImportDiscard` / `HImportDiscardAll` with lazy per-connection fieldset prepare replay ([#3919](https://github.com/redis/go-redis/pull/3919)) by [@ndyakov](https://github.com/ndyakov) +- **`LMOVEM` / `BLMOVEM`**: move multiple list elements in one call, with `COUNT` (up to N) or `EXACTLY` (all-or-nothing) semantics via `LMoveMArgs` ([#3913](https://github.com/redis/go-redis/pull/3913)) by [@ofekshenawa](https://github.com/ofekshenawa) +- **`SUnionCard` / `SDiffCard`**: cardinality of set union/difference ([#3897](https://github.com/redis/go-redis/pull/3897)) by [@ofekshenawa](https://github.com/ofekshenawa) +- **`XRead` / `XReadGroup` `MAXCOUNT` / `MAXSIZE`**: bound stream read responses by entry count or payload size ([#3898](https://github.com/redis/go-redis/pull/3898)) by [@ofekshenawa](https://github.com/ofekshenawa) +- **`TS.READ`**: read samples from a series starting at a given timestamp, with `TSReadEarliest` (`-`), `TSReadLatest` (`+`), and `TSReadNew` (`$`) sentinels ([#3896](https://github.com/redis/go-redis/pull/3896)) by [@ofekshenawa](https://github.com/ofekshenawa) +- **`TS.QUERYLABELS`**: query label names/values across time series ([#3926](https://github.com/redis/go-redis/pull/3926)) by [@ndyakov](https://github.com/ndyakov) +- **`TS.NRANGE` / `TS.NREVRANGE`**: range queries across multiple series ([#3870](https://github.com/redis/go-redis/pull/3870)) by [@ofekshenawa](https://github.com/ofekshenawa), with multiple aggregators per key ([#3937](https://github.com/redis/go-redis/pull/3937)) by [@ndyakov](https://github.com/ndyakov) +- **`TS.MRANGE` / `TS.MREVRANGE` `EXCLUDEEMPTY`**: skip series with no samples in the result ([#3912](https://github.com/redis/go-redis/pull/3912)) by [@ofekshenawa](https://github.com/ofekshenawa) +- **`FT.ALIASLIST`**: list all index aliases ([#3925](https://github.com/redis/go-redis/pull/3925)) by [@ndyakov](https://github.com/ndyakov) +- **`FT.AGGREGATE` `COLLECT` reducer**: collect grouped values into an array ([#3886](https://github.com/redis/go-redis/pull/3886)) by [@ndyakov](https://github.com/ndyakov) +- **`FT.CREATE` `RERANK`**: `RERANK` parameter on HNSW vector field definitions ([#3927](https://github.com/redis/go-redis/pull/3927)) by [@ofekshenawa](https://github.com/ofekshenawa) +- **`FT.HYBRID` timeout warnings**: timeout warnings are now populated in hybrid search results ([#3911](https://github.com/redis/go-redis/pull/3911)) by [@ofekshenawa](https://github.com/ofekshenawa) +- **`FT.HYBRID` KNN `SHARD_K_RATIO`** (Redis 8.8+): per-shard K ratio for KNN clauses ([#3841](https://github.com/redis/go-redis/pull/3841)) by [@ndyakov](https://github.com/ndyakov) + +## 🐛 Bug Fixes + +- **PubSub `Receive` hang**: peek push-notification names without demanding 36 buffered bytes, fixing a hang on short subscribe confirmations (fixes [#3935](https://github.com/redis/go-redis/issues/3935), regression from 9.20.1) ([#3936](https://github.com/redis/go-redis/pull/3936)) by [@ndyakov](https://github.com/ndyakov) +- **Cluster transactions**: re-route the whole tx pipeline on redirect/abort instead of per-command ([#3909](https://github.com/redis/go-redis/pull/3909)) by [@cxljs](https://github.com/cxljs) +- **Credential leak in traces**: `rediscmd.AppendCmd` redacts credential arguments (`AUTH`, `HELLO ... AUTH`, `CONFIG SET` secret params, `ACL SETUSER` password rules, `MIGRATE AUTH`/`AUTH2`), so `redisotel` / `rediscensus` span attributes no longer contain passwords ([#3939](https://github.com/redis/go-redis/pull/3939)) by [@saddamr3e](https://github.com/saddamr3e) +- **`WaitAOF` return type**: returns `*IntSliceCmd` matching the two-integer `WAITAOF` reply ([#3888](https://github.com/redis/go-redis/pull/3888)) by [@CipherN9](https://github.com/CipherN9) +- **`Ring.Publish` routing**: publish to the shard that owns the topic instead of a round-robined one ([#3893](https://github.com/redis/go-redis/pull/3893)) by [@dkindel](https://github.com/dkindel) +- **Pool `OnRemove` hooks**: fire `OnRemove` on `putConn` eviction paths so removal hooks see every evicted connection ([#3932](https://github.com/redis/go-redis/pull/3932)) by [@cxljs](https://github.com/cxljs) +- **`UniversalClient` `InfoMap`**: added `InfoMap` to the `Cmdable` interface ([#3904](https://github.com/redis/go-redis/pull/3904)) by [@nazarli-shabnam](https://github.com/nazarli-shabnam) +- **`SlowLogGet` context**: pass the caller's context instead of a background one ([#3915](https://github.com/redis/go-redis/pull/3915)) by [@sonnemusk](https://github.com/sonnemusk) +- **`ModuleLoadex` nil config**: return an error instead of panicking on nil config ([#3916](https://github.com/redis/go-redis/pull/3916)) by [@sonnemusk](https://github.com/sonnemusk) +- **`ParseURL` IPv6 hosts**: keep single brackets for IPv6 hosts without a port ([#3882](https://github.com/redis/go-redis/pull/3882)) by [@sueun-dev](https://github.com/sueun-dev) +- **`ParseURL` durations**: treat unit durations `<= 0` as disabled ([#3866](https://github.com/redis/go-redis/pull/3866)) by [@sueun-dev](https://github.com/sueun-dev) +- **Nil `*uint8` encoding**: encode nil `*uint8` as `"0"` like other numeric pointers ([#3869](https://github.com/redis/go-redis/pull/3869)) by [@sueun-dev](https://github.com/sueun-dev) +- **`JSONSliceCmd` read errors**: return the read error from `readReply` instead of swallowing it ([#3903](https://github.com/redis/go-redis/pull/3903)) by [@saddamr3e](https://github.com/saddamr3e) +- **RESP parser hardening**: reconcile declared entry-array lengths ([#3907](https://github.com/redis/go-redis/pull/3907)), handle nil elements in int/uint/bool slice parsers ([#3922](https://github.com/redis/go-redis/pull/3922)), drain unexpected reply frames ([#3884](https://github.com/redis/go-redis/pull/3884)), reject odd-length flat replies in Z/KeyValue parsers ([#3900](https://github.com/redis/go-redis/pull/3900)), avoid int overflow when skipping map/attr bodies ([#3877](https://github.com/redis/go-redis/pull/3877)), don't over-read nil replies in `Reader.Discard` ([#3874](https://github.com/redis/go-redis/pull/3874)) by [@saddamr3e](https://github.com/saddamr3e); reject unhashable keys in RESP3 map parsing ([#3873](https://github.com/redis/go-redis/pull/3873)) by [@iabdullah215](https://github.com/iabdullah215) +- **Data races**: hook state during `AddHook` ([#3868](https://github.com/redis/go-redis/pull/3868)), `onNewNode` during `Ring.SetAddrs` ([#3862](https://github.com/redis/go-redis/pull/3862)), shared masters/slaves slices in cluster ([#3861](https://github.com/redis/go-redis/pull/3861)), shared `opt.Addr` during pub/sub reconnect ([#3906](https://github.com/redis/go-redis/pull/3906)), `clusterStateReloadCallback` in maintnotifications ([#3894](https://github.com/redis/go-redis/pull/3894)), conn reader in `isHealthyConn` during handoff ([#3876](https://github.com/redis/go-redis/pull/3876)) by [@saddamr3e](https://github.com/saddamr3e); handoff race window in maintnotifications ([#3872](https://github.com/redis/go-redis/pull/3872)) by [@ndyakov](https://github.com/ndyakov) +- **`redisotel`**: use `ObservableCounter` for cumulative pool stats ([#3914](https://github.com/redis/go-redis/pull/3914)) by [@Solaris-star](https://github.com/Solaris-star); avoid a data race on shared attributes during `MinIdleConns` warmup ([#3881](https://github.com/redis/go-redis/pull/3881)) by [@ndyakov](https://github.com/ndyakov) + +## 🧰 Maintenance + +- **Cross-SDK default alignment**: new defaults for timeouts, retry backoff, cluster state reload, and TCP keep-alive ([#3918](https://github.com/redis/go-redis/pull/3918)) by [@ndyakov](https://github.com/ndyakov) +- **CI on Redis 8.10**: 8.10 made the default test version ([#3920](https://github.com/redis/go-redis/pull/3920)) with version gating by major.minor ([#3908](https://github.com/redis/go-redis/pull/3908)) by [@ofekshenawa](https://github.com/ofekshenawa); the test stack now runs the GA `redislabs/client-libs-test:8.10.0` image and 8.8 was dropped from the CI matrix ([#3940](https://github.com/redis/go-redis/pull/3940)) +- **Type-safe atomics**: use typed `sync/atomic` value types ([#3860](https://github.com/redis/go-redis/pull/3860)) and remove the dead `assertUnstableCommand` RESP3 path ([#3928](https://github.com/redis/go-redis/pull/3928)) by [@cxljs](https://github.com/cxljs) +- **Docs**: clarify that `ExpireTime` / `PExpireTime` return Unix timestamps ([#3917](https://github.com/redis/go-redis/pull/3917)) by [@sonnemusk](https://github.com/sonnemusk); remove a duplicate example step ([#3875](https://github.com/redis/go-redis/pull/3875)) by [@andy-stark-redis](https://github.com/andy-stark-redis) + +## 👥 Contributors + +We'd like to thank all the contributors who worked on this release! + +[@andy-stark-redis](https://github.com/andy-stark-redis), [@CipherN9](https://github.com/CipherN9), [@cxljs](https://github.com/cxljs), [@dkindel](https://github.com/dkindel), [@iabdullah215](https://github.com/iabdullah215), [@nazarli-shabnam](https://github.com/nazarli-shabnam), [@ndyakov](https://github.com/ndyakov), [@ofekshenawa](https://github.com/ofekshenawa), [@saddamr3e](https://github.com/saddamr3e), [@Solaris-star](https://github.com/Solaris-star), [@sonnemusk](https://github.com/sonnemusk), [@sueun-dev](https://github.com/sueun-dev) + +--- + +**Full Changelog**: https://github.com/redis/go-redis/compare/v9.21.0...v9.22.0-beta.1 + # 9.21.0 (2026-06-18) This is a minor release adding new features and bug fixes. There are no breaking changes; upgrading from 9.20.x is a drop-in replacement. diff --git a/vendor/github.com/redis/go-redis/v9/autopipeline.go b/vendor/github.com/redis/go-redis/v9/autopipeline.go new file mode 100644 index 000000000..42ac8d505 --- /dev/null +++ b/vendor/github.com/redis/go-redis/v9/autopipeline.go @@ -0,0 +1,2609 @@ +package redis + +import ( + "context" + "errors" + "fmt" + "io" + "runtime" + "runtime/debug" + "strings" + "sync" + "sync/atomic" + "time" + + "golang.org/x/sys/cpu" + + "github.com/redis/go-redis/v9/internal" +) + +// AutoPipelineOptions configures the autopipelining behavior. +// +// EXPERIMENTAL: this API is subject to change, use with caution. +type AutoPipelineOptions struct { + // MaxBatchSize is the target batch size: the accumulator stops waiting for + // more commands once the shard queue reaches it, so a batch flushes promptly + // instead of lingering. It is a soft threshold, not a hard cap — under heavy + // concurrent enqueue (or while a flush waits on the concurrency semaphore) the + // queue can grow past it and execute as a single larger pipeline, which is + // safe and simply yields a deeper pipeline. + // Default: 200 (the blocking face's no-options preset, + // DefaultBlockingAutoPipelineOptions, uses 300). + MaxBatchSize int + + // MaxBatchBytes, when > 0, caps a batch by APPROXIMATE payload volume: the + // accumulator stops waiting once the queued commands' argument bytes reach + // it, so many large values flush as several bounded writes instead of one + // huge burst (300 x 64KiB is ~19MB written down one connection before any + // reply is read — enough to stall a constrained link past its write + // deadline). Like MaxBatchSize it is a soft threshold, not a hard cap. + // The estimate counts string/[]byte argument lengths plus a small + // per-argument overhead. Default: 0 (no byte cap). + MaxBatchBytes int + + // MaxConcurrentBatches is the maximum number of pipeline batches that may + // execute concurrently. + // + // Default: 1, which gives a single ordered command stream — batches execute + // serially in submit order, so even a windowed caller (submit many, read + // later) sees strict ordering, while still reaching high throughput via deep + // pipelines (~3M ops/sec locally). + // + // Setting this above 1 runs batches in parallel for maximum throughput, but + // commands then have NO guaranteed execution order. Because that trades away + // ordering, it is only allowed together with Unordered: true — otherwise the + // configuration is rejected (see Validate). This makes the trade-off + // explicit: you cannot accidentally lose ordering by raising concurrency. + MaxConcurrentBatches int + + // Unordered must be set to true to allow MaxConcurrentBatches > 1. It is the + // caller's explicit acknowledgement that parallel batch execution gives up + // command ordering in exchange for throughput. With the default (false), + // MaxConcurrentBatches is forced to 1 (an ordered stream) and any value > 1 + // is a configuration error. + Unordered bool + + // contentSharded is set internally by cluster wiring when commands are + // routed to shards by content (slot), so same-key commands always share a + // shard and per-key order holds even with several shards. It exempts that + // wiring from the NumShards ordering check in newAutoPipeliner. Never set + // by users (unexported). + contentSharded bool + + // NumShards is the number of independent queue+flusher shards the + // autopipeliner runs. 0 (the default) means auto: a single shard, which + // funnels every caller into one queue so batches stay deep — measured + // throughput and latency are best with one shard even under heavy + // goroutine concurrency. Cluster clients default to several slot-routed + // shards instead, so commands for different nodes queue independently + // (per-key order still holds: a key's slot always maps to the same + // shard). Raising NumShards splits the queue: it reduces enqueue-mutex + // contention but fragments batches, which usually costs far more than the + // contention saves. Every shard always has at least one concurrency + // permit, so the effective global batch concurrency is + // max(NumShards, MaxConcurrentBatches) — and because shards flush + // concurrently, NumShards > 1 on the deferred (async) face requires + // Unordered: true (construction fails otherwise). + NumShards int + + // MaxFlushDelay is the maximum delay after flushing before checking for more commands. + // A small delay (e.g., 100μs) can significantly reduce CPU usage by allowing + // more commands to batch together, at the cost of slightly higher latency. + // + // Trade-off: + // - 0 (default): Lowest latency, higher CPU usage + // - 100μs: Balanced (recommended for most workloads) + // - 500μs: Lower CPU usage, higher latency + // + // Based on benchmarks, 100μs can reduce CPU usage by 50% + // while adding only ~100μs average latency per command. + // Default: 0, meaning the flusher applies no coalescing wait — it flushes + // each batch as soon as the queue is ready and lets in-flight backpressure + // coalesce concurrent callers (see accumulateBatch). Set a value here to add + // an explicit accumulation window, trading latency for larger batches / less + // CPU as described above. + MaxFlushDelay time.Duration + + // AdaptiveDelay enables smart delay calculation based on queue fill level. + // When enabled, the delay is automatically adjusted: + // - Queue ≥75% full: No delay (flush immediately to prevent overflow) + // - Queue ≥50% full: 25% of MaxFlushDelay (queue filling up) + // - Queue ≥25% full: 50% of MaxFlushDelay (moderate load) + // - Queue <25% full: 100% of MaxFlushDelay (low load, maximize batching) + // + // This provides automatic adaptation to varying load patterns without + // manual tuning. Uses integer-only arithmetic for optimal performance. + // Default: false (use fixed MaxFlushDelay) + AdaptiveDelay bool +} + +// autoPipelinePermitBackstop bounds how long a flush waits for a concurrency +// permit when all are busy. It is only a safety net against a wedged semaphore: +// every permit holder releases it (via defer) and each batch Exec is itself +// bounded by the connection's read/write timeout, so in normal operation a +// permit frees long before this. It is set well above the default ReadTimeout +// and a maintnotifications relaxed window so a legitimately slow in-flight batch +// never makes waiters fail spuriously. The wait deliberately does NOT end on +// Close: commands taken from the queue were already accepted, and Close's +// contract is to flush them (it waits via wg/batchWg), so permit waits run on +// a background context bounded only by this backstop. +const autoPipelinePermitBackstop = 30 * time.Second + +// autoPipelineCloseBackstop bounds Close's wait for in-flight dispatches. It +// deliberately carries the same value as the permit backstop but its OWN name: +// the two answer different questions, and this one may want tuning on its own. +// +// Why it is generous rather than snappy: the bound is only ever REACHED when a +// dispatch cannot end by itself — a blocking command with no timeout, or a +// stalled read with ReadTimeout disabled. In every other configuration the +// read timeout ends the dispatch and Close returns the moment it does, well +// under this value. A tighter bound would not speed up healthy shutdowns; it +// would instead make Close report failure while legitimate work is still +// finishing (a large final batch, or a maintnotifications relaxed window +// during a failover), turning a correct slow drain into a spurious error. +const autoPipelineCloseBackstop = 30 * time.Second + +// numAutoPipelineShards is the shard-count default used by CLUSTER wiring, +// where commands are routed to shards by slot so different nodes' batches +// queue independently (every shard keeps at least one concurrency permit, so +// several shards can flush to their nodes in parallel regardless of +// MaxConcurrentBatches). It is NOT used for standalone clients: those default +// to one shard (see newAutoPipeliner), because a single deep queue pipelines +// far better than a fragmented one. Deliberately NOT derived from +// MaxConcurrentBatches — coupling shard count to the permit budget silently +// collapsed cluster slot routing to a single shard at the default budget. +func numAutoPipelineShards() int { + n := runtime.GOMAXPROCS(0) + if n < 1 { + n = 1 + } + const maxShards = 16 + if n > maxShards { + n = maxShards + } + return n +} + +// DefaultAutoPipelineOptions returns the default autopipelining configuration. +// +// The default is ordered: MaxConcurrentBatches is 1, so batches execute +// serially in submit order (a single ordered command stream) while still +// reaching high throughput via deep pipelines when callers submit in windows. +// To trade ordering for parallel-batch throughput, set MaxConcurrentBatches > 1 +// together with Unordered: true. +// +// EXPERIMENTAL: this API is subject to change, use with caution. +func DefaultAutoPipelineOptions() *AutoPipelineOptions { + return &AutoPipelineOptions{ + MaxBatchSize: 200, + MaxConcurrentBatches: 1, // ordered by default + MaxFlushDelay: 0, // lowest latency; no coalescing wait (batch via in-flight backpressure) + } +} + +// DefaultBlockingAutoPipelineOptions returns the default config for the +// blocking face (Client.AutoPipeline). It uses a single ordered batch stream +// (MaxConcurrentBatches: 1). Counterintuitively this maximizes throughput AND +// minimizes latency for the blocking face: with one batch in flight, callers whose +// commands return while it executes re-enqueue and flush together as the next +// batch, so batches stay deep (a near-continuous, double-buffered pipeline), +// while a lone caller flushes promptly in a single round-trip (no coalescing +// wait — see accumulateBatch). More parallel permits (MaxConcurrentBatches>1) do the +// opposite: each command finds a free permit and flushes on its own before +// others accumulate, collapsing batch size — and throughput — toward one command +// per round-trip while latency rises. For maximum throughput use the async face +// (AsyncAutoPipeline) with a window of in-flight commands (inflight>1); it keeps +// MaxConcurrentBatches: 1 as well. +// +// EXPERIMENTAL: this API is subject to change, use with caution. +func DefaultBlockingAutoPipelineOptions() *AutoPipelineOptions { + return &AutoPipelineOptions{ + MaxBatchSize: 300, + MaxConcurrentBatches: 1, + } +} + +// Validate reports whether the configuration is self-consistent. It returns an +// error if MaxConcurrentBatches > 1 without Unordered: true — raising +// concurrency gives up command ordering, so the caller must opt in explicitly. +// +// Validate()==nil does not guarantee construction succeeds: rules that need +// the face (e.g. NumShards>1 requires Unordered on the deferred face) are +// enforced by the AutoPipeline/AsyncAutoPipeline getters. Note also that +// Options.AutoPipelineOptions is validated lazily — on the first getter +// call, not in NewClient. +func (cfg *AutoPipelineOptions) Validate() error { + if cfg.MaxConcurrentBatches > 1 && !cfg.Unordered { + return fmt.Errorf("redis: AutoPipelineOptions.MaxConcurrentBatches=%d requires Unordered:true "+ + "(parallel batches do not preserve command ordering); set Unordered:true to allow it, "+ + "or keep MaxConcurrentBatches=1 for an ordered stream", cfg.MaxConcurrentBatches) + } + // Reject obviously-wrong negatives so a typo surfaces at construction rather + // than being silently coerced to a default. Zero is allowed and means "use + // the default" (MaxBatchSize) or "no delay" (MaxFlushDelay). + if cfg.MaxBatchSize < 0 { + return fmt.Errorf("redis: AutoPipelineOptions.MaxBatchSize=%d must be >= 0", cfg.MaxBatchSize) + } + if cfg.MaxBatchBytes < 0 { + return fmt.Errorf("redis: AutoPipelineOptions.MaxBatchBytes=%d must be >= 0", cfg.MaxBatchBytes) + } + if cfg.MaxConcurrentBatches < 0 { + return fmt.Errorf("redis: AutoPipelineOptions.MaxConcurrentBatches=%d must be >= 0", cfg.MaxConcurrentBatches) + } + if cfg.MaxFlushDelay < 0 { + return fmt.Errorf("redis: AutoPipelineOptions.MaxFlushDelay=%s must be >= 0", cfg.MaxFlushDelay) + } + if cfg.NumShards < 0 { + return fmt.Errorf("redis: AutoPipelineOptions.NumShards=%d must be >= 0", cfg.NumShards) + } + if cfg.AdaptiveDelay && cfg.MaxFlushDelay <= 0 { + return fmt.Errorf("redis: AutoPipelineOptions.AdaptiveDelay requires MaxFlushDelay > 0 " + + "(adaptive delay scales MaxFlushDelay by queue fill; with no MaxFlushDelay it would " + + "silently disable batch accumulation entirely)") + } + return nil +} + +// cmdableClient is an interface for clients that support pipelining. +// Both Client and ClusterClient implement this interface. It embeds +// UniversalClient (Cmdable + Process + Do + AddHook + Watch + Subscribe... + +// Close + PoolStats) so the AutoPipeliner can delegate the non-batched surface +// back to the underlying client and itself satisfy UniversalClient. +type cmdableClient interface { + UniversalClient + // processPipelineHook is the hook-wrapped []Cmder pipeline entry — the same + // method Pipeline.Exec is wired to (see Client.Pipeline). The flusher + // dispatches drained batches through it directly, skipping the per-batch + // Pipeline construction; hooks/OTel see the identical call. + processPipelineHook(ctx context.Context, cmds []Cmder) error + // The async faces additionally dispatch through withProcessPipelineHook / + // withProcessHook with the base processors as the innermost, so the batch + // can be completed UNDER the user hooks (results ready the moment exec + // returns, before hooks unwind). Both *Client and *ClusterClient satisfy + // these via hooksMixin and their base processors. + withProcessPipelineHook(ctx context.Context, cmds []Cmder, hook ProcessPipelineHook) error + hookCount() int + withProcessHook(ctx context.Context, cmd Cmder, hook ProcessHook) error + processPipeline(ctx context.Context, cmds []Cmder) error + process(ctx context.Context, cmd Cmder) error +} + +// apBatch is the completion signal shared by every command flushed together. +// Its done channel is closed exactly once, when the batch's pipeline has +// executed. Closing one channel wakes all waiters in a single operation, +// instead of doing one buffered-channel send per command — under high +// concurrency the per-command sends dominated CPU (channel-lock contention and +// one goroutine wake-up apiece). +type apBatch struct { + done chan struct{} + // closed makes close() idempotent: on the async faces the dispatch closes + // the batch at the innermost exec seam (under the user hooks, so a hook + // reading a result after next() does not block on a channel its own + // goroutine closes — the #3867 deadlock), while the flusher keeps its + // deferred close as a panic backstop. Whichever runs first wins. + closed atomic.Bool + // dispGid is the goroutine id of the dispatcher while the batch is inside + // the hook chain (0 otherwise). await() consults it before blocking so a + // hook on the dispatch goroutine reading a result BEFORE next() gets the + // not-yet-executed view — what a plain pipeline hook sees — instead of a + // self-deadlock. + dispGid atomic.Int64 + // nodeGids registers cluster per-node executor goroutines: the cluster + // pipeline fans a batch out to one goroutine per node, and each runs the + // NODE client's own hook chain (OnNewNode hooks — redisotel's tracing + // lives there), which the single dispGid slot cannot vouch for. A node + // hook reading a result there would block on a batch that completes only + // after its own return — reproduced as a permanent wedge with a + // rediscmd-shaped Err() peek. Guarded by nodeMu; entered/left once per + // node call, consulted only on the guards' slow path (done still open). + nodeMu sync.Mutex + nodeGids []int64 + // nodeCount mirrors len(nodeGids) so isExecutorGoroutine's fast path can + // skip the goroutine-id parse and the mutex entirely when nobody is + // registered — which is every standalone batch, always, and a cluster + // batch outside its node fan-out window. + nodeCount atomic.Int32 +} + +// enterNodeDispatch registers the calling goroutine as an executor of this +// batch for the duration of a cluster node call; the returned func +// unregisters it. Registered goroutines get the same treatment as the +// dispatcher in the accessor guards: result reads return the current view +// instead of self-deadlocking on the batch's own completion signal. +func (b *apBatch) enterNodeDispatch() func() { + gid := curGoroutineID() + b.nodeMu.Lock() + b.nodeGids = append(b.nodeGids, gid) + b.nodeCount.Store(int32(len(b.nodeGids))) + b.nodeMu.Unlock() + return func() { + b.nodeMu.Lock() + for i, g := range b.nodeGids { + if g == gid { + b.nodeGids[i] = b.nodeGids[len(b.nodeGids)-1] + b.nodeGids = b.nodeGids[:len(b.nodeGids)-1] + break + } + } + b.nodeCount.Store(int32(len(b.nodeGids))) + b.nodeMu.Unlock() + } +} + +// isExecutorGoroutine reports whether the CALLING goroutine is currently +// executing this batch: the flusher/dispatch goroutine or a registered +// cluster node executor. The no-executor fast path (dispGid unset and no +// node executors) is two atomic loads — no goroutine-id parse, no lock. That +// laziness is load-bearing: every blocking-face command and every pre-done +// future passes here once per wait, and an earlier revision that parsed the +// goroutine id and took the mutex unconditionally cost the blocking face 6x +// of its throughput (measured 830k -> 138k ops/sec on a loopback bench). +func (b *apBatch) isExecutorGoroutine() bool { + disp := b.dispGid.Load() + if disp == 0 && b.nodeCount.Load() == 0 { + return false + } + gid := curGoroutineID() + if disp != 0 && disp == gid { + return true + } + if b.nodeCount.Load() == 0 { + return false + } + b.nodeMu.Lock() + defer b.nodeMu.Unlock() + for _, g := range b.nodeGids { + if g == gid { + return true + } + } + return false +} + +// noopUnregister is registerBatchExecutors' zero-batch result, shared so the +// plain-pipeline path stays allocation-free. +var noopUnregister = func() {} + +// registerBatchExecutors marks the calling goroutine as an executor of every +// deferred-face batch among cmds (plain pipeline commands carry none) and +// returns the combined unregister. The cluster pipeline calls it around each +// node's hook chain. +func registerBatchExecutors(cmds []Cmder) func() { + var undo []func() + var seenFirst *apBatch + var seenMore map[*apBatch]struct{} + for _, cmd := range cmds { + bc, ok := cmd.(interface{ readyBatch() *apBatch }) + if !ok { + continue + } + b := bc.readyBatch() + if b == nil || b == seenFirst { + continue + } + if seenFirst == nil { + seenFirst = b + } else { + if seenMore == nil { + seenMore = make(map[*apBatch]struct{}, 2) + } + if _, dup := seenMore[b]; dup { + continue + } + seenMore[b] = struct{}{} + } + undo = append(undo, b.enterNodeDispatch()) + } + if len(undo) == 0 { + return noopUnregister + } + return func() { + for _, u := range undo { + u() + } + } +} + +func newAPBatch() *apBatch { return &apBatch{done: make(chan struct{})} } + +// close completes the batch exactly once, waking every waiter. +func (b *apBatch) close() { + if b.closed.CompareAndSwap(false, true) { + close(b.done) + } +} + +// curGoroutineID parses the goroutine id from runtime.Stack's header +// ("goroutine 123 ["). Called only on paths already paying a dispatch or an +// about-to-block round-trip wait — never on await()'s fast path — so the +// microsecond-scale stack read is noise against the batch RTT. +// armSelfDeadlockGuard reports whether async dispatch should stamp the +// dispatcher's goroutine id on the batches (see apBatch.dispGid) — the +// mechanism that lets a hook on the dispatch goroutine read a command +// without deadlocking on a batch only that goroutine completes: before +// next() it sees the not-yet-executed view, after next() the populated +// results (batches complete only when the whole chain has returned). Armed +// when user hooks exist — without hooks nothing can read a command inside +// the chain — and always on cluster clients, whose node clients may carry +// their own hooks (OnNewNode + AddHook, the redisotel pattern) that +// hookCount() cannot see. NOTE: node-level hooks run on node-worker +// goroutines the gid guard cannot identify, so they must not read command +// results on the async face; the same applies to a goroutine a hook spawns +// and joins before returning. A hook added concurrently with an in-flight +// dispatch misses the guard for that one batch. The guard covers result +// READS only: a hook that ISSUES a command on the same AutoPipeliner and +// synchronously waits for it cannot be saved — the nested command needs the +// dispatch slot the hook chain is holding, and the engine recovers only by +// failing the flush after the permit backstops (see +// autoPipelinePermitBackstop) expire. +func (ap *AutoPipeliner) armSelfDeadlockGuard() bool { + return ap.pipeliner.hookCount() > 0 || ap.config.contentSharded +} + +func curGoroutineID() int64 { + var buf [64]byte + n := runtime.Stack(buf[:], false) + const skip = len("goroutine ") + var id int64 + for _, c := range buf[skip:n] { + if c < '0' || c > '9' { + break + } + id = id*10 + int64(c-'0') + } + return id +} + +// The shard queue stores bare Cmders. The batch a command waits on is the +// shard's curBatch at enqueue time — read once to wire the command's ready +// channel and never needed per-command afterward (the flusher closes the one +// shared batch). Storing []Cmder removes a per-command wrapper allocation. + +var queueSlicePool = sync.Pool{ + New: func() interface{} { s := make([]Cmder, 0, 100); return &s }, +} + +func getQueueSlice(capacity int) []Cmder { + slice := (*queueSlicePool.Get().(*[]Cmder))[:0] + if cap(slice) < capacity { + queueSlicePool.Put(&slice) + return make([]Cmder, 0, capacity) + } + return slice +} + +func putQueueSlice(slice []Cmder) { + if cap(slice) <= 1000 { + // Zero only the used prefix: elements beyond len are already nil — + // slices enter the pool fully zeroed (here) and are only appended to + // afterwards, so the tail invariant holds. Zeroing the whole capacity + // memclr'd up to 8 KB per flush for small batches on large recycled + // arrays. + for i := range slice { + slice[i] = nil + } + queueSlicePool.Put(&slice) + } +} + +// AutoPipeliner automatically batches commands and executes them in pipelines. +// It's safe for concurrent use by multiple goroutines. +// +// AutoPipeliner works by collecting commands from multiple goroutines into a +// shared queue and flushing them as one Redis pipeline when the batch reaches +// MaxBatchSize or a configured coalescing window (MaxFlushDelay) elapses. By +// default there is no window: each batch flushes as soon as the queue is ready +// and concurrent callers coalesce via in-flight backpressure, so a lone command +// flushes in a single round-trip while batches stay deep under load. +// +// This provides significant performance improvements for workloads with many +// concurrent small operations, as it reduces the number of network round-trips. +// +// AutoPipeliner implements the Cmdable interface, so you can use it like a +// regular client. Prefer the typed methods (Set, Get, ...); Do runs OUTSIDE +// the pipeline on a normal connection (see Do). +// AutoPipeline / AsyncAutoPipeline return an error for an invalid config, so check it once: +// +// ap, err := client.AutoPipeline() +// if err != nil { +// return err +// } +// ap.Set(ctx, "key", "value", 0) +// ap.Get(ctx, "key") +// ap.Close() +// +// Per-command contexts: a command is batched and executed on the AutoPipeliner's +// own long-lived context, NOT the context passed to the command. A per-command +// deadline or cancellation is therefore not honored once the command is queued +// (this is deliberate — a per-batch timer per command would cost a goroutine +// each). Use a plain client for commands that need their own deadline. +// The one exception is a blocking command (readTimeout() != nil, e.g. BLPOP): +// it is never batched and runs directly on the caller's context, which is +// honored as usual. +// +// Retries: like any pipeline, a batch that fails on a network error is retried +// as a whole (up to Options.MaxRetries). If the connection drops after the +// server executed part of the batch, non-idempotent commands (INCR, LPUSH, ...) +// may execute twice. Run commands that must not be retransmitted on a plain +// client, or set MaxRetries: -1. +// +// Lifetime: AutoPipeline() returns a single, client-owned instance shared by all +// callers. Close()ing it stops the shared pipeliner for everyone; a later +// AutoPipeline() call on the client builds a fresh one. Closing the CLIENT also +// stops it, but permanently: the getters then return ErrClosed. +// +// Formatting: String()/%v on a command issued by the deferred face WAITS for +// execution, exactly like Err()/Val()/Result() — formatting reads the result +// fields, and reading them unsynchronized would race the dispatcher populating +// them. The one exception is a hook formatting a command from the batch's own +// dispatch goroutine: that returns the not-yet-executed view instead of +// self-deadlocking. Use Name()/Args() if you need to log a submission without +// waiting for it. +// +// EXPERIMENTAL: this API is subject to change, use with caution. +type AutoPipeliner struct { + cmdable // Embed cmdable to get all Redis command methods + + pipeliner cmdableClient + config *AutoPipelineOptions + // blocking selects how the typed command surface (Set, Get, ...) behaves: + // when true the command call itself blocks until the command has executed + // (drop-in, synchronous shape); when false the call returns immediately and + // the result accessors (Val/Result/Err) block. See AutoPipeline (blocking) + // vs AsyncAutoPipeline (deferred). + blocking bool + + // Sharded command queues. Each shard has its own queue, mutex and flusher + // goroutine, so enqueues from many goroutines spread across shards instead + // of all contending on a single mutex and being drained by a single + // flusher. Commands are assigned to shards round-robin; per-goroutine + // ordering is still guaranteed because Do blocks for each command's result + // before issuing the next one. + shards []*apShard + next atomic.Uint32 // round-robin shard selector + // shardFn, when set, picks a command's shard from its content (cluster mode + // sets it to route by slot so all commands for one node land in the same + // shard's batch — keeping per-node pipelines deep instead of splitting every + // batch across nodes). When nil, commands are assigned round-robin. + shardFn func(Cmder) int + + // preflight, when set, can reject a command at submit time, before it is + // enqueued or dispatched (cluster mode refuses fan-out-policy commands + // that cannot ride a pipeline, so one caller's command cannot poison a + // merged batch). The returned error is set on the command. + preflight func(ctx context.Context, cmd Cmder) error + + // mustDivert, when set, forces a command off the batching path even though + // it is otherwise batchable — cluster mode uses it for commands whose + // routing is NOT slot-derived (ReqSpecial, e.g. FT.CURSOR READ, which is + // sticky to the node that owns the cursor). Batched, mapCmdsByNode would + // route them by slot and reach the wrong shard; diverted, they go through + // Client/ClusterClient.Process and keep their special routing. + mustDivert func(ctx context.Context, cmd Cmder) bool + + // sharedClosed, when non-nil, is the owning client's pool-set closed flag + // (shared across WithTimeout clones). The getters refuse to build a fresh + // pipeliner once it is set; this reference makes an ALREADY-built + // pipeliner refuse new work too — without it, a clone's Close would leave + // a cached pipeliner accepting enqueues against closed pools, failing + // them one dispatch at a time instead of with ErrClosed at submit. + sharedClosed *atomic.Bool + + // expectedArrivals counts how many commands the engine expects to arrive + // at any moment: a completed batch of N≥2 commands wakes its N waiters + // together, and in a closed loop each immediately submits its next command + // — so completion announces N expected arrivals, and every enqueue accounts + // for one. The default coalescing wait (awaitExpectedArrivals) holds the + // flusher while arrivals are still expected, so the whole wakeup wave + // flushes as one deep pipeline — an exact count, not a smoothed estimate, + // which cannot ratchet into fragmentation. Single-command batches announce + // nothing, so a lone caller and open-loop traffic never wait. May + // transiently go negative (arrivals nobody announced); readers clamp to + // zero. Pipeliner-global, not per-shard: cluster routing may land a + // follow-up on a different shard than the batch that woke its caller. + expectedArrivals atomic.Int64 + + // execEWMA is an exponentially-weighted moving average (alpha 1/8) of + // batch execution time in nanoseconds — the engine's own view of the + // server round-trip. It scales awaitExpectedArrivals's silence fallback so a + // wave staggered by scheduling on a slow link is not split mid-landing. Updates + // are racy read-modify-writes by design: losing an occasional sample is + // harmless for a smoothing heuristic. 0 means "no sample yet". + execEWMA atomic.Int64 + + // Lifecycle + ctx context.Context + cancel context.CancelFunc + wg sync.WaitGroup // Tracks flusher goroutines + batchWg sync.WaitGroup // Tracks batch execution goroutines + // divertWg tracks the goroutines that execute DIVERTED commands (blocking + // and connection-hostile ones, which never enter a batch). Close waits on + // it exactly like batchWg so a diverted command's pooled connection is not + // left in flight after Close returns — bounded, see Close. + // + // divertMu serializes "observe not-closed, then register" against Close's + // "mark closed, then wait": without it a diverted command could pass the + // closed check, Close could see a zero counter and return, and only then + // would the goroutine register — leaving an accepted command holding a + // pooled connection past Close (and racing WaitGroup Add against Wait). + divertMu sync.Mutex + divertWg sync.WaitGroup + closed atomic.Bool +} + +// apShard is one queue + flusher. Its fields are touched only by enqueuing +// goroutines (under mu) and by its own single flusher goroutine. +// apEnqueueStripes is how many enqueue stripes a shard runs when striping is +// safe (unordered configs, and every blocking-face shard — a blocking caller +// waits for each command, so stripes cannot reorder its stream). The +// enqueue mutex is the hottest lock in the engine (128 concurrent callers on +// one shard spend ~half their CPU in lock slow paths); striping the queue +// spreads that contention while the flusher still drains every stripe into ONE +// merged pipeline, so batches stay deep. Ordered shards always use a single +// stripe: with several stripes a caller's consecutive commands can land in +// stripes on opposite sides of an in-progress drain and execute out of order. +const apEnqueueStripes = 8 + +// apStripe is one striped slice of a shard's enqueue queue. Each stripe has +// its own batch-completion signal so a drain can take stripes one lock at a +// time; every batch taken in one drain completes together after the merged +// pipeline executes. Padded so neighbouring stripes' mutexes do not share a +// cache line. +type apStripe struct { + mu sync.Mutex + queue []Cmder + queueLen atomic.Int32 + // queueBytes approximates the queued commands' payload volume; maintained + // only when MaxBatchBytes is configured (see cmdApproxBytes). + queueBytes atomic.Int64 + curBatch *apBatch // completion signal for currently-queued cmds + // Pad each stripe onto its own cache line(s). Without it, one stripe's hot + // fields (queueLen/curBatch) share a cache line with the NEXT stripe's + // contended mutex, so a lock-free counter bump on stripe i invalidates the + // line a different core is trying to lock stripe i+1 on — false sharing + // that measured ~16x on a contended microbenchmark. cpu.CacheLinePad is + // sized per GOARCH (64 B on x86-64/arm64, 128 B on ppc64, 256 B on s390x), + // so this is correct on every target rather than a hand-tuned constant. + _ cpu.CacheLinePad +} + +type apShard struct { + ap *AutoPipeliner + + next atomic.Uint32 // round-robin stripe pick (unordered mode) + stripes []apStripe // 1 stripe when ordered, apEnqueueStripes when Unordered + notify chan struct{} // buffered (cap 1) enqueue wake-up + sem *internal.FIFOSemaphore // per-shard concurrent-batch budget + + // inFlight counts this shard's dispatched-but-unfinished batches. When it + // is zero and no arrivals are expected, the shard is idle and a + // new command flushes immediately; when batches are in flight, arrivals + // are mid-stream and the flusher holds them briefly to coalesce (see + // awaitExpectedArrivals). + inFlight atomic.Int32 +} + +// stripe picks the enqueue stripe for the next command: the single stripe in +// ordered mode (preserving strict FIFO), round-robin in unordered mode. +func (s *apShard) stripe() *apStripe { + if len(s.stripes) == 1 { + return &s.stripes[0] + } + return &s.stripes[s.next.Add(1)%uint32(len(s.stripes))] +} + +// getOrCreateAutoPipeliner is the shared caching protocol behind the four +// AutoPipeline/AsyncAutoPipeline getters (Client and ClusterClient, each +// face): return the cached live instance, refuse on a closed client, or build +// and cache a new one. The caller supplies its cached-slot pointer, its +// closed flag (both guarded by the mutex), the explicit-config override, the +// fallback config, and a build closure (the cluster one wraps +// clusterAutoPipelineOptions and installs slot sharding). +func getOrCreateAutoPipeliner( + mu *sync.Mutex, + slot **AutoPipeliner, + closed *bool, + sharedClosed *atomic.Bool, + override *AutoPipelineOptions, + fallback func() *AutoPipelineOptions, + build func(*AutoPipelineOptions) (*AutoPipeliner, error), +) (*AutoPipeliner, error) { + mu.Lock() + defer mu.Unlock() + // closed covers THIS wrapper's Close; sharedClosed covers the shared + // pools closing through ANY sharer (e.g. a WithTimeout clone falling + // through to baseClient.Close) — a fresh pipeliner against closed pools + // would leak flushers that error forever. + if *closed || (sharedClosed != nil && sharedClosed.Load()) { + return nil, ErrClosed + } + if *slot != nil && !(*slot).closed.Load() { + return *slot, nil + } + cfg := override + if cfg == nil { + cfg = fallback() + } + ap, err := build(cfg) + if err != nil { + return nil, err + } + // Thread the shared pool-set closed flag into the pipeliner so an + // ALREADY-cached instance also refuses enqueues once any sharer closes + // the pools (the check above only protects fresh builds). + ap.sharedClosed = sharedClosed + *slot = ap + return ap, nil +} + +// newAutoPipeliner builds an autopipeliner in either blocking or deferred mode. +// It is unexported on purpose: the public entry points are +// Client/ClusterClient.AutoPipeline and AsyncAutoPipeline, which also install +// cluster slot-sharding. Constructing one directly would skip that wiring and +// give a *ClusterClient degraded (cross-node) batching. +func newAutoPipeliner(pipeliner cmdableClient, config *AutoPipelineOptions, blocking bool) (*AutoPipeliner, error) { + if config == nil { + config = DefaultAutoPipelineOptions() + } else { + // Copy so default-filling below doesn't mutate the caller's struct — the + // same *AutoPipelineOptions may be shared across clients (e.g. a reused + // Options.AutoPipelineOptions), and callers may inspect it afterward. + cfgCopy := *config + config = &cfgCopy + } + + // Validate BEFORE default-filling: Validate treats zero as "use the + // default" but rejects negatives, and coercing first would silently + // swallow a negative typo the documented contract promises to error on. + if err := config.Validate(); err != nil { + return nil, err + } + + // Apply defaults for zero values + if config.MaxBatchSize <= 0 { + config.MaxBatchSize = 200 + } + + if config.MaxConcurrentBatches <= 0 { + // Default to an ordered single stream. Callers raise this (with + // Unordered:true) to opt into parallel-batch throughput. + config.MaxConcurrentBatches = 1 + } + + // NumShards > 1 on the deferred (async) face distributes commands + // round-robin across shards that flush concurrently, so submit order is + // not preserved — require the explicit Unordered opt-in, exactly like + // MaxConcurrentBatches > 1. The blocking face is exempt (each caller waits + // per command, and Submit is rejected there), as is cluster slot sharding + // (contentSharded: same-key commands always land in the same shard, so + // per-key order holds). + if config.NumShards > 1 && !config.Unordered && !blocking && !config.contentSharded { + return nil, fmt.Errorf( + "redis: AutoPipelineOptions.NumShards=%d requires Unordered:true on the deferred (async) face "+ + "(commands are distributed round-robin across shards, which flush concurrently and do not preserve submit order)", + config.NumShards) + } + + ctx, cancel := context.WithCancel(context.Background()) + + ap := &AutoPipeliner{ + pipeliner: pipeliner, + config: config, + blocking: blocking, + ctx: ctx, + cancel: cancel, + } + + // Route the typed command surface. Blocking: the command call blocks until + // executed (synchronous drop-in shape). Deferred: the call returns at once + // and the result accessors block until the batch executes. + if blocking { + ap.cmdable = ap.processBlocking + } else { + ap.cmdable = ap.processAsync + } + + // Pick the shard count. NumShards=0 (auto) means ONE shard: a single deep + // queue outperforms a sharded one because batches stay large — sharding by + // core count coupled batch fragmentation to MaxConcurrentBatches and + // collapsed pipelining (measured: 16 shards cut async throughput ~4x and + // tripled latency versus one shard at the same permit count). Cluster + // wiring passes an explicit NumShards so slot-routed shards keep each + // batch on one node. + nShards := config.NumShards + if nShards <= 0 { + nShards = 1 + } + // Split the concurrent-batch budget across shards so each shard has its own + // semaphore. A single shared semaphore became a contention point once the + // per-shard queue mutexes were no longer the bottleneck. Integer division + // drops a remainder, so hand the leftover permits to the first shards: the + // per-shard permits then sum to exactly MaxConcurrentBatches. + perShard := config.MaxConcurrentBatches / nShards + remainder := config.MaxConcurrentBatches % nShards + if perShard < 1 { + // Budget smaller than the shard count: give every shard one permit so + // each flusher can still make progress. The sum then exceeds the + // configured budget, which is unavoidable with per-shard semaphores. + perShard = 1 + remainder = 0 + } + ap.shards = make([]*apShard, nShards) + for i := range ap.shards { + permits := perShard + if i < remainder { + permits++ + } + // Stripe when reordering is impossible or waived: a BLOCKING caller + // waits for each command before issuing its next, so its per-goroutine + // order holds no matter which stripe each command lands in; the async + // face may only stripe when the user set Unordered. The remaining case + // (async, ordered) keeps one stripe to preserve strict submit order. + nStripes := 1 + if config.Unordered || blocking { + nStripes = apEnqueueStripes + } + s := &apShard{ + ap: ap, + notify: make(chan struct{}, 1), + stripes: make([]apStripe, nStripes), + sem: internal.NewFIFOSemaphore(int32(permits)), + } + for j := range s.stripes { + s.stripes[j].queue = getQueueSlice(config.MaxBatchSize) + s.stripes[j].curBatch = newAPBatch() + } + ap.shards[i] = s + ap.wg.Add(1) + go s.flusher() + } + + return ap, nil +} + +// Do executes a raw command on a NORMAL connection, outside the pipeline. +// Arbitrary command names can carry connection state (SELECT, MULTI, SUBSCRIBE, +// CLIENT ...) or block the connection (BLPOP ...); batching those onto a shared +// pipeline connection would silently poison it for every later batch, or stall +// unrelated commands. (Submit enforces the same rule for raw Cmders: names in +// the connection-hostile set are diverted off the pipeline automatically.) +// The typed surface (ap.Set, ap.Get, ...) is safe by +// construction and IS batched — prefer it. Do carries the same caveats as +// Client.Do: a stateful command still affects the (normal, non-pipeline) +// pooled connection it runs on. Do keeps each face's call shape: on +// a blocking autopipeliner the call blocks until the command has executed; on a +// deferred (async) one it returns immediately and the command's result +// accessors (Err/Val/Result) block until it completes. +func (ap *AutoPipeliner) Do(ctx context.Context, args ...interface{}) *Cmd { + cmd := NewCmd(ctx, args...) + if len(args) == 0 { + cmd.SetErr(errDoNoArgs) + return cmd + } + if ap.isClosed() { + cmd.SetErr(ErrClosed) + return cmd + } + + // Both faces go through runOutsidePipeline: it applies the divert + // registration gate, so Close cannot conclude "nothing in flight" while an + // accepted raw command — a blocking one on the blocking face runs inline on + // the caller's goroutine — is still holding a pooled connection. + _ = ap.runOutsidePipeline(ctx, cmd) + return cmd +} + +// runOutsidePipeline executes an escape-hatch command (Do, DoRaw, +// DoRawWriteTo) on a normal pooled connection, outside the batching engine, +// following the face's call shape. Blocking face: synchronous Process. +// Deferred face: returns-immediately — the command runs on a background +// goroutine and a ready batch makes its result accessors block until it +// completes. The batch completes at the innermost seam (under the user +// hooks) so a ProcessHook reading the result cannot self-deadlock; the +// deferred close is the panic backstop. Tracked by divertWg under divertMu, +// so Close waits for accepted diverted work (bounded — see Close) instead of +// returning while it still holds a pooled connection. +func (ap *AutoPipeliner) runOutsidePipeline(ctx context.Context, cmd Cmder) *apBatch { + if ap.blocking { + // The blocking face runs it inline, so the caller's own goroutine holds + // the connection; still take the gate so Close cannot decide "nothing + // in flight" while this command is executing. + ap.divertMu.Lock() + if ap.isClosed() { + ap.divertMu.Unlock() + cmd.SetErr(ErrClosed) + return completedBatch + } + ap.divertWg.Add(1) + ap.divertMu.Unlock() + defer ap.divertWg.Done() + _ = ap.pipeliner.Process(ctx, cmd) + return completedBatch + } + // Register under divertMu with a closed re-check, so registration and the + // close transition cannot interleave (see the divertMu comment). A command + // that loses the race is rejected here rather than running after Close. + // The gate comes BEFORE setReady: publishing the fresh batch first and then + // rejecting would leave the command gated on a batch nobody ever closes, + // hanging every accessor. + ap.divertMu.Lock() + if ap.isClosed() { + ap.divertMu.Unlock() + cmd.SetErr(ErrClosed) + cmd.setReady(completedBatch) + return completedBatch + } + b := newAPBatch() + cmd.setReady(b) + ap.divertWg.Add(1) + ap.divertMu.Unlock() + go func() { + defer ap.divertWg.Done() + defer b.close() + defer recoverDispatchPanic([]Cmder{cmd}) + if ap.armSelfDeadlockGuard() { + b.dispGid.Store(curGoroutineID()) + } + // A hook that returns nil WITHOUT calling next has short-circuited + // SUCCESSFULLY (it served the command itself); plain Client hooks may do + // that, so nothing here synthesizes an error for it — see dispatchCmds. + err := ap.pipeliner.withProcessHook(ctx, cmd, func(ctx context.Context, cmd Cmder) error { + return ap.pipeliner.process(ctx, cmd) + }) + // The chain's final verdict, exactly like Client.Process — recorded + // before the deferred close wakes the reader, so short-circuits, + // post-next rewrites and suppressions are all honored. + cmd.SetErr(err) + }() + return b +} + +// DoRaw mirrors Do for raw RESP access: AutoPipeliner embeds cmdable, so +// without this override DoRaw would ride the batching engine — but raw +// commands carry Do's caveats and DoRawWriteTo-style streaming must not run +// inside a shared batch's reply loop. Runs outside the pipeline, following +// the face's call shape (see Do). +func (ap *AutoPipeliner) DoRaw(ctx context.Context, args ...interface{}) *RawCmd { + cmd := NewRawCmd(ctx, args...) + if len(args) == 0 { + cmd.SetErr(errDoNoArgs) + return cmd + } + if ap.isClosed() { + cmd.SetErr(ErrClosed) + return cmd + } + _ = ap.runOutsidePipeline(ctx, cmd) + return cmd +} + +// DoRawWriteTo mirrors Do for streamed raw RESP access (see DoRaw). On the +// deferred face the write to w happens when the command executes; use the +// result accessors (Err/Written) to wait before reading w. +func (ap *AutoPipeliner) DoRawWriteTo(ctx context.Context, w io.Writer, args ...interface{}) *RawWriteToCmd { + cmd := NewRawWriteToCmd(ctx, w, args...) + if len(args) == 0 { + cmd.SetErr(errDoNoArgs) + return cmd + } + if ap.isClosed() { + cmd.SetErr(ErrClosed) + return cmd + } + _ = ap.runOutsidePipeline(ctx, cmd) + return cmd +} + +// Process queues a command for autopipelined execution, following the +// autopipeliner's mode like the typed methods and Do: on a blocking +// autopipeliner the call blocks until the command has executed; on a deferred +// (async) one it returns immediately and reading the command's result +// (Val/Result/Err) blocks until its batch is flushed. +func (ap *AutoPipeliner) Process(ctx context.Context, cmd Cmder) error { + return ap.cmdable(ctx, cmd) +} + +// The methods below complete the UniversalClient surface by delegating to the +// underlying client. They are NOT autopipelined — pub/sub, transactions (Watch), +// hooks, Do and pool stats cannot be batched — so an AutoPipeliner used as a +// UniversalClient batches only the typed data commands; everything here runs on +// the underlying client exactly as it would there. +// +// Note on lifecycle: Close() (defined elsewhere) closes the AUTOPIPELINER — +// drains in-flight batches and stops flushers — but does NOT close the +// underlying client, whose lifecycle is owned by whoever created it. + +// AddHook adds a hook to the underlying client. Autopipelined batches are hooked +// too, since dispatch goes through the hook-wrapped pipeline entry. +func (ap *AutoPipeliner) AddHook(hook Hook) { ap.pipeliner.AddHook(hook) } + +// The four commands below have CLUSTER-WIDE overrides on ClusterClient +// (DBSize sums every master, the Script commands fan out to every shard). +// The embedded generic cmdable would route them as ordinary keyless commands +// to one picked shard — partial results, scripts missing on other shards — +// so they delegate to the underlying client instead of batching. On a +// standalone client the delegation is semantically identical to the generic +// path; these are rare admin/script-management commands, not data-path. + +// DBSize delegates to the underlying client (cluster-wide sum on ClusterClient). +func (ap *AutoPipeliner) DBSize(ctx context.Context) *IntCmd { + return ap.pipeliner.DBSize(ctx) +} + +// ScriptLoad delegates to the underlying client (loads every shard on ClusterClient). +func (ap *AutoPipeliner) ScriptLoad(ctx context.Context, script string) *StringCmd { + return ap.pipeliner.ScriptLoad(ctx, script) +} + +// ScriptFlush delegates to the underlying client (flushes every shard on ClusterClient). +func (ap *AutoPipeliner) ScriptFlush(ctx context.Context) *StatusCmd { + return ap.pipeliner.ScriptFlush(ctx) +} + +// ScriptExists delegates to the underlying client (ANDs results across shards +// on ClusterClient). +func (ap *AutoPipeliner) ScriptExists(ctx context.Context, hashes ...string) *BoolSliceCmd { + return ap.pipeliner.ScriptExists(ctx, hashes...) +} + +// HImportPrepare, HImportDiscard and HImportDiscardAll are the remaining +// cluster-wide overrides (see the delegation note above): ClusterClient fans +// them out to every master and updates the shared fieldset registry, so +// running them on a single routed node would let a later HImportSet for a key +// on another master fail with "no such fieldset". TestAPDelegatesClusterWideOverrides +// fails if a future ClusterClient override is added without a delegate here. +func (ap *AutoPipeliner) HImportPrepare(ctx context.Context, fieldsetName string, fields ...string) *StatusCmd { + return ap.pipeliner.HImportPrepare(ctx, fieldsetName, fields...) +} + +func (ap *AutoPipeliner) HImportDiscard(ctx context.Context, fieldsetName string) *IntCmd { + return ap.pipeliner.HImportDiscard(ctx, fieldsetName) +} + +func (ap *AutoPipeliner) HImportDiscardAll(ctx context.Context) *IntCmd { + return ap.pipeliner.HImportDiscardAll(ctx) +} + +// Watch runs a transactional function on the underlying client (not batched). +func (ap *AutoPipeliner) Watch(ctx context.Context, fn func(*Tx) error, keys ...string) error { + return ap.pipeliner.Watch(ctx, fn, keys...) +} + +// Subscribe opens a pub/sub on the underlying client (not batched — pub/sub +// needs a dedicated connection). +func (ap *AutoPipeliner) Subscribe(ctx context.Context, channels ...string) *PubSub { + return ap.pipeliner.Subscribe(ctx, channels...) +} + +// PSubscribe opens a pattern pub/sub on the underlying client (not batched). +func (ap *AutoPipeliner) PSubscribe(ctx context.Context, channels ...string) *PubSub { + return ap.pipeliner.PSubscribe(ctx, channels...) +} + +// SSubscribe opens a sharded pub/sub on the underlying client (not batched). +func (ap *AutoPipeliner) SSubscribe(ctx context.Context, channels ...string) *PubSub { + return ap.pipeliner.SSubscribe(ctx, channels...) +} + +// PoolStats returns the underlying client's connection pool statistics. +func (ap *AutoPipeliner) PoolStats() *PoolStats { return ap.pipeliner.PoolStats() } + +// AutoPipeline delegates to the underlying client, which returns its cached +// autopipeliner (typically this same instance). Present to satisfy the +// UniversalClient surface. +func (ap *AutoPipeliner) AutoPipeline() (*AutoPipeliner, error) { + return ap.pipeliner.AutoPipeline() +} + +// AutoPipelineWithOptions delegates to the underlying client. +func (ap *AutoPipeliner) AutoPipelineWithOptions(config *AutoPipelineOptions) (*AutoPipeliner, error) { + return ap.pipeliner.AutoPipelineWithOptions(config) +} + +// AsyncAutoPipeline delegates to the underlying client. Present to satisfy the +// UniversalClient surface. +func (ap *AutoPipeliner) AsyncAutoPipeline() (*AutoPipeliner, error) { + return ap.pipeliner.AsyncAutoPipeline() +} + +// AsyncAutoPipelineWithOptions delegates to the underlying client. +func (ap *AutoPipeliner) AsyncAutoPipelineWithOptions(config *AutoPipelineOptions) (*AutoPipeliner, error) { + return ap.pipeliner.AsyncAutoPipelineWithOptions(config) +} + +// AutoFuture is the handle returned by Submit. Call Wait (or Result on the +// command after Wait) once the result is needed; it blocks only until the +// command's batch has executed. +type AutoFuture struct { + cmd Cmder + batch *apBatch +} + +// Wait blocks until the submitted command has executed, then returns its error. +// The zero AutoFuture (no submitted command) returns an error rather than +// panicking. +func (f AutoFuture) Wait() error { + if f.batch == nil { + if f.cmd != nil { + return f.cmd.Err() + } + return errZeroAutoFuture + } + select { + case <-f.batch.done: + default: + // Same self-deadlock guard as baseCmd.await(): a pipeline hook on + // the batch's own dispatch goroutine waiting a future pre-next() + // would block a channel only its goroutine can close. Give it the + // not-yet-executed view instead. + if f.batch.isExecutorGoroutine() { + return f.cmd.rawErr() + } + <-f.batch.done + } + return f.cmd.Err() +} + +// WaitContext is like Wait but stops waiting when ctx is done. The command +// still executes and its result remains readable once its batch completes — +// ctx abandons only this wait, it does not cancel the command (per-command +// contexts are not honored after enqueue; see the AutoPipeliner doc). +// +// After a ctx error the result may simply not be there YET: the batch is +// still in flight and may populate the command at any moment, so do not read +// Cmd()'s value or error directly — that races the executing batch. Call Wait +// (or WaitContext with a fresh context) again; once it returns a non-context +// error, the command's result is complete and safe to read. +func (f AutoFuture) WaitContext(ctx context.Context) error { + if f.batch == nil { + if f.cmd != nil { + return f.cmd.Err() + } + return errZeroAutoFuture + } + select { + case <-f.batch.done: + return f.cmd.Err() + default: + if f.batch.isExecutorGoroutine() { + return f.cmd.rawErr() // see Wait: dispatch-goroutine self-deadlock guard + } + } + select { + case <-f.batch.done: + return f.cmd.Err() + case <-ctx.Done(): + return ctx.Err() + } +} + +// Cmd returns the underlying command (call Wait first before reading results). +func (f AutoFuture) Cmd() Cmder { return f.cmd } + +// outsidePipelineCommands lists commands that must never ride a SHARED +// pipeline connection. SHUTDOWN terminates the server before replying (its +// batchmates would all fail with EOF and the batch would retry against a +// dead server); MONITOR rebinds the connection into a monitor stream, +// desyncing every reply behind it; the rest change per-connection state +// (database, auth, protocol, transaction, subscription mode) that would +// leak to every unrelated caller sharing the pipeline conn afterwards. The +// typed surface cannot produce most of the stateful ones (they live on +// statefulCmdable) — but ReadOnly/ReadWrite ARE on cmdable, and raw +// Submit/Do accept any Cmder. Diverted commands execute directly on their +// own pooled connection — the same semantics (including the same footguns) +// as plain Client.Do. +var outsidePipelineCommands = map[string]struct{}{ + "shutdown": {}, "monitor": {}, + "select": {}, "auth": {}, "hello": {}, "reset": {}, "quit": {}, + "multi": {}, "exec": {}, "discard": {}, "watch": {}, "unwatch": {}, + "subscribe": {}, "unsubscribe": {}, "psubscribe": {}, "punsubscribe": {}, + "ssubscribe": {}, "sunsubscribe": {}, + "client": {}, + // Connection-scoped cluster state: queued onto a shared pipeline conn + // they would leak replica-reads (or a pending redirect) to every later + // batch on that conn. + "readonly": {}, "readwrite": {}, "asking": {}, +} + +func runsOutsidePipeline(name string) bool { + _, ok := outsidePipelineCommands[name] + return ok +} + +// blockingCommands are commands that park on the server until data arrives or +// their own timeout expires. The TYPED helpers set a per-command read timeout +// (see cmdable.BLPop), which submit already diverts on; a RAW Cmder built by +// hand — NewCmd(ctx, "blpop", key, 0) via Submit/Process/Do — carries no such +// marker, so without this set it would be queued onto a shared pipeline +// connection and hold the whole batch for the block duration. +// Derived from the typed helpers rather than guessed: every cmdable method that +// calls cmd.setReadTimeout parks the connection, so +// +// grep -rn 'setReadTimeout' --include='*.go' . | grep -v _test +// +// enumerates exactly the wire names that belong here (the arg-driven ones are +// handled in isBlockingCmd instead). Re-run that grep when adding a blocking +// command. +var blockingCommands = map[string]struct{}{ + "blpop": {}, "brpop": {}, "brpoplpush": {}, + "blmove": {}, "blmovem": {}, "blmpop": {}, + "bzpopmin": {}, "bzpopmax": {}, "bzmpop": {}, + "wait": {}, "waitaof": {}, + // MIGRATE blocks the source instance for up to its timeout. + "migrate": {}, +} + +// isBlockingCmd reports whether cmd parks the connection. XREAD/XREADGROUP are +// decided by ARGUMENTS, not by name: only the BLOCK form blocks, and +// blanket-diverting the (far more common) non-blocking form would drop it out +// of batching for nothing. +func isBlockingCmd(cmd Cmder) bool { + name := cmd.Name() + if _, ok := blockingCommands[name]; ok { + return true + } + // Arg-driven: these block only in their BLOCK form, and blanket-diverting + // the far more common non-blocking form would drop it out of batching for + // nothing. TS.READ takes BLOCK the same way (see TSReadWithArgs). + if name != "xread" && name != "xreadgroup" && name != "ts.read" { + return false + } + // Match the token the way the encoder does: a raw Cmder may carry RESP + // tokens as []byte or *string (see baseCmd.stringArg), and a type switch on + // string alone would let NewCmd(ctx, "xread", []byte("BLOCK"), 0, ...) be + // batched onto a shared connection. + for _, arg := range cmd.Args() { + if internal.ToLower(blockingArgString(arg)) == "block" { + return true + } + } + return false +} + +// blockingArgString renders a command argument as the string the encoder will +// write for the token comparisons above. Only the forms that can carry a RESP +// keyword are handled; anything else cannot be the BLOCK token. +func blockingArgString(arg interface{}) string { + switch v := arg.(type) { + case string: + return v + case []byte: + return string(v) + case *string: + if v == nil { + return "" + } + return *v + default: + return "" + } +} + +// submit queues a command without blocking and returns its completion future. +func (ap *AutoPipeliner) submit(ctx context.Context, cmd Cmder) AutoFuture { + // finish marks the command ready on the deferred face so its result + // accessors (Val/Result/Err) self-gate through await() — whether the + // caller goes through the typed surface or raw Submit. Reading a + // Submit()-ed command before Wait() was previously a silent data race + // with the dispatch goroutine. The blocking face deliberately never + // carries a batch: its callers only regain control after execution, and + // the dispatcher-gid deadlock guard relies on that. + finish := func(f AutoFuture) AutoFuture { + if !ap.blocking { + cmd.setReady(f.batch) + } + return f + } + // Decide DIVERSION first. The cluster preflight rejects commands whose + // request policy cannot ride a pipeline (ReqAllNodes/ReqAllShards), but a + // diverted command never rides one: it goes through the underlying + // Client/ClusterClient.Process, which performs the normal cluster-wide + // fan-out and aggregation. Running the preflight first therefore rejected + // commands that would have worked — typed WAIT/WAITAOF on a cluster with + // command policies enabled (review finding by codex on #3942). + diverted := cmd.readTimeout() != nil || runsOutsidePipeline(cmd.Name()) || isBlockingCmd(cmd) || + (ap.mustDivert != nil && ap.mustDivert(ctx, cmd)) + if !diverted && ap.preflight != nil { + if err := ap.preflight(ctx, cmd); err != nil { + cmd.SetErr(err) + return finish(AutoFuture{cmd: cmd, batch: completedBatch}) + } + } + if diverted { + // Blocking commands (and the conn-hostile ones above) are executed + // directly, outside the pipeline — via runOutsidePipeline, which + // keeps each face's call shape: the blocking face runs the command + // synchronously, the deferred face runs it on its own goroutine so + // this call returns immediately and the result accessors block (a + // BLPOP submitted on the async face must not stall the submitter, + // exactly like Do). They still must respect a closed AutoPipeliner: + // enqueue() rejects on the batched path, so mirror that here instead + // of running after Close(). + if ap.isClosed() { + cmd.SetErr(ErrClosed) + return finish(AutoFuture{cmd: cmd, batch: completedBatch}) + } + // runOutsidePipeline sets the command ready itself on the deferred + // face; the returned batch completes when the command has executed. + return AutoFuture{cmd: cmd, batch: ap.runOutsidePipeline(ctx, cmd)} + } + // No finish here: enqueue stamps ready under the stripe lock, before the + // command is visible to any drain (the error paths above still go through + // finish for uniform accessor behavior). + return AutoFuture{cmd: cmd, batch: ap.enqueue(cmd)} +} + +// ErrSubmitBlockingFace rejects Submit on the blocking face: Submit does not +// wait, so a windowed caller could have several commands in flight at once — +// but the blocking face stripes its enqueue queue on the strength of every +// caller waiting per command, and a non-waiting window there can be reordered. +// The deferred face (AsyncAutoPipeline) is built for exactly that usage. +// +// EXPERIMENTAL: this API is subject to change, use with caution. +var ErrSubmitBlockingFace = errors.New( + "redis: Submit requires the deferred autopipeliner (AsyncAutoPipeline); on the blocking face use the typed methods or Do") + +// errZeroAutoFuture is returned by Wait/WaitContext on a zero AutoFuture. +var errZeroAutoFuture = errors.New("redis: Wait on a zero AutoFuture") + +// errDoNoArgs is returned by Do when called without a command. +var errDoNoArgs = errors.New("redis: AutoPipeliner.Do requires at least one argument") + +// ErrAutoPipelineTimeout is set on drained commands when a flush could not +// obtain a batch permit within the engine's internal backstop — the engine is +// overloaded or an in-flight batch is wedged (e.g. read timeouts disabled on +// a dead peer). It is deliberately NOT context.DeadlineExceeded: the caller's +// own context did not expire, and errors.Is(err, context.DeadlineExceeded) +// must not fire for an internal engine timeout. +// +// EXPERIMENTAL: this API is subject to change, use with caution. +var ErrAutoPipelineTimeout = errors.New( + "redis: autopipeline: no batch permit within the internal backstop (engine overloaded or a batch is wedged)") + +// Submit queues a command without blocking and returns an AutoFuture; Wait on +// it when the result is needed. This is the explicit form for working with raw +// Cmders on the deferred (async) face, where the typed methods (Set, Get, ...) +// provide the same deferred behaviour returning the usual *XxxCmd. The +// command's own result accessors (Err/Val/Result) are safe to use instead of +// Wait — they block until the command has executed. Connection-hostile +// command names (SHUTDOWN, MONITOR, SELECT, AUTH, MULTI, SUBSCRIBE, CLIENT, +// ...) never ride a shared pipeline connection: they are diverted to a +// normal pooled connection with plain Client.Do semantics. On a BLOCKING +// autopipeliner Submit is rejected (the future's Wait returns an error): the +// blocking face's ordering relies on every caller waiting for each command +// before issuing the next, which Submit by design does not do. +func (ap *AutoPipeliner) Submit(ctx context.Context, cmd Cmder) AutoFuture { + if ap.blocking { + cmd.SetErr(ErrSubmitBlockingFace) + return AutoFuture{cmd: cmd, batch: completedBatch} + } + return ap.submit(ctx, cmd) +} + +// processAsync is the cmdable backing the typed command surface: it queues a +// command without blocking the caller and marks it ready so the command's +// result accessors (Val/Result/Err) block until the batch executes. This gives +// the autopipeliner the full typed surface (ap.Set, ap.Get, ...) with the exact +// same call shape as a normal client — only the wait is deferred to the point a +// result is read. +func (ap *AutoPipeliner) processAsync(ctx context.Context, cmd Cmder) error { + // submit marks the command ready (see the finish closure there): a hook + // that reads the command before that store lands sees a nil ready — the + // non-blocking not-yet-executed view — while the caller always sees its + // own store before any await. + f := ap.submit(ctx, cmd) + // Report SUBMIT-time rejections (a closed pipeliner, a cluster preflight + // refusal): those paths set the error on the command and hand back the + // shared completed batch without queueing anything, so returning nil made + // Process claim success for a command that will never run — and callers + // reaching the engine through UniversalClient.Process see only this return + // value (review finding by codex on #3942). Execution errors are NOT + // reported here: the deferred face's contract is that this call does not + // wait, so those stay on the command for its accessors. rawErr keeps the + // check non-blocking. + if f.batch == completedBatch { + return cmd.rawErr() + } + return nil +} + +// processBlocking is the cmdable backing the blocking face: it queues the +// command and blocks until its batch has executed, so the command call has the +// same synchronous shape as a normal client (the returned *XxxCmd already holds +// its result). The flusher still batches this command with other concurrent +// callers' commands into a pipeline, so throughput is far above a plain client +// even though each caller waits. Per-goroutine ordering holds regardless of +// MaxConcurrentBatches: a caller cannot issue its next command until this one +// returns, so its commands execute in submit order. +func (ap *AutoPipeliner) processBlocking(ctx context.Context, cmd Cmder) error { + return ap.submit(ctx, cmd).Wait() +} + +// completedBatch is a reusable already-completed batch: returned both for +// commands that already executed directly (blocking commands, Submit-time +// rejections) and for error cases like enqueue-after-Close, so Wait returns +// immediately and the command's own error tells the story. +var completedBatch = func() *apBatch { + b := newAPBatch() + b.close() + return b +}() + +// enqueue queues a command and returns the batch whose done channel completes +// when it has executed. On a closed autopipeliner it errors the command and +// returns the already-closed batch. +// isClosed reports whether this pipeliner (or the shared pool set it rides +// on) has been closed. Two atomic loads; no locks. +// +// EVERY closed check that gates accepting new work must go through this, not +// ap.closed directly: a WithTimeout clone's Close sets only the shared flag, +// so a guard reading ap.closed alone would accept commands against pools that +// are already gone and surface pool-closed errors instead of ErrClosed. +// (Close's own CompareAndSwap on ap.closed is the one deliberate direct use: +// it claims the shutdown for this instance.) +func (ap *AutoPipeliner) isClosed() bool { + return ap.closed.Load() || (ap.sharedClosed != nil && ap.sharedClosed.Load()) +} + +func (ap *AutoPipeliner) enqueue(cmd Cmder) *apBatch { + if ap.isClosed() { + cmd.SetErr(ErrClosed) + return completedBatch + } + + // Pick a shard. With shardFn (cluster mode) route by command content so all + // commands for one node collect in the same shard's batch; otherwise spread + // round-robin to keep each shard's mutex lightly contended. + var s *apShard + if ap.shardFn != nil { + // uint conversion instead of negation: -math.MinInt overflows back to + // itself and a negative modulo would panic the index. The unsigned + // modulo is deterministic for every int, including MinInt. + idx := ap.shardFn(cmd) + s = ap.shards[uint(idx)%uint(len(ap.shards))] + } else if len(ap.shards) == 1 { + // Single shard (the standalone default): skip the round-robin counter — + // it is a shared cache line bumped by every enqueue for a pick that is + // constant. Same guard the stripe pick already has. + s = ap.shards[0] + } else { + // Unsigned modulo: converting to int first goes negative after the + // uint32 counter passes 2^31 on 32-bit platforms and panics. + s = ap.shards[int((ap.next.Add(1)-1)%uint32(len(ap.shards)))] + } + + st := s.stripe() + st.mu.Lock() + // Re-check closed under the stripe lock (see Close): either we win the lock + // first and the shutdown drain flushes us, or the drain ran first and we + // reject here — so a late enqueue never hangs on an unclosed done. + if ap.isClosed() { + st.mu.Unlock() + cmd.SetErr(ErrClosed) + return completedBatch + } + batch := st.curBatch + if !ap.blocking { + // Publish the gating batch BEFORE the command becomes visible to a + // drain (the drain takes this same stripe lock): a flush racing the + // submitter's return path must observe ready already set, or the + // cluster node-executor registration would skip this command's batch + // and a node hook reading the command mid-dispatch could block on a + // batch its own call chain completes. The blocking face deliberately + // never carries a batch (see submit). + cmd.setReady(batch) + } + st.queue = append(st.queue, cmd) + st.queueLen.Store(int32(len(st.queue))) + if ap.config.MaxBatchBytes > 0 { + st.queueBytes.Add(cmdApproxBytes(cmd)) + } + st.mu.Unlock() + + // One expected arrival has landed (see expectedArrivals). + ap.expectedArrivals.Add(-1) + + s.wake() + return batch +} + +// wake signals the shard's flusher that work is available without blocking. +func (s *apShard) wake() { + select { + case s.notify <- struct{}{}: + default: + } +} + +// IsBlocking reports which face this autopipeliner is: true for the blocking +// face (Client.AutoPipeline — calls wait for execution), false for the +// deferred face (AsyncAutoPipeline — calls return immediately and result +// accessors block). The two faces reject different usage (Submit is +// blocking-face-rejected), so code handed an *AutoPipeliner can branch on +// this instead of probing with errors. +func (ap *AutoPipeliner) IsBlocking() bool { return ap.blocking } + +// Config returns a copy of the effective configuration (defaults filled in). +func (ap *AutoPipeliner) Config() AutoPipelineOptions { + cfg := *ap.config + // Strip internal-only fields. contentSharded is set by cluster wiring and + // tells Validate that shards are slot-routed, so same-key commands cannot + // be reordered — which exempts the config from the NumShards>1 ordering + // requirement. Handing that bit back to a caller who copies this config + // into a STANDALONE async autopipeliner would silence that check for + // round-robin shards, which really do flush concurrently and really do + // break submit order (review finding by codex on #3942). + cfg.contentSharded = false + return cfg +} + +// IsClosed reports whether the AutoPipeliner has been closed, either by an +// explicit Close or by closing the owning client. A closed AutoPipeliner +// rejects new commands with ErrClosed. +func (ap *AutoPipeliner) IsClosed() bool { + return ap.isClosed() +} + +// numShards reports how many shards this autopipeliner runs. +func (ap *AutoPipeliner) numShards() int { return len(ap.shards) } + +// setShardFn installs a content-based shard selector. In cluster mode it maps +// a command's SLOT to a shard, which is a batch-depth heuristic, not an +// invariant: slot ranges are assigned to shards proportionally, so when a +// node's slots are non-contiguous one shard's batch can still span nodes and +// mapCmdsByNode splits it (correctness is unaffected — that router resolves +// every command's own slot — but those per-node pipelines are shallower). +// What the mapping DOES guarantee is that a given key always lands on the same +// shard, so a caller's relative order for that key is preserved regardless of +// how the shard's batch is split. Must be called before the autopipeliner is +// used. Not safe to change concurrently with enqueues. +func (ap *AutoPipeliner) setShardFn(fn func(Cmder) int) { ap.shardFn = fn } + +// setPreflight installs a submit-time command filter (cluster wiring rejects +// commands whose request policy cannot ride a pipeline). Called once during +// construction, before the AutoPipeliner is published. +func (ap *AutoPipeliner) setPreflight(fn func(ctx context.Context, cmd Cmder) error) { + ap.preflight = fn +} + +// setMustDivert installs a predicate that forces a command off the batching +// path (see the mustDivert field). Called once during construction, before the +// AutoPipeliner is published. +func (ap *AutoPipeliner) setMustDivert(fn func(ctx context.Context, cmd Cmder) bool) { + ap.mustDivert = fn +} + +// Close stops the autopipeliner and flushes any pending commands. Worst +// case it blocks up to the internal permit backstop (~30s) PER SHARD if +// in-flight batches are wedged (e.g. read timeouts disabled against a dead +// peer) — healthy shutdowns take one round trip per shard with commands +// queued, near-zero otherwise. +func (ap *AutoPipeliner) Close() error { + if !ap.closed.CompareAndSwap(false, true) { + return nil // Already closed + } + + // Cancel context to stop flushers + ap.cancel() + + // Wake every shard's flusher so each observes the cancelled context promptly. + for _, s := range ap.shards { + s.wake() + } + + // Pass through the divert gate once: after the CompareAndSwap above, any + // registration either completed before this (so the counter already sees + // it) or will observe closed==true and reject. Without this handshake the + // wait below could read a zero counter while a diverted command was + // between its closed check and its Add. + ap.divertMu.Lock() + ap.divertMu.Unlock() //nolint:staticcheck // handshake, not a critical section + + // Drain everything that remains, BOUNDED AS ONE UNIT: the flusher exit, the + // final shard sweep, and the batch/diverted dispatch waits. + // + // None of it can be cancelled: commands taken from a queue (or accepted for + // diverted execution) were already ACCEPTED, and Close's contract is to + // flush them, so ap.cancel() deliberately does not reach an in-flight + // dispatch. With ReadTimeout disabled — a supported configuration — a + // stalled read against a dead peer, or a diverted BLPOP with a zero + // timeout, has nothing to end it. Bounding only the LAST wait would not + // help: the wedged dispatch can just as easily sit in a flusher that + // ap.wg.Wait() is waiting for, or in the shutdown sweep's own dispatch, so + // Close would hang before ever reaching the bound it documents (review + // finding by codex on #3942). On expiry, report what is still outstanding + // instead of blocking the caller: the engine is already closed to new work, + // and the leaked goroutines end when the server or the OS breaks the + // connection. See autoPipelineCloseBackstop for why the bound is generous. + return ap.drainAll(autoPipelineCloseBackstop) +} + +// drainAll runs Close's whole drain tail under a single bound and returns an +// error naming every stage that was still outstanding when it expired. Split +// out of Close so the bound is testable without a real stalled connection. +// +// The stages are ordered as Close needs them — the shard sweep must not start +// before the flushers are provably gone — but they are waited on +// CONCURRENTLY with the timer, which is the whole point: any stage can be the +// one that never finishes. +func (ap *AutoPipeliner) drainAll(timeout time.Duration) error { + flushers := make(chan struct{}) + go func() { defer close(flushers); ap.wg.Wait() }() + + // swept: after the flushers are gone, drain each shard once more under its + // lock. A command can pass enqueue's under-lock closed-recheck just before + // Close's CompareAndSwap and append to a shard AFTER that shard's flusher + // has already drained and exited — leaving its batch.done unclosed and the + // caller's accessor blocked forever. s.mu serializes the two, so either the + // late enqueue appends first and this sweep flushes it, or the sweep runs + // first and the enqueue then observes closed==true and rejects. + swept := make(chan struct{}) + go func() { + defer close(swept) + <-flushers + for _, s := range ap.shards { + s.flushBatchSliceShutdown() + } + }() + + batches := make(chan struct{}) + go func() { + defer close(batches) + <-swept + ap.batchWg.Wait() + }() + + diverted := make(chan struct{}) + go func() { defer close(diverted); ap.divertWg.Wait() }() + + timer := time.NewTimer(timeout) + defer timer.Stop() + batchesDone, divertedDone := false, false + for !batchesDone || !divertedDone { + select { + case <-batches: + batchesDone = true + batches = nil // a closed channel is always ready; stop selecting it + case <-diverted: + divertedDone = true + diverted = nil + case <-timer.C: + var outstanding []string + if !batchesDone { + // Name the precise stage: a wedged flusher and a wedged batch + // dispatch need different operator responses. + select { + case <-flushers: + select { + case <-swept: + outstanding = append(outstanding, "batch dispatches") + default: + outstanding = append(outstanding, "the shutdown flush") + } + default: + outstanding = append(outstanding, "the flusher drain") + } + } + if !divertedDone { + outstanding = append(outstanding, "diverted (blocking) commands") + } + return fmt.Errorf( + "redis: autopipeline: Close timed out after %s with %s still in flight; "+ + "they hold pooled connections until the server or the OS ends them "+ + "(most often a blocking command with no timeout, or ReadTimeout disabled)", + timeout, strings.Join(outstanding, " and ")) + } + } + return nil +} + +// flusher is the per-shard background goroutine that flushes batches. +func (s *apShard) flusher() { + defer s.ap.wg.Done() + ap := s.ap + + for { + // Wait for a command to arrive (or shutdown). The notify channel is a + // cheap buffered wake-up; no lock is taken on the hot enqueue path. + if s.Len() == 0 { + select { + case <-s.notify: + case <-ap.ctx.Done(): + } + } + + // Check if context is cancelled + if ap.ctx.Err() != nil { + // Final flush before shutdown - use background context to avoid immediate cancellation + s.flushBatchSliceShutdown() + return + } + + // Apply the coalescing window if one is configured (MaxFlushDelay / + // AdaptiveDelay). With the default config this returns at once: batching + // under concurrent load comes from in-flight backpressure, not a wait — + // see accumulateBatch. + s.accumulateBatch() + + // Flush all pending commands + for s.Len() > 0 { + select { + case <-ap.ctx.Done(): + // Final flush before shutdown + s.flushBatchSliceShutdown() + return + default: + } + + s.flushBatchSlice() + + // Between batches, apply the configured window again so the next + // pipeline is also full. A no-op with the default config (see + // accumulateBatch); the next drain picks up whatever has queued. + if s.Len() > 0 && s.Len() < ap.config.MaxBatchSize && !s.bytesFull() { + s.accumulateBatch() + } + } + } +} + +// accumulateBatch lets commands pile up before the flusher drains the queue, +// so pipelines carry many commands instead of one. It returns as soon as any +// of these holds: +// +// - the queue reaches MaxBatchSize (batch is full); +// - a configured MaxFlushDelay / AdaptiveDelay window elapses; or +// - with no configured window (the default), the expected resubmission +// wave of arrivals has landed — see awaitExpectedArrivals. +// +// A configured MaxFlushDelay / AdaptiveDelay is an intentional accumulation +// window and is waited in full (AdaptiveDelay scales it down as the queue fills +// and returns 0 — flush now — once the queue is ≥75% full). +func (s *apShard) accumulateBatch() { + ap := s.ap + batchSize := ap.config.MaxBatchSize + if batchSize <= 0 { + batchSize = 1 + } + if s.Len() >= batchSize || s.bytesFull() { + return + } + + // Pick the accumulation window. calculateDelay returns 0 both when no + // MaxFlushDelay is configured (the default) and when AdaptiveDelay resolves + // the current fill level to "flush immediately". The fill level is this + // shard's own length — each shard flushes independently, so a global count + // would mis-tune a quiet shard while another is busy. + window := ap.calculateDelay(s.Len()) + if window <= 0 { + if ap.config.MaxFlushDelay == 0 && !ap.config.AdaptiveDelay { + // Default: coalesce by expected-arrival count, not by wall-clock. + s.awaitExpectedArrivals(batchSize) + } + return + } + + // Explicit window: wait the whole delay (or until the batch fills). Each + // enqueue sends on notify, so we re-check the queue length on every wake-up + // and return once the batch is full. + deadline := time.NewTimer(window) + defer deadline.Stop() + for { + select { + case <-ap.ctx.Done(): + return + case <-deadline.C: + return + case <-s.notify: + if s.Len() >= batchSize || s.bytesFull() { + return + } + } + } +} + +// silenceGapFloor / silenceGapCeil bound awaitExpectedArrivals's silence fallback. +// The floor covers fast links; the RTT-scaled value (execEWMA/8) takes over on +// slow ones, where a wakeup wave staggered by goroutine scheduling can pause +// longer than the floor mid-landing and a premature flush is expensive (each +// batch fragment occupies a pipeline connection for a full round trip). The +// ceiling bounds how long a stale expectation (callers that left) can delay a +// flush. +const ( + silenceGapFloor = 200 * time.Microsecond + silenceGapCeil = 2 * time.Millisecond +) + +// coalesceMinFlush is the smallest pipeline worth dispatching while other +// batches are still executing. Below it, a gap-fire holds the queued +// stragglers for the next wave instead of burning a connection on a +// near-empty flush; once nothing is in flight, any size flushes immediately. +const coalesceMinFlush = 8 + +// observeBatchExec folds one batch execution duration into execEWMA. +func (ap *AutoPipeliner) observeBatchExec(d time.Duration) { + sample := int64(d) + if sample <= 0 { + return + } + old := ap.execEWMA.Load() + if old == 0 { + ap.execEWMA.Store(sample) + return + } + ap.execEWMA.Store(old + (sample-old)/8) +} + +// silenceGap returns the silence fallback for awaitExpectedArrivals, scaled to the +// observed batch round-trip: clamp(execEWMA/8, floor, ceil). +func (ap *AutoPipeliner) silenceGap() time.Duration { + g := time.Duration(ap.execEWMA.Load() / 8) + if g < silenceGapFloor { + return silenceGapFloor + } + if g > silenceGapCeil { + return silenceGapCeil + } + return g +} + +// awaitExpectedArrivals holds the flusher while related work is in motion, so +// commands flush as deep pipelines instead of fragmenting into small batches +// (each fragment costs a pipeline connection for a full round trip). Two +// signals — both facts the engine already has, not wall-clock guesses — decide +// whether anything is imminent: +// +// - expectedArrivals: a completed batch of N commands wakes its N waiters +// together, and in a closed loop each immediately submits its next +// command. Completion announces the exact count; every enqueue accounts +// for one; the wait ends the moment the count drains — the wave of +// arrivals has fully landed. An exact per-wave count has no failure mode +// where an averaged estimate undershoots the true wave and locks the +// engine into fragmented flushes. +// - inFlight: batches still executing mean their waiters will wake shortly +// and stragglers are mid-stream — worth holding a moment to coalesce with, +// bounded by the silence gap. This also recovers a fragmented state (many +// singles in flight, which announce nothing): their staggered returns land +// within one gap, merge into a real batch, and arrival tracking resumes. +// +// When neither holds, the shard is idle and the flush happens immediately: a +// lone caller pays a single round trip with no timer armed. That is the point +// of the design — the previous fixed ~20µs debounce timer armed on every flush +// fires ~1ms late on an idle or low-core host (wakeup latency dominates the +// requested delay), taxing every low-concurrency command ~5x its round trip. +// Here the gap timer never fires in steady state, closed loop or open; it only +// ends waits for callers that left. +func (s *apShard) awaitExpectedArrivals(batchSize int) { + ap := s.ap + expected := ap.expectedArrivals.Load() + if expected < 0 { + // Arrivals outran what was announced (open-loop traffic); re-zero so + // the deficit does not mask the next wave. CAS: only clear the value + // we saw, never a concurrent announcement. + ap.expectedArrivals.CompareAndSwap(expected, 0) + expected = 0 + } + expectingWave := expected > 0 + if !expectingWave && s.inFlight.Load() == 0 { + // Idle shard: nothing imminent, flush in one round trip. + return + } + + gap := ap.silenceGap() + // Reset is drain-safe on Go 1.23+ (see go.mod: go 1.24). + fallback := time.NewTimer(gap) + defer fallback.Stop() + lastSeenExpected := expected // count as of the most recent timer (re)arm + var holdStart time.Time // set on the first straggler-hold gap fire + for { + select { + case <-ap.ctx.Done(): + return + case <-fallback.C: + if !expectingWave && s.Len() < coalesceMinFlush && s.inFlight.Load() > 0 { + // Only stragglers queued while batches are still executing: + // flushing a near-empty pipeline burns a connection for a full + // round trip (measured at high WAN concurrency: straggler + // flushes of 1-3 commands starved the connection pool and + // doubled p50). Hold them — the next completed batch's wave + // sweeps them along, and the wave path below flushes promptly. + // The hold is bounded like the permit wait: with read timeouts + // disabled a wedged batch could pin inFlight forever, and the + // held stragglers must not hang with it. + if holdStart.IsZero() { + holdStart = time.Now() + } + if time.Since(holdStart) < autoPipelinePermitBackstop { + lastSeenExpected = ap.expectedArrivals.Load() + fallback.Reset(gap) + continue + } + } + if expectingWave { + // A whole gap passed with no arrivals on this shard: the + // expected callers left (workload shrank), so clear the stale + // expectation or future flushes will wait for ghosts. But only + // if it did not GROW during the silent gap — growth means a + // batch elsewhere (another shard, or racing this fire) + // announced a fresh wave, and erasing that would fragment a + // wave that is really coming. CAS, never a blind store, so an + // announcement racing the reset itself also survives. + if d := ap.expectedArrivals.Load(); d > 0 && d <= lastSeenExpected { + ap.expectedArrivals.CompareAndSwap(d, 0) + } + } + return + case <-s.notify: + if s.Len() >= batchSize || s.bytesFull() { + return + } + if d := ap.expectedArrivals.Load(); d > 0 { + // An in-flight batch completed mid-wait: its wave is now the + // thing to wait out, with the exact-count exit below. + expectingWave = true + lastSeenExpected = d + } else if expectingWave { + // The wave has fully landed; flush it as one batch. + return + } else if s.inFlight.Load() == 0 { + // Nothing executing, no wave expected: no completion will + // wake more callers, so flush what we have now. + return + } + fallback.Reset(gap) + } + } +} + +// dispatchCmds executes the drained stripe queues as one pipeline without +// constructing a Pipeline object: the queue slices go straight to the client's +// hook-wrapped pipeline processor (the exact entry Pipeline.Exec is wired to), +// so hooks and OTel behave identically while the per-batch Pipeline allocation, +// its append-growth reallocations and the per-command Process calls disappear. +// A single-stripe drain (every ordered shard, and any drain that found one +// non-empty stripe) passes its queue zero-copy; multi-stripe drains merge into +// one pooled slice. +// The batches stay OPEN throughout: completion happens at the caller's +// deferred closes, after the whole hook chain has returned. Hooks on the +// dispatch goroutine can still read results without deadlocking via the +// dispGid guard in await() (pre-next: the not-yet-executed view; post-next: +// the populated results), and — exactly like a plain pipeline — they may +// even adjust results before any waiter wakes. +// +// The innermost records whether execution actually happened. Two hook +// behaviours the chain's return value can carry are surfaced, both while the +// batches are still open (the callers' deferred closes run after this +// returns, so no waiter is reading yet): +// - short-circuit (hook returned without calling next): nothing set the +// commands' results — the chain's error, if any, is set +// on every command; +// - post-next verdict (exec ran, a hook still returned an error): applied +// to the commands ONLY when every one of them is error-free — the case +// where the hook's verdict would otherwise vanish entirely. A plain +// pipeline hands that verdict to the Exec caller without rewriting +// per-command results; with no Exec caller here, per-command errors +// recorded by the exec always win and are never overwritten. +func (ap *AutoPipeliner) dispatchCmds(ctx context.Context, queues [][]Cmder, total int) { + cmds := queues[0] + if len(queues) > 1 { + cmds = getQueueSlice(total) + for i := range queues { + cmds = append(cmds, queues[i]...) + } + } + // A command that forbids retries (today: the zero-copy reads, whose reply + // decodes into a caller buffer that a retry could not un-write) disables + // retries for the WHOLE slice it is dispatched in — see cmdsContainNoRetry. + // In a shared batch that would silently strip retries from unrelated + // callers' ordinary commands, so a mixed batch is dispatched as several + // pipelines instead of one. + // + // Split into CONTIGUOUS RUNS, in order, never into two policy groups: + // grouping would reorder the stream — a zero-copy read submitted before a + // SET to the same key would execute after it, so the read observes the new + // value on a face that promises submit order. Runs preserve every relative + // position while still keeping each dispatched slice policy-uniform (both + // findings by codex on #3942; the grouping bug was introduced by the first + // fix for the retry leak). + if runs := splitRetryRuns(cmds); runs != nil { + ap.dispatchSequential(ctx, runs) + if len(queues) > 1 { + putQueueSlice(cmds) + } + return + } + executed := false + chainErr := ap.pipeliner.withProcessPipelineHook(ctx, cmds, func(ctx context.Context, cmds []Cmder) error { + executed = true + return ap.pipeliner.processPipeline(ctx, cmds) + }) + // NOTE: a hook that returns nil WITHOUT calling next has short-circuited + // SUCCESSFULLY — it served the batch itself (a cache, a mock) and set the + // command values. Plain Pipeline/Client hooks are allowed to do exactly + // that, so no error is synthesized for it: doing so made a hook that works + // on a pipeline fail on an autopipelined batch (review finding by codex on + // #3942). Only the hook's own error propagates, below. + if chainErr != nil { + if !executed { + setCmdsErr(cmds, chainErr) + } else if cmdsFirstErr(cmds) == nil { + // Post-next error on an all-clean batch: the exec fully succeeded, + // so the error can only be the hook's own verdict — apply it. + // On a mixed batch it is applied to nothing: hooks conventionally + // return next's error (`err := next(...); return err`), so after a + // partial failure the chain error is presumed to be that echo, and + // stamping it on the commands that DID succeed would overwrite + // valid replies with their batchmates' failure. Exec-recorded + // per-command outcomes always win over a post-next rewrap. + setCmdsErr(cmds, chainErr) + } + } + if len(queues) > 1 { + putQueueSlice(cmds) + } +} + +// dispatchCmdsMaybeChunked dispatches a drained batch, splitting it into +// byte-bounded chunks when MaxBatchBytes is configured: each chunk is its own +// pipeline write+read cycle, so a batch of many large values becomes several +// bounded bursts instead of one huge write that can stall a constrained link +// past its deadline. The commands' batches still complete only after ALL +// chunks executed (the caller's deferred closes), exactly like an unchunked +// dispatch — chunking bounds the wire bursts, it does not change completion +// semantics. Each chunk runs the full hook chain, like consecutive pipelines. +func (ap *AutoPipeliner) dispatchCmdsMaybeChunked(ctx context.Context, queues [][]Cmder, total int) { + limit := int64(ap.config.MaxBatchBytes) + if limit <= 0 { + ap.dispatchCmds(ctx, queues, total) + return + } + + // Merge (borrowed from dispatchCmds's multi-queue path) so chunk + // boundaries can cross stripe queues. + cmds := queues[0] + merged := false + if len(queues) > 1 { + cmds = getQueueSlice(total) + for i := range queues { + cmds = append(cmds, queues[i]...) + } + merged = true + } + + // Cut the byte-bounded chunks, then hand the ordered sequence to the shared + // dispatcher — which stops after a chunk dies on a transport-class failure, + // so later commands cannot overtake a failed prefix (see + // dispatchSequential; the retry-policy runs go through the same helper). + chunks := make([][]Cmder, 0, 4) + start := 0 + var chunkBytes int64 + for i, cmd := range cmds { + chunkBytes += cmdApproxBytes(cmd) + if chunkBytes >= limit && i+1 > start { + chunks = append(chunks, cmds[start:i+1]) + start = i + 1 + chunkBytes = 0 + } + } + if start < len(cmds) { + chunks = append(chunks, cmds[start:]) + } + ap.dispatchSequential(ctx, chunks) + if merged { + putQueueSlice(cmds) + } +} + +// dispatchSequential dispatches an ORDERED sequence of sub-batches, stopping +// once one of them dies on a transport-class failure and failing the rest with +// that error. +// +// The stop is the same contract the unchunked path has: it fails or retries the +// batch as a UNIT, so in an ordered stream later commands must never overtake a +// prefix that died (retries exhausted, hook abort). Per-command redis errors +// (WRONGTYPE, nil) are normal outcomes and do not stop the sequence. +// +// Both callers that break a batch into ordered pieces — the MaxBatchBytes +// chunker and the retry-policy runs — go through here, because the first +// version of each got this wrong independently (review findings by codex on +// #3942). +func (ap *AutoPipeliner) dispatchSequential(ctx context.Context, groups [][]Cmder) { + var abortErr error + for _, group := range groups { + if len(group) == 0 { + continue + } + if abortErr != nil { + setCmdsErr(group, abortErr) + continue + } + ap.dispatchCmds(ctx, [][]Cmder{group}, len(group)) + for _, cmd := range group { + if err := cmd.rawErr(); err != nil && !isRedisError(err) { + abortErr = err + break + } + } + } +} + +// splitRetryRuns slices cmds into maximal CONTIGUOUS runs of one retry policy, +// preserving order: run i's commands all precede run i+1's, exactly as +// submitted. It returns nil when the whole batch is already policy-uniform — +// the overwhelmingly common case — so uniform batches allocate nothing and are +// dispatched as one pipeline. +// +// Runs are sub-slices of cmds, not copies, so they must be dispatched before +// cmds is recycled and must not be returned to the slice pool individually. +func splitRetryRuns(cmds []Cmder) [][]Cmder { + if len(cmds) < 2 { + return nil + } + first := cmds[0].NoRetry() + boundary := -1 + for i := 1; i < len(cmds); i++ { + if cmds[i].NoRetry() != first { + boundary = i + break + } + } + if boundary < 0 { + return nil // uniform: one dispatch, no split + } + runs := make([][]Cmder, 0, 4) + start := 0 + policy := first + for i := 1; i < len(cmds); i++ { + if p := cmds[i].NoRetry(); p != policy { + runs = append(runs, cmds[start:i]) + start = i + policy = p + } + } + return append(runs, cmds[start:]) +} + +// recoverDispatchPanic converts a panic on a dispatch goroutine (a hook or +// command-encoder panic inside Process/Exec) into per-command errors instead +// of crashing the process. On a plain client the same panic unwinds into the +// CALLER, who can recover; the engine's dispatch goroutines have no caller, +// so an unrecovered panic here would kill the whole program on behalf of one +// bad command. Registered LAST at each dispatch site so it runs FIRST on +// unwind (LIFO) — the errors are stamped before the deferred batch closes +// wake the waiters. setCmdsErr fills only commands without an error, so +// exec-recorded outcomes for commands that finished are preserved. +func recoverDispatchPanic(cmds ...[]Cmder) { + r := recover() + if r == nil { + return + } + err := fmt.Errorf("redis: autopipeline: panic during dispatch: %v", r) + for _, batch := range cmds { + setCmdsErr(batch, err) + } + internal.Logger.Printf(context.Background(), "autopipeline: recovered dispatch panic: %v\n%s", r, debug.Stack()) +} + +// flushBatchSlice takes the shard's currently-queued commands as one batch, +// swaps in a fresh batch for subsequent enqueues, and dispatches the taken +// batch. Completion is signalled by closing the batch's done channel once +// (waking every waiter in a single operation) rather than one channel send +// per command. +func (s *apShard) flushBatchSlice() { + ap := s.ap + + // Drain every stripe into one combined batch and roll fresh queues for the + // commands enqueued after this point. Striped enqueue spreads the hot + // mutex; one merged flush keeps the pipeline deep. accumulateBatch already + // bounds the total to roughly MaxBatchSize before we get here. + queues := make([][]Cmder, 0, len(s.stripes)) + batches := make([]*apBatch, 0, len(s.stripes)) + total := 0 + for i := range s.stripes { + st := &s.stripes[i] + // Skip provably-empty stripes without taking their mutex. Safe in + // THIS path only: an enqueue publishes queueLen under the stripe lock + // and wakes the flusher after unlocking, so a command that appears + // concurrently with this unlocked read is re-observed by the + // flusher's Len() loop or the buffered notify — the same protocol the + // flusher already relies on. The shutdown drain must keep locking + // unconditionally (see flushBatchSliceShutdown). + if st.queueLen.Load() == 0 { + continue + } + st.mu.Lock() + if len(st.queue) > 0 { + queues = append(queues, st.queue) + batches = append(batches, st.curBatch) + total += len(st.queue) + st.queue = getQueueSlice(ap.config.MaxBatchSize) + st.curBatch = newAPBatch() + st.queueLen.Store(0) + st.queueBytes.Store(0) + } + st.mu.Unlock() + } + if total == 0 { + return + } + + // Acquire a concurrency permit. The wait runs on a background context with + // a generous backstop deadline against a wedged semaphore: commands taken + // from the queue were already ACCEPTED, so a concurrent Close must not + // cancel them mid-acquire — Close's contract is to flush pending commands + // (it waits for this dispatch via wg/batchWg before tearing anything + // down). The backstop is deliberately well above both the default + // ReadTimeout and a maintnotifications relaxed window, so a legitimately + // slow batch (e.g. during a failover) holding a permit does not cause + // waiters to spuriously fail. + if !s.sem.TryAcquire() { + err := s.sem.Acquire(context.Background(), autoPipelinePermitBackstop, ErrAutoPipelineTimeout) + if err != nil { + // A permit not freeing within the backstop means the in-flight + // batch is wedged well past any configured timeout — leave an + // operator breadcrumb before failing the drained commands. + internal.Logger.Printf(context.Background(), + "redis: autopipeline: no batch permit after %s; failing %d queued commands", + autoPipelinePermitBackstop, total) + batchErr := err + for i := range queues { + for _, qc := range queues[i] { + qc.SetErr(batchErr) + } + batches[i].close() + putQueueSlice(queues[i]) + } + return + } + + // Wave merge. We took the queue and then waited a full batch round + // trip for the permit; callers whose replies landed just after our + // take re-submitted into the FRESH queue during that wait. Executing + // without them splits the group into two alternating waves — each + // observing two round trips, at half throughput — a state that is + // stable once entered (measured: p50 pinned at 2xRTT for entire runs + // at mid worker counts on a 52ms link). On the default window, let the + // wave of follow-ups land and fold it into this batch before + // executing, which merges the waves back into one batch per round + // trip. Explicit-delay configs keep their own timing. + if ap.config.MaxFlushDelay == 0 && !ap.config.AdaptiveDelay { + s.awaitExpectedArrivals(ap.config.MaxBatchSize) + for i := range s.stripes { + st := &s.stripes[i] + if st.queueLen.Load() == 0 { + continue + } + st.mu.Lock() + if len(st.queue) > 0 { + queues = append(queues, st.queue) + batches = append(batches, st.curBatch) + total += len(st.queue) + st.queue = getQueueSlice(ap.config.MaxBatchSize) + st.curBatch = newAPBatch() + st.queueLen.Store(0) + st.queueBytes.Store(0) + } + st.mu.Unlock() + } + } + } + + // Fast path for single command: skip the pipeline and Process directly, in + // its own goroutine. The dispatch MUST NOT run inline in the flusher: a + // synchronous Process blocks the flusher for a full round trip, and on a + // slow link a solo straggler then holds up an entire landed wave for one + // RTT — whose flush then delays the straggler's next command in turn, a + // stable phase-lock where everyone pays 2x RTT (measured: ~25% of runs on + // a 57ms link locked at exactly 2x RTT until perturbed). + // No expectedArrivals announcement: a single waiter waking is the + // lone-caller case, which must keep flushing immediately. + if total == 1 { + ap.batchWg.Add(1) + s.inFlight.Add(1) + go func() { + // Defer order matters: the batch close is registered BEFORE the + // permit release and inFlight decrement so it runs AFTER them + // (LIFO) — a woken lone caller's next command then observes an + // idle shard and takes the immediate-flush path instead of + // arming the silence-gap wait. + defer ap.batchWg.Done() + defer batches[0].close() + defer s.inFlight.Add(-1) + defer s.sem.Release() + defer putQueueSlice(queues[0]) + defer recoverDispatchPanic(queues[0]) + // Background for the same reason as the batch goroutine below: + // accepted commands execute even under a concurrent Close. + execStart := time.Now() + b := batches[0] + if !ap.blocking && ap.armSelfDeadlockGuard() { + b.dispGid.Store(curGoroutineID()) + } + solo := queues[0][0] + // Both faces run the user-hook chain via withProcessHook. The + // command records the CHAIN's final verdict — exactly what + // Client.Process does — before the deferred close wakes the + // waiter, so a hook that short-circuits, rewrites, or suppresses + // the error is honored. Hooks on this goroutine read the command + // deadlock-free via the dispGid guard stamped above. + // A successful short-circuit stays successful (see dispatchCmds). + err := ap.pipeliner.withProcessHook(context.Background(), solo, func(ctx context.Context, cmd Cmder) error { + return ap.pipeliner.process(ctx, cmd) + }) + solo.SetErr(err) + ap.observeBatchExec(time.Since(execStart)) + }() + return + } + + // Track this goroutine in the batchWg so Close() waits for it. + // IMPORTANT: Add to WaitGroup AFTER semaphore is acquired to avoid deadlock. + ap.batchWg.Add(1) + s.inFlight.Add(1) + go func() { + defer ap.batchWg.Done() + defer s.inFlight.Add(-1) + defer s.sem.Release() + // Signal completion with one close per taken stripe. Deferred so a + // panic in Process/Exec (e.g. a malformed command or encoder panic) + // still wakes every waiter in await() instead of hanging them forever; + // the closes run after Exec on the happy path, so results are + // populated first. + defer func() { + for i := range queues { + batches[i].close() + putQueueSlice(queues[i]) + } + }() + defer recoverDispatchPanic(queues...) + + // Execute on a background context: these commands were accepted before + // any concurrent Close, and Close waits for this goroutine (batchWg) + // before the client tears down its pools — cancelling here would + // error already-accepted commands while the shutdown sweep flushes + // later ones, an inverted outcome. The wire timeouts (Read/Write + // Timeout, or maintnotifications relaxed windows) still bound the + // execution; no per-batch timer is allocated. + ctx := context.Background() + + // The batches complete at the deferred closes, AFTER the whole hook + // chain has returned — so a hook's post-next verdict is honored and, + // like a plain pipeline, a hook may adjust results before any waiter + // wakes. Hooks on this goroutine read results deadlock-free via the + // dispGid guard in await() (armed below when hooks can exist). + if !ap.blocking && ap.armSelfDeadlockGuard() { + gid := curGoroutineID() + for i := range batches { + batches[i].dispGid.Store(gid) + } + } + + execStart := time.Now() + ap.dispatchCmdsMaybeChunked(ctx, queues, total) + ap.observeBatchExec(time.Since(execStart)) + + // Announce the expected arrivals BEFORE the deferred closes wake this + // batch's waiters, so the flusher knows the wave size the moment its + // first command lands (see expectedArrivals). + ap.expectedArrivals.Add(int64(total)) + }() +} + +// flushBatchSliceShutdown flushes commands during shutdown. +// Unlike flushBatchSlice, this doesn't use ap.ctx for semaphore acquisition +// because ap.ctx is already cancelled during shutdown. +// Executes synchronously to preserve command order. +func (s *apShard) flushBatchSliceShutdown() { + ap := s.ap + // Flush all remaining commands synchronously to preserve order. + // + // The loop condition is checked UNDER each stripe's lock (not via the + // unlocked s.Len()): a late enqueue appends to a stripe's queue and updates + // its queueLen under that stripe's mutex, so reading queueLen without the + // lock could miss a command that was just appended (seeing 0 and exiting + // while a command sits in the queue). Locking first makes "is the stripe + // empty?" and "take the stripe" atomic against that enqueue — this is what + // closes the lost-command race on Close. + for { + // Take every stripe's queue as one merged batch and roll fresh queues. + queues := make([][]Cmder, 0, len(s.stripes)) + batches := make([]*apBatch, 0, len(s.stripes)) + total := 0 + for i := range s.stripes { + st := &s.stripes[i] + st.mu.Lock() + if len(st.queue) > 0 { + queues = append(queues, st.queue) + batches = append(batches, st.curBatch) + total += len(st.queue) + st.queue = getQueueSlice(ap.config.MaxBatchSize) + st.curBatch = newAPBatch() + st.queueLen.Store(0) + st.queueBytes.Store(0) + } + st.mu.Unlock() + } + if total == 0 { + return + } + + // Serialize with any still-running in-flight batch: the shutdown drain + // used to bypass the per-shard permit, so under MaxConcurrentBatches:1 + // a drained command could execute CONCURRENTLY with the in-flight + // batch during Close and be observed out of order. Acquire the permit + // (bounded by the backstop, on a background context — ap.ctx is + // already cancelled here); if the backstop expires the permit holder + // is wedged and we proceed anyway rather than strand the commands. + acquired := s.sem.TryAcquire() + if !acquired { + acquired = s.sem.Acquire(context.Background(), autoPipelinePermitBackstop, ErrAutoPipelineTimeout) == nil + if !acquired { + internal.Logger.Printf(context.Background(), + "redis: autopipeline: no batch permit after %s during shutdown; flushing unserialized", + autoPipelinePermitBackstop) + } + } + + // Execute each batch in a func so close(batch.done) is deferred: a panic + // in Process/Exec still signals completion (waking await()) before it + // propagates, instead of leaving shutdown waiters hung. + func() { + if acquired { + defer s.sem.Release() + } + defer func() { + for i := range queues { + batches[i].close() + putQueueSlice(queues[i]) + } + }() + defer recoverDispatchPanic(queues...) + + // ap.ctx is already cancelled here (Close cancels it before draining), + // so use a fresh background context with no artificial deadline. The + // wire timeout is then governed by the connection's ReadTimeout / + // WriteTimeout — exactly like the normal flush path and a plain client + // Exec. Crucially this lets a relaxed timeout (set by maintnotifications + // during a failover/migration) take effect; a hardcoded short deadline + // here would cap that relaxed window and time out in-flight commands the + // relaxation was meant to protect. (A user who wants shutdown bounded + // sets ReadTimeout/WriteTimeout on the client, as for any command.) + if !ap.blocking && ap.armSelfDeadlockGuard() { + gid := curGoroutineID() + for i := range batches { + batches[i].dispGid.Store(gid) + } + } + ap.dispatchCmdsMaybeChunked(context.Background(), queues, total) + }() + } +} + +// Len returns the number of queued commands in this shard. +func (s *apShard) Len() int { + n := 0 + for i := range s.stripes { + n += int(s.stripes[i].queueLen.Load()) + } + return n +} + +// bytesFull reports whether the shard's queued payload volume has reached the +// configured MaxBatchBytes (false when the cap is disabled). Like the +// MaxBatchSize trigger it is soft: enqueues racing the check can overshoot. +func (s *apShard) bytesFull() bool { + limit := int64(s.ap.config.MaxBatchBytes) + if limit <= 0 { + return false + } + var n int64 + for i := range s.stripes { + n += s.stripes[i].queueBytes.Load() + if n >= limit { + return true + } + } + return false +} + +// cmdApproxBytes estimates a command's wire payload for MaxBatchBytes +// accounting: string/[]byte argument lengths plus a small fixed overhead per +// argument (type marker, length line, CRLFs). Exactness doesn't matter — the +// cap bounds burst size, it is not a protocol calculation. +func cmdApproxBytes(cmd Cmder) int64 { + const perArgOverhead = 16 + n := int64(0) + for _, a := range cmd.Args() { + switch v := a.(type) { + case string: + n += int64(len(v)) + case []byte: + n += int64(len(v)) + default: + n += 8 + } + n += perArgOverhead + } + return n +} + +// Len returns the current number of queued commands across all shards. +func (ap *AutoPipeliner) Len() int { + total := 0 + for _, s := range ap.shards { + total += s.Len() + } + return total +} + +// calculateDelay calculates the delay based on the given queue length (the +// caller's own shard, not the global total, so each shard tunes independently). +// Uses integer-only arithmetic for optimal performance (no float operations). +// Returns 0 if MaxFlushDelay is 0. +func (ap *AutoPipeliner) calculateDelay(queueLen int) time.Duration { + maxDelay := ap.config.MaxFlushDelay + if maxDelay == 0 { + return 0 + } + + // If adaptive delay is disabled, return fixed delay + if !ap.config.AdaptiveDelay { + return maxDelay + } + + if queueLen == 0 { + return 0 + } + + maxBatch := ap.config.MaxBatchSize + + // Use integer arithmetic to avoid float operations + // Calculate thresholds: 75%, 50%, 25% of maxBatch + // Multiply by 4 to avoid division: queueLen * 4 vs maxBatch * 3 (75%) + // + // Adaptive delay strategy: + // - ≥75% full: No delay (flush immediately to prevent overflow) + // - ≥50% full: 25% of max delay (queue filling up) + // - ≥25% full: 50% of max delay (moderate load) + // - <25% full: 100% of max delay (low load, maximize batching) + switch { + case queueLen*4 >= maxBatch*3: // queueLen >= 75% of maxBatch + return 0 // Flush immediately + case queueLen*2 >= maxBatch: // queueLen >= 50% of maxBatch + return maxDelay >> 2 // Divide by 4 using bit shift (faster) + case queueLen*4 >= maxBatch: // queueLen >= 25% of maxBatch + return maxDelay >> 1 // Divide by 2 using bit shift (faster) + default: + return maxDelay + } +} + +// Pipeline returns a new pipeline that uses the underlying pipeliner. +// This allows you to create a traditional pipeline from an autopipeliner. +func (ap *AutoPipeliner) Pipeline() Pipeliner { + return ap.pipeliner.Pipeline() +} + +// Pipelined executes a function in a pipeline context. +// This is a convenience method that creates a pipeline, executes the function, +// and returns the results. +func (ap *AutoPipeliner) Pipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error) { + return ap.pipeliner.Pipeline().Pipelined(ctx, fn) +} + +// TxPipelined executes a function in a transaction pipeline context. +// This is a convenience method that creates a transaction pipeline, executes the function, +// and returns the results. It delegates to the underlying client's TxPipeline. +func (ap *AutoPipeliner) TxPipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error) { + return ap.pipeliner.TxPipeline().Pipelined(ctx, fn) +} + +// TxPipeline returns a new transaction pipeline that uses the underlying pipeliner. +// This allows you to create a traditional transaction pipeline from an autopipeliner. +// It delegates to the underlying client's TxPipeline. +func (ap *AutoPipeliner) TxPipeline() Pipeliner { + return ap.pipeliner.TxPipeline() +} + +// validate AutoPipeliner implements Cmdable +var _ Cmdable = (*AutoPipeliner)(nil) diff --git a/vendor/github.com/redis/go-redis/v9/autopipeline_bench_README.md b/vendor/github.com/redis/go-redis/v9/autopipeline_bench_README.md new file mode 100644 index 000000000..40febdf93 --- /dev/null +++ b/vendor/github.com/redis/go-redis/v9/autopipeline_bench_README.md @@ -0,0 +1,128 @@ +# Autopipelining benchmarks + +These benchmarks validate the goal of autopipelining: batching concurrent +commands into pipelines cuts network round-trips and raises throughput, without +callers writing pipeline code. + +Two measurement rules keep every number honest: + +- **Throughput is measured on executed commands** — a command is counted only + after its result has been read (`.Result()` / `.Err()`), never when it is + merely queued. On the deferred face `ap.Set` returns immediately, so counting + calls would measure enqueue speed, not throughput. +- **Rates divide by the timed region, not the nominal window.** The + fixed-duration drivers keep draining whatever was in flight when the deadline + hit; that drain is part of the timed region, so `ops/sec` cannot be inflated + by work that finished after the window closed. + +## Running + +The benchmarks talk to a real Redis on `:6379` (they skip when none answers). +Start one first: + +```sh +make docker.start # or: docker run --rm -p 6379:6379 redis + +# the headline three-way throughput comparison: +go test -run '^$' -bench BenchmarkAutoPipelineThroughput -benchtime=1x . + +# everything: +go test -run '^$' -bench Benchmark -benchmem -benchtime=1x . +``` + +The throughput benchmarks run for a fixed wall-clock duration (~3s each) and +report `ops/sec`, so `-benchtime=1x` (one iteration) is correct for them. +**Do not pass a time-based `-benchtime`** (e.g. `-benchtime=5s`): the +fixed-duration drivers ignore `b.N`, so Go's framework would re-run the full +window geometrically trying to fill the time budget. + +The per-operation benchmarks (`BenchmarkDispatchPath`, +`BenchmarkAutoPipelineZeroCopy`) are the opposite: their ns/op and allocs/op +are only meaningful at the **default** `-benchtime` — at `-benchtime=1x` the +workers still issue a minimum window each, all billed to a single iteration. +(The "everything" command above also sweeps the repo's other root-package +benchmarks; that is harmless, just broader than this file.) + +## The headline benchmark: BenchmarkAutoPipelineThroughput + +Three ways to issue the same workload (2000 goroutines), each counting only +executed commands: + +1. **Normal** — a plain client; each `Set` is a blocking round-trip. Bounded by + Redis's non-pipelined ceiling (like `redis-benchmark` without `-P`). +2. **AutoPipelineBlocking** — the blocking face with a parallel-batch config: + `ap.Set(...)` blocks until executed, the same call shape as a normal client. + Only one command per caller is in flight, but the flusher batches across the + 2000 callers into deep pipelines. +3. **AutoPipelineWindowed** — the deferred face: each caller submits a window of + 200 commands, then reads the results. Keeps pipelines deepest. + +The `WindowedGET` variant repeats (3) with GET instead of SET: SET throughput is +server-bound (Redis's write processing), GET is cheaper on the server, so the +GET number shows the client machinery itself is not the limit. + +**Absolute numbers are machine- and load-dependent and vary a lot** — CPU +count, Redis's own ceiling, network path (loopback vs docker veth vs real +network), and noisy neighbors all move them by integer factors. The signal is +the WITHIN-RUN multiplier against the `Normal` baseline measured in the same +environment, plus `allocs/op` (which is exact and stable everywhere): + +| variant | vs Normal (same run) | +| ----------------------- | ---------------------- | +| Normal | 1x (the baseline) | +| AutoPipelineBlocking | ~10x | +| AutoPipelineWindowed | ~25-30x | +| AutoPipelineWindowedGET | above Windowed (reads) | + +As one concrete example: an Apple Silicon laptop with a loopback Redis puts +`Normal` around 80k ops/sec (so ~800k blocking, ~2.5M windowed); a 4-vCPU CI +runner with dockerized Redis lands near half that on the CPU-bound variants — +different absolutes, same multipliers and ordering. + +The autopipeline variants use an explicit parallel-batch config +(`MaxBatchSize: 300, MaxConcurrentBatches: 80, Unordered: true`) — **not the +ordered default**. The default (`MaxConcurrentBatches: 1`, +`DefaultAutoPipelineOptions` / `DefaultBlockingAutoPipelineOptions`) serializes +batch execution: blocking usage lands at roughly half the parallel-batch +multiplier, while windowed submission stays well into the tens-of-x even +ordered. + +## The other benchmarks + +- **BenchmarkIndividualCommands** — plain-client baseline: one blocking + round-trip per command across GOMAXPROCS workers. Its ns/op is your + environment's RTT floor; every other number is best read against it. +- **BenchmarkManualPipeline** — hand-built 100-deep `Pipeline().Exec()`, + sequential: the per-command cost of explicit pipelining (roughly a tenth + of a round-trip per command). The ceiling autopipelining approaches + without anyone writing pipeline code. +- **BenchmarkDispatchPath** — the engine's per-command dispatch cost with + honest `b.N` accounting: ns/op and allocs/op per executed command + (4 allocs/cmd on the submit path; unordered dispatch roughly halves the + ordered ns/op), plus the lone-command blocking fast path (~1 RTT). +- **BenchmarkFutureFace** — the typed future face on the ordered default + config: per-command reads (`InOrder`) vs windowed reads (`Window200`, + roughly 2x InOrder). +- **BenchmarkAutoPipelineSubmit** — the non-blocking `Submit` entry point, + windowed, on the ordered default; lands in the same band as + `FutureFace/Window200`. +- **BenchmarkAutoPipelineZeroCopy** — `GetToBuffer`/`SetFromBuffer` vs regular + `Get`/`Set` (Set+Get pairs): B/op drops ~10x at 4KiB and ~90x at 64KiB + (payloads decode into the caller's buffer instead of fresh strings), with + throughput at parity or better; allocs/op 10 vs 11. The B/op and allocs/op + ratios are environment-independent. +- **BenchmarkClusterAutoPipelineThroughput** — the same blocking/windowed + drivers against a local 3-master cluster (slot-routed shard batches keep + per-node pipelines deep; scales past the standalone numbers in the same + environment, with a wide run-order-dependent spread). Skips when no + cluster answers on `:16600-16602`. + +## What was deliberately removed + +Earlier revisions carried "tuning sweep" benchmarks (batch sizes, flush +delays, buffer sizes) whose numbers were dominated by the configured +`MaxFlushDelay` timer at low parallelism — every swept value reported the same +timer readout, which could only mislead someone tuning from them. They were +removed rather than fixed: `BenchmarkDispatchPath` and the throughput drivers +cover the engine's real knobs. Tune with your own workload shape; the engine's +defaults need no tuning to hit the numbers above. diff --git a/vendor/github.com/redis/go-redis/v9/command.go b/vendor/github.com/redis/go-redis/v9/command.go index ae0158b3a..f0575c0e3 100644 --- a/vendor/github.com/redis/go-redis/v9/command.go +++ b/vendor/github.com/redis/go-redis/v9/command.go @@ -11,6 +11,7 @@ import ( "strconv" "strings" "sync" + "sync/atomic" "time" "github.com/redis/go-redis/v9/internal" @@ -155,6 +156,7 @@ const ( CmdTypeFTSearch CmdTypeTSTimestampValue CmdTypeTSTimestampValueSlice + CmdTypeTSNRangePivotRowSlice CmdTypeHotKeys CmdTypeIncrEXInt CmdTypeIncrEXFloat @@ -222,12 +224,24 @@ type Cmder interface { stepCount() int8 SetStepCount(int8) + // cachedSlot/setCachedSlot memoize the cluster slot so it is computed once + // (in the autopipeline shard router) and reused at pipeline-flush routing. + cachedSlot() (int, bool) + setCachedSlot(int) + readTimeout() *time.Duration readReply(rd *proto.Reader) error readRawReply(rd *proto.Reader) error SetErr(error) Err() error + // setReady marks a command as asynchronously pending (autopipeline async + // faces); await blocks the public accessors until it has executed; rawErr + // reads the error without awaiting (internal execution path). + setReady(*apBatch) + await() + rawErr() error + // NoRetry returns true if the command should not be retried on failure. // Commands that write directly to an io.Writer should return true since // partial writes cannot be undone on retry. @@ -239,7 +253,8 @@ type Cmder interface { func setCmdsErr(cmds []Cmder, e error) { for _, cmd := range cmds { - if cmd.Err() == nil { + // rawErr: this runs on the execution path; never await here. + if cmd.rawErr() == nil { cmd.SetErr(e) } } @@ -247,7 +262,8 @@ func setCmdsErr(cmds []Cmder, e error) { func cmdsFirstErr(cmds []Cmder) error { for _, cmd := range cmds { - if err := cmd.Err(); err != nil { + // rawErr: this runs on the execution path; never await here. + if err := cmd.rawErr(); err != nil { return err } } @@ -294,6 +310,14 @@ func cmdFirstKeyPosWithInfo(cmd Cmder, info *CommandInfo) int { return 0 } + // Module commands registered keyless in the static policy table (e.g. + // ft.aliaslist) route as keyless even while the command-info cache is + // cold, so the first calls of a process don't hash a non-key argument + // (such as an index name) into a slot. + if defaultPolicyKeyless(name) { + return 0 + } + switch name { case "eval", "evalsha", "eval_ro", "evalsha_ro": if cmd.stringArg(2) != "0" { @@ -328,7 +352,7 @@ func cmdString(cmd Cmder, val interface{}) string { b = internal.AppendArg(b, arg) } - if err := cmd.Err(); err != nil { + if err := cmd.rawErr(); err != nil { b = append(b, ": "...) b = append(b, err.Error()...) } else if val != nil { @@ -350,6 +374,90 @@ type baseCmd struct { rawVal interface{} _readTimeout *time.Duration cmdType CmdType + // slotCache memoizes the cluster slot once computed, so the cluster + // autopipeline shard router and the pipeline flush router don't each + // recompute it. 0 = not computed; it stores slot+1 so a real slot of 0 is + // distinguishable from unset. A plain field is safe by construction: it + // is written at most once, on the submitting goroutine BEFORE the command + // is published to a stripe queue (the stripe mutex is the happens-before + // edge to the flusher that later reads it). Do not write it from any + // other point in the command's life. + slotCache uint16 + + // ready, when non-nil, is the batch whose done channel closes once the + // command has executed. It is set only by the deferred (async) + // autopipeliner, which hands the command back to the caller before it + // runs. The public result accessors (Err/Val/Result/String) call await + // so they transparently block until execution; internal execution-path + // reads use rawErr to avoid awaiting the very batch they are producing + // (formatting included: cmdString reads rawErr and receives the value + // snapshot from its caller, so String methods await BEFORE reading their + // val field — otherwise formatting an in-flight async command would race + // with reply processing). ready stays + // nil for ordinary synchronous commands, whose accessors never block. + ready atomic.Pointer[apBatch] +} + +// setReady publishes the batch gating this command's result accessors. The +// field is atomic, NOT lock-ordered with the enqueue: a dispatch-side hook +// racing this store simply reads nil and takes the non-blocking path — the +// correct "not executed yet" view — while the setting goroutine always sees +// its own store before it awaits. +func (cmd *baseCmd) setReady(b *apBatch) { cmd.ready.Store(b) } + +// await blocks until an asynchronously-submitted command has executed. It is a +// single nil-pointer load for synchronous commands, so the common path stays +// allocation- and contention-free. +func (cmd *baseCmd) await() { + b := cmd.ready.Load() + if b == nil { + return + } + select { + case <-b.done: + return + default: + } + if b.isExecutorGoroutine() { + // A hook on one of the batch's own executor goroutines (the + // dispatcher, or a cluster per-node executor) is reading this + // command's result BEFORE next() has executed it. Blocking would + // self-deadlock (the batch completes only after that goroutine + // returns); return the not-yet-executed state instead — the same + // view a plain pipeline hook has before next(). + return + } + <-b.done +} + +// rawErr returns the command error WITHOUT awaiting. The internal +// execution/serialization path (setCmdsErr, cmdsFirstErr, and the cmdString +// formatter — public String methods await before calling it) uses it so that +// reading errors while a batch is being executed does not deadlock on the +// batch's own completion signal. +func (cmd *baseCmd) rawErr() error { return cmd.err } + +// readyBatch exposes the deferred-face batch gating this command (nil for +// synchronous commands) to the cluster fan-out, which registers its per-node +// goroutines as executors of every batch they carry. +func (cmd *baseCmd) readyBatch() *apBatch { return cmd.ready.Load() } + +// resultReady reports whether the command's result can be read WITHOUT +// blocking: either it never rode the deferred autopipeline face (no gating +// batch) or that batch has already completed. Post-execution bookkeeping in +// the command wrappers — the OTel metric emissions — consults it so that +// enabling telemetry cannot turn a deferred submission into a blocking call. +func (cmd *baseCmd) resultReady() bool { + b := cmd.ready.Load() + if b == nil { + return true + } + select { + case <-b.done: + return true + default: + return false + } } var _ Cmder = (*Cmd)(nil) @@ -389,6 +497,11 @@ func (cmd *baseCmd) stringArg(pos int) string { switch v := arg.(type) { case string: return v + case *string: + if v == nil { + return "" + } + return *v case []byte: return string(v) default: @@ -405,6 +518,21 @@ func (cmd *baseCmd) SetFirstKeyPos(keyPos int8) { cmd.keyPos = keyPos } +// cachedSlot returns the cached cluster slot and whether one was set. +func (cmd *baseCmd) cachedSlot() (int, bool) { + if cmd.slotCache == 0 { + return 0, false + } + return int(cmd.slotCache - 1), true +} + +// setCachedSlot stores the computed cluster slot (0..16383) for reuse. +func (cmd *baseCmd) setCachedSlot(slot int) { + if slot >= 0 && slot < 16384 { + cmd.slotCache = uint16(slot + 1) + } +} + func (cmd *baseCmd) stepCount() int8 { return cmd._stepCount } @@ -418,6 +546,7 @@ func (cmd *baseCmd) SetErr(e error) { } func (cmd *baseCmd) Err() error { + cmd.await() return cmd.err } @@ -488,6 +617,7 @@ func NewCmd(ctx context.Context, args ...interface{}) *Cmd { } func (cmd *Cmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -496,14 +626,17 @@ func (cmd *Cmd) SetVal(val interface{}) { } func (cmd *Cmd) Val() interface{} { + cmd.await() return cmd.val } func (cmd *Cmd) Result() (interface{}, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *Cmd) Text() (string, error) { + cmd.await() if cmd.err != nil { return "", cmd.err } @@ -521,6 +654,7 @@ func toString(val interface{}) (string, error) { } func (cmd *Cmd) Int() (int, error) { + cmd.await() if cmd.err != nil { return 0, cmd.err } @@ -536,6 +670,7 @@ func (cmd *Cmd) Int() (int, error) { } func (cmd *Cmd) Int64() (int64, error) { + cmd.await() if cmd.err != nil { return 0, cmd.err } @@ -555,6 +690,7 @@ func toInt64(val interface{}) (int64, error) { } func (cmd *Cmd) Uint64() (uint64, error) { + cmd.await() if cmd.err != nil { return 0, cmd.err } @@ -574,6 +710,7 @@ func toUint64(val interface{}) (uint64, error) { } func (cmd *Cmd) Float32() (float32, error) { + cmd.await() if cmd.err != nil { return 0, cmd.err } @@ -597,6 +734,7 @@ func toFloat32(val interface{}) (float32, error) { } func (cmd *Cmd) Float64() (float64, error) { + cmd.await() if cmd.err != nil { return 0, cmd.err } @@ -616,6 +754,7 @@ func toFloat64(val interface{}) (float64, error) { } func (cmd *Cmd) Bool() (bool, error) { + cmd.await() if cmd.err != nil { return false, cmd.err } @@ -637,6 +776,7 @@ func toBool(val interface{}) (bool, error) { } func (cmd *Cmd) Slice() ([]interface{}, error) { + cmd.await() if cmd.err != nil { return nil, cmd.err } @@ -787,18 +927,22 @@ func (cmd *RawCmd) SetVal(val []byte) { } func (cmd *RawCmd) Val() []byte { + cmd.await() return cmd.val } func (cmd *RawCmd) Result() ([]byte, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *RawCmd) Bytes() ([]byte, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *RawCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -846,14 +990,17 @@ func (cmd *RawWriteToCmd) SetVal(written int64) { } func (cmd *RawWriteToCmd) Val() int64 { + cmd.await() return cmd.written } func (cmd *RawWriteToCmd) Result() (int64, error) { + cmd.await() return cmd.written, cmd.err } func (cmd *RawWriteToCmd) String() string { + cmd.await() return cmdString(cmd, cmd.written) } @@ -914,20 +1061,24 @@ func (cmd *ZeroCopyStringCmd) SetVal(n int) { } func (cmd *ZeroCopyStringCmd) Val() int { + cmd.await() return cmd.n } // Result returns the number of bytes read and any error. func (cmd *ZeroCopyStringCmd) Result() (int, error) { + cmd.await() return cmd.n, cmd.err } // Bytes returns the slice of the user-provided buffer containing the read data. func (cmd *ZeroCopyStringCmd) Bytes() []byte { + cmd.await() return cmd.buf[:cmd.n] } func (cmd *ZeroCopyStringCmd) String() string { + cmd.await() return cmdString(cmd, cmd.n) } @@ -1012,20 +1163,24 @@ func (cmd *SliceCmd) SetVal(val []interface{}) { } func (cmd *SliceCmd) Val() []interface{} { + cmd.await() return cmd.val } func (cmd *SliceCmd) Result() ([]interface{}, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *SliceCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } // Scan scans the results from the map into a destination struct. The map keys // are matched in the Redis struct fields by the `redis:"field"` tag. func (cmd *SliceCmd) Scan(dst interface{}) error { + cmd.await() if cmd.err != nil { return cmd.err } @@ -1085,18 +1240,22 @@ func (cmd *StatusCmd) SetVal(val string) { } func (cmd *StatusCmd) Val() string { + cmd.await() return cmd.val } func (cmd *StatusCmd) Result() (string, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *StatusCmd) Bytes() ([]byte, error) { + cmd.await() return util.StringToBytes(cmd.val), cmd.err } func (cmd *StatusCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -1137,18 +1296,22 @@ func (cmd *IntCmd) SetVal(val int64) { } func (cmd *IntCmd) Val() int64 { + cmd.await() return cmd.val } func (cmd *IntCmd) Result() (int64, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *IntCmd) Uint64() (uint64, error) { + cmd.await() return uint64(cmd.val), cmd.err } func (cmd *IntCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -1187,14 +1350,17 @@ func (cmd *UintCmd) SetVal(val uint64) { } func (cmd *UintCmd) Val() uint64 { + cmd.await() return cmd.val } func (cmd *UintCmd) Result() (uint64, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *UintCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -1247,14 +1413,17 @@ func (cmd *DigestCmd) SetVal(val uint64) { } func (cmd *DigestCmd) Val() uint64 { + cmd.await() return cmd.val } func (cmd *DigestCmd) Result() (uint64, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *DigestCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -1304,14 +1473,17 @@ func (cmd *IntSliceCmd) SetVal(val []int64) { } func (cmd *IntSliceCmd) Val() []int64 { + cmd.await() return cmd.val } func (cmd *IntSliceCmd) Result() ([]int64, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *IntSliceCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -1322,8 +1494,13 @@ func (cmd *IntSliceCmd) readReply(rd *proto.Reader) error { } cmd.val = make([]int64, n) for i := 0; i < len(cmd.val); i++ { - if cmd.val[i], err = rd.ReadInt(); err != nil { + switch num, err := rd.ReadInt(); { + case err == Nil: + cmd.val[i] = 0 + case err != nil: return err + default: + cmd.val[i] = num } } return nil @@ -1364,14 +1541,17 @@ func (cmd *UintSliceCmd) SetVal(val []uint64) { } func (cmd *UintSliceCmd) Val() []uint64 { + cmd.await() return cmd.val } func (cmd *UintSliceCmd) Result() ([]uint64, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *UintSliceCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -1382,8 +1562,13 @@ func (cmd *UintSliceCmd) readReply(rd *proto.Reader) error { } cmd.val = make([]uint64, n) for i := range cmd.val { - if cmd.val[i], err = rd.ReadUint(); err != nil { + switch num, err := rd.ReadUint(); { + case err == Nil: + cmd.val[i] = 0 + case err != nil: return err + default: + cmd.val[i] = num } } return nil @@ -1428,14 +1613,17 @@ func (cmd *DurationCmd) SetVal(val time.Duration) { } func (cmd *DurationCmd) Val() time.Duration { + cmd.await() return cmd.val } func (cmd *DurationCmd) Result() (time.Duration, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *DurationCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -1488,14 +1676,17 @@ func (cmd *TimeCmd) SetVal(val time.Time) { } func (cmd *TimeCmd) Val() time.Time { + cmd.await() return cmd.val } func (cmd *TimeCmd) Result() (time.Time, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *TimeCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -1547,14 +1738,17 @@ func (cmd *BoolCmd) SetVal(val bool) { } func (cmd *BoolCmd) Val() bool { + cmd.await() return cmd.val } func (cmd *BoolCmd) Result() (bool, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *BoolCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -1602,18 +1796,22 @@ func (cmd *StringCmd) SetVal(val string) { } func (cmd *StringCmd) Val() string { + cmd.await() return cmd.val } func (cmd *StringCmd) Result() (string, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *StringCmd) Bytes() ([]byte, error) { + cmd.await() return util.StringToBytes(cmd.val), cmd.err } func (cmd *StringCmd) Bool() (bool, error) { + cmd.await() if cmd.err != nil { return false, cmd.err } @@ -1621,6 +1819,7 @@ func (cmd *StringCmd) Bool() (bool, error) { } func (cmd *StringCmd) Int() (int, error) { + cmd.await() if cmd.err != nil { return 0, cmd.err } @@ -1628,6 +1827,7 @@ func (cmd *StringCmd) Int() (int, error) { } func (cmd *StringCmd) Int64() (int64, error) { + cmd.await() if cmd.err != nil { return 0, cmd.err } @@ -1635,6 +1835,7 @@ func (cmd *StringCmd) Int64() (int64, error) { } func (cmd *StringCmd) Uint64() (uint64, error) { + cmd.await() if cmd.err != nil { return 0, cmd.err } @@ -1642,6 +1843,7 @@ func (cmd *StringCmd) Uint64() (uint64, error) { } func (cmd *StringCmd) Float32() (float32, error) { + cmd.await() if cmd.err != nil { return 0, cmd.err } @@ -1653,6 +1855,7 @@ func (cmd *StringCmd) Float32() (float32, error) { } func (cmd *StringCmd) Float64() (float64, error) { + cmd.await() if cmd.err != nil { return 0, cmd.err } @@ -1660,6 +1863,7 @@ func (cmd *StringCmd) Float64() (float64, error) { } func (cmd *StringCmd) Time() (time.Time, error) { + cmd.await() if cmd.err != nil { return time.Time{}, cmd.err } @@ -1667,6 +1871,7 @@ func (cmd *StringCmd) Time() (time.Time, error) { } func (cmd *StringCmd) Scan(val interface{}) error { + cmd.await() if cmd.err != nil { return cmd.err } @@ -1674,6 +1879,7 @@ func (cmd *StringCmd) Scan(val interface{}) error { } func (cmd *StringCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -1714,14 +1920,17 @@ func (cmd *FloatCmd) SetVal(val float64) { } func (cmd *FloatCmd) Val() float64 { + cmd.await() return cmd.val } func (cmd *FloatCmd) Result() (float64, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *FloatCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -1762,14 +1971,17 @@ func (cmd *FloatSliceCmd) SetVal(val []float64) { } func (cmd *FloatSliceCmd) Val() []float64 { + cmd.await() return cmd.val } func (cmd *FloatSliceCmd) Result() ([]float64, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *FloatSliceCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -1830,18 +2042,22 @@ func (cmd *StringSliceCmd) SetVal(val []string) { } func (cmd *StringSliceCmd) Val() []string { + cmd.await() return cmd.val } func (cmd *StringSliceCmd) Result() ([]string, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *StringSliceCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } func (cmd *StringSliceCmd) ScanSlice(container interface{}) error { + cmd.await() return proto.ScanSlice(cmd.val, container) } @@ -1902,14 +2118,17 @@ func (cmd *StringSliceSliceCmd) SetVal(val [][]string) { } func (cmd *StringSliceSliceCmd) Val() [][]string { + cmd.await() return cmd.val } func (cmd *StringSliceSliceCmd) Result() ([][]string, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *StringSliceSliceCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -1987,14 +2206,17 @@ func (cmd *KeyValueSliceCmd) SetVal(val []KeyValue) { } func (cmd *KeyValueSliceCmd) Val() []KeyValue { + cmd.await() return cmd.val } func (cmd *KeyValueSliceCmd) Result() ([]KeyValue, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *KeyValueSliceCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -2030,6 +2252,9 @@ func (cmd *KeyValueSliceCmd) readReply(rd *proto.Reader) error { // nolint:dupl if array { cmd.val = make([]KeyValue, n) } else { + if n%2 != 0 { + return fmt.Errorf("redis: got %d elements in the key-value array, wanted a multiple of 2", n) + } cmd.val = make([]KeyValue, n/2) } @@ -2089,14 +2314,17 @@ func (cmd *BoolSliceCmd) SetVal(val []bool) { } func (cmd *BoolSliceCmd) Val() []bool { + cmd.await() return cmd.val } func (cmd *BoolSliceCmd) Result() ([]bool, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *BoolSliceCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -2107,8 +2335,13 @@ func (cmd *BoolSliceCmd) readReply(rd *proto.Reader) error { } cmd.val = make([]bool, n) for i := 0; i < len(cmd.val); i++ { - if cmd.val[i], err = rd.ReadBool(); err != nil { + switch b, err := rd.ReadBool(); { + case err == Nil: + cmd.val[i] = false + case err != nil: return err + default: + cmd.val[i] = b } } return nil @@ -2147,6 +2380,7 @@ func NewMapStringStringCmd(ctx context.Context, args ...interface{}) *MapStringS } func (cmd *MapStringStringCmd) Val() map[string]string { + cmd.await() return cmd.val } @@ -2155,16 +2389,19 @@ func (cmd *MapStringStringCmd) SetVal(val map[string]string) { } func (cmd *MapStringStringCmd) Result() (map[string]string, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *MapStringStringCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } // Scan scans the results from the map into a destination struct. The map keys // are matched in the Redis struct fields by the `redis:"field"` tag. func (cmd *MapStringStringCmd) Scan(dest interface{}) error { + cmd.await() if cmd.err != nil { return cmd.err } @@ -2245,14 +2482,17 @@ func (cmd *MapStringIntCmd) SetVal(val map[string]int64) { } func (cmd *MapStringIntCmd) Val() map[string]int64 { + cmd.await() return cmd.val } func (cmd *MapStringIntCmd) Result() (map[string]int64, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *MapStringIntCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -2309,6 +2549,7 @@ func NewMapStringSliceInterfaceCmd(ctx context.Context, args ...interface{}) *Ma } func (cmd *MapStringSliceInterfaceCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -2317,10 +2558,12 @@ func (cmd *MapStringSliceInterfaceCmd) SetVal(val map[string][]interface{}) { } func (cmd *MapStringSliceInterfaceCmd) Result() (map[string][]interface{}, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *MapStringSliceInterfaceCmd) Val() map[string][]interface{} { + cmd.await() return cmd.val } @@ -2384,6 +2627,11 @@ func (cmd *MapStringSliceInterfaceCmd) readReply(rd *proto.Reader) (err error) { cmd.val[key] = append(cmd.val[key], data) } } + default: + // Any other reply type leaves the peeked frame unread. Returning nil + // here would put the connection back in the pool with those bytes + // buffered, so the next command reads them as its own reply. + return fmt.Errorf("redis: can't parse map-string-slice-interface reply: unexpected type %c", readType) } return nil @@ -2432,14 +2680,17 @@ func (cmd *StringStructMapCmd) SetVal(val map[string]struct{}) { } func (cmd *StringStructMapCmd) Val() map[string]struct{} { + cmd.await() return cmd.val } func (cmd *StringStructMapCmd) Result() (map[string]struct{}, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *StringStructMapCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -2507,14 +2758,17 @@ func (cmd *XMessageSliceCmd) SetVal(val []XMessage) { } func (cmd *XMessageSliceCmd) Val() []XMessage { + cmd.await() return cmd.val } func (cmd *XMessageSliceCmd) Result() ([]XMessage, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *XMessageSliceCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -2653,14 +2907,17 @@ func (cmd *XStreamSliceCmd) SetVal(val []XStream) { } func (cmd *XStreamSliceCmd) Val() []XStream { + cmd.await() return cmd.val } func (cmd *XStreamSliceCmd) Result() ([]XStream, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *XStreamSliceCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -2757,14 +3014,17 @@ func (cmd *XPendingCmd) SetVal(val *XPending) { } func (cmd *XPendingCmd) Val() *XPending { + cmd.await() return cmd.val } func (cmd *XPendingCmd) Result() (*XPending, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *XPendingCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -2862,14 +3122,17 @@ func (cmd *XPendingExtCmd) SetVal(val []XPendingExt) { } func (cmd *XPendingExtCmd) Val() []XPendingExt { + cmd.await() return cmd.val } func (cmd *XPendingExtCmd) Result() ([]XPendingExt, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *XPendingExtCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -2946,14 +3209,17 @@ func (cmd *XAutoClaimCmd) SetVal(val []XMessage, start string) { } func (cmd *XAutoClaimCmd) Val() (messages []XMessage, start string) { + cmd.await() return cmd.val, cmd.start } func (cmd *XAutoClaimCmd) Result() (messages []XMessage, start string, err error) { + cmd.await() return cmd.val, cmd.start, cmd.err } func (cmd *XAutoClaimCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -3040,14 +3306,17 @@ func (cmd *XAutoClaimWithDeletedCmd) SetVal(val []XMessage, start string, delete } func (cmd *XAutoClaimWithDeletedCmd) Val() (messages []XMessage, start string, deletedIDs []string) { + cmd.await() return cmd.val, cmd.start, cmd.deletedIDs } func (cmd *XAutoClaimWithDeletedCmd) Result() (messages []XMessage, start string, deletedIDs []string, err error) { + cmd.await() return cmd.val, cmd.start, cmd.deletedIDs, cmd.err } func (cmd *XAutoClaimWithDeletedCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -3151,14 +3420,17 @@ func (cmd *XAutoClaimJustIDCmd) SetVal(val []string, start string) { } func (cmd *XAutoClaimJustIDCmd) Val() (ids []string, start string) { + cmd.await() return cmd.val, cmd.start } func (cmd *XAutoClaimJustIDCmd) Result() (ids []string, start string, err error) { + cmd.await() return cmd.val, cmd.start, cmd.err } func (cmd *XAutoClaimJustIDCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -3247,14 +3519,17 @@ func (cmd *XInfoConsumersCmd) SetVal(val []XInfoConsumer) { } func (cmd *XInfoConsumersCmd) Val() []XInfoConsumer { + cmd.await() return cmd.val } func (cmd *XInfoConsumersCmd) Result() ([]XInfoConsumer, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *XInfoConsumersCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -3353,14 +3628,17 @@ func (cmd *XInfoGroupsCmd) SetVal(val []XInfoGroup) { } func (cmd *XInfoGroupsCmd) Val() []XInfoGroup { + cmd.await() return cmd.val } func (cmd *XInfoGroupsCmd) Result() ([]XInfoGroup, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *XInfoGroupsCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -3491,14 +3769,17 @@ func (cmd *XInfoStreamCmd) SetVal(val *XInfoStream) { } func (cmd *XInfoStreamCmd) Val() *XInfoStream { + cmd.await() return cmd.val } func (cmd *XInfoStreamCmd) Result() (*XInfoStream, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *XInfoStreamCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -3718,14 +3999,17 @@ func (cmd *XInfoStreamFullCmd) SetVal(val *XInfoStreamFull) { } func (cmd *XInfoStreamFullCmd) Val() *XInfoStreamFull { + cmd.await() return cmd.val } func (cmd *XInfoStreamFullCmd) Result() (*XInfoStreamFull, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *XInfoStreamFullCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -4100,14 +4384,17 @@ func (cmd *ZSliceCmd) SetVal(val []Z) { } func (cmd *ZSliceCmd) Val() []Z { + cmd.await() return cmd.val } func (cmd *ZSliceCmd) Result() ([]Z, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *ZSliceCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -4132,6 +4419,9 @@ func (cmd *ZSliceCmd) readReply(rd *proto.Reader) error { // nolint:dupl if array { cmd.val = make([]Z, n) } else { + if n%2 != 0 { + return fmt.Errorf("redis: got %d elements in the sorted set array, wanted a multiple of 2", n) + } cmd.val = make([]Z, n/2) } @@ -4191,14 +4481,17 @@ func (cmd *ZWithKeyCmd) SetVal(val *ZWithKey) { } func (cmd *ZWithKeyCmd) Val() *ZWithKey { + cmd.await() return cmd.val } func (cmd *ZWithKeyCmd) Result() (*ZWithKey, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *ZWithKeyCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -4268,14 +4561,17 @@ func (cmd *ScanCmd) SetVal(page []string, cursor uint64) { } func (cmd *ScanCmd) Val() (keys []string, cursor uint64) { + cmd.await() return cmd.page, cmd.cursor } func (cmd *ScanCmd) Result() (keys []string, cursor uint64, err error) { + cmd.await() return cmd.page, cmd.cursor, cmd.err } func (cmd *ScanCmd) String() string { + cmd.await() return cmdString(cmd, cmd.page) } @@ -4362,14 +4658,17 @@ func (cmd *ClusterSlotsCmd) SetVal(val []ClusterSlot) { } func (cmd *ClusterSlotsCmd) Val() []ClusterSlot { + cmd.await() return cmd.val } func (cmd *ClusterSlotsCmd) Result() ([]ClusterSlot, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *ClusterSlotsCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -4585,14 +4884,17 @@ func (cmd *GeoLocationCmd) SetVal(locations []GeoLocation) { } func (cmd *GeoLocationCmd) Val() []GeoLocation { + cmd.await() return cmd.locations } func (cmd *GeoLocationCmd) Result() ([]GeoLocation, error) { + cmd.await() return cmd.locations, cmd.err } func (cmd *GeoLocationCmd) String() string { + cmd.await() return cmdString(cmd, cmd.locations) } @@ -4794,14 +5096,17 @@ func (cmd *GeoSearchLocationCmd) SetVal(val []GeoLocation) { } func (cmd *GeoSearchLocationCmd) Val() []GeoLocation { + cmd.await() return cmd.val } func (cmd *GeoSearchLocationCmd) Result() ([]GeoLocation, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *GeoSearchLocationCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -4812,11 +5117,28 @@ func (cmd *GeoSearchLocationCmd) readReply(rd *proto.Reader) error { } cmd.val = make([]GeoLocation, n) + // Each element is an array of [name, ...] whose minimum length is set by + // the requested WITH flags. Entries shorter than that would make the + // parser read into the next reply; extra elements are drained below so a + // longer entry (e.g. from a newer server) can't leave frames on the wire. + withLen := 1 + if cmd.opt.WithDist { + withLen++ + } + if cmd.opt.WithHash { + withLen++ + } + if cmd.opt.WithCoord { + withLen++ + } for i := 0; i < n; i++ { - _, err = rd.ReadArrayLen() + nn, err := rd.ReadArrayLen() if err != nil { return err } + if nn < withLen { + return fmt.Errorf("redis: got %d elements in GEOSEARCH reply, expected at least %d", nn, withLen) + } var loc GeoLocation @@ -4849,6 +5171,11 @@ func (cmd *GeoSearchLocationCmd) readReply(rd *proto.Reader) error { return err } } + for j := withLen; j < nn; j++ { + if err := rd.DiscardNext(); err != nil { + return err + } + } cmd.val[i] = loc } @@ -4919,14 +5246,17 @@ func (cmd *GeoPosCmd) SetVal(val []*GeoPos) { } func (cmd *GeoPosCmd) Val() []*GeoPos { + cmd.await() return cmd.val } func (cmd *GeoPosCmd) Result() ([]*GeoPos, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *GeoPosCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -5021,14 +5351,17 @@ func (cmd *CommandsInfoCmd) SetVal(val map[string]*CommandInfo) { } func (cmd *CommandsInfoCmd) Val() map[string]*CommandInfo { + cmd.await() return cmd.val } func (cmd *CommandsInfoCmd) Result() (map[string]*CommandInfo, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *CommandsInfoCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -5205,6 +5538,11 @@ type cmdsInfoCache struct { once internal.Once refreshLock sync.RWMutex cmds map[string]*CommandInfo + // cmdsAtomic mirrors cmds for lock-free reads via Peek. cmds is only ever + // replaced wholesale (never mutated in place), so an atomic pointer load is a + // safe, contention-free read — Peek is on the hot per-command cluster routing + // path where the RWMutex.RLock showed up as a bottleneck under heavy load. + cmdsAtomic atomic.Pointer[map[string]*CommandInfo] } func newCmdsInfoCache(fn func(ctx context.Context) (map[string]*CommandInfo, error)) *cmdsInfoCache { @@ -5231,6 +5569,7 @@ func (c *cmdsInfoCache) Get(ctx context.Context) (map[string]*CommandInfo, error } c.cmds = lowerCmds + c.cmdsAtomic.Store(&lowerCmds) return nil }) return c.cmds, err @@ -5245,16 +5584,19 @@ func (c *cmdsInfoCache) Refresh() { // Peek returns the cached CommandInfo map without triggering a Redis round-trip. // Returns nil when the cache is cold; callers should fall back to other heuristics. -// Note: during the very first Get() (initial population) this call will block on -// the writer lock. After that, concurrent Peek() calls do not block each other. +// The read is lock-free (a single atomic load) and never blocks, even while a +// concurrent Get() is populating the cache — it simply returns nil until the +// first population publishes the map. // The returned map and its entries MUST NOT be mutated by the caller. func (c *cmdsInfoCache) Peek() map[string]*CommandInfo { if c == nil { return nil } - c.refreshLock.RLock() - defer c.refreshLock.RUnlock() - return c.cmds + // Lock-free read: cmds is replaced wholesale, never mutated in place. + if p := c.cmdsAtomic.Load(); p != nil { + return *p + } + return nil } // ------------------------------------------------------------------------------ @@ -5301,6 +5643,10 @@ type SlowLog struct { // https://redis.io/commands/slowlog#output-format ClientAddr string ClientName string + // CommandArgc is the command's total argument count (including the command + // name), emitted only by Redis 8.10 or greater. It may exceed len(Args) when + // the slow log truncates the stored arguments (slowlog-max-argc, default 32). + CommandArgc int64 } type SlowLogCmd struct { @@ -5326,14 +5672,17 @@ func (cmd *SlowLogCmd) SetVal(val []SlowLog) { } func (cmd *SlowLogCmd) Val() []SlowLog { + cmd.await() return cmd.val } func (cmd *SlowLogCmd) Result() ([]SlowLog, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *SlowLogCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -5396,6 +5745,21 @@ func (cmd *SlowLogCmd) readReply(rd *proto.Reader) error { return err } } + + // Redis 8.10+ appends a 7th field: the command's total argument count. + if nn >= 7 { + if cmd.val[i].CommandArgc, err = rd.ReadInt(); err != nil { + return err + } + } + + // Drain any elements past the 7 this parser knows about so a server + // that declares a longer entry array doesn't leave frames on the wire. + for j := 7; j < nn; j++ { + if err = rd.DiscardNext(); err != nil { + return err + } + } } return nil @@ -5407,11 +5771,12 @@ func (cmd *SlowLogCmd) Clone() Cmder { val = make([]SlowLog, len(cmd.val)) for i, log := range cmd.val { val[i] = SlowLog{ - ID: log.ID, - Time: log.Time, - Duration: log.Duration, - ClientAddr: log.ClientAddr, - ClientName: log.ClientName, + ID: log.ID, + Time: log.Time, + Duration: log.Duration, + ClientAddr: log.ClientAddr, + ClientName: log.ClientName, + CommandArgc: log.CommandArgc, } if log.Args != nil { val[i].Args = make([]string, len(log.Args)) @@ -5455,14 +5820,17 @@ func (cmd *LatencyCmd) SetVal(val []Latency) { } func (cmd *LatencyCmd) Val() []Latency { + cmd.await() return cmd.val } func (cmd *LatencyCmd) Result() ([]Latency, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *LatencyCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -5477,8 +5845,8 @@ func (cmd *LatencyCmd) readReply(rd *proto.Reader) error { if err != nil { return err } - if nn < 3 { - return fmt.Errorf("redis: got %d elements in latency get, expected at least 3", nn) + if nn < 4 { + return fmt.Errorf("redis: got %d elements in latency get, expected at least 4", nn) } if cmd.val[i].Name, err = rd.ReadString(); err != nil { return err @@ -5498,6 +5866,13 @@ func (cmd *LatencyCmd) readReply(rd *proto.Reader) error { return err } cmd.val[i].Max = time.Duration(maximum) * time.Millisecond + // Drain any elements beyond the 4 this parser reads so a server that + // declares a longer entry array can't leave frames on the wire. + for j := 4; j < nn; j++ { + if err = rd.DiscardNext(); err != nil { + return err + } + } } return nil } @@ -5570,14 +5945,17 @@ func (cmd *HotKeysCmd) SetVal(val *HotKeysResult) { } func (cmd *HotKeysCmd) Val() *HotKeysResult { + cmd.await() return cmd.val } func (cmd *HotKeysCmd) Result() (*HotKeysResult, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *HotKeysCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -5690,6 +6068,14 @@ func (cmd *HotKeysCmd) readReply(rd *proto.Reader) error { result.ByNetBytes = parseHotKeysKeyEntries(v) } + // Only the first element of the outer array is parsed; drain the rest so a + // server that wraps more than one element doesn't leave frames on the wire. + for i := 1; i < arrayLen; i++ { + if err := rd.DiscardNext(); err != nil { + return err + } + } + cmd.val = result return nil } @@ -5776,14 +6162,17 @@ func (cmd *MapStringInterfaceCmd) SetVal(val map[string]interface{}) { } func (cmd *MapStringInterfaceCmd) Val() map[string]interface{} { + cmd.await() return cmd.val } func (cmd *MapStringInterfaceCmd) Result() (map[string]interface{}, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *MapStringInterfaceCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -5855,14 +6244,17 @@ func (cmd *MapStringStringSliceCmd) SetVal(val []map[string]string) { } func (cmd *MapStringStringSliceCmd) Val() []map[string]string { + cmd.await() return cmd.val } func (cmd *MapStringStringSliceCmd) Result() ([]map[string]string, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *MapStringStringSliceCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -5933,6 +6325,7 @@ func NewMapMapStringInterfaceCmd(ctx context.Context, args ...interface{}) *MapM } func (cmd *MapMapStringInterfaceCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -5941,10 +6334,12 @@ func (cmd *MapMapStringInterfaceCmd) SetVal(val map[string]interface{}) { } func (cmd *MapMapStringInterfaceCmd) Result() (map[string]interface{}, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *MapMapStringInterfaceCmd) Val() map[string]interface{} { + cmd.await() return cmd.val } @@ -6032,14 +6427,17 @@ func (cmd *MapStringInterfaceSliceCmd) SetVal(val []map[string]interface{}) { } func (cmd *MapStringInterfaceSliceCmd) Val() []map[string]interface{} { + cmd.await() return cmd.val } func (cmd *MapStringInterfaceSliceCmd) Result() ([]map[string]interface{}, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *MapStringInterfaceSliceCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -6119,14 +6517,17 @@ func (cmd *KeyValuesCmd) SetVal(key string, val []string) { } func (cmd *KeyValuesCmd) Val() (string, []string) { + cmd.await() return cmd.key, cmd.val } func (cmd *KeyValuesCmd) Result() (string, []string, error) { + cmd.await() return cmd.key, cmd.val, cmd.err } func (cmd *KeyValuesCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -6195,14 +6596,17 @@ func (cmd *ZSliceWithKeyCmd) SetVal(key string, val []Z) { } func (cmd *ZSliceWithKeyCmd) Val() (string, []Z) { + cmd.await() return cmd.key, cmd.val } func (cmd *ZSliceWithKeyCmd) Result() (string, []Z, error) { + cmd.await() return cmd.key, cmd.val, cmd.err } func (cmd *ZSliceWithKeyCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -6230,6 +6634,9 @@ func (cmd *ZSliceWithKeyCmd) readReply(rd *proto.Reader) (err error) { if array { cmd.val = make([]Z, n) } else { + if n%2 != 0 { + return fmt.Errorf("redis: got %d elements in the sorted set array, wanted a multiple of 2", n) + } cmd.val = make([]Z, n/2) } @@ -6301,18 +6708,22 @@ func (cmd *FunctionListCmd) SetVal(val []Library) { } func (cmd *FunctionListCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } func (cmd *FunctionListCmd) Val() []Library { + cmd.await() return cmd.val } func (cmd *FunctionListCmd) Result() ([]Library, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *FunctionListCmd) First() (*Library, error) { + cmd.await() if cmd.err != nil { return nil, cmd.err } @@ -6514,14 +6925,17 @@ func (cmd *FunctionStatsCmd) SetVal(val FunctionStats) { } func (cmd *FunctionStatsCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } func (cmd *FunctionStatsCmd) Val() FunctionStats { + cmd.await() return cmd.val } func (cmd *FunctionStatsCmd) Result() (FunctionStats, error) { + cmd.await() return cmd.val, cmd.err } @@ -6615,11 +7029,18 @@ func (cmd *FunctionStatsCmd) readEngines(rd *proto.Reader) ([]Engine, error) { for i := 0; i < 2; i++ { key, err := rd.ReadString() + if err != nil { + return nil, err + } switch key { case "libraries_count": engine.LibrariesCount, err = rd.ReadInt() case "functions_count": engine.FunctionsCount, err = rd.ReadInt() + default: + // Unknown field: drain its value so the reader stays aligned + // with the rest of the reply. + err = rd.DiscardNext() } if err != nil { return nil, err @@ -6779,14 +7200,17 @@ func (cmd *LCSCmd) SetVal(val *LCSMatch) { } func (cmd *LCSCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } func (cmd *LCSCmd) Val() *LCSMatch { + cmd.await() return cmd.val } func (cmd *LCSCmd) Result() (*LCSMatch, error) { + cmd.await() return cmd.val, cmd.err } @@ -6827,6 +7251,12 @@ func (cmd *LCSCmd) readReply(rd *proto.Reader) (err error) { if lcs.Len, err = rd.ReadInt(); err != nil { return err } + default: + // Unknown field: drain its value so the reader stays aligned + // with the rest of the reply. + if err = rd.DiscardNext(); err != nil { + return err + } } } } @@ -6929,14 +7359,17 @@ func (cmd *KeyFlagsCmd) SetVal(val []KeyFlags) { } func (cmd *KeyFlagsCmd) Val() []KeyFlags { + cmd.await() return cmd.val } func (cmd *KeyFlagsCmd) Result() ([]KeyFlags, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *KeyFlagsCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -7032,14 +7465,17 @@ func (cmd *ClusterLinksCmd) SetVal(val []ClusterLink) { } func (cmd *ClusterLinksCmd) Val() []ClusterLink { + cmd.await() return cmd.val } func (cmd *ClusterLinksCmd) Result() ([]ClusterLink, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *ClusterLinksCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -7147,14 +7583,17 @@ func (cmd *ClusterShardsCmd) SetVal(val []ClusterShard) { } func (cmd *ClusterShardsCmd) Val() []ClusterShard { + cmd.await() return cmd.val } func (cmd *ClusterShardsCmd) Result() ([]ClusterShard, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *ClusterShardsCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -7307,14 +7746,17 @@ func (cmd *RankWithScoreCmd) SetVal(val RankScore) { } func (cmd *RankWithScoreCmd) Val() RankScore { + cmd.await() return cmd.val } func (cmd *RankWithScoreCmd) Result() (RankScore, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *RankWithScoreCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -7469,14 +7911,17 @@ func (cmd *ClientInfoCmd) SetVal(val *ClientInfo) { } func (cmd *ClientInfoCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } func (cmd *ClientInfoCmd) Val() *ClientInfo { + cmd.await() return cmd.val } func (cmd *ClientInfoCmd) Result() (*ClientInfo, error) { + cmd.await() return cmd.val, cmd.err } @@ -7727,14 +8172,17 @@ func (cmd *ACLLogCmd) SetVal(val []*ACLLogEntry) { } func (cmd *ACLLogCmd) Val() []*ACLLogEntry { + cmd.await() return cmd.val } func (cmd *ACLLogCmd) Result() ([]*ACLLogEntry, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *ACLLogCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -7908,14 +8356,17 @@ func (cmd *InfoCmd) SetVal(val map[string]map[string]string) { } func (cmd *InfoCmd) Val() map[string]map[string]string { + cmd.await() return cmd.val } func (cmd *InfoCmd) Result() (map[string]map[string]string, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *InfoCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -7955,6 +8406,7 @@ func (cmd *InfoCmd) readReply(rd *proto.Reader) error { } func (cmd *InfoCmd) Item(section, key string) string { + cmd.await() if cmd.val == nil { return "" } else if cmd.val[section] == nil { @@ -8012,6 +8464,7 @@ func newMonitorCmd(ctx context.Context, ch chan string) *MonitorCmd { } func (cmd *MonitorCmd) String() string { + cmd.await() return cmdString(cmd, nil) } @@ -8096,14 +8549,17 @@ func (cmd *VectorScoreSliceCmd) SetVal(val []VectorScore) { } func (cmd *VectorScoreSliceCmd) Val() []VectorScore { + cmd.await() return cmd.val } func (cmd *VectorScoreSliceCmd) Result() ([]VectorScore, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *VectorScoreSliceCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -8180,14 +8636,17 @@ func (cmd *VectorScoreSliceSliceCmd) SetVal(val [][]VectorScore) { } func (cmd *VectorScoreSliceSliceCmd) Val() [][]VectorScore { + cmd.await() return cmd.val } func (cmd *VectorScoreSliceSliceCmd) Result() ([][]VectorScore, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *VectorScoreSliceSliceCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -8307,14 +8766,17 @@ func (cmd *VectorAttribSliceCmd) SetVal(val []VectorAttrib) { } func (cmd *VectorAttribSliceCmd) Val() []VectorAttrib { + cmd.await() return cmd.val } func (cmd *VectorAttribSliceCmd) Result() ([]VectorAttrib, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *VectorAttribSliceCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -8395,14 +8857,17 @@ func (cmd *VectorScoreAttribSliceCmd) SetVal(val []VectorScoreAttrib) { } func (cmd *VectorScoreAttribSliceCmd) Val() []VectorScoreAttrib { + cmd.await() return cmd.val } func (cmd *VectorScoreAttribSliceCmd) Result() ([]VectorScoreAttrib, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *VectorScoreAttribSliceCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -8926,6 +9391,13 @@ func ExtractCommandValue(cmd interface{}) (interface{}, error) { }); ok { return tsTimestampValueSliceCmd.Val(), tsTimestampValueSliceCmd.Err() } + case CmdTypeTSNRangePivotRowSlice: + if tsNRangePivotRowSliceCmd, ok := cmd.(interface { + Val() []TSNRangePivotRow + Err() error + }); ok { + return tsNRangePivotRowSliceCmd.Val(), tsNRangePivotRowSliceCmd.Err() + } case CmdTypeStringSlice: if stringSliceCmd, ok := cmd.(interface { Val() []string @@ -9064,11 +9536,18 @@ func NewIncrEXIntCmd(ctx context.Context, args ...interface{}) *IncrEXIntCmd { } func (cmd *IncrEXIntCmd) SetVal(val IncrEXIntResult) { cmd.val = val } -func (cmd *IncrEXIntCmd) Val() IncrEXIntResult { return cmd.val } +func (cmd *IncrEXIntCmd) Val() IncrEXIntResult { + cmd.await() + return cmd.val +} func (cmd *IncrEXIntCmd) Result() (IncrEXIntResult, error) { + cmd.await() return cmd.val, cmd.err } -func (cmd *IncrEXIntCmd) String() string { return cmdString(cmd, cmd.val) } +func (cmd *IncrEXIntCmd) String() string { + cmd.await() + return cmdString(cmd, cmd.val) +} func (cmd *IncrEXIntCmd) readReply(rd *proto.Reader) error { if err := rd.ReadFixedArrayLen(2); err != nil { @@ -9118,11 +9597,18 @@ func NewIncrEXFloatCmd(ctx context.Context, args ...interface{}) *IncrEXFloatCmd } func (cmd *IncrEXFloatCmd) SetVal(val IncrEXFloatResult) { cmd.val = val } -func (cmd *IncrEXFloatCmd) Val() IncrEXFloatResult { return cmd.val } +func (cmd *IncrEXFloatCmd) Val() IncrEXFloatResult { + cmd.await() + return cmd.val +} func (cmd *IncrEXFloatCmd) Result() (IncrEXFloatResult, error) { + cmd.await() return cmd.val, cmd.err } -func (cmd *IncrEXFloatCmd) String() string { return cmdString(cmd, cmd.val) } +func (cmd *IncrEXFloatCmd) String() string { + cmd.await() + return cmdString(cmd, cmd.val) +} func (cmd *IncrEXFloatCmd) readReply(rd *proto.Reader) error { if err := rd.ReadFixedArrayLen(2); err != nil { @@ -9172,14 +9658,17 @@ func (cmd *AREntrySliceCmd) SetVal(val []AREntry) { } func (cmd *AREntrySliceCmd) Val() []AREntry { + cmd.await() return cmd.val } func (cmd *AREntrySliceCmd) Result() ([]AREntry, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *AREntrySliceCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } diff --git a/vendor/github.com/redis/go-redis/v9/command_policy_resolver.go b/vendor/github.com/redis/go-redis/v9/command_policy_resolver.go index da8c6d314..11fc5d1c7 100644 --- a/vendor/github.com/redis/go-redis/v9/command_policy_resolver.go +++ b/vendor/github.com/redis/go-redis/v9/command_policy_resolver.go @@ -109,6 +109,13 @@ var defaultPolicies = map[module]map[commandName]*routing.CommandPolicy{ Request: routing.ReqDefault, Response: routing.RespDefaultKeyless, }, + "aliaslist": { + Request: routing.ReqDefault, + Response: routing.RespDefaultKeyless, + Tips: map[string]string{ + routing.ReadOnlyCMD: "", + }, + }, "info": { Request: routing.ReqDefault, Response: routing.RespDefaultKeyless, @@ -156,6 +163,26 @@ var defaultPolicies = map[module]map[commandName]*routing.CommandPolicy{ }, } +// defaultPolicyKeyless reports whether name (e.g. "ft.aliaslist") is registered +// in the static policy table as a plain keyless command: default request +// routing with a keyless response policy. Commands whose slot comes from a key +// (RespDefaultHashSlot, e.g. ft.suglen) or with special request routing +// (ReqSpecial, e.g. ft.cursor) are excluded — their key position must still be +// resolved. cmdFirstKeyPosWithInfo consults this so the initial slot +// computation on a cold command-info cache matches the policy the router +// applies once the command reaches routeAndRun. +func defaultPolicyKeyless(name string) bool { + i := strings.IndexByte(name, '.') + if i < 0 { + return false + } + policy, ok := defaultPolicies[name[:i]][name[i+1:]] + if !ok { + return false + } + return policy.Request == routing.ReqDefault && policy.Response == routing.RespDefaultKeyless +} + type CommandInfoResolveFunc func(ctx context.Context, cmd Cmder) *routing.CommandPolicy type commandInfoResolver struct { diff --git a/vendor/github.com/redis/go-redis/v9/commands.go b/vendor/github.com/redis/go-redis/v9/commands.go index d347ffeb5..c574f6e6e 100644 --- a/vendor/github.com/redis/go-redis/v9/commands.go +++ b/vendor/github.com/redis/go-redis/v9/commands.go @@ -199,6 +199,9 @@ type Cmdable interface { ClientUnblock(ctx context.Context, id int64) *IntCmd ClientUnblockWithError(ctx context.Context, id int64) *IntCmd ClientMaintNotifications(ctx context.Context, enabled bool, endpointType string) *StatusCmd + ClientTracking(ctx context.Context, on bool, opt *ClientTrackingOptions) *StatusCmd + ClientTrackingOn(ctx context.Context, opt *ClientTrackingOptions) *StatusCmd + ClientTrackingOff(ctx context.Context) *StatusCmd ConfigGet(ctx context.Context, parameter string) *MapStringStringCmd ConfigResetStat(ctx context.Context) *StatusCmd ConfigSet(ctx context.Context, parameter, value string) *StatusCmd @@ -209,6 +212,7 @@ type Cmdable interface { FlushDB(ctx context.Context) *StatusCmd FlushDBAsync(ctx context.Context) *StatusCmd Info(ctx context.Context, section ...string) *StringCmd + InfoMap(ctx context.Context, section ...string) *InfoCmd LastSave(ctx context.Context) *IntCmd Save(ctx context.Context) *StatusCmd Shutdown(ctx context.Context) *StatusCmd @@ -296,8 +300,8 @@ func (c cmdable) Wait(ctx context.Context, numSlaves int, timeout time.Duration) return cmd } -func (c cmdable) WaitAOF(ctx context.Context, numLocal, numSlaves int, timeout time.Duration) *IntCmd { - cmd := NewIntCmd(ctx, "waitAOF", numLocal, numSlaves, int(timeout/time.Millisecond)) +func (c cmdable) WaitAOF(ctx context.Context, numLocal, numSlaves int, timeout time.Duration) *IntSliceCmd { + cmd := NewIntSliceCmd(ctx, "waitAOF", numLocal, numSlaves, int(timeout/time.Millisecond)) cmd.setReadTimeout(timeout) _ = c(ctx, cmd) return cmd @@ -565,6 +569,95 @@ func (c cmdable) ClientMaintNotifications(ctx context.Context, enabled bool, end return cmd } +// ClientTrackingOptions configures CLIENT TRACKING ON. See +// https://redis.io/commands/client-tracking/ for semantics. +type ClientTrackingOptions struct { + Redirect int64 + Bcast bool + Prefixes []string + OptIn bool + OptOut bool + NoLoop bool +} + +// ClientTracking enables or disables server-assisted client-side caching for +// the ONE connection that happens to serve this command. On a pooled client +// that connection is arbitrary, so this is only meaningful on a dedicated +// connection (see Client.Conn). When on is false, opt is ignored. Invalid +// option combinations are reported via the returned command's Err and nothing +// is sent to the server. +// +// Must not be combined with the built-in client-side cache: on a client +// configured with Options.ClientSideCache or ClientSideCacheConfig this +// command is rejected, because changing a pool connection's tracking state +// would silently break the cache's invalidation. +func (c cmdable) ClientTracking(ctx context.Context, on bool, opt *ClientTrackingOptions) *StatusCmd { + if !on { + return c.ClientTrackingOff(ctx) + } + return c.ClientTrackingOn(ctx, opt) +} + +// ClientTrackingOn enables tracking on the serving connection. See +// ClientTracking for the pooled-client and built-in-CSC caveats. +func (c cmdable) ClientTrackingOn(ctx context.Context, opt *ClientTrackingOptions) *StatusCmd { + args := []interface{}{"client", "tracking", "on"} + if opt != nil { + if err := validateClientTrackingOptions(opt); err != nil { + cmd := NewStatusCmd(ctx, args...) + cmd.SetErr(err) + return cmd + } + args = appendClientTrackingOptions(args, opt) + } + cmd := NewStatusCmd(ctx, args...) + _ = c(ctx, cmd) + return cmd +} + +// ClientTrackingOff disables tracking on the serving connection. See +// ClientTracking for the pooled-client and built-in-CSC caveats. +func (c cmdable) ClientTrackingOff(ctx context.Context) *StatusCmd { + cmd := NewStatusCmd(ctx, "client", "tracking", "off") + _ = c(ctx, cmd) + return cmd +} + +func validateClientTrackingOptions(opt *ClientTrackingOptions) error { + if opt.OptIn && opt.OptOut { + return errors.New("redis: CLIENT TRACKING OPTIN and OPTOUT are mutually exclusive") + } + if opt.Bcast && (opt.OptIn || opt.OptOut) { + return errors.New("redis: CLIENT TRACKING BCAST cannot be combined with OPTIN or OPTOUT") + } + if len(opt.Prefixes) > 0 && !opt.Bcast { + return errors.New("redis: CLIENT TRACKING PREFIX requires BCAST") + } + return nil +} + +func appendClientTrackingOptions(args []interface{}, opt *ClientTrackingOptions) []interface{} { + if opt.Redirect != 0 { + args = append(args, "redirect", opt.Redirect) + } + if opt.Bcast { + args = append(args, "bcast") + } + for _, p := range opt.Prefixes { + args = append(args, "prefix", p) + } + if opt.OptIn { + args = append(args, "optin") + } + if opt.OptOut { + args = append(args, "optout") + } + if opt.NoLoop { + args = append(args, "noloop") + } + return args +} + // ------------------------------------------------------------------------------------------------ func (c cmdable) ConfigGet(ctx context.Context, parameter string) *MapStringStringCmd { @@ -706,7 +799,7 @@ func (c cmdable) ReplicaOf(ctx context.Context, host, port string) *StatusCmd { } func (c cmdable) SlowLogGet(ctx context.Context, num int64) *SlowLogCmd { - cmd := NewSlowLogCmd(context.Background(), "slowlog", "get", num) + cmd := NewSlowLogCmd(ctx, "slowlog", "get", num) _ = c(ctx, cmd) return cmd } @@ -797,6 +890,11 @@ func (c *ModuleLoadexConfig) toArgs() []interface{} { // ModuleLoadex Redis `MODULE LOADEX path [CONFIG name value [CONFIG name value ...]] [ARGS args [args ...]]` command. func (c cmdable) ModuleLoadex(ctx context.Context, conf *ModuleLoadexConfig) *StringCmd { + if conf == nil { + cmd := NewStringCmd(ctx) + cmd.SetErr(errors.New("redis: ModuleLoadex nil config")) + return cmd + } cmd := NewStringCmd(ctx, conf.toArgs()...) _ = c(ctx, cmd) return cmd diff --git a/vendor/github.com/redis/go-redis/v9/csc_commands.go b/vendor/github.com/redis/go-redis/v9/csc_commands.go new file mode 100644 index 000000000..8c6a2b248 --- /dev/null +++ b/vendor/github.com/redis/go-redis/v9/csc_commands.go @@ -0,0 +1,257 @@ +package redis + +import ( + "bytes" + "strconv" + "strings" + + "github.com/redis/go-redis/v9/internal/proto" +) + +// defaultCacheableCommands is the allow-list of read-only, deterministic +// commands whose responses may be stored in the client-side cache. Keys are +// lowercase to match baseCmd.Name() on the hot path. +var defaultCacheableCommands = map[string]struct{}{ + // String commands + "get": {}, "mget": {}, "getbit": {}, "getrange": {}, + "strlen": {}, "substr": {}, + // Hash commands + "hget": {}, "hgetall": {}, "hmget": {}, + "hkeys": {}, "hvals": {}, "hlen": {}, + "hexists": {}, "hstrlen": {}, + // List commands + "lindex": {}, "llen": {}, "lpos": {}, "lrange": {}, + // Set commands + "scard": {}, "sismember": {}, "smembers": {}, "smismember": {}, + "sdiff": {}, "sinter": {}, "sintercard": {}, "sunion": {}, + // Sorted-set commands + "zcard": {}, "zcount": {}, "zlexcount": {}, "zmscore": {}, + "zrange": {}, "zrangebylex": {}, "zrangebyscore": {}, + "zrank": {}, "zrevrange": {}, "zrevrangebylex": {}, + "zrevrangebyscore": {}, "zrevrank": {}, "zscore": {}, + "zdiff": {}, "zinter": {}, "zunion": {}, + // Bit commands + "bitcount": {}, "bitfield_ro": {}, "bitpos": {}, + // Key/generic commands + "exists": {}, "type": {}, "sort_ro": {}, "lcs": {}, + // Geo commands + "geodist": {}, "geohash": {}, "geopos": {}, "geosearch": {}, + "georadiusbymember_ro": {}, "georadius_ro": {}, + // Stream commands. XREAD is deliberately excluded: it supports BLOCK, and + // its $/+ IDs are state-relative, so identical args are not deterministic. + // XPENDING is excluded for the same class of reason: its extended form + // returns wall-clock-relative idle times and its IDLE filter is + // time-dependent, so identical args yield different correct results with + // no key modification (and therefore no invalidation). + "xlen": {}, "xrange": {}, "xrevrange": {}, + // JSON (RedisJSON) commands + "json.get": {}, "json.mget": {}, "json.arrindex": {}, "json.arrlen": {}, + "json.objkeys": {}, "json.objlen": {}, "json.resp": {}, + "json.strlen": {}, "json.type": {}, + // TimeSeries commands + "ts.get": {}, "ts.info": {}, "ts.range": {}, "ts.revrange": {}, +} + +// isCacheable reports whether cmd is eligible for client-side caching: its +// name is on the allow-list and it operates on at least one key. +func isCacheable(cmd Cmder) bool { + // Commands such as RawWriteToCmd stream replies directly to an io.Writer. + // Capturing their replies for CSC would buffer the entire response first, + // defeating their streaming and allocation guarantees. + if cmd.NoRetry() { + return false + } + if _, ok := defaultCacheableCommands[cmd.Name()]; !ok { + return false + } + // SORT_RO ... BY/GET reads pattern keys that extractRedisKeys can't + // enumerate, so its invalidations would be dropped and the result go stale. + // Plain SORT_RO is fine. + if cmd.Name() == "sort_ro" && sortROHasByGet(cmd) { + return false + } + return cmdFirstKeyPosWithInfo(cmd, nil) != 0 +} + +// sortROHasByGet reports whether a SORT_RO invocation uses BY or GET +// (case-insensitive), scanning past the command name and key. stringArg +// normalizes string, *string, and []byte tokens. +func sortROHasByGet(cmd Cmder) bool { + for i := 2; i < len(cmd.Args()); i++ { + if s := cmd.stringArg(i); strings.EqualFold(s, "by") || strings.EqualFold(s, "get") { + return true + } + } + return false +} + +// isClientTrackingCmd reports whether cmd is a CLIENT TRACKING subcommand (any +// mode: ON, OFF, or with options). Name and stringArg normalize string, +// *string, and []byte arguments. +func isClientTrackingCmd(cmd Cmder) bool { + return cmd.Name() == "client" && strings.EqualFold(cmd.stringArg(1), "tracking") +} + +// isSelectCmd reports whether cmd changes the selected database on its +// connection. CSC keys are namespaced with Options.DB, so a runtime SELECT +// would make the connection's actual database diverge from the cache namespace. +func isSelectCmd(cmd Cmder) bool { + return cmd.Name() == "select" +} + +// isAuthCmd reports whether cmd changes the authenticated user on its +// connection. The cache namespace is fixed from Options.Username, so runtime +// authentication would make the connection identity diverge from it. +func isAuthCmd(cmd Cmder) bool { + return cmd.Name() == "auth" +} + +// isProtocolChangingHelloCmd reports whether HELLO includes a protocol version +// (and can therefore switch a tracked RESP3 connection to RESP2). A bare HELLO +// only reports connection properties and is safe. +func isProtocolChangingHelloCmd(cmd Cmder) bool { + return cmd.Name() == "hello" && len(cmd.Args()) > 1 +} + +// isResetCmd reports whether cmd resets all server-side connection state. +// RESET disables tracking, switches to RESP2, deauthenticates, and changes +// other state that a pooled CSC connection relies on. +func isResetCmd(cmd Cmder) bool { + return cmd.Name() == "reset" +} + +// isSubscribeCmd reports whether a raw command would turn an ordinary pooled +// connection into a Pub/Sub connection. Pub/Sub pushes are deliberately left +// for the dedicated PubSub reader, so the CSC drainer cannot safely own such a +// connection. +func isSubscribeCmd(cmd Cmder) bool { + switch cmd.Name() { + case "subscribe", "psubscribe", "ssubscribe": + return true + default: + return false + } +} + +// buildCacheKey returns the RESP-encoded form of the command's argument list, +// used as a collision-free canonical cache key. ok is false when the writer +// cannot marshal the arguments, in which case the caller must skip caching +// rather than bucket the command under an empty key. +func buildCacheKey(cmd Cmder) (string, bool) { + args := cmd.Args() + if len(args) == 0 { + return "", false + } + var buf bytes.Buffer + if err := proto.NewWriter(&buf).WriteArgs(args); err != nil { + return "", false + } + return buf.String(), true +} + +// keyArg renders the key argument at pos exactly as proto.Writer sends it to +// the server, so invalidation lookups match the key names in the server's +// "invalidate" pushes. Only types whose stringArg rendering is byte-identical +// to the wire encoding are accepted (fmt.Sprint of any integer matches the +// writer's base-10 strconv output); for anything else — pointers, bools, +// times, durations, floats, BinaryMarshaler values — the rendering can +// diverge, the invalidation would never match, and the entry would be served +// stale forever, so ok=false and the caller skips caching (see processCached). +func keyArg(cmd Cmder, pos int) (string, bool) { + args := cmd.Args() + if pos < 0 || pos >= len(args) { + return "", false + } + switch args[pos].(type) { + case string, []byte, + int, int8, int16, int32, int64, + uint, uint8, uint16, uint32, uint64: + return cmd.stringArg(pos), true + } + return "", false +} + +// extractRedisKeys returns the Redis key arguments from cmd. The result lets +// the cache map incoming invalidations back to affected entries. Returns nil +// (caller skips caching) when any key +// argument cannot be rendered in its wire form (see keyArg). +func extractRedisKeys(cmd Cmder) []string { + firstKey := cmdFirstKeyPosWithInfo(cmd, nil) + if firstKey == 0 { + return nil + } + + argsLen := len(cmd.Args()) + if firstKey >= argsLen { + return nil + } + + switch cmd.Name() { + // All remaining args from firstKeyPos are keys. + case "mget", "exists", "sdiff", "sinter", "sunion": + keys := make([]string, 0, argsLen-firstKey) + for i := firstKey; i < argsLen; i++ { + k, ok := keyArg(cmd, i) + if !ok { + return nil + } + keys = append(keys, k) + } + return keys + + // Numkeys pattern: numkeys at args[1], keys from args[2]. + case "sintercard", "zdiff", "zinter", "zunion": + if argsLen < 3 { + return nil + } + numKeys, err := strconv.Atoi(cmd.stringArg(1)) + if err != nil || numKeys <= 0 { + return nil + } + keys := make([]string, 0, numKeys) + for i := 2; i < 2+numKeys && i < argsLen; i++ { + k, ok := keyArg(cmd, i) + if !ok { + return nil + } + keys = append(keys, k) + } + return keys + + // LCS: exactly two consecutive keys starting at firstKeyPos. + case "lcs": + if firstKey+1 >= argsLen { + return nil + } + k1, ok1 := keyArg(cmd, firstKey) + k2, ok2 := keyArg(cmd, firstKey+1) + if !ok1 || !ok2 { + return nil + } + return []string{k1, k2} + + // JSON.MGET: keys from firstKeyPos to second-to-last (last arg is the + // JSON path, not a key). + case "json.mget": + lastKey := argsLen - 2 + if lastKey < firstKey { + return nil + } + keys := make([]string, 0, lastKey-firstKey+1) + for i := firstKey; i <= lastKey; i++ { + k, ok := keyArg(cmd, i) + if !ok { + return nil + } + keys = append(keys, k) + } + return keys + } + + // Single key at firstKeyPos (GET, HGET, LRANGE, ...). + k, ok := keyArg(cmd, firstKey) + if !ok { + return nil + } + return []string{k} +} diff --git a/vendor/github.com/redis/go-redis/v9/csc_integration.go b/vendor/github.com/redis/go-redis/v9/csc_integration.go new file mode 100644 index 000000000..f9b41352f --- /dev/null +++ b/vendor/github.com/redis/go-redis/v9/csc_integration.go @@ -0,0 +1,922 @@ +package redis + +import ( + "bytes" + "context" + "errors" + "reflect" + "runtime" + "strconv" + "sync" + "sync/atomic" + "time" + + "github.com/redis/go-redis/v9/internal" + "github.com/redis/go-redis/v9/internal/pool" + "github.com/redis/go-redis/v9/internal/proto" + "github.com/redis/go-redis/v9/push" +) + +// cscRegisterCleanups arranges for a client dropped without Close to stop its +// background CSC drainer. The drainer's exit path revokes its pool's cache +// coverage; the runtime cleanup itself stays non-blocking and never captures +// *Client, so the wrapper remains collectible. +func cscRegisterCleanups(c *Client) { + h := c.baseClient.cscDrainHandle + if h == nil { + return + } + // Capture cscActive (a standalone *atomic.Bool, not *Client) so the cleanup + // also stops clones from serving once the drainer is gone. + active := c.baseClient.cscActive + runtime.AddCleanup(c, func(h *cscDrainHandle) { + if active != nil { + active.Store(false) + } + h.signalStop() + }, h) +} + +// ClientSideCacheConfig configures the built-in client-side cache. Pass a +// non-nil value to Options.ClientSideCacheConfig to enable caching on a RESP3 +// client. +// +// Experimental: this API may change in a minor release. +type ClientSideCacheConfig = CacheConfig + +const ( + invalidatePushName = "invalidate" + // cscNamespaceSep separates fixed-width/logically-delimited namespace parts + // from the command or Redis key. + cscNamespaceSep = "\x00" +) + +// cscNamespacePrefix scopes a shared cache by database and fixed ACL identity. +// Password rotation does not change identity; provider-backed identities are +// rejected before attachment. +func cscNamespacePrefix(db int, username string) string { + return strconv.Itoa(db) + cscNamespaceSep + + strconv.Itoa(len(username)) + ":" + username + cscNamespaceSep +} + +func cscNamespacedKey(prefix, key string) string { + return prefix + key +} + +// invalidateHandler propagates RESP3 "invalidate" push notifications into the +// shared client-side cache. keyPrefix scopes incoming key names so a shared +// cache cannot collide across databases or fixed ACL identities. +// +// The binding (cache, keyPrefix) is mutable under mu: the owning client's teardown +// RELEASES it (cache=nil) instead of unregistering the handler, so the handler +// can stay registered protected — application code holding the processor +// cannot silently unregister invalidation out from under a live client — while +// a successor client on the same processor can still rebind it (see +// registerInvalidateHandler). +type invalidateHandler struct { + mu sync.RWMutex + cache Cache + keyPrefix string + users int +} + +// HandlePushNotification decodes ["invalidate", ] notifications. A nil +// payload is emitted on FLUSHDB/FLUSHALL and triggers a full cache flush. +func (h *invalidateHandler) HandlePushNotification( + _ context.Context, _ push.NotificationHandlerContext, notification []interface{}, +) error { + h.mu.RLock() + cache, keyPrefix := h.cache, h.keyPrefix + h.mu.RUnlock() + if cache == nil || len(notification) < 2 { + return nil + } + + switch payload := notification[1].(type) { + case nil: + cache.Flush() + case []interface{}: + for _, k := range payload { + var name string + switch v := k.(type) { + case string: + name = v + case []byte: + name = string(v) + default: + continue + } + cache.DeleteByRedisKey(cscNamespacedKey(keyPrefix, name)) + } + } + return nil +} + +func (h *invalidateHandler) release() { + h.mu.Lock() + if h.users > 0 { + h.releaseLocked() + } + h.mu.Unlock() +} + +func (h *invalidateHandler) releaseLocked() { + h.users-- + if h.users == 0 { + h.cache = nil + h.keyPrefix = "" + } +} + +// sameCache compares Cache interface values without panicking when an +// implementation uses a non-comparable value type. +func sameCache(a, b Cache) bool { + if a == nil || b == nil { + return a == nil && b == nil + } + typ := reflect.TypeOf(a) + return typ == reflect.TypeOf(b) && typ.Comparable() && a == b +} + +func isNilCache(cache Cache) bool { + if cache == nil { + return true + } + v := reflect.ValueOf(cache) + switch v.Kind() { + case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice: + return v.IsNil() + default: + return false + } +} + +// errInvalidateHandlerBound: piggybacking on a handler bound to a live +// different cache would leave the new cache uninvalidated. +var errInvalidateHandlerBound = errors.New(`csc: a different "invalidate" push handler is already registered`) + +// bindTo binds the handler to (cache, keyPrefix). Success when that is already the +// binding (a derived Client.Conn sharing the parent's processor and cache) or +// when the handler was released by a previous owner's teardown (rebind); +// errInvalidateHandlerBound otherwise. +func (h *invalidateHandler) bindTo(cache Cache, keyPrefix string) error { + h.mu.Lock() + defer h.mu.Unlock() + switch { + case sameCache(h.cache, cache) && h.keyPrefix == keyPrefix: + h.users++ + return nil + case h.cache == nil: + h.cache, h.keyPrefix = cache, keyPrefix + h.users = 1 + return nil + default: + return errInvalidateHandlerBound + } +} + +// lookupInvalidateHandler returns the processor's CSC invalidate handler, nil +// when absent or foreign. +func lookupInvalidateHandler(p push.NotificationProcessor) *invalidateHandler { + if p == nil { + return nil + } + h, _ := p.GetHandler(invalidatePushName).(*invalidateHandler) + return h +} + +func registerInvalidateHandler(p push.NotificationProcessor, cache Cache, keyPrefix string) error { + if p == nil || cache == nil { + return nil + } + if existing := p.GetHandler(invalidatePushName); existing != nil { + h, ok := existing.(*invalidateHandler) + if !ok { + return errInvalidateHandlerBound + } + return h.bindTo(cache, keyPrefix) + } + // VoidProcessor (RESP2) returns an error here; the caller treats it as + // "CSC not available" rather than fatal. Registered PROTECTED: application + // code holding the processor must not be able to unregister invalidation + // under a live client (that would serve unbounded-stale hits with no + // signal); owner teardown releases the BINDING instead of the handler. + err := p.RegisterHandler(invalidatePushName, &invalidateHandler{ + cache: cache, + keyPrefix: keyPrefix, + users: 1, + }, true) + if err == nil { + return nil + } + // Another client can register the same protected handler between GetHandler + // and RegisterHandler. Re-read it and accept the compatible binding. + if existing := p.GetHandler(invalidatePushName); existing != nil { + h, ok := existing.(*invalidateHandler) + if !ok { + return errInvalidateHandlerBound + } + return h.bindTo(cache, keyPrefix) + } + return err +} + +// attachCSC dispatches to the invalidation strategy in +// Options.ClientSideCacheStrategy. Safe with a nil cache; on failure c.csc stays +// nil and commands fall back to normal round-trips. Adding a strategy: a new +// CSCStrategy constant plus cases in Options.init and here. +func (c *baseClient) attachCSC(ctx context.Context, cache Cache) { + if isNilCache(cache) || c.opt.Protocol != 3 { + return + } + // Credential providers may return a different ACL identity over the + // client's lifetime (or per context/connection), while the cache namespace + // is fixed when the client is created. Fixed credentials remain safe because + // the ACL username is included in the length-delimited namespace below. + if c.opt.StreamingCredentialsProvider != nil || + c.opt.CredentialsProviderContext != nil || + c.opt.CredentialsProvider != nil { + internal.Logger.Printf(ctx, + "redis: client-side caching is disabled with credential providers") + return + } + c.cscKeyPrefix = cscNamespacePrefix(c.opt.DB, c.opt.Username) + switch c.opt.ClientSideCacheStrategy { + case CSCStrategySharedTracking: + c.attachSharedTrackingCSC(ctx, cache) + default: + // Options.init clamps unknown strategies to SharedTracking; delegate anyway. + c.attachSharedTrackingCSC(ctx, cache) + } +} + +// attachSharedTrackingCSC wires SharedTracking: one shared cache, per-conn CLIENT +// TRACKING, a background drainer, and the owning-conn eviction hook. DB-0 only: +// tracking is bound to the conn's DB and a runtime SELECT does not re-key it. +func (c *baseClient) attachSharedTrackingCSC(ctx context.Context, cache Cache) { + if c.opt.DB != 0 { + internal.Logger.Printf(ctx, + "csc: client-side caching is restricted to DB 0; disabling CSC for client configured with DB=%d. "+ + "Use one client per DB if you need caching against non-zero databases.", c.opt.DB) + return + } + // A pooler without idle-conn draining (e.g. Client.Conn's StickyConnPool) + // can't apply buffered invalidations, so stay uncached. + if _, ok := c.connPool.(idleConnDrainer); !ok { + return + } + // The lifecycle hook serializes cache publication with connection removal + // and socket replacement. Without it, a reply can become visible after its + // tracking coverage is gone. + reg, ok := c.connPool.(poolHookSupport) + if !ok || !reg.SupportsPoolHooks() { + return + } + if err := registerInvalidateHandler(c.pushProcessor, cache, c.cscKeyPrefix); err != nil { + internal.Logger.Printf(ctx, "csc: failed to register invalidate handler: %v", err) + return + } + c.csc = cache + c.registerConnEvictHook(cache, reg) + c.startBackgroundDrainer() +} + +// cscHook returns the shared evict-on-remove hook, nil when CSC is off. +func (c *baseClient) cscHook() *cscEvictOnRemoveHook { + h, _ := c.cscPoolHook.(*cscEvictOnRemoveHook) + return h +} + +// cscInstallConnCloseHook evicts cn's owned entries on any close — including the +// ConnMaxLifetime/idle retirement path (CloseConn) that bypasses the OnRemove +// hook — so entries don't outlive the server tracking dropped at close. Uses the +// onCscClose slot so it doesn't clobber streaming-credentials cleanup. +func (c *baseClient) cscInstallConnCloseHook(cn *pool.Conn) { + cn.SetOnCscClose(func() error { + c.cscOnConnClose(cn.GetID()) + return nil + }) +} + +// cscInstallConnReinitHook invalidates the old socket's cache coverage before +// SetNetConnAndInitConn replaces it. The later init can then safely enable +// tracking for the new socket without a post-swap publication window. +func (c *baseClient) cscInstallConnReinitHook(cn *pool.Conn) { + cn.SetOnCscReinit(func() { + c.cscEvictOwnedEntries(cn.GetID()) + }) +} + +// cscOnConnClose evicts a closing conn's entries: via the shared hook (which +// records the removed-ring, closing the close-before-fulfill race), else scoped +// EvictByConn on the owning cache. +func (c *baseClient) cscOnConnClose(connID uint64) { + if h := c.cscHook(); h != nil { + h.markRemoved(connID) + return + } + if c.csc != nil { + c.csc.EvictByConn(connID) + } +} + +// poolHookSupport is the pool capability SharedTracking needs to serialize +// cache publication with connection removal and reinitialization. +type poolHookSupport interface { + AddPoolHook(hook pool.PoolHook) + RemovePoolHook(hook pool.PoolHook) + SupportsPoolHooks() bool +} + +// cscEvictOnRemoveHook evicts a connection's owned entries when the pool removes +// it (the server stops delivering their invalidations — Window 2), and tracks +// per-conn init generations so fulfillCached can catch a value whose owning +// conn was removed or re-initialized mid-fetch. +type cscEvictOnRemoveHook struct { + evictor Cache + + mu sync.Mutex + // initGen counts a live conn's socket (re)initializations: bumped by + // cscEvictOwnedEntries before its eviction (first init included, so every + // serving conn has gen >= 1), deleted on removal/close. fulfillCached + // compares it with the generation captured at reply time. + initGen map[uint64]uint64 +} + +func (h *cscEvictOnRemoveHook) OnGet(_ context.Context, _ *pool.Conn, _ bool) (bool, error) { + return true, nil +} + +func (h *cscEvictOnRemoveHook) OnPut(_ context.Context, _ *pool.Conn) (shouldPool, shouldRemove bool, err error) { + return true, false, nil +} + +func (h *cscEvictOnRemoveHook) OnRemove(_ context.Context, cn *pool.Conn, _ error) { + if cn == nil { + return + } + h.markRemoved(cn.GetID()) +} + +// markRemoved forgets connID's generation, then evicts. Forgetting before +// evicting lets a racing fulfillCached see the change (a served conn's captured +// generation is >= 1, an absent entry reads 0) and drop an entry created after +// the eviction — closing the close-before-fulfill race. +func (h *cscEvictOnRemoveHook) markRemoved(connID uint64) { + h.forgetConn(connID) + h.evictor.EvictByConn(connID) +} + +// bumpInitGen advances connID's coverage generation. On reinit it is called by +// the pre-swap hook, before the old socket and its server-side tracking table +// are replaced. +func (h *cscEvictOnRemoveHook) bumpInitGen(connID uint64) { + h.mu.Lock() + if h.initGen == nil { + h.initGen = make(map[uint64]uint64) + } + h.initGen[connID]++ + h.mu.Unlock() +} + +// invalidateConnCoverage revokes all cache coverage associated with connID. +// Bumping before eviction also rejects an in-flight fetch that completed on the +// connection just before it left the parent's invalidation drainer. +func (h *cscEvictOnRemoveHook) invalidateConnCoverage(connID uint64) { + h.bumpInitGen(connID) + h.evictor.EvictByConn(connID) +} + +// initGenOf returns connID's current init generation (0 if never bumped). +func (h *cscEvictOnRemoveHook) initGenOf(connID uint64) uint64 { + h.mu.Lock() + defer h.mu.Unlock() + return h.initGen[connID] +} + +// forgetConn drops connID's init-generation entry: the conn was removed/closed, +// or its init failed before ever serving (the pubsub path would otherwise leak +// the entry — no OnRemove hook, close hook not yet installed). +func (h *cscEvictOnRemoveHook) forgetConn(connID uint64) { + h.mu.Lock() + delete(h.initGen, connID) + h.mu.Unlock() +} + +// fulfillOwnedIfCovered linearizes the final coverage check with connection +// removal/re-init generation changes. Holding h.mu through FulfillOwned means +// either the old generation is rejected before the placeholder becomes valid, +// or publication wins first and the subsequent lifecycle path evicts it before +// closing/replacing the tracked socket. +func (h *cscEvictOnRemoveHook) fulfillOwnedIfCovered( + cacheKey string, + token, ownerConnID, capturedGen uint64, + value []byte, +) bool { + h.mu.Lock() + defer h.mu.Unlock() + if h.initGen[ownerConnID] != capturedGen { + return false + } + return h.evictor.FulfillOwned(cacheKey, token, ownerConnID, value) +} + +// invalidateAllCoverage revokes every connection generation known to this +// client's pool and evicts the entries those connections own. Incrementing +// instead of deleting keeps in-flight fetches that captured an old generation +// from publishing after a drainer stops. +func (h *cscEvictOnRemoveHook) invalidateAllCoverage() { + h.mu.Lock() + connIDs := make([]uint64, 0, len(h.initGen)) + for connID := range h.initGen { + h.initGen[connID]++ + connIDs = append(connIDs, connID) + } + h.mu.Unlock() + + for _, connID := range connIDs { + h.evictor.EvictByConn(connID) + } +} + +// registerConnEvictHook wires the required OnRemove eviction hook. +func (c *baseClient) registerConnEvictHook(cache Cache, reg poolHookSupport) { + h := &cscEvictOnRemoveHook{evictor: cache, initGen: make(map[uint64]uint64)} + reg.AddPoolHook(h) + c.cscPoolHook = h +} + +// cscEvictOwnedEntries evicts connID's entries on first init or immediately +// before a reinit/handoff replaces the socket and its tracking table. It +// prefers the shared hook (so Conn/Tx, which carry it but have a nil csc, still +// evict from the parent cache). Scoped only — no removed-ring (the conn keeps +// serving, and the ring never ages out); the fulfill-vs-re-init race is closed +// by the init-generation bump instead. No custom-cache flush (this also runs on +// first init). +func (c *baseClient) cscEvictOwnedEntries(connID uint64) { + if h := c.cscHook(); h != nil { + h.invalidateConnCoverage(connID) + return + } + if c.csc == nil { + return + } + c.csc.EvictByConn(connID) +} + +// newStickyConnPool creates a derived sticky pool and revokes the claimed +// connection's parent-cache ownership before it becomes unreachable to the +// parent's idle-connection drainer. +func (c *baseClient) newStickyConnPool() *pool.StickyConnPool { + sticky := pool.NewStickyConnPool(c.connPool) + if h := c.cscHook(); h != nil { + sticky.SetOnFirstConn(func(cn *pool.Conn) { + if cn != nil { + h.invalidateConnCoverage(cn.GetID()) + } + }) + } + return sticky +} + +// cscFetchCapture receives, from the successful attempt's reply read — while +// the serving connection is still held — everything the CSC fetch path needs to +// attribute the cached entry: the raw RESP reply, the conn id, and the conn's +// CSC init generation. The generation must be captured before the conn is +// released: a handoff queued at Put can re-init the socket (bumping the +// generation) before fulfillCached runs. +type cscFetchCapture struct { + raw []byte + connID uint64 + initGen uint64 +} + +// cscConnInitGen returns connID's CSC init generation, captured by _process at +// reply time (while the conn is still held) and compared by fulfillCached via +// fulfillOwnedIfCovered. Zero without an active evict-on-remove hook. +func (c *baseClient) cscConnInitGen(connID uint64) uint64 { + if h := c.cscHook(); h != nil { + return h.initGenOf(connID) + } + return 0 +} + +// cscForgetConn drops connID's init-generation entry when initialization does +// not establish tracked coverage, either because init failed or tracking was +// rejected and CSC was disabled. +func (c *baseClient) cscForgetConn(connID uint64) { + if h := c.cscHook(); h != nil { + h.forgetConn(connID) + } +} + +// errClientTrackingWithCSC rejects CLIENT TRACKING on clients with built-in CSC +// (see the guards in baseClient.process and generalProcessPipeline). The raw +// escape hatches — Do(ctx, "client", "tracking", ...) with string or []byte +// args, and pipelines — are also caught: the guard matches on the command's +// leading args, not the typed method. +var errClientTrackingWithCSC = errors.New( + "redis: CLIENT TRACKING is not allowed when client-side caching is enabled") + +// errSelectWithCSC rejects runtime SELECT on clients with built-in CSC. Cache +// keys use Options.DB, while SELECT mutates only the chosen pool connection. +var errSelectWithCSC = errors.New( + "redis: SELECT is not allowed when client-side caching is enabled") + +// errAuthWithCSC rejects runtime authentication because it can change one +// connection's ACL identity without changing the client's fixed cache namespace. +var errAuthWithCSC = errors.New( + "redis: AUTH is not allowed when client-side caching is enabled") + +// errHelloWithCSC rejects HELLO with arguments because it can switch a tracked +// connection out of RESP3 (and can also change authentication). +var errHelloWithCSC = errors.New( + "redis: HELLO with arguments is not allowed when client-side caching is enabled") + +// errResetWithCSC rejects RESET because it disables tracking and switches the +// connection to RESP2. +var errResetWithCSC = errors.New( + "redis: RESET is not allowed when client-side caching is enabled") + +// errSubscribeWithCSC rejects raw subscriptions on the ordinary pool. The +// typed Subscribe methods use dedicated PubSub connections and remain allowed. +var errSubscribeWithCSC = errors.New( + "redis: SUBSCRIBE is not allowed on pooled connections when client-side caching is enabled") + +// cscCommandError rejects commands that can make a pooled connection's state +// diverge from the assumptions used by CSC. +func (c *baseClient) cscCommandError(cmd Cmder) error { + // The successful attachment signal is shared with derived clients. + // initConn's internal command wrapper is exempt during library setup. + if !c.cscTrackingRequested() || c.allowClientTracking { + return nil + } + switch { + case isClientTrackingCmd(cmd): + return errClientTrackingWithCSC + case isSelectCmd(cmd): + return errSelectWithCSC + case isAuthCmd(cmd): + return errAuthWithCSC + case isProtocolChangingHelloCmd(cmd): + return errHelloWithCSC + case isResetCmd(cmd): + return errResetWithCSC + case isSubscribeCmd(cmd): + return errSubscribeWithCSC + default: + return nil + } +} + +// cscDrainHandle owns the drainer lifecycle and serializes client teardown. +// stop signals shutdown; done is closed on exit so Close can join. +type cscDrainHandle struct { + stop chan struct{} + done chan struct{} + stopOnce sync.Once + teardownOnce sync.Once + handlerCloseOnce sync.Once + closeOnce sync.Once + closeErr error + invalidateHandler *invalidateHandler +} + +// signalStop closes stop at most once (so Close and the AddCleanup safety net +// can't double-close) and does not join — a GC cleanup must not block. +func (h *cscDrainHandle) signalStop() { + h.stopOnce.Do(func() { close(h.stop) }) +} + +// cscHandlerClient is exposed only through the background drainer's handler +// context. Close must return before the handler does, otherwise it would wait +// for the drainer goroutine that is currently invoking the handler. +type cscHandlerClient struct { + *baseClient +} + +func (c cscHandlerClient) Close() error { + h := c.cscDrainHandle + if h == nil { + return c.baseClient.Close() + } + h.handlerCloseOnce.Do(func() { + // Close has logically started: stop cache hits immediately and let the + // drainer exit as soon as this handler returns. + if c.cscActive != nil { + c.cscActive.Store(false) + } + h.signalStop() + go func() { + if err := c.baseClient.Close(); err != nil { + internal.Logger.Printf(context.Background(), "csc: deferred client close failed: %v", err) + } + }() + }) + return nil +} + +// cscMinDrainInterval floors a user-supplied DrainInterval: sub-millisecond +// timers are unreliable (https://github.com/golang/go/issues/53824). +const cscMinDrainInterval = time.Millisecond + +// cscDrainInterval returns DrainInterval clamped to cscMinDrainInterval, or the +// default (cscDrainSkipWindow) when unset. +func (c *baseClient) cscDrainInterval() time.Duration { + if cfg := c.opt.ClientSideCacheConfig; cfg != nil && cfg.DrainInterval > 0 { + if cfg.DrainInterval < cscMinDrainInterval { + return cscMinDrainInterval + } + return cfg.DrainInterval + } + return cscDrainSkipWindow +} + +// idleConnDrainer is the pooler capability the drainer needs (*pool.ConnPool has +// it). attachSharedTrackingCSC leaves a pooler without it uncached, rather than +// serve entries nothing would invalidate. +type idleConnDrainer interface { + DrainIdleConns(ctx context.Context, st *pool.DrainState, fn func(cn *pool.Conn) error) +} + +// startBackgroundDrainer launches the per-client invalidation drainer: each tick +// runs one pool.DrainIdleConns pass, draining idle conns' buffered push frames. +// No-op for poolers that don't implement idleConnDrainer. +func (c *baseClient) startBackgroundDrainer() { + cp, ok := c.connPool.(idleConnDrainer) + if !ok { + return + } + if c.cscDrainHandle != nil { + return // already running (startBackgroundDrainer runs once, in NewClient) + } + h := &cscDrainHandle{ + stop: make(chan struct{}), + done: make(chan struct{}), + invalidateHandler: lookupInvalidateHandler(c.pushProcessor), + } + c.cscDrainHandle = h + active := &atomic.Bool{} + active.Store(true) + c.cscActive = active + interval := c.cscDrainInterval() + // Custom-processor drain errors are connection-fatal (drainPushNotifications), + // so a PERSISTENTLY failing custom processor would turn every tick into a + // conn removal + redial — a sustained dial storm. Damping: after + // cscDrainCustomErrCap consecutive fatal custom-processor drains, disable + // CSC serving and stop the drainer (with one log line) instead of churning. + // Built-in processor errors are real conn desyncs and are never damped. + _, builtinProc := c.pushProcessor.(*push.Processor) + go func() { + defer func() { + active.Store(false) + if c.cscPoolHook != nil { + if reg, ok := c.connPool.(poolHookSupport); ok { + reg.RemovePoolHook(c.cscPoolHook) + } + } + if hook := c.cscHook(); hook != nil { + hook.invalidateAllCoverage() + } + if h.invalidateHandler != nil { + h.invalidateHandler.release() + } + close(h.done) + }() + ticker := time.NewTicker(interval) + defer ticker.Stop() + // st persists round/visited across ticks; single-goroutine, no lock. + var st pool.DrainState + consecFatal := 0 + drain := func(cn *pool.Conn) error { + processorSucceeded, err := c.drainPushNotifications(cn) + switch { + case err != nil: + consecFatal++ + case processorSucceeded: + // A successful processor invocation resets consecutive + // failures. A conn skipped without invoking the processor — + // including a clean replacement after a fatal drain — does + // not reset the counter. + consecFatal = 0 + } + return err + } + for { + select { + case <-h.stop: + return + case <-ticker.C: + if !active.Load() { + return + } + // ctx bounds the whole pass; the drain read has its own hard deadline. + cycleCtx, cancel := context.WithTimeout(context.Background(), interval/2) + cp.DrainIdleConns(cycleCtx, &st, drain) + cancel() + if !builtinProc && consecFatal >= cscDrainCustomErrCap { + internal.Logger.Printf(context.Background(), + "csc: disabling client-side caching: the custom push notification processor failed %d consecutive drains "+ + "(each failure removes a connection because the reader may be mid-frame); "+ + "caching cannot be kept fresh safely with this processor", consecFatal) + return + } + } + } + }() +} + +// disableCSCServing atomically stops cache hits and revokes all tracked +// connection coverage. The owner drainer observes the shared active flag on its +// next tick, including when a derived Conn or Tx discovered the incompatibility. +func (c *baseClient) disableCSCServing(ctx context.Context, reason string) { + active := c.cscActive + if active == nil || !active.CompareAndSwap(true, false) { + return + } + if hook := c.cscHook(); hook != nil { + hook.invalidateAllCoverage() + } + internal.Logger.Printf(ctx, "csc: disabling client-side caching: %s", reason) +} + +// stopBackgroundDrainer joins the drainer goroutine and flushes an owned cache. +// The drainer's exit path releases its handler binding and pool hook, including +// when it stops itself. Owner-only: clones have no handle and return early. +// The fields are never cleared here — fulfillCached reads cscPoolHook on the hot +// path, so niling under a concurrent Close would race; teardownOnce makes repeat +// Close idempotent instead. +func (c *baseClient) stopBackgroundDrainer() { + h := c.cscDrainHandle + if h == nil { + return + } + h.teardownOnce.Do(func() { + // Stop serving cache hits on any clone before the drainer is gone. + if c.cscActive != nil { + c.cscActive.Store(false) + } + h.signalStop() + <-h.done + // The drainer's exit defer revoked and evicted this pool's coverage + // before closing done, including for injected caches shared elsewhere. + if c.cscOwnsCache && c.csc != nil { + c.csc.Flush() + } + }) +} + +// applyCachedReply populates cmd from a previously captured raw RESP reply by +// replaying it through the command's own readReply. +func applyCachedReply(cmd Cmder, raw []byte) error { + return cmd.readReply(proto.NewReaderSize(bytes.NewReader(raw), len(raw)+1)) +} + +// isCacheableReplyResult reports whether a fully read Redis reply can be +// cached. redis.Nil is a normal negative lookup, not a transport/protocol +// failure; tracking will invalidate it if the key is later created. +func isCacheableReplyResult(err error) bool { + return err == nil || err == Nil +} + +// cscDrainSkipWindow is the default SharedTracking drain period (overridable via +// ClientSideCacheConfig.DrainInterval). A buffered invalidation is picked up within +// roughly one round; MaxStaleness, when configured, is the hard time-based backstop. +const cscDrainSkipWindow = 5 * time.Millisecond + +// cscDrainHardReadCap is the hard socket read deadline the drainer applies via +// Conn.WithReaderHardDeadline. It bounds only a rare partial-frame mid-read. A +// var (not const) so the tuning harness can sweep it. +var cscDrainHardReadCap = 50 * time.Millisecond + +// cscDrainProbeReadCap bounds the non-consuming one-byte probe used only when +// an opaque transport may hold data that the socket readiness check cannot see. +const cscDrainProbeReadCap = 50 * time.Microsecond + +// cscDrainCustomErrCap is the number of CONSECUTIVE fatal custom-processor +// drain errors after which the drainer disables CSC instead of removing (and +// redialing) a connection per tick indefinitely. +const cscDrainCustomErrCap = 8 + +// processCached runs the Get-Reserve-Fulfill lifecycle for a cacheable command. +// Only invoked after process has verified that CSC is active and cmd is +// eligible. +func (c *baseClient) processCached(ctx context.Context, cmd Cmder, state *processState) error { + if err := ctx.Err(); err != nil { + return err + } + + // Once the drainer has stopped (owner Close, or the owner dropped without + // Close), no invalidations flow — a surviving clone must not serve stale hits. + if a := c.cscActive; a != nil && !a.Load() { + return c.processWithRetry(ctx, cmd, nil, state) + } + + rawKey, ok := buildCacheKey(cmd) + if !ok { + return c.processWithRetry(ctx, cmd, nil, state) + } + + redisKeys := extractRedisKeys(cmd) + if len(redisKeys) == 0 { + // Without a key list we cannot react to invalidations for this command. + return c.processWithRetry(ctx, cmd, nil, state) + } + + keyPrefix := c.cscKeyPrefix + if keyPrefix == "" { + // A successfully attached client always has a namespace. Fail closed if + // an incomplete custom baseClient reaches this path. + return c.processWithRetry(ctx, cmd, nil, state) + } + key := cscNamespacedKey(keyPrefix, rawKey) + nsRedisKeys := make([]string, len(redisKeys)) + for i, k := range redisKeys { + nsRedisKeys[i] = cscNamespacedKey(keyPrefix, k) + } + + // Serve hits straight from the cache. + if data, ok := c.csc.Get(ctx, key); ok { + if err := ctx.Err(); err != nil { + return err + } + if err := applyCachedReply(cmd, data); isCacheableReplyResult(err) { + return err + } + c.csc.DeleteByCacheKey(key) + } + + token, shouldFetch := c.csc.Reserve(key, nsRedisKeys) + if !shouldFetch { + // Another goroutine is fetching; Get below waits until it completes. + if data, ok := c.csc.Get(ctx, key); ok { + if err := ctx.Err(); err != nil { + return err + } + if err := applyCachedReply(cmd, data); isCacheableReplyResult(err) { + return err + } + c.csc.DeleteByCacheKey(key) + } + // Original fetcher cancelled or its value was invalidated; try to take + // over so later waiters still benefit from the cache. + token, shouldFetch = c.csc.Reserve(key, nsRedisKeys) + } + + var fc cscFetchCapture + var capture *cscFetchCapture + if shouldFetch { + capture = &fc + // Release the placeholder if processWithRetry panics; Cancel on a + // stale token is a no-op. + defer func() { + if capture != nil { + c.csc.Cancel(key, token) + } + }() + } + + err := c.processWithRetry(ctx, cmd, capture, state) + + if shouldFetch { + capture = nil // disarm the deferred Cancel + if isCacheableReplyResult(err) { + c.fulfillCached(key, token, &fc) + } else { + c.csc.Cancel(key, token) + } + } + return err +} + +// fulfillCached stores a fetched value, attributing it to its serving conn when +// an evict-on-remove hook is active so EvictByConn can drop it if that conn is +// removed. It also closes the attribute-vs-coverage races: the conn is released +// before this runs, so its OnRemove eviction — or a handoff re-init's scoped +// eviction — may fire before the entry exists. Publication is serialized with +// the hook's init-generation changes, so a reply whose invalidation coverage +// was already lost never becomes visible and never wakes waiters with stale +// data. +func (c *baseClient) fulfillCached(key string, token uint64, fc *cscFetchCapture) bool { + if active := c.cscActive; active != nil && !active.Load() { + c.csc.Cancel(key, token) + return false + } + if hook := c.cscHook(); hook != nil { + if fc.connID == 0 { + // Invariant: an active hook always gets a real conn id (>=1). A zero id + // would leave the entry unattributed and un-evictable, so fail closed. + c.csc.Cancel(key, token) + return false + } + if !hook.fulfillOwnedIfCovered(key, token, fc.connID, fc.initGen, fc.raw) { + // A coverage mismatch leaves the reservation IN_PROGRESS because + // FulfillOwned was deliberately skipped. Cancel wakes its waiters + // as misses so one can safely refetch on a covered connection. + c.csc.Cancel(key, token) + return false + } + return true + } + return c.csc.FulfillOwned(key, token, 0, fc.raw) +} diff --git a/vendor/github.com/redis/go-redis/v9/csc_stats.go b/vendor/github.com/redis/go-redis/v9/csc_stats.go new file mode 100644 index 000000000..d14d3fcf6 --- /dev/null +++ b/vendor/github.com/redis/go-redis/v9/csc_stats.go @@ -0,0 +1,36 @@ +package redis + +// CSCStats reports cumulative client-side cache activity and current +// residency. +// +// Experimental: this API may change in a minor release. +type CSCStats struct { + Hits uint64 + Misses uint64 + Entries int + MemoryUsageBytes int64 +} + +// cacheStatsReporter is an optional interface a Cache implementation may +// satisfy to expose statistics. The built-in LocalCache does; user +// implementations are not required to. +type cacheStatsReporter interface { + Stats() CSCStats +} + +// CSCStats returns statistics for this client's client-side cache, read from +// the shared cache when its implementation exposes them (the built-in +// LocalCache does). +// +// It returns a zero value when CSC is not configured or stats are unavailable. +// +// Experimental: this API may change in a minor release. +func (c *Client) CSCStats() CSCStats { + if c == nil || c.baseClient.csc == nil { + return CSCStats{} + } + if r, ok := c.baseClient.csc.(cacheStatsReporter); ok { + return r.Stats() + } + return CSCStats{} +} diff --git a/vendor/github.com/redis/go-redis/v9/docker-compose.yml b/vendor/github.com/redis/go-redis/v9/docker-compose.yml index fed908bea..de9683a68 100644 --- a/vendor/github.com/redis/go-redis/v9/docker-compose.yml +++ b/vendor/github.com/redis/go-redis/v9/docker-compose.yml @@ -1,6 +1,6 @@ --- -x-default-image: &default-image ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:8.8.0} +x-default-image: &default-image ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:8.10.0} services: redis: diff --git a/vendor/github.com/redis/go-redis/v9/error.go b/vendor/github.com/redis/go-redis/v9/error.go index 06ecca740..ad3a81b76 100644 --- a/vendor/github.com/redis/go-redis/v9/error.go +++ b/vendor/github.com/redis/go-redis/v9/error.go @@ -168,6 +168,9 @@ func shouldRetry(err error, retryTimeout bool) bool { return true } + // Other server errors are not retried. This includes the logical + // -SEARCH_TIMEOUT (search-on-timeout fail): retrying would just repeat the + // same expensive query. return false } diff --git a/vendor/github.com/redis/go-redis/v9/generic_commands.go b/vendor/github.com/redis/go-redis/v9/generic_commands.go index c7100222c..6d6d8e77a 100644 --- a/vendor/github.com/redis/go-redis/v9/generic_commands.go +++ b/vendor/github.com/redis/go-redis/v9/generic_commands.go @@ -129,6 +129,9 @@ func (c cmdable) ExpireAt(ctx context.Context, key string, tm time.Time) *BoolCm return cmd } +// ExpireTime returns the absolute expiration time of key as a Unix timestamp +// encoded in *DurationCmd (seconds since the epoch), not a remaining TTL. +// Convert with: time.Unix(int64(d/time.Second), 0). Use TTL/PTTL for remaining TTL. func (c cmdable) ExpireTime(ctx context.Context, key string) *DurationCmd { cmd := NewDurationCmd(ctx, time.Second, "expiretime", key) _ = c(ctx, cmd) @@ -209,6 +212,9 @@ func (c cmdable) PExpireAt(ctx context.Context, key string, tm time.Time) *BoolC return cmd } +// PExpireTime returns the absolute expiration time of key as a Unix timestamp +// encoded in *DurationCmd (milliseconds since the epoch), not a remaining TTL. +// Convert with: time.UnixMilli(int64(d/time.Millisecond)). Use TTL/PTTL for remaining TTL. func (c cmdable) PExpireTime(ctx context.Context, key string) *DurationCmd { cmd := NewDurationCmd(ctx, time.Millisecond, "pexpiretime", key) _ = c(ctx, cmd) diff --git a/vendor/github.com/redis/go-redis/v9/hash_commands.go b/vendor/github.com/redis/go-redis/v9/hash_commands.go index 256b8746b..3174eab79 100644 --- a/vendor/github.com/redis/go-redis/v9/hash_commands.go +++ b/vendor/github.com/redis/go-redis/v9/hash_commands.go @@ -44,6 +44,11 @@ type HashCmdable interface { HPExpireTime(ctx context.Context, key string, fields ...string) *IntSliceCmd HTTL(ctx context.Context, key string, fields ...string) *IntSliceCmd HPTTL(ctx context.Context, key string, fields ...string) *IntSliceCmd + // note: the HIMPORT API is experimental and may be subject to change. + HImportPrepare(ctx context.Context, fieldsetName string, fields ...string) *StatusCmd + HImportSet(ctx context.Context, key, fieldsetName string, values ...interface{}) *StatusCmd + HImportDiscard(ctx context.Context, fieldsetName string) *IntCmd + HImportDiscardAll(ctx context.Context) *IntCmd } func (c cmdable) HDel(ctx context.Context, key string, fields ...string) *IntCmd { diff --git a/vendor/github.com/redis/go-redis/v9/himport.go b/vendor/github.com/redis/go-redis/v9/himport.go new file mode 100644 index 000000000..a1d9125af --- /dev/null +++ b/vendor/github.com/redis/go-redis/v9/himport.go @@ -0,0 +1,473 @@ +package redis + +import ( + "context" + "strings" + "sync" + + "github.com/redis/go-redis/v9/internal" + "github.com/redis/go-redis/v9/internal/pool" + "github.com/redis/go-redis/v9/internal/proto" +) + +// himportFieldset is the client-side record of a fieldset registered with +// HImportPrepare. +type himportFieldset struct { + fields []string + version uint64 +} + +// himportRegistry remembers fieldsets registered through a client so HIMPORT +// SET can lazily prepare them on whichever pooled connection it executes. +// Versions increase monotonically and start at 1; re-registering a name under +// a new version invalidates every connection's prepared flag for it, so a +// replaced fieldset is re-prepared before its next use. +// +// Discards propagate lazily as well: a discarded name is kept as a tombstone +// and the discard-all counter as an epoch, and connections whose sessions +// still hold discarded fieldsets replay HIMPORT DISCARD/DISCARDALL before +// their next HIMPORT command (see baseClient.himportInjectedCmds). +type himportRegistry struct { + mu sync.RWMutex + nextVersion uint64 + fieldsets map[string]himportFieldset + // tombstones holds names discarded through this client whose server-side + // copies may survive on pooled connections that prepared them. An entry + // is removed when the name is registered again (the new version replaces + // the fieldset on the server, so no discard is needed) or by discardAll. + // Known limitation: a workload discarding many uniquely-named fieldsets + // grows this map for the client's lifetime and pays an O(tombstones) + // snapshot per HIMPORT round trip; HImportDiscardAll resets it. + tombstones map[string]struct{} + // discardAllEpoch increments on every successful HImportDiscardAll. + discardAllEpoch uint64 +} + +func newHImportRegistry() *himportRegistry { + return &himportRegistry{} +} + +// register stores the fieldset and returns its new version together with the +// current discard-all epoch. +func (r *himportRegistry) register(name string, fields []string) (version, epoch uint64) { + r.mu.Lock() + defer r.mu.Unlock() + if r.fieldsets == nil { + r.fieldsets = make(map[string]himportFieldset) + } + delete(r.tombstones, name) + r.nextVersion++ + r.fieldsets[name] = himportFieldset{ + fields: append([]string(nil), fields...), + version: r.nextVersion, + } + return r.nextVersion, r.discardAllEpoch +} + +func (r *himportRegistry) lookup(name string) (himportFieldset, bool) { + if r == nil { + return himportFieldset{}, false + } + r.mu.RLock() + fs, ok := r.fieldsets[name] + r.mu.RUnlock() + return fs, ok +} + +// discard removes the fieldset and leaves a tombstone so connections whose +// sessions still hold it replay the DISCARD before their next HIMPORT +// command. It reports whether the fieldset was registered. +func (r *himportRegistry) discard(name string) bool { + r.mu.Lock() + defer r.mu.Unlock() + if _, ok := r.fieldsets[name]; !ok { + return false + } + delete(r.fieldsets, name) + if r.tombstones == nil { + r.tombstones = make(map[string]struct{}) + } + r.tombstones[name] = struct{}{} + return true +} + +// discardAll drops every fieldset and tombstone and moves to a new epoch; +// connections prepared under an older epoch replay HIMPORT DISCARDALL before +// their next HIMPORT command. It returns the new epoch and the number of +// fieldsets that were registered. +func (r *himportRegistry) discardAll() (epoch uint64, removed int) { + r.mu.Lock() + removed = len(r.fieldsets) + r.fieldsets = nil + r.tombstones = nil + r.discardAllEpoch++ + epoch = r.discardAllEpoch + r.mu.Unlock() + return epoch, removed +} + +// discardVersion withdraws a registration whose fan-out PREPARE was rejected +// by a server — but only while the entry is still at that version, so a +// concurrent re-registration is not clobbered. A tombstone is left: the +// fan-out may have succeeded on some masters before another rejected it +// (per-node ACLs, rolling upgrades), and those sessions hold the withdrawn +// fieldset; the tombstone makes their next HIMPORT command discard it +// instead of leaving a fieldset the client can no longer address. +func (r *himportRegistry) discardVersion(name string, version uint64) { + r.mu.Lock() + if fs, ok := r.fieldsets[name]; ok && fs.version == version { + delete(r.fieldsets, name) + if r.tombstones == nil { + r.tombstones = make(map[string]struct{}) + } + r.tombstones[name] = struct{}{} + } + r.mu.Unlock() +} + +// refreshVersion bumps a registered fieldset to a new version, keeping its +// fields — but only while the entry is still at the given version, so a +// concurrent re-registration is not disturbed. Every connection's prepared +// flag becomes stale, forcing a re-prepare before the fieldset's next use on +// each of them. Used when a "no such fieldset" reply signals session loss +// that may have hit more connections than the one that reported it (failover, +// cross-region switch, reset storms). +func (r *himportRegistry) refreshVersion(name string, version uint64) { + r.mu.Lock() + if fs, ok := r.fieldsets[name]; ok && fs.version == version { + r.nextVersion++ + fs.version = r.nextVersion + r.fieldsets[name] = fs + } + r.mu.Unlock() +} + +// idle reports whether the registry implies no injection work at all: no +// fieldsets to replay, no tombstones to discard, and no discard-all epoch a +// session could be behind. +func (r *himportRegistry) idle() bool { + if r == nil { + return true + } + r.mu.RLock() + idle := len(r.fieldsets) == 0 && len(r.tombstones) == 0 && r.discardAllEpoch == 0 + r.mu.RUnlock() + return idle +} + +// cleanupSnapshot returns the current epoch and the tombstoned names. +func (r *himportRegistry) cleanupSnapshot() (epoch uint64, tombstones []string) { + r.mu.RLock() + epoch = r.discardAllEpoch + if len(r.tombstones) > 0 { + tombstones = make([]string, 0, len(r.tombstones)) + for name := range r.tombstones { + tombstones = append(tombstones, name) + } + } + r.mu.RUnlock() + return epoch, tombstones +} + +// himportNoSuchFieldset reports whether err is the server's "no such +// fieldset" reply, i.e. an HIMPORT SET executed on a connection whose session +// does not hold the referenced fieldset. +func himportNoSuchFieldset(err error) bool { + return isRedisError(err) && strings.Contains(err.Error(), "no such fieldset") +} + +// himportInjectedCmds returns the HIMPORT commands to write to cn ahead of a +// batch, in order: +// +// 1. HIMPORT DISCARDALL when cn's session was prepared under an older +// discard-all epoch; +// 2. HIMPORT DISCARD for each discarded fieldset the session still holds; +// 3. HIMPORT PREPARE for each registered fieldset referenced by an HIMPORT +// SET in the batch that the session lacks at the current version. +// +// A fieldset covered by a user-issued PREPARE earlier in the batch needs no +// injection — the server session holds it by the time the SET runs. Returns +// nil when the batch contains no HIMPORT commands: sessions holding only +// discarded fieldsets are cleaned up on their next HIMPORT use, not on +// unrelated traffic. +func (c *baseClient) himportInjectedCmds(ctx context.Context, cn *pool.Conn, cmds []Cmder) []Cmder { + if c.himport.idle() { + return nil + } + hasHImport := false + for _, cmd := range cmds { + if _, ok := cmd.(himportCmder); ok { + hasHImport = true + break + } + } + if !hasHImport { + return nil + } + + var injected []Cmder + + // Discards first: a session behind the discard-all epoch is wiped + // entirely; otherwise individual tombstoned fieldsets it still holds are + // discarded. + epoch, tombstones := c.himport.cleanupSnapshot() + sessionWiped := false + if cn.HasPreparedFieldsets() && cn.FieldsetEpoch() != epoch { + da := NewHImportDiscardAllCmd(ctx) + da.registryEpoch = epoch + injected = append(injected, da) + sessionWiped = true + } else { + for _, name := range tombstones { + if cn.FieldsetPreparedVersion(name) != 0 { + injected = append(injected, NewHImportDiscardCmd(ctx, name)) + } + } + } + + // Prepares for registered fieldsets the batch's SETs reference. + var covered map[string]struct{} + cover := func(name string) { + if covered == nil { + covered = make(map[string]struct{}) + } + covered[name] = struct{}{} + } + for _, cmd := range cmds { + switch hc := cmd.(type) { + case *HImportPrepareCmd: + cover(hc.fieldsetName) + case *HImportSetCmd: + if _, ok := covered[hc.fieldsetName]; ok { + continue + } + fs, ok := c.himport.lookup(hc.fieldsetName) + if !ok { + continue + } + if !sessionWiped && cn.FieldsetPreparedVersion(hc.fieldsetName) == fs.version { + continue + } + // The session holds an older version. Discard it before the + // re-prepare: the SET behind it is already on the wire, and if + // the re-prepare fails the SET must answer "no such fieldset" + // rather than silently writing the old version's field names. + if !sessionWiped && cn.FieldsetPreparedVersion(hc.fieldsetName) != 0 { + injected = append(injected, NewHImportDiscardCmd(ctx, hc.fieldsetName)) + } + prep := NewHImportPrepareCmd(ctx, hc.fieldsetName, fs.fields...) + prep.registryVersion = fs.version + prep.registryEpoch = epoch + injected = append(injected, prep) + cover(hc.fieldsetName) + } + } + return injected +} + +// himportReadInjectedReplies consumes the replies of injected HIMPORT +// commands. Server errors are recorded on the command and the connection is +// left readable; transport errors are returned. Successful commands apply +// their prepared-flag bookkeeping on cn. +func (c *baseClient) himportReadInjectedReplies(ctx context.Context, cn *pool.Conn, rd *proto.Reader, injected []Cmder) error { + for _, cmd := range injected { + if err := c.processPendingPushNotificationWithReader(ctx, cn, rd); err != nil { + internal.Logger.Printf(ctx, "push: error processing pending notifications before reading reply: %v", err) + } + err := cmd.readReply(rd) + cmd.SetErr(err) + if err != nil { + if !isRedisError(err) { + return err + } + // A failed injected PREPARE becomes the root cause of the + // dependent SETs' errors downstream; a failed injected discard + // only delays cleanup until the next HIMPORT command. + internal.Logger.Printf(ctx, "himport: injected %s failed: %v", cmd.Name(), err) + continue + } + switch hc := cmd.(type) { + case *HImportPrepareCmd: + cn.MarkFieldsetPrepared(hc.fieldsetName, hc.registryVersion, hc.registryEpoch) + case *HImportDiscardCmd: + cn.UnmarkFieldsetPrepared(hc.fieldsetName) + case *HImportDiscardAllCmd: + cn.ClearPreparedFieldsets(hc.registryEpoch) + } + } + return nil +} + +// himportAfterCmd applies registry and prepared-flag updates after a +// user-issued HIMPORT command completed successfully on cn. +func (c *baseClient) himportAfterCmd(cn *pool.Conn, hc himportCmder) { + if c.himport == nil { + return + } + switch cmd := hc.(type) { + case *HImportPrepareCmd: + version, epoch := cmd.registryVersion, cmd.registryEpoch + if version == 0 { + version, epoch = c.himport.register(cmd.fieldsetName, cmd.fields) + } + // A pre-assigned version marks a fan-out copy: the fieldset was + // registered once at the cluster/ring level; only mark the + // executing connection. + cn.MarkFieldsetPrepared(cmd.fieldsetName, version, epoch) + case *HImportDiscardCmd: + registered := c.himport.discard(cmd.fieldsetName) + cn.UnmarkFieldsetPrepared(cmd.fieldsetName) + // The managed API reports the registry lifecycle: 1 when the + // fieldset was registered on this client and is now removed. The + // executing connection's session count stands only for fieldsets + // the registry never knew (raw usage). + if registered { + cmd.SetVal(1) + } + case *HImportDiscardAllCmd: + // A pre-assigned epoch marks a fan-out copy: the registry was + // already wiped at the cluster/ring level; only move the executing + // connection to that epoch. + if cmd.registryEpoch != 0 { + cn.ClearPreparedFieldsets(cmd.registryEpoch) + return + } + epoch, removed := c.himport.discardAll() + cn.ClearPreparedFieldsets(epoch) + // Same registry semantics: report how many registered fieldsets + // were removed, not how many the executing session happened to + // hold. + if removed > 0 { + cmd.SetVal(int64(removed)) + } + } +} + +// himportAfterBatch runs after all replies of a batch were read: it surfaces +// an injected PREPARE failure as the root cause on the HIMPORT SET commands +// that depended on it (their own reply is the secondary "no such fieldset" +// error), invalidates stale prepared flags for SETs that found their +// registered fieldset missing server-side, and applies registry updates for +// user-issued HIMPORT commands that succeeded in the batch. +// rawErr throughout: this runs on the execution path, before an async +// autopipeline batch completes (its ready channel closes only after the +// pipeline hook chain returns) — Err() on a user command would await and +// self-deadlock the dispatcher. +func (c *baseClient) himportAfterBatch(cn *pool.Conn, injected []Cmder, cmds []Cmder) { + var failed map[string]error + var refreshed map[string]struct{} + for _, cmd := range injected { + if prep, ok := cmd.(*HImportPrepareCmd); ok { + if err := prep.Err(); err != nil { + if failed == nil { + failed = make(map[string]error) + } + failed[prep.fieldsetName] = err + } + } + } + for _, cmd := range cmds { + hc, ok := cmd.(himportCmder) + if !ok { + continue + } + if set, ok := hc.(*HImportSetCmd); ok { + if rootCause, ok := failed[set.fieldsetName]; ok && himportNoSuchFieldset(set.rawErr()) { + set.SetErr(rootCause) + continue + } + // The session lost a fieldset the flags claim is prepared (e.g. + // RESET) — and the same event may have wiped other sessions + // whose flags also still look current. Bump the fieldset + // version once so the SET's re-issue, the cluster re-queue on + // whichever connection it lands, or the caller's transaction + // retry replays the PREPARE. + if himportNoSuchFieldset(set.rawErr()) { + if _, done := refreshed[set.fieldsetName]; !done { + if refreshed == nil { + refreshed = make(map[string]struct{}) + } + refreshed[set.fieldsetName] = struct{}{} + if fs, registered := c.himport.lookup(set.fieldsetName); registered { + c.himport.refreshVersion(set.fieldsetName, fs.version) + } + } + } + continue + } + if hc.rawErr() == nil { + c.himportAfterCmd(cn, hc) + } + } +} + +// himportRetryFailedSets re-issues, once, the HIMPORT SET commands of a +// pipeline batch that failed with "no such fieldset" while their fieldset is +// registered — the error must not surface for managed fieldsets (NF.4). Only +// the SETs are re-sent: HIMPORT SET is a full replace, so re-execution is +// idempotent, and no other command of the batch runs again. Their prepared +// flags were invalidated by himportAfterBatch, so himportInjectedCmds +// regenerates the PREPAREs for this connection. Transport errors are +// returned; server errors stay recorded on the commands. +// (The retry does not carry an ASKING prefix. A redirected [ASKING, SET] +// pair whose injected PREPARE failed is excluded by the root-cause swap in +// himportAfterBatch; one that lost its session without an injection can be +// re-issued here, and the bare SET then draws a fresh MOVED/ASK that the +// outer cluster redirect handling resolves.) +func (c *baseClient) himportRetryFailedSets(ctx context.Context, cn *pool.Conn, cmds []Cmder) error { + if c.himport.idle() { + return nil + } + var retry []Cmder + for _, cmd := range cmds { + // rawErr: execution path, same self-deadlock rule as himportAfterBatch. + if set, ok := cmd.(*HImportSetCmd); ok && himportNoSuchFieldset(set.rawErr()) { + if _, registered := c.himport.lookup(set.fieldsetName); registered { + retry = append(retry, set) + } + } + } + if len(retry) == 0 { + return nil + } + + injected := c.himportInjectedCmds(ctx, cn, retry) + if err := cn.WithWriter(c.context(ctx), c.opt.WriteTimeout, func(wr *proto.Writer) error { + for _, ic := range injected { + if err := writeCmd(wr, ic); err != nil { + return err + } + } + return writeCmds(wr, retry) + }); err != nil { + return err + } + return cn.WithReader(c.context(ctx), c.opt.ReadTimeout, func(rd *proto.Reader) error { + if err := c.himportReadInjectedReplies(ctx, cn, rd, injected); err != nil { + return err + } + err := c.pipelineReadCmds(ctx, cn, rd, retry) + if err != nil && !isRedisError(err) { + return err + } + // Server errors (including a repeated failure) stay on the + // individual commands; the batch as a whole is done. + c.himportAfterBatch(cn, injected, retry) + return nil + }) +} + +// himportShouldRetrySet reports whether a retry of cmd may succeed after it +// failed with "no such fieldset": true when the fieldset is registered +// client-side — the executing connection lost its server session state (for +// example a RESET, or a concurrent discard). The connection's prepared flag +// was already invalidated inside _process, while that goroutine still owned +// the connection, so the retry re-prepares lazily wherever it lands. +func (c *baseClient) himportShouldRetrySet(cmd Cmder, err error) bool { + set, ok := cmd.(*HImportSetCmd) + if !ok || !himportNoSuchFieldset(err) { + return false + } + _, registered := c.himport.lookup(set.fieldsetName) + return registered +} diff --git a/vendor/github.com/redis/go-redis/v9/himport_cluster.go b/vendor/github.com/redis/go-redis/v9/himport_cluster.go new file mode 100644 index 000000000..57cddb0da --- /dev/null +++ b/vendor/github.com/redis/go-redis/v9/himport_cluster.go @@ -0,0 +1,206 @@ +package redis + +import "context" + +// Cluster and ring support for the HIMPORT command family. +// +// Correctness comes from the shared registry: every node/shard client holds +// the same himportRegistry (wired at client construction), so any connection +// executing an HIMPORT SET lazily replays the PREPARE, MOVED/ASK redirects +// re-prepare on the target node, and discards propagate through tombstones +// and the discard-all epoch. Replicas share the registry too — roles change +// with the topology, and a promoted replica's connections simply carry no +// prepared flags, so their first SET self-prepares. +// +// On top of that, user-issued PREPARE/DISCARD/DISCARDALL fan out eagerly to +// all masters (R.4): one connection per master is prepared/cleaned up front, +// server-side validation surfaces immediately, and leftover session state is +// bounded. The fan-out is best-effort — any connection it does not reach is +// covered by the lazy replay. + +// The fan-out helpers execute the per-node copies through each node client's +// Process, so node-level hooks observe them; the cluster/ring-level +// ProcessHook chain sees only the user's command object, not the fan-out. +// +// Known limitation: an HImportPrepare pipelined together with HImportSets of +// the same new fieldset in one ClusterClient Exec is not ordered across +// nodes — per-node sub-batches run concurrently, and the registration +// happens when the PREPARE's node completes, so SETs routed to other nodes +// can race it and fail with "no such fieldset". Register the fieldset with +// the client-level HImportPrepare before pipelining (the HLD's back-to-back +// PREPARE+SET pattern is a single-connection guarantee). + +// himportForEach runs fn on a set of clients (all cluster masters, or all +// ring shards). +type himportForEach func(ctx context.Context, fn func(ctx context.Context, client *Client) error) error + +// himportRequeueFailedSets re-queues HIMPORT SETs of registered fieldsets +// that failed with "no such fieldset" — their stale prepared flags were just +// invalidated by himportAfterBatch, so the next pipeline attempt re-prepares +// lazily and re-executes only those SETs (a full replace, so idempotent). +// Bounded by the cluster pipeline's attempt budget. +func (c *ClusterClient) himportRequeueFailedSets(ctx context.Context, cmds []Cmder, failedCmds *cmdsMap) { + for _, cmd := range cmds { + // rawErr: runs on the per-node execution goroutine, same + // self-deadlock rule as himportAfterBatch. + if set, ok := cmd.(*HImportSetCmd); ok && himportNoSuchFieldset(set.rawErr()) { + if _, registered := c.himport.lookup(set.fieldsetName); registered { + _ = c.mapCmdsByNode(ctx, failedCmds, []Cmder{set}) + } + } + } +} + +// himportFanOutPrepare registers the fieldset once in the shared registry +// and executes a pre-versioned PREPARE copy on every client; each copy marks +// its executing connection without registering again. A deterministic server +// rejection (e.g. duplicate field name) withdraws the registration; a +// transport failure keeps it, and lazy replay covers the connections the +// fan-out missed (all-succeeded semantics: the first error is reported). +func himportFanOutPrepare(ctx context.Context, registry *himportRegistry, forEach himportForEach, cmd *HImportPrepareCmd) { + version, epoch := registry.register(cmd.fieldsetName, cmd.fields) + err := forEach(ctx, func(ctx context.Context, client *Client) error { + fanCmd := NewHImportPrepareCmd(ctx, cmd.fieldsetName, cmd.fields...) + fanCmd.registryVersion = version + fanCmd.registryEpoch = epoch + return client.Process(ctx, fanCmd) + }) + if err != nil { + if isRedisError(err) { + // Withdraw the registration; the tombstone cleans the sessions + // on which the fan-out succeeded before the rejection. + registry.discardVersion(cmd.fieldsetName, version) + } + cmd.SetErr(err) + return + } + cmd.SetVal("OK") +} + +// himportFanOutDiscard removes the fieldset from the shared registry +// (leaving the tombstone that lazily cleans the connections the fan-out does +// not reach) and discards it on one connection of every client. +func himportFanOutDiscard(ctx context.Context, registry *himportRegistry, forEach himportForEach, cmd *HImportDiscardCmd) { + registered := registry.discard(cmd.fieldsetName) + err := forEach(ctx, func(ctx context.Context, client *Client) error { + return client.Process(ctx, NewHImportDiscardCmd(ctx, cmd.fieldsetName)) + }) + if err != nil { + cmd.SetErr(err) + return + } + if registered { + cmd.SetVal(1) + } else { + cmd.SetVal(0) + } +} + +// himportFanOutDiscardAll wipes the shared registry once and executes a +// pre-epoch DISCARDALL copy on every client; each copy moves its executing +// connection to the new epoch without bumping the registry again. +func himportFanOutDiscardAll(ctx context.Context, registry *himportRegistry, forEach himportForEach, cmd *HImportDiscardAllCmd) { + epoch, removed := registry.discardAll() + err := forEach(ctx, func(ctx context.Context, client *Client) error { + fanCmd := NewHImportDiscardAllCmd(ctx) + fanCmd.registryEpoch = epoch + return client.Process(ctx, fanCmd) + }) + if err != nil { + cmd.SetErr(err) + return + } + cmd.SetVal(int64(removed)) +} + +// HImportPrepare registers the fieldset in the cluster-wide registry and +// eagerly prepares one connection on every master; all other connections — +// including those of replicas promoted later and masters added by +// resharding — are prepared lazily before their first HImportSet. See +// HashCmdable.HImportPrepare (cmdable) for the fieldset semantics. +// +// The fan-out is best-effort and reports the first error: on a server +// rejection (e.g. duplicate field name) the registration is withdrawn and +// any sessions the fan-out already prepared are cleaned lazily; on a +// transport failure the registration is kept and lazy replay covers the +// connections the fan-out missed. +// +// Requires Redis 8.10 or newer. +// +// note: the API is experimental and may be subject to change. +func (c *ClusterClient) HImportPrepare(ctx context.Context, fieldsetName string, fields ...string) *StatusCmd { + cmd := NewHImportPrepareCmd(ctx, fieldsetName, fields...) + himportFanOutPrepare(ctx, c.himport, c.ForEachMaster, cmd) + return &cmd.StatusCmd +} + +// HImportDiscard removes the fieldset from the cluster-wide registry and +// discards it on every master; connections the fan-out does not reach +// replay the discard before their next HIMPORT command. It returns 1 if the +// fieldset was registered on this client and is now removed. +// +// Requires Redis 8.10 or newer. +// +// note: the API is experimental and may be subject to change. +func (c *ClusterClient) HImportDiscard(ctx context.Context, fieldsetName string) *IntCmd { + cmd := NewHImportDiscardCmd(ctx, fieldsetName) + himportFanOutDiscard(ctx, c.himport, c.ForEachMaster, cmd) + return &cmd.IntCmd +} + +// HImportDiscardAll removes all fieldsets from the cluster-wide registry and +// wipes them on every master; connections the fan-out does not reach replay +// the wipe before their next HIMPORT command. It returns the number of +// fieldsets removed from the registry. +// +// Requires Redis 8.10 or newer. +// +// note: the API is experimental and may be subject to change. +func (c *ClusterClient) HImportDiscardAll(ctx context.Context) *IntCmd { + cmd := NewHImportDiscardAllCmd(ctx) + himportFanOutDiscardAll(ctx, c.himport, c.ForEachMaster, cmd) + return &cmd.IntCmd +} + +// HImportPrepare registers the fieldset in the ring-wide registry and +// eagerly prepares one connection on every shard; all other connections are +// prepared lazily before their first HImportSet. The fan-out is best-effort +// with the same failure semantics as ClusterClient.HImportPrepare. See +// HashCmdable.HImportPrepare (cmdable) for the fieldset semantics. +// +// Requires Redis 8.10 or newer. +// +// note: the API is experimental and may be subject to change. +func (c *Ring) HImportPrepare(ctx context.Context, fieldsetName string, fields ...string) *StatusCmd { + cmd := NewHImportPrepareCmd(ctx, fieldsetName, fields...) + himportFanOutPrepare(ctx, c.opt.himport, c.ForEachShard, cmd) + return &cmd.StatusCmd +} + +// HImportDiscard removes the fieldset from the ring-wide registry and +// discards it on every shard; connections the fan-out does not reach replay +// the discard before their next HIMPORT command. It returns 1 if the +// fieldset was registered on this client and is now removed. +// +// Requires Redis 8.10 or newer. +// +// note: the API is experimental and may be subject to change. +func (c *Ring) HImportDiscard(ctx context.Context, fieldsetName string) *IntCmd { + cmd := NewHImportDiscardCmd(ctx, fieldsetName) + himportFanOutDiscard(ctx, c.opt.himport, c.ForEachShard, cmd) + return &cmd.IntCmd +} + +// HImportDiscardAll removes all fieldsets from the ring-wide registry and +// wipes them on every shard; connections the fan-out does not reach replay +// the wipe before their next HIMPORT command. It returns the number of +// fieldsets removed from the registry. +// +// Requires Redis 8.10 or newer. +// +// note: the API is experimental and may be subject to change. +func (c *Ring) HImportDiscardAll(ctx context.Context) *IntCmd { + cmd := NewHImportDiscardAllCmd(ctx) + himportFanOutDiscardAll(ctx, c.opt.himport, c.ForEachShard, cmd) + return &cmd.IntCmd +} diff --git a/vendor/github.com/redis/go-redis/v9/himport_commands.go b/vendor/github.com/redis/go-redis/v9/himport_commands.go new file mode 100644 index 000000000..77e1a98cb --- /dev/null +++ b/vendor/github.com/redis/go-redis/v9/himport_commands.go @@ -0,0 +1,253 @@ +package redis + +import "context" + +// The HIMPORT command family (Redis 8.10+, "hinted hash templates") provides +// fast ingestion of many hashes sharing the same field names. HIMPORT PREPARE +// registers the field names once under a fieldset name, then HIMPORT SET +// creates hashes by sending only the values. +// +// The server scopes a fieldset to the physical connection that prepared it. +// Because go-redis pools connections, the client additionally keeps a +// client-side registry of fieldsets registered through HImportPrepare and +// lazily replays the PREPARE (at most once per connection session) on any +// pooled connection about to execute an HImportSet that references it. See +// himport.go. +// +// The whole HIMPORT surface — the typed methods, the HImport*Cmd types and +// their constructors — is experimental and may be subject to change. + +// himportCmder marks HIMPORT commands that participate in client-side +// fieldset tracking. Process paths do a single interface assertion on the +// hot path and inspect the concrete type only for HIMPORT commands. +type himportCmder interface { + Cmder + himportCmd() +} + +var ( + _ himportCmder = (*HImportPrepareCmd)(nil) + _ himportCmder = (*HImportSetCmd)(nil) + _ himportCmder = (*HImportDiscardCmd)(nil) + _ himportCmder = (*HImportDiscardAllCmd)(nil) +) + +// HImportPrepareCmd represents an HIMPORT PREPARE command. +type HImportPrepareCmd struct { + StatusCmd + + fieldsetName string + fields []string + + // registryVersion and registryEpoch are set only on commands injected by + // the client to replay a registered fieldset onto a connection; on + // success the connection is marked as prepared at this version under + // this discard-all epoch. + registryVersion uint64 + registryEpoch uint64 +} + +func (cmd *HImportPrepareCmd) himportCmd() {} + +// NewHImportPrepareCmd returns an HIMPORT PREPARE command. +func NewHImportPrepareCmd(ctx context.Context, fieldsetName string, fields ...string) *HImportPrepareCmd { + args := make([]interface{}, 3+len(fields)) + args[0] = "himport" + args[1] = "prepare" + args[2] = fieldsetName + for i, field := range fields { + args[3+i] = field + } + return &HImportPrepareCmd{ + StatusCmd: StatusCmd{ + baseCmd: baseCmd{ + ctx: ctx, + args: args, + cmdType: CmdTypeStatus, + }, + }, + fieldsetName: fieldsetName, + fields: append([]string(nil), fields...), + } +} + +// HImportSetCmd represents an HIMPORT SET command. +type HImportSetCmd struct { + StatusCmd + + fieldsetName string +} + +func (cmd *HImportSetCmd) himportCmd() {} + +// NewHImportSetCmd returns an HIMPORT SET command. +func NewHImportSetCmd(ctx context.Context, key, fieldsetName string, values ...interface{}) *HImportSetCmd { + args := make([]interface{}, 4+len(values)) + args[0] = "himport" + args[1] = "set" + args[2] = key + args[3] = fieldsetName + copy(args[4:], values) + cmd := &HImportSetCmd{ + StatusCmd: StatusCmd{ + baseCmd: baseCmd{ + ctx: ctx, + args: args, + cmdType: CmdTypeStatus, + }, + }, + fieldsetName: fieldsetName, + } + cmd.SetFirstKeyPos(2) + return cmd +} + +// HImportDiscardCmd represents an HIMPORT DISCARD command. +type HImportDiscardCmd struct { + IntCmd + + fieldsetName string +} + +func (cmd *HImportDiscardCmd) himportCmd() {} + +// NewHImportDiscardCmd returns an HIMPORT DISCARD command. +func NewHImportDiscardCmd(ctx context.Context, fieldsetName string) *HImportDiscardCmd { + return &HImportDiscardCmd{ + IntCmd: IntCmd{ + baseCmd: baseCmd{ + ctx: ctx, + args: []interface{}{"himport", "discard", fieldsetName}, + cmdType: CmdTypeInt, + }, + }, + fieldsetName: fieldsetName, + } +} + +// HImportDiscardAllCmd represents an HIMPORT DISCARDALL command. +type HImportDiscardAllCmd struct { + IntCmd + + // registryEpoch is set only on commands injected by the client to wipe a + // session that predates the registry's discard-all epoch; on success the + // connection adopts this epoch. + registryEpoch uint64 +} + +func (cmd *HImportDiscardAllCmd) himportCmd() {} + +// NewHImportDiscardAllCmd returns an HIMPORT DISCARDALL command. +func NewHImportDiscardAllCmd(ctx context.Context) *HImportDiscardAllCmd { + return &HImportDiscardAllCmd{ + IntCmd: IntCmd{ + baseCmd: baseCmd{ + ctx: ctx, + args: []interface{}{"himport", "discardall"}, + cmdType: CmdTypeInt, + }, + }, + } +} + +// HImportPrepare registers an ordered list of hash field names under +// fieldsetName for use by subsequent HImportSet calls: +// +// HIMPORT PREPARE fieldset_name field [field ...] +// +// The server keeps the fieldset in the session of the connection that +// executed the command. On pooled clients (Client, Conn, Pipeline, Tx) the +// fieldset is also remembered client-side and the PREPARE is replayed +// lazily — at most once per connection session — on any pooled connection +// about to execute an HImportSet referencing it, so HImportSet works +// transparently across the pool. Preparing an existing fieldset name again +// silently replaces it. +// +// ClusterClient and Ring override this method (see himport_cluster.go): the +// fieldset registers in a registry shared by every node/shard client and the +// PREPARE additionally fans out eagerly to all masters/shards. +// +// Requires Redis 8.10 or newer. +// +// note: the API is experimental and may be subject to change. +func (c cmdable) HImportPrepare(ctx context.Context, fieldsetName string, fields ...string) *StatusCmd { + cmd := NewHImportPrepareCmd(ctx, fieldsetName, fields...) + _ = c(ctx, cmd) + return &cmd.StatusCmd +} + +// HImportSet creates or fully replaces the hash at key using the field list +// registered under fieldsetName, pairing values positionally with the +// prepared fields: +// +// HIMPORT SET key fieldset_name value [value ...] +// +// The number of values must equal the fieldset's field count. The resulting +// key is a regular hash readable and writable by all hash commands. If the +// fieldset was registered through HImportPrepare on this client, it is +// prepared automatically on whichever pooled connection executes the command; +// otherwise the fieldset must have been prepared on the executing connection +// or the server replies "ERR no such fieldset". +// +// "no such fieldset" never surfaces for a registered fieldset: a +// single-command HImportSet whose connection lost its session state (e.g. +// RESET) is transparently re-prepared and retried once — the failure also +// stales every other connection's prepared flag, so the retry re-prepares +// wherever it lands, and this recovery attempt is granted even when retries +// are disabled (MaxRetries -1). In pipelines the failed HImportSets — and +// only those — are re-prepared and re-issued once on the same connection +// (HIMPORT SET is a full replace, so the re-execution is idempotent and no +// other command of the batch runs again). Inside transactions the error does +// surface after EXEC — an executed transaction cannot be partially re-run — +// but the prepared flags are invalidated, so retrying the transaction +// succeeds. +// +// Requires Redis 8.10 or newer. +// +// note: the API is experimental and may be subject to change. +func (c cmdable) HImportSet(ctx context.Context, key, fieldsetName string, values ...interface{}) *StatusCmd { + cmd := NewHImportSetCmd(ctx, key, fieldsetName, values...) + _ = c(ctx, cmd) + return &cmd.StatusCmd +} + +// HImportDiscard removes fieldsetName from the executing connection's session +// and from the client-side registry, stopping further automatic replay: +// +// HIMPORT DISCARD fieldset_name +// +// It returns 1 if the fieldset was registered on this client and is now +// removed, 0 otherwise (for names never registered through the managed API, +// the executing connection's session reply passes through unchanged). Pooled +// connections whose sessions still hold the fieldset replay the DISCARD +// before their next HIMPORT command, so a subsequent HImportSet fails with +// "no such fieldset" on every connection, exactly as on a single connection. +// Hashes already created through the fieldset are not affected. +// +// Requires Redis 8.10 or newer. +// +// note: the API is experimental and may be subject to change. +func (c cmdable) HImportDiscard(ctx context.Context, fieldsetName string) *IntCmd { + cmd := NewHImportDiscardCmd(ctx, fieldsetName) + _ = c(ctx, cmd) + return &cmd.IntCmd +} + +// HImportDiscardAll removes all fieldsets from the executing connection's +// session and clears the client-side registry: +// +// HIMPORT DISCARDALL +// +// It returns the number of fieldsets removed from the client-side registry +// (when none were registered, the executing connection's session count +// passes through). Other pooled connections whose sessions were prepared +// earlier replay HIMPORT DISCARDALL before their next HIMPORT command. +// +// Requires Redis 8.10 or newer. +// +// note: the API is experimental and may be subject to change. +func (c cmdable) HImportDiscardAll(ctx context.Context) *IntCmd { + cmd := NewHImportDiscardAllCmd(ctx) + _ = c(ctx, cmd) + return &cmd.IntCmd +} diff --git a/vendor/github.com/redis/go-redis/v9/internal/once.go b/vendor/github.com/redis/go-redis/v9/internal/once.go index b81244fd6..2d3a8cdc8 100644 --- a/vendor/github.com/redis/go-redis/v9/internal/once.go +++ b/vendor/github.com/redis/go-redis/v9/internal/once.go @@ -27,7 +27,7 @@ import ( // and is re-armed on failure. type Once struct { m sync.Mutex - done uint32 + done atomic.Uint32 } // Do calls the function f if and only if Do has not been invoked @@ -46,17 +46,17 @@ type Once struct { // // err := config.once.Do(func() error { return config.init(filename) }) func (o *Once) Do(f func() error) error { - if atomic.LoadUint32(&o.done) == 1 { + if o.done.Load() == 1 { return nil } // Slow-path. o.m.Lock() defer o.m.Unlock() var err error - if o.done == 0 { + if o.done.Load() == 0 { err = f() if err == nil { - atomic.StoreUint32(&o.done, 1) + o.done.Store(1) } } return err diff --git a/vendor/github.com/redis/go-redis/v9/internal/otel/metrics.go b/vendor/github.com/redis/go-redis/v9/internal/otel/metrics.go index a3f23fffe..2e234ba8b 100644 --- a/vendor/github.com/redis/go-redis/v9/internal/otel/metrics.go +++ b/vendor/github.com/redis/go-redis/v9/internal/otel/metrics.go @@ -155,6 +155,15 @@ func getRecorder() Recorder { return r } +// Enabled reports whether a real recorder is installed. Callers use it to +// skip metric work whose INPUTS are expensive to obtain — e.g. reading a +// command's result, which on the async autopipeline face blocks until the +// command executes. +func Enabled() bool { + _, noop := getRecorder().(noopRecorder) + return !noop +} + // SetGlobalRecorder sets the global recorder (called by Init() in extra/redisotel-native) func SetGlobalRecorder(r Recorder) { recorderMu.Lock() @@ -266,10 +275,15 @@ func (noopRecorder) RecordStreamLag(context.Context, time.Duration, *pool.Conn, func (noopRecorder) RecordConnectionCount(context.Context, int, *pool.Conn, string, bool) {} func (noopRecorder) RecordPendingRequests(context.Context, int, *pool.Conn, string) {} -// RegisterPools registers connection pools with the global recorder. -func RegisterPools(connPool pool.Pooler, pubSubPool PubSubPooler, addr string) { - // Check if the global recorder implements PoolRegistrar - if registrar, ok := globalRecorder.(PoolRegistrar); ok { +// RegisterPools registers connection pools with the global recorder. pipelinePool +// is the optional dedicated pipeline connection pool (nil when not configured); +// it is registered as a regular pool under a "_pipeline" name suffix. +func RegisterPools(connPool pool.Pooler, pubSubPool PubSubPooler, pipelinePool pool.Pooler, addr string) { + // Check if the global recorder implements PoolRegistrar. Read it through + // getRecorder: SetGlobalRecorder writes globalRecorder under recorderMu, and + // clients are created (and closed) concurrently with telemetry being + // installed, so an unlocked read here is a data race -race reports. + if registrar, ok := getRecorder().(PoolRegistrar); ok { // Generate a unique ID for this client's pools uniqueID := generateUniqueID() @@ -281,18 +295,27 @@ func RegisterPools(connPool pool.Pooler, pubSubPool PubSubPooler, addr string) { poolName := addr + "_" + uniqueID + "_pubsub" registrar.RegisterPubSubPool(poolName, pubSubPool) } + if pipelinePool != nil { + poolName := addr + "_" + uniqueID + "_pipeline" + registrar.RegisterPool(poolName, pipelinePool) + } } } -// UnregisterPools removes connection pools from the global recorder -func UnregisterPools(connPool pool.Pooler, pubSubPool PubSubPooler) { - // Check if the global recorder implements PoolRegistrar - if registrar, ok := globalRecorder.(PoolRegistrar); ok { +// UnregisterPools removes connection pools from the global recorder. pipelinePool +// is the optional dedicated pipeline connection pool (nil when not configured). +func UnregisterPools(connPool pool.Pooler, pubSubPool PubSubPooler, pipelinePool pool.Pooler) { + // Check if the global recorder implements PoolRegistrar (see RegisterPools + // for why this goes through getRecorder rather than reading directly). + if registrar, ok := getRecorder().(PoolRegistrar); ok { if connPool != nil { registrar.UnregisterPool(connPool) } if pubSubPool != nil { registrar.UnregisterPubSubPool(pubSubPool) } + if pipelinePool != nil { + registrar.UnregisterPool(pipelinePool) + } } } diff --git a/vendor/github.com/redis/go-redis/v9/internal/pool/conn.go b/vendor/github.com/redis/go-redis/v9/internal/pool/conn.go index 1e836ad44..80f3b77c7 100644 --- a/vendor/github.com/redis/go-redis/v9/internal/pool/conn.go +++ b/vendor/github.com/redis/go-redis/v9/internal/pool/conn.go @@ -45,7 +45,7 @@ func GetCachedTimeNs() int64 { } // Global atomic counter for connection IDs -var connIDCounter uint64 +var connIDCounter atomic.Uint64 // HandoffState represents the atomic state for connection handoffs // This struct is stored atomically to prevent race conditions between @@ -63,7 +63,7 @@ type atomicNetConn struct { // generateConnID generates a fast unique identifier for a connection with zero allocations func generateConnID() uint64 { - return atomic.AddUint64(&connIDCounter, 1) + return connIDCounter.Add(1) } type Conn struct { @@ -109,6 +109,18 @@ type Conn struct { expiresAt time.Time poolName string // Name of the pool this connection belongs to (for metrics) + // preparedFieldsets tracks HIMPORT fieldsets prepared on this + // connection's current server session: fieldset name -> client-side + // registry version. The server drops fieldsets when the session ends, + // so the map is cleared whenever the underlying network connection is + // replaced. preparedFieldsetsEpoch records the registry's discard-all + // epoch the session was prepared under; a session behind the current + // epoch replays HIMPORT DISCARDALL before its next HIMPORT command. + // Guarded by preparedFieldsetsMu; the map is nil until first use. + preparedFieldsetsMu sync.Mutex + preparedFieldsets map[string]uint64 + preparedFieldsetsEpoch uint64 + // When a goroutine closes a connection, it usually knows the reason, so closeReason is not needed. // closeReason is only used when an in-use connection is closed by another goroutine, // to inform the goroutine using the connection why the connection was closed. @@ -135,6 +147,24 @@ type Conn struct { initConnFunc func(context.Context, *Conn) error onClose func() error + + // onCscClose is the client-side-caching close hook, kept separate from + // onClose (streaming-credentials cleanup) so neither clobbers the other. + // Both keep overwrite semantics, so re-running initConn can't accumulate them. + onCscClose func() error + + // onCscReinit runs after the connection is claimed for reinitialization but + // before its socket is replaced. CSC uses it to invalidate entries whose + // server-side tracking coverage belongs to the old socket. + onCscReinit func() + + // cscReadPending requests one conservative drain after a command read through + // a transport whose buffered state cannot be fully observed by MaybeHasData. + cscReadPending atomic.Bool + + // lastCscPeriodicProbeNs throttles bounded fallback reads on platforms and + // opaque transports without a non-consuming readiness mechanism. + lastCscPeriodicProbeNs atomic.Int64 } func NewConn(netConn net.Conn) *Conn { @@ -638,6 +668,18 @@ func (cn *Conn) SetOnClose(fn func() error) { cn.onClose = fn } +// SetOnCscClose sets the client-side-caching close hook, overwriting any +// previous one. It runs on Close in addition to the SetOnClose callback. +func (cn *Conn) SetOnCscClose(fn func() error) { + cn.onCscClose = fn +} + +// SetOnCscReinit sets the client-side-caching pre-reinitialization hook, +// overwriting any previous one. +func (cn *Conn) SetOnCscReinit(fn func()) { + cn.onCscReinit = fn +} + // SetInitConnFunc sets the connection initialization function to be called on reconnections. func (cn *Conn) SetInitConnFunc(fn func(context.Context, *Conn) error) { cn.initConnFunc = fn @@ -661,6 +703,85 @@ func (cn *Conn) SetNetConn(netConn net.Conn) { cn.readerMu.Unlock() cn.bw.Reset(netConn) + + // A new socket is a new server session with no HIMPORT fieldsets and + // nothing left to discard. + cn.ClearPreparedFieldsets(0) +} + +// FieldsetPreparedVersion returns the client-side registry version at which +// the named HIMPORT fieldset was prepared on this connection's current server +// session, or 0 if it was not prepared on it (registry versions start at 1). +func (cn *Conn) FieldsetPreparedVersion(name string) uint64 { + cn.preparedFieldsetsMu.Lock() + version := cn.preparedFieldsets[name] + cn.preparedFieldsetsMu.Unlock() + return version +} + +// MarkFieldsetPrepared records that the named HIMPORT fieldset was prepared +// on this connection's current server session at the given registry version. +// A session acquiring its first fieldset adopts the given discard-all epoch +// (fieldsets prepared after an HIMPORT DISCARDALL are not subject to it); +// the epoch never moves backwards, so a mark carrying an older snapshot +// cannot regress a session already wiped at a newer epoch. +func (cn *Conn) MarkFieldsetPrepared(name string, version, epoch uint64) { + cn.preparedFieldsetsMu.Lock() + if len(cn.preparedFieldsets) == 0 { + cn.preparedFieldsets = make(map[string]uint64) + if epoch > cn.preparedFieldsetsEpoch { + cn.preparedFieldsetsEpoch = epoch + } + } + cn.preparedFieldsets[name] = version + cn.preparedFieldsetsMu.Unlock() +} + +// UnmarkFieldsetPrepared forgets that the named HIMPORT fieldset was prepared +// on this connection, forcing a replay before the next HIMPORT SET using it. +func (cn *Conn) UnmarkFieldsetPrepared(name string) { + cn.preparedFieldsetsMu.Lock() + delete(cn.preparedFieldsets, name) + cn.preparedFieldsetsMu.Unlock() +} + +// HasPreparedFieldsets reports whether any HIMPORT fieldset is prepared on +// this connection's current server session. +func (cn *Conn) HasPreparedFieldsets() bool { + cn.preparedFieldsetsMu.Lock() + n := len(cn.preparedFieldsets) + cn.preparedFieldsetsMu.Unlock() + return n > 0 +} + +// PreparedFieldsetNames returns the names of the HIMPORT fieldsets prepared +// on this connection's current server session. +func (cn *Conn) PreparedFieldsetNames() []string { + cn.preparedFieldsetsMu.Lock() + names := make([]string, 0, len(cn.preparedFieldsets)) + for name := range cn.preparedFieldsets { + names = append(names, name) + } + cn.preparedFieldsetsMu.Unlock() + return names +} + +// FieldsetEpoch returns the discard-all epoch this connection's prepared +// fieldsets belong to (0 when none were ever prepared on the session). +func (cn *Conn) FieldsetEpoch() uint64 { + cn.preparedFieldsetsMu.Lock() + epoch := cn.preparedFieldsetsEpoch + cn.preparedFieldsetsMu.Unlock() + return epoch +} + +// ClearPreparedFieldsets forgets all HIMPORT fieldsets prepared on this +// connection and records the discard-all epoch the wipe corresponds to. +func (cn *Conn) ClearPreparedFieldsets(epoch uint64) { + cn.preparedFieldsetsMu.Lock() + cn.preparedFieldsets = nil + cn.preparedFieldsetsEpoch = epoch + cn.preparedFieldsetsMu.Unlock() } // GetNetConn safely returns the current network connection using atomic load (lock-free). @@ -694,6 +815,10 @@ func (cn *Conn) SetNetConnAndInitConn(ctx context.Context, netConn net.Conn) err return fmt.Errorf("cannot initialize connection from state %s: %w", finalState, err) } + if cn.onCscReinit != nil { + cn.onCscReinit() + } + // Replace the underlying connection cn.SetNetConn(netConn) @@ -774,8 +899,13 @@ func (cn *Conn) MarkQueuedForHandoff() error { // Already unusable - this is fine, keep the new handoff state return nil } - // Restore the original state if transition fails for other reasons - cn.handoffStateAtomic.Store(currentState) + // Restore the original handoff state only if nothing else changed it + // since our CAS above. A concurrent handoff worker may have completed + // the handoff and run ClearHandoffState in this window; a plain Store + // would clobber that, resurrecting ShouldHandoff=true and wedging the + // connection so it can never be acquired again. The CAS leaves the + // worker's state intact when it has taken over. + cn.handoffStateAtomic.CompareAndSwap(newState, currentState) return fmt.Errorf("failed to mark connection as unusable: %w", err) } return nil @@ -871,6 +1001,18 @@ func (cn *Conn) PeekReplyTypeSafe() (byte, error) { return cn.rd.PeekReplyType() } +// PeekReplyTypeForCheck peeks at the reply type while holding readerMu, so it is +// safe against a concurrent SetNetConn resetting the reader during handoff. +// Unlike PeekReplyTypeSafe it does not require the data to already be buffered: +// the pool health check calls it after connCheck reports unexpected socket data, +// and connCheck only MSG_PEEKs, so the byte still has to be pulled from the +// socket into the reader here. +func (cn *Conn) PeekReplyTypeForCheck() (byte, error) { + cn.readerMu.RLock() + defer cn.readerMu.RUnlock() + return cn.rd.PeekReplyType() +} + func (cn *Conn) Write(b []byte) (int, error) { // Lock-free netConn access for better performance if netConn := cn.getNetConn(); netConn != nil { @@ -907,6 +1049,29 @@ func (cn *Conn) WithReader( return fn(cn.rd) } +// WithReaderHardDeadline runs fn under a HARD read deadline of now+timeout, +// bypassing getEffectiveReadTimeout so a relaxed maintenance timeout can't extend +// it (used by the CSC drainer). Takes no context: an expired cycle ctx must not +// become the socket deadline, or the read surfaces context.DeadlineExceeded, which +// isBadConn treats as fatal. +func (cn *Conn) WithReaderHardDeadline( + timeout time.Duration, fn func(rd *proto.Reader) error, +) (err error) { + netConn := cn.getNetConn() + if netConn == nil { + return errConnectionNotAvailable + } + if err := netConn.SetReadDeadline(time.Now().Add(timeout)); err != nil { + return err + } + defer func() { + if clearErr := netConn.SetReadDeadline(time.Time{}); clearErr != nil { + err = clearErr + } + }() + return fn(cn.rd) +} + func (cn *Conn) WithWriter( ctx context.Context, timeout time.Duration, fn func(wr *proto.Writer) error, ) error { @@ -944,17 +1109,29 @@ func (cn *Conn) IsClosed() bool { } func (cn *Conn) Close() error { - if cn.IsClosed() { - return nil + for { + state := cn.stateMachine.GetState() + if state == StateClosed { + return nil + } + if cn.stateMachine.TryTransitionFast(state, StateClosed) { + // TryTransitionFast deliberately skips waiter notification; Close + // still needs to wake any goroutine waiting on initialization. + cn.stateMachine.notifyWaiters() + break + } } - // Transition to CLOSED state - cn.stateMachine.Transition(StateClosed) if cn.onClose != nil { // ignore error _ = cn.onClose() cn.onClose = nil } + if cn.onCscClose != nil { + // ignore error + _ = cn.onCscClose() + cn.onCscClose = nil + } // Lock-free netConn access for better performance if netConn := cn.getNetConn(); netConn != nil { @@ -974,6 +1151,56 @@ func (cn *Conn) MaybeHasData() bool { return false } +// CheckForData reports whether the socket has data ready and surfaces a +// detected closed or failed socket. +func (cn *Conn) CheckForData() (bool, error) { + if netConn := cn.getNetConn(); netConn != nil { + return checkForData(netConn) + } + return false, nil +} + +// MarkCscReadPending requests one conservative CSC drain after a command read +// when the transport may retain data that MaybeHasData cannot observe. +func (cn *Conn) MarkCscReadPending() { + netConn := cn.getNetConn() + if netConn == nil { + return + } + if needsCscReadProbe(netConn) { + cn.cscReadPending.Store(true) + } +} + +// TakeCscReadPending consumes the post-command conservative-drain request. +func (cn *Conn) TakeCscReadPending() bool { + return cn.cscReadPending.Swap(false) +} + +// TakeCscPeriodicReadPending schedules a throttled conservative read for +// transports with no readiness mechanism. It returns true at most once per +// interval, including when several drainer passes race. +func (cn *Conn) TakeCscPeriodicReadPending(interval time.Duration) bool { + netConn := cn.getNetConn() + if netConn == nil || interval <= 0 || !needsCscPeriodicProbe(netConn) { + return false + } + + now := time.Since(cn.createdAt).Nanoseconds() + if now <= 0 { + now = 1 + } + for { + last := cn.lastCscPeriodicProbeNs.Load() + if last != 0 && now >= last && now-last < int64(interval) { + return false + } + if cn.lastCscPeriodicProbeNs.CompareAndSwap(last, now) { + return true + } + } +} + // deadline computes the effective deadline time based on context and timeout. // It updates the usedAt timestamp to now. // Uses cached time to avoid expensive syscall (max 50ms staleness is acceptable for deadline calculation). diff --git a/vendor/github.com/redis/go-redis/v9/internal/pool/conn_check.go b/vendor/github.com/redis/go-redis/v9/internal/pool/conn_check.go index 9e83dd833..333c34ba6 100644 --- a/vendor/github.com/redis/go-redis/v9/internal/pool/conn_check.go +++ b/vendor/github.com/redis/go-redis/v9/internal/pool/conn_check.go @@ -19,10 +19,19 @@ func connCheck(conn net.Conn) error { // Reset previous timeout. _ = conn.SetDeadline(time.Time{}) + // Health checks deliberately inspect only the outer connection. Unwrapping a + // buffered transport such as crypto/tls.Conn can reveal an encrypted + // post-handshake record and make isHealthyConn call PeekReplyType on the TLS + // stream. With the deadline cleared above, TLS may consume that control record + // and then wait forever for application data. sysConn, ok := conn.(syscall.Conn) if !ok { return nil } + return checkSyscallConn(sysConn) +} + +func checkSyscallConn(sysConn syscall.Conn) error { rawConn, err := sysConn.SyscallConn() if err != nil { return err @@ -53,7 +62,62 @@ func connCheck(conn net.Conn) error { return sysErr } +// underlyingSyscallConn unwraps connections that expose their transport through +// NetConn (notably crypto/tls.Conn). Limit the walk so a broken wrapper cannot +// loop forever. +func underlyingSyscallConn(conn net.Conn) (syscall.Conn, bool) { + for range 8 { + if sysConn, ok := conn.(syscall.Conn); ok { + return sysConn, true + } + unwrapper, ok := conn.(interface{ NetConn() net.Conn }) + if !ok { + return nil, false + } + conn = unwrapper.NetConn() + if conn == nil { + return nil, false + } + } + return nil, false +} + // maybeHasData checks if there is data in the socket without consuming it func maybeHasData(conn net.Conn) bool { - return connCheck(conn) == errUnexpectedRead + hasData, _ := checkForData(conn) + return hasData +} + +func checkForData(conn net.Conn) (bool, error) { + // Unlike the general health check, CSC only uses this as a readiness hint + // before a bounded read, so unwrapping TLS is safe and avoids blocking. + _ = conn.SetDeadline(time.Time{}) + sysConn, ok := underlyingSyscallConn(conn) + if !ok { + return false, nil + } + switch err := checkSyscallConn(sysConn); err { + case nil: + return false, nil + case errUnexpectedRead: + return true, nil + default: + return false, err + } +} + +// needsCscReadProbe reports whether a command read may leave data hidden from +// maybeHasData. On Unix a direct syscall.Conn has no intermediate buffering; +// TLS and opaque wrappers need one bounded post-command probe. +func needsCscReadProbe(conn net.Conn) bool { + _, direct := conn.(syscall.Conn) + return !direct +} + +// needsCscPeriodicProbe reports whether the platform can inspect the transport +// at all. Opaque wrappers get a throttled bounded fallback so invalidations that +// arrive after the post-command probe are still eventually consumed. +func needsCscPeriodicProbe(conn net.Conn) bool { + _, ok := underlyingSyscallConn(conn) + return !ok } diff --git a/vendor/github.com/redis/go-redis/v9/internal/pool/conn_check_dummy.go b/vendor/github.com/redis/go-redis/v9/internal/pool/conn_check_dummy.go index f971d94c4..947706619 100644 --- a/vendor/github.com/redis/go-redis/v9/internal/pool/conn_check_dummy.go +++ b/vendor/github.com/redis/go-redis/v9/internal/pool/conn_check_dummy.go @@ -14,7 +14,21 @@ func connCheck(_ net.Conn) error { return nil } -// since we can't check for data on the socket, we just assume there is some +// There is no portable non-consuming readiness check on this platform. +// Returning true would force every idle CSC connection through a timed read on +// every drainer tick. The CSC drainer uses needsCscPeriodicProbe instead. func maybeHasData(_ net.Conn) bool { + return false +} + +func checkForData(_ net.Conn) (bool, error) { + return false, nil +} + +func needsCscReadProbe(_ net.Conn) bool { + return true +} + +func needsCscPeriodicProbe(_ net.Conn) bool { return true } diff --git a/vendor/github.com/redis/go-redis/v9/internal/pool/pool.go b/vendor/github.com/redis/go-redis/v9/internal/pool/pool.go index 8f648ffbf..b79c2bac1 100644 --- a/vendor/github.com/redis/go-redis/v9/internal/pool/pool.go +++ b/vendor/github.com/redis/go-redis/v9/internal/pool/pool.go @@ -72,6 +72,11 @@ var ( // errConnNotPooled is returned when trying to return a non-pooled connection to the pool. errConnNotPooled = errors.New("connection not pooled") + + // errConnEvictedIdle is passed to OnRemove hooks when a pooled connection is evicted on + // Put because the idle pool is already at MaxIdleConns. + errConnEvictedIdle = errors.New("connection evicted: idle pool at capacity") + // metricCallbackMu protects all global metric callback functions for thread-safe access. metricCallbackMu sync.RWMutex @@ -304,6 +309,9 @@ func getMetricPendingRequestsCallback() func(ctx context.Context, delta int, cn } // Stats contains pool state information and accumulated stats. +// +// TODO(cxl): the uint32/int64 fields below will be changed to atomic value +// types (atomic.Uint32/atomic.Int64) in v10, which is a breaking API change. type Stats struct { Hits uint32 // number of times free connection was found in the pool Misses uint32 // number of times free connection was NOT found in the pool @@ -318,6 +326,11 @@ type Stats struct { PendingRequests uint32 // number of pending requests waiting for a connection PubSubStats PubSubStats + + // PipelineStats holds the stats of the separate pipeline connection pool + // when one is configured (PipelineReadBufferSize/PipelineWriteBufferSize). + // nil when pipelines share the main pool. + PipelineStats *Stats } type ConnRetirer interface { @@ -394,7 +407,7 @@ type lastDialErrorWrap struct { type ConnPool struct { cfg *Options - dialErrorsNum uint32 // atomic + dialErrorsNum atomic.Uint32 lastDialError atomic.Value dialsInProgress chan struct{} @@ -415,11 +428,23 @@ type ConnPool struct { stats Stats waitDurationNs atomic.Int64 - _closed uint32 // atomic + _closed atomic.Uint32 - // Pool hooks manager for flexible connection processing - // Using atomic.Pointer for lock-free reads in hot paths (Get/Put) + // Pool hooks manager. atomic.Pointer keeps hot-path reads (Get/Put) + // lock-free; hookMu serializes Add/RemovePoolHook's read-clone-store so + // concurrent mutators (e.g. maintnotifications and CSC) can't lose an update. hookManager atomic.Pointer[PoolHookManager] + hookMu sync.Mutex + + // drainMu/drainDone coordinate the CSC drainer's temporary idle-connection + // claim with Get. The normal semaphore retains its PoolSize capacity (and + // therefore the established MaxActiveConns/ErrPoolExhausted behavior); a Get + // that finds the idle list empty only because the drainer borrowed a conn + // waits for that short claim to finish instead of opening an overflow conn. + drainMu sync.Mutex + drainDone chan struct{} + drainBorrowed int + drainGeneration atomic.Uint64 } var _ Pooler = (*ConnPool)(nil) @@ -453,7 +478,10 @@ func (p *ConnPool) initializeHooks() { // AddPoolHook adds a pool hook to the pool. func (p *ConnPool) AddPoolHook(hook PoolHook) { - // Lock-free read of current manager + // Serialize so a concurrent Add/Remove can't clobber this change. + p.hookMu.Lock() + defer p.hookMu.Unlock() + manager := p.hookManager.Load() if manager == nil { p.initializeHooks() @@ -464,12 +492,22 @@ func (p *ConnPool) AddPoolHook(hook PoolHook) { newManager := manager.Clone() newManager.AddHook(hook) - // Atomically swap to new manager + // Atomically swap to new manager (hot-path readers load lock-free) p.hookManager.Store(newManager) } +// SupportsPoolHooks reports that AddPoolHook and RemovePoolHook are functional. +// Pooler adapters with no-op hook methods intentionally do not expose this +// optional capability. +func (p *ConnPool) SupportsPoolHooks() bool { + return true +} + // RemovePoolHook removes a pool hook from the pool. func (p *ConnPool) RemovePoolHook(hook PoolHook) { + p.hookMu.Lock() + defer p.hookMu.Unlock() + manager := p.hookManager.Load() if manager != nil { // Create new manager with removed hook @@ -651,7 +689,7 @@ func (p *ConnPool) dialConn(ctx context.Context, pooled bool) (*Conn, error) { return nil, ErrClosed } - if atomic.LoadUint32(&p.dialErrorsNum) >= uint32(p.cfg.PoolSize) { + if p.dialErrorsNum.Load() >= uint32(p.cfg.PoolSize) { return nil, p.getLastDialError() } @@ -724,7 +762,7 @@ func (p *ConnPool) dialConn(ctx context.Context, pooled bool) (*Conn, error) { internal.Logger.Printf(ctx, "redis: connection pool: failed to dial after %d attempts: %v", attempt, lastErr) // All retries failed - handle error tracking p.setLastDialError(lastErr) - if atomic.AddUint32(&p.dialErrorsNum, 1) == uint32(p.cfg.PoolSize) { + if p.dialErrorsNum.Add(1) == uint32(p.cfg.PoolSize) { go p.tryDial() } return nil, lastErr @@ -789,7 +827,7 @@ func (p *ConnPool) tryDial() { continue } - atomic.StoreUint32(&p.dialErrorsNum, 0) + p.dialErrorsNum.Store(0) _ = conn.Close() return } @@ -835,28 +873,30 @@ func (p *ConnPool) getConn(ctx context.Context) (cn *Conn, err error) { cb(ctx, -1, nil, poolName) } } - }() - - // Track wait time - only call time.Now() if callback is registered - var waitStart time.Time - waitTimeCallback := getMetricConnectionWaitTimeCallback() - if waitTimeCallback != nil { - waitStart = time.Now() - } - if err = p.waitTurn(ctx); err != nil { - // Record timeout if applicable if err == ErrPoolTimeout { + atomic.AddUint32(&p.stats.Timeouts, 1) if cb := getMetricConnectionTimeoutCallback(); cb != nil { cb(ctx, nil, "pool") } - // Record general error metric for pool timeout if cb := GetMetricErrorCallback(); cb != nil { cb(ctx, "POOL_TIMEOUT", nil, "POOL_TIMEOUT", true, 0) } } + }() + + // PoolTimeout is one budget for both the pool turn and a drainer handoff. + poolDeadline := time.Now().Add(p.cfg.PoolTimeout) + + // Connection wait time measures only semaphore acquisition. + var waitStart time.Time + var waitDuration time.Duration + waitTimeCallback := getMetricConnectionWaitTimeCallback() + if waitTimeCallback != nil { + waitStart = time.Now() + } + if err = p.waitTurn(ctx); err != nil { return nil, err } - var waitDuration time.Duration if waitTimeCallback != nil { waitDuration = time.Since(waitStart) } @@ -867,6 +907,8 @@ func (p *ConnPool) getConn(ctx context.Context) (cn *Conn, err error) { // Lock-free atomic read - no mutex overhead! hookManager := p.hookManager.Load() +retryIdle: + drainGeneration := p.drainGeneration.Load() for attempts := 0; attempts < getAttempts; attempts++ { p.connsMu.Lock() @@ -937,6 +979,21 @@ func (p *ConnPool) getConn(ctx context.Context) (cn *Conn, err error) { return cn, nil } + // If the CSC drainer removed the only idle connection during this scan, + // wait for that bounded maintenance claim and retry. The generation closes + // the race where the drainer returns the connection between popIdle and this + // check. Normal MaxActiveConns exhaustion still proceeds to newConn and + // returns ErrPoolExhausted immediately, preserving the existing contract. + if done, retry := p.drainerWaitState(drainGeneration); done != nil { + if err = p.waitForDrainer(ctx, done, poolDeadline); err != nil { + p.freeTurn() + return nil, err + } + goto retryIdle + } else if retry { + goto retryIdle + } + atomic.AddUint32(&p.stats.Misses, 1) var newcn *Conn @@ -964,7 +1021,7 @@ func (p *ConnPool) getConn(ctx context.Context) (cn *Conn, err error) { // causing IsInited()=true. This means _getConn() in redis.go will take the // early return path and never reach its create time recording. // When hookManager is nil, _getConn() handles both initialization and create time recording. - if dialStartNs := newcn.GetDialStartNs(); dialStartNs > 0 { + if dialStartNs := newcn.GetDialStartNs(); newcn.IsInited() && dialStartNs > 0 { if cb := GetMetricConnectionCreateTimeCallback(); cb != nil { duration := time.Duration(time.Now().UnixNano() - dialStartNs) cb(ctx, duration, newcn) @@ -1120,23 +1177,83 @@ func (p *ConnPool) waitTurn(ctx context.Context) error { // Slow path: need to wait start := time.Now() err := p.semaphore.Acquire(ctx, p.cfg.PoolTimeout, ErrPoolTimeout) - - switch err { - case nil: - // Successfully acquired after waiting - p.waitDurationNs.Add(time.Now().UnixNano() - start.UnixNano()) - atomic.AddUint32(&p.stats.WaitCount, 1) - case ErrPoolTimeout: - atomic.AddUint32(&p.stats.Timeouts, 1) + if err != nil { + return err } - return err + p.waitDurationNs.Add(time.Now().UnixNano() - start.UnixNano()) + atomic.AddUint32(&p.stats.WaitCount, 1) + return nil } func (p *ConnPool) freeTurn() { p.semaphore.Release() } +func (p *ConnPool) beginDrainerBorrow() { + p.drainMu.Lock() + if p.drainBorrowed == 0 { + p.drainDone = make(chan struct{}) + } + p.drainBorrowed++ + p.drainMu.Unlock() +} + +func (p *ConnPool) endDrainerBorrow() { + p.drainMu.Lock() + p.drainBorrowed-- + if p.drainBorrowed == 0 { + close(p.drainDone) + p.drainDone = nil + p.drainGeneration.Add(1) + } + p.drainMu.Unlock() +} + +// drainerWaitState returns the current drain epoch's completion channel. If no +// drain is active, retry reports whether an epoch completed during the caller's +// idle scan and the idle list therefore needs to be checked again. +func (p *ConnPool) drainerWaitState(generation uint64) (done <-chan struct{}, retry bool) { + p.drainMu.Lock() + defer p.drainMu.Unlock() + if p.drainBorrowed > 0 { + return p.drainDone, false + } + return nil, p.drainGeneration.Load() != generation +} + +func (p *ConnPool) waitForDrainer( + ctx context.Context, done <-chan struct{}, poolDeadline time.Time, +) error { + if err := ctx.Err(); err != nil { + return err + } + select { + case <-done: + return nil + default: + } + remaining := time.Until(poolDeadline) + if remaining <= 0 { + return ErrPoolTimeout + } + timer := time.NewTimer(remaining) + defer timer.Stop() + + select { + case <-done: + return nil + case <-ctx.Done(): + return ctx.Err() + case <-timer.C: + // Prefer a caller cancellation that raced with the pool timeout. + if err := ctx.Err(); err != nil { + return err + } + return ErrPoolTimeout + } +} + func (p *ConnPool) popIdle() (*Conn, error) { if p.closed() { return nil, ErrClosed @@ -1290,6 +1407,9 @@ func (p *ConnPool) putConn(ctx context.Context, cn *Conn, freeTurn bool) { // expected state, don't log it case StateClosed: internal.Logger.Printf(ctx, "Unexpected conn[%d] state changed by hook to %v, closing it", cn.GetID(), currentState) + if hookManager != nil { + hookManager.ProcessOnRemove(ctx, cn, errHookRequestedRemoval) + } shouldCloseConn = true removedFromPool = p.removeConnWithLock(cn) default: @@ -1357,6 +1477,9 @@ func (p *ConnPool) putConn(ctx context.Context, cn *Conn, freeTurn bool) { } } else { shouldCloseConn = true + if hookManager != nil { + hookManager.ProcessOnRemove(ctx, cn, errConnEvictedIdle) + } removedFromPool = p.removeConnWithLock(cn) // Only emit if we actually removed it from the map (not already taken by Close()). @@ -1548,6 +1671,13 @@ func (p *ConnPool) IdleLen() int { return int(n) } +// Name returns the pool's configured name, which is stamped on every +// connection it creates (Conn.PoolName). Callers holding a Pooler can type +// assert to interface{ Name() string } to find which pool owns a connection — +// used by maintnotifications to route a handoff to the hook that owns the +// conn's pool rather than always the primary one. +func (p *ConnPool) Name() string { return p.cfg.Name } + // Size returns the maximum pool size (capacity). // // This is used by the streaming credentials manager to size the re-auth worker pool, @@ -1573,7 +1703,7 @@ func (p *ConnPool) Stats() *Stats { } func (p *ConnPool) closed() bool { - return atomic.LoadUint32(&p._closed) == 1 + return p._closed.Load() == 1 } func (p *ConnPool) RetireConns(ctx context.Context, conns []*Conn, reason string) { @@ -1652,8 +1782,142 @@ func (p *ConnPool) Filter(fn func(*Conn) bool) error { return firstErr } +type drainConn struct { + conn *Conn + idleIndex int +} + +// DrainState carries the cross-pass round bookkeeping for the CSC drainer. +// It is owned by one drainer goroutine, so no synchronization is needed. +type DrainState struct { + // round contains only initialized idle connections. Entries are processed + // from the end so their snapshot indexes remain stable as connections are + // removed and returned. Connections that go idle mid-round are deferred. + round []drainConn + next int +} + +// DrainIdleConns runs one pass of the CSC invalidation drainer over the current +// round, holding AT MOST ONE connection and its pool turn at a time (ctx is the +// per-cycle deadline). A round = idle conn ids snapshotted at start; mid-round +// arrivals are deferred. Each member is drainerPop'd and drained by fn, or — if no +// longer a claimable idle conn — reconciled (marked visited) so it can't hang the +// round. The drainer yields when no turn is immediately available, giving command +// traffic priority. Handles at least one member before honoring ctx (so a tiny +// DrainInterval can't stall it). No-ops if the pool is closed. +func (p *ConnPool) DrainIdleConns(ctx context.Context, st *DrainState, fn func(cn *Conn) error) { + if st == nil || fn == nil || p.closed() { + return + } + + if st.round == nil { + st.round = p.idleConnsSnapshot() + st.next = len(st.round) + if len(st.round) == 0 { + st.round = nil + return + } + } + + handled := 0 + for st.next > 0 { + // Min-progress: handle at least one member — drained OR reconciled — before + // honoring the per-cycle deadline, so a pass does a bounded amount of work + // while ignoring an expired ctx. A deadline-truncated round resumes on the + // next pass. + if handled > 0 && ctx.Err() != nil { + return + } + + // Account for the borrowed connection exactly like Get. Without a turn, + // a concurrent Get can observe the temporarily-empty idle pool and either + // exceed PoolSize or fail at MaxActiveConns. Maintenance never waits for a + // turn, so command traffic wins under contention. + if !p.semaphore.TryAcquire() { + return + } + st.next-- + cn := p.drainerPop(ctx, st.round[st.next]) + if cn == nil { + p.freeTurn() + // Reconcile: not a claimable idle member right now (closed, in use, + // unusable, or moved in idleConns by concurrent traffic). Covered by + // the command-path drain and/or the next round. + handled++ + continue + } + + func() { + defer p.endDrainerBorrow() + if err := fn(cn); err != nil { + // Fatal drain error (read/protocol/connection). + p.removeConnInternal(ctx, cn, err, true) + } else { + // Normal return: runs OnPut (queues any maintenance handoff). + p.putConn(ctx, cn, true) + } + }() + handled++ + } + + // Every member handled — round complete; snapshot a fresh round next pass. + st.round = nil + st.next = 0 +} + +// idleConnsSnapshot returns initialized idle connections and their current +// indexes. StateCreated MinIdleConns are intentionally excluded. +func (p *ConnPool) idleConnsSnapshot() []drainConn { + p.connsMu.Lock() + defer p.connsMu.Unlock() + if len(p.idleConns) == 0 { + return nil + } + round := make([]drainConn, 0, len(p.idleConns)) + for idx, cn := range p.idleConns { + if cn.stateMachine.GetState() == StateIdle { + round = append(round, drainConn{conn: cn, idleIndex: idx}) + } + } + return round +} + +// drainerPop claims a snapshotted connection (strict IDLE->IN_USE) and removes +// it from idleConns in O(1). Entries are processed in reverse index order, so +// swap removal cannot move an unprocessed round member. If concurrent pool +// traffic changed the slot, the member is deferred to the next round. +func (p *ConnPool) drainerPop(ctx context.Context, member drainConn) *Conn { + p.connsMu.Lock() + defer p.connsMu.Unlock() + if p.closed() { + return nil + } + idx := member.idleIndex + if idx < 0 || idx >= len(p.idleConns) || p.idleConns[idx] != member.conn { + return nil + } + cn := member.conn + if !cn.stateMachine.TryTransitionFast(StateIdle, StateInUse) { + return nil + } + p.beginDrainerBorrow() + last := len(p.idleConns) - 1 + p.idleConns[idx] = p.idleConns[last] + p.idleConns[last] = nil + p.idleConns = p.idleConns[:last] + p.idleConnsLen.Add(-1) + if cb := getMetricConnectionStateChangeCallback(); cb != nil { + cb(ctx, cn, MetricStateIdle, MetricStateUsed) + } + if cb := getMetricConnectionCountCallback(); cb != nil { + cb(ctx, -1, cn, "idle", false) + cb(ctx, 1, cn, "used", false) + } + return cn +} + func (p *ConnPool) Close() error { - if !atomic.CompareAndSwapUint32(&p._closed, 0, 1) { + if !p._closed.CompareAndSwap(0, 1) { return ErrClosed } @@ -1735,8 +1999,11 @@ func (p *ConnPool) isHealthyConn(cn *Conn, nowNs int64) bool { if err := connCheck(cn.getNetConn()); err != nil { // If there's unexpected data, it might be push notifications (RESP3) if p.cfg.PushNotificationsEnabled && err == errUnexpectedRead { - // Peek at the reply type to check if it's a push notification - if replyType, err := cn.rd.PeekReplyType(); err == nil && replyType == proto.RespPush { + // Peek at the reply type to check if it's a push notification. + // Use the readerMu-guarded peek: a concurrent handoff may be + // resetting cn.rd via SetNetConn on a connection popped by Get + // before the OnGet state check rejects it. + if replyType, err := cn.PeekReplyTypeForCheck(); err == nil && replyType == proto.RespPush { // For RESP3 connections with push notifications, we allow some buffered data // The client will process these notifications before using the connection internal.Logger.Printf( diff --git a/vendor/github.com/redis/go-redis/v9/internal/pool/pool_sticky.go b/vendor/github.com/redis/go-redis/v9/internal/pool/pool_sticky.go index 6763299eb..e2206c82e 100644 --- a/vendor/github.com/redis/go-redis/v9/internal/pool/pool_sticky.go +++ b/vendor/github.com/redis/go-redis/v9/internal/pool/pool_sticky.go @@ -35,11 +35,16 @@ func (e BadConnError) Unwrap() error { type StickyConnPool struct { pool Pooler - shared int32 // atomic + shared atomic.Int32 - state uint32 // atomic + state atomic.Uint32 ch chan *Conn + // onFirstConn runs once when this sticky pool claims a connection from its + // parent. CSC uses it to revoke cache ownership before the connection leaves + // the parent's background drainer. + onFirstConn func(*Conn) + _badConnError atomic.Value } @@ -53,7 +58,7 @@ func NewStickyConnPool(pool Pooler) *StickyConnPool { ch: make(chan *Conn, 1), } } - atomic.AddInt32(&p.shared, 1) + p.shared.Add(1) return p } @@ -68,13 +73,16 @@ func (p *StickyConnPool) CloseConn(ctx context.Context, cn *Conn, reason string, func (p *StickyConnPool) Get(ctx context.Context) (*Conn, error) { // In worst case this races with Close which is not a very common operation. for i := 0; i < 1000; i++ { - switch atomic.LoadUint32(&p.state) { + switch p.state.Load() { case stateDefault: cn, err := p.pool.Get(ctx) if err != nil { return nil, err } - if atomic.CompareAndSwapUint32(&p.state, stateDefault, stateInited) { + if p.state.CompareAndSwap(stateDefault, stateInited) { + if p.onFirstConn != nil { + p.onFirstConn(cn) + } return cn, nil } p.pool.Remove(ctx, cn, ErrClosed) @@ -96,12 +104,26 @@ func (p *StickyConnPool) Get(ctx context.Context) (*Conn, error) { return nil, fmt.Errorf("redis: StickyConnPool.Get: infinite loop") } +// SetOnFirstConn configures a callback that runs when the sticky pool first +// claims a parent connection. It must be called before the pool is used. +func (p *StickyConnPool) SetOnFirstConn(fn func(*Conn)) { + p.onFirstConn = fn +} + func (p *StickyConnPool) Put(ctx context.Context, cn *Conn) { defer func() { if recover() != nil { p.freeConn(ctx, cn) } }() + // A connection marked for removal on release (it may hold unread + // replies) must not be served to the next Get: record it as a bad + // connection — exactly like Remove — so Get refuses and the underlying + // connection is removed from the parent pool when the sticky pool + // unwinds (the parent's Put honors the same mark). + if reason := cn.CloseOnPutReason(); reason != "" { + p._badConnError.Store(BadConnError{wrapped: errors.New(reason)}) + } p.ch <- cn } @@ -130,16 +152,16 @@ func (p *StickyConnPool) RemoveWithoutTurn(ctx context.Context, cn *Conn, reason } func (p *StickyConnPool) Close() error { - if shared := atomic.AddInt32(&p.shared, -1); shared > 0 { + if shared := p.shared.Add(-1); shared > 0 { return nil } for i := 0; i < 1000; i++ { - state := atomic.LoadUint32(&p.state) + state := p.state.Load() if state == stateClosed { return ErrClosed } - if atomic.CompareAndSwapUint32(&p.state, state, stateClosed) { + if p.state.CompareAndSwap(state, stateClosed) { close(p.ch) cn, ok := <-p.ch if ok { @@ -168,8 +190,8 @@ func (p *StickyConnPool) Reset(ctx context.Context) error { return errors.New("redis: StickyConnPool does not have a Conn") } - if !atomic.CompareAndSwapUint32(&p.state, stateInited, stateDefault) { - state := atomic.LoadUint32(&p.state) + if !p.state.CompareAndSwap(stateInited, stateDefault) { + state := p.state.Load() return fmt.Errorf("redis: invalid StickyConnPool state: %d", state) } @@ -186,7 +208,7 @@ func (p *StickyConnPool) badConnError() error { } func (p *StickyConnPool) Len() int { - switch atomic.LoadUint32(&p.state) { + switch p.state.Load() { case stateDefault: return 0 case stateInited: diff --git a/vendor/github.com/redis/go-redis/v9/internal/pool/pubsub.go b/vendor/github.com/redis/go-redis/v9/internal/pool/pubsub.go index 8cfa86788..34c329fff 100644 --- a/vendor/github.com/redis/go-redis/v9/internal/pool/pubsub.go +++ b/vendor/github.com/redis/go-redis/v9/internal/pool/pubsub.go @@ -7,6 +7,10 @@ import ( "sync/atomic" ) +// PubSubStats contains pub/sub connection pool stats. +// +// TODO(cxl): the uint32 fields below will be changed to atomic.Uint32 in v10, +// which is a breaking API change. type PubSubStats struct { Created uint32 Untracked uint32 diff --git a/vendor/github.com/redis/go-redis/v9/internal/proto/reader.go b/vendor/github.com/redis/go-redis/v9/internal/proto/reader.go index 33b027f79..28e1a7814 100644 --- a/vendor/github.com/redis/go-redis/v9/internal/proto/reader.go +++ b/vendor/github.com/redis/go-redis/v9/internal/proto/reader.go @@ -76,6 +76,11 @@ func (r *Reader) Buffered() int { return r.rd.Buffered() } +// Size returns the size of the underlying read buffer. +func (r *Reader) Size() int { + return r.rd.Size() +} + func (r *Reader) Peek(n int) ([]byte, error) { return r.rd.Peek(n) } @@ -100,18 +105,30 @@ func (r *Reader) PeekReplyType() (byte, error) { return b[0], nil } +// MinRESP3ReadBufferSize is the minimum buffer size used when RESP3 push +// notifications must be inspected without consuming them. +const MinRESP3ReadBufferSize = 128 + +// ErrPushNotificationNameTooLong is returned when the push header does not fit +// in the bounded peek window. Callers should consume the frame with ReadReply. +var ErrPushNotificationNameTooLong = errors.New("redis: push notification name exceeds peek window") + // PeekPushNotificationName returns the notification name of the next RESP3 // push frame without consuming it. The caller is expected to have already // verified that the next reply is a push notification (e.g. via PeekReplyType // returning RespPush). // -// To identify the name the method may block briefly reading more bytes from -// the underlying connection. That is safe: once the push marker '>' has been -// observed, the server is committed to sending the rest of the frame, so -// fetching the next few header bytes does not race with anything the caller -// could be waiting on. Blocking is preferred to a truncated peek, which would -// silently misidentify the notification and cause the caller's ReadReply to -// consume (and drop) the frame; see issue #3839. +// To identify the name the method may block reading more bytes from the +// underlying connection, but only ever waits for one byte beyond the valid +// frame prefix it has already seen. That byte is guaranteed to arrive: an +// incomplete prefix means the server is still committed to sending the rest +// of the frame. Demanding any fixed amount instead can deadlock — a complete +// frame such as a subscribe confirmation for a short channel name can be +// smaller than the fixed window, and once it is buffered the server has +// nothing more to send (issue #3935). Blocking for in-flight bytes is +// preferred to a truncated peek, which would silently misidentify the +// notification and cause the caller's ReadReply to consume (and drop) the +// frame; see issue #3839. func (r *Reader) PeekPushNotificationName() (string, error) { c, err := r.rd.Peek(1) if err != nil { @@ -121,16 +138,18 @@ func (r *Reader) PeekPushNotificationName() (string, error) { return "", fmt.Errorf("redis: can't peek push notification name, next reply is not a push notification") } - // Start with a peek window that covers every Redis-defined notification - // header (MOVING, MIGRATING, FAILED_OVER, message, pmessage, smessage, - // subscribe, unsubscribe, ...). If a longer name is encountered, grow - // the window up to maxPushHeaderPeek before giving up. - const initialPeek = 36 const maxPushHeaderPeek = 4096 - peekSize := initialPeek for { - buf, peekErr := r.rd.Peek(peekSize) + // Parse from what is already buffered; this never blocks. + avail := r.rd.Buffered() + if avail > maxPushHeaderPeek { + avail = maxPushHeaderPeek + } + buf, peekErr := r.rd.Peek(avail) + if peekErr != nil { + return "", peekErr + } name, complete, parseErr := parsePushNotificationName(buf) if parseErr != nil { return "", parseErr @@ -138,17 +157,17 @@ func (r *Reader) PeekPushNotificationName() (string, error) { if complete { return name, nil } - // Parser ran out of bytes. Surface a failed underlying read before - // growing further; otherwise grow the peek window and retry. - if peekErr != nil { - return "", peekErr - } - if peekSize >= maxPushHeaderPeek { - return "", fmt.Errorf("redis: push notification header exceeds %d bytes", maxPushHeaderPeek) + if avail >= maxPushHeaderPeek { + return "", ErrPushNotificationNameTooLong } - peekSize *= 2 - if peekSize > maxPushHeaderPeek { - peekSize = maxPushHeaderPeek + // Valid but incomplete prefix: the rest of the frame is in flight. + // Block for exactly one more byte — the read that delivers it picks + // up whatever else has already arrived — then re-parse. + if _, err := r.rd.Peek(avail + 1); err != nil { + if errors.Is(err, bufio.ErrBufferFull) { + return "", ErrPushNotificationNameTooLong + } + return "", err } } } @@ -440,6 +459,16 @@ func (r *Reader) readMap(line []byte) (map[interface{}]interface{}, error) { if err != nil { return nil, err } + + // Reject unhashable keys (arrays/maps) before they are used as a map + // key, which would otherwise panic. This check must run before the + // value is read so it also guards the Nil and RedisError paths below, + // which write the key into the map and continue. + switch k.(type) { + case []interface{}, map[interface{}]interface{}: + return nil, fmt.Errorf("redis: RESP3 map key must be a scalar type, got %T", k) + } + v, err := r.ReadReply() if err != nil { if err == Nil { @@ -452,6 +481,7 @@ func (r *Reader) readMap(line []byte) (map[interface{}]interface{}, error) { } return nil, err } + m[k] = v } return m, nil @@ -591,10 +621,33 @@ func (r *Reader) ReadStringInto(buf []byte) (int, error) { // bufio.Reader.Read first drains its internal buffer, then for // remaining data larger than its buffer size reads directly from the // underlying reader (socket) — effectively zero-copy. + // + // Fast path: when the caller VISIBLY hands over room for the trailing + // CRLF too (len(buf) >= n+2), read the payload and the CRLF in a + // single io.ReadFull. For large values this is one direct socket read + // instead of a big read followed by a tiny separate Discard(2) read, + // which is what makes GetToBuffer beat a regular Get (no payload + // allocation and the same number of reads). The 2 trailing bytes land + // past the returned length and are ignored. + // + // The gate is on len, NOT cap: a sub-slice of a larger buffer (e.g. + // packed segments big[i*slot:(i+1)*slot]) exposes trailing capacity + // that belongs to the caller's NEXT segment — writing the CRLF there + // would silently corrupt caller-owned memory outside the slice they + // passed. Callers who want the fast path pass len == payload+2 (the + // returned length is still the payload length). + if len(buf) >= n+2 { + full := buf[:n+2] + if _, err := io.ReadFull(r.rd, full); err != nil { + return 0, err + } + return n, nil + } + // Slow path: buffer is exactly large enough for the payload only, so + // read the payload into it and discard the CRLF separately. if _, err := io.ReadFull(r.rd, buf[:n]); err != nil { return 0, err } - // Discard trailing \r\n. if _, err := r.rd.Discard(2); err != nil { return 0, err } @@ -738,7 +791,15 @@ func (r *Reader) Discard(line []byte) (err error) { } n, err := replyLen(line) - if err != nil && err != Nil { + if err != nil { + if err == Nil { + // A nil reply ($-1, =-1, !-1, *-1, %-1) carries no payload; the + // header line was already consumed by readLine, so there is + // nothing to discard. Falling through would Discard(n+2)==2 bytes + // that belong to the next reply and desync the stream, matching + // how readRawReplyBuf/readRawReplyWriteTo already treat Nil. + return nil + } return err } @@ -755,8 +816,14 @@ func (r *Reader) Discard(line []byte) (err error) { } return nil case RespMap, RespAttr: - // Read key & value. - for i := 0; i < n*2; i++ { + // Iterate over the n key/value pairs rather than n*2 elements: a count + // above MaxInt/2 makes n*2 overflow to a negative loop bound, which + // would skip the body entirely and return nil, leaving the map bytes in + // the stream for the next reply to consume (a silent desync). + for i := 0; i < n; i++ { + if err = r.DiscardNext(); err != nil { + return err + } if err = r.DiscardNext(); err != nil { return err } @@ -849,10 +916,12 @@ func (r *Reader) readRawReplyBuf(buf []byte) ([]byte, error) { } return buf, err } - for i := 0; i < n*2; i++ { - buf, err = r.readRawReplyBuf(buf) - if err != nil { - return buf, err + for i := 0; i < n; i++ { + for pair := 0; pair < 2; pair++ { + buf, err = r.readRawReplyBuf(buf) + if err != nil { + return buf, err + } } } return buf, nil @@ -867,11 +936,15 @@ func (r *Reader) readRawReplyBuf(buf []byte) ([]byte, error) { } return buf, err } - // Read the attribute key-value pairs - for i := 0; i < n*2; i++ { - buf, err = r.readRawReplyBuf(buf) - if err != nil { - return buf, err + // Read the attribute key-value pairs. Iterate over pairs rather than + // n*2 elements so a count above MaxInt/2 can't overflow int to a + // negative loop bound and skip the body. + for i := 0; i < n; i++ { + for pair := 0; pair < 2; pair++ { + buf, err = r.readRawReplyBuf(buf) + if err != nil { + return buf, err + } } } // Read the command reply that follows the attribute @@ -948,11 +1021,13 @@ func (r *Reader) readRawReplyWriteTo(w io.Writer) (int64, error) { } return written, err } - for i := 0; i < count*2; i++ { - n, err := r.readRawReplyWriteTo(w) - written += n - if err != nil { - return written, err + for i := 0; i < count; i++ { + for pair := 0; pair < 2; pair++ { + n, err := r.readRawReplyWriteTo(w) + written += n + if err != nil { + return written, err + } } } return written, nil @@ -967,12 +1042,16 @@ func (r *Reader) readRawReplyWriteTo(w io.Writer) (int64, error) { } return written, err } - // Read the attribute key-value pairs - for i := 0; i < count*2; i++ { - n, err := r.readRawReplyWriteTo(w) - written += n - if err != nil { - return written, err + // Read the attribute key-value pairs. Iterate over pairs rather than + // count*2 elements so a count above MaxInt/2 can't overflow int to a + // negative loop bound and skip the body. + for i := 0; i < count; i++ { + for pair := 0; pair < 2; pair++ { + n, err := r.readRawReplyWriteTo(w) + written += n + if err != nil { + return written, err + } } } // Read the command reply that follows the attribute diff --git a/vendor/github.com/redis/go-redis/v9/internal/proto/writer.go b/vendor/github.com/redis/go-redis/v9/internal/proto/writer.go index 38e66c688..e3eff8b63 100644 --- a/vendor/github.com/redis/go-redis/v9/internal/proto/writer.go +++ b/vendor/github.com/redis/go-redis/v9/internal/proto/writer.go @@ -118,7 +118,7 @@ func (w *Writer) WriteArg(v interface{}) error { return w.uint(uint64(v)) case *uint8: if v == nil { - return w.string("") + return w.uint(0) } return w.uint(uint64(*v)) case uint16: diff --git a/vendor/github.com/redis/go-redis/v9/internal/semaphore.go b/vendor/github.com/redis/go-redis/v9/internal/semaphore.go index a7f40466c..b8d60a7b7 100644 --- a/vendor/github.com/redis/go-redis/v9/internal/semaphore.go +++ b/vendor/github.com/redis/go-redis/v9/internal/semaphore.go @@ -14,6 +14,28 @@ var semTimers = sync.Pool{ }, } +// putSemTimer stops a pooled timer and drains a stale fire before reuse, +// portably across both timer-channel semantics (the drain must never block): +// +// - main module on go >= 1.23 (synchronous channels): Stop returns TRUE for +// an expired-but-undelivered fire — the delivery is aborted — and false +// only once the value was actually received. With the sole receiver +// being Acquire's own select, the drain branch is unreachable; the +// select-with-default is a safety net so a future semantics shift cannot +// turn it into a blocking receive (reviewed on #3942). +// - GODEBUG=asynctimerchan=1 (consumer main module on go < 1.23, old +// buffered channels): Stop returns false and the fired value sits in the +// buffer; the drain consumes it so the timer is clean for Reset-reuse. +func putSemTimer(t *time.Timer) { + if !t.Stop() { + select { + case <-t.C: + default: + } + } + semTimers.Put(t) +} + // FastSemaphore is a channel-based semaphore optimized for performance. // It uses a fast path that avoids timer allocation when tokens are available. // The channel is pre-filled with tokens: Acquire = receive, Release = send. @@ -70,19 +92,13 @@ func (s *FastSemaphore) Acquire(ctx context.Context, timeout time.Duration, time // Slow path: need to wait with timeout timer := semTimers.Get().(*time.Timer) - defer semTimers.Put(timer) + defer putSemTimer(timer) timer.Reset(timeout) select { case <-s.tokens: - if !timer.Stop() { - <-timer.C - } return nil case <-ctx.Done(): - if !timer.Stop() { - <-timer.C - } return ctx.Err() case <-timer.C: return timeoutErr @@ -152,42 +168,20 @@ func (s *FIFOSemaphore) TryAcquire() bool { func (s *FIFOSemaphore) Acquire(ctx context.Context, timeout time.Duration, timeoutErr error) error { // No fast path - always use timer to guarantee FIFO timer := semTimers.Get().(*time.Timer) - defer semTimers.Put(timer) + defer putSemTimer(timer) timer.Reset(timeout) select { case <-s.tokens: - if !timer.Stop() { - <-timer.C - } return nil case <-ctx.Done(): - if !timer.Stop() { - <-timer.C - } return ctx.Err() case <-timer.C: return timeoutErr } } -// AcquireBlocking acquires a token, blocking indefinitely until one is available. -func (s *FIFOSemaphore) AcquireBlocking() { - <-s.tokens -} - // Release releases a token back to the semaphore. func (s *FIFOSemaphore) Release() { s.tokens <- struct{}{} } - -// Close closes the semaphore, unblocking all waiting goroutines. -// After close, all Acquire calls will receive a closed channel signal. -func (s *FIFOSemaphore) Close() { - close(s.tokens) -} - -// Len returns the current number of acquired tokens. -func (s *FIFOSemaphore) Len() int32 { - return s.max - int32(len(s.tokens)) -} diff --git a/vendor/github.com/redis/go-redis/v9/iterator.go b/vendor/github.com/redis/go-redis/v9/iterator.go index cd1a82851..a0cf1b358 100644 --- a/vendor/github.com/redis/go-redis/v9/iterator.go +++ b/vendor/github.com/redis/go-redis/v9/iterator.go @@ -46,6 +46,14 @@ func (it *ScanIterator) Next(ctx context.Context) bool { if err != nil { return false } + // Await the fetch before reading page/cursor: on the deferred + // autopipeline face process() only enqueues, and reading the raw + // fields of a not-yet-executed command would spin re-issuing SCANs + // with a stale cursor forever. Err() blocks until executed there and + // is a no-op read everywhere else. + if err := it.cmd.Err(); err != nil { + return false + } it.pos = 1 diff --git a/vendor/github.com/redis/go-redis/v9/json.go b/vendor/github.com/redis/go-redis/v9/json.go index 2bcad0b79..b3878260e 100644 --- a/vendor/github.com/redis/go-redis/v9/json.go +++ b/vendor/github.com/redis/go-redis/v9/json.go @@ -96,6 +96,7 @@ func newJSONCmd(ctx context.Context, args ...interface{}) *JSONCmd { } func (cmd *JSONCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -105,6 +106,7 @@ func (cmd *JSONCmd) SetVal(val string) { // Val returns the result of the JSON.GET command as a string. func (cmd *JSONCmd) Val() string { + cmd.await() if len(cmd.val) == 0 && cmd.expanded != nil { val, err := json.Marshal(cmd.expanded) if err != nil { @@ -119,11 +121,13 @@ func (cmd *JSONCmd) Val() string { } func (cmd *JSONCmd) Result() (string, error) { + cmd.await() return cmd.Val(), cmd.Err() } // Expanded returns the result of the JSON.GET command as unmarshalled JSON. func (cmd *JSONCmd) Expanded() (interface{}, error) { + cmd.await() if len(cmd.val) != 0 && cmd.expanded == nil { err := json.Unmarshal([]byte(cmd.val), &cmd.expanded) if err != nil { @@ -136,15 +140,18 @@ func (cmd *JSONCmd) Expanded() (interface{}, error) { func (cmd *JSONCmd) readReply(rd *proto.Reader) error { // nil response from JSON.(M)GET (cmd.baseCmd.err will be "redis: nil") - // This happens when the key doesn't exist - if cmd.baseCmd.Err() == Nil { + // This happens when the key doesn't exist. + // Use rawErr() (not Err()): readReply runs inside the batch's Exec, before + // the autopipeline batch's done channel is closed, so Err()->await() would + // deadlock on the very Exec that is calling readReply. + if cmd.baseCmd.rawErr() == Nil { cmd.val = "" return Nil } // Handle other base command errors - if cmd.baseCmd.Err() != nil { - return cmd.baseCmd.Err() + if cmd.baseCmd.rawErr() != nil { + return cmd.baseCmd.rawErr() } if readType, err := rd.PeekReplyType(); err != nil { @@ -212,6 +219,7 @@ func NewJSONSliceCmd(ctx context.Context, args ...interface{}) *JSONSliceCmd { } func (cmd *JSONSliceCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -220,15 +228,19 @@ func (cmd *JSONSliceCmd) SetVal(val []interface{}) { } func (cmd *JSONSliceCmd) Val() []interface{} { + cmd.await() return cmd.val } func (cmd *JSONSliceCmd) Result() ([]interface{}, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *JSONSliceCmd) readReply(rd *proto.Reader) error { - if cmd.baseCmd.Err() == Nil { + // rawErr(), not Err(): readReply runs inside Exec before the batch's done + // channel closes, so Err()->await() would deadlock (see JSONCmd.readReply). + if cmd.baseCmd.rawErr() == Nil { cmd.val = nil return Nil } @@ -238,7 +250,7 @@ func (cmd *JSONSliceCmd) readReply(rd *proto.Reader) error { } else if readType == proto.RespArray { response, err := rd.ReadReply() if err != nil { - return nil + return err } else { cmd.val = response.([]interface{}) } @@ -299,6 +311,7 @@ func NewIntPointerSliceCmd(ctx context.Context, args ...interface{}) *IntPointer } func (cmd *IntPointerSliceCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -307,10 +320,12 @@ func (cmd *IntPointerSliceCmd) SetVal(val []*int64) { } func (cmd *IntPointerSliceCmd) Val() []*int64 { + cmd.await() return cmd.val } func (cmd *IntPointerSliceCmd) Result() ([]*int64, error) { + cmd.await() return cmd.val, cmd.err } diff --git a/vendor/github.com/redis/go-redis/v9/list_commands.go b/vendor/github.com/redis/go-redis/v9/list_commands.go index 9d9e16c65..afaf58e1a 100644 --- a/vendor/github.com/redis/go-redis/v9/list_commands.go +++ b/vendor/github.com/redis/go-redis/v9/list_commands.go @@ -34,6 +34,8 @@ type ListCmdable interface { RPushX(ctx context.Context, key string, values ...interface{}) *IntCmd LMove(ctx context.Context, source, destination, srcpos, destpos string) *StringCmd BLMove(ctx context.Context, source, destination, srcpos, destpos string, timeout time.Duration) *StringCmd + LMoveM(ctx context.Context, source, destination, srcpos, destpos string, args LMoveMArgs) *StringSliceCmd + BLMoveM(ctx context.Context, source, destination, srcpos, destpos string, timeout time.Duration, args LMoveMArgs) *StringSliceCmd } func (c cmdable) BLPop(ctx context.Context, timeout time.Duration, keys ...string) *StringSliceCmd { @@ -156,6 +158,45 @@ type LPosArgs struct { Rank, MaxLen int64 } +// LMoveMMode is the count semantics for LMOVEM/BLMOVEM. +type LMoveMMode string + +const ( + LMoveMCount LMoveMMode = "COUNT" // up to Count + LMoveMExactly LMoveMMode = "EXACTLY" // exactly Count, or nothing +) + +// LMoveMOrder is the destination ordering for LMOVEM/BLMOVEM. +type LMoveMOrder string + +const ( + LMoveMOBO LMoveMOrder = "OBO" // one-by-one, order reversed + LMoveMBulk LMoveMOrder = "BULK" // preserve order +) + +// LMoveMArgs configures the optional count group of LMOVEM/BLMOVEM. +// Count <= 0 moves a single element. Mode defaults to COUNT, Order to BULK. +type LMoveMArgs struct { + Mode LMoveMMode + Count int64 + Order LMoveMOrder +} + +func (a LMoveMArgs) appendArgs(args []interface{}) []interface{} { + if a.Count <= 0 { + return args + } + mode := a.Mode + if mode == "" { + mode = LMoveMCount + } + order := a.Order + if order == "" { + order = LMoveMBulk + } + return append(args, string(mode), a.Count, string(order)) +} + func (c cmdable) LPos(ctx context.Context, key string, value string, a LPosArgs) *IntCmd { args := []interface{}{"lpos", key, value} if a.Rank != 0 { @@ -295,3 +336,27 @@ func (c cmdable) BLMove( _ = c(ctx, cmd) return cmd } + +// LMoveM atomically moves multiple elements between lists (Redis 8.10+). +// srcpos/destpos are "LEFT" or "RIGHT". Returns moved elements, or redis.Nil if none. +func (c cmdable) LMoveM(ctx context.Context, source, destination, srcpos, destpos string, a LMoveMArgs) *StringSliceCmd { + args := make([]interface{}, 5, 8) + args[0], args[1], args[2], args[3], args[4] = "lmovem", source, destination, srcpos, destpos + args = a.appendArgs(args) + cmd := NewStringSliceCmd(ctx, args...) + _ = c(ctx, cmd) + return cmd +} + +// BLMoveM is the blocking variant of LMoveM (Redis 8.10+); timeout 0 blocks forever. +// Returns moved elements, or redis.Nil on timeout. +func (c cmdable) BLMoveM(ctx context.Context, source, destination, srcpos, destpos string, timeout time.Duration, a LMoveMArgs) *StringSliceCmd { + args := make([]interface{}, 6, 9) + args[0], args[1], args[2], args[3], args[4] = "blmovem", source, destination, srcpos, destpos + args[5] = formatSec(ctx, timeout) + args = a.appendArgs(args) + cmd := NewStringSliceCmd(ctx, args...) + cmd.setReadTimeout(timeout) + _ = c(ctx, cmd) + return cmd +} diff --git a/vendor/github.com/redis/go-redis/v9/local_cache.go b/vendor/github.com/redis/go-redis/v9/local_cache.go new file mode 100644 index 000000000..2a5579c63 --- /dev/null +++ b/vendor/github.com/redis/go-redis/v9/local_cache.go @@ -0,0 +1,774 @@ +package redis + +import ( + "context" + "math" + "sync" + "sync/atomic" + "time" +) + +// cacheEntryState tracks the lifecycle of a local cache entry. +type cacheEntryState uint8 + +const ( + // cacheEntryInProgress marks a placeholder entry while a value is being fetched. + cacheEntryInProgress cacheEntryState = iota + // cacheEntryValid marks an entry that contains a value that can be returned. + cacheEntryValid +) + +// cacheEntry represents a cached command reply and its Redis-key associations. +type cacheEntry struct { + cacheKey string + redisKeys []string + value []byte + state cacheEntryState + + token uint64 + sizeBytes int64 + reservedAt time.Time + waitCh chan struct{} + waitClosed bool + + // lastAccessNs is a recency token for LRU eviction: a global atomic counter + // bumped on every access, stored atomically so the read path can mark a + // touch under the shard's RLock without upgrading to a write lock. + lastAccessNs atomic.Int64 + + // validAt retains time.Now's monotonic component for the MaxStaleness + // backstop, so wall-clock corrections cannot extend an entry's lifetime. + // Written under Lock (Set/Fulfill), read under RLock (get). + validAt time.Time + + // ownerConnID is the conn that fetched this entry (set by FulfillOwned; 0 = + // none). Default CLIENT TRACKING sends a key's invalidation only to that + // conn, so the entry must be evicted when it goes away (see EvictByConn). + ownerConnID uint64 +} + +// lruSequence is the global monotonic counter feeding lastAccessNs. It totally +// orders recency across all entries in all shards for approximate-LRU eviction. +var lruSequence atomic.Int64 + +// nextLRUToken returns the next strictly-greater LRU token. +func nextLRUToken() int64 { + return lruSequence.Add(1) +} + +// CacheSizer calculates estimated memory usage in bytes for a cache entry. +// +// Experimental: this API may change in a minor release. +type CacheSizer func(cacheKey string, redisKeys []string, value []byte) int64 + +// CacheConfig configures a local cache instance. +// +// Experimental: this API may change in a minor release. +type CacheConfig struct { + // MaxEntries limits the number of entries. Zero or negative means unlimited. + MaxEntries int + // MaxMemoryBytes limits estimated memory usage in bytes. Zero or negative means unlimited. + // + // If both MaxEntries and MaxMemoryBytes are unlimited, MaxEntries defaults to + // defaultCacheMaxEntries so the cache cannot grow without bound. The cache is + // sharded 16 ways (above small thresholds) and each shard enforces its 1/16 + // share, so an entry larger than MaxMemoryBytes/16 is never admitted — + // size it to at least 16× your largest reply. + MaxMemoryBytes int64 + // Sizer estimates memory usage per entry. If nil, a built-in approximation is used. + // + // Sizer may be invoked concurrently from multiple goroutines and must be + // thread-safe. It must return quickly and must not call back into the + // cache (Get, Set, Delete*, Flush, etc.): some call sites hold an internal + // shard lock, so re-entry can deadlock. + Sizer CacheSizer + // StaleTimeout is the duration after which an IN_PROGRESS placeholder is + // considered stale and eligible for takeover by a new Reserve call. + // If zero, defaults to defaultStaleTimeout (5s). + StaleTimeout time.Duration + + // DrainInterval is the background-drainer period (default 5ms; zero uses the + // default): how often idle pool conns are swept for buffered "invalidate" + // frames, roughly bounding cache-hit staleness. Values below 1ms are clamped + // to 1ms. + DrainInterval time.Duration + + // MaxStaleness caps how long a cached entry is served after it became valid, + // regardless of invalidation. It is a correctness + // BACKSTOP for lost invalidations or connection-lifecycle gaps ("Window 2"), not + // the primary freshness mechanism. Keep it well above the invalidation round-trip + // (e.g. seconds); per-entry refetch overhead scales ~1/MaxStaleness. + // + // Default: 0 (disabled). + MaxStaleness time.Duration +} + +// Cache is the thread-safe storage contract used by client-side caching. +// +// All methods may be called concurrently. Cache keys and Redis keys are opaque +// strings and must be preserved exactly. Removing a reservation must wake any +// Get calls waiting for it. +// +// Reserve must allow only one caller to fetch a missing key and return a token +// that is valid until FulfillOwned, Cancel, or an eviction removes that +// reservation. FulfillOwned and Cancel must modify only a reservation with the +// matching token. Get may wait for an in-progress reservation and must stop +// waiting when ctx is done. +// +// Experimental: this API may change in a minor release. +type Cache interface { + Get(ctx context.Context, cacheKey string) ([]byte, bool) + Reserve(cacheKey string, redisKeys []string) (token uint64, shouldFetch bool) + // FulfillOwned publishes a reserved value and records the connection that + // fetched it so the entry can be evicted if that connection loses tracking. + FulfillOwned(cacheKey string, token, ownerConnID uint64, value []byte) bool + Cancel(cacheKey string, token uint64) bool + DeleteByRedisKey(redisKey string) int + DeleteByCacheKey(cacheKey string) bool + // EvictByConn removes every entry fetched by connID. + EvictByConn(connID uint64) int + Flush() int +} + +const ( + defaultStaleTimeout = 5 * time.Second + defaultCacheShardCount = 16 + + // defaultCacheMaxEntries bounds the cache when the config leaves both + // MaxEntries and MaxMemoryBytes unlimited (matches the 10k-entry default + // other Redis clients use, e.g. redis-py). + defaultCacheMaxEntries = 10000 + + // shardingThresholdEntries / shardingThresholdBytes: caches with capacity + // below these thresholds fall back to a single shard so global LRU / + // memory-cap semantics behave exactly as a non-sharded cache would. + shardingThresholdEntries = 64 + shardingThresholdBytes = 64 * 1024 +) + +// NewLocalCache creates a thread-safe local cache with approximate-LRU +// eviction. The cache is internally sharded by cache-key hash to reduce +// mutex contention under high concurrent access. +// +// Experimental: this API may change in a minor release. +func NewLocalCache(cfg CacheConfig) *LocalCache { + sizer := cfg.Sizer + if sizer == nil { + sizer = defaultCacheSizer + } + + staleTimeout := cfg.StaleTimeout + if staleTimeout <= 0 { + staleTimeout = defaultStaleTimeout + } + + maxEntries := cfg.MaxEntries + maxMemoryBytes := cfg.MaxMemoryBytes + // An unbounded cache can grow until the process OOMs; require at least + // one limit. + if maxEntries <= 0 && maxMemoryBytes <= 0 { + maxEntries = defaultCacheMaxEntries + } + + shardCount := defaultCacheShardCount + if maxEntries > 0 && maxEntries < shardingThresholdEntries { + shardCount = 1 + } + if maxMemoryBytes > 0 && maxMemoryBytes < int64(shardingThresholdBytes) { + shardCount = 1 + } + + c := &LocalCache{ + shards: make([]cacheShard, shardCount), + shardCount: uint32(shardCount), + shardMask: uint32(shardCount - 1), + sizer: sizer, + } + for i := range c.shards { + s := &c.shards[i] + s.entries = make(map[string]*cacheEntry) + s.byRedisKey = make(map[string]map[string]struct{}) + s.byConnID = make(map[uint64]map[string]struct{}) + // Distribute capacity so the per-shard caps sum to exactly the + // configured limits; a ceil-per-shard split would let total residency + // exceed MaxEntries/MaxMemoryBytes. + if maxEntries > 0 { + s.maxEntries = maxEntries / shardCount + if i < maxEntries%shardCount { + s.maxEntries++ + } + } + if maxMemoryBytes > 0 { + s.maxMemoryBytes = maxMemoryBytes / int64(shardCount) + if int64(i) < maxMemoryBytes%int64(shardCount) { + s.maxMemoryBytes++ + } + } + s.maxStaleness = cfg.MaxStaleness + s.sizer = sizer + s.staleTimeout = staleTimeout + } + return c +} + +// LocalCache is the built-in sharded approximate-LRU cache. +// +// Experimental: this API may change in a minor release. +type LocalCache struct { + shards []cacheShard + shardCount uint32 + shardMask uint32 + sizer CacheSizer + + nextToken atomic.Uint64 + hits atomic.Uint64 + misses atomic.Uint64 +} + +var _ Cache = (*LocalCache)(nil) + +// cacheShard holds the state for one shard of LocalCache. The mutex +// protects entries, byRedisKey, byConnID, and usedBytes. +type cacheShard struct { + mu sync.RWMutex + entries map[string]*cacheEntry + byRedisKey map[string]map[string]struct{} + // byConnID is the owning-conn reverse index (twin of byRedisKey): conn id -> + // its cache keys. Populated by FulfillOwned, cleaned in removeEntryLocked, + // consumed by EvictByConn. + byConnID map[uint64]map[string]struct{} + usedBytes int64 + + maxEntries int + maxMemoryBytes int64 + maxStaleness time.Duration + sizer CacheSizer + staleTimeout time.Duration +} + +// shardFor returns the shard responsible for cacheKey. +func (c *LocalCache) shardFor(cacheKey string) *cacheShard { + if c.shardCount == 1 { + return &c.shards[0] + } + return &c.shards[fnv1a32(cacheKey)&c.shardMask] +} + +// fnv1a32 returns the FNV-1a 32-bit hash of s. Allocation-free. +func fnv1a32(s string) uint32 { + const ( + offset uint32 = 2166136261 + prime uint32 = 16777619 + ) + h := offset + for i := 0; i < len(s); i++ { + h ^= uint32(s[i]) + h *= prime + } + return h +} + +const defaultCacheEntryOverhead int64 = 96 + +func defaultCacheSizer(cacheKey string, redisKeys []string, value []byte) int64 { + size := defaultCacheEntryOverhead + int64(len(cacheKey)+len(value)) + for _, key := range redisKeys { + size += int64(len(key)) + 16 + } + if size < 0 { + return 0 + } + return size +} + +// Get returns a copy of a cached value, waiting for an in-progress fetch when +// necessary. +func (c *LocalCache) Get(ctx context.Context, cacheKey string) ([]byte, bool) { + if ctx == nil { + ctx = context.Background() + } + value, ok := c.shardFor(cacheKey).get(ctx, cacheKey) + if ok { + c.hits.Add(1) + } else { + c.misses.Add(1) + } + return value, ok +} + +// get is the read-side hot path. Holds only the shard's read lock; updates +// the LRU recency timestamp via atomic store on the entry — no write-lock +// upgrade is needed. +func (s *cacheShard) get(ctx context.Context, cacheKey string) ([]byte, bool) { + for { + s.mu.RLock() + entry, ok := s.entries[cacheKey] + if !ok { + s.mu.RUnlock() + return nil, false + } + + if entry.state == cacheEntryInProgress { + waitCh := entry.waitCh + // Bound the wait by the placeholder's remaining stale window so an + // abandoned reservation cannot block waiters indefinitely. + remaining := s.staleTimeout - time.Since(entry.reservedAt) + s.mu.RUnlock() + if waitCh == nil { + // Defensive: treat a missing waitCh as a miss to avoid busy-looping. + return nil, false + } + if remaining <= 0 { + // Placeholder already stale; miss so the caller refetches. + return nil, false + } + // Wait for the in-flight fetch to either publish (Fulfill) or abort (Cancel/Delete/Flush). + timer := time.NewTimer(remaining) + select { + case <-waitCh: + timer.Stop() + case <-ctx.Done(): + timer.Stop() + return nil, false + case <-timer.C: + return nil, false + } + continue + } + + if entry.state != cacheEntryValid { + s.mu.RUnlock() + return nil, false + } + + // Max-staleness backstop: a Valid entry older than maxStaleness is treated + // as a miss and evicted, so a lost invalidation or connection-lifecycle + // staleness (Window 2) cannot keep a stale value resident past MaxStaleness. + // Evict under the write lock so the next access re-fetches — a stale-but-present + // entry would otherwise suppress the re-fetch via Reserve. + if s.maxStaleness > 0 && time.Since(entry.validAt) > s.maxStaleness { + s.mu.RUnlock() + s.mu.Lock() + if cur, ok := s.entries[cacheKey]; ok && cur == entry { + s.removeEntryLocked(cacheKey) + } + s.mu.Unlock() + return nil, false + } + + value := cloneBytes(entry.value) + // Record access timestamp without upgrading the lock. Last writer + // wins; cross-goroutine ordering of timestamps is fine for + // approximate-LRU semantics. + entry.lastAccessNs.Store(nextLRUToken()) + s.mu.RUnlock() + return value, true + } +} + +// Stats returns cumulative activity and current residency. +func (c *LocalCache) Stats() CSCStats { + return CSCStats{ + Hits: c.hits.Load(), + Misses: c.misses.Load(), + Entries: c.Len(), + MemoryUsageBytes: c.MemoryUsage(), + } +} + +// Reserve claims a missing cache key for fetching. +func (c *LocalCache) Reserve(cacheKey string, redisKeys []string) (token uint64, shouldFetch bool) { + keysCopy := cloneStrings(redisKeys) + waitCh := make(chan struct{}) + reservedAt := time.Now() + sizeBytes := c.sizer(cacheKey, keysCopy, nil) + if sizeBytes < 0 { + sizeBytes = 0 + } + newToken := c.nextToken.Add(1) + + s := c.shardFor(cacheKey) + s.mu.Lock() + defer s.mu.Unlock() + + if entry, ok := s.entries[cacheKey]; ok { + switch entry.state { + case cacheEntryValid: + // Existing-VALID hit: record access; caller will re-Get to + // retrieve. + entry.lastAccessNs.Store(nextLRUToken()) + return 0, false + case cacheEntryInProgress: + if time.Since(entry.reservedAt) < s.staleTimeout { + return 0, false + } + s.removeEntryLocked(cacheKey) + default: + return 0, false + } + } + + if s.maxMemoryBytes > 0 && sizeBytes > s.maxMemoryBytes { + return 0, true + } + + entry := &cacheEntry{ + cacheKey: cacheKey, + redisKeys: keysCopy, + state: cacheEntryInProgress, + token: newToken, + reservedAt: reservedAt, + waitCh: waitCh, + sizeBytes: sizeBytes, + } + entry.lastAccessNs.Store(nextLRUToken()) + + s.setEntryLocked(entry) + // Evict only Valid victims. If still over capacity the shard holds only + // in-flight placeholders: rather than abort a peer's fetch, drop this + // reservation (the caller fetches uncached). The hard cap holds either way. + s.evictValidLocked() + if s.overCapacityLocked() { + s.removeEntryLocked(cacheKey) + return 0, true + } + if s.entries[cacheKey] != entry { + return 0, true + } + return newToken, true +} + +// FulfillOwned publishes a reserved value and records ownerConnID so +// EvictByConn can drop it when that connection is removed. ownerConnID == 0 +// leaves the value unowned. +func (c *LocalCache) FulfillOwned(cacheKey string, token, ownerConnID uint64, value []byte) bool { + return c.fulfill(cacheKey, token, ownerConnID, value) +} + +func (c *LocalCache) fulfill(cacheKey string, token, ownerConnID uint64, value []byte) bool { + valueCopy := cloneBytes(value) + + s := c.shardFor(cacheKey) + s.mu.Lock() + defer s.mu.Unlock() + + entry, ok := s.entries[cacheKey] + if !ok || entry.state != cacheEntryInProgress || entry.token != token { + return false + } + + valueSize := s.sizer(cacheKey, entry.redisKeys, valueCopy) + if valueSize < 0 { + valueSize = 0 + } + if s.maxMemoryBytes > 0 && valueSize > s.maxMemoryBytes { + s.removeEntryLocked(cacheKey) + return false + } + + s.usedBytes += valueSize - entry.sizeBytes + entry.value = valueCopy + entry.sizeBytes = valueSize + entry.state = cacheEntryValid + entry.validAt = time.Now() + entry.token = 0 + entry.lastAccessNs.Store(nextLRUToken()) + if ownerConnID != 0 { + entry.ownerConnID = ownerConnID + s.indexConnLocked(ownerConnID, cacheKey) + } + s.closeWaitersLocked(entry) + + s.evictIfNeededLocked() + current, stillExists := s.entries[cacheKey] + return stillExists && current == entry && entry.state == cacheEntryValid +} + +// EvictByConn removes every entry fetched by connID and returns the count. +// Called when a conn is removed/swapped: the server stops delivering those +// keys' invalidations, so keeping them risks stale serves. Errs toward a miss. +func (c *LocalCache) EvictByConn(connID uint64) int { + if connID == 0 { + return 0 + } + removed := 0 + for i := range c.shards { + removed += c.shards[i].evictByConn(connID) + } + return removed +} + +func (s *cacheShard) evictByConn(connID uint64) int { + s.mu.Lock() + defer s.mu.Unlock() + + cacheKeys, ok := s.byConnID[connID] + if !ok { + return 0 + } + toRemove := make([]string, 0, len(cacheKeys)) + for cacheKey := range cacheKeys { + toRemove = append(toRemove, cacheKey) + } + removed := 0 + for _, cacheKey := range toRemove { + if s.removeEntryLocked(cacheKey) { + removed++ + } + } + return removed +} + +// indexConnLocked records cacheKey under connID in the owning-connection index. +func (s *cacheShard) indexConnLocked(connID uint64, cacheKey string) { + cacheKeys := s.byConnID[connID] + if cacheKeys == nil { + cacheKeys = make(map[string]struct{}) + s.byConnID[connID] = cacheKeys + } + cacheKeys[cacheKey] = struct{}{} +} + +// Cancel removes the reservation matching token. +func (c *LocalCache) Cancel(cacheKey string, token uint64) bool { + s := c.shardFor(cacheKey) + s.mu.Lock() + defer s.mu.Unlock() + + entry, ok := s.entries[cacheKey] + if !ok || entry.state != cacheEntryInProgress || entry.token != token { + return false + } + + s.removeEntryLocked(cacheKey) + return true +} + +// DeleteByRedisKey removes entries associated with redisKey. +func (c *LocalCache) DeleteByRedisKey(redisKey string) int { + removed := 0 + for i := range c.shards { + removed += c.shards[i].deleteByRedisKey(redisKey) + } + return removed +} + +func (s *cacheShard) deleteByRedisKey(redisKey string) int { + s.mu.Lock() + defer s.mu.Unlock() + + cacheKeys, ok := s.byRedisKey[redisKey] + if !ok { + return 0 + } + + // Remove IN_PROGRESS placeholders too: an invalidation can arrive on a + // different stream than the in-flight reply (the background drainer), so the + // fetch may predate the write. Removing makes the racing Fulfill fail and + // waiters refetch, so a raced-invalidation value is never published. + toRemove := make([]string, 0, len(cacheKeys)) + for cacheKey := range cacheKeys { + toRemove = append(toRemove, cacheKey) + } + + removed := 0 + for _, cacheKey := range toRemove { + if s.removeEntryLocked(cacheKey) { + removed++ + } + } + return removed +} + +// DeleteByCacheKey removes one entry by its internal cache key. +func (c *LocalCache) DeleteByCacheKey(cacheKey string) bool { + s := c.shardFor(cacheKey) + s.mu.Lock() + defer s.mu.Unlock() + return s.removeEntryLocked(cacheKey) +} + +// Flush removes all entries. +func (c *LocalCache) Flush() int { + removed := 0 + for i := range c.shards { + removed += c.shards[i].flush() + } + return removed +} + +func (s *cacheShard) flush() int { + s.mu.Lock() + defer s.mu.Unlock() + + // Flush placeholders too (see deleteByRedisKey): a flush (FLUSHDB, or the + // owned-cache flush on Close) means everything, including in-flight fetches, + // may be stale. + removed := 0 + for cacheKey := range s.entries { + if s.removeEntryLocked(cacheKey) { + removed++ + } + } + return removed +} + +// Len returns the current number of entries and reservations. +func (c *LocalCache) Len() int { + n := 0 + for i := range c.shards { + s := &c.shards[i] + s.mu.RLock() + n += len(s.entries) + s.mu.RUnlock() + } + return n +} + +// MemoryUsage returns the cache's estimated memory usage in bytes. +func (c *LocalCache) MemoryUsage() int64 { + var total int64 + for i := range c.shards { + s := &c.shards[i] + s.mu.RLock() + total += s.usedBytes + s.mu.RUnlock() + } + return total +} + +func (s *cacheShard) setEntryLocked(entry *cacheEntry) { + if old, exists := s.entries[entry.cacheKey]; exists { + s.removeEntryLocked(old.cacheKey) + } + + s.entries[entry.cacheKey] = entry + s.usedBytes += entry.sizeBytes + + for _, redisKey := range entry.redisKeys { + cacheKeys := s.byRedisKey[redisKey] + if cacheKeys == nil { + cacheKeys = make(map[string]struct{}) + s.byRedisKey[redisKey] = cacheKeys + } + cacheKeys[entry.cacheKey] = struct{}{} + } +} + +func (s *cacheShard) removeEntryLocked(cacheKey string) bool { + entry, exists := s.entries[cacheKey] + if !exists { + return false + } + + delete(s.entries, cacheKey) + s.usedBytes -= entry.sizeBytes + if s.usedBytes < 0 { + s.usedBytes = 0 + } + + for _, redisKey := range entry.redisKeys { + cacheKeys := s.byRedisKey[redisKey] + if cacheKeys == nil { + continue + } + delete(cacheKeys, cacheKey) + if len(cacheKeys) == 0 { + delete(s.byRedisKey, redisKey) + } + } + + if entry.ownerConnID != 0 { + if cacheKeys := s.byConnID[entry.ownerConnID]; cacheKeys != nil { + delete(cacheKeys, cacheKey) + if len(cacheKeys) == 0 { + delete(s.byConnID, entry.ownerConnID) + } + } + } + + s.closeWaitersLocked(entry) + return true +} + +func (s *cacheShard) closeWaitersLocked(entry *cacheEntry) { + if entry.waitCh != nil && !entry.waitClosed { + close(entry.waitCh) + entry.waitClosed = true + } +} + +func (s *cacheShard) overCapacityLocked() bool { + if s.maxEntries > 0 && len(s.entries) > s.maxEntries { + return true + } + if s.maxMemoryBytes > 0 && s.usedBytes > s.maxMemoryBytes { + return true + } + return false +} + +// evictIfNeededLocked evicts by approximate LRU (O(N) scan; rare in +// well-sized caches) until under capacity. Used by Set/Fulfill: it prefers a +// Valid victim but falls back to the oldest IN_PROGRESS placeholder to keep the +// hard cap (that placeholder's Fulfill then fails and its waiters refetch). +func (s *cacheShard) evictIfNeededLocked() { + for s.overCapacityLocked() { + victim := s.oldestLocked(cacheEntryValid) + if victim == nil { + victim = s.oldestLocked(cacheEntryInProgress) + } + if victim == nil { + return + } + s.removeEntryLocked(victim.cacheKey) + } +} + +// evictValidLocked evicts only Valid entries until under capacity. Unlike +// evictIfNeededLocked it never evicts a placeholder, so Reserve can't abort a +// peer's in-flight fetch. +func (s *cacheShard) evictValidLocked() { + for s.overCapacityLocked() { + victim := s.oldestLocked(cacheEntryValid) + if victim == nil { + return + } + s.removeEntryLocked(victim.cacheKey) + } +} + +// oldestLocked returns the entry in the given state with the smallest +// lastAccessNs (the least-recently-used), or nil when none exists. +func (s *cacheShard) oldestLocked(state cacheEntryState) *cacheEntry { + var victim *cacheEntry + var oldestNs int64 = math.MaxInt64 + for _, e := range s.entries { + if e.state != state { + continue + } + if ns := e.lastAccessNs.Load(); ns < oldestNs { + oldestNs = ns + victim = e + } + } + return victim +} + +func cloneBytes(src []byte) []byte { + if src == nil { + return nil + } + dst := make([]byte, len(src)) + copy(dst, src) + return dst +} + +func cloneStrings(src []string) []string { + if len(src) == 0 { + return nil + } + dst := make([]string, len(src)) + copy(dst, src) + return dst +} diff --git a/vendor/github.com/redis/go-redis/v9/maintnotifications/manager.go b/vendor/github.com/redis/go-redis/v9/maintnotifications/manager.go index ff54c717d..bf32389a7 100644 --- a/vendor/github.com/redis/go-redis/v9/maintnotifications/manager.go +++ b/vendor/github.com/redis/go-redis/v9/maintnotifications/manager.go @@ -77,17 +77,33 @@ type Manager struct { activeOperationCount atomic.Int64 // Number of active operations closed atomic.Bool // Manager closed state + // shutdownTimeout bounds each pool hook's Shutdown during Close. A field + // (not a constant) so tests can exercise the failed-Close-then-retry + // path without waiting out the real budget. + shutdownTimeout time.Duration + // Notification hooks for extensibility hooks []NotificationHook hooksMu sync.RWMutex // Protects hooks slice poolHooksRef *PoolHook + // additionalPoolHooks are pool hooks bound to pools other than the primary + // one (e.g. a dedicated pipeline connection pool). Each is an independent + // *PoolHook bound to its own pool because the hook's failed-handoff removal + // target (HandoffRequest.Pool) is taken from the hook's single pool field, + // so one hook cannot safely serve two pools. They share this Manager as + // their operations manager, keeping MOVING/MIGRATING tracking centralized. + additionalPoolHooks []additionalPoolHook + // Connections that successfully enabled maintnotifications. These need to be // retired before the pool-level listeners are removed. maintNotificationsConns sync.Map // connID -> *pool.Conn - // Cluster state reload callback for SMIGRATED notifications - clusterStateReloadCallback ClusterStateReloadCallback + // Cluster state reload callback for SMIGRATED notifications. + // Stored atomically because it is set from the OnNewNode hook while a node + // client is being created and read from the SMIGRATED push handler on that + // node's connections, which can overlap during connection init. + clusterStateReloadCallback atomic.Pointer[ClusterStateReloadCallback] } // MovingOperation tracks an active MOVING operation. @@ -113,11 +129,12 @@ func NewManager(client interfaces.ClientInterface, pool pool.Pooler, config *Con } hm := &Manager{ - client: client, - pool: pool, - options: client.GetOptions(), - config: config.Clone(), - hooks: make([]NotificationHook, 0), + client: client, + pool: pool, + options: client.GetOptions(), + config: config.Clone(), + hooks: make([]NotificationHook, 0), + shutdownTimeout: 10 * time.Second, } // Set up push notification handling @@ -134,6 +151,78 @@ func (hm *Manager) InitPoolHook(baseDialer func(context.Context, string, string) hm.pool.AddPoolHook(poolHook) } +// additionalPoolHook pairs a pool hook with the pool it was attached to so the +// manager can shut it down and detach it on Close. +type additionalPoolHook struct { + pool pool.Pooler + hook *PoolHook +} + +// InitPoolHookForPool attaches a maintnotifications pool hook to an additional +// pool (e.g. a client's dedicated pipeline connection pool). A fresh, independent +// *PoolHook is created and bound to the given pool so that connections which fail +// handoff are removed from the correct pool — the hook's removal target is its own +// single pool field, so the primary hook cannot be reused for a second pool. The +// new hook shares this Manager as its operations manager, so MOVING/MIGRATING +// tracking and notification handling stay centralized across both pools. +func (hm *Manager) InitPoolHookForPool(p pool.Pooler, baseDialer func(context.Context, string, string) (net.Conn, error)) { + if p == nil { + return + } + poolSize := 0 + network := "" + if hm.options != nil { + poolSize = hm.options.GetPoolSize() + network = hm.options.GetNetwork() + } + hook := NewPoolHookWithPoolSize(baseDialer, network, hm.config, hm, poolSize) + hook.SetPool(p) + // The closed check, the append, AND the AddPoolHook must all be atomic with + // respect to Close's snapshot: hold the lock across all three so either Close + // runs first (closed==true here, so we neither register nor attach) or we + // register+attach first (Close's snapshot then includes this hook and tears + // it down). Attaching outside the lock left a window where Close could + // snapshot/tear-down between the append and the attach, then AddPoolHook + // would re-attach to a closed manager's pool — leaking an active hook. + // p.AddPoolHook is lock-free (atomic swap on the pool's own hook manager) and + // never calls back into this manager, so holding hooksMu across it is safe. + hm.hooksMu.Lock() + defer hm.hooksMu.Unlock() + if hm.closed.Load() { + return + } + hm.additionalPoolHooks = append(hm.additionalPoolHooks, additionalPoolHook{pool: p, hook: hook}) + p.AddPoolHook(hook) +} + +// hookForConn returns the pool hook that owns cn's pool: an additional hook +// when the connection came from a secondary pool (e.g. a client's dedicated +// pipeline pool), the primary hook otherwise. Handoffs must be queued through +// the owning hook — the HandoffRequest carries that hook's pool, and a failed +// handoff removes the connection from it, so queuing a pipeline-pool +// connection on the primary hook would close the connection without freeing +// its slot in the pipeline pool's bookkeeping. +func (hm *Manager) hookForConn(cn *pool.Conn) *PoolHook { + if cn == nil { + return hm.poolHooksRef + } + name := cn.PoolName() + if name == "" { + return hm.poolHooksRef + } + hm.hooksMu.RLock() + defer hm.hooksMu.RUnlock() + for _, ah := range hm.additionalPoolHooks { + // Pooler does not expose the name; the concrete pool does. A Pooler + // implementation without it simply never matches and falls through to + // the primary hook — the pre-existing behavior. + if np, ok := ah.pool.(interface{ Name() string }); ok && np.Name() == name { + return ah.hook + } + } + return hm.poolHooksRef +} + // setupPushNotifications sets up push notification handling by registering with the client's processor. func (hm *Manager) setupPushNotifications() error { processor := hm.client.GetPushProcessor() @@ -284,17 +373,38 @@ func (hm *Manager) maintNotificationsConnSnapshot() []*pool.Conn { func (hm *Manager) retireMaintNotificationsConns(ctx context.Context) { conns := hm.maintNotificationsConnSnapshot() - if len(conns) == 0 || hm.pool == nil { + if len(conns) == 0 { return } - if retirer, ok := hm.pool.(pool.ConnRetirer); ok { - retirer.RetireConns(ctx, conns, pool.CloseReasonMaintNotificationsDisabled) - return + // Tracked connections can live in the primary pool OR in any additional + // pool this manager attached a hook to (e.g. a client's dedicated pipeline + // connection pool — its conns run initConn and are tracked exactly like + // primary ones). Retire through every pool: RetireConns skips connections + // a pool does not own, so offering the full snapshot to each pool is safe. + // Missing the additional pools left pipeline connections in service with + // maintnotifications enabled but no hook attached after a runtime + // downgrade — pushes on them were silently dropped. + pools := make([]pool.Pooler, 0, 1+len(hm.additionalPoolHooks)) + if hm.pool != nil { + pools = append(pools, hm.pool) + } + hm.hooksMu.RLock() + for _, ah := range hm.additionalPoolHooks { + if ah.pool != nil { + pools = append(pools, ah.pool) + } } + hm.hooksMu.RUnlock() - for _, cn := range conns { - _ = hm.pool.CloseConn(ctx, cn, pool.CloseReasonMaintNotificationsDisabled, pool.MetricStateIdle) + for _, pl := range pools { + if retirer, ok := pl.(pool.ConnRetirer); ok { + retirer.RetireConns(ctx, conns, pool.CloseReasonMaintNotificationsDisabled) + continue + } + for _, cn := range conns { + _ = pl.CloseConn(ctx, cn, pool.CloseReasonMaintNotificationsDisabled, pool.MetricStateIdle) + } } } @@ -312,7 +422,7 @@ func (hm *Manager) Close() error { // Shutdown the pool hook if it exists if hm.poolHooksRef != nil { // Use a timeout to prevent hanging indefinitely - shutdownCtx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + shutdownCtx, cancel := context.WithTimeout(context.Background(), hm.shutdownTimeout) defer cancel() err := hm.poolHooksRef.Shutdown(shutdownCtx) @@ -327,6 +437,36 @@ func (hm *Manager) Close() error { } } + // Shutdown and detach any hooks bound to additional pools (e.g. a dedicated + // pipeline pool). Snapshot under the lock so we don't iterate concurrently + // with a registering InitPoolHookForPool; Shutdown itself runs unlocked. + hm.hooksMu.Lock() + additional := hm.additionalPoolHooks + hm.additionalPoolHooks = nil + hm.hooksMu.Unlock() + for i, ah := range additional { + shutdownCtx, cancel := context.WithTimeout(context.Background(), hm.shutdownTimeout) + err := ah.hook.Shutdown(shutdownCtx) + cancel() + if err != nil { + // Could not cleanly shut down this hook. Put it and the ones not + // yet processed back so a retried Close still sees them, then stay + // open so the caller can retry, matching the primary-hook behavior + // above. Hooks before i already shut down and detached. + hm.hooksMu.Lock() + remaining := make([]additionalPoolHook, 0, len(additional)-i+len(hm.additionalPoolHooks)) + remaining = append(remaining, additional[i:]...) + remaining = append(remaining, hm.additionalPoolHooks...) + hm.additionalPoolHooks = remaining + hm.hooksMu.Unlock() + hm.closed.Store(false) + return err + } + if ah.pool != nil { + ah.pool.RemovePoolHook(ah.hook) + } + } + // Clear all active operations hm.activeMovingOps.Range(func(key, value interface{}) bool { hm.activeMovingOps.Delete(key) @@ -401,13 +541,13 @@ func (hm *Manager) AddNotificationHook(notificationHook NotificationHook) { // SetClusterStateReloadCallback sets the callback function that will be called when a SMIGRATED notification is received. // This allows node clients to notify their parent ClusterClient to reload cluster state. func (hm *Manager) SetClusterStateReloadCallback(callback ClusterStateReloadCallback) { - hm.clusterStateReloadCallback = callback + hm.clusterStateReloadCallback.Store(&callback) } // TriggerClusterStateReload calls the cluster state reload callback if it's set. // This is called when a SMIGRATED notification is received. func (hm *Manager) TriggerClusterStateReload(ctx context.Context, hostPort string, slotRanges []string) { - if hm.clusterStateReloadCallback != nil { - hm.clusterStateReloadCallback(ctx, hostPort, slotRanges) + if cb := hm.clusterStateReloadCallback.Load(); cb != nil { + (*cb)(ctx, hostPort, slotRanges) } } diff --git a/vendor/github.com/redis/go-redis/v9/maintnotifications/pool_hook.go b/vendor/github.com/redis/go-redis/v9/maintnotifications/pool_hook.go index 752abc711..71d14a7ff 100644 --- a/vendor/github.com/redis/go-redis/v9/maintnotifications/pool_hook.go +++ b/vendor/github.com/redis/go-redis/v9/maintnotifications/pool_hook.go @@ -164,12 +164,17 @@ func (ph *PoolHook) OnPut(ctx context.Context, conn *pool.Conn) (shouldPool bool } if err := conn.MarkQueuedForHandoff(); err != nil { - // If marking fails, check if handoff was processed in the meantime + // Marking can fail if a worker advanced the connection's state between + // our queueHandoff above and here. Re-check ShouldHandoff: with the CAS + // rollback in Conn.MarkQueuedForHandoff, a worker that already cleared + // the handoff state is no longer misreported as ShouldHandoff=true, so a + // cleared connection is reliably detected and pooled here. if !conn.ShouldHandoff() { - // Handoff was processed - this is normal, pool the connection + // Handoff was processed - this is normal, pool the connection. return true, false, nil } - // Other error - remove the connection + // Still marked for handoff in an ambiguous state — remove it rather than + // returning a connection a queued worker may still close or replace. return false, true, nil } internal.Logger.Printf(ctx, logs.MarkedForHandoff(conn.GetID())) diff --git a/vendor/github.com/redis/go-redis/v9/maintnotifications/push_notification_handler.go b/vendor/github.com/redis/go-redis/v9/maintnotifications/push_notification_handler.go index 7108265b2..26ae7fd44 100644 --- a/vendor/github.com/redis/go-redis/v9/maintnotifications/push_notification_handler.go +++ b/vendor/github.com/redis/go-redis/v9/maintnotifications/push_notification_handler.go @@ -161,8 +161,15 @@ func (snh *NotificationHandler) handleMoving(ctx context.Context, handlerCtx pus // If the connection is in use (StateInUse), it will be queued when returned to the pool via OnPut. // This handles the case where the connection is idle and might never be retrieved again. if poolConn.GetStateMachine().GetState() == pool.StateIdle { - if snh.manager.poolHooksRef != nil && snh.manager.poolHooksRef.workerManager != nil { - if err := snh.manager.poolHooksRef.workerManager.queueHandoff(poolConn); err != nil { + // Queue on the hook that owns this connection's pool, not + // unconditionally on the primary one: the request carries the + // hook's pool, and a failed handoff removes the connection + // from it — for a dedicated pipeline-pool connection the + // primary pool cannot do that, which would close the + // connection while leaving a dead slot behind. + owner := snh.manager.hookForConn(poolConn) + if owner != nil && owner.workerManager != nil { + if err := owner.workerManager.queueHandoff(poolConn); err != nil { internal.Logger.Printf(context.Background(), logs.FailedToQueueHandoff(poolConn.GetID(), err)) } else { // Mark the connection as queued for handoff to prevent it from being retrieved diff --git a/vendor/github.com/redis/go-redis/v9/options.go b/vendor/github.com/redis/go-redis/v9/options.go index ba45a0cb8..0863b3862 100644 --- a/vendor/github.com/redis/go-redis/v9/options.go +++ b/vendor/github.com/redis/go-redis/v9/options.go @@ -16,6 +16,7 @@ import ( "time" "github.com/redis/go-redis/v9/auth" + "github.com/redis/go-redis/v9/internal" "github.com/redis/go-redis/v9/internal/pool" "github.com/redis/go-redis/v9/internal/proto" "github.com/redis/go-redis/v9/internal/util" @@ -121,12 +122,12 @@ type Options struct { // MinRetryBackoff is the minimum backoff between each retry. // -1 disables backoff. // - // default: 8 milliseconds + // default: 10 milliseconds MinRetryBackoff time.Duration // MaxRetryBackoff is the maximum backoff between each retry. // -1 disables backoff. - // default: 512 milliseconds; + // default: 1 second; MaxRetryBackoff time.Duration // DialTimeout for establishing new connections. @@ -157,7 +158,7 @@ type Options struct { // - `-1` - no timeout (block indefinitely). // - `-2` - disables SetReadDeadline calls completely. // - // default: 3 seconds + // default: 5 seconds ReadTimeout time.Duration // WriteTimeout for socket writes. If reached, commands will fail @@ -166,7 +167,7 @@ type Options struct { // - `-1` - no timeout (block indefinitely). // - `-2` - disables SetWriteDeadline calls completely. // - // default: 3 seconds + // default: 5 seconds (same as ReadTimeout, which it follows when unset) WriteTimeout time.Duration // ContextTimeoutEnabled controls whether the client respects context timeouts and deadlines. @@ -187,6 +188,86 @@ type Options struct { // default: 32KiB (32768 bytes) WriteBufferSize int + // PipelineReadBufferSize is the size of the bufio.Reader buffer for pipeline connections. + // If set to a value > 0, a separate connection pool will be created specifically for + // pipelining operations (Pipeline, AutoPipeline and AsyncAutoPipeline) with + // this buffer size. + // + // This allows you to use large buffers for pipelining (to reduce syscalls and improve + // throughput) while keeping regular command buffers small (to save memory). + // + // If not set (0), pipeline operations will use the regular connection pool with + // ReadBufferSize buffers. + // + // Recommended: 64–128 KiB for high-throughput pipelining. The benefit here is + // on the READ side: a batch's replies arrive as one large stream, and a bigger + // buffer consumes them in fewer syscalls instead of refilling repeatedly + // mid-batch. Size it to roughly the reply volume of a typical batch — which + // for read-heavy pipelines is dominated by value sizes, not command count. + // (The write-side counterpart, sizing to the outgoing wire bytes so the batch + // flushes without overflowing mid-write, belongs to PipelineWriteBufferSize.) + // Benchmarks show throughput climbs from the 32 KiB default up to ~64 KiB and + // then plateaus; going beyond ~128 KiB gives no further gain and very large + // buffers (≥512 KiB) can regress throughput and waste memory. Bigger is not + // better. + // + // Example: + // client := redis.NewClient(&redis.Options{ + // Addr: "localhost:6379", + // ReadBufferSize: 32 * 1024, // 32 KiB for regular commands + // PipelineReadBufferSize: 128 * 1024, // 128 KiB for pipelining + // PipelineWriteBufferSize: 128 * 1024, + // }) + // + // Memory impact: With PoolSize=100 and PipelinePoolSize=10: + // - Without pipeline pool: 100 conns × 128 KiB = 12.8 MB (if all use 128 KiB buffers) + // - With pipeline pool: (100 × 32 KiB) + (10 × 128 KiB) = 4.5 MB (~65% savings) + // + // default: 0 (use ReadBufferSize) + PipelineReadBufferSize int + + // PipelineWriteBufferSize is the size of the bufio.Writer buffer for pipeline connections. + // If set to a value > 0, a separate connection pool will be created specifically for + // pipelining operations (Pipeline, AutoPipeline and AsyncAutoPipeline) with + // this buffer size. + // + // This allows you to use large buffers for pipelining (to reduce syscalls and improve + // throughput) while keeping regular command buffers small (to save memory). + // + // If not set (0), pipeline operations will use the regular connection pool with + // WriteBufferSize buffers. + // + // Recommended: 64–128 KiB for high-throughput pipelining (size to roughly + // MaxBatchSize × average-command-bytes). Throughput plateaus past ~64 KiB and + // gains nothing beyond ~128 KiB; very large buffers (≥512 KiB) can regress it. + // See PipelineReadBufferSize for the full rationale. + // + // default: 0 (use WriteBufferSize) + PipelineWriteBufferSize int + + // PipelinePoolSize is the pool size for the separate pipeline connection pool. + // Only used if PipelineReadBufferSize or PipelineWriteBufferSize is set. + // + // Pipelining typically needs fewer connections than regular operations because + // batching reduces connection contention. A smaller pool saves memory while + // maintaining high throughput. + // + // If not set (0), defaults to 10 connections. + // + // default: 10 + PipelinePoolSize int + + // AutoPipelineOptions is the default config for BOTH autopipeliner faces: + // AutoPipeline and AsyncAutoPipeline use it when called without an + // explicit config, falling back to their per-face defaults + // (DefaultBlockingAutoPipelineOptions / DefaultAutoPipelineOptions) when it + // is nil. Pass a config to either method to override. Commands issued + // through an autopipeliner are batched into pipelines to cut round-trips + // and raise throughput. + // + // EXPERIMENTAL: this API is subject to change, use with caution. + AutoPipelineOptions *AutoPipelineOptions + // PoolFIFO type of connection pool. // // - true for FIFO pool @@ -300,6 +381,8 @@ type Options struct { // PushNotificationProcessor is the processor for handling push notifications. // If nil, a default processor will be created for RESP3 connections. + // With client-side caching, a custom processor runs while an idle connection + // is borrowed from the pool and should return promptly. PushNotificationProcessor push.NotificationProcessor // FailingTimeoutSeconds is the timeout in seconds for marking a cluster node as failing. @@ -313,12 +396,76 @@ type Options struct { // transitions seamlessly. Requires Protocol: 3 (RESP3) for push notifications. // If nil, maintnotifications are in "auto" mode and will be enabled if the server supports it. MaintNotificationsConfig *maintnotifications.Config + + // ClientSideCacheConfig enables client-side caching when non-nil. Together + // with ClientSideCache it is the on/off switch for the feature: leave both + // nil to disable CSC, set either one to enable it. If ClientSideCache is also set, it + // takes precedence over this config. + // + // Client-side caching is disabled when CredentialsProvider, + // CredentialsProviderContext, or StreamingCredentialsProvider is set: + // provider-backed credentials can change the ACL identity after the cache + // namespace is selected. Fixed Username/Password values are supported and + // included in the cache namespace. + // + // Experimental: this API may change in a minor release. + ClientSideCacheConfig *ClientSideCacheConfig + + // ClientSideCache is an explicit Cache implementation used for client-side + // caching. When set, it overrides ClientSideCacheConfig. Intended for + // advanced users that want to share a cache across clients or supply a + // custom implementation. + // + // A shared Cache is only safe across clients on the same server and DB. + // Clients with different fixed Username/Password values are isolated by a + // username namespace. + // Client-side caching is restricted to DB 0 and disabled with a warning + // otherwise. It is also disabled with any credential provider; see + // ClientSideCacheConfig. + // + // Experimental: this API may change in a minor release. + ClientSideCache Cache + + // ClientSideCacheStrategy selects the invalidation architecture used when + // client-side caching is enabled (via ClientSideCacheConfig or + // ClientSideCache); it is ignored when CSC is disabled. The zero value is + // CSCStrategySharedTracking, currently the only implemented strategy. + // + // Experimental: this API may change in a minor release. + ClientSideCacheStrategy CSCStrategy } +// CSCStrategy selects the client-side caching invalidation architecture. Set via +// Options.ClientSideCacheStrategy; fixed for the client's lifetime. +// +// CSCStrategySharedTracking is currently the only implemented strategy; the type +// exists as an extension point for additional architectures (e.g. a BCAST sidecar) +// without a breaking API change. +// +// Experimental: this API may change in a minor release. +type CSCStrategy int + +const ( + // CSCStrategySharedTracking (default, the zero value): one shared cache; every + // pool connection runs plain CLIENT TRACKING ON and a background drainer applies + // buffered invalidations. Portable (no BCAST), and matches the other Redis clients. + CSCStrategySharedTracking CSCStrategy = iota +) + func (opt *Options) init() { if opt.Addr == "" { opt.Addr = "localhost:6379" } + // An unknown strategy would thread the CSC gates inconsistently (e.g. tracking + // on with no drainer), serving stale data. Clamp to the only supported value. + switch opt.ClientSideCacheStrategy { + case CSCStrategySharedTracking: + default: + internal.Logger.Printf(context.Background(), + "redis: unknown ClientSideCacheStrategy %d; falling back to CSCStrategySharedTracking", + opt.ClientSideCacheStrategy) + opt.ClientSideCacheStrategy = CSCStrategySharedTracking + } if opt.Network == "" { if strings.HasPrefix(opt.Addr, "/") { opt.Network = "unix" @@ -357,6 +504,13 @@ func (opt *Options) init() { } if opt.ReadBufferSize == 0 { opt.ReadBufferSize = proto.DefaultBufferSize + } else if opt.Protocol == 3 && opt.ReadBufferSize < proto.MinRESP3ReadBufferSize { + // Too small to hold a push header, the processor would consume frames before + // knowing their name and could swallow a Pub/Sub frame. Clamp to the minimum. + internal.Logger.Printf(context.Background(), + "redis: ReadBufferSize=%d is below the RESP3 minimum %d; clamping.", + opt.ReadBufferSize, proto.MinRESP3ReadBufferSize) + opt.ReadBufferSize = proto.MinRESP3ReadBufferSize } if opt.WriteBufferSize == 0 { opt.WriteBufferSize = proto.DefaultBufferSize @@ -367,7 +521,7 @@ func (opt *Options) init() { case -1: opt.ReadTimeout = 0 case 0: - opt.ReadTimeout = 3 * time.Second + opt.ReadTimeout = 5 * time.Second } switch opt.WriteTimeout { case -2: @@ -400,19 +554,24 @@ func (opt *Options) init() { case -1: opt.MinRetryBackoff = 0 case 0: - opt.MinRetryBackoff = 8 * time.Millisecond + opt.MinRetryBackoff = 10 * time.Millisecond } switch opt.MaxRetryBackoff { case -1: opt.MaxRetryBackoff = 0 case 0: - opt.MaxRetryBackoff = 512 * time.Millisecond + opt.MaxRetryBackoff = time.Second } if opt.FailingTimeoutSeconds == 0 { opt.FailingTimeoutSeconds = 15 } + if opt.Protocol == 2 && (opt.ClientSideCache != nil || opt.ClientSideCacheConfig != nil) { + internal.Logger.Printf(context.Background(), + "redis: client-side caching requires Protocol: 3 (RESP3); caching is disabled") + } + opt.MaintNotificationsConfig = opt.MaintNotificationsConfig.ApplyDefaultsWithPoolConfig(opt.PoolSize, opt.MaxActiveConns) // auto-detect endpoint type if not specified @@ -442,13 +601,24 @@ func (opt *Options) NewDialer() func(context.Context, string, string) (net.Conn, return NewDialer(opt) } +// defaultKeepAliveConfig is the TCP keep-alive policy of the default dialers +// here and in sentinel.go: start probing after 30s idle (below typical LB/NAT +// idle timeouts), then declare the peer dead after 3 unanswered probes 5s +// apart. +var defaultKeepAliveConfig = net.KeepAliveConfig{ + Enable: true, + Idle: 30 * time.Second, + Interval: 5 * time.Second, + Count: 3, +} + // NewDialer returns a function that will be used as the default dialer // when none is specified in Options.Dialer. func NewDialer(opt *Options) func(context.Context, string, string) (net.Conn, error) { return func(ctx context.Context, network, addr string) (net.Conn, error) { netDialer := &net.Dialer{ - Timeout: opt.DialTimeout, - KeepAlive: 5 * time.Minute, + Timeout: opt.DialTimeout, + KeepAliveConfig: defaultKeepAliveConfig, } if opt.TLSConfig == nil { return netDialer.DialContext(ctx, network, addr) @@ -547,10 +717,12 @@ func setupTCPConn(u *url.URL) (*Options, error) { // a host and a port. If the host is missing, it defaults to localhost // and if the port is missing, it defaults to 6379. func getHostPortWithDefaults(u *url.URL) (string, string) { - host, port, err := net.SplitHostPort(u.Host) - if err != nil { - host = u.Host - } + // u.Hostname and u.Port strip the surrounding brackets from IPv6 literals + // (e.g. "[::1]" -> "::1") and handle the missing-port case, which + // net.SplitHostPort instead reports as an error. Relying on them avoids + // leaving the brackets on the host, which the caller's net.JoinHostPort + // would wrap again and turn "redis://[::1]" into "[[::1]]:6379". + host, port := u.Hostname(), u.Port() if host == "" { host = "localhost" } @@ -627,6 +799,10 @@ func (o *queryOptions) duration(name string) time.Duration { } dur, err := time.ParseDuration(s) if err == nil { + if dur <= 0 { + // disable timeouts + return -1 + } return dur } if o.err == nil { diff --git a/vendor/github.com/redis/go-redis/v9/osscluster.go b/vendor/github.com/redis/go-redis/v9/osscluster.go index efd52960c..c6f97a40a 100644 --- a/vendor/github.com/redis/go-redis/v9/osscluster.go +++ b/vendor/github.com/redis/go-redis/v9/osscluster.go @@ -142,6 +142,19 @@ type ClusterOptions struct { // default: 32KiB (32768 bytes) WriteBufferSize int + // PipelineReadBufferSize, PipelineWriteBufferSize and PipelinePoolSize + // configure an optional separate connection pool used for pipelining on + // each node, with its own (typically larger) buffers. See the same-named + // fields on Options for details. The pool is created only when PipelineReadBufferSize or PipelineWriteBufferSize is set (PipelinePoolSize alone does not enable it). + PipelineReadBufferSize int + PipelineWriteBufferSize int + PipelinePoolSize int + + // AutoPipelineOptions is the default config for BOTH autopipeliner faces + // (AutoPipeline and AsyncAutoPipeline), applied when they are called + // without explicit options. See Options.AutoPipelineOptions. + AutoPipelineOptions *AutoPipelineOptions + TLSConfig *tls.Config // DisableRoutingPolicies disables the request/response policy routing system. @@ -190,7 +203,9 @@ type ClusterOptions struct { ShardPicker routing.ShardPicker // ClusterStateReloadInterval is the interval for reloading the cluster state. - // Default is 10 seconds. + // MOVED/ASK redirects still trigger an immediate reactive reload, so this + // only bounds how stale a topology can get without traffic errors. + // Default is 60 seconds. ClusterStateReloadInterval time.Duration } @@ -235,7 +250,7 @@ func (opt *ClusterOptions) init() { case -1: opt.ReadTimeout = 0 case 0: - opt.ReadTimeout = 3 * time.Second + opt.ReadTimeout = 5 * time.Second } switch opt.WriteTimeout { case -1: @@ -251,13 +266,13 @@ func (opt *ClusterOptions) init() { case -1: opt.MinRetryBackoff = 0 case 0: - opt.MinRetryBackoff = 8 * time.Millisecond + opt.MinRetryBackoff = 10 * time.Millisecond } switch opt.MaxRetryBackoff { case -1: opt.MaxRetryBackoff = 0 case 0: - opt.MaxRetryBackoff = 512 * time.Millisecond + opt.MaxRetryBackoff = time.Second } if opt.NewClient == nil { @@ -273,7 +288,7 @@ func (opt *ClusterOptions) init() { } if opt.ClusterStateReloadInterval == 0 { - opt.ClusterStateReloadInterval = 10 * time.Second + opt.ClusterStateReloadInterval = 60 * time.Second } } @@ -455,11 +470,15 @@ func (opt *ClusterOptions) clientOptions() *Options { ConnMaxLifetimeJitter: opt.ConnMaxLifetimeJitter, ReadBufferSize: opt.ReadBufferSize, WriteBufferSize: opt.WriteBufferSize, - DisableIdentity: opt.DisableIdentity, - DisableIndentity: opt.DisableIdentity, - IdentitySuffix: opt.IdentitySuffix, - FailingTimeoutSeconds: opt.FailingTimeoutSeconds, - TLSConfig: opt.TLSConfig, + + PipelineReadBufferSize: opt.PipelineReadBufferSize, + PipelineWriteBufferSize: opt.PipelineWriteBufferSize, + PipelinePoolSize: opt.PipelinePoolSize, + DisableIdentity: opt.DisableIdentity, + DisableIndentity: opt.DisableIndentity, + IdentitySuffix: opt.IdentitySuffix, + FailingTimeoutSeconds: opt.FailingTimeoutSeconds, + TLSConfig: opt.TLSConfig, // If ClusterSlots is populated, then we probably have an artificial // cluster whose nodes are not in clustering mode (otherwise there isn't // much use for ClusterSlots config). This means we cannot execute the @@ -477,13 +496,13 @@ func (opt *ClusterOptions) clientOptions() *Options { type clusterNode struct { Client *Client - latency uint32 // atomic - generation uint32 // atomic - failing uint32 // atomic - loaded uint32 // atomic + latency atomic.Uint32 + generation atomic.Uint32 + failing atomic.Uint32 + loaded atomic.Uint32 // last time the latency measurement was performed for the node, stored in nanoseconds from epoch - lastLatencyMeasurement int64 // atomic + lastLatencyMeasurement atomic.Int64 } func newClusterNodeWithNodeAddress(clOpt *ClusterOptions, addr, nodeAddress string) *clusterNode { @@ -494,7 +513,7 @@ func newClusterNodeWithNodeAddress(clOpt *ClusterOptions, addr, nodeAddress stri Client: clOpt.NewClient(opt), } - node.latency = math.MaxUint32 + node.latency.Store(math.MaxUint32) if clOpt.RouteByLatency { go node.updateLatency() } @@ -536,46 +555,46 @@ func (n *clusterNode) updateLatency() { } else { latency = float64(dur) / float64(successes) } - atomic.StoreUint32(&n.latency, uint32(latency+0.5)) + n.latency.Store(uint32(latency + 0.5)) n.SetLastLatencyMeasurement(time.Now()) } func (n *clusterNode) Latency() time.Duration { - latency := atomic.LoadUint32(&n.latency) + latency := n.latency.Load() return time.Duration(latency) * time.Microsecond } func (n *clusterNode) MarkAsFailing() { - atomic.StoreUint32(&n.failing, uint32(time.Now().Unix())) - atomic.StoreUint32(&n.loaded, 0) + n.failing.Store(uint32(time.Now().Unix())) + n.loaded.Store(0) } func (n *clusterNode) Failing() bool { timeout := int64(n.Client.opt.FailingTimeoutSeconds) - failing := atomic.LoadUint32(&n.failing) + failing := n.failing.Load() if failing == 0 { return false } if time.Now().Unix()-int64(failing) < timeout { return true } - atomic.StoreUint32(&n.failing, 0) + n.failing.Store(0) return false } func (n *clusterNode) Generation() uint32 { - return atomic.LoadUint32(&n.generation) + return n.generation.Load() } func (n *clusterNode) LastLatencyMeasurement() int64 { - return atomic.LoadInt64(&n.lastLatencyMeasurement) + return n.lastLatencyMeasurement.Load() } func (n *clusterNode) SetGeneration(gen uint32) { for { - v := atomic.LoadUint32(&n.generation) - if gen < v || atomic.CompareAndSwapUint32(&n.generation, v, gen) { + v := n.generation.Load() + if gen < v || n.generation.CompareAndSwap(v, gen) { break } } @@ -583,15 +602,15 @@ func (n *clusterNode) SetGeneration(gen uint32) { func (n *clusterNode) SetLastLatencyMeasurement(t time.Time) { for { - v := atomic.LoadInt64(&n.lastLatencyMeasurement) - if t.UnixNano() < v || atomic.CompareAndSwapInt64(&n.lastLatencyMeasurement, v, t.UnixNano()) { + v := n.lastLatencyMeasurement.Load() + if t.UnixNano() < v || n.lastLatencyMeasurement.CompareAndSwap(v, t.UnixNano()) { break } } } func (n *clusterNode) Loading() bool { - loaded := atomic.LoadUint32(&n.loaded) + loaded := n.loaded.Load() if loaded == 1 { return false } @@ -603,7 +622,7 @@ func (n *clusterNode) Loading() bool { err := n.Client.Ping(ctx).Err() loading := err != nil && isLoadingError(err) if !loading { - atomic.StoreUint32(&n.loaded, 1) + n.loaded.Store(1) } return loading } @@ -620,7 +639,7 @@ type clusterNodes struct { closed bool onNewNode []func(rdb *Client) - generation uint32 // atomic + generation atomic.Uint32 } func newClusterNodes(opt *ClusterOptions) *clusterNodes { @@ -685,7 +704,7 @@ func (c *clusterNodes) Addrs() ([]string, error) { } func (c *clusterNodes) NextGeneration() uint32 { - return atomic.AddUint32(&c.generation, 1) + return c.generation.Add(1) } // GC removes unused nodes. @@ -1064,8 +1083,8 @@ type clusterStateHolder struct { reloadInterval time.Duration state atomic.Value - reloading uint32 // atomic - reloadPending uint32 // atomic - set to 1 when reload is requested during active reload + reloading atomic.Uint32 + reloadPending atomic.Uint32 // set to 1 when reload is requested during active reload } func newClusterStateHolder(load func(ctx context.Context) (*clusterState, error), reloadInterval time.Duration) *clusterStateHolder { @@ -1086,8 +1105,8 @@ func (c *clusterStateHolder) Reload(ctx context.Context) (*clusterState, error) func (c *clusterStateHolder) LazyReload() { // If already reloading, mark that another reload is pending - if !atomic.CompareAndSwapUint32(&c.reloading, 0, 1) { - atomic.StoreUint32(&c.reloadPending, 1) + if !c.reloading.CompareAndSwap(0, 1) { + c.reloadPending.Store(1) return } @@ -1095,22 +1114,22 @@ func (c *clusterStateHolder) LazyReload() { for { _, err := c.Reload(context.Background()) if err != nil { - atomic.StoreUint32(&c.reloadPending, 0) - atomic.StoreUint32(&c.reloading, 0) + c.reloadPending.Store(0) + c.reloading.Store(0) return } // Clear pending flag after reload completes, before cooldown // This captures notifications that arrived during the reload - atomic.StoreUint32(&c.reloadPending, 0) + c.reloadPending.Store(0) // Wait cooldown period time.Sleep(200 * time.Millisecond) // Check if another reload was requested during cooldown - if atomic.LoadUint32(&c.reloadPending) == 0 { + if c.reloadPending.Load() == 0 { // No pending reload, we're done - atomic.StoreUint32(&c.reloading, 0) + c.reloading.Store(0) return } @@ -1153,6 +1172,17 @@ type ClusterClient struct { cmdInfoResolver *commandInfoResolver cmdable hooksMixin + + // himport is the cluster-wide HIMPORT fieldset registry, shared with + // every node client (masters and replicas alike — roles change with the + // topology) so any connection serving an HIMPORT SET can lazily replay + // the PREPARE (see himport.go, himport_cluster.go). + himport *himportRegistry + + autopipelinerMu *sync.Mutex // guards the autopipeliner fields against concurrent first-call creation + autopipeliner *AutoPipeliner // blocking face (ClusterClient.AutoPipeline) + asyncAutopipeliner *AutoPipeliner // deferred face (ClusterClient.AsyncAutoPipeline) + autopipelinerClosed bool // set by Close: refuse to resurrect a pipeliner on a closed client } // NewClusterClient returns a Redis Cluster client as described in @@ -1165,10 +1195,19 @@ func NewClusterClient(opt *ClusterOptions) *ClusterClient { opt.init() c := &ClusterClient{ - opt: opt, - nodes: newClusterNodes(opt), + opt: opt, + nodes: newClusterNodes(opt), + himport: newHImportRegistry(), + autopipelinerMu: &sync.Mutex{}, } + // Every node client shares the cluster-wide fieldset registry, replicas + // included: a promoted replica's connections carry no prepared flags, so + // the first HIMPORT SET routed to it replays the PREPARE lazily. + c.nodes.OnNewNode(func(nodeClient *Client) { + nodeClient.himport = c.himport + }) + c.cmdsInfoCache = newCmdsInfoCache(c.cmdsInfo) c.state = newClusterStateHolder(c.loadState, opt.ClusterStateReloadInterval) @@ -1223,7 +1262,26 @@ func (c *ClusterClient) ReloadState(ctx context.Context) { // It is rare to Close a ClusterClient, as the ClusterClient is meant // to be long-lived and shared between many goroutines. func (c *ClusterClient) Close() error { - return c.nodes.Close() + // Stop both cached autopipeliners (blocking and async faces) before + // closing nodes, so its background flusher goroutines don't outlive the + // client. AutoPipeliner.Close is idempotent and nil-safe here. + c.autopipelinerMu.Lock() + ap, async := c.autopipeliner, c.asyncAutopipeliner + c.autopipeliner, c.asyncAutopipeliner = nil, nil + c.autopipelinerClosed = true // getters refuse to resurrect on a closed client + c.autopipelinerMu.Unlock() + var firstErr error + for _, p := range []*AutoPipeliner{ap, async} { + if p != nil { + if err := p.Close(); err != nil && firstErr == nil { + firstErr = err + } + } + } + if err := c.nodes.Close(); err != nil && firstErr == nil { + firstErr = err + } + return firstErr } func (c *ClusterClient) Process(ctx context.Context, cmd Cmder) error { @@ -1555,6 +1613,155 @@ func (c *ClusterClient) Pipeline() Pipeliner { return &pipe } +// clusterAutoPipelineOptions applies the cluster shard-count default: commands +// are routed to shards by slot (see installAutoPipelineSharding), so unlike a +// standalone client — which defaults to a single deep queue — a cluster client +// wants several shards to keep concurrent nodes' batches separate. The caller's +// config is copied before the default is filled in, never mutated. +func clusterAutoPipelineOptions(cfg *AutoPipelineOptions) *AutoPipelineOptions { + c2 := *cfg + if c2.NumShards == 0 { + c2.NumShards = numAutoPipelineShards() + } + // A cluster always routes by slot, so per-key order holds regardless of shard + // count; mark it so construction's NumShards ordering check (which targets + // round-robin sharding) does not reject the cluster default or an explicit + // NumShards on the deferred (async) face. + c2.contentSharded = true + return &c2 +} + +// AutoPipeline returns the blocking autopipeliner for this cluster client: each +// command call blocks until executed (drop-in shape) while the engine batches +// concurrent callers into pipelines. Commands keep per-goroutine order; across +// nodes, ordering is per key (slot routing keeps a key on one shard and node +// sub-pipelines execute concurrently). Use AutoPipelineWithOptions to override +// DefaultBlockingAutoPipelineOptions. Cached/shared; first call's config wins. +// Close it (or the client) to release its goroutines. +// +// It returns an error if the supplied config is invalid (e.g. MaxConcurrentBatches>1 +// without Unordered, or a negative size); on error no instance is cached. +// +// EXPERIMENTAL: this API is subject to change, use with caution. +func (c *ClusterClient) AutoPipeline() (*AutoPipeliner, error) { + return c.AutoPipelineWithOptions(nil) +} + +// AutoPipelineWithOptions is AutoPipeline with explicit options instead of +// ClusterOptions.AutoPipelineOptions / the default. Cached/shared; first call wins. +// +// EXPERIMENTAL: this API is subject to change, use with caution. +func (c *ClusterClient) AutoPipelineWithOptions(config *AutoPipelineOptions) (*AutoPipeliner, error) { + return getOrCreateAutoPipeliner(c.autopipelinerMu, &c.autopipeliner, &c.autopipelinerClosed, nil, config, + func() *AutoPipelineOptions { + if c.opt.AutoPipelineOptions != nil { + return c.opt.AutoPipelineOptions + } + return DefaultBlockingAutoPipelineOptions() + }, + func(cfg *AutoPipelineOptions) (*AutoPipeliner, error) { + ap, err := newAutoPipeliner(c, clusterAutoPipelineOptions(cfg), true) + if err != nil { + return nil, err + } + c.installAutoPipelineSharding(ap) + return ap, nil + }) +} + +// installAutoPipelineSharding routes commands to shards by cluster slot so each +// shard's batch lands on a single master node, keeping per-node pipelines deep +// instead of splitting every batch across all nodes at flush. Cluster slots are +// contiguous per node, so bucketing by slot range (slot*shards/16384) keeps a +// node's slots together. Keyless commands hash to slot -1 → bucket 0; multi-node +// commands are already rejected from pipelines, so only single-node commands +// reach here. +func (c *ClusterClient) installAutoPipelineSharding(ap *AutoPipeliner) { + // Reject commands whose request policy cannot ride a pipeline (ReqAllNodes/ + // ReqAllShards/ReqMultiShard) at submit, BEFORE they can join a merged + // batch: mapCmdsByNode fails a whole mapping on such a command (user + // pipelines are all-or-nothing), and one autopipeline caller must not be + // able to poison unrelated callers' batches. Rejecting here also keeps the + // lone-command fast path consistent with batched dispatch — the command is + // refused regardless of what it happens to coalesce with. + ap.setPreflight(func(ctx context.Context, cmd Cmder) error { + if c.cmdInfoResolver == nil { + return nil + } + if policy := c.cmdInfoResolver.GetCommandPolicy(ctx, cmd); policy != nil && !policy.CanBeUsedInPipeline() { + return fmt.Errorf( + "redis: cannot pipeline command %q with request policy ReqAllNodes/ReqAllShards/ReqMultiShard; Note: This behavior is subject to change in the future", cmd.Name(), + ) + } + return nil + }) + // Commands whose routing is not slot-derived must not be coalesced: a solo + // flush reaches ClusterClient.process and its special handling (FT.CURSOR + // READ/DEL are sticky to the node holding the cursor), but inside a batch + // mapCmdsByNode routes by slot and can hit the wrong shard — visible only + // under concurrent traffic, which is the worst way to find it. Divert them + // instead of rejecting: they work fine on their own connection (review + // finding by codex on #3942). + ap.setMustDivert(func(ctx context.Context, cmd Cmder) bool { + if c.cmdInfoResolver == nil { + return false + } + policy := c.cmdInfoResolver.GetCommandPolicy(ctx, cmd) + return policy != nil && policy.Request == routing.ReqSpecial + }) + + const slots = 16384 + n := ap.numShards() + ap.setShardFn(func(cmd Cmder) int { + // Compute the exact slot once and cache it on the command; the flush + // router (mapCmdsByNode) reuses the cached value, so the slot is resolved + // once per command, not twice. Keyless (slot -1) buckets to shard 0. + slot := c.cmdSlot(cmd, -1) + if slot < 0 { + return 0 + } + return slot * n / slots + }) +} + +// AsyncAutoPipeline returns the deferred autopipeliner: command calls return +// immediately and the result accessors block. Submit a window then read results +// for the highest throughput. By default, +// ClusterOptions.AutoPipelineOptions is used if set, otherwise +// DefaultAutoPipelineOptions. Ordering across nodes is per key: slot routing +// keeps a key on one shard, and node sub-pipelines execute concurrently. Use +// AsyncAutoPipelineWithOptions to override. Cached/shared; first call's config wins. +// +// It returns an error if the supplied config is invalid (e.g. MaxConcurrentBatches>1 +// without Unordered, or a negative size); on error no instance is cached. +// +// EXPERIMENTAL: this API is subject to change, use with caution. +func (c *ClusterClient) AsyncAutoPipeline() (*AutoPipeliner, error) { + return c.AsyncAutoPipelineWithOptions(nil) +} + +// AsyncAutoPipelineWithOptions is AsyncAutoPipeline with an explicit config +// instead of ClusterOptions.AutoPipelineOptions / the default. Cached/shared. +// +// EXPERIMENTAL: this API is subject to change, use with caution. +func (c *ClusterClient) AsyncAutoPipelineWithOptions(config *AutoPipelineOptions) (*AutoPipeliner, error) { + return getOrCreateAutoPipeliner(c.autopipelinerMu, &c.asyncAutopipeliner, &c.autopipelinerClosed, nil, config, + func() *AutoPipelineOptions { + if c.opt.AutoPipelineOptions != nil { + return c.opt.AutoPipelineOptions + } + return DefaultAutoPipelineOptions() + }, + func(cfg *AutoPipelineOptions) (*AutoPipeliner, error) { + ap, err := newAutoPipeliner(c, clusterAutoPipelineOptions(cfg), false) + if err != nil { + return nil, err + } + c.installAutoPipelineSharding(ap) + return ap, nil + }) +} + func (c *ClusterClient) Pipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error) { return c.Pipeline().Pipelined(ctx, fn) } @@ -1638,9 +1845,18 @@ func (c *ClusterClient) mapCmdsByNode(ctx context.Context, cmdsMap *cmdsMap, cmd policy = c.cmdInfoResolver.GetCommandPolicy(ctx, cmd) } if policy != nil && !policy.CanBeUsedInPipeline() { - return fmt.Errorf( + // All-or-nothing: a user Pipeline() relies on the whole batch + // either dispatching or failing before anything executes, so a + // non-pipelineable command fails the entire mapping pre-dispatch. + // Autopipeline batches never reach here with such a command: the + // cluster face rejects them at submit (see the preflight installed + // by installAutoPipelineSharding), so one caller's bad command + // cannot poison a merged batch. + err := fmt.Errorf( "redis: cannot pipeline command %q with request policy ReqAllNodes/ReqAllShards/ReqMultiShard; Note: This behavior is subject to change in the future", cmd.Name(), ) + setCmdsErr(cmds, err) + return err } slot := c.cmdSlot(cmd, -1) var node *clusterNode @@ -1649,10 +1865,15 @@ func (c *ClusterClient) mapCmdsByNode(ctx context.Context, cmdsMap *cmdsMap, cmd if len(state.Masters) == 0 { return errClusterNoNodes } - // For read-only keyless commands, pick from all nodes (masters + slaves) - allNodes := append(state.Masters, state.Slaves...) - idx := c.opt.ShardPicker.Next(len(allNodes)) - node = allNodes[idx] + // For read-only keyless commands, pick from all nodes (masters + slaves). + // Index directly instead of building a combined slice, which would + // append into the shared snapshot's spare capacity and race. + idx := c.opt.ShardPicker.Next(len(state.Masters) + len(state.Slaves)) + if idx < len(state.Masters) { + node = state.Masters[idx] + } else { + node = state.Slaves[idx-len(state.Masters)] + } } else { node, err = c.slotReadOnlyNode(state, slot) if err != nil { @@ -1670,9 +1891,18 @@ func (c *ClusterClient) mapCmdsByNode(ctx context.Context, cmdsMap *cmdsMap, cmd policy = c.cmdInfoResolver.GetCommandPolicy(ctx, cmd) } if policy != nil && !policy.CanBeUsedInPipeline() { - return fmt.Errorf( + // All-or-nothing: a user Pipeline() relies on the whole batch + // either dispatching or failing before anything executes, so a + // non-pipelineable command fails the entire mapping pre-dispatch. + // Autopipeline batches never reach here with such a command: the + // cluster face rejects them at submit (see the preflight installed + // by installAutoPipelineSharding), so one caller's bad command + // cannot poison a merged batch. + err := fmt.Errorf( "redis: cannot pipeline command %q with request policy ReqAllNodes/ReqAllShards/ReqMultiShard; Note: This behavior is subject to change in the future", cmd.Name(), ) + setCmdsErr(cmds, err) + return err } slot := c.cmdSlot(cmd, -1) var node *clusterNode @@ -1707,31 +1937,76 @@ func (c *ClusterClient) cmdsAreReadOnly(ctx context.Context, cmds []Cmder) bool func (c *ClusterClient) processPipelineNode( ctx context.Context, node *clusterNode, cmds []Cmder, failedCmds *cmdsMap, ) { - _ = node.Client.withProcessPipelineHook(ctx, cmds, func(ctx context.Context, cmds []Cmder) error { - cn, err := node.Client.getConn(ctx) - if err != nil { + // This call runs on a per-node fan-out goroutine, so register it as an + // executor of every deferred-face batch among cmds: a NODE-level hook + // (OnNewNode — redisotel's tracing) reading a result before next() must + // get the not-yet-executed view from the accessor guards instead of + // blocking on a batch only this call chain completes (reproduced as a + // permanent wedge with a rediscmd-shaped Err() peek). + unregister := registerBatchExecutors(cmds) + defer unregister() + + // executed guards against a node-level hook short-circuiting (returning + // without calling next): the inner callback then never runs, and without + // surfacing the chain's error the cluster pipeline would report success + // for commands that were never sent. + executed := false + err := node.Client.withProcessPipelineHook(ctx, cmds, func(ctx context.Context, cmds []Cmder) error { + executed = true + // Acquire through the node's dedicated pipeline pool when one is + // configured (Pipeline*BufferSize propagate to node clients via + // clientOptions); withPipelineConn falls back to the main pool + // otherwise, preserving the previous behavior. entered distinguishes + // an acquisition failure (fn never ran) from an execution error. + entered := false + err := node.Client.withPipelineConn(ctx, func(ctx context.Context, cn *pool.Conn) error { + entered = true + return c.processPipelineNodeConn(ctx, node, cn, cmds, failedCmds) + }) + if err != nil && !entered { if !isContextError(err) { node.MarkAsFailing() } _ = c.mapCmdsByNode(ctx, failedCmds, cmds) setCmdsErr(cmds, err) - return err } - - var processErr error - defer func() { - node.Client.releaseConn(ctx, cn, processErr) - }() - processErr = c.processPipelineNodeConn(ctx, node, cn, cmds, failedCmds) - - return processErr + return err }) + if !executed { + // A hook returned without calling next. If it supplied an error that is + // a deliberate abort: set it and do not remap for retry (a retry would + // re-run the same hook). If it returned nil it short-circuited + // SUCCESSFULLY, having served the batch itself — the same thing a plain + // Pipeline hook may do — so setCmdsErr(nil) leaves the values it set + // intact (review finding by codex on #3942). + setCmdsErr(cmds, err) + return + } + if err != nil && cmdsFirstErr(cmds) == nil { + // Post-next verdict from a node-level hook on an all-clean sub-batch: + // the exec fully succeeded, so the error can only be the hook's own — + // apply it, mirroring AutoPipeliner.dispatchCmds. On a mixed batch the + // exec-recorded outcomes win (hooks conventionally echo next's error, + // and stamping the echo would overwrite successful replies). No remap: + // retrying would re-run the same hook. + setCmdsErr(cmds, err) + } } func (c *ClusterClient) processPipelineNodeConn( ctx context.Context, node *clusterNode, cn *pool.Conn, cmds []Cmder, failedCmds *cmdsMap, ) error { + // HIMPORT bookkeeping: pending discards for this session and PREPAREs + // for registered fieldsets the batch references get written ahead of + // the batch (see himport.go). + injected := node.Client.himportInjectedCmds(ctx, cn, cmds) + if err := cn.WithWriter(c.context(ctx), c.opt.WriteTimeout, func(wr *proto.Writer) error { + for _, ic := range injected { + if err := writeCmd(wr, ic); err != nil { + return err + } + } return writeCmds(wr, cmds) }); err != nil { if isBadConn(err, false, node.Client.getAddr()) { @@ -1745,18 +2020,56 @@ func (c *ClusterClient) processPipelineNodeConn( } return cn.WithReader(c.context(ctx), c.opt.ReadTimeout, func(rd *proto.Reader) error { - return c.pipelineReadCmds(ctx, node, rd, cmds, failedCmds) + if err := node.Client.himportReadInjectedReplies(ctx, cn, rd, injected); err != nil { + // Transport error with the batch replies unread: same handling + // as a write error — the batch may be retried on a fresh + // connection. + if isBadConn(err, false, node.Client.getAddr()) { + node.MarkAsFailing() + } + if shouldRetry(err, true) && !cmdsContainNoRetry(cmds) { + _ = c.mapCmdsByNode(ctx, failedCmds, cmds) + } + setCmdsErr(cmds, err) + return err + } + err := c.pipelineReadCmds(ctx, node, cn, rd, cmds, failedCmds) + if err == nil || isRedisError(err) { + node.Client.himportAfterBatch(cn, injected, cmds) + // SETs of registered fieldsets that lost their session state + // re-queue for the next attempt, which re-prepares lazily — + // the cluster equivalent of himportRetryFailedSets, bounded by + // the pipeline's attempt budget. A non-nil redis error here + // means pipelineReadCmds already re-queued the whole batch + // (retryable first-command error); adding the SETs again would + // duplicate them in the next attempt. + if err == nil { + c.himportRequeueFailedSets(ctx, cmds, failedCmds) + } + } + return err }) } func (c *ClusterClient) pipelineReadCmds( ctx context.Context, node *clusterNode, + cn *pool.Conn, rd *proto.Reader, cmds []Cmder, failedCmds *cmdsMap, ) error { for i, cmd := range cmds { + // Drain any buffered RESP3 push notifications before reading each + // reply — otherwise a push frame (e.g. a maintnotifications MOVING + // notification) is consumed AS the command's reply and every + // subsequent reply in the pipeline shifts by one command. The + // standalone pipeline and the cluster TxPipeline read loops already + // do this; this loop was the only push-blind reader, and the + // autopipeliner routes all cluster traffic through it. + if err := node.Client.processPendingPushNotificationWithReader(ctx, cn, rd); err != nil { + internal.Logger.Printf(ctx, "push: error processing pending notifications before reading reply: %v", err) + } err := cmd.readReply(rd) cmd.SetErr(err) @@ -1781,7 +2094,8 @@ func (c *ClusterClient) pipelineReadCmds( } } - if err := cmds[0].Err(); err != nil && shouldRetry(err, true) && !cmdsContainNoRetry(cmds) { + // rawErr: execution path; never await an async command's batch here. + if err := cmds[0].rawErr(); err != nil && shouldRetry(err, true) && !cmdsContainNoRetry(cmds) { _ = c.mapCmdsByNode(ctx, failedCmds, cmds) return err } @@ -1832,18 +2146,108 @@ func (c *ClusterClient) TxPipelined(ctx context.Context, fn func(Pipeliner) erro return c.TxPipeline().Pipelined(ctx, fn) } -func (c *ClusterClient) processTxPipeline(ctx context.Context, cmds []Cmder) error { - // Only call time.Now() if pipeline operation duration callback is set to avoid overhead +// A cluster tx pipeline sends MULTI, c1..cN, EXEC — N+2 commands, or N+3 with a +// leading ASKING — and always receives exactly that many replies, so every +// redirect/abort path leaves the connection clean. +// +// Possible reply sequences: +// 1. Slot owned here, no migration: +// +OK, +QUEUED x N, *N (array of N results) -> success +// 2. Slot already migrated away: +// +OK, -MOVED x N, -EXECABORT -> re-route whole tx +// 3. Slot in migrating state (still owned here, keys draining out). Per +// cmd, the queue reply is +QUEUED / -ASK / -TRYAGAIN (keys present / +// all gone / some gone); any -ASK or -TRYAGAIN dirties the tx, so +// EXEC is -EXECABORT. Still N+2 replies, like the cases above: +// +OK, (+QUEUED|-ASK|-TRYAGAIN) x N, -EXECABORT -> follow first redirect +// 4. Narrow race (all +QUEUED, slot moves before EXEC): +// +OK, +QUEUED x N, -MOVED -> re-route whole tx +// 5. Non-cluster command error (arity / ACL / unknown): +// +OK, +QUEUED..., -ERR..., -EXECABORT -> surface, not retryable +// 6. Narrow race (all +QUEUED, slot still migrating, keys drain before EXEC): +// +OK, +QUEUED x N, -ASK / -TRYAGAIN -> re-route on -ASK, back off on -TRYAGAIN +// +// EXEC reply — the reply that decides the outcome: +// +// *N success; read N per-command results +// -EXECABORT a queue-stage command failed; follow the first queue +// redirect (MOVED/ASK/TRYAGAIN), else surface the trigger +// -MOVED case 4; re-route whole tx to addr, reload topology +// -ASK race: slot entered migrating state; re-route to addr +// with a top-level ASKING before MULTI +// -TRYAGAIN race: migrating with split keys, or slot being trimmed +// (CLUSTER_REDIR_TRIMMING on a write); back off and retry +// the whole tx (same node still owns it) +// -CLUSTERDOWN cluster degraded; back off and retry whole tx +// +// ASK retry: the ASKING flag is NOT cleared between commands inside a MULTI +// so one top-level ASKING before MULTI covers the whole tx and lets the importing +// slot serve at EXEC. ASKING placed inside the MULTI would be queued and leave +// the flag unset during queueing, so the keyed commands would still get MOVED. +// +// Out of scope: WATCH's null-array EXEC and -CROSSSLOT; +// cluster TxPipeline is not used with WATCH and cross-slot is rejected client-side. + +type txOutcomeKind int + +const ( + txSuccess txOutcomeKind = iota // transaction executed; per-command results are set + txRetryMoved // MOVED: reload topology and re-route the whole tx + txRetryAsk // ASK: re-route to the target with a top-level ASKING + txRetryTryAgain // TRYAGAIN: back off and re-route the whole tx + txRetryConn // connection/write/read failure: re-route the whole tx + txFatal // non-retryable error; surface to the caller +) + +// txOutcome is the result of a single tx attempt. err is the error to report +// when the redirect/retry loop is exhausted (or the fatal error to surface); +// addr is the ASK target; execErr is the EXEC reply error used to mark +// aborted commands; unreadReplies forces the connection to be discarded +// when the read loop exited before consuming all N+2 replies, leaving bytes +// on the wire. +type txOutcome struct { + kind txOutcomeKind + err error + addr string + execErr error + unreadReplies bool +} + +// txRedirect records the first queue-stage redirect (MOVED/ASK/TRYAGAIN) seen +// while reading +QUEUED replies. Redis dirties and aborts the transaction on +// any such reply, so the EXEC reply will be EXECABORT and the client must +// follow the recorded redirect with the whole transaction. +type txRedirect struct { + moved bool + ask bool + tryAgain bool + addr string + err error +} + +// errTxDirtyConn forces releaseConn to discard a connection that may still have +// unread transaction replies on it (an early exit before consuming all N+2). +var errTxDirtyConn = errors.New("redis: connection has unread transaction replies") + +func (c *ClusterClient) processTxPipeline(ctx context.Context, cmds []Cmder) (retErr error) { var operationStart time.Time pipelineOpDurationCallback := otel.GetPipelineOperationDurationCallback() if pipelineOpDurationCallback != nil { operationStart = time.Now() } totalAttempts := 0 + var lastErr error + + defer func() { + if pipelineOpDurationCallback == nil { + return + } + finalErr := cmp.Or(retErr, cmdsFirstErr(cmds), lastErr) + pipelineOpDurationCallback(ctx, time.Since(operationStart), "MULTI", len(cmds), totalAttempts, finalErr, nil, 0) + }() // Trim multi .. exec. cmds = cmds[1 : len(cmds)-1] - if len(cmds) == 0 { return nil } @@ -1851,10 +2255,6 @@ func (c *ClusterClient) processTxPipeline(ctx context.Context, cmds []Cmder) err state, err := c.state.Get(ctx) if err != nil { setCmdsErr(cmds, err) - if pipelineOpDurationCallback != nil { - operationDuration := time.Since(operationStart) - pipelineOpDurationCallback(ctx, operationDuration, "MULTI", len(cmds), 1, err, nil, 0) - } return err } @@ -1866,77 +2266,85 @@ func (c *ClusterClient) processTxPipeline(ctx context.Context, cmds []Cmder) err case 1: for sl := range keyedCmdsBySlot { slot = sl - break } default: // TxPipeline does not support cross slot transaction. setCmdsErr(cmds, ErrCrossSlot) - if pipelineOpDurationCallback != nil { - operationDuration := time.Since(operationStart) - pipelineOpDurationCallback(ctx, operationDuration, "MULTI", len(cmds), 1, ErrCrossSlot, nil, 0) - } return ErrCrossSlot } node, err := state.slotMasterNode(slot) if err != nil { setCmdsErr(cmds, err) - if pipelineOpDurationCallback != nil { - operationDuration := time.Since(operationStart) - pipelineOpDurationCallback(ctx, operationDuration, "MULTI", len(cmds), 1, err, nil, 0) - } return err } - var lastErr error - cmdsMap := map[*clusterNode][]Cmder{node: cmds} + asking := false + // MOVED/ASK are routing changes, not transient failures: follow them immediately. + redirected := false for attempt := 0; attempt <= c.opt.MaxRedirects; attempt++ { totalAttempts++ - if attempt > 0 { + if attempt > 0 && !redirected { if err := internal.Sleep(ctx, c.retryBackoff(attempt)); err != nil { setCmdsErr(cmds, err) - if pipelineOpDurationCallback != nil { - operationDuration := time.Since(operationStart) - pipelineOpDurationCallback(ctx, operationDuration, "MULTI", len(cmds), totalAttempts, err, nil, 0) - } return err } } - failedCmds := newCmdsMap() - var wg sync.WaitGroup - - for node, cmds := range cmdsMap { - wg.Add(1) - go func(node *clusterNode, cmds []Cmder) { - defer wg.Done() - c.processTxPipelineNode(ctx, node, cmds, failedCmds) - }(node, cmds) - } - - wg.Wait() - if len(failedCmds.m) == 0 { - break + outcome := c.processTxPipelineNode(ctx, node, cmds, asking) + lastErr = outcome.err + redirected = false + switch outcome.kind { + case txSuccess: + return cmdsFirstErr(cmds) + case txRetryMoved: + // Route directly to the authoritative addr from the MOVED; the + // cached slot state may be stale until LazyReload lands. + redirected = true + asking = false + c.state.LazyReload() + if node, err = c.nodes.GetOrCreate(outcome.addr); err != nil { + setCmdsErr(cmds, err) + return err + } + case txRetryAsk: + redirected = true + asking = true + if node, err = c.nodes.GetOrCreate(outcome.addr); err != nil { + setCmdsErr(cmds, err) + return err + } + case txRetryTryAgain, txRetryConn: + // Same node, fresh connection: TRYAGAIN comes from the migrating + // source (still the owner), and a conn failure only needs a new + // connection. Preserve a prior ASKING flag: if we followed an ASK + // to the importing target, the retry must still send ASKING (the + // slot is still importing). ASKING is harmless if the migration + // has since completed, since the flag is only consulted for + // importing slots. + case txFatal: + // Mark every queued-but-never-executed command with the abort + // error; the command that triggered EXECABORT already has its + // own error and keeps it, so callers can tell what went wrong. + abortErr := cmp.Or(outcome.execErr, outcome.err) + for _, cmd := range cmds { + if cmd.Err() == nil { + cmd.SetErr(abortErr) + } + } + return lastErr } - cmdsMap = failedCmds.m - lastErr = cmdsFirstErr(cmds) } - if pipelineOpDurationCallback != nil { - operationDuration := time.Since(operationStart) - finalErr := cmdsFirstErr(cmds) - if finalErr == nil { - finalErr = lastErr - } - pipelineOpDurationCallback(ctx, operationDuration, "MULTI", len(cmds), totalAttempts, finalErr, nil, 0) + if lastErr != nil { + setCmdsErr(cmds, lastErr) } - return cmdsFirstErr(cmds) } // slottedKeyedCommands returns a map of slot to commands taking into account // only commands that have keys. -func (c *ClusterClient) slottedKeyedCommands(ctx context.Context, cmds []Cmder) map[int][]Cmder { +func (c *ClusterClient) slottedKeyedCommands(_ context.Context, cmds []Cmder) map[int][]Cmder { cmdsSlots := map[int][]Cmder{} // Peek once outside the loop, one RLock for the whole batch instead of @@ -1967,151 +2375,255 @@ func (c *ClusterClient) slottedKeyedCommands(ctx context.Context, cmds []Cmder) } func (c *ClusterClient) processTxPipelineNode( - ctx context.Context, node *clusterNode, cmds []Cmder, failedCmds *cmdsMap, -) { - cmds = wrapMultiExec(ctx, cmds) - _ = node.Client.withProcessPipelineHook(ctx, cmds, func(ctx context.Context, cmds []Cmder) error { - cn, err := node.Client.getConn(ctx) - if err != nil { - _ = c.mapCmdsByNode(ctx, failedCmds, cmds) - setCmdsErr(cmds, err) - return err + ctx context.Context, node *clusterNode, cmds []Cmder, asking bool, +) *txOutcome { + wire := wrapMultiExec(ctx, cmds) + if asking { + // ASKING must precede MULTI so the flag stays set for the whole tx. + wire = append([]Cmder{NewCmd(ctx, "asking")}, wire...) + } + + var outcome *txOutcome + // executed guards against a node-level hook short-circuiting (returning + // without calling next) — same treatment as processPipelineNode. + executed := false + chainErr := node.Client.withProcessPipelineHook(ctx, wire, func(ctx context.Context, wire []Cmder) error { + executed = true + // Acquire through the node's dedicated pipeline pool when configured + // (same routing as processPipelineNode); withPipelineConn falls back + // to the main pool otherwise. The inner fn's return value drives the + // connection release exactly like the explicit releaseConn did: + // redis errors keep the conn poolable, unread replies poison it. + entered := false + err := node.Client.withPipelineConn(ctx, func(ctx context.Context, cn *pool.Conn) error { + entered = true + outcome = c.processTxPipelineNodeConn(ctx, node, cn, wire, cmds, asking) + connErr := outcome.err + if isRedisError(outcome.err) { + connErr = nil + } + if outcome.unreadReplies { + connErr = errTxDirtyConn + } + return connErr + }) + if !entered && err != nil { + // Connection acquisition failed — fn never ran. + if shouldRetry(err, true) && !cmdsContainNoRetry(cmds) { + outcome = &txOutcome{kind: txRetryConn, err: err} + } else { + outcome = &txOutcome{kind: txFatal, err: err} + } } - - var processErr error - defer func() { - node.Client.releaseConn(ctx, cn, processErr) - }() - processErr = c.processTxPipelineNodeConn(ctx, node, cn, cmds, failedCmds) - - return processErr + return err }) + + if !executed && chainErr != nil { + // A node-level hook aborted with an error: surface its verdict. A hook + // that returned nil short-circuited successfully (it served the batch), + // which is legal for plain pipelines too, so it is not turned into a + // fatal outcome (review finding by codex on #3942). + outcome = &txOutcome{kind: txFatal, err: chainErr} + } + if outcome == nil { + outcome = &txOutcome{kind: txFatal, err: fmt.Errorf("redis: tx pipeline produced no outcome")} + } + return outcome } func (c *ClusterClient) processTxPipelineNodeConn( - ctx context.Context, node *clusterNode, cn *pool.Conn, cmds []Cmder, failedCmds *cmdsMap, -) error { + ctx context.Context, node *clusterNode, cn *pool.Conn, wire []Cmder, cmds []Cmder, asking bool, +) *txOutcome { + // HIMPORT bookkeeping: pending discards and PREPAREs for registered + // fieldsets the transaction references get written ahead of the wire + // batch (before ASKING/MULTI; the session state is visible at EXEC). + injected := node.Client.himportInjectedCmds(ctx, cn, cmds) + if err := cn.WithWriter(c.context(ctx), c.opt.WriteTimeout, func(wr *proto.Writer) error { - return writeCmds(wr, cmds) + for _, ic := range injected { + if err := writeCmd(wr, ic); err != nil { + return err + } + } + return writeCmds(wr, wire) }); err != nil { + // Write failure: re-route the whole tx on a fresh connection. if shouldRetry(err, true) && !cmdsContainNoRetry(cmds) { - _ = c.mapCmdsByNode(ctx, failedCmds, cmds) + return &txOutcome{kind: txRetryConn, err: err} } - setCmdsErr(cmds, err) - return err + return &txOutcome{kind: txFatal, err: err} } - return cn.WithReader(c.context(ctx), c.opt.ReadTimeout, func(rd *proto.Reader) error { - statusCmd := cmds[0].(*StatusCmd) - // Trim multi and exec. - trimmedCmds := cmds[1 : len(cmds)-1] - - if err := c.txPipelineReadQueued( - ctx, node, cn, rd, statusCmd, trimmedCmds, failedCmds, - ); err != nil { - setCmdsErr(cmds, err) - - moved, ask, addr := isMovedError(err) - if moved || ask { - return c.cmdsMoved(ctx, trimmedCmds, moved, ask, addr, failedCmds) - } - - return err + var outcome *txOutcome + readErr := cn.WithReader(c.context(ctx), c.opt.ReadTimeout, func(rd *proto.Reader) error { + if err := node.Client.himportReadInjectedReplies(ctx, cn, rd, injected); err != nil { + // Transport error with the tx replies unread; the batch was + // written and may have committed — fatal, discard the conn. + outcome = c.txReadFatal(err) + return nil } - - return node.Client.pipelineReadCmds(ctx, cn, rd, trimmedCmds) + outcome = c.readTxPipelineReplies(ctx, node, cn, rd, cmds, asking) + if outcome != nil && outcome.kind == txSuccess { + node.Client.himportAfterBatch(cn, injected, cmds) + } + return nil }) + + if readErr != nil { + // Reader-level failure (deadline setup, nil conn) around the read loop. + // The batch was already written, so the server may have committed; + // surface the error as fatal and discard the suspect connection rather + // than re-executing the transaction. + return c.txReadFatal(readErr) + } + return outcome } -func (c *ClusterClient) txPipelineReadQueued( - ctx context.Context, - node *clusterNode, - cn *pool.Conn, - rd *proto.Reader, - statusCmd *StatusCmd, - cmds []Cmder, - failedCmds *cmdsMap, -) error { - // Parse queued replies. - // To be sure there are no buffered push notifications, we process them before reading the reply - if err := node.Client.processPendingPushNotificationWithReader(ctx, cn, rd); err != nil { - // Log the error but don't fail the command execution - // Push notification processing errors shouldn't break normal Redis operations - internal.Logger.Printf(ctx, "push: error processing pending notifications before reading reply: %v", err) +// readTxPipelineReplies reads the replies of one MULTI..EXEC unit and +// classifies the outcome. The reply count always matches the number of sent +// commands, so success/redirect paths leave the connection clean; only an early +// MULTI read failure can leave unread replies. +func (c *ClusterClient) readTxPipelineReplies( + ctx context.Context, node *clusterNode, cn *pool.Conn, rd *proto.Reader, cmds []Cmder, asking bool, +) *txOutcome { + scratch := NewStatusCmd(ctx) + + readStatus := func() error { + c.txProcessPush(ctx, node, cn, rd) + return scratch.readReply(rd) } - if err := statusCmd.readReply(rd); err != nil { - return err + + // Optional top-level ASKING reply (+OK, or a retryable error such as -LOADING). + if asking { + if err := readStatus(); err != nil { + return c.txPreQueueErrorOutcome(err, cmds) + } + } + + // MULTI reply (+OK, or an error such as -LOADING during failover). + if err := readStatus(); err != nil { + return c.txPreQueueErrorOutcome(err, cmds) } + // Queue replies: +QUEUED, or a redirect / command error that dirties the tx. + var firstRedirect *txRedirect + var firstFatal error for _, cmd := range cmds { - // To be sure there are no buffered push notifications, we process them before reading the reply - if err := node.Client.processPendingPushNotificationWithReader(ctx, cn, rd); err != nil { - // Log the error but don't fail the command execution - // Push notification processing errors shouldn't break normal Redis operations - internal.Logger.Printf(ctx, "push: error processing pending notifications before reading reply: %v", err) + err := readStatus() + if err == nil { + continue // +QUEUED } - err := statusCmd.readReply(rd) - if err != nil { - if c.checkMovedErr(ctx, cmd, err, failedCmds) { - // will be processed later - continue + if !isRedisError(err) { + return c.txReadFatal(err) // IO error + } + if moved, ask, addr := isMovedError(err); moved || ask { + if firstRedirect == nil { + firstRedirect = &txRedirect{moved: moved, ask: ask, addr: addr, err: err} } - cmd.SetErr(err) - if !isRedisError(err) { - return err + continue + } + if proto.IsTryAgainError(err) { + if firstRedirect == nil { + firstRedirect = &txRedirect{tryAgain: true, err: err} } + continue + } + // Non-redirect command error (e.g. wrong arity) dirties the tx. + cmd.SetErr(err) + if firstFatal == nil { + firstFatal = err } } - // To be sure there are no buffered push notifications, we process them before reading the reply - if err := node.Client.processPendingPushNotificationWithReader(ctx, cn, rd); err != nil { - // Log the error but don't fail the command execution - // Push notification processing errors shouldn't break normal Redis operations - internal.Logger.Printf(ctx, "push: error processing pending notifications before reading reply: %v", err) - } - // Parse number of replies. + // EXEC reply. ReadLine parses error lines into typed errors, so a non-nil + // err means EXEC returned an error rather than the result array. + c.txProcessPush(ctx, node, cn, rd) line, err := rd.ReadLine() if err != nil { - if err == Nil { - err = TxFailedErr + if !isRedisError(err) { + return c.txReadFatal(err) // IO error } - return err + return c.classifyExecError(err, firstRedirect, firstFatal) } if line[0] != proto.RespArray { - return fmt.Errorf("redis: expected '*', but got line %q", line) + err := fmt.Errorf("redis: unexpected EXEC reply %q", line) + setCmdsErr(cmds, err) + // A non-array aggregate reply may carry an unread payload. + return &txOutcome{kind: txFatal, err: err, unreadReplies: true} } - return nil + // Success: read the N command results. + if err := node.Client.pipelineReadCmds(ctx, cn, rd, cmds); err != nil && !isRedisError(err) { + return c.txReadFatal(err) // IO error mid-results + } + return &txOutcome{kind: txSuccess} } -func (c *ClusterClient) cmdsMoved( - ctx context.Context, cmds []Cmder, - moved, ask bool, - addr string, - failedCmds *cmdsMap, -) error { - node, err := c.nodes.GetOrCreate(addr) - if err != nil { - return err +func (c *ClusterClient) txProcessPush(ctx context.Context, node *clusterNode, cn *pool.Conn, rd *proto.Reader) { + if err := node.Client.processPendingPushNotificationWithReader(ctx, cn, rd); err != nil { + internal.Logger.Printf(ctx, "push: error processing pending notifications before reading reply: %v", err) } +} - if moved { - c.state.LazyReload() - for _, cmd := range cmds { - failedCmds.Add(node, cmd) - } - return nil +// txReadFatal classifies a read-phase IO error. The MULTI..EXEC batch was +// already written, so the server may have committed the transaction; retrying +// would re-execute it, double-applying non-idempotent commands (INCR/APPEND, +// which are not NoRetry). Surface the error as fatal and discard the +// connection, since replies may still be unread on the wire. +func (c *ClusterClient) txReadFatal(err error) *txOutcome { + return &txOutcome{kind: txFatal, err: err, unreadReplies: true} +} + +// txPreQueueErrorOutcome classifies a setup-phase reply error: the top-level +// ASKING reply or the MULTI reply. The transaction body never executes (EXEC +// returns -EXECABORT), so retryable errors such as -LOADING are safe to retry +// on a fresh connection. A failed setup reply still leaves the remaining +// replies on the wire -- the server replies to each following command and to +// EXEC regardless -- so the connection is always discarded. +func (c *ClusterClient) txPreQueueErrorOutcome(err error, cmds []Cmder) *txOutcome { + if !isRedisError(err) { + return c.txReadFatal(err) } + if shouldRetry(err, true) && !cmdsContainNoRetry(cmds) { + return &txOutcome{kind: txRetryConn, err: err, unreadReplies: true} + } + return &txOutcome{kind: txFatal, err: err, unreadReplies: true} +} - if ask { - for _, cmd := range cmds { - failedCmds.Add(node, NewCmd(ctx, "asking"), cmd) +// classifyExecError turns an EXEC reply error into a retry/fatal outcome. +func (c *ClusterClient) classifyExecError(execErr error, firstRedirect *txRedirect, firstFatal error) *txOutcome { + if moved, ask, addr := isMovedError(execErr); moved || ask { + // Narrow race: the slot moved after every command was queued. + if ask { + return &txOutcome{kind: txRetryAsk, err: execErr, addr: addr} } - return nil + return &txOutcome{kind: txRetryMoved, err: execErr, addr: addr} } - - return nil + if proto.IsTryAgainError(execErr) { + return &txOutcome{kind: txRetryTryAgain, err: execErr} + } + if proto.IsClusterDownError(execErr) { + // Cluster degraded: back off and retry. Replies were fully consumed. + return &txOutcome{kind: txRetryConn, err: execErr} + } + if proto.IsExecAbortError(execErr) { + if firstFatal != nil { + return &txOutcome{kind: txFatal, err: firstFatal, execErr: execErr} + } + if firstRedirect != nil { + switch { + case firstRedirect.moved: + return &txOutcome{kind: txRetryMoved, err: firstRedirect.err, addr: firstRedirect.addr} + case firstRedirect.ask: + return &txOutcome{kind: txRetryAsk, err: firstRedirect.err, addr: firstRedirect.addr} + case firstRedirect.tryAgain: + return &txOutcome{kind: txRetryTryAgain, err: firstRedirect.err} + } + } + return &txOutcome{kind: txFatal, err: execErr, execErr: execErr} + } + return &txOutcome{kind: txFatal, err: execErr} } func (c *ClusterClient) Watch(ctx context.Context, fn func(*Tx) error, keys ...string) error { @@ -2359,8 +2871,22 @@ func (c *ClusterClient) cmdInfoPeek(name string) *CommandInfo { } func (c *ClusterClient) cmdSlot(cmd Cmder, prefferedSlot int) int { + // Serve/populate the per-command slot cache only on the natural-slot path + // (prefferedSlot == -1). A forced prefferedSlot (retry re-routing) must not be + // cached or served from cache. The cache lets the autopipeline shard router + // and the pipeline-flush router (mapCmdsByNode) share one slot computation + // instead of each recomputing it. + if prefferedSlot == -1 { + if slot, ok := cmd.cachedSlot(); ok { + return slot + } + } info := c.cmdInfoPeek(cmd.Name()) - return c.cmdSlotWithPos(cmd, cmdFirstKeyPosWithInfo(cmd, info), prefferedSlot) + slot := c.cmdSlotWithPos(cmd, cmdFirstKeyPosWithInfo(cmd, info), prefferedSlot) + if prefferedSlot == -1 && slot >= 0 { + cmd.setCachedSlot(slot) + } + return slot } // cmdSlotWithPos computes the cluster slot for cmd given a pre-resolved first key @@ -2520,10 +3046,8 @@ func (c *ClusterClient) NewDynamicResolver() *commandInfoResolver { } func appendIfNotExist[T comparable](vals []T, newVal T) []T { - for _, v := range vals { - if v == newVal { - return vals - } + if slices.Contains(vals, newVal) { + return vals } return append(vals, newVal) } diff --git a/vendor/github.com/redis/go-redis/v9/osscluster_commands.go b/vendor/github.com/redis/go-redis/v9/osscluster_commands.go index b13f8e7e9..bc6f60fdc 100644 --- a/vendor/github.com/redis/go-redis/v9/osscluster_commands.go +++ b/vendor/github.com/redis/go-redis/v9/osscluster_commands.go @@ -9,19 +9,19 @@ import ( func (c *ClusterClient) DBSize(ctx context.Context) *IntCmd { cmd := NewIntCmd(ctx, "dbsize") _ = c.withProcessHook(ctx, cmd, func(ctx context.Context, _ Cmder) error { - var size int64 + var size atomic.Int64 err := c.ForEachMaster(ctx, func(ctx context.Context, master *Client) error { n, err := master.DBSize(ctx).Result() if err != nil { return err } - atomic.AddInt64(&size, n) + size.Add(n) return nil }) if err != nil { cmd.SetErr(err) } else { - cmd.val = size + cmd.val = size.Load() } return nil }) diff --git a/vendor/github.com/redis/go-redis/v9/osscluster_router.go b/vendor/github.com/redis/go-redis/v9/osscluster_router.go index 0da29530a..b56271d18 100644 --- a/vendor/github.com/redis/go-redis/v9/osscluster_router.go +++ b/vendor/github.com/redis/go-redis/v9/osscluster_router.go @@ -85,7 +85,9 @@ func (c *ClusterClient) executeOnAllNodes(ctx context.Context, cmd Cmder, policy return err } - nodes := append(state.Masters, state.Slaves...) + nodes := make([]*clusterNode, 0, len(state.Masters)+len(state.Slaves)) + nodes = append(nodes, state.Masters...) + nodes = append(nodes, state.Slaves...) if len(nodes) == 0 { return errClusterNoNodes } @@ -494,10 +496,14 @@ func (c *ClusterClient) pickArbitraryNode(ctx context.Context) *clusterNode { return nil } - allNodes := append(state.Masters, state.Slaves...) - - idx := c.opt.ShardPicker.Next(len(allNodes)) - return allNodes[idx] + // Index into masters+slaves without materializing a combined slice. + // append(state.Masters, state.Slaves...) writes into the shared snapshot's + // spare capacity and races other routers, so pick directly. + idx := c.opt.ShardPicker.Next(len(state.Masters) + len(state.Slaves)) + if idx < len(state.Masters) { + return state.Masters[idx] + } + return state.Slaves[idx-len(state.Masters)] } // hasKeys checks if a command operates on keys diff --git a/vendor/github.com/redis/go-redis/v9/probabilistic.go b/vendor/github.com/redis/go-redis/v9/probabilistic.go index ee67911e6..f4c40262c 100644 --- a/vendor/github.com/redis/go-redis/v9/probabilistic.go +++ b/vendor/github.com/redis/go-redis/v9/probabilistic.go @@ -233,6 +233,7 @@ func newScanDumpCmd(ctx context.Context, args ...interface{}) *ScanDumpCmd { } func (cmd *ScanDumpCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -241,10 +242,12 @@ func (cmd *ScanDumpCmd) SetVal(val ScanDump) { } func (cmd *ScanDumpCmd) Result() (ScanDump, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *ScanDumpCmd) Val() ScanDump { + cmd.await() return cmd.val } @@ -316,14 +319,17 @@ func (cmd *BFInfoCmd) SetVal(val BFInfo) { } func (cmd *BFInfoCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } func (cmd *BFInfoCmd) Val() BFInfo { + cmd.await() return cmd.val } func (cmd *BFInfoCmd) Result() (BFInfo, error) { + cmd.await() return cmd.val, cmd.err } @@ -653,14 +659,17 @@ func (cmd *CFInfoCmd) SetVal(val CFInfo) { } func (cmd *CFInfoCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } func (cmd *CFInfoCmd) Val() CFInfo { + cmd.await() return cmd.val } func (cmd *CFInfoCmd) Result() (CFInfo, error) { + cmd.await() return cmd.val, cmd.err } @@ -823,14 +832,17 @@ func (cmd *CMSInfoCmd) SetVal(val CMSInfo) { } func (cmd *CMSInfoCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } func (cmd *CMSInfoCmd) Val() CMSInfo { + cmd.await() return cmd.val } func (cmd *CMSInfoCmd) Result() (CMSInfo, error) { + cmd.await() return cmd.val, cmd.err } @@ -1024,14 +1036,17 @@ func (cmd *TopKInfoCmd) SetVal(val TopKInfo) { } func (cmd *TopKInfoCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } func (cmd *TopKInfoCmd) Val() TopKInfo { + cmd.await() return cmd.val } func (cmd *TopKInfoCmd) Result() (TopKInfo, error) { + cmd.await() return cmd.val, cmd.err } @@ -1279,14 +1294,17 @@ func (cmd *TDigestInfoCmd) SetVal(val TDigestInfo) { } func (cmd *TDigestInfoCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } func (cmd *TDigestInfoCmd) Val() TDigestInfo { + cmd.await() return cmd.val } func (cmd *TDigestInfoCmd) Result() (TDigestInfo, error) { + cmd.await() return cmd.val, cmd.err } diff --git a/vendor/github.com/redis/go-redis/v9/pubsub_commands.go b/vendor/github.com/redis/go-redis/v9/pubsub_commands.go index ccc0ed524..b0857b9cb 100644 --- a/vendor/github.com/redis/go-redis/v9/pubsub_commands.go +++ b/vendor/github.com/redis/go-redis/v9/pubsub_commands.go @@ -20,8 +20,15 @@ type PubSubCmdable interface { func (c cmdable) Publish(ctx context.Context, channel string, message interface{}) *IntCmd { cmd := NewIntCmd(ctx, "publish", channel, message) _ = c(ctx, cmd) - // Record PubSub message sent (if command succeeded) - if cmd.Err() == nil { + // Record PubSub message sent (if command succeeded). Gated on the result + // being readable WITHOUT blocking: on the deferred autopipeline face the + // call above only enqueues, so reading the outcome here would await the + // batch and turn a fire-and-forget publish into a blocking call — i.e. + // enabling telemetry would change the async call shape (review finding by + // codex on #3942). The metric is therefore skipped for a submission that + // has not executed yet; recording it from the execution path instead is a + // follow-up in the OTel wiring, not something the command wrapper can do. + if otel.Enabled() && cmd.resultReady() && cmd.rawErr() == nil { otel.RecordPubSubMessage(ctx, nil, "sent", channel, false) } return cmd @@ -30,8 +37,9 @@ func (c cmdable) Publish(ctx context.Context, channel string, message interface{ func (c cmdable) SPublish(ctx context.Context, channel string, message interface{}) *IntCmd { cmd := NewIntCmd(ctx, "spublish", channel, message) _ = c(ctx, cmd) - // Record PubSub message sent (if command succeeded) - if cmd.Err() == nil { + // Record PubSub message sent (if command succeeded). See Publish for why + // this is gated on the result being readable without blocking. + if otel.Enabled() && cmd.resultReady() && cmd.rawErr() == nil { otel.RecordPubSubMessage(ctx, nil, "sent", channel, true) } return cmd diff --git a/vendor/github.com/redis/go-redis/v9/push/processor.go b/vendor/github.com/redis/go-redis/v9/push/processor.go index b8112ddc8..264d779d7 100644 --- a/vendor/github.com/redis/go-redis/v9/push/processor.go +++ b/vendor/github.com/redis/go-redis/v9/push/processor.go @@ -2,6 +2,7 @@ package push import ( "context" + "errors" "github.com/redis/go-redis/v9/internal" "github.com/redis/go-redis/v9/internal/proto" @@ -26,6 +27,15 @@ type Processor struct { registry *Registry } +type timeoutError interface { + Timeout() bool +} + +func isTimeoutError(err error) bool { + var timeoutErr timeoutError + return errors.As(err, &timeoutErr) && timeoutErr.Timeout() +} + // NewProcessor creates a new push notification processor func NewProcessor() *Processor { return &Processor{ @@ -52,17 +62,59 @@ func (p *Processor) UnregisterHandler(pushNotificationName string) error { // This method should be called by the client in WithReader before reading the reply // It will try to read from the socket and if it is empty - it may block. func (p *Processor) ProcessPendingNotifications(ctx context.Context, handlerCtx NotificationHandlerContext, rd *proto.Reader) error { + return p.processPendingNotifications(ctx, handlerCtx, rd, false) +} + +// ProcessPendingNotificationsBuffered processes one pending push notification +// and then continues only through frames already buffered by that read. It is +// used by callers that have already established socket readiness and must not +// wait for another frame after draining the current batch. +func (p *Processor) ProcessPendingNotificationsBuffered( + ctx context.Context, handlerCtx NotificationHandlerContext, rd *proto.Reader, +) error { + return p.processPendingNotifications(ctx, handlerCtx, rd, true) +} + +func (p *Processor) processPendingNotifications( + ctx context.Context, + handlerCtx NotificationHandlerContext, + rd *proto.Reader, + bufferedContinuation bool, +) error { if rd == nil { return nil } - for { + processed := false + for !bufferedContinuation || !processed || rd.Buffered() > 0 { // Check if there's data available to read - replyType, err := rd.PeekReplyType() - if err != nil { - // No more data available or error reading - // if timeout, it will be handled by the caller - break + var replyType byte + if bufferedContinuation { + for { + b, err := rd.Peek(1) + if err != nil { + if isTimeoutError(err) { + return nil + } + return err + } + replyType = b[0] + if replyType != proto.RespAttr { + break + } + // Unlike Peek, DiscardNext consumes bytes. Any error here is + // fatal because the reader may be left mid-frame. + if err := rd.DiscardNext(); err != nil { + return err + } + } + } else { + var err error + replyType, err = rd.PeekReplyType() + if err != nil { + // No more data available or error reading. + break + } } // Only process push notifications (arrays starting with >) @@ -73,19 +125,31 @@ func (p *Processor) ProcessPendingNotifications(ctx context.Context, handlerCtx // see if we should skip this notification notificationName, err := rd.PeekPushNotificationName() if err != nil { + // Name too long to peek: consume & dispatch below rather than leave the + // frame at the buffer head (which would stall and desync the next reply). + if !errors.Is(err, proto.ErrPushNotificationNameTooLong) { + if bufferedContinuation { + if isTimeoutError(err) { + return nil + } + return err + } + break + } + } else if willHandleNotificationInClient(notificationName) { break } - if willHandleNotificationInClient(notificationName) { - break - } - - // Read the push notification + // Surface a ReadReply error (unlike the boundary peek errors above, + // which consumed nothing): it happens mid-frame after bytes are + // consumed, so the conn is desynced and the CSC drainer must remove it. + // Normal reply-read callers log-and-ignore this and let their own read fail. reply, err := rd.ReadReply() if err != nil { internal.Logger.Printf(ctx, "push: error reading push notification: %v", err) - break + return err } + processed = true // Convert to slice of interfaces notification, ok := reply.([]interface{}) @@ -165,10 +229,12 @@ func (v *VoidProcessor) ProcessPendingNotifications(_ context.Context, handlerCt // see if we should skip this notification notificationName, err := rd.PeekPushNotificationName() if err != nil { - break - } - - if willHandleNotificationInClient(notificationName) { + // Name too long to peek: still consume the frame below so it isn't + // misread as a reply. + if !errors.Is(err, proto.ErrPushNotificationNameTooLong) { + break + } + } else if willHandleNotificationInClient(notificationName) { break } diff --git a/vendor/github.com/redis/go-redis/v9/redis.go b/vendor/github.com/redis/go-redis/v9/redis.go index 3bb759c34..8883a1adf 100644 --- a/vendor/github.com/redis/go-redis/v9/redis.go +++ b/vendor/github.com/redis/go-redis/v9/redis.go @@ -1,6 +1,7 @@ package redis import ( + "bytes" "context" "errors" "fmt" @@ -64,17 +65,61 @@ type ( ) type hooksMixin struct { - hooksMu *sync.RWMutex + // hooksMu serializes writers (AddHook); readers never take it. + hooksMu *sync.Mutex + // state holds the immutable hook snapshot. Readers Load it lock-free; + // writers publish a replacement copy-on-write under hooksMu. + state *atomic.Pointer[hooksState] +} +// hooksState is an immutable snapshot of the hook configuration. Once stored +// in hooksMixin.state it is never mutated; AddHook builds a fresh copy. +type hooksState struct { slice []Hook initial hooks current hooks } +// rebuild recomputes current from initial + slice. It mutates the receiver, so +// it must only run on a state that has not yet been published. +func (s *hooksState) rebuild() { + s.initial.setDefaults() + + s.current.dial = s.initial.dial + s.current.process = s.initial.process + s.current.pipeline = s.initial.pipeline + s.current.txPipeline = s.initial.txPipeline + + for i := len(s.slice) - 1; i >= 0; i-- { + if wrapped := s.slice[i].DialHook(s.current.dial); wrapped != nil { + s.current.dial = wrapped + } + if wrapped := s.slice[i].ProcessHook(s.current.process); wrapped != nil { + s.current.process = wrapped + } + if wrapped := s.slice[i].ProcessPipelineHook(s.current.pipeline); wrapped != nil { + s.current.pipeline = wrapped + } + if wrapped := s.slice[i].ProcessPipelineHook(s.current.txPipeline); wrapped != nil { + s.current.txPipeline = wrapped + } + } +} + func (hs *hooksMixin) initHooks(hooks hooks) { - hs.hooksMu = new(sync.RWMutex) - hs.initial = hooks - hs.chain() + var slice []Hook + if hs.state != nil { + if old := hs.state.Load(); old != nil { + slice = old.slice + } + } + + hs.hooksMu = new(sync.Mutex) + hs.state = new(atomic.Pointer[hooksState]) + + state := &hooksState{slice: slice, initial: hooks} + state.rebuild() + hs.state.Store(state) } type hooks struct { @@ -136,51 +181,42 @@ func (h *hooks) setDefaults() { // Please note: "next(ctx, cmd)" is very important, it will call the next hook, // if "next(ctx, cmd)" is not executed, the redis command will not be executed. func (hs *hooksMixin) AddHook(hook Hook) { - hs.slice = append(hs.slice, hook) - hs.chain() -} - -func (hs *hooksMixin) chain() { - hs.initial.setDefaults() - hs.hooksMu.Lock() defer hs.hooksMu.Unlock() - hs.current.dial = hs.initial.dial - hs.current.process = hs.initial.process - hs.current.pipeline = hs.initial.pipeline - hs.current.txPipeline = hs.initial.txPipeline - - for i := len(hs.slice) - 1; i >= 0; i-- { - if wrapped := hs.slice[i].DialHook(hs.current.dial); wrapped != nil { - hs.current.dial = wrapped - } - if wrapped := hs.slice[i].ProcessHook(hs.current.process); wrapped != nil { - hs.current.process = wrapped - } - if wrapped := hs.slice[i].ProcessPipelineHook(hs.current.pipeline); wrapped != nil { - hs.current.pipeline = wrapped - } - if wrapped := hs.slice[i].ProcessPipelineHook(hs.current.txPipeline); wrapped != nil { - hs.current.txPipeline = wrapped - } + old := hs.state.Load() + state := &hooksState{ + slice: make([]Hook, len(old.slice)+1), + initial: old.initial, } + copy(state.slice, old.slice) + state.slice[len(old.slice)] = hook + state.rebuild() + + hs.state.Store(state) } func (hs *hooksMixin) clone() hooksMixin { - hs.hooksMu.Lock() - defer hs.hooksMu.Unlock() + old := hs.state.Load() + l := len(old.slice) + state := &hooksState{ + slice: old.slice[:l:l], + initial: old.initial, + current: old.current, + } - clone := *hs - l := len(clone.slice) - clone.slice = clone.slice[:l:l] - clone.hooksMu = new(sync.RWMutex) + clone := hooksMixin{ + hooksMu: new(sync.Mutex), + state: new(atomic.Pointer[hooksState]), + } + clone.state.Store(state) return clone } func (hs *hooksMixin) withProcessHook(ctx context.Context, cmd Cmder, hook ProcessHook) error { - for i := len(hs.slice) - 1; i >= 0; i-- { - if wrapped := hs.slice[i].ProcessHook(hook); wrapped != nil { + slice := hs.state.Load().slice + for i := len(slice) - 1; i >= 0; i-- { + if wrapped := slice[i].ProcessHook(hook); wrapped != nil { hook = wrapped } } @@ -190,8 +226,9 @@ func (hs *hooksMixin) withProcessHook(ctx context.Context, cmd Cmder, hook Proce func (hs *hooksMixin) withProcessPipelineHook( ctx context.Context, cmds []Cmder, hook ProcessPipelineHook, ) error { - for i := len(hs.slice) - 1; i >= 0; i-- { - if wrapped := hs.slice[i].ProcessPipelineHook(hook); wrapped != nil { + slice := hs.state.Load().slice + for i := len(slice) - 1; i >= 0; i-- { + if wrapped := slice[i].ProcessPipelineHook(hook); wrapped != nil { hook = wrapped } } @@ -199,26 +236,26 @@ func (hs *hooksMixin) withProcessPipelineHook( } func (hs *hooksMixin) dialHook(ctx context.Context, network, addr string) (net.Conn, error) { - // Access to hs.current is guarded by a read-only lock since it may be mutated by AddHook(...) - // while this dialer is concurrently accessed by the background connection pool population - // routine when MinIdleConns > 0. - hs.hooksMu.RLock() - current := hs.current - hs.hooksMu.RUnlock() + return hs.state.Load().current.dial(ctx, network, addr) +} - return current.dial(ctx, network, addr) +// hookCount reports how many user hooks are installed. The autopipeliner +// arms its await() self-deadlock guard only when hooks exist, keeping the +// guard a single atomic load on hook-free clients. +func (hs *hooksMixin) hookCount() int { + return len(hs.state.Load().slice) } func (hs *hooksMixin) processHook(ctx context.Context, cmd Cmder) error { - return hs.current.process(ctx, cmd) + return hs.state.Load().current.process(ctx, cmd) } func (hs *hooksMixin) processPipelineHook(ctx context.Context, cmds []Cmder) error { - return hs.current.pipeline(ctx, cmds) + return hs.state.Load().current.pipeline(ctx, cmds) } func (hs *hooksMixin) processTxPipelineHook(ctx context.Context, cmds []Cmder) error { - return hs.current.txPipeline(ctx, cmds) + return hs.state.Load().current.txPipeline(ctx, cmds) } //------------------------------------------------------------------------------ @@ -314,10 +351,26 @@ func (h *onCloseHooks) run() error { } type baseClient struct { + // apClosed flips when the shared pools begin closing; every wrapper and + // every clone SHARING those pools refuses to build a new autopipeliner + // from then on. A pointer: withTimeout/clone copy it, so the flag is one + // per pool-set, not one per wrapper. See baseClient.Close. + apClosed *atomic.Bool + opt *Options optLock sync.RWMutex connPool pool.Pooler pubSubPool *pool.PubSubPool + // pipelinePool is an optional separate connection pool for pipelining + // operations, used when PipelineReadBufferSize/PipelineWriteBufferSize is + // set so pipelines can use large buffers without bloating the main pool. + // nil means pipelines use connPool. + pipelinePool pool.Pooler + // pipelinePoolName is the pool name assigned to pipelinePool's connections + // (pool.Conn.PoolName()). It lets poolForConn route a connection back to the + // pool that owns it — e.g. so streaming-credentials re-auth closes/accounts a + // failed pipeline connection against pipelinePool, not connPool. + pipelinePoolName string hooksMixin // onClose holds named callbacks invoked when the client is closed. @@ -337,6 +390,51 @@ type baseClient struct { // streamingCredentialsManager is used to manage streaming credentials streamingCredentialsManager *streaming.Manager + + // himport is the client-side registry of HIMPORT fieldsets, used to + // lazily replay HIMPORT PREPARE onto pooled connections (see himport.go). + // Shared by clones and by Conn instances derived from the same pool. + himport *himportRegistry + + // csc is the shared client-side cache; nil when CSC is disabled. + csc Cache + + // cscKeyPrefix namespaces a shared cache by DB and fixed authentication + // identity. It is computed once during attachment and copied with the cache. + cscKeyPrefix string + + // allowClientTracking exempts a client from the CLIENT TRACKING guard (see + // process and generalProcessPipeline). Set only on initConn's internal conn + // wrapper, whose init pipeline legitimately issues CLIENT TRACKING ON; + // never set on user-visible clients. + allowClientTracking bool + + // The following are OWNER-ONLY and NOT copied by clone(): derived clients + // (Conn/WithTimeout) share the cache but must not stop the owner's + // goroutines or flush its cache on their own Close. + + // cscOwnsCache is true only when this client constructed its LocalCache (not + // an injected/shared one); it gates the defensive flush on drainer stop. + cscOwnsCache bool + + // cscDrainHandle is the background drainer handle (nil when none). Held + // on the client, not a global registry, so an un-Closed client stays + // GC-collectible and a runtime.AddCleanup net can stop the goroutine. Its + // presence also identifies the owner (the only client that runs the drainer + // and thus the one that deregisters cscPoolHook). + cscDrainHandle *cscDrainHandle + + // cscPoolHook is the evict-on-remove pool hook (nil when CSC is off). Unlike + // the owner-only fields above it IS copied by clone(): a clone reads it in + // processCached to attribute fetches to the shared hook. Only the owner (the + // one with cscDrainHandle) deregisters it when the drainer exits. + cscPoolHook pool.PoolHook + + // cscActive is allocated only after CSC attaches successfully and becomes + // false once the drainer stops (owner Close, GC cleanup, or damping). It is + // shared with derived clients so they initialize borrowed pool connections + // with tracking only while the parent's CSC is actually operational. + cscActive *atomic.Bool } func (c *baseClient) clone() *baseClient { @@ -345,13 +443,24 @@ func (c *baseClient) clone() *baseClient { c.maintNotificationsManagerLock.RUnlock() clone := &baseClient{ + apClosed: c.apClosed, opt: c.opt, connPool: c.connPool, + pipelinePool: c.pipelinePool, + pipelinePoolName: c.pipelinePoolName, pubSubPool: c.pubSubPool, onClose: c.onClose, pushProcessor: c.pushProcessor, maintNotificationsManager: maintNotificationsManager, streamingCredentialsManager: c.streamingCredentialsManager, + himport: c.himport, + csc: c.csc, + // cscPoolHook and cscActive travel with the cache (read in processCached); + // the owner-only fields — cscDrainHandle, cscOwnsCache — do not, so a clone's + // Close never tears down the owner's resources. + cscPoolHook: c.cscPoolHook, + cscActive: c.cscActive, + cscKeyPrefix: c.cscKeyPrefix, } return clone } @@ -405,16 +514,30 @@ func (c *baseClient) _getConn(ctx context.Context) (*pool.Conn, error) { return nil, err } + if err := c.initPooledConn(ctx, c.connPool, cn); err != nil { + return nil, err + } + + return cn, nil +} + +// initPooledConn brings a conn freshly obtained from p to a usable state: it +// runs the connection handshake if needed, records the connection-create-time +// metric, and re-acquires the conn after initConn parks it IDLE. On failure +// the conn is Removed from p (never leaked) and the error is unwrapped to the +// caller-visible cause. Shared by the main-pool path (_getConn) and the +// dedicated pipeline-pool path (withPipelineConn) so the two cannot drift. +func (c *baseClient) initPooledConn(ctx context.Context, p pool.Pooler, cn *pool.Conn) error { if cn.IsInited() { - return cn, nil + return nil } if err := c.initConn(ctx, cn); err != nil { - c.connPool.Remove(ctx, cn, err) - if err := errors.Unwrap(err); err != nil { - return nil, err + p.Remove(ctx, cn, err) + if unwrapped := errors.Unwrap(err); unwrapped != nil { + return unwrapped } - return nil, err + return err } if dialStartNs := cn.GetDialStartNs(); dialStartNs > 0 { @@ -427,10 +550,25 @@ func (c *baseClient) _getConn(ctx context.Context) (*pool.Conn, error) { // initConn will transition to IDLE state, so we need to acquire it // before returning it to the user. if !cn.TryAcquire() { - return nil, fmt.Errorf("redis: connection is not usable") + err := fmt.Errorf("redis: connection is not usable") + // Remove rather than abandon: an unacquirable conn left outside the + // pool's accounting would leak its slot. + p.Remove(ctx, cn, err) + return err } - return cn, nil + return nil +} + +// poolForConn returns the pool that owns cn — the dedicated pipeline pool when +// cn was dialed there, otherwise the main pool. Re-auth close/accounting must +// target the owning pool so a failed pipeline connection is removed from the +// pipeline pool's books, not the main pool's. +func (c *baseClient) poolForConn(cn *pool.Conn) pool.Pooler { + if c.pipelinePool != nil && c.pipelinePoolName != "" && cn.PoolName() == c.pipelinePoolName { + return c.pipelinePool + } + return c.connPool } func (c *baseClient) reAuthConnection() func(poolCn *pool.Conn, credentials auth.Credentials) error { @@ -441,10 +579,11 @@ func (c *baseClient) reAuthConnection() func(poolCn *pool.Conn, credentials auth // Use background context - timeout is handled by ReadTimeout in WithReader/WithWriter ctx := context.Background() - connPool := pool.NewSingleConnPool(c.connPool, poolCn) + connPool := pool.NewSingleConnPool(c.poolForConn(poolCn), poolCn) - // Pass hooks so that reauth commands are recorded/traced - cn := newConn(c.opt, connPool, &c.hooksMixin) + // Pass hooks so that reauth commands are recorded/traced; share the + // HIMPORT registry for the same reason as in initConn. + cn := newConn(c.opt, connPool, &c.hooksMixin, c.himport) if username != "" { err = cn.AuthACL(ctx, username, password).Err() @@ -455,6 +594,7 @@ func (c *baseClient) reAuthConnection() func(poolCn *pool.Conn, credentials auth return err } } + func (c *baseClient) onAuthenticationErr() func(poolCn *pool.Conn, err error) { return func(poolCn *pool.Conn, err error) { if err != nil { @@ -464,7 +604,7 @@ func (c *baseClient) onAuthenticationErr() func(poolCn *pool.Conn, err error) { // waits for IDLE state before transitioning to UNUSABLE for re-auth). // From metrics perspective, the connection was never "used" by a client. // Note: Using context.Background() as this callback doesn't have access to caller's context. - err := c.connPool.CloseConn(context.Background(), poolCn, pool.CloseReasonAuthError, pool.MetricStateIdle) + err := c.poolForConn(poolCn).CloseConn(context.Background(), poolCn, pool.CloseReasonAuthError, pool.MetricStateIdle) if err != nil { internal.Logger.Printf(context.Background(), "redis: failed to close connection: %v", err) // try to close the network connection directly @@ -480,6 +620,25 @@ func (c *baseClient) onAuthenticationErr() func(poolCn *pool.Conn, err error) { } } +// resolveCredentials returns the username/password to authenticate with, using +// the non-streaming credential sources in precedence order: +// CredentialsProviderContext, then CredentialsProvider, then the static +// Username/Password fields. The StreamingCredentialsProvider path is handled +// separately by initConn (it requires per-connection listener wiring) and is +// intentionally not covered here. Returns empty strings when no credentials +// are configured. +func (opt *Options) resolveCredentials(ctx context.Context) (username, password string, err error) { + switch { + case opt.CredentialsProviderContext != nil: + return opt.CredentialsProviderContext(ctx) + case opt.CredentialsProvider != nil: + username, password = opt.CredentialsProvider() + case opt.Username != "" || opt.Password != "": + username, password = opt.Username, opt.Password + } + return username, password, nil +} + func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error { // This function is called in two scenarios: // 1. First-time init: Connection is in CREATED state (from pool.Get()) @@ -558,7 +717,22 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error { // If we fail, we must transition to CLOSED var initErr error connPool := pool.NewSingleConnPool(c.connPool, cn) - conn := newConn(c.opt, connPool, &c.hooksMixin) + // The handshake Conn (handed to OnConnect) must share the client's + // HIMPORT registry: a private registry restarts versions at 1, so an + // OnConnect prepare would mark the pooled connection with a version + // number that collides with the client registry's and silently skips + // the replay of a different fieldset definition. + conn := newConn(c.opt, connPool, &c.hooksMixin, c.himport) + // The internal wrapper does not serve cached reads, but it needs the + // successful-attachment signal both to issue CLIENT TRACKING during init + // and to guard the user-visible OnConnect callback below. + conn.baseClient.cscActive = c.cscActive + // This internal conn's init pipeline issues CLIENT TRACKING ON itself; + // exempt it from the guard that blocks user-issued CLIENT TRACKING. Setting + // the field after newConn is safe: initHooks bound the pipeline hook as a + // method value on the addressable baseClient, so the guard reads the + // updated field. + conn.baseClient.allowClientTracking = true username, password := "", "" if c.opt.StreamingCredentialsProvider != nil { @@ -598,16 +772,12 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error { cn.SetOnClose(unsubscribeFromCredentialsProvider) username, password = credentials.BasicAuth() - } else if c.opt.CredentialsProviderContext != nil { - username, password, initErr = c.opt.CredentialsProviderContext(ctx) + } else { + username, password, initErr = c.opt.resolveCredentials(ctx) if initErr != nil { cn.GetStateMachine().Transition(pool.StateClosed) - return fmt.Errorf("failed to get credentials from context provider: %w", initErr) + return fmt.Errorf("failed to resolve credentials: %w", initErr) } - } else if c.opt.CredentialsProvider != nil { - username, password = c.opt.CredentialsProvider() - } else if c.opt.Username != "" || c.opt.Password != "" { - username, password = c.opt.Username, c.opt.Password } // for redis-server versions that do not support the HELLO command, @@ -616,6 +786,10 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error { // falls back to RESP2 regardless of c.opt.Protocol, and features that // require RESP3 (e.g. maintenance notifications) must be skipped. helloOK := false + // For redis-server versions that do not support HELLO, RESP2 continues to + // be used. Remember that negotiated fallback: configured Protocol remains 3, + // but CSC must not serve without RESP3 invalidations. + helloFallbackToRESP2 := false if initErr = conn.Hello(ctx, c.opt.Protocol, username, password, c.opt.ClientName).Err(); initErr == nil { // Authentication successful with HELLO command helloOK = true @@ -629,20 +803,40 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error { // difficult to rely on error strings to determine all results. cn.GetStateMachine().Transition(pool.StateClosed) return initErr - } else if password != "" { - // Try legacy AUTH command if HELLO failed - if username != "" { - initErr = conn.AuthACL(ctx, username, password).Err() - } else { - initErr = conn.Auth(ctx, password).Err() - } - if initErr != nil { - cn.GetStateMachine().Transition(pool.StateClosed) - return fmt.Errorf("failed to authenticate: %w", initErr) + } else { + helloFallbackToRESP2 = c.opt.Protocol == 3 + if password != "" { + // Try legacy AUTH command if HELLO failed. + if username != "" { + initErr = conn.AuthACL(ctx, username, password).Err() + } else { + initErr = conn.Auth(ctx, password).Err() + } + if initErr != nil { + cn.GetStateMachine().Transition(pool.StateClosed) + return fmt.Errorf("failed to authenticate: %w", initErr) + } } } - - _, initErr = conn.Pipelined(ctx, func(pipe Pipeliner) error { + if helloFallbackToRESP2 { + c.disableCSCServing(ctx, "HELLO 3 was rejected and the connection negotiated RESP2") + } + + // trackingEnabled reports whether THIS pool connection must issue + // CLIENT TRACKING ON during init. True when CSC (SharedTracking) is enabled: + // the shared cache is fed by per-connection tracking + the background + // drainer. Once CSC serving stops (owner Close, GC cleanup, or drainer + // damping), new and re-inited conns skip tracking — nothing consumes the + // pushes into the cache anymore. + trackingEnabled := !helloFallbackToRESP2 && !cn.IsPubSub() && c.cscTrackingRequested() + if trackingEnabled && c.cscConnInitGen(cn.GetID()) == 0 { + // First initialization establishes generation 1. Reinitialization + // already bumped and evicted through onCscReinit before replacing the + // socket, so it must not bump a second time here. + c.cscEvictOwnedEntries(cn.GetID()) + } + var trackingCmd *StatusCmd + initCmds, initErr := conn.Pipelined(ctx, func(pipe Pipeliner) error { if c.opt.DB > 0 { pipe.Select(ctx, c.opt.DB) } @@ -655,13 +849,56 @@ func (c *baseClient) initConn(ctx context.Context, cn *pool.Conn) error { pipe.ClientSetName(ctx, c.opt.ClientName) } + if trackingEnabled { + // Must run before any cacheable command is issued on this conn. + trackingCmd = pipe.ClientTrackingOn(ctx, nil) + } + return nil }) + // The exemption is init-only. OnConnect is user code and must go through + // the same CSC connection-state guard as every other public command path. + conn.baseClient.allowClientTracking = false + trackingRejected := trackingCmd != nil && isRedisError(trackingCmd.Err()) + for _, cmd := range initCmds { + if cmd != trackingCmd && cmd.Err() != nil { + trackingRejected = false + break + } + } + if trackingRejected { + // A server-side rejection means tracking is unavailable, but the + // connection and the preceding init commands are still usable. Disable + // CSC globally and continue without caching. Transport and protocol + // failures still take the normal connection-failure path below. + c.disableCSCServing(ctx, fmt.Sprintf("CLIENT TRACKING ON was rejected: %v", trackingCmd.Err())) + c.cscForgetConn(cn.GetID()) + trackingEnabled = false + initErr = nil + } if initErr != nil { + if trackingEnabled { + // cscEvictOwnedEntries above bumped this conn's init generation; a + // failed init never serves, and the pubsub path has no OnRemove + // hook (and the close hook below is not yet installed), so drop + // the entry here to keep the map bounded to live conns. + c.cscForgetConn(cn.GetID()) + } cn.GetStateMachine().Transition(pool.StateClosed) return fmt.Errorf("failed to initialize connection options: %w", initErr) } + if trackingEnabled { + // Evict this conn's entries on any close (incl. the ConnMaxLifetime/idle + // path that bypasses the OnRemove hook), since the server drops its + // tracking table on close. + c.cscInstallConnCloseHook(cn) + // A handoff replaces the socket before initConn runs. Bump and evict at + // the pre-swap boundary so fulfillCached cannot publish an old-socket + // reply during that gap. + c.cscInstallConnReinitHook(cn) + } + // Enable maintnotifications if maintnotifications are configured c.optLock.RLock() maintNotifEnabled := c.opt.MaintNotificationsConfig != nil && c.opt.MaintNotificationsConfig.Mode != maintnotifications.ModeDisabled @@ -799,16 +1036,38 @@ func (c *baseClient) releaseConn(ctx context.Context, cn *pool.Conn, err error) if c.opt.Limiter != nil { c.opt.Limiter.ReportResult(err) } + c.releaseConnToPool(ctx, c.connPool, cn, err) +} +// releaseConnToPool returns a conn to p after a command or pipeline ran on +// it: bad conns are Removed, pending push notifications are drained (a +// mid-frame drain failure also Removes — the reply stream may be +// desynchronized), and a client-side-cache post-read probe is requested when +// tracking is on. Limiter accounting stays with the callers, whose shapes +// differ. Shared by releaseConn and withPipelineConn so the two cannot drift. +func (c *baseClient) releaseConnToPool(ctx context.Context, p pool.Pooler, cn *pool.Conn, err error) { if isBadConn(err, false, c.opt.Addr) { - c.connPool.Remove(ctx, cn, err) - } else { - // process any pending push notifications before returning the connection to the pool - if err := c.processPushNotifications(ctx, cn); err != nil { - internal.Logger.Printf(ctx, "push: error processing pending notifications before releasing connection: %v", err) + p.Remove(ctx, cn, err) + return + } + // process any pending push notifications before returning the connection to the pool + if err := c.processPushNotifications(ctx, cn); err != nil { + internal.Logger.Printf(ctx, "push: error processing pending notifications before releasing connection: %v", err) + if isBadConn(err, false, c.opt.Addr) { + // A mid-frame read failure may leave the reply stream + // desynchronized, so the connection cannot be reused. + p.Remove(ctx, cn, err) + return } - c.connPool.Put(ctx, cn) } + if c.cscTrackingRequested() { + // A TLS-like wrapper can retain decrypted bytes after the command + // reply even when its raw socket is empty. Ask the background + // drainer for one bounded post-read probe before relying on raw + // socket peeks again. + cn.MarkCscReadPending() + } + p.Put(ctx, cn) } func (c *baseClient) withConn( @@ -829,39 +1088,158 @@ func (c *baseClient) withConn( return fnErr } +// withPipelineConn executes fn with a connection from the pipeline pool when +// one is configured (PipelineReadBufferSize/PipelineWriteBufferSize set), +// otherwise it falls back to the regular pool via withConn. +// withPipelineConn is withConn/releaseConn for the DEDICATED pipeline pool. +// Conn preparation and release go through the shared pool-parameterized +// helpers (initPooledConn, releaseConnToPool) — the paths used to mirror each +// other by hand and drifted three times (a Limiter-ordering divergence, a +// missed drain-error removal, a missed client-side-cache probe), so only the +// Limiter shape is allowed to live here. +func (c *baseClient) withPipelineConn( + ctx context.Context, fn func(context.Context, *pool.Conn) error, +) (retErr error) { + // Use pipeline pool if available, otherwise fall back to regular pool. + if c.pipelinePool == nil { + return c.withConn(ctx, fn) + } + + // Honor the Limiter on the dedicated pipeline-pool path too, mirroring + // getConn/releaseConn: Allow() before acquiring and ReportResult() on every + // exit (including the early init/re-acquire failures below). Without this, + // enabling the pipeline pool would silently bypass throttling and failure + // reporting for callers that set a Limiter. + if c.opt.Limiter != nil { + if err := c.opt.Limiter.Allow(); err != nil { + return err + } + } + + // One deferred exit for both concerns, because their ORDER is part of the + // contract: releaseConn reports the result BEFORE the connection becomes + // available again, so a limiter or circuit breaker observes the failure + // before it can admit the next operation. Two separate defers would run + // LIFO and release first, letting another pipelined operation through + // against a breaker that has not seen the failure yet (review finding by + // codex on #3942). cn is nil on the acquire/init failure paths, which still + // must report. + var cn *pool.Conn + var fnErr error + defer func() { + if c.opt.Limiter != nil { + c.opt.Limiter.ReportResult(retErr) + } + if cn != nil { + c.releaseConnToPool(ctx, c.pipelinePool, cn, fnErr) + } + }() + + cn, retErr = c.pipelinePool.Get(ctx) + if retErr != nil { + cn = nil // nothing acquired: no release, but still report above + return retErr + } + + if err := c.initPooledConn(ctx, c.pipelinePool, cn); err != nil { + // initPooledConn already removed the conn from the pool on failure. + cn = nil + retErr = err + return retErr + } + + fnErr = fn(ctx, cn) + retErr = fnErr + return retErr +} + func (c *baseClient) dial(ctx context.Context, network, addr string) (net.Conn, error) { return c.opt.Dialer(ctx, network, addr) } +// cscTrackingRequested reports whether initConn must issue CLIENT TRACKING ON. +// cscActive is allocated only after attachment succeeds and is shared with +// derived clients: a conn initialized by Conn/Tx may later return to the +// parent's pool, but a configured cache whose attachment failed must not turn +// tracking on. +func (c *baseClient) cscTrackingRequested() bool { + if c.opt.Protocol != 3 || c.cscActive == nil || !c.cscActive.Load() { + return false + } + return c.opt.DB == 0 +} + func (c *baseClient) process(ctx context.Context, cmd Cmder) error { - // Start measuring total operation duration (includes all retries) - // Only call time.Now() if operation duration callback is set to avoid overhead - var operationStart time.Time opDurationCallback := otel.GetOperationDurationCallback() - if opDurationCallback != nil { - operationStart = time.Now() + if opDurationCallback == nil { + return c.processCommand(ctx, cmd, nil) + } + + start := time.Now() + var state processState + err := c.processCommand(ctx, cmd, &state) + opDurationCallback(ctx, time.Since(start), cmd, state.attempts, err, state.lastConn, c.opt.DB) + return err +} + +type processState struct { + attempts int + lastConn *pool.Conn +} + +func (c *baseClient) processCommand(ctx context.Context, cmd Cmder, state *processState) error { + // Reject commands that would make one pooled connection diverge from CSC's + // tracking or database assumptions. Pipelines mirror this guard below. + if err := c.cscCommandError(cmd); err != nil { + return err + } + if c.csc != nil && isCacheable(cmd) { + return c.processCached(ctx, cmd, state) } + return c.processWithRetry(ctx, cmd, nil, state) +} + +// processWithRetry runs cmd through the retry loop. capture (optional) is +// filled by the successful attempt's reply read for the CSC fetch path (see +// cscFetchCapture). +func (c *baseClient) processWithRetry( + ctx context.Context, cmd Cmder, capture *cscFetchCapture, state *processState, +) error { var lastConn *pool.Conn var lastErr error totalAttempts := 0 - for attempt := 0; attempt <= c.opt.MaxRetries; attempt++ { + maxRetries := c.opt.MaxRetries + himportRetried := false + for attempt := 0; attempt <= maxRetries; attempt++ { totalAttempts++ attempt := attempt - retry, cn, err := c._process(ctx, cmd, attempt) + retry, cn, err := c._process(ctx, cmd, attempt, capture) if cn != nil { lastConn = cn } + if state != nil { + state.attempts = totalAttempts + state.lastConn = lastConn + } + // A "no such fieldset" reply for a registered fieldset means the + // connection lost its server session state (e.g. RESET, concurrent + // discard). The stale prepared flag was invalidated inside _process + // while the connection was still held; grant a single extra attempt + // so the retry re-prepares lazily on whichever connection it lands. + if err != nil && !retry && !himportRetried && !cmd.NoRetry() && + c.himportShouldRetrySet(cmd, err) { + himportRetried = true + if attempt == maxRetries { + maxRetries++ + } + lastErr = err + continue + } // Don't retry if command explicitly disables retries (e.g., RawWriteToCmd // which writes directly to an io.Writer and cannot undo partial writes) if err == nil || !retry || cmd.NoRetry() { - // Record total operation duration - if opDurationCallback != nil { - operationDuration := time.Since(operationStart) - opDurationCallback(ctx, operationDuration, cmd, totalAttempts, err, lastConn, c.opt.DB) - } - if err != nil { if errorCallback := pool.GetMetricErrorCallback(); errorCallback != nil { errorType, statusCode, isInternal := classifyCommandError(err) @@ -874,12 +1252,6 @@ func (c *baseClient) process(ctx context.Context, cmd Cmder) error { lastErr = err } - // Record failed operation after all retries - if opDurationCallback != nil { - operationDuration := time.Since(operationStart) - opDurationCallback(ctx, operationDuration, cmd, totalAttempts, lastErr, lastConn, c.opt.DB) - } - // Record error metric for exhausted retries if errorCallback := pool.GetMetricErrorCallback(); errorCallback != nil { errorType, statusCode, isInternal := classifyCommandError(lastErr) @@ -949,13 +1321,7 @@ func classifyCommandError(err error) (errorType, statusCode string, isInternal b return "UNKNOWN", "UNKNOWN", true } -func (c *baseClient) assertUnstableCommand(cmd Cmder) (bool, error) { - // All search commands (FTSearchCmd, AggregateCmd, FTInfoCmd, FTSpellCheckCmd, FTSynDumpCmd) - // now have stable RESP3 parsing. No commands require the UnstableResp3 flag anymore. - return false, nil -} - -func (c *baseClient) _process(ctx context.Context, cmd Cmder, attempt int) (bool, *pool.Conn, error) { +func (c *baseClient) _process(ctx context.Context, cmd Cmder, attempt int, capture *cscFetchCapture) (bool, *pool.Conn, error) { if attempt > 0 { if err := internal.Sleep(ctx, c.retryBackoff(attempt)); err != nil { return false, nil, err @@ -963,7 +1329,7 @@ func (c *baseClient) _process(ctx context.Context, cmd Cmder, attempt int) (bool } var usedConn *pool.Conn - retryTimeout := uint32(0) + var retryTimeout atomic.Uint32 if err := c.withConn(ctx, func(ctx context.Context, cn *pool.Conn) error { usedConn = cn // Process any pending push notifications before executing the command @@ -971,41 +1337,110 @@ func (c *baseClient) _process(ctx context.Context, cmd Cmder, attempt int) (bool internal.Logger.Printf(ctx, "push: error processing pending notifications before command: %v", err) } + // HIMPORT bookkeeping: pending discards for this session and the + // PREPARE for an HIMPORT SET's registered fieldset are written in + // the same round trip, right before the command. + var injected []Cmder + if _, ok := cmd.(himportCmder); ok { + injected = c.himportInjectedCmds(ctx, cn, []Cmder{cmd}) + } + if err := cn.WithWriter(c.context(ctx), c.opt.WriteTimeout, func(wr *proto.Writer) error { + for _, ic := range injected { + if err := writeCmd(wr, ic); err != nil { + return err + } + } return writeCmd(wr, cmd) }); err != nil { - atomic.StoreUint32(&retryTimeout, 1) + retryTimeout.Store(1) return err } readReplyFunc := cmd.readReply - // Apply unstable RESP3 search module. - if c.opt.Protocol != 2 { - useRawReply, err := c.assertUnstableCommand(cmd) - if err != nil { - return err - } - if useRawReply { - readReplyFunc = cmd.readRawReply + // When the caller requested raw-reply capture (client-side cache), + // read the reply as raw RESP bytes and re-parse them through the + // command's normal reply handler. This reuses proto.Reader rather + // than duplicating parsing logic in a bespoke cache serializer. + if capture != nil { + origRead := readReplyFunc + readReplyFunc = func(rd *proto.Reader) error { + raw, err := rd.ReadRawReply() + if err != nil { + return err + } + capture.raw = raw + return origRead(proto.NewReaderSize(bytes.NewReader(raw), len(raw)+1)) } } - if err := cn.WithReader(c.context(ctx), c.cmdTimeout(cmd), func(rd *proto.Reader) error { + readErr := cn.WithReader(c.context(ctx), c.cmdTimeout(cmd), func(rd *proto.Reader) error { // To be sure there are no buffered push notifications, we process them before reading the reply if err := c.processPendingPushNotificationWithReader(ctx, cn, rd); err != nil { internal.Logger.Printf(ctx, "push: error processing pending notifications before reading reply: %v", err) } - return readReplyFunc(rd) - }); err != nil { + if len(injected) > 0 { + if err := c.himportReadInjectedReplies(ctx, cn, rd, injected); err != nil { + return err + } + // A push notification can arrive between the injected + // replies and the command reply; drain again so the + // reply read below does not consume it as the command's. + if err := c.processPendingPushNotificationWithReader(ctx, cn, rd); err != nil { + internal.Logger.Printf(ctx, "push: error processing pending notifications before reading reply: %v", err) + } + } + err := readReplyFunc(rd) + // Assert the command type before touching the error: the + // errors.As chain inside himportNoSuchFieldset allocates, and + // this is the per-command hot path. + if set, ok := cmd.(*HImportSetCmd); ok && himportNoSuchFieldset(err) { + // A failed injected PREPARE is the root cause of the + // command's "no such fieldset" reply (drained above). + for _, ic := range injected { + if prep, ok := ic.(*HImportPrepareCmd); ok && + prep.fieldsetName == set.fieldsetName && prep.Err() != nil { + err = prep.Err() + break + } + } + // The session lost a registered fieldset the flags claim is + // prepared — and the same event (failover, cross-region + // switch, reset storm) may have wiped other sessions whose + // flags also still look current. Bump the fieldset version + // so every connection re-prepares before its next use, + // wherever the retry granted by process() lands. + if himportNoSuchFieldset(err) { + if fs, registered := c.himport.lookup(set.fieldsetName); registered { + c.himport.refreshVersion(set.fieldsetName, fs.version) + } + } + } + return err + }) + // redis.Nil is a complete, valid negative reply. For a CSC fetch, retain + // its connection attribution before returning Nil to the caller so the + // raw reply can be cached and invalidated like any other read result. + if readErr != nil && (capture == nil || readErr != Nil) { if cmd.readTimeout() == nil { - atomic.StoreUint32(&retryTimeout, 1) + retryTimeout.Store(1) } else { - atomic.StoreUint32(&retryTimeout, 0) + retryTimeout.Store(0) } - return err + return readErr + } + if capture != nil { + // Attribute while the conn is still held: once it is released, a + // queued handoff may swap the socket and bump the generation, and + // this capture is what fulfillCached compares against. + capture.connID = cn.GetID() + capture.initGen = c.cscConnInitGen(capture.connID) } - return nil + if hc, ok := cmd.(himportCmder); ok { + c.himportAfterCmd(cn, hc) + } + return readErr }); err != nil { - retry := shouldRetry(err, atomic.LoadUint32(&retryTimeout) == 1) + retry := shouldRetry(err, retryTimeout.Load() == 1) return retry, usedConn, err } @@ -1064,6 +1499,13 @@ func (c *baseClient) enableMaintNotificationsUpgrades() error { // Initialize pool hook (safe to call without lock since manager is now set) manager.InitPoolHook(c.dialHook) + // If a dedicated pipeline connection pool is in use, attach an independent + // maintnotifications hook to it as well. Otherwise autopipelined/pipelined + // commands run on pipeline-pool connections that never receive MOVING/ + // MIGRATING handoff handling. + if c.pipelinePool != nil { + manager.InitPoolHookForPool(c.pipelinePool, c.dialHook) + } return nil } @@ -1088,8 +1530,30 @@ func (c *baseClient) disableMaintNotificationsUpgrades() error { // It is rare to Close a Client, as the Client is meant to be // long-lived and shared between many goroutines. func (c *baseClient) Close() error { + // The pools this baseClient owns are shared with every WithTimeout/ + // WithReadTimeout clone. Once ANY sharer closes them, no wrapper may + // build a fresh autopipeliner against them — its flushers would run + // against closed pools forever. The atomic is checked by the + // AutoPipeline getters of every wrapper sharing this base. + if c.apClosed != nil { + c.apClosed.Store(true) + } + if h := c.cscDrainHandle; h != nil { + h.closeOnce.Do(func() { + h.closeErr = c.closeResources() + }) + return h.closeErr + } + return c.closeResources() +} + +func (c *baseClient) closeResources() error { var firstErr error + // CSC teardown (no-op when CSC is not active): stop the background + // invalidation drainer before the pool it walks is torn down. + c.stopBackgroundDrainer() + // Close maintnotifications manager first if err := c.disableMaintNotificationsUpgrades(); err != nil { firstErr = err @@ -1100,13 +1564,18 @@ func (c *baseClient) Close() error { } // Unregister pools from OTel before closing them - otel.UnregisterPools(c.connPool, c.pubSubPool) + otel.UnregisterPools(c.connPool, c.pubSubPool, c.pipelinePool) if c.connPool != nil { if err := c.connPool.Close(); err != nil && firstErr == nil { firstErr = err } } + if c.pipelinePool != nil { + if err := c.pipelinePool.Close(); err != nil && firstErr == nil { + firstErr = err + } + } if c.pubSubPool != nil { if err := c.pubSubPool.Close(); err != nil && firstErr == nil { firstErr = err @@ -1138,6 +1607,14 @@ type pipelineProcessor func(context.Context, *pool.Conn, []Cmder) (bool, error) func (c *baseClient) generalProcessPipeline( ctx context.Context, cmds []Cmder, p pipelineProcessor, operationName string, ) error { + // Pipeline commands never pass through process, so apply the same CSC state + // guard here. initConn's internal client is exempt. + for _, cmd := range cmds { + if err := c.cscCommandError(cmd); err != nil { + setCmdsErr(cmds, err) + return err + } + } // Only call time.Now() if pipeline operation duration callback is set to avoid overhead var operationStart time.Time pipelineOpDurationCallback := otel.GetPipelineOperationDurationCallback() @@ -1163,7 +1640,9 @@ func (c *baseClient) generalProcessPipeline( // Enable retries by default to retry dial errors returned by withConn. canRetry := true - lastErr = c.withConn(ctx, func(ctx context.Context, cn *pool.Conn) error { + // Route pipelines through the dedicated pipeline pool when configured; + // withPipelineConn falls back to the regular pool when it is not. + lastErr = c.withPipelineConn(ctx, func(ctx context.Context, cn *pool.Conn) error { lastConn = cn // Process any pending push notifications before executing the pipeline if err := c.processPushNotifications(ctx, cn); err != nil { @@ -1196,6 +1675,17 @@ func (c *baseClient) generalProcessPipeline( } } + // Retries exhausted on a retryable error: the loop fell through without the + // early-exit branch running, so the commands were never populated with the + // failure. Mirror that branch here so callers that observe results only + // per-command — notably AutoPipeline, which discards this function's returned + // error — see the error instead of a nil error and a zero value. Guard on + // !isRedisError so a per-command redis error (e.g. LOADING) keeps its own + // reply rather than being overwritten. + if !isRedisError(lastErr) { + setCmdsErr(cmds, lastErr) + } + if pipelineOpDurationCallback != nil { operationDuration := time.Since(operationStart) pipelineOpDurationCallback(ctx, operationDuration, operationName, len(cmds), totalAttempts, lastErr, lastConn, c.opt.DB) @@ -1217,21 +1707,69 @@ func (c *baseClient) pipelineProcessCmds( internal.Logger.Printf(ctx, "push: error processing pending notifications before writing pipeline: %v", err) } + // HIMPORT bookkeeping: pending discards for this session and PREPAREs + // for registered fieldsets the batch references get written ahead of + // the batch. + injected := c.himportInjectedCmds(ctx, cn, cmds) + if err := cn.WithWriter(c.context(ctx), c.opt.WriteTimeout, func(wr *proto.Writer) error { + for _, ic := range injected { + if err := writeCmd(wr, ic); err != nil { + return err + } + } return writeCmds(wr, cmds) }); err != nil { setCmdsErr(cmds, err) return true, err } + var readErr error if err := cn.WithReader(c.context(ctx), c.opt.ReadTimeout, func(rd *proto.Reader) error { + if err := c.himportReadInjectedReplies(ctx, cn, rd, injected); err != nil { + // Transport error with every batch reply unreadXX: stamp the + // batch like a write failure. The outer retry loop stamps only + // on its exit branch, not when attempts run out, so without + // this a batch that keeps dying here would surface an Exec + // error while every command still reports Err() == nil. + setCmdsErr(cmds, err) + return err + } // read all replies - return c.pipelineReadCmds(ctx, cn, rd, cmds) + readErr = c.pipelineReadCmds(ctx, cn, rd, cmds) + if readErr != nil && !isRedisError(readErr) { + return readErr + } + c.himportAfterBatch(cn, injected, cmds) + return nil }); err != nil { return true, err } - return false, nil + // Registered fieldsets whose SETs came back "no such fieldset" (the + // session was lost between prepare and use) are re-prepared and those + // SETs re-issued once on the same connection; the error must not + // surface for managed fieldsets. + // + // A transport failure here must neither retry nor fail the batch: the + // first round trip was fully consumed and its results delivered, so + // re-executing would double-apply non-idempotent commands and failing + // would stamp a spurious error onto commands that succeeded. The + // re-issue errors stay on the retried SETs; the connection, which may + // hold unread replies, is marked for removal when released. + if err := c.himportRetryFailedSets(ctx, cn, cmds); err != nil { + internal.Logger.Printf(ctx, "himport: pipeline set re-issue failed: %v", err) + cn.MarkCloseOnPut("himport: transport error during set re-issue") + } + + // Preserve retryable first-command errors (e.g. LOADING) for the outer + // loop; the re-issue above may have cleared it. rawErr: this runs on the + // execution path; never await here (an async autopipeline command's ready + // channel is closed by this very batch — Err() would self-deadlock). + if readErr != nil { + readErr = cmds[0].rawErr() + } + return readErr != nil, readErr } func (c *baseClient) pipelineReadCmds(ctx context.Context, cn *pool.Conn, rd *proto.Reader, cmds []Cmder) error { @@ -1248,7 +1786,9 @@ func (c *baseClient) pipelineReadCmds(ctx context.Context, cn *pool.Conn, rd *pr } } // Retry errors like "LOADING redis is loading the dataset in memory". - return cmds[0].Err() + // rawErr: this runs on the execution path; never await here (an async + // autopipeline command's ready channel is closed by this very batch). + return cmds[0].rawErr() } func (c *baseClient) txPipelineProcessCmds( @@ -1259,7 +1799,17 @@ func (c *baseClient) txPipelineProcessCmds( internal.Logger.Printf(ctx, "push: error processing pending notifications before transaction: %v", err) } + // HIMPORT bookkeeping: pending discards for this session and PREPAREs + // for registered fieldsets the transaction references get written ahead + // of MULTI; the session state is visible inside the transaction. + injected := c.himportInjectedCmds(ctx, cn, cmds) + if err := cn.WithWriter(c.context(ctx), c.opt.WriteTimeout, func(wr *proto.Writer) error { + for _, ic := range injected { + if err := writeCmd(wr, ic); err != nil { + return err + } + } return writeCmds(wr, cmds) }); err != nil { setCmdsErr(cmds, err) @@ -1267,6 +1817,13 @@ func (c *baseClient) txPipelineProcessCmds( } if err := cn.WithReader(c.context(ctx), c.opt.ReadTimeout, func(rd *proto.Reader) error { + if err := c.himportReadInjectedReplies(ctx, cn, rd, injected); err != nil { + // Transport error with every transaction reply unread: stamp + // the batch like a write failure (see pipelineProcessCmds). + setCmdsErr(cmds, err) + return err + } + statusCmd := cmds[0].(*StatusCmd) // Trim multi and exec. trimmedCmds := cmds[1 : len(cmds)-1] @@ -1277,7 +1834,11 @@ func (c *baseClient) txPipelineProcessCmds( } // Read replies. - return c.pipelineReadCmds(ctx, cn, rd, trimmedCmds) + err := c.pipelineReadCmds(ctx, cn, rd, trimmedCmds) + if err == nil || isRedisError(err) { + c.himportAfterBatch(cn, injected, trimmedCmds) + } + return err }); err != nil { return false, err } @@ -1341,6 +1902,16 @@ func (c *baseClient) txPipelineReadQueued(ctx context.Context, cn *pool.Conn, rd type Client struct { *baseClient cmdable + + // cscLifecycleOwner keeps the canonical Client wrapper (the one whose GC + // cleanup owns the drainer) reachable while a WithTimeout clone can still + // serve from its cache. Nil on the canonical wrapper and on non-CSC clones. + cscLifecycleOwner *Client + + autopipelinerMu *sync.Mutex // guards the autopipeliner fields against concurrent first-call creation + autopipeliner *AutoPipeliner // blocking face (Client.AutoPipeline) + asyncAutopipeliner *AutoPipeliner // deferred face (Client.AsyncAutoPipeline) + autopipelinerClosed bool // set by Close: refuse to resurrect a pipeliner on a closed client } // NewClient returns a client to the Redis Server specified by Options. @@ -1357,8 +1928,10 @@ func NewClient(opt *Options) *Client { c := Client{ baseClient: &baseClient{ - opt: opt, - onClose: &onCloseHooks{}, + apClosed: &atomic.Bool{}, + opt: opt, + onClose: &onCloseHooks{}, + himport: newHImportRegistry(), }, } c.init() @@ -1385,9 +1958,61 @@ func NewClient(opt *Options) *Client { panic(fmt.Errorf("redis: failed to create pubsub pool: %w", err)) } + // Optionally create a separate connection pool for pipelining, with its own + // (typically larger) buffers, so pipelines can use big buffers without + // bloating the main pool. Enabled when either pipeline buffer size is set. + if opt.PipelineReadBufferSize > 0 || opt.PipelineWriteBufferSize > 0 { + pipelineOpt := opt.clone() + if opt.PipelineReadBufferSize > 0 { + pipelineOpt.ReadBufferSize = opt.PipelineReadBufferSize + // Same clamp Options.init applies to the main pool: RESP3 push + // parsing needs a minimum read buffer, and a tiny pipeline reader + // would break push-notification handling on pipeline conns. + if pipelineOpt.Protocol == 3 && pipelineOpt.ReadBufferSize < proto.MinRESP3ReadBufferSize { + pipelineOpt.ReadBufferSize = proto.MinRESP3ReadBufferSize + } + } + if opt.PipelineWriteBufferSize > 0 { + pipelineOpt.WriteBufferSize = opt.PipelineWriteBufferSize + } + if opt.PipelinePoolSize > 0 { + pipelineOpt.PoolSize = opt.PipelinePoolSize + } else { + pipelineOpt.PoolSize = 10 // default smaller pool for pipelining + } + pipelinePoolName := opt.Addr + "_" + uniqueID + "_pipeline" + c.pipelinePoolName = pipelinePoolName + c.pipelinePool, err = newConnPool(pipelineOpt, c.dialHook, pipelinePoolName) + if err != nil { + panic(fmt.Errorf("redis: failed to create pipeline connection pool: %w", err)) + } + } + if opt.StreamingCredentialsProvider != nil { c.streamingCredentialsManager = streaming.NewManager(c.connPool, c.opt.PoolTimeout) c.connPool.AddPoolHook(c.streamingCredentialsManager.PoolHook()) + if c.pipelinePool != nil { + c.pipelinePool.AddPoolHook(c.streamingCredentialsManager.PoolHook()) + } + } + + // CSC wiring (SharedTracking): shared cache + per-connection CLIENT TRACKING + + // background drainer. attachCSC is the strategy dispatch entry. + if opt.Protocol == 3 { + var cache Cache + if explicit := opt.ClientSideCache; explicit != nil { + cache = explicit + } else if cfg := opt.ClientSideCacheConfig; cfg != nil { + cache = NewLocalCache(*cfg) + // We constructed it, so we own it (may flush on drainer stop). + c.baseClient.cscOwnsCache = true + } + c.baseClient.attachCSC(context.Background(), cache) + + // Safety net for a client dropped without Close: the goroutines hold + // *baseClient (never *Client), so dropping *Client (returned as &c) + // triggers these cleanups, which stop them. See cscRegisterCleanups. + cscRegisterCleanups(&c) } // Initialize maintnotifications first if enabled and protocol is RESP3 @@ -1413,12 +2038,17 @@ func NewClient(opt *Options) *Client { // Register pools with OTel recorder if it supports pool registration // This allows async gauge metrics to pull stats from pools periodically - otel.RegisterPools(c.connPool, c.pubSubPool, opt.Addr) + otel.RegisterPools(c.connPool, c.pubSubPool, c.pipelinePool, opt.Addr) return &c } func (c *Client) init() { + // Fresh per-Client guard and no inherited autopipeliner: a WithTimeout clone + // (clone := *c) must not share the parent's mutex or AutoPipeliner instance. + c.autopipelinerMu = &sync.Mutex{} + c.autopipeliner = nil + c.asyncAutopipeliner = nil c.cmdable = c.Process c.initHooks(hooks{ dial: c.baseClient.dial, @@ -1428,15 +2058,89 @@ func (c *Client) init() { }) } +// WithTimeout returns a clone sharing the parent's connection pools with the +// given read/write timeout. The clone caches its own autopipeliners: an +// AutoPipeline()/AsyncAutoPipeline() created on the clone is NOT stopped by +// the parent's Close — call Close on the clone's autopipeliner explicitly. func (c *Client) WithTimeout(timeout time.Duration) *Client { + // Snapshot under the guard: AutoPipeline()/Close() mutate the + // autopipeliner fields concurrently, so a bare struct copy of them is a + // data race (init below discards the copied values either way). + c.autopipelinerMu.Lock() clone := *c + c.autopipelinerMu.Unlock() + if c.cscLifecycleOwner != nil { + clone.cscLifecycleOwner = c.cscLifecycleOwner + } else if c.baseClient.cscDrainHandle != nil { + clone.cscLifecycleOwner = c + } clone.baseClient = c.baseClient.withTimeout(timeout) clone.init() return &clone } +// Close closes the client, stopping both cached autopipeliners (the blocking +// AutoPipeline instance and the async AsyncAutoPipeline instance, if created) +// before releasing the underlying resources, so their background flusher +// goroutines don't outlive the client. AutoPipeliner.Close is idempotent and +// safe to call here even if autopipelining was never used. +// A WithTimeout clone delegates CSC teardown to the canonical wrapper that +// owns the background drainer. +func (c *Client) Close() error { + c.autopipelinerMu.Lock() + ap, async := c.autopipeliner, c.asyncAutopipeliner + c.autopipeliner, c.asyncAutopipeliner = nil, nil + // A later AutoPipeline()/AsyncAutoPipeline() call must not build a fresh + // pipeliner against the closed pools: nothing would ever close it and its + // flusher goroutines would leak. The getters check this flag. + c.autopipelinerClosed = true + c.autopipelinerMu.Unlock() + var firstErr error + for _, p := range []*AutoPipeliner{ap, async} { + if p != nil { + if err := p.Close(); err != nil && firstErr == nil { + firstErr = err + } + } + } + if c.cscLifecycleOwner != nil { + // Delegate through the OWNER's *Client.Close, not its baseClient: + // the owner may hold cached autopipeliners of its own whose flusher + // goroutines must stop with the shared pools, and its + // autopipelinerClosed flag must flip so later owner getters cannot + // resurrect a pipeliner against closed pools. Client.Close is + // idempotent through baseClient.Close, so an owner also closed + // directly is fine. + if err := c.cscLifecycleOwner.Close(); err != nil && firstErr == nil { + firstErr = err + } + return firstErr + } + if err := c.baseClient.Close(); err != nil && firstErr == nil { + firstErr = err + } + return firstErr +} + func (c *Client) Conn() *Conn { - return newConn(c.opt, pool.NewStickyConnPool(c.connPool), &c.hooksMixin) + // Share the HIMPORT fieldset registry: the sticky pool borrows + // connections from this client's pool, so fieldsets prepared on them + // stay valid after the connections are returned. + conn := newConn(c.opt, c.baseClient.newStickyConnPool(), &c.hooksMixin, c.himport) + // A sticky client does not serve cache hits, but a new pool connection first + // initialized through it may later be reused by the parent. Share the + // successful-attachment signal so that connection is tracked exactly when + // the parent's CSC is active. + conn.baseClient.cscActive = c.baseClient.cscActive + // No-op today: the strategy needs an idle-conn drainer and a StickyConnPool + // has none, so CSC isn't active on a Conn() (its reads hit the server). Kept + // so a future sticky-pool-capable strategy attaches here. + conn.baseClient.attachCSC(context.Background(), c.csc) + // Carry the parent's shared eviction hook so that if this derived client + // initializes a pool conn, the close hook it installs still evicts from the + // parent cache (its own csc is nil). + conn.baseClient.cscPoolHook = c.baseClient.cscPoolHook + return conn } func (c *Client) Process(ctx context.Context, cmd Cmder) error { @@ -1505,7 +2209,10 @@ type PoolStats pool.Stats // PoolStats returns connection pool stats. func (c *Client) PoolStats() *PoolStats { stats := c.connPool.Stats() - stats.PubSubStats = *(c.pubSubPool.Stats()) + stats.PubSubStats = *c.pubSubPool.Stats() + if c.pipelinePool != nil { + stats.PipelineStats = c.pipelinePool.Stats() + } return (*PoolStats)(stats) } @@ -1521,6 +2228,79 @@ func (c *Client) Pipeline() Pipeliner { return &pipe } +// AutoPipeline returns the blocking autopipeliner for this client: a drop-in +// replacement for the normal command surface where each command call (ap.Set, +// ap.Get, ...) blocks until executed, exactly like a plain client — but the +// engine batches concurrent callers' commands into pipelines, so throughput is +// far higher (measured locally over loopback: ~1M+ SET/sec vs ~100k; indicative, not a guarantee). Commands keep per-goroutine order. +// +// By default, Options.AutoPipelineOptions is used if set, +// otherwise DefaultBlockingAutoPipelineOptions (a single ordered batch stream, +// which maximizes throughput and minimizes latency for the blocking face — see +// its doc). The instance is cached and shared; the first +// call's config wins and later calls return the same instance until it is closed. +// It must be closed (or close the client) to release its goroutines. +// +// It returns an error if the supplied config is invalid (e.g. MaxConcurrentBatches>1 +// without Unordered, or a negative size); on error no instance is cached. +// +// EXPERIMENTAL: this API is subject to change, use with caution. +func (c *Client) AutoPipeline() (*AutoPipeliner, error) { + return c.AutoPipelineWithOptions(nil) +} + +// AutoPipelineWithOptions is AutoPipeline with explicit options instead of +// Options.AutoPipelineOptions / the default. The instance is cached and shared; +// the first call's config wins. +// +// EXPERIMENTAL: this API is subject to change, use with caution. +func (c *Client) AutoPipelineWithOptions(config *AutoPipelineOptions) (*AutoPipeliner, error) { + return getOrCreateAutoPipeliner(c.autopipelinerMu, &c.autopipeliner, &c.autopipelinerClosed, c.baseClient.apClosed, config, + func() *AutoPipelineOptions { + if c.opt.AutoPipelineOptions != nil { + return c.opt.AutoPipelineOptions + } + return DefaultBlockingAutoPipelineOptions() + }, + func(cfg *AutoPipelineOptions) (*AutoPipeliner, error) { return newAutoPipeliner(c, cfg, true) }) +} + +// AsyncAutoPipeline returns the deferred (async) autopipeliner: command calls +// return immediately and the result accessors (Val/Result/Err) block until the +// command has executed. Submit a window of commands, then read their results, to +// keep each pipeline deep and reach the highest throughput (measured locally over loopback: ~2-3M SET/sec; indicative). +// +// By default, Options.AutoPipelineOptions is used if set, +// otherwise DefaultAutoPipelineOptions (ordered, MaxConcurrentBatches: 1) — a +// single goroutine's deferred commands execute in submit order. Use AsyncAutoPipelineWithOptions +// to override (and, for parallel batches, set Unordered). The instance is +// cached and shared; the first call's config wins. Close it (or the client) to +// release its goroutines. +// +// It returns an error if the supplied config is invalid (e.g. MaxConcurrentBatches>1 +// without Unordered, or a negative size); on error no instance is cached. +// +// EXPERIMENTAL: this API is subject to change, use with caution. +func (c *Client) AsyncAutoPipeline() (*AutoPipeliner, error) { + return c.AsyncAutoPipelineWithOptions(nil) +} + +// AsyncAutoPipelineWithOptions is AsyncAutoPipeline with an explicit config +// instead of Options.AutoPipelineOptions / the default. The instance is cached +// and shared; the first call's config wins. +// +// EXPERIMENTAL: this API is subject to change, use with caution. +func (c *Client) AsyncAutoPipelineWithOptions(config *AutoPipelineOptions) (*AutoPipeliner, error) { + return getOrCreateAutoPipeliner(c.autopipelinerMu, &c.asyncAutopipeliner, &c.autopipelinerClosed, c.baseClient.apClosed, config, + func() *AutoPipelineOptions { + if c.opt.AutoPipelineOptions != nil { + return c.opt.AutoPipelineOptions + } + return DefaultAutoPipelineOptions() + }, + func(cfg *AutoPipelineOptions) (*AutoPipeliner, error) { return newAutoPipeliner(c, cfg, false) }) +} + func (c *Client) TxPipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error) { return c.TxPipeline().Pipelined(ctx, fn) } @@ -1539,7 +2319,7 @@ func (c *Client) TxPipeline() Pipeliner { func (c *Client) pubSub() *PubSub { pubsub := &PubSub{ - opt: c.opt, + opt: c.cloneOpt(), newConn: func(ctx context.Context, addr string, channels []string) (*pool.Conn, error) { cn, err := c.pubSubPool.NewConn(ctx, c.opt.Network, addr, channels) if err != nil { @@ -1634,14 +2414,20 @@ type Conn struct { } // newConn is a helper func to create a new Conn instance. -// the Conn instance is not thread-safe and should not be shared between goroutines. -// the parentHooks will be cloned, no need to clone before passing it. -func newConn(opt *Options, connPool pool.Pooler, parentHooks *hooksMixin) *Conn { +// The Conn instance is not thread-safe and should not be shared between goroutines. +// The parentHooks will be cloned, no need to clone before passing it. +// himport is the HIMPORT fieldset registry the Conn participates in — pass +// the owning client's registry (a private one would restart versions at 1 +// and collide with the client's version space on the shared pooled +// connections); nil disables HIMPORT tracking. +func newConn(opt *Options, connPool pool.Pooler, parentHooks *hooksMixin, himport *himportRegistry) *Conn { c := Conn{ baseClient: baseClient{ + apClosed: &atomic.Bool{}, opt: opt, connPool: connPool, onClose: &onCloseHooks{}, + himport: himport, }, } @@ -1739,25 +2525,116 @@ func (c *baseClient) processPushNotifications(ctx context.Context, cn *pool.Conn } } - // Check if there is any data to read before processing - // This is an optimization on UNIX systems where MaybeHasData is a syscall - // On Windows, MaybeHasData always returns true, so this check is a no-op + return c.peekAndProcessPushNotifications(ctx, cn) +} + +// peekAndProcessPushNotifications peeks the socket and processes any pending +// push notifications on cn unconditionally, bypassing the recent-health-check +// shortcut in processPushNotifications. Required on paths that do not follow +// up with a reply read on the same connection (e.g. the CSC cache-hit drain), +// where the shortcut would otherwise suppress invalidations buffered since the +// last health check. +func (c *baseClient) peekAndProcessPushNotifications(ctx context.Context, cn *pool.Conn) error { + if c.opt.Protocol != 3 || c.pushProcessor == nil { + return nil + } + if !cn.MaybeHasData() { return nil } - // Use WithReader to access the reader and process push notifications - // This is critical for maintnotifications to work properly - // NOTE: almost no timeouts are set for this read, so it should not block - // longer than necessary, 10us should be plenty of time to read if there are any push notifications - // on the socket. - return cn.WithReader(ctx, 10*time.Microsecond, func(rd *proto.Reader) error { - // Create handler context with client, connection pool, and connection information + // Short read timeout: MaybeHasData confirmed kernel-buffered bytes, so + // the first read returns immediately — the deadline only needs to cover + // scheduler pauses, not network waits. 10us was routinely lost to + // scheduling on loaded machines: the peek then timed out with nothing + // consumed, the processor treated that as "no pending data", and a + // connection with buffered push bytes was returned to the pool instead + // of being drained (or removed, when the frame turns out partial). + return cn.WithReader(ctx, time.Millisecond, func(rd *proto.Reader) error { handlerCtx := c.pushNotificationHandlerContext(cn) return c.pushProcessor.ProcessPendingNotifications(ctx, handlerCtx, rd) }) } +// cscFallbackProbeInterval bounds how often an idle connection without a +// portable readiness mechanism is subjected to a timed read. Post-command +// probes remain immediate; this is only the eventual invalidation fallback. +const cscFallbackProbeInterval = 100 * time.Millisecond + +// drainPushNotifications drains push frames buffered on a connection the CSC +// drainer has claimed, under a HARD read deadline. processorSucceeded reports a +// successful processor invocation; it resets custom-processor damping even when +// the frame was hidden inside a transport wrapper. A non-nil error is +// connection-fatal (the drainer removes the conn), including a read timeout +// after reply consumption starts: the reader may be desynchronized. A custom +// processor's error is also fatal because its contract cannot prove no bytes +// were consumed. +func (c *baseClient) drainPushNotifications(cn *pool.Conn) (processorSucceeded bool, err error) { + if c.opt.Protocol != 3 || c.pushProcessor == nil { + return false, nil + } + // Skip only when nothing is buffered (reader) AND nothing on the socket: + // MaybeHasData peeks only the socket, but an invalidate can sit in cn.rd. + readPending := cn.TakeCscReadPending() + periodicReadPending := cn.TakeCscPeriodicReadPending(cscFallbackProbeInterval) + socketData, socketErr := cn.CheckForData() + if socketErr != nil { + return false, socketErr + } + hasData := cn.HasBufferedData() || socketData + if !readPending && !periodicReadPending && !hasData { + return false, nil + } + if !hasData { + // TLS and opaque wrappers can hide bytes from the socket readiness + // check. Probe one byte without consuming it under a tiny deadline; + // only a confirmed byte gets the longer fragmented-frame budget below. + err := cn.WithReaderHardDeadline(cscDrainProbeReadCap, func(rd *proto.Reader) error { + _, err := rd.Peek(1) + return err + }) + if err != nil { + if isTimeout, hasTimeoutFlag := isTimeoutError(err); isTimeout && hasTimeoutFlag { + return false, nil + } + return false, err + } + } + + handlerCtx := c.pushNotificationHandlerContext(cn) + handlerCtx.Client = cscHandlerClient{baseClient: c} + err = cn.WithReaderHardDeadline(cscDrainHardReadCap, func(rd *proto.Reader) error { + if processor, ok := c.pushProcessor.(*push.Processor); ok { + return processor.ProcessPendingNotificationsBuffered( + context.Background(), handlerCtx, rd) + } + return c.pushProcessor.ProcessPendingNotifications(context.Background(), handlerCtx, rd) + }) + if err != nil { + // The built-in processor surfaces mid-frame ReadReply errors (a benign + // boundary peek timeout returns nil). allowTimeout=false: such an error + // means bytes were consumed mid-frame, leaving the conn desynced — + // re-pooling would corrupt the next command's reply, so remove it. + if _, builtin := c.pushProcessor.(*push.Processor); builtin { + if isBadConn(err, false, c.opt.Addr) { + return true, err // fatal read/protocol/connection error — remove the conn + } + return true, nil + } + // A CUSTOM processor's error contract is unknown: it may have consumed + // part of a frame before failing, and a mid-frame reader silently + // corrupts the next command's reply. The conn is idle and held solely + // by the drainer, so the safe default — removal — costs one reconnect; + // persistent failures are damped by the drainer (cscDrainCustomErrCap). + internal.Logger.Printf(context.Background(), "csc: drain: custom push processor error (removing conn): %v", err) + return true, err + } + // The processor ran successfully. This is stronger evidence than a clean + // connection on which it was never invoked, and prevents successful TLS- + // buffered drains from being counted as if failures were consecutive. + return true, nil +} + // processPendingPushNotificationWithReader processes all pending push notifications on a connection // This method should be called by the client in WithReader before reading the reply func (c *baseClient) processPendingPushNotificationWithReader(ctx context.Context, cn *pool.Conn, rd *proto.Reader) error { diff --git a/vendor/github.com/redis/go-redis/v9/ring.go b/vendor/github.com/redis/go-redis/v9/ring.go index b60d3eab5..a22e16672 100644 --- a/vendor/github.com/redis/go-redis/v9/ring.go +++ b/vendor/github.com/redis/go-redis/v9/ring.go @@ -48,6 +48,10 @@ type RingOptions struct { // NewClient creates a shard client with provided options. NewClient func(opt *Options) *Client + // himport is the ring-wide HIMPORT fieldset registry, set by NewRing and + // shared with every shard client (see himport.go, himport_cluster.go). + himport *himportRegistry + // ClientName will execute the `CLIENT SETNAME ClientName` command for each conn. ClientName string @@ -143,6 +147,14 @@ type RingOptions struct { // default: 32KiB (32768 bytes) WriteBufferSize int + // PipelineReadBufferSize, PipelineWriteBufferSize and PipelinePoolSize + // configure an optional separate connection pool used for pipelining on + // each shard, with its own (typically larger) buffers. See the same-named + // fields on Options for details. The pool is created only when PipelineReadBufferSize or PipelineWriteBufferSize is set (PipelinePoolSize alone does not enable it). + PipelineReadBufferSize int + PipelineWriteBufferSize int + PipelinePoolSize int + TLSConfig *tls.Config Limiter Limiter @@ -194,13 +206,13 @@ func (opt *RingOptions) init() { case -1: opt.MinRetryBackoff = 0 case 0: - opt.MinRetryBackoff = 8 * time.Millisecond + opt.MinRetryBackoff = 10 * time.Millisecond } switch opt.MaxRetryBackoff { case -1: opt.MaxRetryBackoff = 0 case 0: - opt.MaxRetryBackoff = 512 * time.Millisecond + opt.MaxRetryBackoff = time.Second } if opt.ReadBufferSize == 0 { @@ -247,6 +259,10 @@ func (opt *RingOptions) clientOptions() *Options { ReadBufferSize: opt.ReadBufferSize, WriteBufferSize: opt.WriteBufferSize, + PipelineReadBufferSize: opt.PipelineReadBufferSize, + PipelineWriteBufferSize: opt.PipelineWriteBufferSize, + PipelinePoolSize: opt.PipelinePoolSize, + TLSConfig: opt.TLSConfig, Limiter: opt.Limiter, @@ -262,7 +278,7 @@ func (opt *RingOptions) clientOptions() *Options { type ringShard struct { Client *Client - down int32 + down atomic.Int32 addr string } @@ -270,10 +286,16 @@ func newRingShard(opt *RingOptions, addr string) *ringShard { clopt := opt.clientOptions() clopt.Addr = addr - return &ringShard{ + shard := &ringShard{ Client: opt.NewClient(clopt), addr: addr, } + // Share the ring-wide HIMPORT fieldset registry so any shard connection + // serving an HIMPORT SET can lazily replay the PREPARE. + if opt.himport != nil { + shard.Client.himport = opt.himport + } + return shard } func (shard *ringShard) String() string { @@ -288,7 +310,7 @@ func (shard *ringShard) String() string { func (shard *ringShard) IsDown() bool { const threshold = 3 - return atomic.LoadInt32(&shard.down) >= threshold + return shard.down.Load() >= threshold } func (shard *ringShard) IsUp() bool { @@ -299,7 +321,7 @@ func (shard *ringShard) IsUp() bool { func (shard *ringShard) Vote(up bool) bool { if up { changed := shard.IsDown() - atomic.StoreInt32(&shard.down, 0) + shard.down.Store(0) return changed } @@ -307,7 +329,7 @@ func (shard *ringShard) Vote(up bool) bool { return false } - atomic.AddInt32(&shard.down, 1) + shard.down.Add(1) return shard.IsDown() } @@ -369,9 +391,10 @@ func (c *ringSharding) SetAddrs(addrs map[string]string) { return } existing := c.shards + onNewNode := c.onNewNode c.mu.RUnlock() - shards, created, unused := c.newRingShards(addrs, existing) + shards, created, unused := c.newRingShards(addrs, existing, onNewNode) c.mu.Lock() if c.closed { @@ -387,7 +410,7 @@ func (c *ringSharding) SetAddrs(addrs map[string]string) { } func (c *ringSharding) newRingShards( - addrs map[string]string, existing *ringShards, + addrs map[string]string, existing *ringShards, onNewNode []func(rdb *Client), ) (shards *ringShards, created, unused map[string]*ringShard) { shards = &ringShards{m: make(map[string]*ringShard, len(addrs))} created = make(map[string]*ringShard) // indexed by addr @@ -408,7 +431,7 @@ func (c *ringSharding) newRingShards( shards.m[name] = shard created[addr] = shard - for _, fn := range c.onNewNode { + for _, fn := range onNewNode { fn(shard.Client) } } @@ -604,7 +627,16 @@ func NewRing(opt *RingOptions) *Ring { if opt == nil { panic("redis: NewRing nil options") } + // Shallow-copy the options: the ring-wide HIMPORT registry is carried + // through them to shard construction, and reusing one caller-owned + // RingOptions across several rings must not make the rings share (or + // clobber each other's) registry. + optCopy := *opt + opt = &optCopy opt.init() + // The registry must exist before the first shard is created; shards + // adopt it in newRingShard. + opt.himport = newHImportRegistry() hbCtx, hbCancel := context.WithCancel(context.Background()) @@ -714,6 +746,17 @@ func (c *Ring) SSubscribe(ctx context.Context, channels ...string) *PubSub { return shard.Client.SSubscribe(ctx, channels...) } +// Publish posts the message to the channel +func (c *Ring) Publish(ctx context.Context, channel string, message interface{}) *IntCmd { + shard, err := c.sharding.GetByKey(channel) + if err != nil { + cmd := NewIntCmd(ctx, "publish", channel, message) + cmd.SetErr(err) + return cmd + } + return shard.Client.Publish(ctx, channel, message) +} + func (c *Ring) OnNewNode(fn func(rdb *Client)) { c.sharding.OnNewNode(fn) } @@ -820,6 +863,34 @@ func (c *Ring) Pipeline() Pipeliner { return &pipe } +// ErrRingAutoPipelineUnsupported is returned by Ring's AutoPipeline / +// AsyncAutoPipeline (and their WithOptions forms); check for it with +// errors.Is. Autopipelining is not implemented for Ring; use the per-shard +// clients or a ClusterClient. Ring is part of the UniversalClient +// interface, so these methods exist to satisfy it and fail explicitly rather +// than being silently absent. +var ErrRingAutoPipelineUnsupported = errors.New("redis: AutoPipeline is not supported by Ring") + +// AutoPipeline is not supported by Ring; it returns ErrRingAutoPipelineUnsupported. +func (c *Ring) AutoPipeline() (*AutoPipeliner, error) { + return c.AutoPipelineWithOptions(nil) +} + +// AutoPipelineWithOptions is not supported by Ring; it returns ErrRingAutoPipelineUnsupported. +func (c *Ring) AutoPipelineWithOptions(config *AutoPipelineOptions) (*AutoPipeliner, error) { + return nil, ErrRingAutoPipelineUnsupported +} + +// AsyncAutoPipeline is not supported by Ring; it returns ErrRingAutoPipelineUnsupported. +func (c *Ring) AsyncAutoPipeline() (*AutoPipeliner, error) { + return c.AsyncAutoPipelineWithOptions(nil) +} + +// AsyncAutoPipelineWithOptions is not supported by Ring; it returns ErrRingAutoPipelineUnsupported. +func (c *Ring) AsyncAutoPipelineWithOptions(config *AutoPipelineOptions) (*AutoPipeliner, error) { + return nil, ErrRingAutoPipelineUnsupported +} + func (c *Ring) TxPipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error) { return c.TxPipeline().Pipelined(ctx, fn) } diff --git a/vendor/github.com/redis/go-redis/v9/script.go b/vendor/github.com/redis/go-redis/v9/script.go index 92d508f9a..5b649f661 100644 --- a/vendor/github.com/redis/go-redis/v9/script.go +++ b/vendor/github.com/redis/go-redis/v9/script.go @@ -192,7 +192,7 @@ func (s *Script) EvalShaRO(ctx context.Context, c Scripter, keys []string, args // it is retried using EVAL. func (s *Script) Run(ctx context.Context, c Scripter, keys []string, args ...interface{}) *Cmd { r := s.EvalSha(ctx, c, keys, args...) - if errors.Is(r.Err(), ErrNoScript) { + if isNoScriptErr(r.Err()) { return s.Eval(ctx, c, keys, args...) } return r @@ -202,8 +202,20 @@ func (s *Script) Run(ctx context.Context, c Scripter, keys []string, args ...int // it is retried using EVAL_RO. func (s *Script) RunRO(ctx context.Context, c Scripter, keys []string, args ...interface{}) *Cmd { r := s.EvalShaRO(ctx, c, keys, args...) - if errors.Is(r.Err(), ErrNoScript) { + if isNoScriptErr(r.Err()) { return s.EvalRO(ctx, c, keys, args...) } return r } + +// isNoScriptErr reports whether err means "this digest is not cached", whether +// it arrived already normalized to ErrNoScript or as the server's raw NOSCRIPT +// error. Both are accepted because the Eval wrappers only normalize when the +// result is readable without blocking — on the deferred autopipeline face the +// raw error reaches here untouched (see cmdable.eval). +func isNoScriptErr(err error) bool { + if err == nil { + return false + } + return errors.Is(err, ErrNoScript) || HasErrorPrefix(err, "NOSCRIPT") +} diff --git a/vendor/github.com/redis/go-redis/v9/scripting_commands.go b/vendor/github.com/redis/go-redis/v9/scripting_commands.go index 3310b9d0a..6845f398c 100644 --- a/vendor/github.com/redis/go-redis/v9/scripting_commands.go +++ b/vendor/github.com/redis/go-redis/v9/scripting_commands.go @@ -60,8 +60,16 @@ func (c cmdable) eval(ctx context.Context, name, payload string, keys []string, cmd.SetFirstKeyPos(3) } _ = c(ctx, cmd) - if err := cmd.Err(); err != nil { - if HasErrorPrefix(err, "NOSCRIPT") { + // Normalize NOSCRIPT to ErrNoScript for Script.Run/RunRO's EVAL fallback, + // but only when the result is already readable: on the deferred + // autopipeline face the call above merely enqueues, and reading the outcome + // here would await execution — making the whole Eval family synchronous on + // a face whose contract is to return immediately (review finding by codex + // on #3942). When the result is still pending the normalization is skipped; + // Script.Run/RunRO also match the raw NOSCRIPT prefix, so the fallback + // keeps working on that face. + if cmd.resultReady() { + if err := cmd.rawErr(); err != nil && HasErrorPrefix(err, "NOSCRIPT") { cmd.SetErr(ErrNoScript) } } diff --git a/vendor/github.com/redis/go-redis/v9/search_builders.go b/vendor/github.com/redis/go-redis/v9/search_builders.go index a6c6718c3..094441c74 100644 --- a/vendor/github.com/redis/go-redis/v9/search_builders.go +++ b/vendor/github.com/redis/go-redis/v9/search_builders.go @@ -313,6 +313,31 @@ func (b *AggregateBuilder) ReduceAs(fn SearchAggregator, alias string, args ...i return b } +// Collect adds a REDUCE COLLECT clause to the last step, which must be a +// GROUPBY. The COLLECT options (FIELDS/DISTINCT/SORTBY/LIMIT/AS) are rendered +// and the argument count is computed automatically; field and sort names are +// normalized to a single "@" prefix. Set FTAggregateCollect.As to alias the +// output column. +// +// If the last step is not a GROUPBY, or the options are invalid (no FIELDS +// selector), Run returns the recorded error without issuing the command. +// COLLECT requires Redis 8.8+ with unstable features enabled. +func (b *AggregateBuilder) Collect(o FTAggregateCollect) *AggregateBuilder { + n := len(b.options.Steps) + if n == 0 || b.options.Steps[n-1].GroupBy == nil { + b.setErr(fmt.Errorf("FT.AGGREGATE: Collect must follow a GroupBy step")) + return b + } + reducer, err := NewCollectReducer(o) + if err != nil { + b.setErr(err) + return b + } + g := b.options.Steps[n-1].GroupBy + g.Reduce = append(g.Reduce, reducer) + return b +} + // SortBy adds SORTBY ASC|DESC. Consecutive SortBy calls (with no // other step in between) are merged into a single SORTBY clause so fields // act as tiebreakers. A SortBy call after a non-SortBy step starts a new diff --git a/vendor/github.com/redis/go-redis/v9/search_collect.go b/vendor/github.com/redis/go-redis/v9/search_collect.go new file mode 100644 index 000000000..48389a0ce --- /dev/null +++ b/vendor/github.com/redis/go-redis/v9/search_collect.go @@ -0,0 +1,235 @@ +package redis + +import ( + "fmt" + "strings" +) + +// ---------------------- +// FT.AGGREGATE COLLECT reducer +// ---------------------- +// +// COLLECT is a GROUPBY reducer for FT.AGGREGATE (Redis 8.8+, gated behind +// search-enable-unstable-features). Within each group it projects a chosen +// set of fields from every row, optionally deduplicates, sorts, and limits +// them, and emits the result as an array of per-entry maps under the reducer +// alias. +// +// COLLECT is not a standalone command; it is a REDUCE clause inside +// FT.AGGREGATE. The helpers below assemble the reducer token list and compute +// its argument count, so callers do not have to hand-write FIELDS/SORTBY/LIMIT +// tokens or remember to @-prefix every name. + +// FTAggregateCollect describes a COLLECT reducer. It is rendered into a +// standard FTAggregateReducer via NewCollectReducer, or appended to a builder +// via AggregateBuilder.Collect. +// +// Field and sort names may be supplied with or without a leading "@"; each is +// normalized to a single "@" on the wire. Output map keys returned by +// the server are the bare names (see AggregateRow.Collect). +type FTAggregateCollect struct { + // FieldsAll emits FIELDS *, projecting every field present in the + // pipeline at the COLLECT stage. It is not a whole-document fetch; pair + // it with an upstream LOAD * to collect complete documents. FieldsAll + // takes precedence over Fields when both are set. + FieldsAll bool + + // Fields is the explicit list of fields to project (FIELDS @f ...). + // Ignored when FieldsAll is true. Exactly one of FieldsAll or a non-empty + // Fields must be set. + Fields []string + + // Distinct emits DISTINCT, deduplicating entries with identical projected + // fields. + // + // NOTE: DISTINCT is specified by the product but not yet implemented by + // the server. Sending it currently produces a server error. The option is + // kept for forward compatibility; leave it false unless the target server + // supports it. + Distinct bool + + // SortBy orders entries within each group. Direction defaults to ASC when + // neither Asc nor Desc is set. With Limit, SORTBY acts as a top-N + // selection. Reuses FTAggregateSortBy for consistency with the rest of the + // aggregate API. + SortBy []FTAggregateSortBy + + // Limit returns at most Count entries per group after skipping Offset. + // nil means no LIMIT clause (distinct from LIMIT 0 0). + Limit *FTAggregateCollectLimit + + // As sets the reducer output column name (AS ). It is emitted + // outside the reducer argument count. + As string +} + +// FTAggregateCollectLimit is the LIMIT clause of a COLLECT +// reducer. Numeric bounds are enforced by the server, not the client. +type FTAggregateCollectLimit struct { + Offset int + Count int +} + +// ensureAtPrefix normalizes a field or sort name to exactly one leading "@", +// collapsing any number of leading "@" (including none) to a single prefix. +func ensureAtPrefix(name string) string { + return "@" + strings.TrimLeft(name, "@") +} + +// buildCollectArgs renders a FTAggregateCollect into the reducer argument +// token list (everything after "REDUCE COLLECT ", excluding AS ). +// The serializer computes as len(args), which matches the COLLECT +// contract: narg counts every FIELDS/DISTINCT/SORTBY/LIMIT token. +func buildCollectArgs(o FTAggregateCollect) ([]interface{}, error) { + args := make([]interface{}, 0, 8) + + // FIELDS (required): either * or a counted list of @-names. + switch { + case o.FieldsAll: + args = append(args, "FIELDS", "*") + case len(o.Fields) > 0: + args = append(args, "FIELDS", len(o.Fields)) + for _, f := range o.Fields { + if strings.TrimLeft(f, "@") == "" { + return nil, fmt.Errorf("redis: FT.AGGREGATE COLLECT: empty field name in Fields") + } + args = append(args, ensureAtPrefix(f)) + } + default: + return nil, fmt.Errorf("redis: FT.AGGREGATE COLLECT requires FieldsAll or a non-empty Fields list") + } + + // DISTINCT (optional, forward-compatible). + if o.Distinct { + args = append(args, "DISTINCT") + } + + // SORTBY (optional). sort_narg counts each field plus its optional + // direction token. + if len(o.SortBy) > 0 { + sortTokens := make([]interface{}, 0, len(o.SortBy)*2) + for _, s := range o.SortBy { + if strings.TrimLeft(s.FieldName, "@") == "" { + return nil, fmt.Errorf("redis: FT.AGGREGATE COLLECT: empty field name in SortBy") + } + if s.Asc && s.Desc { + return nil, fmt.Errorf("redis: FT.AGGREGATE COLLECT: ASC and DESC are mutually exclusive") + } + sortTokens = append(sortTokens, ensureAtPrefix(s.FieldName)) + switch { + case s.Desc: + sortTokens = append(sortTokens, "DESC") + case s.Asc: + sortTokens = append(sortTokens, "ASC") + // neither set: ASC is the server default; emit nothing. + } + } + args = append(args, "SORTBY", len(sortTokens)) + args = append(args, sortTokens...) + } + + // LIMIT (optional). + if o.Limit != nil { + args = append(args, "LIMIT", o.Limit.Offset, o.Limit.Count) + } + + return args, nil +} + +// NewCollectReducer builds a COLLECT FTAggregateReducer for use with +// FTAggregateOptions.GroupBy[i].Reduce. It normalizes field/sort names and +// computes the argument count automatically. +// +// It returns an error only for local API misuse: a missing FIELDS selector, an +// empty field name (in Fields or SortBy), or a SortBy entry with both Asc and +// Desc set. Numeric bounds and the unstable-features gate are enforced by the +// server and surface unchanged through the command reply. +func NewCollectReducer(o FTAggregateCollect) (FTAggregateReducer, error) { + args, err := buildCollectArgs(o) + if err != nil { + return FTAggregateReducer{}, err + } + return FTAggregateReducer{Reducer: SearchCollect, Args: args, As: o.As}, nil +} + +// ---------------------- +// COLLECT response decoding +// ---------------------- + +// CollectEntry is a single collected row: a sparse map of bare field name to +// value. A field absent from a row is omitted from its entry (no NULL +// placeholder), so entries in the same column may have different key sets. +type CollectEntry = map[string]interface{} + +// CollectColumn is the value stored under a COLLECT reducer alias: the ordered +// list of collected entries for a group. +type CollectColumn = []CollectEntry + +// Collect decodes the COLLECT reducer column stored under alias in this row +// into a uniform CollectColumn, hiding the RESP2/RESP3 representation +// difference (RESP3 entries are maps; RESP2 entries are flat key/value +// arrays). +// +// It returns (nil, nil) when the alias is absent from the row. Entry order is +// preserved as returned by the server; it is meaningful only when the COLLECT +// reducer was given a SORTBY. +func (r AggregateRow) Collect(alias string) (CollectColumn, error) { + v, ok := r.Fields[alias] + if !ok { + return nil, nil + } + return parseCollectValue(v) +} + +// parseCollectValue decodes a raw COLLECT alias value (an array of entries) +// into a CollectColumn. +func parseCollectValue(v interface{}) (CollectColumn, error) { + if v == nil { + return nil, nil + } + arr, ok := v.([]interface{}) + if !ok { + return nil, fmt.Errorf("redis: COLLECT value has type %T, want array of entries", v) + } + out := make(CollectColumn, 0, len(arr)) + for i, e := range arr { + entry, err := parseCollectEntry(e) + if err != nil { + return nil, fmt.Errorf("redis: COLLECT entry %d: %w", i, err) + } + out = append(out, entry) + } + return out, nil +} + +// parseCollectEntry decodes a single collected entry from either the RESP3 +// map form or the RESP2 flat key/value array form into a CollectEntry. Keys +// are passed through as-is: the server already returns them without the "@" +// prefix. +func parseCollectEntry(e interface{}) (CollectEntry, error) { + switch m := e.(type) { + case map[interface{}]interface{}: // RESP3 + out := make(CollectEntry, len(m)) + for k, val := range m { + out[fmt.Sprint(k)] = val + } + return out, nil + case map[string]interface{}: // already string-keyed + return m, nil + case []interface{}: // RESP2 flat [field, value, field, value, ...] + if len(m)%2 != 0 { + return nil, fmt.Errorf("odd-length key/value array of length %d", len(m)) + } + out := make(CollectEntry, len(m)/2) + for i := 0; i < len(m); i += 2 { + key, ok := m[i].(string) + if !ok { + key = fmt.Sprint(m[i]) + } + out[key] = m[i+1] + } + return out, nil + default: + return nil, fmt.Errorf("unexpected type %T, want map or key/value array", e) + } +} diff --git a/vendor/github.com/redis/go-redis/v9/search_commands.go b/vendor/github.com/redis/go-redis/v9/search_commands.go index b13aa5bef..588a30e76 100644 --- a/vendor/github.com/redis/go-redis/v9/search_commands.go +++ b/vendor/github.com/redis/go-redis/v9/search_commands.go @@ -18,6 +18,7 @@ type SearchCmdable interface { FTAggregateWithArgs(ctx context.Context, index string, query string, options *FTAggregateOptions) *AggregateCmd FTAliasAdd(ctx context.Context, index string, alias string) *StatusCmd FTAliasDel(ctx context.Context, alias string) *StatusCmd + FTAliasList(ctx context.Context, index string) *StringSliceCmd FTAliasUpdate(ctx context.Context, index string, alias string) *StatusCmd FTAlter(ctx context.Context, index string, skipInitialScan bool, definition []interface{}) *StatusCmd FTConfigGet(ctx context.Context, option string) *MapMapStringInterfaceCmd @@ -107,6 +108,13 @@ type FTHNSWOptions struct { MaxAllowedEdgesPerNode int EFRunTime int Epsilon float64 + // Rerank toggles the exact re-scoring pass over approximate candidates on + // disk-backed HNSW indexes (Redis 8.10+), where the server requires it to + // be set explicitly. Rerank=true emits RERANK TRUE on its own; to emit + // RERANK FALSE, set HasRerank=true with Rerank=false, so that an explicit + // false can be distinguished from unset (omitted). + Rerank bool + HasRerank bool } type FTVamanaOptions struct { @@ -157,6 +165,12 @@ const ( SearchToList SearchFirstValue SearchRandomSample + // SearchCollect is the COLLECT reducer for FT.AGGREGATE. Within each + // GROUPBY group it projects a chosen set of fields from every row and + // emits them as an array of per-entry maps under the reducer alias. + // Requires Redis 8.8+ with unstable features enabled + // (CONFIG SET search-enable-unstable-features yes). + SearchCollect ) func (a SearchAggregator) String() string { @@ -187,6 +201,8 @@ func (a SearchAggregator) String() string { return "FIRST_VALUE" case SearchRandomSample: return "RANDOM_SAMPLE" + case SearchCollect: + return "COLLECT" default: return "" } @@ -418,8 +434,15 @@ type FTHybridVectorExpression struct { VectorParamName string Method FTHybridVectorMethod MethodParams []interface{} - Filter string - YieldScoreAs string + // ShardKRatio controls how many results each shard returns relative to the + // requested KNN K, trading recall for latency in Redis cluster setups. + // Valid range: 0.1 - 1.0. The zero value means "unset" and falls back to + // the server default of 1.0 (no per-shard reduction). Has no effect on + // standalone Redis, and only applies to the KNN method. Requires Redis 8.8+. + // See https://redis.io/docs/latest/develop/ai/search-and-query/query/vector-search/ + ShardKRatio float64 + Filter string + YieldScoreAs string } // FTHybridCombineOptions represents options for result fusion @@ -487,8 +510,10 @@ type FTSynDumpCmd struct { // FTAggregateResult represents the result of an aggregate operation // NOTE: For RESP3 Total is not reliable (before Redis 8.8) type FTAggregateResult struct { - Total int - Rows []AggregateRow + Total int + Rows []AggregateRow + // Warnings holds server warnings for a partial result (search-on-timeout + // return/return-strict). RESP3 only; the fail policy returns an error instead. Warnings []string } @@ -619,8 +644,10 @@ type SpellCheckSuggestion struct { } type FTSearchResult struct { - Total int - Docs []Document + Total int + Docs []Document + // Warnings holds server warnings for a partial result (search-on-timeout + // return/return-strict). RESP3 only; the fail policy returns an error instead. Warnings []string } @@ -936,22 +963,27 @@ func (cmd *AggregateCmd) SetVal(val *FTAggregateResult) { } func (cmd *AggregateCmd) Val() *FTAggregateResult { + cmd.await() return cmd.val } func (cmd *AggregateCmd) Result() (*FTAggregateResult, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *AggregateCmd) RawVal() interface{} { + cmd.await() return cmd.rawVal } func (cmd *AggregateCmd) RawResult() (interface{}, error) { + cmd.await() return cmd.rawVal, cmd.err } func (cmd *AggregateCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -1268,6 +1300,20 @@ func (c cmdable) FTAliasDel(ctx context.Context, alias string) *StatusCmd { return cmd } +// FTAliasList - Lists all aliases associated with an index. +// The 'index' parameter specifies the index whose aliases are listed; it must +// be the name of an index created with FT.CREATE, not an alias. +// The reply is an unordered collection of alias names, already deduplicated +// by the server; an index with no aliases yields an empty result, not an +// error. Available since Redis 8.10. +// For more information, please refer to the Redis documentation: +// [FT.ALIASLIST]: (https://redis.io/commands/ft.aliaslist/) +func (c cmdable) FTAliasList(ctx context.Context, index string) *StringSliceCmd { + cmd := NewStringSliceCmd(ctx, "FT.ALIASLIST", index) + _ = c(ctx, cmd) + return cmd +} + // FTAliasUpdate - Updates an alias to an index. // The 'index' parameter specifies the index to which the alias is updated, and the 'alias' parameter specifies the alias. // If the alias already exists for a different index, it updates the alias to point to the specified index instead. @@ -1484,6 +1530,13 @@ func (c cmdable) FTCreate(ctx context.Context, index string, options *FTCreateOp if schema.VectorArgs.HNSWOptions.Epsilon > 0 { hnswArgs = append(hnswArgs, "EPSILON", schema.VectorArgs.HNSWOptions.Epsilon) } + if schema.VectorArgs.HNSWOptions.Rerank || schema.VectorArgs.HNSWOptions.HasRerank { + rerank := "FALSE" + if schema.VectorArgs.HNSWOptions.Rerank { + rerank = "TRUE" + } + hnswArgs = append(hnswArgs, "RERANK", rerank) + } args = append(args, len(hnswArgs)) args = append(args, hnswArgs...) } @@ -1564,7 +1617,6 @@ func (c cmdable) FTCreate(ctx context.Context, index string, options *FTCreateOp } if schema.IndexMissing { args = append(args, "INDEXMISSING") - } } cmd := NewStatusCmd(ctx, args...) @@ -2127,6 +2179,7 @@ func newFTInfoCmd(ctx context.Context, args ...interface{}) *FTInfoCmd { } func (cmd *FTInfoCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -2135,20 +2188,25 @@ func (cmd *FTInfoCmd) SetVal(val FTInfoResult) { } func (cmd *FTInfoCmd) Result() (FTInfoResult, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *FTInfoCmd) Val() FTInfoResult { + cmd.await() return cmd.val } func (cmd *FTInfoCmd) RawVal() interface{} { + cmd.await() return cmd.rawVal } func (cmd *FTInfoCmd) RawResult() (interface{}, error) { + cmd.await() return cmd.rawVal, cmd.err } + func (cmd *FTInfoCmd) readReply(rd *proto.Reader) (err error) { readType, err := rd.PeekReplyType() if err != nil { @@ -2329,6 +2387,7 @@ func newFTSpellCheckCmd(ctx context.Context, args ...interface{}) *FTSpellCheckC } func (cmd *FTSpellCheckCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -2337,18 +2396,22 @@ func (cmd *FTSpellCheckCmd) SetVal(val []SpellCheckResult) { } func (cmd *FTSpellCheckCmd) Result() ([]SpellCheckResult, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *FTSpellCheckCmd) Val() []SpellCheckResult { + cmd.await() return cmd.val } func (cmd *FTSpellCheckCmd) RawVal() interface{} { + cmd.await() return cmd.rawVal } func (cmd *FTSpellCheckCmd) RawResult() (interface{}, error) { + cmd.await() return cmd.rawVal, cmd.err } @@ -2645,6 +2708,7 @@ func newFTSearchCmd(ctx context.Context, options *FTSearchOptions, args ...inter } func (cmd *FTSearchCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -2653,18 +2717,22 @@ func (cmd *FTSearchCmd) SetVal(val FTSearchResult) { } func (cmd *FTSearchCmd) Result() (FTSearchResult, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *FTSearchCmd) Val() FTSearchResult { + cmd.await() return cmd.val } func (cmd *FTSearchCmd) RawVal() interface{} { + cmd.await() return cmd.rawVal } func (cmd *FTSearchCmd) RawResult() (interface{}, error) { + cmd.await() return cmd.rawVal, cmd.err } @@ -2890,8 +2958,10 @@ func (cmd *FTSearchCmd) Clone() Cmder { // FTHybridResult represents the result of a hybrid search operation type FTHybridResult struct { - TotalResults int - Results []map[string]interface{} + TotalResults int + Results []map[string]interface{} + // Warnings holds server warnings for a partial result (search-on-timeout + // return/return-strict), on RESP2 and RESP3; the fail policy returns an error. Warnings []string ExecutionTime float64 } @@ -2926,6 +2996,7 @@ func newFTHybridCmd(ctx context.Context, options *FTHybridOptions, args ...inter } func (cmd *FTHybridCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -2934,26 +3005,32 @@ func (cmd *FTHybridCmd) SetVal(val FTHybridResult) { } func (cmd *FTHybridCmd) Result() (FTHybridResult, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *FTHybridCmd) CursorResult() (*FTHybridCursorResult, error) { + cmd.await() return cmd.cursorVal, cmd.err } func (cmd *FTHybridCmd) Val() FTHybridResult { + cmd.await() return cmd.val } func (cmd *FTHybridCmd) CursorVal() *FTHybridCursorResult { + cmd.await() return cmd.cursorVal } func (cmd *FTHybridCmd) RawVal() interface{} { + cmd.await() return cmd.rawVal } func (cmd *FTHybridCmd) RawResult() (interface{}, error) { + cmd.await() return cmd.rawVal, cmd.err } @@ -3034,9 +3111,13 @@ func parseFTHybrid(data []interface{}, withCursor bool) (FTHybridResult, *FTHybr results = append(results, itemMap) } - // Parse warnings (optional field) + // Optional warnings; accept both "warning" (as FT.SEARCH/FT.AGGREGATE) and "warnings". var warnings []string - if warningsData, ok := resultMap["warnings"].([]interface{}); ok { + warningsData, ok := resultMap["warning"].([]interface{}) + if !ok { + warningsData, ok = resultMap["warnings"].([]interface{}) + } + if ok { warnings = make([]string, 0, len(warningsData)) for _, w := range warningsData { if ws, ok := w.(string); ok { @@ -3460,6 +3541,7 @@ func NewFTSynDumpCmd(ctx context.Context, args ...interface{}) *FTSynDumpCmd { } func (cmd *FTSynDumpCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -3468,18 +3550,22 @@ func (cmd *FTSynDumpCmd) SetVal(val []FTSynDumpResult) { } func (cmd *FTSynDumpCmd) Val() []FTSynDumpResult { + cmd.await() return cmd.val } func (cmd *FTSynDumpCmd) Result() ([]FTSynDumpResult, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *FTSynDumpCmd) RawVal() interface{} { + cmd.await() return cmd.rawVal } func (cmd *FTSynDumpCmd) RawResult() (interface{}, error) { + cmd.await() return cmd.rawVal, cmd.err } @@ -3795,6 +3881,22 @@ func (c cmdable) FTHybridWithArgs(ctx context.Context, index string, options *FT } } + // SHARD_K_RATIO applies to the KNN method only (Redis 8.8+, cluster only). + // Zero means "unset" and falls back to the server default of 1.0. + if vectorExpr.ShardKRatio > 0 { + if vectorExpr.Method != "KNN" { + cmd := newFTHybridCmd(ctx, options, args...) + cmd.SetErr(fmt.Errorf("FT.HYBRID: SHARD_K_RATIO requires KNN method")) + return cmd + } + if vectorExpr.ShardKRatio < 0.1 || vectorExpr.ShardKRatio > 1.0 { + cmd := newFTHybridCmd(ctx, options, args...) + cmd.SetErr(fmt.Errorf("FT.HYBRID: SHARD_K_RATIO must be between 0.1 and 1.0")) + return cmd + } + args = append(args, "SHARD_K_RATIO", vectorExpr.ShardKRatio) + } + if vectorExpr.Filter != "" { args = append(args, "FILTER", vectorExpr.Filter) } diff --git a/vendor/github.com/redis/go-redis/v9/sentinel.go b/vendor/github.com/redis/go-redis/v9/sentinel.go index 055b3101f..5720fc476 100644 --- a/vendor/github.com/redis/go-redis/v9/sentinel.go +++ b/vendor/github.com/redis/go-redis/v9/sentinel.go @@ -12,11 +12,14 @@ import ( "strconv" "strings" "sync" + "sync/atomic" "time" "github.com/redis/go-redis/v9/auth" "github.com/redis/go-redis/v9/internal" + "github.com/redis/go-redis/v9/internal/otel" "github.com/redis/go-redis/v9/internal/pool" + "github.com/redis/go-redis/v9/internal/proto" "github.com/redis/go-redis/v9/maintnotifications" "github.com/redis/go-redis/v9/push" ) @@ -123,6 +126,18 @@ type FailoverOptions struct { // default: 32KiB (32768 bytes) WriteBufferSize int + // PipelineReadBufferSize, PipelineWriteBufferSize and PipelinePoolSize + // configure an optional separate connection pool used for pipelining, with + // its own (typically larger) buffers. See the same-named fields on Options + // for details. The pool is created only when PipelineReadBufferSize or PipelineWriteBufferSize is set (PipelinePoolSize alone does not enable it). + PipelineReadBufferSize int + PipelineWriteBufferSize int + PipelinePoolSize int + + // AutoPipelineOptions is the default config for the client's autopipeliner + // faces. See Options.AutoPipelineOptions. + AutoPipelineOptions *AutoPipelineOptions + PoolFIFO bool PoolSize int @@ -176,7 +191,7 @@ type FailoverOptions struct { // seamlessly. Requires Protocol: 3 (RESP3) for push notifications. // If nil, maintnotifications upgrades are disabled. // (however if Mode is nil, it defaults to "auto" - enable if server supports it) - //MaintNotificationsConfig *maintnotifications.Config + // MaintNotificationsConfig *maintnotifications.Config } func (opt *FailoverOptions) clientOptions() *Options { @@ -202,6 +217,11 @@ func (opt *FailoverOptions) clientOptions() *Options { ReadBufferSize: opt.ReadBufferSize, WriteBufferSize: opt.WriteBufferSize, + PipelineReadBufferSize: opt.PipelineReadBufferSize, + PipelineWriteBufferSize: opt.PipelineWriteBufferSize, + PipelinePoolSize: opt.PipelinePoolSize, + AutoPipelineOptions: opt.AutoPipelineOptions, + DialTimeout: opt.DialTimeout, DialerRetries: opt.DialerRetries, DialerRetryTimeout: opt.DialerRetryTimeout, @@ -318,6 +338,11 @@ func (opt *FailoverOptions) clusterOptions() *ClusterOptions { ReadBufferSize: opt.ReadBufferSize, WriteBufferSize: opt.WriteBufferSize, + PipelineReadBufferSize: opt.PipelineReadBufferSize, + PipelineWriteBufferSize: opt.PipelineWriteBufferSize, + PipelinePoolSize: opt.PipelinePoolSize, + AutoPipelineOptions: opt.AutoPipelineOptions, + DialTimeout: opt.DialTimeout, DialerRetries: opt.DialerRetries, DialerRetryTimeout: opt.DialerRetryTimeout, @@ -536,8 +561,10 @@ func NewFailoverClient(failoverOpt *FailoverOptions) *Client { rdb := &Client{ baseClient: &baseClient{ - opt: opt, - onClose: &onCloseHooks{}, + apClosed: &atomic.Bool{}, + opt: opt, + onClose: &onCloseHooks{}, + himport: newHImportRegistry(), }, } rdb.init() @@ -561,6 +588,40 @@ func NewFailoverClient(failoverOpt *FailoverOptions) *Client { panic(fmt.Errorf("redis: failed to create pubsub pool: %w", err)) } + // Optionally create a separate connection pool for pipelining, with its own + // (typically larger) buffers. Enabled when either pipeline buffer size is set. + if opt.PipelineReadBufferSize > 0 || opt.PipelineWriteBufferSize > 0 { + pipelineOpt := opt.clone() + if opt.PipelineReadBufferSize > 0 { + pipelineOpt.ReadBufferSize = opt.PipelineReadBufferSize + // Same clamp Options.init applies to the main pool: RESP3 push + // parsing needs a minimum read buffer, and a tiny pipeline reader + // would break push-notification handling on pipeline conns. + if pipelineOpt.Protocol == 3 && pipelineOpt.ReadBufferSize < proto.MinRESP3ReadBufferSize { + pipelineOpt.ReadBufferSize = proto.MinRESP3ReadBufferSize + } + } + if opt.PipelineWriteBufferSize > 0 { + pipelineOpt.WriteBufferSize = opt.PipelineWriteBufferSize + } + if opt.PipelinePoolSize > 0 { + pipelineOpt.PoolSize = opt.PipelinePoolSize + } else { + pipelineOpt.PoolSize = 10 // default smaller pool for pipelining + } + rdb.pipelinePoolName = mainPoolName + "_pipeline" + rdb.pipelinePool, err = newConnPool(pipelineOpt, rdb.dialHook, rdb.pipelinePoolName) + if err != nil { + panic(fmt.Errorf("redis: failed to create pipeline connection pool: %w", err)) + } + } + + // Register pools for OTel async gauge metrics, matching NewClient (the + // failover client previously registered none, so pool gauges were silent + // for the identical standalone setup). The pipeline pool is nil when not + // configured. + otel.RegisterPools(rdb.connPool, rdb.pubSubPool, rdb.pipelinePool, opt.Addr) + rdb.onClose.register(onCloseHookIDSentinelFailover, failover.Close) failover.mu.Lock() @@ -570,6 +631,13 @@ func NewFailoverClient(failoverOpt *FailoverOptions) *Client { return cn.RemoteAddr().String() != addr }) } + // Drop stale pipeline-pool connections dialed to the demoted master too; + // otherwise pipelined traffic keeps using the old address after failover. + if pipelinePool, ok := rdb.pipelinePool.(*pool.ConnPool); ok { + _ = pipelinePool.Filter(func(cn *pool.Conn) bool { + return cn.RemoteAddr().String() != addr + }) + } } failover.mu.Unlock() @@ -599,8 +667,8 @@ func masterReplicaDialer( } netDialer := &net.Dialer{ - Timeout: failover.opt.DialTimeout, - KeepAlive: 5 * time.Minute, + Timeout: failover.opt.DialTimeout, + KeepAliveConfig: defaultKeepAliveConfig, } if failover.opt.TLSConfig == nil { return netDialer.DialContext(ctx, network, addr) @@ -625,8 +693,9 @@ func NewSentinelClient(opt *Options) *SentinelClient { opt.init() c := &SentinelClient{ baseClient: &baseClient{ - opt: opt, - onClose: &onCloseHooks{}, + apClosed: &atomic.Bool{}, + opt: opt, + onClose: &onCloseHooks{}, }, } @@ -678,7 +747,7 @@ func (c *SentinelClient) Process(ctx context.Context, cmd Cmder) error { func (c *SentinelClient) pubSub() *PubSub { pubsub := &PubSub{ - opt: c.opt, + opt: c.cloneOpt(), newConn: func(ctx context.Context, addr string, channels []string) (*pool.Conn, error) { cn, err := c.pubSubPool.NewConn(ctx, c.opt.Network, addr, channels) if err != nil { diff --git a/vendor/github.com/redis/go-redis/v9/set_commands.go b/vendor/github.com/redis/go-redis/v9/set_commands.go index 2a465728b..940745552 100644 --- a/vendor/github.com/redis/go-redis/v9/set_commands.go +++ b/vendor/github.com/redis/go-redis/v9/set_commands.go @@ -12,6 +12,7 @@ type SetCmdable interface { SAdd(ctx context.Context, key string, members ...interface{}) *IntCmd SCard(ctx context.Context, key string) *IntCmd SDiff(ctx context.Context, keys ...string) *StringSliceCmd + SDiffCard(ctx context.Context, opts *SDiffCardOptions, keys ...string) *IntCmd SDiffStore(ctx context.Context, destination string, keys ...string) *IntCmd SInter(ctx context.Context, keys ...string) *StringSliceCmd SInterCard(ctx context.Context, limit int64, keys ...string) *IntCmd @@ -28,9 +29,21 @@ type SetCmdable interface { SRem(ctx context.Context, key string, members ...interface{}) *IntCmd SScan(ctx context.Context, key string, cursor uint64, match string, count int64) *ScanCmd SUnion(ctx context.Context, keys ...string) *StringSliceCmd + SUnionCard(ctx context.Context, opts *SUnionCardOptions, keys ...string) *IntCmd SUnionStore(ctx context.Context, destination string, keys ...string) *IntCmd } +// SUnionCardOptions are the options for SUnionCard. +type SUnionCardOptions struct { + Approx bool // use an approximate (HyperLogLog) count. + Limit int64 // cap the result; 0 means no limit. +} + +// SDiffCardOptions are the options for SDiffCard. +type SDiffCardOptions struct { + Limit int64 // cap the result; 0 means no limit. +} + // Returns the number of elements that were added to the set, not including all // the elements already present in the set. // @@ -96,6 +109,30 @@ func (c cmdable) SDiffStore(ctx context.Context, destination string, keys ...str return cmd } +// Returns the cardinality of the difference of the first set and the rest. +// Missing keys are treated as empty sets. +// +// For more information about the command please refer to [SDIFFCARD]. +// +// [SDIFFCARD]: (https://redis.io/docs/latest/commands/sdiffcard/) +func (c cmdable) SDiffCard(ctx context.Context, opts *SDiffCardOptions, keys ...string) *IntCmd { + if opts == nil { + opts = &SDiffCardOptions{} + } + numKeys := len(keys) + args := make([]interface{}, 0, 4+numKeys) + args = append(args, "sdiffcard", numKeys) + for _, key := range keys { + args = append(args, key) + } + args = append(args, "limit", opts.Limit) + cmd := NewIntCmd(ctx, args...) + // Keys start after the numkeys arg: ["sdiffcard", numKeys, key1, ...]. + cmd.SetFirstKeyPos(2) + _ = c(ctx, cmd) + return cmd +} + // Returns the members of the set resulting from the intersection of all the given sets. // Keys that do not exist are considered to be empty sets. // With one of the keys being an empty set, the resulting set is also empty. @@ -328,6 +365,33 @@ func (c cmdable) SUnionStore(ctx context.Context, destination string, keys ...st return cmd } +// Returns the cardinality of the union of all the given sets. +// Missing keys are treated as empty sets. +// +// For more information about the command please refer to [SUNIONCARD]. +// +// [SUNIONCARD]: (https://redis.io/docs/latest/commands/sunioncard/) +func (c cmdable) SUnionCard(ctx context.Context, opts *SUnionCardOptions, keys ...string) *IntCmd { + if opts == nil { + opts = &SUnionCardOptions{} + } + numKeys := len(keys) + args := make([]interface{}, 0, 4+numKeys+1) + args = append(args, "sunioncard", numKeys) + for _, key := range keys { + args = append(args, key) + } + if opts.Approx { + args = append(args, "approx") + } + args = append(args, "limit", opts.Limit) + cmd := NewIntCmd(ctx, args...) + // Keys start after the numkeys arg: ["sunioncard", numKeys, key1, ...]. + cmd.SetFirstKeyPos(2) + _ = c(ctx, cmd) + return cmd +} + // Incrementally iterates the set elements stored at key. // This is a cursor-based iterator that allows scanning large sets efficiently. // diff --git a/vendor/github.com/redis/go-redis/v9/stream_commands.go b/vendor/github.com/redis/go-redis/v9/stream_commands.go index e2b2a9e2f..95531eb1b 100644 --- a/vendor/github.com/redis/go-redis/v9/stream_commands.go +++ b/vendor/github.com/redis/go-redis/v9/stream_commands.go @@ -227,14 +227,16 @@ func (c cmdable) XRevRangeN(ctx context.Context, stream, start, stop string, cou } type XReadArgs struct { - Streams []string // list of streams and ids, e.g. stream1 stream2 id1 id2 - Count int64 - Block time.Duration - ID string + Streams []string // list of streams and ids, e.g. stream1 stream2 id1 id2 + Count int64 + MaxCount int64 // cumulative cap on total entries across all streams (Redis >= 8.10) + MaxSize int64 // soft cumulative cap on total reply size in bytes across all streams (Redis >= 8.10) + Block time.Duration + ID string } func (c cmdable) XRead(ctx context.Context, a *XReadArgs) *XStreamSliceCmd { - args := make([]interface{}, 0, 2*len(a.Streams)+6) + args := make([]interface{}, 0, 2*len(a.Streams)+10) args = append(args, "xread") keyPos := int8(1) @@ -243,6 +245,14 @@ func (c cmdable) XRead(ctx context.Context, a *XReadArgs) *XStreamSliceCmd { args = append(args, a.Count) keyPos += 2 } + if a.MaxCount > 0 { + args = append(args, "maxcount", a.MaxCount) + keyPos += 2 + } + if a.MaxSize > 0 { + args = append(args, "maxsize", a.MaxSize) + keyPos += 2 + } if a.Block >= 0 { args = append(args, "block") args = append(args, int64(a.Block/time.Millisecond)) @@ -322,13 +332,15 @@ type XReadGroupArgs struct { Consumer string Streams []string // list of streams and ids, e.g. stream1 stream2 id1 id2 Count int64 + MaxCount int64 // cumulative cap on total entries across all streams (Redis >= 8.10) + MaxSize int64 // soft cumulative cap on total reply size in bytes across all streams (Redis >= 8.10) Block time.Duration NoAck bool Claim time.Duration // Claim idle pending entries older than this duration } func (c cmdable) XReadGroup(ctx context.Context, a *XReadGroupArgs) *XStreamSliceCmd { - args := make([]interface{}, 0, 10+len(a.Streams)) + args := make([]interface{}, 0, 14+len(a.Streams)) args = append(args, "xreadgroup", "group", a.Group, a.Consumer) keyPos := int8(4) @@ -336,6 +348,14 @@ func (c cmdable) XReadGroup(ctx context.Context, a *XReadGroupArgs) *XStreamSlic args = append(args, "count", a.Count) keyPos += 2 } + if a.MaxCount > 0 { + args = append(args, "maxcount", a.MaxCount) + keyPos += 2 + } + if a.MaxSize > 0 { + args = append(args, "maxsize", a.MaxSize) + keyPos += 2 + } if a.Block >= 0 { args = append(args, "block", int64(a.Block/time.Millisecond)) keyPos += 2 @@ -361,8 +381,15 @@ func (c cmdable) XReadGroup(ctx context.Context, a *XReadGroupArgs) *XStreamSlic cmd.SetFirstKeyPos(keyPos) _ = c(ctx, cmd) - // Record stream lag for each message (if command succeeded) - if cmd.Err() == nil { + // Record stream lag for each message (if command succeeded). Gated on the + // result being readable WITHOUT blocking: this command carries a + // read-timeout marker, so on the deferred autopipeline face it is diverted + // and still running when we get here — and the default Block: 0 form can + // wait indefinitely for messages, so reading the outcome would block the + // submit call instead of returning a future (review finding by codex on + // #3942). Skipped for a submission that has not executed yet; emitting + // this from the execution path is a follow-up in the OTel wiring. + if otel.Enabled() && cmd.resultReady() && cmd.rawErr() == nil { streams := cmd.Val() for _, stream := range streams { for _, msg := range stream.Messages { diff --git a/vendor/github.com/redis/go-redis/v9/string_commands.go b/vendor/github.com/redis/go-redis/v9/string_commands.go index 6731c09f5..3c50715ba 100644 --- a/vendor/github.com/redis/go-redis/v9/string_commands.go +++ b/vendor/github.com/redis/go-redis/v9/string_commands.go @@ -194,6 +194,12 @@ func (c cmdable) GetDel(ctx context.Context, key string) *StringCmd { // (including redis.Nil when the key does not exist) via Err(). If buf is too // small to hold the value, Err() returns a "buffer too small" error. // +// Nothing is ever written past len(buf). When len(buf) >= value length + 2, +// the read takes a fast path that pulls the payload and the protocol's +// trailing CRLF in a single socket read, using the two bytes after the +// payload as scratch — size buffers with 2 spare bytes to opt in (see +// example/zerocopy-buffer). +// // This command opts out of automatic retries because partial data from a // failed attempt would already be sitting in the caller's buffer. func (c cmdable) GetToBuffer(ctx context.Context, key string, buf []byte) *ZeroCopyStringCmd { diff --git a/vendor/github.com/redis/go-redis/v9/timeseries_commands.go b/vendor/github.com/redis/go-redis/v9/timeseries_commands.go index db00db80f..673e0e574 100644 --- a/vendor/github.com/redis/go-redis/v9/timeseries_commands.go +++ b/vendor/github.com/redis/go-redis/v9/timeseries_commands.go @@ -5,6 +5,7 @@ import ( "errors" "fmt" "strings" + "time" "github.com/redis/go-redis/v9/internal/proto" "github.com/redis/go-redis/v9/internal/util" @@ -30,6 +31,8 @@ type TimeseriesCmdable interface { TSInfoWithArgs(ctx context.Context, key string, options *TSInfoOptions) *MapStringInterfaceCmd TSMAdd(ctx context.Context, ktvSlices [][]interface{}) *IntSliceCmd TSQueryIndex(ctx context.Context, filterExpr []string) *StringSliceCmd + TSQueryLabels(ctx context.Context, filterExpr []string) *StringSliceCmd + TSQueryLabelValues(ctx context.Context, label string, filterExpr []string) *StringSliceCmd TSRevRange(ctx context.Context, key string, fromTimestamp int, toTimestamp int) *TSTimestampValueSliceCmd TSRevRangeWithArgs(ctx context.Context, key string, fromTimestamp int, toTimestamp int, options *TSRevRangeOptions) *TSTimestampValueSliceCmd TSRange(ctx context.Context, key string, fromTimestamp int, toTimestamp int) *TSTimestampValueSliceCmd @@ -40,6 +43,27 @@ type TimeseriesCmdable interface { TSMRevRangeWithArgs(ctx context.Context, fromTimestamp int, toTimestamp int, filterExpr []string, options *TSMRevRangeOptions) *MapStringSliceInterfaceCmd TSMGet(ctx context.Context, filters []string) *MapStringSliceInterfaceCmd TSMGetWithArgs(ctx context.Context, filters []string, options *TSMGetOptions) *MapStringSliceInterfaceCmd + TSNRange(ctx context.Context, keys []string, fromTimestamp interface{}, toTimestamp interface{}) *TSNRangePivotRowSliceCmd + TSNRangeWithArgs(ctx context.Context, keys []string, fromTimestamp interface{}, toTimestamp interface{}, options *TSNRangeOptions) *TSNRangePivotRowSliceCmd + TSNRevRange(ctx context.Context, keys []string, fromTimestamp interface{}, toTimestamp interface{}) *TSNRangePivotRowSliceCmd + TSNRevRangeWithArgs(ctx context.Context, keys []string, fromTimestamp interface{}, toTimestamp interface{}, options *TSNRevRangeOptions) *TSNRangePivotRowSliceCmd + TSRead(ctx context.Context, key string, timestamp interface{}) *TSTimestampValueSliceCmd + TSReadWithArgs(ctx context.Context, key string, timestamp interface{}, options *TSReadOptions) *TSTimestampValueSliceCmd +} + +// TS.READ timestamp cursor sentinels. +const ( + TSReadEarliest = "-" // read from the earliest sample + TSReadLatest = "+" // latest sample, inclusive + TSReadNew = "$" // only samples added after the call +) + +// TSReadOptions holds the optional TS.READ arguments. +type TSReadOptions struct { + Block bool // wait for samples (emits the BLOCK group) + Timeout time.Duration // max wait; 0 blocks indefinitely + MinCount int // unblock threshold; defaults to 1 + MaxCount int // reply cap; 0 is unlimited } type TSOptions struct { @@ -145,6 +169,7 @@ func (a Aggregator) String() string { var ( errTSMultiAggregationGroupBy = errors.New("redis: GROUPBY is not allowed when multiple aggregators are specified") errTSAggregationConflict = errors.New("redis: setting both Aggregator and Aggregators is not allowed; use Aggregators instead because Aggregator is deprecated") + errTSExcludeEmptyGroupBy = errors.New("redis: EXCLUDEEMPTY is not allowed with GROUPBY") ) func formatAggregationArgs(aggregator Aggregator, aggregators []Aggregator) (string, int, error) { @@ -227,8 +252,10 @@ type TSMRangeOptions struct { BucketDuration int BucketTimestamp interface{} Empty bool - GroupByLabel interface{} - Reducer interface{} + // ExcludeEmpty omits matching series that have no samples. Not allowed with GroupByLabel/Reducer. Redis 8.10+. + ExcludeEmpty bool + GroupByLabel interface{} + Reducer interface{} } type TSMRevRangeOptions struct { @@ -245,8 +272,10 @@ type TSMRevRangeOptions struct { BucketDuration int BucketTimestamp interface{} Empty bool - GroupByLabel interface{} - Reducer interface{} + // ExcludeEmpty omits matching series that have no samples. Not allowed with GroupByLabel/Reducer. Redis 8.10+. + ExcludeEmpty bool + GroupByLabel interface{} + Reducer interface{} } type TSMGetOptions struct { @@ -255,6 +284,36 @@ type TSMGetOptions struct { SelectedLabels []interface{} } +type TSNRangeOptions struct { + Latest bool + FilterByTS []int + FilterByValue []float64 // exactly two elements: [min, max] + Count int + Align interface{} + // Aggregators holds exactly one aggregator spec per key. Each spec lists one or + // more aggregators applied to that key and is sent as a single comma-joined token + // (e.g. {{Min, Max}, {Sum}} -> AGGREGATION MIN,MAX SUM ). + Aggregators [][]Aggregator + BucketDuration int + BucketTimestamp interface{} + Empty bool +} + +type TSNRevRangeOptions struct { + Latest bool + FilterByTS []int + FilterByValue []float64 // exactly two elements: [min, max] + Count int + Align interface{} + // Aggregators holds exactly one aggregator spec per key. Each spec lists one or + // more aggregators applied to that key and is sent as a single comma-joined token + // (e.g. {{Min, Max}, {Sum}} -> AGGREGATION MIN,MAX SUM ). + Aggregators [][]Aggregator + BucketDuration int + BucketTimestamp interface{} + Empty bool +} + // TSAdd - Adds one or more observations to a t-digest sketch. // For more information - https://redis.io/commands/ts.add/ func (c cmdable) TSAdd(ctx context.Context, key string, timestamp interface{}, value float64) *IntCmd { @@ -563,6 +622,7 @@ func newTSTimestampValueCmd(ctx context.Context, args ...interface{}) *TSTimesta } func (cmd *TSTimestampValueCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -571,10 +631,12 @@ func (cmd *TSTimestampValueCmd) SetVal(val TSTimestampValue) { } func (cmd *TSTimestampValueCmd) Result() (TSTimestampValue, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *TSTimestampValueCmd) Val() TSTimestampValue { + cmd.await() return cmd.val } @@ -666,6 +728,53 @@ func (c cmdable) TSQueryIndex(ctx context.Context, filterExpr []string) *StringS return cmd } +// TSQueryLabels - Returns the set of label names present on the time series +// matching the filter expressions. Passing no filter expressions queries all +// indexed series. The reply is unordered and already deduplicated by the +// server; it includes the label names used in the filter itself, and an +// empty reply is a valid result, not an error. +// filterExpr uses the same filter language as TSQueryIndex and is passed to +// the server verbatim. Available since Redis 8.10. +// For more information - https://redis.io/commands/ts.querylabels/ +func (c cmdable) TSQueryLabels(ctx context.Context, filterExpr []string) *StringSliceCmd { + args := []interface{}{"TS.QUERYLABELS", "LABELS"} + args = appendTSFilter(args, filterExpr) + cmd := NewStringSliceCmd(ctx, args...) + _ = c(ctx, cmd) + return cmd +} + +// TSQueryLabelValues - Returns the set of values assigned to the given label +// name across the time series matching the filter expressions. Passing no +// filter expressions queries all indexed series. The label name is matched +// byte-exactly; a label present on no matching series yields an empty reply, +// not an error. The reply is unordered and already deduplicated by the +// server. +// filterExpr uses the same filter language as TSQueryIndex and is passed to +// the server verbatim. Available since Redis 8.10. +// For more information - https://redis.io/commands/ts.querylabels/ +func (c cmdable) TSQueryLabelValues(ctx context.Context, label string, filterExpr []string) *StringSliceCmd { + args := []interface{}{"TS.QUERYLABELS", "VALUES", label} + args = appendTSFilter(args, filterExpr) + cmd := NewStringSliceCmd(ctx, args...) + _ = c(ctx, cmd) + return cmd +} + +// appendTSFilter appends the FILTER token followed by the filter expressions, +// or nothing when no expressions are given: the server rejects a bare FILTER +// token, and omitting it is the documented way to query all indexed series. +func appendTSFilter(args []interface{}, filterExpr []string) []interface{} { + if len(filterExpr) == 0 { + return args + } + args = append(args, "FILTER") + for _, f := range filterExpr { + args = append(args, f) + } + return args +} + // TSRevRange - Returns a range of samples from a time-series key in reverse order. // For more information - https://redis.io/commands/ts.revrange/ func (c cmdable) TSRevRange(ctx context.Context, key string, fromTimestamp int, toTimestamp int) *TSTimestampValueSliceCmd { @@ -790,6 +899,47 @@ func (c cmdable) TSRangeWithArgs(ctx context.Context, key string, fromTimestamp return cmd } +// TSRead - Returns samples at or after timestamp, in ascending order. +// timestamp is a non-negative Unix-ms integer or a sentinel (TSReadEarliest, +// TSReadLatest, TSReadNew). +// For more information - https://redis.io/commands/ts.read/ +func (c cmdable) TSRead(ctx context.Context, key string, timestamp interface{}) *TSTimestampValueSliceCmd { + args := []interface{}{"TS.READ", key, timestamp} + cmd := newTSTimestampValueSliceCmd(ctx, args...) + _ = c(ctx, cmd) + return cmd +} + +// TSReadWithArgs - TS.READ with the optional BLOCK and MAX_COUNT groups. +// When options.Block is set it waits for options.MinCount samples or until +// options.Timeout elapses. Blocking calls must not be used in a pipeline or MULTI. +// For more information - https://redis.io/commands/ts.read/ +func (c cmdable) TSReadWithArgs(ctx context.Context, key string, timestamp interface{}, options *TSReadOptions) *TSTimestampValueSliceCmd { + args := []interface{}{"TS.READ", key, timestamp} + blocking := false + var blockTimeout time.Duration + if options != nil { + if options.Block { + blocking = true + blockTimeout = options.Timeout + minCount := options.MinCount + if minCount <= 0 { + minCount = 1 + } + args = append(args, "BLOCK", formatMs(ctx, options.Timeout), minCount) + } + if options.MaxCount != 0 { + args = append(args, "MAX_COUNT", options.MaxCount) + } + } + cmd := newTSTimestampValueSliceCmd(ctx, args...) + if blocking { + cmd.setReadTimeout(blockTimeout) + } + _ = c(ctx, cmd) + return cmd +} + type TSTimestampValueSliceCmd struct { baseCmd val []TSTimestampValue @@ -806,6 +956,7 @@ func newTSTimestampValueSliceCmd(ctx context.Context, args ...interface{}) *TSTi } func (cmd *TSTimestampValueSliceCmd) String() string { + cmd.await() return cmdString(cmd, cmd.val) } @@ -814,10 +965,12 @@ func (cmd *TSTimestampValueSliceCmd) SetVal(val []TSTimestampValue) { } func (cmd *TSTimestampValueSliceCmd) Result() ([]TSTimestampValue, error) { + cmd.await() return cmd.val, cmd.err } func (cmd *TSTimestampValueSliceCmd) Val() []TSTimestampValue { + cmd.await() return cmd.val } @@ -896,11 +1049,8 @@ func (c cmdable) TSMRange(ctx context.Context, fromTimestamp int, toTimestamp in return cmd } -// TSMRangeWithArgs - Returns a range of samples from multiple time-series keys with additional options. -// This function allows for specifying additional options such as: -// Latest, FilterByTS, FilterByValue, WithLabels, SelectedLabels, -// Count, Align, Aggregator, BucketDuration, BucketTimestamp, -// Empty, GroupByLabel and Reducer. +// TSMRangeWithArgs - Returns a range of samples from multiple time-series keys. +// Options are set via TSMRangeOptions. // For more information - https://redis.io/commands/ts.mrange/ func (c cmdable) TSMRangeWithArgs(ctx context.Context, fromTimestamp int, toTimestamp int, filterExpr []string, options *TSMRangeOptions) *MapStringSliceInterfaceCmd { args := []interface{}{"TS.MRANGE", fromTimestamp, toTimestamp} @@ -953,12 +1103,20 @@ func (c cmdable) TSMRangeWithArgs(ctx context.Context, fromTimestamp int, toTime if options.Empty { args = append(args, "EMPTY") } + if options.ExcludeEmpty { + args = append(args, "EXCLUDEEMPTY") + } } args = append(args, "FILTER") for _, f := range filterExpr { args = append(args, f) } if options != nil { + if options.ExcludeEmpty && (options.GroupByLabel != nil || options.Reducer != nil) { + cmd := NewMapStringSliceInterfaceCmd(ctx, args...) + cmd.SetErr(errTSExcludeEmptyGroupBy) + return cmd + } if multiAggregationCount > 1 && (options.GroupByLabel != nil || options.Reducer != nil) { cmd := NewMapStringSliceInterfaceCmd(ctx, args...) cmd.SetErr(errTSMultiAggregationGroupBy) @@ -988,11 +1146,8 @@ func (c cmdable) TSMRevRange(ctx context.Context, fromTimestamp int, toTimestamp return cmd } -// TSMRevRangeWithArgs - Returns a range of samples from multiple time-series keys in reverse order with additional options. -// This function allows for specifying additional options such as: -// Latest, FilterByTS, FilterByValue, WithLabels, SelectedLabels, -// Count, Align, Aggregator, BucketDuration, BucketTimestamp, -// Empty, GroupByLabel and Reducer. +// TSMRevRangeWithArgs - Returns a range of samples from multiple time-series keys in reverse order. +// Options are set via TSMRevRangeOptions. // For more information - https://redis.io/commands/ts.mrevrange/ func (c cmdable) TSMRevRangeWithArgs(ctx context.Context, fromTimestamp int, toTimestamp int, filterExpr []string, options *TSMRevRangeOptions) *MapStringSliceInterfaceCmd { args := []interface{}{"TS.MREVRANGE", fromTimestamp, toTimestamp} @@ -1045,12 +1200,20 @@ func (c cmdable) TSMRevRangeWithArgs(ctx context.Context, fromTimestamp int, toT if options.Empty { args = append(args, "EMPTY") } + if options.ExcludeEmpty { + args = append(args, "EXCLUDEEMPTY") + } } args = append(args, "FILTER") for _, f := range filterExpr { args = append(args, f) } if options != nil { + if options.ExcludeEmpty && (options.GroupByLabel != nil || options.Reducer != nil) { + cmd := NewMapStringSliceInterfaceCmd(ctx, args...) + cmd.SetErr(errTSExcludeEmptyGroupBy) + return cmd + } if multiAggregationCount > 1 && (options.GroupByLabel != nil || options.Reducer != nil) { cmd := NewMapStringSliceInterfaceCmd(ctx, args...) cmd.SetErr(errTSMultiAggregationGroupBy) @@ -1106,3 +1269,279 @@ func (c cmdable) TSMGetWithArgs(ctx context.Context, filters []string, options * _ = c(ctx, cmd) return cmd } + +// TSNRangePivotRow represents a single row in the pivot response from TS.NRANGE / TS.NREVRANGE. +// Timestamp is the row's timestamp. Without aggregation, Values holds one float64 per input key +// in input-key order. With aggregation, Values holds one float64 per requested (key, aggregator) +// pair, flattened in input-key order with each key's aggregators in spec order. +// Missing samples and missing aggregation buckets are represented as NaN. +type TSNRangePivotRow struct { + Timestamp int64 + Values []float64 +} + +type TSNRangePivotRowSliceCmd struct { + baseCmd + val []TSNRangePivotRow +} + +func newTSNRangePivotRowSliceCmd(ctx context.Context, args ...interface{}) *TSNRangePivotRowSliceCmd { + return &TSNRangePivotRowSliceCmd{ + baseCmd: baseCmd{ + ctx: ctx, + args: args, + cmdType: CmdTypeTSNRangePivotRowSlice, + }, + } +} + +func (cmd *TSNRangePivotRowSliceCmd) String() string { + cmd.await() + return cmdString(cmd, cmd.val) +} + +func (cmd *TSNRangePivotRowSliceCmd) SetVal(val []TSNRangePivotRow) { + cmd.val = val +} + +func (cmd *TSNRangePivotRowSliceCmd) Result() ([]TSNRangePivotRow, error) { + cmd.await() + return cmd.val, cmd.err +} + +func (cmd *TSNRangePivotRowSliceCmd) Val() []TSNRangePivotRow { + cmd.await() + return cmd.val +} + +func (cmd *TSNRangePivotRowSliceCmd) readReply(rd *proto.Reader) error { + n, err := rd.ReadArrayLen() + if err != nil { + return err + } + cmd.val = make([]TSNRangePivotRow, n) + for i := 0; i < n; i++ { + // Each row is a 2-element array: [timestamp, [value_0, value_1, ...]] + if _, err = rd.ReadArrayLen(); err != nil { + return err + } + timestamp, err := rd.ReadInt() + if err != nil { + return err + } + cmd.val[i].Timestamp = timestamp + + valCount, err := rd.ReadArrayLen() + if err != nil { + return err + } + cmd.val[i].Values = make([]float64, valCount) + for j := 0; j < valCount; j++ { + s, err := rd.ReadString() + if err != nil { + return err + } + cmd.val[i].Values[j], err = util.ParseStringToFloat(s) + if err != nil { + return err + } + } + } + return nil +} + +func (cmd *TSNRangePivotRowSliceCmd) Clone() Cmder { + var val []TSNRangePivotRow + if cmd.val != nil { + val = make([]TSNRangePivotRow, len(cmd.val)) + copy(val, cmd.val) + for i := range cmd.val { + if cmd.val[i].Values != nil { + val[i].Values = make([]float64, len(cmd.val[i].Values)) + copy(val[i].Values, cmd.val[i].Values) + } + } + } + return &TSNRangePivotRowSliceCmd{ + baseCmd: cmd.cloneBaseCmd(), + val: val, + } +} + +// buildNRangeAggregationArgs validates and returns one aggregator spec string per key for +// TS.NRANGE / TS.NREVRANGE. The number of specs must equal the number of keys. Each spec +// lists one or more aggregators for its key and is emitted as a single comma-joined wire +// token; specs for different keys are separate wire tokens. +func buildNRangeAggregationArgs(keys []string, aggregators [][]Aggregator) ([]string, error) { + if len(aggregators) != len(keys) { + return nil, fmt.Errorf("redis: TS.NRANGE/TS.NREVRANGE requires exactly %d aggregator spec(s), got %d", len(keys), len(aggregators)) + } + parts := make([]string, len(aggregators)) + for i, spec := range aggregators { + if len(spec) == 0 { + return nil, fmt.Errorf("redis: empty timeseries aggregator spec at index %d", i) + } + names := make([]string, len(spec)) + for j, agg := range spec { + if agg == Invalid { + return nil, fmt.Errorf("redis: invalid timeseries aggregator at index %d[%d]: Invalid (%d)", i, j, agg) + } + s := agg.String() + if s == "" { + return nil, fmt.Errorf("redis: invalid timeseries aggregator at index %d[%d]: %d", i, j, agg) + } + names[j] = s + } + parts[i] = strings.Join(names, ",") + } + return parts, nil +} + +// appendNRangeOptions appends optional TS.NRANGE / TS.NREVRANGE arguments to args. +func appendNRangeOptions( + args []interface{}, + keys []string, + latest bool, + filterByTS []int, + filterByValue []float64, + count int, + align interface{}, + aggregators [][]Aggregator, + bucketDuration int, + bucketTimestamp interface{}, + empty bool, +) ([]interface{}, error) { + if latest { + args = append(args, "LATEST") + } + if len(filterByTS) > 0 { + args = append(args, "FILTER_BY_TS") + for _, ts := range filterByTS { + args = append(args, ts) + } + } + if len(filterByValue) > 0 { + if len(filterByValue) != 2 { + return args, fmt.Errorf("redis: FILTER_BY_VALUE requires exactly 2 elements [min, max], got %d", len(filterByValue)) + } + args = append(args, "FILTER_BY_VALUE", filterByValue[0], filterByValue[1]) + } + if count != 0 { + args = append(args, "COUNT", count) + } + if align != nil { + args = append(args, "ALIGN", align) + } + if len(aggregators) > 0 { + aggParts, err := buildNRangeAggregationArgs(keys, aggregators) + if err != nil { + return args, err + } + args = append(args, "AGGREGATION") + for _, a := range aggParts { + args = append(args, a) + } + if bucketDuration != 0 { + args = append(args, bucketDuration) + } + if bucketTimestamp != nil { + args = append(args, "BUCKETTIMESTAMP", bucketTimestamp) + } + if empty { + args = append(args, "EMPTY") + } + } + return args, nil +} + +// TSNRange - Queries multiple time-series keys and returns a pivot response in forward (ascending) order. +// For more information - https://redis.io/commands/ts.nrange/ +func (c cmdable) TSNRange(ctx context.Context, keys []string, fromTimestamp interface{}, toTimestamp interface{}) *TSNRangePivotRowSliceCmd { + args := make([]interface{}, 0, 3+len(keys)) + args = append(args, "TS.NRANGE", len(keys)) + for _, k := range keys { + args = append(args, k) + } + args = append(args, fromTimestamp, toTimestamp) + cmd := newTSNRangePivotRowSliceCmd(ctx, args...) + cmd.SetFirstKeyPos(2) + _ = c(ctx, cmd) + return cmd +} + +// TSNRangeWithArgs - Queries multiple time-series keys and returns a pivot response in forward (ascending) order with additional options. +// This function allows for specifying additional options such as: +// Latest, FilterByTS, FilterByValue, Count, Align, Aggregators, BucketDuration, BucketTimestamp and Empty. +// Aggregators must contain exactly one spec per key; each spec lists one or more aggregators +// for its key and is emitted as a single comma-joined wire token. +// For more information - https://redis.io/commands/ts.nrange/ +func (c cmdable) TSNRangeWithArgs(ctx context.Context, keys []string, fromTimestamp interface{}, toTimestamp interface{}, options *TSNRangeOptions) *TSNRangePivotRowSliceCmd { + args := make([]interface{}, 0, 3+len(keys)) + args = append(args, "TS.NRANGE", len(keys)) + for _, k := range keys { + args = append(args, k) + } + args = append(args, fromTimestamp, toTimestamp) + if options != nil { + var err error + args, err = appendNRangeOptions(args, keys, + options.Latest, options.FilterByTS, options.FilterByValue, + options.Count, options.Align, options.Aggregators, + options.BucketDuration, options.BucketTimestamp, options.Empty) + if err != nil { + cmd := newTSNRangePivotRowSliceCmd(ctx, args...) + cmd.SetErr(err) + return cmd + } + } + cmd := newTSNRangePivotRowSliceCmd(ctx, args...) + cmd.SetFirstKeyPos(2) + _ = c(ctx, cmd) + return cmd +} + +// TSNRevRange - Queries multiple time-series keys and returns a pivot response in reverse (descending) order. +// For more information - https://redis.io/commands/ts.nrevrange/ +func (c cmdable) TSNRevRange(ctx context.Context, keys []string, fromTimestamp interface{}, toTimestamp interface{}) *TSNRangePivotRowSliceCmd { + args := make([]interface{}, 0, 3+len(keys)) + args = append(args, "TS.NREVRANGE", len(keys)) + for _, k := range keys { + args = append(args, k) + } + args = append(args, fromTimestamp, toTimestamp) + cmd := newTSNRangePivotRowSliceCmd(ctx, args...) + cmd.SetFirstKeyPos(2) + _ = c(ctx, cmd) + return cmd +} + +// TSNRevRangeWithArgs - Queries multiple time-series keys and returns a pivot response in reverse (descending) order with additional options. +// This function allows for specifying additional options such as: +// Latest, FilterByTS, FilterByValue, Count, Align, Aggregators, BucketDuration, BucketTimestamp and Empty. +// Aggregators must contain exactly one spec per key; each spec lists one or more aggregators +// for its key and is emitted as a single comma-joined wire token. +// For more information - https://redis.io/commands/ts.nrevrange/ +func (c cmdable) TSNRevRangeWithArgs(ctx context.Context, keys []string, fromTimestamp interface{}, toTimestamp interface{}, options *TSNRevRangeOptions) *TSNRangePivotRowSliceCmd { + args := make([]interface{}, 0, 3+len(keys)) + args = append(args, "TS.NREVRANGE", len(keys)) + for _, k := range keys { + args = append(args, k) + } + args = append(args, fromTimestamp, toTimestamp) + if options != nil { + var err error + args, err = appendNRangeOptions(args, keys, + options.Latest, options.FilterByTS, options.FilterByValue, + options.Count, options.Align, options.Aggregators, + options.BucketDuration, options.BucketTimestamp, options.Empty) + if err != nil { + cmd := newTSNRangePivotRowSliceCmd(ctx, args...) + cmd.SetErr(err) + return cmd + } + } + cmd := newTSNRangePivotRowSliceCmd(ctx, args...) + cmd.SetFirstKeyPos(2) + _ = c(ctx, cmd) + return cmd +} diff --git a/vendor/github.com/redis/go-redis/v9/tx.go b/vendor/github.com/redis/go-redis/v9/tx.go index 179230e30..0e4e33dac 100644 --- a/vendor/github.com/redis/go-redis/v9/tx.go +++ b/vendor/github.com/redis/go-redis/v9/tx.go @@ -4,7 +4,6 @@ import ( "context" "errors" - "github.com/redis/go-redis/v9/internal/pool" "github.com/redis/go-redis/v9/internal/proto" ) @@ -44,10 +43,20 @@ func (c *Client) newTx() *Tx { tx := Tx{ baseClient: baseClient{ opt: c.cloneOpt(), // Clone options under optLock to avoid race with initConn - connPool: pool.NewStickyConnPool(c.connPool), + connPool: c.baseClient.newStickyConnPool(), hooksMixin: c.hooksMixin.clone(), pushProcessor: c.pushProcessor, // Copy push processor from parent client onClose: &onCloseHooks{}, + // Share the HIMPORT fieldset registry: the sticky pool borrows + // connections from the parent client's pool, so fieldsets + // prepared on them stay valid after the connections are + // returned. + himport: c.himport, + // Carry the shared eviction hook (not csc: a sticky Tx must not serve + // cached reads) so close/reinit hooks on a Watch-initialized conn still + // evict from the parent cache. + cscPoolHook: c.cscPoolHook, + cscActive: c.cscActive, }, } tx.init() diff --git a/vendor/github.com/redis/go-redis/v9/universal.go b/vendor/github.com/redis/go-redis/v9/universal.go index b623460cb..40f72ac55 100644 --- a/vendor/github.com/redis/go-redis/v9/universal.go +++ b/vendor/github.com/redis/go-redis/v9/universal.go @@ -149,8 +149,31 @@ type UniversalOptions struct { // IsClusterMode can be used when only one Addrs is provided (e.g. Elasticache supports setting up cluster mode with configuration endpoint). IsClusterMode bool + // AutoPipelineOptions is the default config for the client's + // autopipeliner faces (AutoPipeline / AsyncAutoPipeline), applied when + // they are called without explicit options. See Options.AutoPipelineOptions. + AutoPipelineOptions *AutoPipelineOptions + // MaintNotificationsConfig provides configuration for maintnotifications upgrades. MaintNotificationsConfig *maintnotifications.Config + + // ClientSideCacheConfig enables client-side caching when NewUniversalClient + // selects a standalone Client. See Options.ClientSideCacheConfig. + // + // Experimental: this API may change in a minor release. + ClientSideCacheConfig *ClientSideCacheConfig + + // ClientSideCache supplies an explicit cache when NewUniversalClient selects + // a standalone Client. See Options.ClientSideCache. + // + // Experimental: this API may change in a minor release. + ClientSideCache Cache + + // ClientSideCacheStrategy selects the standalone client's invalidation + // strategy. See Options.ClientSideCacheStrategy. + // + // Experimental: this API may change in a minor release. + ClientSideCacheStrategy CSCStrategy } // Cluster returns cluster options created from the universal options. @@ -208,6 +231,7 @@ func (o *UniversalOptions) Cluster() *ClusterOptions { DisableIdentity: o.DisableIdentity, DisableIndentity: o.DisableIndentity, IdentitySuffix: o.IdentitySuffix, + AutoPipelineOptions: o.AutoPipelineOptions, FailingTimeoutSeconds: o.FailingTimeoutSeconds, UnstableResp3: o.UnstableResp3, PushNotificationProcessor: o.PushNotificationProcessor, @@ -276,6 +300,7 @@ func (o *UniversalOptions) Failover() *FailoverOptions { DisableIdentity: o.DisableIdentity, DisableIndentity: o.DisableIndentity, IdentitySuffix: o.IdentitySuffix, + AutoPipelineOptions: o.AutoPipelineOptions, UnstableResp3: o.UnstableResp3, PushNotificationProcessor: o.PushNotificationProcessor, // Note: MaintNotificationsConfig not supported for FailoverOptions @@ -334,9 +359,13 @@ func (o *UniversalOptions) Simple() *Options { DisableIdentity: o.DisableIdentity, DisableIndentity: o.DisableIndentity, IdentitySuffix: o.IdentitySuffix, + AutoPipelineOptions: o.AutoPipelineOptions, UnstableResp3: o.UnstableResp3, PushNotificationProcessor: o.PushNotificationProcessor, MaintNotificationsConfig: o.MaintNotificationsConfig, + ClientSideCacheConfig: o.ClientSideCacheConfig, + ClientSideCache: o.ClientSideCache, + ClientSideCacheStrategy: o.ClientSideCacheStrategy, } } @@ -352,6 +381,15 @@ type UniversalClient interface { Watch(ctx context.Context, fn func(*Tx) error, keys ...string) error Do(ctx context.Context, args ...interface{}) *Cmd Process(ctx context.Context, cmd Cmder) error + // AutoPipeline / AsyncAutoPipeline return an AutoPipeliner for the concrete + // client. Supported on *Client (including sentinel-backed failover clients) + // and *ClusterClient; *Ring returns an error (not supported). + // + // EXPERIMENTAL: this API is subject to change, use with caution. + AutoPipeline() (*AutoPipeliner, error) + AutoPipelineWithOptions(config *AutoPipelineOptions) (*AutoPipeliner, error) + AsyncAutoPipeline() (*AutoPipeliner, error) + AsyncAutoPipelineWithOptions(config *AutoPipelineOptions) (*AutoPipeliner, error) Subscribe(ctx context.Context, channels ...string) *PubSub PSubscribe(ctx context.Context, channels ...string) *PubSub SSubscribe(ctx context.Context, channels ...string) *PubSub @@ -363,6 +401,9 @@ var ( _ UniversalClient = (*Client)(nil) _ UniversalClient = (*ClusterClient)(nil) _ UniversalClient = (*Ring)(nil) + // AutoPipeliner is a drop-in for the real clients; non-data operations + // delegate to the underlying client. + _ UniversalClient = (*AutoPipeliner)(nil) ) // NewUniversalClient returns a new multi client. The type of the returned client depends diff --git a/vendor/github.com/redis/go-redis/v9/version.go b/vendor/github.com/redis/go-redis/v9/version.go index c6cabc694..9ce635e13 100644 --- a/vendor/github.com/redis/go-redis/v9/version.go +++ b/vendor/github.com/redis/go-redis/v9/version.go @@ -2,5 +2,5 @@ package redis // Version is the current release version. func Version() string { - return "9.21.0" + return "9.22.0" } diff --git a/vendor/golang.org/x/oauth2/google/default.go b/vendor/golang.org/x/oauth2/google/default.go index 6e5720699..069f1aac9 100644 --- a/vendor/golang.org/x/oauth2/google/default.go +++ b/vendor/golang.org/x/oauth2/google/default.go @@ -253,7 +253,7 @@ func FindDefaultCredentialsWithParams(ctx context.Context, params CredentialsPar if metadata.OnGCE() { id, _ := metadata.ProjectID() universeDomainProvider := func() (string, error) { - universeDomain, err := metadata.Get("universe/universe_domain") + universeDomain, err := metadata.Get("universe/universe-domain") if err != nil { if _, ok := err.(metadata.NotDefinedError); ok { // http.StatusNotFound (404) diff --git a/vendor/modules.txt b/vendor/modules.txt index 74ec7b68a..c36b41713 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -131,25 +131,24 @@ github.com/ProtonMail/go-crypto/openpgp/x448 ## explicit; go 1.26.5 github.com/argoproj-labs/argocd-operator/api/v1beta1 github.com/argoproj-labs/argocd-operator/common -# github.com/argoproj/argo-cd/gitops-engine v0.7.1-0.20250908182407-97ad5b59a627 => github.com/argoproj/argo-cd/gitops-engine v0.0.0-20260827090335-e258ee23c3e5 -## explicit; go 1.26.1 -github.com/argoproj/argo-cd/gitops-engine/internal/kubernetes_vendor/pkg/api/v1/endpoints -github.com/argoproj/argo-cd/gitops-engine/internal/kubernetes_vendor/pkg/util/hash -github.com/argoproj/argo-cd/gitops-engine/pkg/diff -github.com/argoproj/argo-cd/gitops-engine/pkg/diff/internal/fieldmanager -github.com/argoproj/argo-cd/gitops-engine/pkg/health -github.com/argoproj/argo-cd/gitops-engine/pkg/sync/common -github.com/argoproj/argo-cd/gitops-engine/pkg/sync/hook -github.com/argoproj/argo-cd/gitops-engine/pkg/sync/hook/helm -github.com/argoproj/argo-cd/gitops-engine/pkg/sync/resource -github.com/argoproj/argo-cd/gitops-engine/pkg/utils/io -github.com/argoproj/argo-cd/gitops-engine/pkg/utils/json -github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube -github.com/argoproj/argo-cd/gitops-engine/pkg/utils/kube/scheme -github.com/argoproj/argo-cd/gitops-engine/pkg/utils/text -github.com/argoproj/argo-cd/gitops-engine/pkg/utils/tracing -# github.com/argoproj/argo-cd/v3 v3.5.6 -## explicit; go 1.26.3 +# github.com/argoproj/argo-cd/gitops-engine/v3 v3.6.2 +## explicit; go 1.27.0 +github.com/argoproj/argo-cd/gitops-engine/v3/internal/kubernetes_vendor/pkg/api/v1/endpoints +github.com/argoproj/argo-cd/gitops-engine/v3/internal/kubernetes_vendor/pkg/util/hash +github.com/argoproj/argo-cd/gitops-engine/v3/pkg/diff +github.com/argoproj/argo-cd/gitops-engine/v3/pkg/health +github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/common +github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/hook +github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/hook/helm +github.com/argoproj/argo-cd/gitops-engine/v3/pkg/sync/resource +github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/io +github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/json +github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube +github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/kube/scheme +github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/text +github.com/argoproj/argo-cd/gitops-engine/v3/pkg/utils/tracing +# github.com/argoproj/argo-cd/v3 v3.6.2 +## explicit; go 1.27.0 github.com/argoproj/argo-cd/v3/assets github.com/argoproj/argo-cd/v3/common github.com/argoproj/argo-cd/v3/pkg/apis/application @@ -168,6 +167,7 @@ github.com/argoproj/argo-cd/v3/util/env github.com/argoproj/argo-cd/v3/util/exec github.com/argoproj/argo-cd/v3/util/git github.com/argoproj/argo-cd/v3/util/glob +github.com/argoproj/argo-cd/v3/util/hash github.com/argoproj/argo-cd/v3/util/helm github.com/argoproj/argo-cd/v3/util/http github.com/argoproj/argo-cd/v3/util/io @@ -196,8 +196,8 @@ github.com/blang/semver/v4 # github.com/bmatcuk/doublestar/v4 v4.10.4 ## explicit; go 1.16 github.com/bmatcuk/doublestar/v4 -# github.com/bombsimon/logrusr/v4 v4.1.0 -## explicit; go 1.17 +# github.com/bombsimon/logrusr/v4 v4.2.0 +## explicit; go 1.23 github.com/bombsimon/logrusr/v4 # github.com/bradleyfalzon/ghinstallation/v2 v2.19.0 ## explicit; go 1.25.0 @@ -272,10 +272,11 @@ github.com/davidmz/go-pageant # github.com/distribution/reference v0.6.0 ## explicit; go 1.20 github.com/distribution/reference -# github.com/dlclark/regexp2 v1.12.0 -## explicit; go 1.13 -github.com/dlclark/regexp2 -github.com/dlclark/regexp2/syntax +# github.com/dlclark/regexp2/v2 v2.13.0 +## explicit; go 1.25 +github.com/dlclark/regexp2/v2 +github.com/dlclark/regexp2/v2/helpers +github.com/dlclark/regexp2/v2/syntax # github.com/emicklei/go-restful/v3 v3.13.0 ## explicit; go 1.13 github.com/emicklei/go-restful/v3 @@ -385,12 +386,12 @@ github.com/go-logr/logr/slogr # github.com/go-logr/zapr v1.3.0 ## explicit; go 1.18 github.com/go-logr/zapr -# github.com/go-openapi/jsonpointer v1.0.0 -## explicit; go 1.25.0 +# github.com/go-openapi/jsonpointer v1.0.1 +## explicit; go 1.26.0 github.com/go-openapi/jsonpointer github.com/go-openapi/jsonpointer/jsonname -# github.com/go-openapi/jsonreference v1.0.0 -## explicit; go 1.25.0 +# github.com/go-openapi/jsonreference v1.0.2 +## explicit; go 1.26.0 github.com/go-openapi/jsonreference github.com/go-openapi/jsonreference/internal # github.com/go-openapi/swag v0.28.0 @@ -399,37 +400,37 @@ github.com/go-openapi/swag # github.com/go-openapi/swag/cmdutils v0.28.0 ## explicit; go 1.25.0 github.com/go-openapi/swag/cmdutils -# github.com/go-openapi/swag/conv v0.28.0 +# github.com/go-openapi/swag/conv v0.29.1 ## explicit; go 1.25.0 github.com/go-openapi/swag/conv # github.com/go-openapi/swag/fileutils v0.28.0 ## explicit; go 1.25.0 github.com/go-openapi/swag/fileutils -# github.com/go-openapi/swag/jsonutils v0.28.0 +# github.com/go-openapi/swag/jsonutils v0.29.1 ## explicit; go 1.25.0 github.com/go-openapi/swag/jsonutils github.com/go-openapi/swag/jsonutils/adapters github.com/go-openapi/swag/jsonutils/adapters/ifaces github.com/go-openapi/swag/jsonutils/adapters/stdlib/json -# github.com/go-openapi/swag/loading v0.28.0 +# github.com/go-openapi/swag/loading v0.29.1 ## explicit; go 1.25.0 github.com/go-openapi/swag/loading -# github.com/go-openapi/swag/mangling v0.28.0 +# github.com/go-openapi/swag/mangling v0.29.1 ## explicit; go 1.25.0 github.com/go-openapi/swag/mangling # github.com/go-openapi/swag/netutils v0.28.0 ## explicit; go 1.25.0 github.com/go-openapi/swag/netutils -# github.com/go-openapi/swag/pools v0.28.0 +# github.com/go-openapi/swag/pools v0.29.1 ## explicit; go 1.25.0 github.com/go-openapi/swag/pools -# github.com/go-openapi/swag/stringutils v0.28.0 +# github.com/go-openapi/swag/stringutils v0.29.1 ## explicit; go 1.25.0 github.com/go-openapi/swag/stringutils -# github.com/go-openapi/swag/typeutils v0.28.0 +# github.com/go-openapi/swag/typeutils v0.29.1 ## explicit; go 1.25.0 github.com/go-openapi/swag/typeutils -# github.com/go-openapi/swag/yamlutils v0.28.0 +# github.com/go-openapi/swag/yamlutils v0.29.1 ## explicit; go 1.25.0 github.com/go-openapi/swag/yamlutils # github.com/go-redis/cache/v9 v9.0.0 @@ -441,16 +442,11 @@ github.com/go-task/slim-sprig/v3 # github.com/gobuffalo/flect v1.0.3 ## explicit; go 1.16 github.com/gobuffalo/flect -# github.com/gobwas/glob v0.2.3 -## explicit +# github.com/gobwas/glob v1.0.0 +## explicit; go 1.22.0 github.com/gobwas/glob -github.com/gobwas/glob/compiler -github.com/gobwas/glob/match +github.com/gobwas/glob/internal/debug github.com/gobwas/glob/syntax -github.com/gobwas/glob/syntax/ast -github.com/gobwas/glob/syntax/lexer -github.com/gobwas/glob/util/runes -github.com/gobwas/glob/util/strings # github.com/gogo/protobuf v1.3.2 ## explicit; go 1.15 github.com/gogo/protobuf/proto @@ -716,7 +712,7 @@ github.com/prometheus/common/model github.com/prometheus/procfs github.com/prometheus/procfs/internal/fs github.com/prometheus/procfs/internal/util -# github.com/redis/go-redis/v9 v9.21.0 +# github.com/redis/go-redis/v9 v9.22.0 ## explicit; go 1.24 github.com/redis/go-redis/v9 github.com/redis/go-redis/v9/auth @@ -878,8 +874,8 @@ golang.org/x/net/internal/httpcommon golang.org/x/net/internal/httpsfv golang.org/x/net/internal/socks golang.org/x/net/proxy -# golang.org/x/oauth2 v0.36.0 -## explicit; go 1.25.0 +# golang.org/x/oauth2 v0.37.0 +## explicit; go 1.26.0 golang.org/x/oauth2 golang.org/x/oauth2/authhandler golang.org/x/oauth2/google @@ -937,8 +933,8 @@ golang.org/x/text/secure/bidirule golang.org/x/text/transform golang.org/x/text/unicode/bidi golang.org/x/text/unicode/norm -# golang.org/x/time v0.15.0 -## explicit; go 1.25.0 +# golang.org/x/time v0.16.0 +## explicit; go 1.26.0 golang.org/x/time/rate # golang.org/x/tools v0.52.0 ## explicit; go 1.26.0 @@ -968,7 +964,7 @@ golang.org/x/tools/internal/versions # gomodules.xyz/jsonpatch/v2 v2.5.0 ## explicit; go 1.20 gomodules.xyz/jsonpatch/v2 -# google.golang.org/genproto/googleapis/rpc v0.0.0-20260803160001-6ac0973c030d +# google.golang.org/genproto/googleapis/rpc v0.0.0-20260825221802-da73d73af1c5 ## explicit; go 1.25.0 google.golang.org/genproto/googleapis/rpc/status # google.golang.org/grpc v1.84.0 @@ -1556,12 +1552,12 @@ k8s.io/component-base/metrics/prometheus/feature k8s.io/component-base/metrics/prometheusextension k8s.io/component-base/version k8s.io/component-base/zpages/features -# k8s.io/component-helpers v0.36.6 => k8s.io/component-helpers v0.36.6 +# k8s.io/component-helpers v0.37.0 => k8s.io/component-helpers v0.36.6 ## explicit; go 1.26.0 k8s.io/component-helpers/auth/rbac/reconciliation k8s.io/component-helpers/auth/rbac/validation k8s.io/component-helpers/resource -# k8s.io/controller-manager v0.36.1 => k8s.io/controller-manager v0.36.6 +# k8s.io/controller-manager v0.37.0 => k8s.io/controller-manager v0.36.6 ## explicit; go 1.26.0 k8s.io/controller-manager/pkg/features # k8s.io/gengo/v2 v2.0.0-20260408192533-25e2208e0dc3 @@ -1583,7 +1579,7 @@ k8s.io/klog/v2/internal/severity k8s.io/klog/v2/internal/sloghandler k8s.io/klog/v2/internal/verbosity k8s.io/klog/v2/textlogger -# k8s.io/kube-aggregator v0.36.2 => k8s.io/kube-aggregator v0.36.6 +# k8s.io/kube-aggregator v0.37.0 => k8s.io/kube-aggregator v0.36.6 ## explicit; go 1.26.0 k8s.io/kube-aggregator/pkg/apis/apiregistration k8s.io/kube-aggregator/pkg/apis/apiregistration/v1 @@ -1645,7 +1641,7 @@ k8s.io/kubectl/pkg/util/storage k8s.io/kubectl/pkg/util/templates k8s.io/kubectl/pkg/util/term k8s.io/kubectl/pkg/validation -# k8s.io/kubernetes v1.36.1 => k8s.io/kubernetes v1.36.6 +# k8s.io/kubernetes v1.37.0 => k8s.io/kubernetes v1.36.6 ## explicit; go 1.26.0 k8s.io/kubernetes/pkg/api/legacyscheme k8s.io/kubernetes/pkg/api/v1/service