summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go
diff options
context:
space:
mode:
authorGlenn Vriesman <glenn.vriesman@gmail.com>2019-11-10 13:16:17 +0100
committerJesse Duffield <jessedduffield@gmail.com>2019-11-10 23:23:20 +1100
commit3f7e107d09a675b28783584d3643ee112206d905 (patch)
treed8622a53c93e2d89e9e3ddf1b0a647a28b6fa752 /vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go
parent22c0d79e2dbb8a6792664e1a56fa91f28592bbc0 (diff)
Vendor: Updated dependenciesv0.10.2
* Updated go.mod * Updated go.sum * Updated vendor packages Signed-off-by: Glenn Vriesman <glenn.vriesman@gmail.com>
Diffstat (limited to 'vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go')
-rw-r--r--vendor/github.com/aws/aws-sdk-go/internal/ini/comment_token.go35
1 files changed, 35 insertions, 0 deletions
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
+}