From 3f7e107d09a675b28783584d3643ee112206d905 Mon Sep 17 00:00:00 2001 From: Glenn Vriesman Date: Sun, 10 Nov 2019 13:16:17 +0100 Subject: Vendor: Updated dependencies * Updated go.mod * Updated go.sum * Updated vendor packages Signed-off-by: Glenn Vriesman --- .../aws/aws-sdk-go/internal/ini/comment_token.go | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go (limited to 'vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go') diff --git a/vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go b/vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go new file mode 100644 index 000000000..0b76999ba --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go @@ -0,0 +1,35 @@ +package ini + +// isComment will return whether or not the next byte(s) is a +// comment. +func isComment(b []rune) bool { + if len(b) == 0 { + return false + } + + switch b[0] { + case ';': + return true + case '#': + return true + } + + return false +} + +// newCommentToken will create a comment token and +// return how many bytes were read. +func newCommentToken(b []rune) (Token, int, error) { + i := 0 + for ; i < len(b); i++ { + if b[i] == '\n' { + break + } + + if len(b)-i > 2 && b[i] == '\r' && b[i+1] == '\n' { + break + } + } + + return newToken(TokenComment, b[:i], NoneType), i, nil +} -- cgit v1.2.3