From 8c12c6939aab9106db14ec2d11d983bc5b29fb2c Mon Sep 17 00:00:00 2001 From: Niall Sheridan Date: Sun, 7 Jul 2019 21:33:44 +0100 Subject: Switch to modules --- .../golang.org/x/text/secure/bidirule/bidirule.go | 336 --------------------- 1 file changed, 336 deletions(-) delete mode 100644 vendor/golang.org/x/text/secure/bidirule/bidirule.go (limited to 'vendor/golang.org/x/text/secure/bidirule/bidirule.go') diff --git a/vendor/golang.org/x/text/secure/bidirule/bidirule.go b/vendor/golang.org/x/text/secure/bidirule/bidirule.go deleted file mode 100644 index e2b70f7..0000000 --- a/vendor/golang.org/x/text/secure/bidirule/bidirule.go +++ /dev/null @@ -1,336 +0,0 @@ -// Copyright 2016 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package bidirule implements the Bidi Rule defined by RFC 5893. -// -// This package is under development. The API may change without notice and -// without preserving backward compatibility. -package bidirule - -import ( - "errors" - "unicode/utf8" - - "golang.org/x/text/transform" - "golang.org/x/text/unicode/bidi" -) - -// This file contains an implementation of RFC 5893: Right-to-Left Scripts for -// Internationalized Domain Names for Applications (IDNA) -// -// A label is an individual component of a domain name. Labels are usually -// shown separated by dots; for example, the domain name "www.example.com" is -// composed of three labels: "www", "example", and "com". -// -// An RTL label is a label that contains at least one character of class R, AL, -// or AN. An LTR label is any label that is not an RTL label. -// -// A "Bidi domain name" is a domain name that contains at least one RTL label. -// -// The following guarantees can be made based on the above: -// -// o In a domain name consisting of only labels that satisfy the rule, -// the requirements of Section 3 are satisfied. Note that even LTR -// labels and pure ASCII labels have to be tested. -// -// o In a domain name consisting of only LDH labels (as defined in the -// Definitions document [RFC5890]) and labels that satisfy the rule, -// the requirements of Section 3 are satisfied as long as a label -// that starts with an ASCII digit does not come after a -// right-to-left label. -// -// No guarantee is given for other combinations. - -// ErrInvalid indicates a label is invalid according to the Bidi Rule. -var ErrInvalid = errors.New("bidirule: failed Bidi Rule") - -type ruleState uint8 - -const ( - ruleInitial ruleState = iota - ruleLTR - ruleLTRFinal - ruleRTL - ruleRTLFinal - ruleInvalid -) - -type ruleTransition struct { - next ruleState - mask uint16 -} - -var transitions = [...][2]ruleTransition{ - // [2.1] The first character must be a character with Bidi property L, R, or - // AL. If it has the R or AL property, it is an RTL label; if it has the L - // property, it is an LTR label. - ruleInitial: { - {ruleLTRFinal, 1 << bidi.L}, - {ruleRTLFinal, 1<