summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/pelletier/go-toml/token.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-09-01 16:01:23 +0200
committerGitHub <noreply@github.com>2020-09-01 10:01:23 -0400
commit3270e7a4435fceb757728dfc319fc04077a37caf (patch)
tree60dcaf02442e930c0b2c7bd7fe0f0b00190a402f /vendor/github.com/pelletier/go-toml/token.go
parent66843f22375b67a58746dac508b71200a96e68d6 (diff)
downloadgitea-3270e7a4435fceb757728dfc319fc04077a37caf.tar.gz
gitea-3270e7a4435fceb757728dfc319fc04077a37caf.zip
[Vendor] update go-swagger v0.21.0 -> v0.25.0 (#12670)
* Update go-swagger * vendor
Diffstat (limited to 'vendor/github.com/pelletier/go-toml/token.go')
-rw-r--r--vendor/github.com/pelletier/go-toml/token.go22
1 files changed, 6 insertions, 16 deletions
diff --git a/vendor/github.com/pelletier/go-toml/token.go b/vendor/github.com/pelletier/go-toml/token.go
index 1a90813466..6af4ec46bc 100644
--- a/vendor/github.com/pelletier/go-toml/token.go
+++ b/vendor/github.com/pelletier/go-toml/token.go
@@ -1,10 +1,6 @@
package toml
-import (
- "fmt"
- "strconv"
- "unicode"
-)
+import "fmt"
// Define tokens
type tokenType int
@@ -35,6 +31,7 @@ const (
tokenDoubleLeftBracket
tokenDoubleRightBracket
tokenDate
+ tokenLocalDate
tokenKeyGroup
tokenKeyGroupArray
tokenComma
@@ -68,7 +65,8 @@ var tokenTypeNames = []string{
")",
"]]",
"[[",
- "Date",
+ "LocalDate",
+ "LocalDate",
"KeyGroup",
"KeyGroupArray",
",",
@@ -95,14 +93,6 @@ func (tt tokenType) String() string {
return "Unknown"
}
-func (t token) Int() int {
- if result, err := strconv.Atoi(t.val); err != nil {
- panic(err)
- } else {
- return result
- }
-}
-
func (t token) String() string {
switch t.typ {
case tokenEOF:
@@ -119,7 +109,7 @@ func isSpace(r rune) bool {
}
func isAlphanumeric(r rune) bool {
- return unicode.IsLetter(r) || r == '_'
+ return 'a' <= r && r <= 'z' || 'A' <= r && r <= 'Z' || r == '_'
}
func isKeyChar(r rune) bool {
@@ -134,7 +124,7 @@ func isKeyStartChar(r rune) bool {
}
func isDigit(r rune) bool {
- return unicode.IsNumber(r)
+ return '0' <= r && r <= '9'
}
func isHexDigit(r rune) bool {