aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/pelletier/go-toml/token.go
diff options
context:
space:
mode:
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 {