瀏覽代碼

Merge pull request #853 from slingamn/deps.1

upgrade some dependencies
tags/v2.1.0-rc1
Shivaram Lingamneni 4 年之前
父節點
當前提交
8692ede1f3
沒有連結到貢獻者的電子郵件帳戶。

+ 4
- 4
go.mod 查看文件

3
 go 1.14
3
 go 1.14
4
 
4
 
5
 require (
5
 require (
6
-	code.cloudfoundry.org/bytefmt v0.0.0-20190819182555-854d396b647c
6
+	code.cloudfoundry.org/bytefmt v0.0.0-20200131002437-cf55d5288a48
7
 	github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
7
 	github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
8
-	github.com/go-ldap/ldap/v3 v3.1.6
8
+	github.com/go-ldap/ldap/v3 v3.1.7
9
 	github.com/go-sql-driver/mysql v1.5.0
9
 	github.com/go-sql-driver/mysql v1.5.0
10
 	github.com/goshuirc/e-nfa v0.0.0-20160917075329-7071788e3940 // indirect
10
 	github.com/goshuirc/e-nfa v0.0.0-20160917075329-7071788e3940 // indirect
11
 	github.com/goshuirc/irc-go v0.0.0-20190713001546-05ecc95249a0
11
 	github.com/goshuirc/irc-go v0.0.0-20190713001546-05ecc95249a0
18
 	github.com/oragono/go-ident v0.0.0-20170110123031-337fed0fd21a
18
 	github.com/oragono/go-ident v0.0.0-20170110123031-337fed0fd21a
19
 	github.com/stretchr/testify v1.4.0 // indirect
19
 	github.com/stretchr/testify v1.4.0 // indirect
20
 	github.com/tidwall/buntdb v1.1.2
20
 	github.com/tidwall/buntdb v1.1.2
21
-	golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708
21
+	golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073
22
 	golang.org/x/text v0.3.2
22
 	golang.org/x/text v0.3.2
23
-	gopkg.in/yaml.v2 v2.2.5
23
+	gopkg.in/yaml.v2 v2.2.8
24
 )
24
 )

+ 8
- 0
go.sum 查看文件

1
 code.cloudfoundry.org/bytefmt v0.0.0-20190819182555-854d396b647c h1:2RuXx1+tSNWRjxhY0Bx52kjV2odJQ0a6MTbfTPhGAkg=
1
 code.cloudfoundry.org/bytefmt v0.0.0-20190819182555-854d396b647c h1:2RuXx1+tSNWRjxhY0Bx52kjV2odJQ0a6MTbfTPhGAkg=
2
 code.cloudfoundry.org/bytefmt v0.0.0-20190819182555-854d396b647c/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc=
2
 code.cloudfoundry.org/bytefmt v0.0.0-20190819182555-854d396b647c/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc=
3
+code.cloudfoundry.org/bytefmt v0.0.0-20200131002437-cf55d5288a48 h1:/EMHruHCFXR9xClkGV/t0rmHrdhX4+trQUcBqjwc9xE=
4
+code.cloudfoundry.org/bytefmt v0.0.0-20200131002437-cf55d5288a48/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc=
3
 github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
5
 github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
4
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
6
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
5
 github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ=
7
 github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ=
10
 github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
12
 github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
11
 github.com/go-ldap/ldap/v3 v3.1.6 h1:VTihvB7egSAvU6KOagaiA/EvgJMR2jsjRAVIho2ydBo=
13
 github.com/go-ldap/ldap/v3 v3.1.6 h1:VTihvB7egSAvU6KOagaiA/EvgJMR2jsjRAVIho2ydBo=
12
 github.com/go-ldap/ldap/v3 v3.1.6/go.mod h1:5Zun81jBTabRaI8lzN7E1JjyEl1g6zI6u9pd8luAK4Q=
14
 github.com/go-ldap/ldap/v3 v3.1.6/go.mod h1:5Zun81jBTabRaI8lzN7E1JjyEl1g6zI6u9pd8luAK4Q=
15
+github.com/go-ldap/ldap/v3 v3.1.7 h1:aHjuWTgZsnxjMgqzx0JHwNqz4jBYZTcNarbPFkW1Oww=
16
+github.com/go-ldap/ldap/v3 v3.1.7/go.mod h1:5Zun81jBTabRaI8lzN7E1JjyEl1g6zI6u9pd8luAK4Q=
13
 github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
17
 github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
14
 github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
18
 github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
15
 github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
19
 github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
61
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
65
 golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
62
 golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708 h1:pXVtWnwHkrWD9ru3sDxY/qFK/bfc0egRovX91EjWjf4=
66
 golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708 h1:pXVtWnwHkrWD9ru3sDxY/qFK/bfc0egRovX91EjWjf4=
63
 golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
67
 golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
68
+golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073 h1:xMPOj6Pz6UipU1wXLkrtqpHbR0AVFnyPEQq/wRWz9lM=
69
+golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
64
 golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
70
 golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
65
 golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ=
71
 golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ=
66
 golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
72
 golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
89
 gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
95
 gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
90
 gopkg.in/yaml.v2 v2.2.5 h1:ymVxjfMaHvXD8RqPRmzHHsB3VvucivSkIAvJFDI5O3c=
96
 gopkg.in/yaml.v2 v2.2.5 h1:ymVxjfMaHvXD8RqPRmzHHsB3VvucivSkIAvJFDI5O3c=
91
 gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
97
 gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
98
+gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
99
+gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=

+ 4
- 0
vendor/code.cloudfoundry.org/bytefmt/README.md 查看文件

13
 ```
13
 ```
14
 
14
 
15
 For documentation, please see http://godoc.org/code.cloudfoundry.org/bytefmt
15
 For documentation, please see http://godoc.org/code.cloudfoundry.org/bytefmt
16
+
17
+## Reporting issues and requesting features
18
+
19
+Please report all issues and feature requests in [cloudfoundry/diego-release](https://github.com/cloudfoundry/diego-release/issues).

+ 11
- 6
vendor/github.com/go-ldap/ldap/v3/ldap.go 查看文件

269
 }
269
 }
270
 
270
 
271
 func addDefaultLDAPResponseDescriptions(packet *ber.Packet) error {
271
 func addDefaultLDAPResponseDescriptions(packet *ber.Packet) error {
272
-	err := GetLDAPError(packet)
273
-	if err == nil {
274
-		return nil
272
+	resultCode := uint16(LDAPResultSuccess)
273
+	matchedDN := ""
274
+	description := "Success"
275
+	if err := GetLDAPError(packet); err != nil {
276
+		resultCode = err.(*Error).ResultCode
277
+		matchedDN = err.(*Error).MatchedDN
278
+		description = "Error Message"
275
 	}
279
 	}
276
-	packet.Children[1].Children[0].Description = "Result Code (" + LDAPResultCodeMap[err.(*Error).ResultCode] + ")"
277
-	packet.Children[1].Children[1].Description = "Matched DN (" + err.(*Error).MatchedDN + ")"
278
-	packet.Children[1].Children[2].Description = "Error Message"
280
+
281
+	packet.Children[1].Children[0].Description = "Result Code (" + LDAPResultCodeMap[resultCode] + ")"
282
+	packet.Children[1].Children[1].Description = "Matched DN (" + matchedDN + ")"
283
+	packet.Children[1].Children[2].Description = description
279
 	if len(packet.Children[1].Children) > 3 {
284
 	if len(packet.Children[1].Children) > 3 {
280
 		packet.Children[1].Children[3].Description = "Referral"
285
 		packet.Children[1].Children[3].Description = "Referral"
281
 	}
286
 	}

+ 1
- 1
vendor/golang.org/x/crypto/sha3/sha3_s390x.go 查看文件

112
 		if len(s.buf) == 0 && len(b) >= cap(s.buf) {
112
 		if len(s.buf) == 0 && len(b) >= cap(s.buf) {
113
 			// Hash the data directly and push any remaining bytes
113
 			// Hash the data directly and push any remaining bytes
114
 			// into the buffer.
114
 			// into the buffer.
115
-			remainder := len(s.buf) % s.rate
115
+			remainder := len(b) % s.rate
116
 			kimd(s.function, &s.a, b[:len(b)-remainder])
116
 			kimd(s.function, &s.a, b[:len(b)-remainder])
117
 			if remainder != 0 {
117
 			if remainder != 0 {
118
 				s.copyIntoBuf(b[len(b)-remainder:])
118
 				s.copyIntoBuf(b[len(b)-remainder:])

+ 15
- 2
vendor/golang.org/x/crypto/ssh/terminal/terminal.go 查看文件

7
 import (
7
 import (
8
 	"bytes"
8
 	"bytes"
9
 	"io"
9
 	"io"
10
+	"runtime"
10
 	"strconv"
11
 	"strconv"
11
 	"sync"
12
 	"sync"
12
 	"unicode/utf8"
13
 	"unicode/utf8"
939
 // readPasswordLine reads from reader until it finds \n or io.EOF.
940
 // readPasswordLine reads from reader until it finds \n or io.EOF.
940
 // The slice returned does not include the \n.
941
 // The slice returned does not include the \n.
941
 // readPasswordLine also ignores any \r it finds.
942
 // readPasswordLine also ignores any \r it finds.
943
+// Windows uses \r as end of line. So, on Windows, readPasswordLine
944
+// reads until it finds \r and ignores any \n it finds during processing.
942
 func readPasswordLine(reader io.Reader) ([]byte, error) {
945
 func readPasswordLine(reader io.Reader) ([]byte, error) {
943
 	var buf [1]byte
946
 	var buf [1]byte
944
 	var ret []byte
947
 	var ret []byte
947
 		n, err := reader.Read(buf[:])
950
 		n, err := reader.Read(buf[:])
948
 		if n > 0 {
951
 		if n > 0 {
949
 			switch buf[0] {
952
 			switch buf[0] {
953
+			case '\b':
954
+				if len(ret) > 0 {
955
+					ret = ret[:len(ret)-1]
956
+				}
950
 			case '\n':
957
 			case '\n':
951
-				return ret, nil
958
+				if runtime.GOOS != "windows" {
959
+					return ret, nil
960
+				}
961
+				// otherwise ignore \n
952
 			case '\r':
962
 			case '\r':
953
-				// remove \r from passwords on Windows
963
+				if runtime.GOOS == "windows" {
964
+					return ret, nil
965
+				}
966
+				// otherwise ignore \r
954
 			default:
967
 			default:
955
 				ret = append(ret, buf[0])
968
 				ret = append(ret, buf[0])
956
 			}
969
 			}

+ 2
- 2
vendor/golang.org/x/crypto/ssh/terminal/util_windows.go 查看文件

85
 	}
85
 	}
86
 	old := st
86
 	old := st
87
 
87
 
88
-	st &^= (windows.ENABLE_ECHO_INPUT)
89
-	st |= (windows.ENABLE_PROCESSED_INPUT | windows.ENABLE_LINE_INPUT | windows.ENABLE_PROCESSED_OUTPUT)
88
+	st &^= (windows.ENABLE_ECHO_INPUT | windows.ENABLE_LINE_INPUT)
89
+	st |= (windows.ENABLE_PROCESSED_OUTPUT | windows.ENABLE_PROCESSED_INPUT)
90
 	if err := windows.SetConsoleMode(windows.Handle(fd), st); err != nil {
90
 	if err := windows.SetConsoleMode(windows.Handle(fd), st); err != nil {
91
 		return nil, err
91
 		return nil, err
92
 	}
92
 	}

+ 11
- 7
vendor/gopkg.in/yaml.v2/.travis.yml 查看文件

1
 language: go
1
 language: go
2
 
2
 
3
 go:
3
 go:
4
-    - 1.4
5
-    - 1.5
6
-    - 1.6
7
-    - 1.7
8
-    - 1.8
9
-    - 1.9
10
-    - tip
4
+    - "1.4.x"
5
+    - "1.5.x"
6
+    - "1.6.x"
7
+    - "1.7.x"
8
+    - "1.8.x"
9
+    - "1.9.x"
10
+    - "1.10.x"
11
+    - "1.11.x"
12
+    - "1.12.x"
13
+    - "1.13.x"
14
+    - "tip"
11
 
15
 
12
 go_import_path: gopkg.in/yaml.v2
16
 go_import_path: gopkg.in/yaml.v2

+ 53
- 54
vendor/gopkg.in/yaml.v2/scannerc.go 查看文件

626
 func yaml_parser_fetch_more_tokens(parser *yaml_parser_t) bool {
626
 func yaml_parser_fetch_more_tokens(parser *yaml_parser_t) bool {
627
 	// While we need more tokens to fetch, do it.
627
 	// While we need more tokens to fetch, do it.
628
 	for {
628
 	for {
629
-		// Check if we really need to fetch more tokens.
630
-		need_more_tokens := false
631
-
632
-		if parser.tokens_head == len(parser.tokens) {
633
-			// Queue is empty.
634
-			need_more_tokens = true
635
-		} else {
636
-			// Check if any potential simple key may occupy the head position.
637
-			if !yaml_parser_stale_simple_keys(parser) {
629
+		if parser.tokens_head != len(parser.tokens) {
630
+			// If queue is non-empty, check if any potential simple key may
631
+			// occupy the head position.
632
+			head_tok_idx, ok := parser.simple_keys_by_tok[parser.tokens_parsed]
633
+			if !ok {
634
+				break
635
+			} else if valid, ok := yaml_simple_key_is_valid(parser, &parser.simple_keys[head_tok_idx]); !ok {
638
 				return false
636
 				return false
639
-			}
640
-
641
-			for i := range parser.simple_keys {
642
-				simple_key := &parser.simple_keys[i]
643
-				if simple_key.possible && simple_key.token_number == parser.tokens_parsed {
644
-					need_more_tokens = true
645
-					break
646
-				}
637
+			} else if !valid {
638
+				break
647
 			}
639
 			}
648
 		}
640
 		}
649
-
650
-		// We are finished.
651
-		if !need_more_tokens {
652
-			break
653
-		}
654
 		// Fetch the next token.
641
 		// Fetch the next token.
655
 		if !yaml_parser_fetch_next_token(parser) {
642
 		if !yaml_parser_fetch_next_token(parser) {
656
 			return false
643
 			return false
678
 		return false
665
 		return false
679
 	}
666
 	}
680
 
667
 
681
-	// Remove obsolete potential simple keys.
682
-	if !yaml_parser_stale_simple_keys(parser) {
683
-		return false
684
-	}
685
-
686
 	// Check the indentation level against the current column.
668
 	// Check the indentation level against the current column.
687
 	if !yaml_parser_unroll_indent(parser, parser.mark.column) {
669
 	if !yaml_parser_unroll_indent(parser, parser.mark.column) {
688
 		return false
670
 		return false
837
 		"found character that cannot start any token")
819
 		"found character that cannot start any token")
838
 }
820
 }
839
 
821
 
840
-// Check the list of potential simple keys and remove the positions that
841
-// cannot contain simple keys anymore.
842
-func yaml_parser_stale_simple_keys(parser *yaml_parser_t) bool {
843
-	// Check for a potential simple key for each flow level.
844
-	for i := range parser.simple_keys {
845
-		simple_key := &parser.simple_keys[i]
846
-
847
-		// The specification requires that a simple key
848
-		//
849
-		//  - is limited to a single line,
850
-		//  - is shorter than 1024 characters.
851
-		if simple_key.possible && (simple_key.mark.line < parser.mark.line || simple_key.mark.index+1024 < parser.mark.index) {
852
-
853
-			// Check if the potential simple key to be removed is required.
854
-			if simple_key.required {
855
-				return yaml_parser_set_scanner_error(parser,
856
-					"while scanning a simple key", simple_key.mark,
857
-					"could not find expected ':'")
858
-			}
859
-			simple_key.possible = false
822
+func yaml_simple_key_is_valid(parser *yaml_parser_t, simple_key *yaml_simple_key_t) (valid, ok bool) {
823
+	if !simple_key.possible {
824
+		return false, true
825
+	}
826
+
827
+	// The 1.2 specification says:
828
+	//
829
+	//     "If the ? indicator is omitted, parsing needs to see past the
830
+	//     implicit key to recognize it as such. To limit the amount of
831
+	//     lookahead required, the “:” indicator must appear at most 1024
832
+	//     Unicode characters beyond the start of the key. In addition, the key
833
+	//     is restricted to a single line."
834
+	//
835
+	if simple_key.mark.line < parser.mark.line || simple_key.mark.index+1024 < parser.mark.index {
836
+		// Check if the potential simple key to be removed is required.
837
+		if simple_key.required {
838
+			return false, yaml_parser_set_scanner_error(parser,
839
+				"while scanning a simple key", simple_key.mark,
840
+				"could not find expected ':'")
860
 		}
841
 		}
842
+		simple_key.possible = false
843
+		return false, true
861
 	}
844
 	}
862
-	return true
845
+	return true, true
863
 }
846
 }
864
 
847
 
865
 // Check if a simple key may start at the current position and add it if
848
 // Check if a simple key may start at the current position and add it if
879
 			possible:     true,
862
 			possible:     true,
880
 			required:     required,
863
 			required:     required,
881
 			token_number: parser.tokens_parsed + (len(parser.tokens) - parser.tokens_head),
864
 			token_number: parser.tokens_parsed + (len(parser.tokens) - parser.tokens_head),
865
+			mark:         parser.mark,
882
 		}
866
 		}
883
-		simple_key.mark = parser.mark
884
 
867
 
885
 		if !yaml_parser_remove_simple_key(parser) {
868
 		if !yaml_parser_remove_simple_key(parser) {
886
 			return false
869
 			return false
887
 		}
870
 		}
888
 		parser.simple_keys[len(parser.simple_keys)-1] = simple_key
871
 		parser.simple_keys[len(parser.simple_keys)-1] = simple_key
872
+		parser.simple_keys_by_tok[simple_key.token_number] = len(parser.simple_keys) - 1
889
 	}
873
 	}
890
 	return true
874
 	return true
891
 }
875
 }
900
 				"while scanning a simple key", parser.simple_keys[i].mark,
884
 				"while scanning a simple key", parser.simple_keys[i].mark,
901
 				"could not find expected ':'")
885
 				"could not find expected ':'")
902
 		}
886
 		}
887
+		// Remove the key from the stack.
888
+		parser.simple_keys[i].possible = false
889
+		delete(parser.simple_keys_by_tok, parser.simple_keys[i].token_number)
903
 	}
890
 	}
904
-	// Remove the key from the stack.
905
-	parser.simple_keys[i].possible = false
906
 	return true
891
 	return true
907
 }
892
 }
908
 
893
 
912
 // Increase the flow level and resize the simple key list if needed.
897
 // Increase the flow level and resize the simple key list if needed.
913
 func yaml_parser_increase_flow_level(parser *yaml_parser_t) bool {
898
 func yaml_parser_increase_flow_level(parser *yaml_parser_t) bool {
914
 	// Reset the simple key on the next level.
899
 	// Reset the simple key on the next level.
915
-	parser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{})
900
+	parser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{
901
+		possible:     false,
902
+		required:     false,
903
+		token_number: parser.tokens_parsed + (len(parser.tokens) - parser.tokens_head),
904
+		mark:         parser.mark,
905
+	})
916
 
906
 
917
 	// Increase the flow level.
907
 	// Increase the flow level.
918
 	parser.flow_level++
908
 	parser.flow_level++
928
 func yaml_parser_decrease_flow_level(parser *yaml_parser_t) bool {
918
 func yaml_parser_decrease_flow_level(parser *yaml_parser_t) bool {
929
 	if parser.flow_level > 0 {
919
 	if parser.flow_level > 0 {
930
 		parser.flow_level--
920
 		parser.flow_level--
931
-		parser.simple_keys = parser.simple_keys[:len(parser.simple_keys)-1]
921
+		last := len(parser.simple_keys) - 1
922
+		delete(parser.simple_keys_by_tok, parser.simple_keys[last].token_number)
923
+		parser.simple_keys = parser.simple_keys[:last]
932
 	}
924
 	}
933
 	return true
925
 	return true
934
 }
926
 }
1005
 	// Initialize the simple key stack.
997
 	// Initialize the simple key stack.
1006
 	parser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{})
998
 	parser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{})
1007
 
999
 
1000
+	parser.simple_keys_by_tok = make(map[int]int)
1001
+
1008
 	// A simple key is allowed at the beginning of the stream.
1002
 	// A simple key is allowed at the beginning of the stream.
1009
 	parser.simple_key_allowed = true
1003
 	parser.simple_key_allowed = true
1010
 
1004
 
1286
 	simple_key := &parser.simple_keys[len(parser.simple_keys)-1]
1280
 	simple_key := &parser.simple_keys[len(parser.simple_keys)-1]
1287
 
1281
 
1288
 	// Have we found a simple key?
1282
 	// Have we found a simple key?
1289
-	if simple_key.possible {
1283
+	if valid, ok := yaml_simple_key_is_valid(parser, simple_key); !ok {
1284
+		return false
1285
+
1286
+	} else if valid {
1287
+
1290
 		// Create the KEY token and insert it into the queue.
1288
 		// Create the KEY token and insert it into the queue.
1291
 		token := yaml_token_t{
1289
 		token := yaml_token_t{
1292
 			typ:        yaml_KEY_TOKEN,
1290
 			typ:        yaml_KEY_TOKEN,
1304
 
1302
 
1305
 		// Remove the simple key.
1303
 		// Remove the simple key.
1306
 		simple_key.possible = false
1304
 		simple_key.possible = false
1305
+		delete(parser.simple_keys_by_tok, simple_key.token_number)
1307
 
1306
 
1308
 		// A simple key cannot follow another simple key.
1307
 		// A simple key cannot follow another simple key.
1309
 		parser.simple_key_allowed = false
1308
 		parser.simple_key_allowed = false

+ 1
- 1
vendor/gopkg.in/yaml.v2/yaml.go 查看文件

89
 	return unmarshal(in, out, true)
89
 	return unmarshal(in, out, true)
90
 }
90
 }
91
 
91
 
92
-// A Decorder reads and decodes YAML values from an input stream.
92
+// A Decoder reads and decodes YAML values from an input stream.
93
 type Decoder struct {
93
 type Decoder struct {
94
 	strict bool
94
 	strict bool
95
 	parser *parser
95
 	parser *parser

+ 1
- 0
vendor/gopkg.in/yaml.v2/yamlh.go 查看文件

579
 
579
 
580
 	simple_key_allowed bool                // May a simple key occur at the current position?
580
 	simple_key_allowed bool                // May a simple key occur at the current position?
581
 	simple_keys        []yaml_simple_key_t // The stack of simple keys.
581
 	simple_keys        []yaml_simple_key_t // The stack of simple keys.
582
+	simple_keys_by_tok map[int]int         // possible simple_key indexes indexed by token_number
582
 
583
 
583
 	// Parser stuff
584
 	// Parser stuff
584
 
585
 

+ 4
- 4
vendor/modules.txt 查看文件

1
-# code.cloudfoundry.org/bytefmt v0.0.0-20190819182555-854d396b647c
1
+# code.cloudfoundry.org/bytefmt v0.0.0-20200131002437-cf55d5288a48
2
 ## explicit
2
 ## explicit
3
 code.cloudfoundry.org/bytefmt
3
 code.cloudfoundry.org/bytefmt
4
 # github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
4
 # github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
6
 github.com/docopt/docopt-go
6
 github.com/docopt/docopt-go
7
 # github.com/go-asn1-ber/asn1-ber v1.3.1
7
 # github.com/go-asn1-ber/asn1-ber v1.3.1
8
 github.com/go-asn1-ber/asn1-ber
8
 github.com/go-asn1-ber/asn1-ber
9
-# github.com/go-ldap/ldap/v3 v3.1.6
9
+# github.com/go-ldap/ldap/v3 v3.1.7
10
 ## explicit
10
 ## explicit
11
 github.com/go-ldap/ldap/v3
11
 github.com/go-ldap/ldap/v3
12
 # github.com/go-sql-driver/mysql v1.5.0
12
 # github.com/go-sql-driver/mysql v1.5.0
59
 github.com/tidwall/rtree/base
59
 github.com/tidwall/rtree/base
60
 # github.com/tidwall/tinyqueue v0.0.0-20180302190814-1e39f5511563
60
 # github.com/tidwall/tinyqueue v0.0.0-20180302190814-1e39f5511563
61
 github.com/tidwall/tinyqueue
61
 github.com/tidwall/tinyqueue
62
-# golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708
62
+# golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073
63
 ## explicit
63
 ## explicit
64
 golang.org/x/crypto/bcrypt
64
 golang.org/x/crypto/bcrypt
65
 golang.org/x/crypto/blowfish
65
 golang.org/x/crypto/blowfish
84
 golang.org/x/text/unicode/bidi
84
 golang.org/x/text/unicode/bidi
85
 golang.org/x/text/unicode/norm
85
 golang.org/x/text/unicode/norm
86
 golang.org/x/text/width
86
 golang.org/x/text/width
87
-# gopkg.in/yaml.v2 v2.2.5
87
+# gopkg.in/yaml.v2 v2.2.8
88
 ## explicit
88
 ## explicit
89
 gopkg.in/yaml.v2
89
 gopkg.in/yaml.v2

Loading…
取消
儲存